(function(ng,xa){typeof exports=="object"&&typeof module=="object"?module.exports=xa():typeof define=="function"&&define.amd?define("agCharts",[],xa):typeof exports=="object"?exports.agCharts=xa():ng.agCharts=xa()})(this,()=>{var ng={},xa={exports:ng};if(typeof Doe>"u")var Doe=function(t){throw new Error("Unknown module: "+t)};var Ym=Object.defineProperty,RL=Object.getOwnPropertyDescriptor,mH=Object.getOwnPropertyNames,yH=Object.prototype.hasOwnProperty,$s=(e,t)=>{for(var i in t)Ym(e,i,{get:t[i],enumerable:!0})},xH=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of mH(t))!yH.call(e,n)&&n!==i&&Ym(e,n,{get:()=>t[n],enumerable:!(s=RL(t,n))||s.enumerable});return e},bH=e=>xH(Ym({},"__esModule",{value:!0}),e),g=(e,t,i,s)=>{for(var n=s>1?void 0:s?RL(t,i):t,o=e.length-1,a;o>=0;o--)(a=e[o])&&(n=(s?a(t,i,n):a(n))||n);return s&&n&&Ym(t,i,n),n},zL={};$s(zL,{AG_CHARTS_LOCALE_EN_US:()=>dT,AgCharts:()=>To,AgChartsCommunityModule:()=>RZ,AgChartsEnterpriseModule:()=>Soe,AgTooltipAnchorToType:()=>UL,AgTooltipPlacementType:()=>YL,AllCartesianAxesModule:()=>AB,AllCartesianModule:()=>jB,AllCartesianSeriesModule:()=>GB,AllCommunityModule:()=>uA,AllEnterpriseModule:()=>ML,AllGaugeModule:()=>LF,AllMapSeriesModule:()=>B_,AllPolarModule:()=>h_,AngleCategoryAxisModule:()=>EF,AngleNumberAxisModule:()=>RF,AnimationModule:()=>am,AnnotationsModule:()=>uw,AreaSeriesModule:()=>Gk,BandHighlightModule:()=>pw,BarSeriesModule:()=>tv,BoxPlotSeriesModule:()=>kw,BubbleSeriesModule:()=>Zk,CandlestickSeriesModule:()=>nS,CartesianChartModule:()=>hi,CategoryAxisModule:()=>EE,ChartToolbarModule:()=>Qv,ChordSeriesModule:()=>KE,ConeFunnelSeriesModule:()=>zB,ContextMenuModule:()=>xm,CrosshairModule:()=>yw,DataSourceModule:()=>Jv,DonutSeriesModule:()=>TE,ErrorBarsModule:()=>xw,FinancialChartModule:()=>XB,FlashOnUpdateModule:()=>Kz,FunnelSeriesModule:()=>HB,GradientLegendModule:()=>IS,GroupedCategoryAxisModule:()=>RE,HeatmapSeriesModule:()=>Ew,HistogramSeriesModule:()=>qk,LegendModule:()=>Fk,LicenseManager:()=>voe,LineSeriesModule:()=>av,LinearGaugeModule:()=>mF,LocaleModule:()=>cA,LogAxisModule:()=>PE,MapLineBackgroundSeriesModule:()=>m_,MapLineSeriesModule:()=>M_,MapMarkerSeriesModule:()=>N_,MapShapeBackgroundSeriesModule:()=>O_,MapShapeSeriesModule:()=>V_,ModuleRegistry:()=>ye,NavigatorModule:()=>sC,NightingaleSeriesModule:()=>XF,NumberAxisModule:()=>hA,OhlcSeriesModule:()=>oS,OrdinalTimeAxisModule:()=>DC,PieSeriesModule:()=>OE,PolarChartModule:()=>el,PyramidSeriesModule:()=>eR,RadarAreaSeriesModule:()=>t_,RadarLineSeriesModule:()=>i_,RadialBarSeriesModule:()=>l_,RadialColumnSeriesModule:()=>c_,RadialGaugeModule:()=>CF,RadiusCategoryAxisModule:()=>HF,RadiusNumberAxisModule:()=>GF,RangeAreaSeriesModule:()=>hS,RangeBarSeriesModule:()=>dS,RangesModule:()=>cC,SankeySeriesModule:()=>aR,ScatterSeriesModule:()=>tA,ScrollbarModule:()=>pB,SparklinePresetModule:()=>xE,StatusBarModule:()=>pC,SunburstSeriesModule:()=>pR,SyncModule:()=>mC,TimeAxisModule:()=>dA,TreemapSeriesModule:()=>xR,UnitTimeAxisModule:()=>zE,VERSION:()=>de,WaterfallSeriesModule:()=>iC,ZoomModule:()=>Yp,_ModuleSupport:()=>N,_Scene:()=>lv,_Theme:()=>cv,_Util:()=>hv,_Widget:()=>qf,time:()=>Aj}),xa.exports=bH(zL);var VL={};$s(VL,{AGGREGATION_INDEX_UNSET:()=>El,AGGREGATION_INDEX_X_MAX:()=>Xs,AGGREGATION_INDEX_X_MIN:()=>Zs,AGGREGATION_INDEX_Y_MAX:()=>Qs,AGGREGATION_INDEX_Y_MIN:()=>qs,AGGREGATION_MAX_POINTS:()=>hN,AGGREGATION_MIN_RANGE:()=>Nr,AGGREGATION_SPAN:()=>jn,AGGREGATION_THRESHOLD:()=>wa,AbstractModuleInstance:()=>ri,ActionOnSet:()=>Ze,AdjacencyListGraph:()=>LM,AgDocument:()=>bM,AsyncAwaitQueue:()=>jg,BASE_FONT_SIZE:()=>Uo,BREAK_TRANSFORM_CHAIN:()=>Ag,BaseProperties:()=>q,Border:()=>Pr,CANVAS_HEIGHT:()=>vN,CANVAS_TO_BUFFER_DEFAULTS:()=>SN,CANVAS_WIDTH:()=>bN,CARTESIAN_AXIS_TYPE:()=>eM,CARTESIAN_POSITION:()=>J0,CallbackCache:()=>xM,ChangeDetectableProperties:()=>dh,ChartAxisDirection:()=>_y,ChartUpdateType:()=>Gn,CleanupRegistry:()=>ot,Color:()=>Ne,ConfiguredCanvasMixin:()=>MN,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Yd,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>qd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Qd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Jd,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>eu,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Zd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Xd,DEFAULT_CAPTION_ALIGNMENT:()=>Or,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Ta,DEFAULT_FIBONACCI_STROKES:()=>Ud,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>rs,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ts,DEFAULT_POLAR_SERIES_STROKE:()=>Bg,DEFAULT_SHADOW_COLOUR:()=>Na,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Fg,DEFAULT_TEXTBOX_COLOR:()=>su,DEFAULT_TEXTBOX_FILL:()=>tu,DEFAULT_TEXTBOX_STROKE:()=>iu,DEFAULT_TEXT_ANNOTATION_COLOR:()=>_g,DEFAULT_TOOLBAR_POSITION:()=>nu,DIRECTION_SWAP_AXES:()=>$d,Debug:()=>ve,DebugMetrics:()=>yo,DeclaredSceneChangeDetection:()=>Ee,DeclaredSceneObjectChangeDetection:()=>Au,Deprecated:()=>AN,DeprecatedAndRenamedTo:()=>wN,EllipsisChar:()=>Wc,ErrorType:()=>w0,EventEmitter:()=>zn,FILL_GRADIENT_BLANK_DEFAULTS:()=>aM,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>lM,FILL_GRADIENT_LINEAR_DEFAULTS:()=>Vi,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>rM,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>Ny,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>Ly,FILL_GRADIENT_RADIAL_DEFAULTS:()=>Rg,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Yo,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>Oy,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>Ty,FILL_IMAGE_BLANK_DEFAULTS:()=>dM,FILL_IMAGE_DEFAULTS:()=>it,FILL_PATTERN_BLANK_DEFAULTS:()=>cM,FILL_PATTERN_DEFAULTS:()=>tt,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>hM,FILL_PATTERN_KEYED_DEFAULTS:()=>Ey,FILL_PATTERN_SINGLE_DEFAULTS:()=>Py,FONT_SIZE:()=>Q0,FONT_SIZE_RATIO:()=>li,IS_DARK_THEME:()=>zl,InterpolationProperties:()=>Pl,LABEL_BOXING_DEFAULTS:()=>Ye,LEGEND_CONTAINER_THEME:()=>By,LRUCache:()=>og,LineSplitter:()=>gr,Logger:()=>W,MARKER_SERIES_HIGHLIGHT_STYLE:()=>Kd,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Ys,MementoCaretaker:()=>Fy,ModuleRegistry:()=>ye,ModuleType:()=>QS,ObserveChanges:()=>Rt,PALETTE_ALT_DOWN_FILL:()=>qy,PALETTE_ALT_DOWN_STROKE:()=>Zy,PALETTE_ALT_NEUTRAL_FILL:()=>Qy,PALETTE_ALT_NEUTRAL_STROKE:()=>Jy,PALETTE_ALT_UP_FILL:()=>Xy,PALETTE_ALT_UP_STROKE:()=>Yy,PALETTE_DOWN_FILL:()=>$y,PALETTE_DOWN_STROKE:()=>jy,PALETTE_NEUTRAL_FILL:()=>Uy,PALETTE_NEUTRAL_STROKE:()=>Ky,PALETTE_UP_FILL:()=>Wy,PALETTE_UP_STROKE:()=>Gy,PART_WHOLE_HIGHLIGHT_STYLE:()=>zy,POLAR_AXIS_SHAPE:()=>iM,POLAR_AXIS_TYPE:()=>tM,Padding:()=>Vr,ParallelStateMachine:()=>$M,PolarZIndexMap:()=>fM,PropertiesArray:()=>Bi,Property:()=>m,ProxyOnWrite:()=>yN,ProxyProperty:()=>Gt,ProxyPropertyOnWrite:()=>St,SAFE_FILLS_OPERATION:()=>Cy,SAFE_FILL_OPERATION:()=>oM,SAFE_RANGE2_OPERATION:()=>Nl,SAFE_STROKE_FILL_OPERATION:()=>Lr,SEGMENTATION_DEFAULTS:()=>Tl,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>Vy,SKIP_JS_BUILTINS:()=>Iy,ScaleAlignment:()=>JS,SceneArrayChangeDetection:()=>ku,SceneChangeDetection:()=>K,SceneObjectChangeDetection:()=>Hr,SceneRefChangeDetection:()=>rf,SeriesContentZIndexMap:()=>gM,SeriesZIndexMap:()=>pM,SimpleCache:()=>kN,SpanJoin:()=>pD,StateMachine:()=>he,StateMachineProperty:()=>Je,TRIPLE_EQ:()=>ph,TextMeasurer:()=>xx,TickIntervals:()=>Jg,TrimCharsRegex:()=>g0,TrimEdgeGuard:()=>Ld,UNIT_MAX:()=>Ai,UNIT_MIN:()=>yn,UnknownError:()=>gg,ValidationError:()=>Da,Vec2:()=>H,Vec4:()=>Se,Vertex:()=>NM,WeakCache:()=>kM,ZIndexMap:()=>uM,addEscapeEventListener:()=>dx,addFakeTransformToInstanceProperty:()=>m,addMouseCloseListener:()=>EM,addObserverToInstanceProperty:()=>vy,addOverrideFocusVisibleEventListener:()=>zM,addTouchCloseListener:()=>RM,addTransformToInstanceProperty:()=>Ar,aggregationBucketForDatum:()=>dN,aggregationDatumMatchesIndex:()=>uN,aggregationDomain:()=>ci,aggregationIndexForXRatio:()=>zg,aggregationRangeFittingPoints:()=>Ca,aggregationXRatioForDatumIndex:()=>th,aggregationXRatioForXValue:()=>Wn,and:()=>We,angleBetween:()=>Xo,angularPadding:()=>ix,appendEllipsis:()=>iy,applySkiaPatches:()=>IN,arcDistanceSquared:()=>CN,areScalingEqual:()=>ia,array:()=>dn,arrayLength:()=>br,arrayOf:()=>xe,arrayOfDefs:()=>Ft,arraysEqual:()=>Vn,assignIfNotStrictlyEqual:()=>Ay,attachDescription:()=>Ve,attachListener:()=>mt,autoSizedLabelOptionsDefs:()=>kr,barHighlightOptionsDef:()=>vo,bezier2DDistance:()=>hD,bezier2DExtrema:()=>lD,boolean:()=>E,borderOptionsDef:()=>Sr,boxCollides:()=>nx,boxContains:()=>Wg,boxEmpty:()=>DM,boxesEqual:()=>$g,buildDateFormatter:()=>uh,cachedTextMeasurer:()=>et,calcLineHeight:()=>Fn,calculatePlacement:()=>yx,callWithContext:()=>ls,callback:()=>at,callbackDefs:()=>Xe,callbackOf:()=>Ki,ceilTo:()=>O0,checkDatum:()=>oD,circularSliceArray:()=>mo,clamp:()=>se,clampArray:()=>Jc,clipLines:()=>YM,clipSpanX:()=>Rx,collapseSpanToPoint:()=>af,collectAggregationLevels:()=>pN,color:()=>J,colorStopsOrderValidator:()=>gy,colorUnion:()=>Ls,commonChartOptionsDefs:()=>we,commonSeriesOptionsDefs:()=>qe,commonSeriesThemeableOptionsDefs:()=>Ke,compactAggregationIndices:()=>Rl,compareDates:()=>ax,computeExtremesAggregation:()=>Tr,computeExtremesAggregationPartial:()=>Vg,constant:()=>Ce,contextMenuItemsArray:()=>Ig,countFractionDigits:()=>Uc,countLines:()=>I0,createAggregationIndices:()=>La,createButton:()=>Iu,createCanvasContext:()=>IM,createCheckbox:()=>xD,createDeprecationWarning:()=>cx,createElement:()=>ke,createElementId:()=>Rr,createIcon:()=>SD,createId:()=>gi,createIdsGenerator:()=>sf,createNumberFormatter:()=>uy,createSelect:()=>bD,createSvgElement:()=>jt,createTextArea:()=>vD,createTicks:()=>ah,date:()=>ns,dateToNumber:()=>Zi,dateTruncationForDomain:()=>tf,datesSortOrder:()=>lx,debounce:()=>ny,decodeIntervalValue:()=>JM,deepClone:()=>Pe,deepFreeze:()=>Us,defaultEpoch:()=>wx,defined:()=>le,definedZoomState:()=>Lt,diffArrays:()=>AM,distribute:()=>s0,downloadUrl:()=>UM,dropFirstWhile:()=>t0,dropLastWhile:()=>i0,durationDay:()=>jl,durationHour:()=>Gl,durationMinute:()=>Br,durationMonth:()=>Sx,durationSecond:()=>oh,durationWeek:()=>ZM,durationYear:()=>pu,easeIn:()=>oT,easeInOut:()=>aT,easeInOutQuad:()=>cT,easeInQuad:()=>rT,easeOut:()=>Ea,easeOutQuad:()=>lT,encodedToTimestamp:()=>Fr,enterpriseRegistry:()=>zi,entries:()=>rt,errorBarOptionsDefs:()=>jd,errorBarThemeableOptionsDefs:()=>Gd,estimateTickCount:()=>Nx,evaluateBezier:()=>ta,every:()=>Y0,expandLegendPosition:()=>Ol,extent:()=>Qo,extractDecoratedProperties:()=>K0,extractDomain:()=>Md,fillCssOptionsDef:()=>Ns,fillGradientDefaults:()=>xg,fillImageDefaults:()=>vg,fillOptionsDef:()=>ie,fillPatternDefaults:()=>bg,findMaxIndex:()=>ko,findMaxValue:()=>ox,findMinIndex:()=>ih,findMinMax:()=>kt,findMinValue:()=>xN,findRangeExtent:()=>Aa,first:()=>Ks,flush:()=>u0,focusCursorAtEnd:()=>Qm,fontFamilyFull:()=>Sg,fontOptionsDef:()=>$e,fontWeight:()=>_d,formatNumber:()=>CM,formatObjectValidator:()=>j0,formatPercent:()=>wM,formatValue:()=>Ao,fromPairs:()=>Z0,generateUUID:()=>cu,geoJson:()=>Fl,getAngleRatioRadians:()=>SM,getAttribute:()=>Bl,getDOMMatrix:()=>Zm,getDocument:()=>kl,getElementBBox:()=>m0,getIconClassNames:()=>fr,getImage:()=>a0,getLastFocus:()=>fx,getMaxInnerRectSize:()=>ex,getMidpointsForIndices:()=>Zo,getMinOuterRectSize:()=>fN,getOffscreenCanvas:()=>rg,getPath:()=>Dy,getPath2D:()=>kd,getPrevNextKeys:()=>lu,getResizeObserver:()=>r0,getSequentialColors:()=>fn,getTickTimeInterval:()=>vu,getWindow:()=>Go,googleFont:()=>my,gradientColorStops:()=>mg,gradientStrict:()=>yg,graphemeSegments:()=>Ma,greaterThan:()=>as,groupBy:()=>Id,guardTextEdges:()=>S0,hasNoModifiers:()=>ru,hasRequiredInPath:()=>Cl,highlightOptionsDef:()=>fy,htmlElement:()=>cy,inRange:()=>N0,initRovingTabIndex:()=>px,insertListItemsSorted:()=>mx,instanceOf:()=>JL,interpolationOptionsDefs:()=>kg,intervalAgo:()=>tD,intervalCeil:()=>XM,intervalEpoch:()=>Wl,intervalExtent:()=>kx,intervalFloor:()=>tn,intervalHierarchy:()=>bu,intervalMilliseconds:()=>Yi,intervalNext:()=>Ix,intervalPrevious:()=>qM,intervalRange:()=>mn,intervalRangeCount:()=>Qg,intervalRangeNumeric:()=>QM,intervalRangeStartIndex:()=>Ax,intervalStep:()=>Jo,intervalUnit:()=>wo,inverseEaseOut:()=>DD,isArray:()=>Ae,isBetweenAngles:()=>Js,isBoolean:()=>x0,isButtonClickEvent:()=>gx,isColor:()=>v0,isContinuous:()=>ch,isDate:()=>Cs,isDecoratedObject:()=>Cg,isDefined:()=>vt,isDenseInterval:()=>$l,isDirectionRtl:()=>$c,isDocumentFragment:()=>l0,isElement:()=>Xm,isEmptyObject:()=>Td,isEnumKey:()=>ZL,isEnumValue:()=>XL,isFiniteNumber:()=>je,isFunction:()=>jo,isGradientFill:()=>qt,isGradientFillArray:()=>YN,isGradientOrPatternFill:()=>ZN,isHTMLElement:()=>Ad,isHtmlElement:()=>ey,isImageFill:()=>ea,isInputPending:()=>y0,isInteger:()=>T0,isKeyOf:()=>Al,isNegative:()=>Kc,isNode:()=>lg,isNumber:()=>gt,isNumberEqual:()=>Be,isNumberObject:()=>nD,isObject:()=>me,isObjectLike:()=>Nd,isObjectWithProperty:()=>X0,isObjectWithStringProperty:()=>q0,isPatternFill:()=>Un,isPlainObject:()=>Ge,isPointLabelDatum:()=>dD,isProperties:()=>Qc,isRegExp:()=>b0,isScaleValid:()=>Kl,isSegmentTruncated:()=>ug,isString:()=>Pt,isStringFillArray:()=>rD,isStringObject:()=>Tx,isSymbol:()=>Od,isTextTruncated:()=>mr,isTimeInterval:()=>iD,isTimeIntervalUnit:()=>sD,isTruncated:()=>D0,isUnitTimeCategoryScaling:()=>_r,isValidDate:()=>Sa,isValidNumberFormat:()=>E0,iterate:()=>Cr,joinFormatted:()=>yr,jsonApply:()=>au,jsonDiff:()=>Kn,jsonPropertyCompare:()=>OM,jsonWalk:()=>Oa,kebabCase:()=>A0,labelBoxOptionsDef:()=>Hn,legendPositionValidator:()=>Hd,lessThan:()=>os,lessThanOrEqual:()=>L0,levenshteinDistance:()=>k0,lineDashOptionsDef:()=>ae,lineDistanceSquared:()=>Er,lineHighlightOptionsDef:()=>vr,lineSegmentOptions:()=>V0,lineSegmentation:()=>B0,linear:()=>MD,linearGaugeSeriesOptionsDef:()=>ka,linearGaugeSeriesThemeableOptionsDef:()=>Pg,linearGaugeTargetOptionsDef:()=>Tg,linearPoints:()=>gD,listDecoratedProperties:()=>wr,lowestGranularityForInterval:()=>Su,lowestGranularityUnitForTicks:()=>ef,lowestGranularityUnitForValue:()=>Mu,makeAccessibleClickListener:()=>RN,mapValues:()=>Zc,markerOptionsDefs:()=>So,markerStyleOptionsDefs:()=>Ir,measureTextSegments:()=>en,memo:()=>nh,merge:()=>Wd,mergeArrayDefaults:()=>My,mergeDefaults:()=>ce,modulus:()=>P0,multiSeriesHighlightOptionsDef:()=>_t,nearestSquared:()=>hu,nearestSquaredInContainer:()=>_M,nextPowerOf2:()=>eh,niceTicksDomain:()=>Lx,normalisedExtentWithMetadata:()=>sh,normalisedTimeExtentWithMetadata:()=>Ug,normalizeAngle180:()=>Gg,normalizeAngle360:()=>Qe,normalizeAngle360FromDegrees:()=>qo,normalizeAngle360Inclusive:()=>ou,number:()=>$,numberFormatValidator:()=>gn,numberMin:()=>dy,numberRange:()=>C0,object:()=>xr,objectsEqual:()=>Ht,objectsEqualWith:()=>Sy,optionsDefs:()=>Et,or:()=>Ie,padding:()=>_n,paddingOptions:()=>F0,parseColor:()=>f0,parseNumberFormat:()=>fg,partialAssign:()=>Ng,pause:()=>sx,pick:()=>Lg,placeLabels:()=>uD,positiveNumber:()=>P,positiveNumberNonZero:()=>un,preserveArabicJoining:()=>sy,previousPowerOf2:()=>Hy,radialGaugeSeriesOptionsDef:()=>Xc,radialGaugeSeriesThemeableOptionsDef:()=>Eg,radialGaugeTargetOptionsDef:()=>Og,range:()=>lh,rangeValidator:()=>Mg,ratio:()=>oe,readIntegratedWrappedValue:()=>Ox,record:()=>d0,required:()=>j,rescaleSpan:()=>hh,rescaleVisibleRange:()=>Zg,resetIds:()=>VN,rotatePoint:()=>tx,roundTo:()=>Vd,safeCall:()=>ay,seriesLabelOptionsDefs:()=>ft,seriesTooltipRangeValidator:()=>H0,setAttribute:()=>Fe,setAttributes:()=>Do,setDocument:()=>n0,setElementBBox:()=>dg,setElementStyle:()=>Io,setElementStyles:()=>MM,setPath:()=>ky,setWindow:()=>o0,shadowOptionsDefs:()=>$o,shallowClone:()=>_l,shapeHighlightOptionsDef:()=>It,shapeSegmentOptions:()=>z0,shapeSegmentation:()=>Ia,shapeValidator:()=>Mr,simpleMemorize:()=>Ui,simpleMemorize2:()=>zr,smoothPoints:()=>mD,solveBezier:()=>of,sortAndUniqueDates:()=>rx,sortBasedOnArray:()=>e0,spanRange:()=>cs,splitBezier2D:()=>Du,stepPoints:()=>fD,stopPageScrolling:()=>VM,strictObjectKeys:()=>Ko,strictUnion:()=>zd,string:()=>L,stringLength:()=>hy,stringifyValue:()=>Pd,strokeOptionsDef:()=>X,textOrSegments:()=>pn,themeOperator:()=>Fd,throttle:()=>oy,tickFormat:()=>Cx,tickStep:()=>rh,timeInterval:()=>Yc,timeIntervalUnit:()=>Ll,toArray:()=>Dd,toDegrees:()=>vM,toFontString:()=>ty,toIterable:()=>U0,toPlainText:()=>Oe,toRadians:()=>lt,toTextString:()=>Dt,toolbarButtonOptionsDefs:()=>Dr,tooltipOptionsDefs:()=>Ue,tooltipOptionsDefsWithArea:()=>W0,transformIntegratedCategoryValue:()=>nf,truncateLine:()=>Hl,typeUnion:()=>wl,undocumented:()=>Q,unguardTextEdges:()=>M0,union:()=>U,unionSymbol:()=>Ed,unique:()=>ag,validate:()=>ki,withTimeout:()=>mN,without:()=>ee,wrapLines:()=>uu,wrapText:()=>Pa,wrapTextOrSegments:()=>du,wrapTextSegments:()=>vx});var QS=(e=>(e.Chart="chart",e.Axis="axis",e.Series="series",e.Plugin="plugin",e.AxisPlugin="axis:plugin",e.SeriesPlugin="series:plugin",e.Preset="preset",e))(QS||{});function Md(e){return e.domain}var JS=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(JS||{}),zn=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),i.size===0&&this.events.delete(e))}emit(e,t){const i=this.events.get(e);if(i)for(const s of i)s(t)}clear(e){e?this.events.delete(e):this.events.clear()}},og=class{constructor(e){if(this.maxCacheSize=e,this.store=new Map,e<=0)throw new Error("LRUCache size must be greater than 0")}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){return this.store.set(e,t),this.store.size>this.maxCacheSize&&this.store.delete(this.store.keys().next().value),t}clear(){this.store.clear()}},ve={};$s(ve,{Time:()=>wH,check:()=>wd,create:()=>jL,inDevelopmentMode:()=>WL});function Dd(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function ag(e){return Array.from(new Set(e))}function Id(e,t){return e.reduce((i,s)=>{const n=t(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function Vn(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i{const o=i.get(s)??1/0,a=i.get(n)??1/0;return o-a})}function t0(e,t){let i=0;for(;i=0&&t(e[i]);)i-=1;const s=e.length-1-i;s!==0&&e.splice(e.length-s,s)}function s0(e,t,i){const s=[e],n=Math.round((t-e)/(i-1));if(n>0)for(let o=e+n;o=i-1);o+=n);return s.push(t),s}var hn={};typeof globalThis.window<"u"&&(hn.window=globalThis.window),typeof document<"u"?hn.document=document:typeof globalThis.global<"u"&&(hn.document=globalThis.document);function kl(e){return e?hn.document?.[e]:hn.document}function Go(e){return e?hn.window?.[e]:hn.window}function n0(e){hn.document=e}function o0(e){hn.window=e}function rg(){return hn.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function kd(){return hn.window?.Path2D??globalThis.Path2D}function Zm(){return hn.window?.DOMMatrix??globalThis.DOMMatrix}function a0(){return hn.window?.Image??globalThis.Image}function r0(){return hn.window?.ResizeObserver??globalThis.ResizeObserver}var BL=1,vH=11;function lg(e){return e!=null&&typeof e.nodeType=="number"}function Xm(e){return e!=null&&e.nodeType===BL}function l0(e){return e!=null&&e.nodeType===vH}function Ad(e){return e!=null&&e.nodeType===BL&&"style"in e}var W={};$s(W,{error:()=>FL,errorOnce:()=>MH,log:()=>qm,logGroup:()=>HL,reset:()=>DH,table:()=>SH,warn:()=>ba,warnOnce:()=>Bn});var c0=new Set;function qm(...e){console.log(...e)}function ba(e,...t){console.warn(`AG Charts - ${e}`,...t)}function FL(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function SH(...e){console.table(...e)}function _L(e,t,i){let s;e instanceof Error?s=e.message:typeof e=="string"?s=e:typeof e=="object"?s=JSON.stringify(e):s=String(e);const n=`${t}: ${s}`;c0.has(n)||(i(e),c0.add(n))}function Bn(e,...t){_L(e,"Logger.warn",i=>ba(i,...t))}function MH(e,...t){_L(e,"Logger.error",i=>FL(i,...t))}function DH(){c0.clear()}function IH(e){return typeof e=="object"&&e!==null&&"then"in e}function HL(e,t){console.groupCollapsed(e);let i=!0;try{const s=t();return IH(s)?(i=!1,s.finally(()=>{console.groupEnd()})):s}finally{i&&console.groupEnd()}}var kH=2e3,GL=Date.now();function AH(){const e=Date.now()-GL;if(e>kH){const t=(Math.floor(e/100)/10).toFixed(1);qm(`**** ${t}s since last log message ****`)}GL=Date.now()}function jL(...e){return Object.assign((...i)=>{wd(...e)&&(typeof i[0]=="function"&&(i=Dd(i[0]())),AH(),qm(...i))},{check:()=>wd(...e),group:(i,s)=>wd(...e)?HL(i,s):s()})}function wd(...e){return e.length===0&&e.push(!0),Dd(Go("agChartsDebug")).some(i=>e.includes(i))}function WL(e){if(wd("dev"))return e()}function wH(e,t={}){const{logResult:i=!0,logStack:s=!1,logArgs:n=!1,logData:o}=t;return function(a,r,l){const c=l.value;l.value=function(...h){const d=performance.now(),u=c.apply(this,h),f={duration:performance.now()-d};return i&&(f.result=u),n&&(f.args=h),s&&(f.stack=new Error("Stack trace for timing debug").stack),o&&(f.logData=o(this)),qm(e,f),u}}}var yo={};$s(yo,{flush:()=>u0,record:()=>d0});var h0=new Map;function d0(e,t){wd("scene:stats:verbose")&&h0.set(e,t)}function u0(){const e=Object.fromEntries(h0);return h0.clear(),e}var zi={},ye={};$s(ye,{RegistryMode:()=>$L,getAxisModule:()=>PH,getChartModule:()=>EH,getPresetModule:()=>RH,getSeriesModule:()=>zH,hasModule:()=>NH,isEnterprise:()=>BH,isIntegrated:()=>FH,isModuleType:()=>Cd,isUmd:()=>_H,listModules:()=>TH,listModulesByType:()=>OH,register:()=>p0,registerModules:()=>CH,reset:()=>LH,setRegistryMode:()=>VH});var $L=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))($L||{}),cg=new Set,va=new Map;function KL(e){if(va.set(e.name,e),e.dependencies)for(const t of e.dependencies)p0(t)}function p0(e){const t=va.get(e.name);if(!t){KL(e);return}if(t.version===e.version){!t.enterprise&&e.enterprise&&KL(e);return}throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${t.version} vs ${e.version}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(` `))}function CH(e){for(const t of e.flat())p0(t)}function LH(){cg.clear(),va.clear()}function NH(e){return va.has(e)}function*TH(){for(const e of va.values())yield e}function*OH(e){for(const t of va.values())Cd(e,t)&&(yield t)}function PH(e){const t=va.get(e);if(Cd("axis",t))return t}function EH(e){const t=va.get(e);if(Cd("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function RH(e){const t=va.get(e);if(Cd("preset",t))return t}function zH(e){const t=va.get(e);if(Cd("series",t))return t}function VH(e){cg.add(e)}function BH(){return cg.has("enterprise")}function FH(){return cg.has("integrated")}function _H(){return cg.has("umd")}function Cd(e,t){return t?.type===e}var ot=class{constructor(){this.callbacks=new Set}flush(){for(const e of this.callbacks)e();this.callbacks.clear()}merge(e){for(const t of e.callbacks)this.callbacks.add(t)}register(...e){for(const t of e)t&&this.callbacks.add(t)}},ri=class{constructor(){this.cleanup=new ot}destroy(){this.cleanup.flush()}},HH=void 0,GH=void 0;GH=HH;var jH=void 0,WH=void 0;WH=jH;var UL=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(UL||{}),YL=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(YL||{}),$H=void 0,KH=void 0;KH=$H;var UH=void 0,YH=void 0;YH=UH;var Wc="\u2026",gr=/\r?\n/g,Ld="\u200B",g0=/[\s.,;:-]{1,5}$/,hg;function f0(e){if(hg==null){const i=Go("Option");hg=new i().style}hg.color=e;const t=hg.color||null;return hg.color="",t}function $c(e){return e?.ownerDocument.defaultView?.getComputedStyle(e).direction==="rtl"}function dg(e,t){if(!e)return;const{x:i,y:s,width:n,height:o}=ZH(t);Jm(e.style,"width",n),Jm(e.style,"height",o),Jm(e.style,"left",i),Jm(e.style,"top",s)}function m0(e){const t=Number.parseFloat(e.style.width),i=Number.parseFloat(e.style.height),s=Number.parseFloat(e.style.left),n=Number.parseFloat(e.style.top),o=Number.isFinite(t)?t:e.offsetWidth,a=Number.isFinite(i)?i:e.offsetHeight,r=Number.isFinite(s)?s:e.offsetLeft,l=Number.isFinite(n)?n:e.offsetTop;return{x:r,y:l,width:o,height:a}}function Qm(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const{ownerDocument:t}=e,i=t.createRange();i.setStart(e.lastChild,e.lastChild.textContent.length),i.setEnd(e.lastChild,e.lastChild.textContent.length);const s=t.defaultView?.getSelection();s?.removeAllRanges(),s?.addRange(i)}function y0(){const e=Go("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function fr(e){return`ag-charts-icon ag-charts-icon-${e}`}function ZH(e){let{x:t,y:i,width:s,height:n}=e;return(s==null||s>0)&&(n==null||n>0)?e:(t!=null&&s!=null&&s<0&&(s=-s,t=t-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:t,y:i,width:s,height:n})}function Jm(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}function vt(e){return e!=null}function Ae(e){return Array.isArray(e)}function x0(e){return typeof e=="boolean"}function Cs(e){return e instanceof Date}function Sa(e){return Cs(e)&&!Number.isNaN(Number(e))}function b0(e){return e instanceof RegExp}function jo(e){return typeof e=="function"}function me(e){return typeof e=="object"&&e!==null&&!Ae(e)}function Nd(e){return Ae(e)||Ge(e)}function Ge(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function Td(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function Pt(e){return typeof e=="string"}function gt(e){return typeof e=="number"}function je(e){return Number.isFinite(e)}function ey(e){return e!=null&&e.nodeType===1&&"style"in e}function ZL(e,t){return Pt(t)&&Object.keys(e).includes(t)}function XL(e,t){return Object.values(e).includes(t)}function Od(e){return typeof e=="symbol"}function v0(e){return Pt(e)&&(e==="none"||f0(e)!=null)}function Al(e,t){return e in t}function ty({fontSize:e,fontStyle:t,fontWeight:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i===700?"bold":i} `),n+=`${e}px`,n+=` ${s}`,n}function Fn(e,t=1.15){return Math.round(e*t)}function Dt(e){return String(e??"")}function iy(e){return sy(e.replace(g0,""))+Wc}var XH=new Set([1575,1577,1583,1584,1585,1586,1608]);function qH(e){return e>=1568&&e<=1610&&!XH.has(e)}function sy(e){if(!e)return e;const t=e.codePointAt(e.length-1);return qH(t)?e+"\u200D":e}function S0(e){return Ld+e+Ld}function M0(e){return e.replaceAll(Ld,"")}function D0(e){return Ae(e)?ug(e.at(-1)):mr(Dt(e))}function mr(e){return e.endsWith(Wc)}function ug(e){return Dt(e?.text).endsWith(Wc)}var qL=typeof Intl<"u"&&typeof Intl.Segmenter=="function"?new Intl.Segmenter(void 0,{granularity:"grapheme"}):void 0;function Ma(e){return qL?Array.from(qL.segment(e),t=>t.segment):Array.from(e)}function yr(e,t="and",i=String,s=1/0){if(e.length===0)return"";if(e.length===1)return i(e[0]);e=e.map(i);const n=e.pop();if(e.length>=s){const o=e.length-(s-1);return`${e.slice(0,s-1).join(", ")}, and ${o} more ${t} ${n}`}return`${e.join(", ")} ${t} ${n}`}function Pd(e,t=1/0){if(typeof e=="number"){if(Number.isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function I0(e){let t=1;for(let i=0;ic),r=new Array(n+1);for(let l=1;l<=o;l++){r[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;r[c]=Math.min(a[c]+1,r[c-1]+1,a[c-1]+h)}[a,r]=[r,a]}return a[n]}function A0(e){return e.replaceAll(QH,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var QH=/[A-Z]+(?![a-z])|[A-Z]/g;function Oe(e,t=""){return e==null?t:Ae(e)?e.map(i=>Dt(i.text)).join(""):Pt(e)?e:String(e)}function ny(e,t=0,i){const{leading:s=!1,trailing:n=!0,maxWait:o=1/0}=i??{};let a,r;if(or=null,t),e(...c);return}let h=t;if(o!==1/0&&r){const d=Date.now()-r;t>o-d&&(h=o-d)}clearTimeout(a),r??(r=Date.now()),a=setTimeout(()=>{r=null,n&&e(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(a),r=null}})}function oy(e,t,i){const{leading:s=!0,trailing:n=!0}=i??{};let o,a,r=!1;function l(){n&&a?(o=setTimeout(l,t),e(...a)):r=!1,a=null}function c(...h){r?a=h:(r=!0,o=setTimeout(l,t),s?e(...h):a=h)}return Object.assign(c,{cancel(){clearTimeout(o),r=!1,a=null}})}function ay(e,t,i=""){try{return e(...t)}catch(s){const n=i?` \`${i}\``:"";Bn(`Uncaught exception in user callback${n}`,s)}}var xo=Symbol("description"),QL=Symbol("required"),ry=Symbol("marked"),ly=Symbol("undocumented"),Ed=Symbol("union"),JH=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"],["show","visible","enabled"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(s=>s!==i)));return e},new Map),w0=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(w0||{});function pg(e,t){return je(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var Da=class{constructor(e,t,i,s,n){this.type=e,this.description=t,this.value=i,this.path=s,this.key=n}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?pg(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:i}=this;return t==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${Pd(i,50)}\`; expecting ${e}, ignoring.`}},gg=class extends Da{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${pg(this.altPath??this.path,this.key)}\``}getPostfix(){const e=yr(eG(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function ki(e,t,i=""){if(!me(e))return{cleared:null,invalid:[new Da("required","an object",e,i)]};const s={},n=[],o=new Set(Object.keys(e)),a=[];if(Ed in t){const r=Object.keys(t),l=t[Ed];if(e.type!=null&&r.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,d=ki(h,t[c],i);Object.assign(s,{type:c},d.cleared);for(const u of d.invalid)u.setUnionType(c,i);n.push(...d.invalid)}else{const c=yr(r,"or",h=>`'${h}'`);n.push(new Da("required",`a keyword such as ${c}`,e.type,i,"type"))}return{cleared:s,invalid:n}}for(const r of Object.keys(t)){const l=t[r],c=l[QL],h=e[r];if(o.delete(r),h===void 0&&(l[ly]||a.push(r),!c))continue;const d=pg(i,r);if(jo(l)){const p=l(h,{options:e,path:d});if(typeof p=="object"){if(n.push(...p.invalid),p.valid){s[r]=p.cleared;continue}else if(Cl(p.invalid,d))continue}else if(p){s[r]=h;continue}n.push(new Da(c?"required":"invalid",l[xo],h,i,r))}else{const u=ki(h,l,d);u.cleared!=null&&(s[r]=u.cleared),n.push(...u.invalid)}}for(const r of o){const l=e[r];l!==void 0&&n.push(new gg(a,l,i,r))}return{cleared:s,invalid:n}}function eG(e,t,i=2){const s=e.toLowerCase(),n=JH.get(s);return t.filter(o=>{const a=o.toLowerCase();return n?.has(o)===!0||a.includes(s)||k0(s,a)<=i})}function Ve(e,t){if(jo(e)){let s=function(n,o){return e(n,o)};var i=s;return s[xo]=t,s}else return{...e,[xo]:t}}function j(e){return Object.assign(jo(e)?(t,i)=>e(t,i):Et(e),{[QL]:!0,[xo]:e[xo]})}function Q(e){return Object.assign(jo(e)?(t,i)=>e(t,i):Et(e),{[ly]:!0,[xo]:e[xo]})}var Et=(e,t="an object",i=!1)=>Ve((s,n)=>{const o=ki(s,e,n.path),a=!Cl(o.invalid,n.path);return{valid:a,cleared:a||!i?o.cleared:null,invalid:o.invalid}},t),wl=(e,t,i)=>({...e,[xo]:t,[Ed]:i}),We=(...e)=>Ve((t,i)=>{const s=[];for(const n of e){const o=n(t,i);if(typeof o=="object"){if(s.push(...o.invalid),!o.valid)return{valid:!1,cleared:t,invalid:s};t=o.cleared}else if(!o)return!1}return{valid:!0,cleared:t,invalid:s}},yr(e.filter(t=>!t[ly]).map(t=>t[xo]).filter(vt),"and")),Ie=(...e)=>Ve((t,i)=>{for(const s of e){const n=s(t,i);if(typeof n=="object"?n.valid:n)return n}return!1},yr(e.filter(t=>!t[ly]).map(t=>t[xo]).filter(vt),"or")),Rd=e=>je(e)||Sa(e),tG=e=>Cs(e)||(je(e)||Pt(e))&&Sa(new Date(e)),dn=Ve(Ae,"an array"),E=Ve(x0,"a boolean"),at=Ve(jo,"a function"),J=Ve(v0,"a color string"),ns=Ve(tG,"a date"),le=Ve(vt,"a defined value"),$=Ve(je,"a number"),xr=Ve(me,"an object"),L=Ve(Pt,"a string"),cy=Ve(ey,"an html element"),br=(e,t=1/0)=>{let i;return t===1/0?i=`an array of at least ${e} items`:e===t?i=`an array of exactly ${e} items`:e===0?i=`an array of no more than ${t} items`:i=`an array of at least ${e} and no more than ${t} items`,Ve(s=>Ae(s)&&s.length>=e&&s.length<=t,i)},hy=(e,t=1/0)=>{let i;return t===1/0?i=`a string of at least ${e} characters`:e===t?i=`an string of exactly ${e} characters`:e===0?i=`an string of no more than ${t} characters`:i=`an string of at least ${e} and no more than ${t} characters`,Ve(s=>Pt(s)&&s.length>=e&&s.length<=t,i)},dy=(e,t=!0)=>Ve(i=>je(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),C0=(e,t)=>Ve(i=>je(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),P=dy(0),un=dy(0,!1),oe=C0(0,1),os=e=>Ve((t,{options:i})=>!Rd(t)||!Rd(i[e])||tVe((t,{options:i})=>!Rd(t)||!Rd(i[e])||t<=i[e],`the value to be less than or equal to \`${e}\``),as=e=>Ve((t,{options:i})=>!Rd(t)||!Rd(i[e])||t>i[e],`the value to be greater than \`${e}\``);function U(...e){me(e[0])&&(e=Object.values(e[0]));const t=yr(e,"or",i=>`'${i}'`);return Ve(i=>e.includes(i),`a keyword such as ${t}`)}function zd(){return U}var Ce=e=>Ve(t=>e===t,`the value ${JSON.stringify(e)}`),JL=(e,t)=>Ve(i=>i instanceof e,t??`an instance of ${e.name}`),xe=(e,t,i=!0)=>Ve((s,n)=>{if(!Ae(s))return!1;let o=i;const a=[],r=[],l=c=>{o=i?o&&c:o||c};if(s.length===0)return{valid:!0,cleared:a,invalid:r};for(let c=0;cVe((i,s)=>{if(!Ae(i))return!1;const n=[],o=[];for(let a=0;aVe((i,s)=>{if(!jo(i))return!1;if(ry in i)return!0;const n=t??e[xo];return{valid:!0,cleared:Object.assign((...a)=>{const r=ay(i,a);if(r==null)return;const l=e(r,{options:r,path:""});if(typeof l=="object"){if(eN(l,s,n,r),l.valid)return l.cleared}else{if(l)return r;Bn(`Callback \`${s.path}\` returned an invalid value \`${Pd(r,50)}\`; expecting ${n}, ignoring.`)}},{[ry]:!0}),invalid:[]}},"a function"),Xe=(e,t="an object")=>Ve((i,s)=>{if(!jo(i))return!1;if(ry in i)return!0;const n=t;return{valid:!0,cleared:Object.assign((...a)=>{const r=ay(i,a,s.path);if(r==null)return;const l=ki(r,e);return eN(l,s,n,r),l.cleared},{[ry]:!0}),invalid:[]}},"a function");function Cl(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function eN(e,t,i,s){if(e.invalid.length!==0){if(Ae(s)){const n=i??e.invalid[0]?.description??"a valid value";return Bn(`Callback \`${t.path}\` returned an invalid value \`${Pd(s,50)}\`; expecting ${n}, ignoring.`)}for(const n of e.invalid){if(n instanceof gg)return Bn(`Callback \`${t.path}\` returned an unknown property \`${pg(n.path,n.key)}\`${n.getPostfix()}`);const o=Pd(n.value,50);Bn(n.key?`Callback \`${t.path}\` returned an invalid property \`${pg(n.path,n.key)}\`: \`${o}\`; expecting ${n.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${o}\`; expecting ${i??n.description}, ignoring.`)}}}function se(e,t,i){return Math.min(i,Math.max(e,t))}function N0(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function Be(e,t,i=1e-10){return e===t||Math.abs(e-t)=1e21){let n;[t,n]=t.split("e"),n!=null&&(i=Number(n))}const s=t.split(".")[1]?.length??0;return Math.max(s-i,0)}var tN=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,iN=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function E0(e){if(!Pt(e))return!1;const t=iN.exec(e);return tN.test(t?t[2]:e)}function fg(e){let t,i;const s=iN.exec(e);s&&([,t,e,i]=s);const n=tN.exec(e);if(!n){Bn(`The number formatter is invalid: ${e}`);return}const[,o,a,r,l,c,h,d,u,p,f]=n;return{fill:o,align:a,sign:r,symbol:l,zero:c,width:Number.parseInt(h),comma:d,precision:Number.parseInt(u),trim:!!p,type:f,prefix:t,suffix:i}}function uy(e){const t=typeof e=="string"?fg(e):e;if(t==null)return;const{fill:i,align:s,sign:n="-",symbol:o,zero:a,width:r,comma:l,type:c,prefix:h="",suffix:d="",precision:u}=t;let{trim:p}=t;const f=u==null||Number.isNaN(u);let y;if(!c)y=bo.g,p=!0;else if(c in bo&&c in Bd)y=f?Bd[c]:bo[c];else if(c in bo)y=bo[c];else if(c in Bd)y=Bd[c];else throw new Error(`The number formatter type is invalid: ${c}`);const x=c?6:12;let b;f||(b=u);let v=s,S=i;return a&&(S??(S="0"),v??(v="=")),(M,D)=>{let I;b!=null?I=b:c==="f"||c==="%"?I=D??x:c?I=x:I=D??x;let k=y(M,I);p&&(k=nG(k)),l&&(k=oG(k,l));const A=cG(o,c),w=A?.length??0;A&&(k=`${A}${k}`),c==="s"&&(k=`${k}${aG(M)}`),(c==="%"||c==="p")&&(k=`${k}%`);const{value:C,prefixLength:T}=rG(M,k,n),O=T+w;let V=C;return r!=null&&!Number.isNaN(r)&&(V=lG(V,r,S??" ",v,O)),V=`${h}${V}${d}`,V}}var Bd={b:e=>py(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>py(e).toString(8),x:e=>py(e).toString(16),X:e=>Bd.x(e).toUpperCase(),n:e=>Bd.d(e),"%":e=>`${py(e*100).toFixed(0)}`},bo={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>bo.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>bo.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&sbo.g(e,t).toUpperCase(),n:(e,t)=>bo.g(e,t),p:(e,t)=>bo.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const o=10**n;return(Math.round(i/o)*o).toFixed()},s:(e,t)=>{const i=oN(e);return bo.r(e/10**i,t)},"%":(e,t)=>bo.f(e*100,t)},sN=-24,nN=24,iG={[sN]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[nN]:"Y"},sG="\u2212";function py(e){return Math.floor(Math.abs(e))}function nG(e){if(!e.endsWith("0")||!e.includes("."))return e;let t=e.length-1;for(;t>0;)if(e[t]=="0")t-=1;else if(e[t]=="."){t-=1;break}else break;return e.substring(0,t+1)}function oG(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),n=e.substring(i);for(let o=s.length-3;o>0;o-=3)s.splice(o,0,t);return`${s.join("")}${n}`}function aG(e){return iG[oN(e)]}function oN(e){return se(sN,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,nN)}function rG(e,t,i=""){if(i==="(")return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let s="";return e<0?s=sG:i==="+"?s="+":i===" "&&(s=" "),{value:`${s}${t}`,prefixLength:s.length}}function lG(e,t,i=" ",s=">",n=0){const o=t-e.length;if(o<=0)return e;const a=i.repeat(o);if(s==="="){const r=Math.min(Math.max(n,0),e.length),l=e.slice(0,r),c=e.slice(r);return`${l}${a}${c}`}if(s===">"||!s)return a+e;if(s==="<")return`${e}${a}`;if(s==="^"){const r=Math.ceil(o/2),l=Math.floor(o/2);return`${i.repeat(r)}${e}${i.repeat(l)}`}return a+e}function cG(e,t){if(e==="#")switch(t){case"b":return"0b";case"o":return"0o";case"x":return"0x";case"X":return"0X";default:return""}return e??""}var Fd=e=>{if(!me(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},hG=Et({color:J,stop:oe},""),gy=Ve(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop{let i;if(typeof e=="string")_0.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Da("invalid",`a legend placement string: ["${_0.join('", "')}"]`,e,t.path)));else{const{cleared:s,invalid:n}=ki(e,gG);i={valid:n.length===0,cleared:s,invalid:n}}return i},"a legend position object or placement string"),Mr=Ie(U("circle","cross","diamond","heart","plus","pin","square","star","triangle"),at),aN=U("never","always","hyphenate","on-space"),yy=U("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Mg=Ie(P,U("exact","nearest","area")),H0=Ie(P,U("exact","nearest")),pn=Ie(L,$,ns,Ft({text:j(L),...$e},"text segments array")),Dg={enabled:E,text:pn,textAlign:U("left","center","right"),wrapping:U("never","always","hyphenate","on-space"),spacing:P,maxWidth:P,maxHeight:P,...$e};Dg.padding=Q(P),Dg.truncate=Q(E);var xy={enabled:E,text:pn,renderer:Ki(Ie(L,cy))},G0=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],rN={type:U("action","separator"),showOn:U("always","series-area","series-node","legend-item"),label:j(L),enabled:E,action:at,items:(e,t)=>Ig(e,t)};rN.iconUrl=Q(L);var fG=Et(rN),mG=Ve((e,t)=>{let i;return typeof e=="string"?G0.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new Da("invalid",`a context menu item string alias: ["${G0.join('", "')}"]`,e,t.path))):i=fG(e,t),i},`a context menu item object or string alias: [${G0.join(", ")}]`),Ig=xe(mG,"a menu items array",!1),Dr={label:L,ariaLabel:L,tooltip:L,iconPosition:U("before","after"),icon:U("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","chevron-filled-down","chevron-right","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},Wo=Ie(L,Ki(pn)),j0=Et({x:Wo,y:Wo,angle:Wo,radius:Wo,size:Wo,color:Wo,label:Wo,secondaryLabel:Wo,sectorLabel:Wo,calloutLabel:Wo,legendItem:Wo}),gn=Ve(E0,"a valid number format string"),Ll=U("millisecond","second","minute","hour","day","month","year"),lN={unit:j(Ll),step:un,epoch:ns,utc:E};lN.every=at;var Yc=Et(lN,"a time interval object"),we={width:P,height:P,minWidth:P,minHeight:P,suppressFieldDotNotation:E,title:Dg,subtitle:Dg,footnote:Dg,padding:{top:P,right:P,bottom:P,left:P},seriesArea:{border:Sr,clip:E,cornerRadius:$,padding:_n},legend:{enabled:E,position:Hd,orientation:U("horizontal","vertical"),maxWidth:P,maxHeight:P,spacing:P,border:Sr,cornerRadius:$,padding:_n,fill:Ls,fillOpacity:oe,preventHidingAll:E,reverseOrder:E,toggleSeries:E,item:{marker:{size:P,shape:Mr,padding:P,strokeWidth:P},line:{length:P,strokeWidth:P},label:{maxLength:P,formatter:at,...$e},maxWidth:P,paddingX:P,paddingY:P,showSeriesStroke:E},pagination:{marker:{size:P,shape:Mr,padding:P},activeStyle:{...ie,...X},inactiveStyle:{...ie,...X},highlightStyle:{...ie,...X},label:$e},listeners:{legendItemClick:at,legendItemDoubleClick:at}},gradientLegend:{enabled:E,position:Hd,spacing:P,reverseOrder:E,border:Sr,cornerRadius:$,padding:_n,fill:Ls,fillOpacity:oe,gradient:{preferredLength:P,thickness:P},scale:{label:{...$e,minSpacing:P,format:gn,formatter:at},padding:P,interval:{step:$,values:dn,minSpacing:We(P,os("maxSpacing")),maxSpacing:We(P,as("minSpacing"))}}},listeners:{seriesNodeClick:at,seriesNodeDoubleClick:at,seriesVisibilityChange:at,activeChange:at,click:at,doubleClick:at,annotations:at,zoom:at},loadGoogleFonts:E,highlight:{drawingMode:U("overlay","cutout"),range:U("tooltip","node")},overlays:{loading:xy,noData:xy,noVisibleSeries:xy,unsupportedBrowser:xy},tooltip:{enabled:E,showArrow:E,pagination:E,delay:P,range:Mg,wrapping:aN,mode:U("single","shared","compact"),position:{anchorTo:U("pointer","node","chart"),placement:Ie(yy,xe(yy)),xOffset:$,yOffset:$}},animation:le,flashOnUpdate:le,contextMenu:le,context:()=>!0,dataSource:{getData:at},keyboard:{enabled:E,tabIndex:$,initialFocus:zd()("data-start","data-end","viewport-start","viewport-end")},touch:{dragAction:U("none","drag","hover")},ranges:{enabled:E,enableOutOfRange:E,position:U("top-left","top","top-right","bottom-left","bottom","bottom-right"),spacing:P,button:{...Ns,...X,textColor:J,...$e,cornerRadius:P,padding:_n,active:{...Ns,stroke:X.stroke,textColor:J},disabled:{...Ns,stroke:X.stroke,textColor:J},hover:{...Ns,stroke:X.stroke,textColor:J}},dropdown:{visible:U("auto","always","never"),...Ns,...X,textColor:J,...$e,cornerRadius:P,padding:_n,active:{...Ns,stroke:X.stroke,textColor:J},disabled:{...Ns,stroke:X.stroke,textColor:J},hover:{...Ns,stroke:X.stroke,textColor:J}},gap:P,...Ns,...X,textColor:J,...$e,cornerRadius:P,padding:_n,active:{...Ns,stroke:X.stroke,textColor:J},disabled:{...Ns,stroke:X.stroke,textColor:J},hover:{...Ns,stroke:X.stroke,textColor:J},buttons:Ft({...Dr,enabled:E,value:Ie($,We(xe(Ie($,ns)),br(2,2)),Yc,Ll,at)},"range button options array")},locale:{localeText:xr,getLocaleText:Ki(L)},background:{visible:E,fill:J,image:{url:j(L),top:$,right:$,bottom:$,left:$,width:P,height:P,opacity:oe}},styleNonce:L,sync:le,zoom:le,scrollbar:le,formatter:Ie(Ki(pn),j0),enableRtl:E};we.highlight.enabled=Q(E),we.dataSource.requestThrottle=Q(P),we.dataSource.updateThrottle=Q(P),we.dataSource.updateDuringInteraction=Q(E),we.statusBar=Q(le),we.ranges.minSize=Q(P),we.foreground=Q({visible:E,text:L,image:{url:L,top:$,right:$,bottom:$,left:$,width:P,height:P,opacity:oe},...ie}),we.overrideDevicePixelRatio=Q($),we.sync.domainMode=Q(U("direction","position","key")),we.displayNullData=Q(E);var Ke={cursor:L,context:()=>!0,showInLegend:E,nodeClickRange:Mg,listeners:{seriesNodeClick:at,seriesNodeDoubleClick:at},highlight:fy(It)};Ke.allowNullKeys=Q(E);var qe={...Ke,id:L,visible:E,context:()=>!0,data:dn};qe.seriesGrouping=Q(le);var Ir={shape:Mr,size:P,...ie,...X,...ae},So={enabled:E,itemStyler:Xe({...ie,...X,...ae,shape:Mr,size:P}),...Ir},ft={enabled:E,formatter:Ki(pn),format:gn,itemStyler:Xe({enabled:E,...Hn,...$e}),...Hn,...$e},kr={...ft,lineHeight:P,minimumFontSize:P,wrapping:aN,overflowStrategy:U("ellipsis","hide")},Gd={visible:E,cap:{visible:E,length:P,lengthRatio:oe,...X,...ae},...X,...ae},jd={...Gd,xLowerKey:L,xUpperKey:L,yLowerKey:L,yUpperKey:L,xLowerName:L,xUpperName:L,yLowerName:L,yUpperName:L,itemStyler:Xe({visible:E,...X,...ae,cap:{visible:E,length:P,lengthRatio:oe,...X,...ae}})},Ue={enabled:E,showArrow:E,range:H0,renderer:Ki(Ie(L,$,ns,Et({heading:L,title:L,symbol:{marker:{enabled:E,shape:Mr,...ie,stroke:J,strokeOpacity:oe,strokeWidth:P,...ae},line:{enabled:E,stroke:J,strokeWidth:P,strokeOpacity:oe,...ae}},data:Ft({label:j(L),value:j(Ie(L,$,ns))})},"tooltip renderer result object"))),position:{anchorTo:U("node","pointer","chart"),placement:Ie(yy,xe(yy)),xOffset:$,yOffset:$},interaction:{enabled:E}},W0={...Ue,range:Mg},$o={enabled:E,xOffset:$,yOffset:$,blur:P,color:J},kg=wl({linear:{},smooth:{tension:oe},step:{position:U("start","middle","end")}},"interpolation line options"),Ag=Symbol("BREAK"),wg="__decorator_config",by="__decorator_accessors";function m(e,t){$0(e,t).optional=!0}function $0(e,t){if(Object.getOwnPropertyDescriptor(e,wg)==null&&Object.defineProperty(e,wg,{value:{}}),Object.getOwnPropertyDescriptor(e,by)==null){const h=Object.getPrototypeOf(e)?.[by]?.slice()??[];Object.defineProperty(e,by,{value:h})}const i=e[wg],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let o=n?.get,a=n?.set;if(o==null||a==null){const c=e[by];let h=c.indexOf(t);h===-1&&(h=c.push(t)-1),o??(o=function(){let d=this.__accessors;return d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[h]}),a??(a=function(d){let u=this.__accessors;u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[h]=d})}return Object.defineProperty(e,t,{set:function(c){const{setters:h,observers:d}=i[s];let u;h.some(p=>p.length>2)&&(u=o.call(this));for(const p of h)if(c=p(this,t,c,u),c===Ag)return;a.call(this,c);for(const p of d)p(this,c,u)},get:function(){let c=o.call(this);for(const h of i[s].getters)if(c=h(this,t,c),c===Ag)return;return c},enumerable:!0,configurable:!1}),i[s]}function Ar(e,t,i){return(s,n)=>{const o=$0(s,n);o.setters.push(e),t&&o.getters.unshift(t),i&&Object.assign(o,i)}}function vy(e){return(t,i)=>{$0(t,i).observers.push(e)}}function Cg(e){return e!==void 0&&wg in e}function wr(e){const t=new Set;for(;Cg(e);)t.add(e?.[wg]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function K0(e){return wr(e).reduce((t,i)=>(t[String(i)]=e[i]??null,t),{})}function*Cr(...e){for(const t of e)t!=null&&(t[Symbol.iterator]?yield*t:yield t)}function U0(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function Ks(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*rt(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}function Ko(e){return Object.keys(e)}function Ht(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>Ht(i,t[s])):Ge(e)?Ge(t)?Sy(e,t,Ht):!1:e===t}function Sy(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function ce(...e){const t={};for(const i of e){if(!me(i))continue;const s=Cg(i)?wr(i):Object.keys(i);for(const n of s)Ge(t[n])&&Ge(i[n])?t[n]=ce(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function Wd(...e){const t={};for(const i of e){if(!me(i))continue;const s=Cg(i)?wr(i):Object.keys(i);for(const n of s)Ge(t[n])&&Ge(i[n])?t[n]=Wd(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function My(e,...t){return t&&Ae(e)?e.map(i=>ce(i,...t)):e}function Zc(e,t){const i={};for(const[s,n]of rt(e))i[s]=t(n,s,e);return i}function ee(e,t){const i={...e};for(const s of t)delete i[s];return i}function Lg(e,t){if(e==null)return;const i={};for(const s of t)Object.hasOwn(e,s)&&(i[s]=e[s]);return i}function Y0(e,t){if(e==null)return!0;for(const[i,s]of rt(e))if(!t(i,s))return!1;return!0}function Z0(e){const t={};if(e==null)return t;for(const[i,s]of e)t[i]=s;return t}function Dy(e,t){return(Ae(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var Iy=new Set(["__proto__","constructor","prototype"]);function ky(e,t,i){const s=Ae(t)?t.slice():t.split("."),n=s.pop();if(s.some(a=>Iy.has(a)))return;const o=s.reduce((a,r)=>a[r],e);return o[n]=i,o[n]}function Ng(e,t,i){if(i===void 0)return t;for(const s of e){const n=i[s];n!==void 0&&(t[s]=n)}return t}function Ay(e,t,i){const s=i??Object.keys(t);for(let n=0,o=s.length;n(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(Q0||{}),Uo=12,li={SMALLEST:8/Uo,SMALLER:10/Uo,SMALL:12/Uo,MEDIUM:13/Uo,LARGE:14/Uo,LARGEST:17/Uo},J0=(e=>(e.TOP="top",e.TOP_RIGHT="top-right",e.TOP_LEFT="top-left",e.RIGHT="right",e.RIGHT_TOP="right-top",e.RIGHT_BOTTOM="right-bottom",e.BOTTOM="bottom",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.LEFT="left",e.LEFT_TOP="left-top",e.LEFT_BOTTOM="left-bottom",e))(J0||{}),eM=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.TIME="time",e.NUMBER="number",e.LOG="log",e))(eM||{}),tM=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(tM||{}),iM=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(iM||{}),qc=(e,t,i)=>e*(1-i)+t*i,sM=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},nM=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},cN=class nt{constructor(t,i,s,n=1){this.r=se(0,t||0,1),this.g=se(0,i||0,1),this.b=se(0,s||0,1),this.a=se(0,n||0,1)}static validColorString(t){return t.includes("#")?!!nt.parseHex(t):t.includes("rgb")?!!nt.stringToRgba(t):nt.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.includes("#"))return nt.fromHexString(t);const i=nt.nameToHex.get(t.toLowerCase());if(i)return nt.fromHexString(i);if(t.includes("rgb"))return nt.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replaceAll(" ","").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;sNumber.parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=nt.parseHex(t);if(i){const[s,n,o,a]=i;return new nt(s/255,n/255,o/255,a/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let r=0;r=0?p:p+360;return[f,y,x]}static OKLCHtoRGB(t,i,s){const n=t,o=i*Math.cos(s*Math.PI/180),a=i*Math.sin(s*Math.PI/180),r=(n+.3963377774*o+.2158037573*a)**3,l=(n-.1055613458*o-.0638541728*a)**3,c=(n-.0894841775*o-1.291485548*a)**3,h=4.0767416621*r-3.3077115913*l+.2309699292*c,d=-1.2684380046*r+2.6097574011*l-.3413193965*c,u=-.0041960863*r-.7034186147*l+1.707614701*c,p=nM(h),f=nM(d),y=nM(u);return[p,f,y]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),o=Math.max(t,i,s),a=(o+n)/2;let r,l;if(o===n)r=0,l=0;else{const c=o-n;l=a>.5?c/(2-o-n):c/(o+n),o===t?r=(i-s)/c+(i1&&(h-=1),h<1/6?o+(n-o)*6*h:h<1/2?n:h<2/3?o+(n-o)*(2/3-h)*6:o}const r=a(t/360+1/3),l=a(t/360),c=a(t/360-1/3);return[r,l,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),o=Math.max(t,i,s),a=o===0?0:(o-n)/o;let r=0;if(n!==o){const l=o-n,c=(o-t)/l,h=(o-i)/l,d=(o-s)/l;t===o?r=d-h:i===o?r=2+c-d:r=4+h-c,r/=6,r<0&&(r=r+1)}return[r*360,a,o]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,o=0,a=0;if(i===0)n=o=a=s;else{const r=(t-Math.floor(t))*6,l=r-Math.floor(r),c=s*(1-i),h=s*(1-i*l),d=s*(1-i*(1-l));switch(Math.trunc(r)){case 0:n=s,o=d,a=c;break;case 1:n=h,o=s,a=c;break;case 2:n=c,o=s,a=d;break;case 3:n=c,o=h,a=s;break;case 4:n=d,o=c,a=s;break;case 5:n=s,o=c,a=h;break}}return[n,o,a]}static mix(t,i,s){return new nt(qc(t.r,i.r,s),qc(t.g,i.g,s),qc(t.b,i.b,s),qc(t.a,i.a,s))}static lighten(t,i){const s=nt.RGBtoOKLCH(t.r,t.g,t.b);return nt.fromOKLCH(se(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=nt.RGBtoOKLCH(t.r,t.g,t.b);return nt.fromOKLCH(se(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(o=>nt.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:i},(o,a)=>{const r=a/(i-1),l=t.length<=2?0:Math.min(Math.floor(r*(t.length-1)),t.length-2),c=(r-l*s)/s,h=n[l],d=n[l+1];return nt.fromOKLCH(qc(h[0],d[0],c),qc(h[1],d[1],c),qc(h[2],d[2],c))})}};cN.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var Ne=cN,$d={x:{position:"bottom",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"number","category"]}},y:{position:"left",type:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"category","number"]}}},oM={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},Cy={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},Lr={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},Nl={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},aM={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},Vi={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},rM={...Vi,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},Ly={...Vi,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},Ny=e=>({...Vi,colorStops:{$shallow:{$if:[{$or:[{$isGradient:{$palette:`${e}.fill`}},{$isPattern:{$palette:`${e}.fill`}},{$isImage:{$palette:`${e}.fill`}}]},{$path:["/colorStops",void 0,{$palette:`${e}.fill`}]},[{color:{$mix:[{$palette:`${e}.fill`},"black",.15]}},{color:{$mix:[{$palette:`${e}.fill`},"white",.15]}}]]}}}),Rg={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},Yo={...Rg,reverse:!0},Ty={...Rg,bounds:"series"},Oy={...Rg,bounds:"series",reverse:!0},lM={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},tt={type:"pattern",pattern:"forward-slanted-lines",width:{$isUserOption:["./height",{$path:"./height"},10]},height:{$isUserOption:["./width",{$path:"./width"},10]},padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:Lr,strokeOpacity:1,strokeWidth:{$switch:[{$path:"./pattern"},0,[["backward-slanted-lines","forward-slanted-lines","horizontal-lines","vertical-lines"],4]]},backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},Py={...tt,stroke:{$if:[{$isGradient:{$palette:"fill"}},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]},fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$path:["/0",void 0,{$palette:"fillsFallback"}]},{$path:["/0",void 0,{$palette:"fills"}]}]},{$path:["/0",void 0,{$palette:"fills"}]}]}]}},cM={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},hM={...tt,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},Ey=e=>({...tt,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),it={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},dM={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function fn(e){return Zc(e,t=>{const i=Ne.fromString(t);return[Ne.darken(i,.15).toString(),t,Ne.lighten(i,.15).toString()]})}var Ye={padding:8,cornerRadius:4,fill:{$if:[{$and:[{$eq:[{$path:"./fill/type"},"image"]},{$isUserOption:["./fill/backgroundFill",!1,!0]}]},{backgroundFill:"transparent"},void 0]},border:{enabled:{$isUserOption:["../border",!0,!1]},strokeWidth:1,stroke:{$foregroundOpacity:.08}}},Ry={$isUserOption:["/highlight/enabled",{$path:"/highlight/enabled"},!0]},Ys={enabled:Ry,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},Kd={enabled:Ry,unhighlightedSeries:{opacity:.2}},zy={enabled:Ry,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},Vy={enabled:Ry,unhighlightedItem:{opacity:.2}},By={border:{enabled:!1,stroke:{$foregroundBackgroundMix:.25},strokeOpacity:1,strokeWidth:1},cornerRadius:4,fillOpacity:1,padding:{$if:[{$eq:[{$path:"./border/enabled"},!0]},5,{$isUserOption:["./fill",5,0]}]}},Tl={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$path:"../../../stroke"},fillOpacity:{$path:"../../../fillOpacity"},strokeWidth:{$isUserOption:["./stroke",{$isUserOption:["../../../strokeWidth",{$path:"../../../strokeWidth"},{$if:[{$greaterThan:[{$path:"../../../strokeWidth"},0]},{$path:"../../../strokeWidth"},2]}]},{$path:"../../../strokeWidth"}]},strokeOpacity:{$path:"../../../strokeOpacity"},lineDash:{$path:"../../../lineDash"},lineDashOffset:{$path:"../../../lineDashOffset"}}}},Fy=class AL{constructor(t){this.version=t.split("-")[0]}save(...t){const i={version:this.version};for(const s of Object.values(t))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(t,...i){if(!me(t)){Bn(`Could not restore data of type [${t===null?"null":typeof t}], expecting an object, ignoring.`);return}if(!("version"in t)||typeof t.version!="string"){Bn("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,t[s.mementoOriginatorKey]),o=[];if(!s.guardMemento(n,o)){let a=`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.`;o.length>0&&(a+=` ${o.join(` `)} `),Bn(a,n);return}s.restoreMemento(this.version,t.version,n)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,AL.encodeTypes))}catch(s){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(t,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),AL.decodeTypes)}catch(s){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(t,i){return Cs(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return me(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},_y=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(_y||{}),Gn=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PROCESS_RANGE=4]="PROCESS_RANGE",e[e.PERFORM_LAYOUT=5]="PERFORM_LAYOUT",e[e.PRE_SERIES_UPDATE=6]="PRE_SERIES_UPDATE",e[e.SERIES_UPDATE=7]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=8]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=9]="SCENE_RENDER",e[e.NONE=10]="NONE",e))(Gn||{}),uM=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",e[e.AXIS_GRID=2]="AXIS_GRID",e[e.AXIS=3]="AXIS",e[e.SERIES_AREA_CONTAINER=4]="SERIES_AREA_CONTAINER",e[e.ZOOM_SELECTION=5]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=6]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=7]="SERIES_LAYER",e[e.AXIS_FOREGROUND=8]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=9]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=10]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=11]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=12]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=13]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=14]="STATUS_BAR",e[e.SERIES_LABEL=15]="SERIES_LABEL",e[e.LEGEND=16]="LEGEND",e[e.NAVIGATOR=17]="NAVIGATOR",e[e.FOREGROUND=18]="FOREGROUND",e))(uM||{}),pM=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(pM||{}),gM=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(gM||{}),fM=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(fM||{});function Ol(e){const{placement:t="bottom",floating:i=!1,xOffset:s=0,yOffset:n=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:i,xOffset:s,yOffset:n}}var q=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(e==null)return this.clear(),this;if(typeof e!="object")return ba(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of wr(this))if(i.has(s)){const n=e[s],o=this;if(Qc(o[s]))if(o[s]instanceof Bi){const a=o[s].reset(n);a==null?ba(`unable to set [${String(s)}] - expecting a properties array`):o[s]=a}else o[s].set(n);else Ge(n)?o[s]=Wd(n,o[s]??{}):o[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)ba(`unable to set [${String(s)}] in ${t} - property is unknown`);return this}clear(){for(const e of wr(this)){const t=this[e];Qc(t)?t.clear():this[e]=void 0}return this}toJson(){return wr(this).reduce((e,t)=>{const i=this[t];return e[String(t)]=Qc(i)?i.toJson():i,e},{})}},Bi=class W_ extends Array{constructor(t,...i){super(i.length);const n=(o=>!!o?.prototype?.constructor?.name)(t)?o=>new t().set(o):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if(Ae(t)){this.length=t.length;for(let i=0;it?.toJson?.()??t)}};function Qc(e){return e instanceof q||e instanceof Bi}var Pl=class extends q{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};g([m],Pl.prototype,"type",2),g([m],Pl.prototype,"tension",2),g([m],Pl.prototype,"position",2);function Jc(e,t){const[i,s]=kt(t);return se(i,e,s)}function kt(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)it[1]&&(t[1]=i);return t}function Aa(e){const[t,i]=kt(e);return i-t}function eh(e){return e=Math.trunc(e),e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function Hy(e){return e=Math.trunc(e),e<=0?0:e===1?1:1<<31-Math.clz32(e)}var Zs=0,Xs=1,qs=2,Qs=3,jn=4,wa=1e3,hN=10,Nr=64,El=4294967295,yG=3,xG=20,mM=100;function yM(e,t,i,s,n,o,a,r){let l=0;for(;ls;)n-=1,l+=1;if(l>=mM||s>=n)return o;const c=Number.isFinite(t)?Wn(e[n],t,i,r)-Wn(e[s],t,i,r):th(n,e.length)-th(s,e.length);if(c===0||!Number.isFinite(c))return o;const h=Math.abs(c)/(n-s);let d;if(axG?d=!1:d=h<=o,o=Math.min(o,h),!d)return o;const u=Math.floor((s+n)/2),p=yM(e,t,i,s,u,o,a+1,r),f=yM(e,t,i,u+1,n,o,a+1,r);return Math.min(p,f,o)}function bG(e,t,i,s){return yM(e,t,i,0,e.length-1,1/(e.length-1),0,s)}function Ca(e,t,i,s){if(Number.isFinite(t)){const n=s?.smallestKeyInterval,o=s?.xNeedsValueOf??!0,a=n==null?bG(e,t,i,o):n/(i-t);return eh(Math.trunc(1/a))>>3}else{let n=Math.ceil(Math.log2(e.length))-1;return n=Math.min(Math.max(n,0),24),Math.trunc(2**n)}}function ci(e,t){const{domain:i,sortMetadata:s}=t;switch(e){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(i.length===0)return[1/0,-1/0];if(s?.sortOrder===1)return[Number(i[0]),Number(i.at(-1))];if(s?.sortOrder===-1)return[Number(i.at(-1)),Number(i[0])];let n=1/0,o=-1/0;for(const a of i){const r=Number(a);n=Math.min(n,r),o=Math.max(o,r)}return[n,o]}case"color":case"log":case"mercator":return[0,0]}}function th(e,t){return e/t}function Wn(e,t,i,s){return s?(e.valueOf()-t)/(i-t):(e-t)/(i-t)}function zg(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*jn)}function dN(e,t,i,s,n,{xNeedsValueOf:o=!0,xValuesLength:a}={}){const r=e[n];if(r==null)return-1;const l=a??e.length,c=Number.isFinite(t)?Wn(r,t,i,o):th(n,l);return zg(c,s)}function uN(e,t,i,s){for(const n of s)if(i===e[t+n])return!0;return!1}function La(e,t,i,s,n,o,{positive:a,split:r=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:h,reuseValueData:d,reuseNegativeIndexData:u,reuseNegativeValueData:p}={}){const f=Number.NaN,y=o*jn,x=h?.length===y?h:new Uint32Array(y),b=d?.length===y?d:new Float64Array(y);let v,S;r&&(u?.length===y?v=u:v=new Uint32Array(y),p?.length===y?S=p:S=new Float64Array(y));const M=Number.isFinite(s)&&Number.isFinite(n),D=e.length;M&&(b.fill(f),x.fill(El),r&&(S.fill(f),v.fill(El)));const I=M?o/(n-s):o*(1/D);let k=-1,A=-1,w=f,C=-1,T=f,O=-1,V=f,z=-1,R=f,B=-1,G=-1,F=f,_=-1,Y=f,Z=-1,ne=f,te=-1,ue=f;const ge=e.length,be=t===i;for(let fe=0;fe=0;else if(a!=null&&Te>=0!==a)continue;let pe;M?l?pe=(He.valueOf()-s)*I:pe=(He-s)*I:pe=fe*I;const dt=Math.floor(pe),yt=(dtT&&(C=fe,T=pe),ut&&MeR&&(z=fe,R=Te))}else{yt!==B&&(B!==-1&&(v[B]=G,v[B+1]=_,v[B+2]=Z,v[B+3]=te,S[B]=F,S[B+1]=Y,S[B+2]=ne,S[B+3]=ue),B=yt,G=-1,F=f,_=-1,Y=f,Z=-1,ne=f,te=-1,ue=f);const ut=Me===Me,bt=Te===Te;G===-1?(G=fe,F=pe,_=fe,Y=pe,ut&&(Z=fe,ne=Me),bt&&(te=fe,ue=Te)):(peY&&(_=fe,Y=pe),ut&&Meue&&(te=fe,ue=Te))}}return k!==-1&&(x[k]=A,x[k+1]=C,x[k+2]=O,x[k+3]=z,b[k]=w,b[k+1]=T,b[k+2]=V,b[k+3]=R),r&&B!==-1&&(v[B]=G,v[B+1]=_,v[B+2]=Z,v[B+3]=te,S[B]=F,S[B+1]=Y,S[B+2]=ne,S[B+3]=ue),{indexData:x,valueData:b,negativeIndexData:v,negativeValueData:S}}function Rl(e,t,i,{inPlace:s=!1,midpointData:n,reuseIndexData:o,reuseValueData:a}={}){const r=Math.trunc(i/2),l=r*jn;let c;s?c=e:o?.length===l?c=o:c=new Uint32Array(l);let h;s?h=t:a?.length===l?h=a:h=new Float64Array(l);const d=n??new Uint32Array(r);for(let u=0;ut[y+Xs]?f:y,M=e[S+Xs];c[p+Xs]=M,h[p+Xs]=t[S+Xs],d[u]=v+M>>1;const D=x||t[f+qs]t[y+Qs]?f:y;c[p+Qs]=e[I+Qs],h[p+Qs]=t[I+Qs]}return{maxRange:r,indexData:c,valueData:h,midpointData:d}}function Zo(e,t,i,s=Zs,n=Xs,o=-1){const a=i?.length===e?i:new Uint32Array(e);for(let r=0,l=0;r>1}return a}function pN(e,{collectLevel:t,shouldContinue:i,minRange:s=Nr,compactInPlace:n=!1}){let o=e,a=t(o);const r=[a];for(;o.maxRange>s&&i(a,o);){const l=Rl(o.indexData,o.valueData,o.maxRange,{inPlace:n});o={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},a=t(o),r.push(a)}return r.reverse(),r}function Tr(e,t,i,s,n){if(t.lengthb.maxRange===d);let{indexData:p,valueData:f}=La(t,i,s,o,a,d,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:u?.indexData,reuseValueData:u?.valueData}),y=Zo(d,p,u?.midpointIndices);const x=[{maxRange:d,indexData:p,valueData:f,midpointIndices:y}];for(;d>Nr;){const b=d,v=Math.trunc(b/2),S=h?.find(D=>D.maxRange===v),M=Rl(p,f,b,{reuseIndexData:S?.indexData,reuseValueData:S?.valueData});d=M.maxRange,p=M.indexData,f=M.valueData,y=M.midpointData??Zo(d,p,S?.midpointIndices),x.push({maxRange:d,indexData:p,valueData:f,midpointIndices:y})}return x.reverse(),x}function Vg(e,t,i,s,n){if(t.lengthM.maxRange===p),{indexData:y,valueData:x}=La(t,i,s,o,a,p,{xNeedsValueOf:c,yNeedsValueOf:h,reuseIndexData:f?.indexData,reuseValueData:f?.valueData}),b=Zo(p,y,f?.midpointIndices),v={maxRange:p,indexData:y,valueData:x,midpointIndices:b};function S(){return Tr([o,a],t,i,s,{smallestKeyInterval:r,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:d})?.filter(D=>D.maxRange!==p)??[]}return{immediate:[v],computeRemaining:S}}var zl=Symbol("is-dark-theme"),Na=Symbol("default-shadow-colour"),Ta=Symbol("default-caption-layout-style"),Or=Symbol("default-caption-alignment"),Gy=Symbol("palette-up-stroke"),jy=Symbol("palette-down-stroke"),Wy=Symbol("palette-up-fill"),$y=Symbol("palette-down-fill"),Ky=Symbol("palette-neutral-stroke"),Uy=Symbol("palette-neutral-fill"),Yy=Symbol("palette-alt-up-stroke"),Zy=Symbol("palette-alt-down-stroke"),Xy=Symbol("palette-alt-up-fill"),qy=Symbol("palette-alt-down-fill"),Qy=Symbol("palette-gray-fill"),Jy=Symbol("palette-gray-stroke"),Bg=Symbol("default-polar-series-stroke"),Fg=Symbol("default-sparkline-crosshair-stroke"),Ts=Symbol("default-financial-charts-annotation-stroke"),Ud=Symbol("default-hierarchy-strokes"),_g=Symbol("default-text-annotation-color"),rs=Symbol("default-financial-charts-annotation-background-fill"),Yd=Symbol("default-annotation-handle-fill"),Zd=Symbol("default-annotation-statistics-fill"),Xd=Symbol("default-annotation-statistics-stroke"),qd=Symbol("default-annotation-statistics-color"),Qd=Symbol("default-annotation-statistics-divider-stroke"),Jd=Symbol("default-annotation-statistics-fill"),eu=Symbol("default-annotation-statistics-stroke"),tu=Symbol("default-textbox-fill"),iu=Symbol("default-textbox-stroke"),su=Symbol("default-textbox-color"),nu=Symbol("default-toolbar-position");function vG(e,t){return"context"in e}function gN(e,t){return e!=null&&vG(e,t)&&t!=null&&typeof t=="object"&&t.context===void 0?(t.context=e.context,!0):!1}function ls(e,t,i){if(Array.isArray(e)){for(const s of e)if(gN(s,i))break}else gN(e,i);return t(i)}var xM=class{constructor(){this.cache=new WeakMap}call(e,t,i){let s,n=this.cache.get(t);try{s=JSON.stringify(i)}catch{return this.invoke(e,t,n,void 0,i)}return n==null&&(n=new Map,this.cache.set(t,n)),n.has(s)?n.get(s):this.invoke(e,t,n,s,i)}invoke(e,t,i,s,n){try{const o=ls(e,t,n);return i&&s!=null&&i.set(s,o),o}catch(o){Bn("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}},bM=class{constructor(e,t=e.defaultView){this.fallbackDocument=e,this.fallbackWindow=t,this.windowEvents=new Map}destroy(){this.removeWindowEvents(),this.container=void 0,this.cachedDocument=void 0,this.cachedWindow=void 0,this.windowEvents.clear()}get document(){return this.cachedDocument??this.fallbackDocument}get window(){return this.cachedWindow??this.fallbackWindow}getContainer(){return this.container}setContainer(e){if(this.container=e,e==null)return;const t=e.ownerDocument,i=t.defaultView??void 0,s=t!==this.document;s&&this.removeWindowEvents(),this.cachedDocument=t,this.cachedWindow=i,s&&this.reattachWindowEvents()}removeWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:i,options:s}of t)this.window.removeEventListener(e,i,s)}reattachWindowEvents(){for(const[e,t]of this.windowEvents)for(const{listener:i,options:s}of t)this.window.addEventListener(e,i,s)}get devicePixelRatio(){return this.window.devicePixelRatio}get innerWidth(){return this.window.innerWidth}get innerHeight(){return this.window.innerHeight}get navigator(){return this.window.navigator}getComputedStyle(e,t){return this.window.getComputedStyle(e,t)}matchMedia(e){return this.window.matchMedia?.(e)}getSelection(){return this.window.getSelection()}requestAnimationFrame(e){return this.window.requestAnimationFrame(e)}cancelAnimationFrame(e){this.window.cancelAnimationFrame(e)}shimIdleCallback(e,t){return setTimeout(()=>e(null),t?.timeout)}requestIdleCallback(e,t){return typeof this.window.requestIdleCallback=="function"?this.window.requestIdleCallback(e,t):this.shimIdleCallback(e,t)}cancelIdleCallback(e){return typeof this.window.cancelIdleCallback=="function"?this.window.cancelIdleCallback(e):clearTimeout(e)}attachListener(e,t,i){let s=this.windowEvents.get(e);s==null&&(s=new Set,this.windowEvents.set(e,s));const n=()=>{s?.delete(a),s?.size===0&&this.windowEvents.delete(e)},o=me(i)&&i.once?r=>{n(),t(r)}:t,a={listener:o,options:i};return s.add(a),this.window.addEventListener(e,o,i),()=>{n(),this.window.removeEventListener(e,o,i)}}get body(){return this.document.body}get head(){return this.document.head}isReady(){return this.document.readyState==="complete"}createElement(e,t,i){const s=this.document.createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const n of t.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}createSvgElement(e){return this.document.createElementNS("http://www.w3.org/2000/svg",e)}createResizeObserver(e){const t=this.window.ResizeObserver;if(t!=null)return new t(e)}createIntersectionObserver(e,t){const i=this.window.IntersectionObserver;if(i!=null)return new i(e,t)}};function ex(e,t,i=1/0){const s=t,n=i,o=e%180*(Math.PI/180),a=Math.abs(Math.sin(o)),r=Math.abs(Math.cos(o));if(a===0)return{width:s,height:n};if(r===0)return{width:n,height:s};if(!Number.isFinite(n)){const c=r/a,h=s/(r+c*a);return{width:h,height:c*h}}const l=r*r-a*a;if(l===0){const c=Math.min(s,n)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((s*r-n*a)/l),height:Math.abs((n*r-s*a)/l)}}function fN(e,t,i=1/0){const s=t,n=i,o=e%180*(Math.PI/180),a=Math.abs(Math.sin(o)),r=Math.abs(Math.cos(o));return a===0?{width:s,height:n}:r===0?{width:n,height:s}:{width:s*r+n*a,height:s*a+n*r}}function tx(e,t,i,s=0,n=0){const o=Math.cos(i),a=Math.sin(i),r=e-s,l=t-n;return{x:s+r*o-l*a,y:n+r*a+l*o}}var Mo=Math.PI*2,Hg=Math.PI/2;function Qe(e){return e%=Mo,e+=Mo,e%=Mo,e}function ou(e){return e%=Mo,e+=Mo,e!==Mo&&(e%=Mo),e}function Gg(e){return e%=Mo,e<-Math.PI?e+=Mo:e>=Math.PI&&(e-=Mo),e}function Js(e,t,i){const s=Qe(e),n=Qe(t),o=Qe(i);return no?n<=s||s<=o:t!==i}function lt(e){return e/180*Math.PI}function vM(e){return e/Math.PI*180}function Xo(e,t){return e=Qe(e),t=Qe(t),t-e+(e>t?Mo:0)}function SM(e){const t=Qe(e);return t<=Hg?t/Hg:t<=Math.PI?(Math.PI-t)/Hg:t<=1.5*Math.PI?(t-Math.PI)/Hg:(Mo-t)/Hg}function ix(e,t,i){const s=SM(i);return e*s+t*Math.abs(1-s)}function qo(e){return e?Qe(lt(e)):0}var jg=class{constructor(){this.queue=[]}waitForCompletion(e=50){const t=this.queue;function i(s){function n(){clearTimeout(a),s(!0)}function o(){const r=t.indexOf(n);r<0||(t.splice(r,1),s(!1))}const a=setTimeout(o,e);t.push(n)}return new Promise(i)}notify(){for(const e of this.queue.splice(0))e()}};function sx(e=0){function t(i){setTimeout(i,e)}return new Promise(t)}async function mN(e,t,i=`Timeout after ${t}ms`){let s;const n=new Promise((o,a)=>{s=setTimeout(()=>a(new Error(i)),t)});try{return await Promise.race([e,n])}finally{clearTimeout(s)}}function Vl(e){return e==="true"}function SG(e){return Number(e)}function $n(e){return e}var MG={role:$n,"aria-checked":Vl,"aria-controls":$n,"aria-describedby":$n,"aria-disabled":Vl,"aria-expanded":Vl,"aria-haspopup":$n,"aria-hidden":Vl,"aria-label":$n,"aria-labelledby":$n,"aria-live":$n,"aria-orientation":$n,"aria-selected":Vl,"data-focus-override":Vl,"data-focus-visible-override":Vl,"data-preventdefault":Vl,class:$n,for:$n,id:$n,tabindex:SG,title:$n,placeholder:$n};function Fe(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function Do(e,t){if(t!=null)for(const[i,s]of rt(t))i!=="class"&&Fe(e,i,s)}function Bl(e,t,i){if(!Ad(e))return;const s=e.getAttribute(t);return s===null?i:MG[t]?.(s)??void 0}function Io(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function MM(e,t){for(const[i,s]of rt(t))Io(e,i,s)}function Gt(e,t){const i=Array.isArray(e)?e:e.split(".");if(i.length===1){const[s]=i;return Ar((n,o,a)=>n[s]=a,n=>n[s],t)}return Ar((s,n,o)=>ky(s,i,o),s=>Dy(s,i),t)}function yN(e){return Ar((t,i,s)=>t[e]=s)}function St(e,t){return Ar((i,s,n)=>i[e][t??s]=n)}function Ze(e){const{newValue:t,oldValue:i,changeValue:s}=e;return Ar((n,o,a,r)=>(a!==r&&(r!==void 0&&i?.call(n,r),a!==void 0&&t?.call(n,a),s?.call(n,a,r)),a))}function Rt(e){return vy(e)}var Pr=class extends q{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};g([Ze({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),m],Pr.prototype,"enabled",2),g([St("node","stroke"),m],Pr.prototype,"stroke",2),g([St("node","strokeOpacity"),m],Pr.prototype,"strokeOpacity",2),g([Ze({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),m],Pr.prototype,"strokeWidth",2);function nx(e,t,i,s,n){return te.x&&ie.y}function Wg(e,t,i,s=0,n=0){return t>=e.x&&t+s<=e.x+e.width&&i>=e.y&&i+n<=e.y+e.height}function DM(e){return e==null||e.height===0||e.width===0||Number.isNaN(e.height)||Number.isNaN(e.width)}function $g(e,t){return e===t?!0:e==null||t==null?!1:e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function ko(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,e=n+1):t=n-1}return s}function ih(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,t=n-1):e=n+1}return s}function ox(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),o=i(n);o==null?t=n-1:(s=o,e=n+1)}return s}function xN(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),o=i(n);o==null?e=n+1:(s=o,t=n-1)}return s}function IM(e=0,t=0){const i=rg();return new i(e,t).getContext("2d")}var bN=800,vN=600,SN={quality:1};function MN(e){const t=class extends e{constructor(...s){super(...s),this.gpu=!1}toBuffer(s,n){return super.toBuffer(s,{...n,msaa:!1})}transferToImageBitmap(){const{width:s,height:n}=this,o=new t(Math.max(1,s),Math.max(1,n));return s>0&&n>0&&o.getContext("2d").drawCanvas(this,0,0,s,n),Object.defineProperty(o,"close",{value:()=>{}}),o}};return t}var DN=!1;function IN(e,t){DN||(DN=!0,Object.defineProperty(e.prototype,"fillText",{value:function(i,s,n){let o=this.outlineText(i);o=o.transform(new t([1,0,0,1,s,n])),this.fill(o)},writable:!0,configurable:!0}))}var kN=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},kM=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}};function ax(e,t){return e.valueOf()-t.valueOf()}function DG(e){let t=Number.NaN;const i=[];for(const s of e){const n=s.valueOf();t!==n&&i.push(s),t=n}return i}function rx(e){const t=e.slice().sort(ax);return lx(t)==null?DG(t):t}function lx(e){if(e.length===0)return 1;const t=Number(e.at(-1))>Number(e[0])?1:-1;let i=-1/0*t;for(const s of e){const n=s.valueOf();if(Math.sign(n-i)!==t)return;i=n}return t}function cx(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");Bn(i)}}function AN(e,t){const i=cx(),s=t?.default;return Ar((n,o,a)=>(a!==s&&i(o.toString(),e),a))}function wN(e,t){const i=cx();return Ar((s,n,o)=>(o!==s[e]&&(i(n.toString(),`Use [${e}] instead.`),ky(s,e,t?t(o):o)),Ag),(s,n)=>(i(n.toString(),`Use [${e}] instead.`),Dy(s,e)))}function AM(e,t){const i=Math.max(e.length,t.length),s=new Set,n=new Set;for(let o=0;o0||n.size>0,added:s,removed:n}}function Kg(e,t,i,s){const n=e-i,o=t-s;return n*n+o*o}function Er(e,t,i,s,n,o,a){if(i===n&&s===o)return Math.min(a,Kg(e,t,i,s));const r=n-i,l=o-s,c=Math.max(0,Math.min(1,((e-i)*r+(t-s)*l)/(r*r+l*l))),h=i+c*r,d=s+c*l;return Math.min(a,Kg(e,t,h,d))}function CN(e,t,i,s,n,o,a,r,l){r&&([a,o]=[o,a]);const c=Math.atan2(t-s,e-i);if(!Js(c,o,a)){const d=i+Math.cos(o)*n,u=s+Math.sin(o)*n,p=i+Math.cos(o)*n,f=s+Math.sin(o)*n;return Math.min(l,Kg(e,t,d,u),Kg(e,t,p,f))}const h=n-Math.sqrt(Kg(e,t,i,s));return Math.min(l,h*h)}function Qo(e,t){if(e.length===0)return null;if(t!==void 0){const o=e.at(0),a=e.at(-1),r=o instanceof Date?o.getTime():o,l=a instanceof Date?a.getTime():a;if(typeof r=="number"&&typeof l=="number")return t===1?[r,l]:[l,r]}let i=1/0,s=-1/0;for(const o of e){const a=o instanceof Date?o.getTime():o;typeof a=="number"&&(as&&(s=a))}const n=[i,s];return n.every(Number.isFinite)?n:null}function sh(e,t,i,s,n,o,a){let r=!1;const l=Qo(e,a),c=l&&o?[o(l[0]),o(l[1])]:l;if(c==null){let u;return t!=null&&i!=null&&t<=i?u=[t,i]:s!=null&&n!=null&&s<=n&&(u=[s,n]),{extent:u??[],clipped:!1}}let[h,d]=c;return t!=null?(r||(r=t>h),h=t):s!=null&&sd&&(d=n),h>d?{extent:[],clipped:!1}:{extent:[h,d],clipped:r}}function Ug(e,t,i,s,n){const{extent:o,clipped:a}=sh(e.domain,gt(t)?new Date(t):t,gt(i)?new Date(i):i,gt(s)?new Date(s):s,gt(n)?new Date(n):n,r=>new Date(r),e.sortMetadata?.sortOrder);return{extent:o.map(r=>new Date(r)),clipped:a}}var IG=new Intl.NumberFormat("en-US",{style:"percent"});function Ao(e,t=2){return typeof e=="number"?CM(e,t):typeof e=="string"?e:String(e??"")}function wM(e){return IG.format(e)}var LN=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function CM(e,t){let i=LN.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),LN.set(t,i)),i.format(e)}function NN(e){return Array.isArray(e)&&e.length>=2&&e.every(je)}function hx(e){return Array.isArray(e)&&e.length>=2&&e.every(NN)}function kG(e){const t=e[0],i=e.at(-1);return i===void 0?!1:Be(t[0],i[0],.001)&&Be(t[1],i[1],.001)}function TN(e){return Array.isArray(e)&&e.every(hx)&&e.every(kG)}function ON(e){if(e===null)return!0;if(!me(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(ON);case"MultiPolygon":return Array.isArray(i)&&i.every(TN);case"Polygon":return TN(i);case"MultiLineString":return Array.isArray(i)&&i.every(hx);case"LineString":return hx(i);case"MultiPoint":return hx(i);case"Point":return NN(i);default:return!1}}function AG(e){return me(e)&&e.type==="Feature"&&ON(e.geometry)}function wG(e){return me(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(AG)}var Fl=Ve(wG,"a GeoJSON object"),LM=class{constructor(e,t,i){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e,this.processedEdge=t,this.singleValueEdges=i}clear(){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.singleValueEdges?.clear()}getVertexCount(){return this._vertexCount}getEdgeCount(){return this._edgeCount}addVertex(e){const t=new NM(e);return this._vertexCount++,t}addEdge(e,t,i){i===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):i===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:s}=e,n=s.get(i);n?n.includes(t)||(this.singleValueEdges?.has(i)?s.set(i,[t]):(n.push(t),this._edgeCount++)):(s.set(i,[t]),this._edgeCount++)}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[,i]of t)this._vertexCount-=i.length;e.clear()}}removeEdge(e,t,i){const s=e.edges.get(i);if(!s)return;const n=s.indexOf(t);n!==-1&&(s.splice(n,1),s.length===0&&e.edges.delete(i),this._edgeCount--,i===this.cachedNeighboursEdge&&e.readCachedNeighbours()?.delete(t.value))}removeEdges(e,t){e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[,t]of e.edges)for(const i of t)yield i}*neighboursAndEdges(e){for(const[t,i]of e.edges)for(const s of i)yield[s,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const i=this.findNeighbour(e,t);if(i)return this.getVertexValue(i)}findNeighbourWithValue(e,t,i){const s=i==null?this.neighbours(e):this.neighboursWithEdgeValue(e,i);if(s){for(const n of s)if(this.getVertexValue(n)===t)return n}}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let n;for(const o of t)if(n=(n??e).readCachedNeighbours()?.get(o),!n)return;return n}if(t.length===0)return;let s=e;for(const n of t){const o=s?this.neighboursWithEdgeValue(s,i):void 0;if(!o)return;s=o.find(a=>a.value===n)}return s}adjacent(e,t){for(const[,i]of e.edges)if(i.includes(t))return!0;return!1}},NM=class{constructor(e){this.value=e,this.edges=new Map}readCachedNeighbours(){return this._cachedNeighbours}updateCachedNeighbours(){return this._cachedNeighbours??(this._cachedNeighbours=new Map),this._cachedNeighbours}clear(){this.edges.clear(),this._cachedNeighbours?.clear()}},TM="class-instance";function Kn(e,t,i){if(Ae(t)){if(!Ae(e)||e.length!==t.length||t.some((s,n)=>Kn(e[n],s,i)!=null))return t}else if(Ge(t)){if(!Ge(e))return t;const s={},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of n)if(e[o]!==t[o])if(i?.has(o))s[o]=t[o];else if(typeof e[o]==typeof t[o]){const a=Kn(e[o],t[o],i);a!==null&&(s[o]=a)}else s[o]=t[o];return Object.keys(s).length?s:null}else if(e!==t)return t;return null}function OM(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Pe(e,t){return Ae(e)?CG(e,t):Ge(e)?LG(e,t):e instanceof Map?new Map(Pe(Array.from(e))):_l(e)}function CG(e,t){const i=[],s=t?.seen;for(const n of e){if(typeof n=="object"&&s?.includes(n)){ba("cycle detected in array",n);continue}s?.push(n),i.push(Pe(n,t)),s?.pop()}return i}function LG(e,t){const i={};for(const s of Object.keys(e))t?.assign?.has(s)?i[s]=e[s]:t?.shallow?.has(s)?i[s]=_l(e[s]):i[s]=Pe(e[s],t);return i}function _l(e){return Ae(e)?e.slice(0):Ge(e)?{...e}:Cs(e)?new Date(e):b0(e)?new RegExp(e.source,e.flags):e}function Oa(e,t,i,s,n,o){if(Ae(e)){o=t(e,s,n,o);let a=0;for(const r of e)o=Oa(r,t,i,s?.[a],n,o),a++}else if(Ge(e)){o=t(e,s,n,o);for(const a of Object.keys(e)){if(i?.has(a))continue;const r=e[a];o=Oa(r,t,i,s?.[a],n,o)}}return o}function au(e,t,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=i;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${s??""}`);if(t==null)return e;if(Qc(e))return e.set(t);const a=e,r=PM(e);for(const l of Object.keys(t)){if(Iy.has(l))continue;const c=`${n?n+".":""}${l}`;if(o.includes(c))continue;const h=t[l],d=`${s?s+".":""}${l}`,u=a.constructor,p=a[l];try{const f=PM(p),y=PM(h);if(r===TM&&!(l in e||l==="context")){if(h===void 0)continue;ba(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}if(f!=null&&y!=null&&y!==f&&(f!==TM||y!=="object")){ba(`unable to set [${d}] in ${u?.name} - can't apply type of [${y}], allowed types are: [${f}]`);continue}if(Qc(p))h===void 0?p.clear():p.set(h);else if(y==="object"&&l!=="context"){if(!(l in a)){ba(`unable to set [${d}] in ${u?.name} - property is unknown`);continue}p==null?a[l]=h:au(p,h,{...i,path:d,matcherPath:c})}else a[l]=h}catch(f){ba(`unable to set [${d}] in [${u?.name}]; nested error is: ${f.message}`)}}return e}function PM(e){return e==null?null:ey(e)||Cs(e)?"primitive":Ae(e)?"array":me(e)?Ge(e)?"object":TM:jo(e)?"function":"primitive"}function mt(e,t,i,s){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i,s)}function dx(e,t,i){return mt(e,"keydown",s=>{const n=i?.()??["Escape"];ux(s,...n)&&t(s)})}function EM(e,t){const i=e.ownerDocument.defaultView,s=mt(i,"mousedown",n=>{[0,2].includes(n.button)&&!PN(e,n)&&(t(),s())});return s}function RM(e,t){const i=e.ownerDocument.defaultView,s=mt(i,"touchstart",n=>{Array.from(n.targetTouches).some(a=>!PN(e,a))&&(t(),s())});return s}function PN(e,t){return Xm(t.target)&&t.target.shadowRoot!=null?!0:lg(t.target)&&e.contains(t.target)}function zM(e,t,i){const s=n=>{for(const o of t)Fe(o,"data-focus-visible-override",n)};return s(i),mt(e,"keydown",()=>s(!0),{once:!0})}function ru(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function ux(e,...t){return ru(e)&&t.includes(e.key)}function EN(e,t,i){return mt(e,"keydown",s=>{ux(s,i)&&t.focus()})}var NG={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}},TG={nextKey:"ArrowLeft",prevKey:"ArrowRight"};function lu(e,t){return t&&e==="horizontal"?TG:NG[e]}function px(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:o,onBlur:a}=e,{nextKey:r,prevKey:l}=lu(t,$c(i[0])),c=p=>{if(p.target&&"tabIndex"in p.target){for(const f of i)f.tabIndex=-1;p.target.tabIndex=0}},[h,d]=s?[i.length,i.length]:[0,1/0],u=new ot;for(let p=0;p{ux(b,r,l)&&b.preventDefault()})),y.tabIndex=p===0?0:-1}return u}function RN(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function gx(e){return"button"in e?e.button===0:ru(e)&&(e.code==="Space"||e.key==="Enter")}function fx(e){const t=e?.target;if(Xm(t)&&"tabindex"in t.attributes)return t}function VM(e){return mt(e,"keydown",t=>{if(t.defaultPrevented)return;Bl(t.target,"data-preventdefault",!0)&&ux(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var BM=new Map,zN=1;function VN(){BM.clear(),zN=1}function gi(e){const t=e.constructor;let i=Object.hasOwn(t,"className")?t.className:t.name;WL(()=>{if(!i)throw new Error(`The ${String(t)} is missing the 'className' property.`)}),i??(i="Unknown");const s=(BM.get(i)??0)+1;return BM.set(i,s),`${i}-${s}`}function Rr(){return`ag-charts-${zN++}`}function cu(){return crypto.randomUUID?.()??OG()}function OG(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let i=0;i0)s={value:o,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,o)<=0;)n=n.next;n.next={value:o,next:n.next}}return s}var Yg=new WeakMap;function nh(e,t){const i=JSON.stringify(e,null,0);return Yg.has(t)||Yg.set(t,new Map),Yg.get(t)?.has(i)||Yg.get(t)?.set(i,t(e)),Yg.get(t)?.get(i)}var FM=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function zr(e,t){let i=new FM;const s=(...n)=>{let o=i;for(const a of n){const r=typeof a=="object"||typeof a=="symbol"?o.weak:o.strong;let l=r.get(a);l==null&&(l=new FM,r.set(a,l)),o=l}if(o.set)return t?.("hit",e,n),o.value;{const a=e(...n);return o.set=!0,o.value=a,t?.("miss",e,n),a}};return s.reset=()=>{i=new FM},s}function Ui(e,t){const i=new Map,s=(...a)=>a.map(r=>typeof r=="object"||typeof r=="symbol"?r:(i.has(r)||i.set(r,{v:r}),i.get(r))),n={},o=new WeakMap;return(...a)=>{const r=a.length===0?[n]:s(...a);let l=o;for(const d of r.slice(0,-1))l.has(d)||l.set(d,new WeakMap),l=l.get(d);const c=r.at(-1);let h=l.get(c);return h?t?.("hit",e,a):(h=e(...a),l.set(c,h),t?.("miss",e,a)),h}}function hu(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const o of i){const a=o.distanceSquared(e,t);if(a===0)return{nearest:o,distanceSquared:0};a{})}function jM(e,t){const i=wr(t);if(i.length===0)return;const s=K0(e);for(const n of i)n in s&&(t[n]=s[n])}var BN=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},WM=class Pn extends BN{constructor(t,i,s){super(),this.defaultState=t,this.states=i,this.enterEach=s,this.debug=jL(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,HM)}transition(t,i){if(!this.transitionChild(t,i)||this.state===Pn.child||this.state===Pn.parent)return;const n=this.state,o=this.states[this.state];let a=o[t];const r=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(a))a=a.find(h=>{if(!h.guard)return!0;const d=h.guard(i);return d||this.debug(`${r} (guarded)`,h.target,GM),d});else if(typeof a=="object"&&!(a instanceof Pn)&&a.guard&&!a.guard(i)){this.debug(`${r} (guarded)`,a.target,GM);return}if(!a){this.debug(`${r} ${this.state}`,GM);return}const l=this.getDestinationState(a),c=l===this.state?void 0:o.onExit;this.debug(`${r} ${l}`,HM),this.state=l,typeof a=="function"?a(i):typeof a=="object"&&!(a instanceof Pn)&&a.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==Pn.child&&l!==Pn.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===Pn.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==Pn.child||!this.childState||(jM(this,this.childState),this.childState.transition(t,i),!this.childState.is(Pn.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,HM),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let i=this.state;return typeof t=="string"?i=t:t instanceof Pn?(this.childState=t,this.childState.parent=this,i=Pn.child):typeof t=="object"&&(t.target instanceof Pn?(this.childState=t.target,this.childState.parent=this,i=Pn.child):t.target!=null&&(i=t.target)),i}};WM.child="__child",WM.parent="__parent";var he=WM,$M=class extends BN{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)jM(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)jM(this,i),i.transitionAsync(e,t)}},xx=class{constructor(e,t){this.ctx=e,this.measureTextCached=t,this.baselineMap=new Map,this.charMap=new Map,this.lineHeightCache=null}baselineDistance(e){if(e==="alphabetic")return 0;if(this.baselineMap.has(e))return this.baselineMap.get(e);this.ctx.textBaseline=e;const{alphabeticBaseline:t}=this.ctx.measureText("");return this.baselineMap.set(e,t),this.ctx.textBaseline="alphabetic",t}lineHeight(){return this.lineHeightCache??(this.lineHeightCache=this.measureText("").height),this.lineHeightCache}measureText(e){const t=this.measureTextCached?.(e)??this.ctx.measureText(e),{width:i,fontBoundingBoxAscent:s=t.emHeightAscent,fontBoundingBoxDescent:n=t.emHeightDescent}=t,o=s+n;return{width:i,height:o,ascent:s,descent:n}}measureLines(e){const t=typeof e=="string"?e.split(gr):e;let i=0,s=0;const n=t.map(o=>{const a=this.measureText(o);return i1?this.ctx.measureText(e).width:this.charMap.get(e)??this.charWidth(e)}charWidth(e){const{width:t}=this.ctx.measureText(e);return this.charMap.set(e,t),t}},KM=new og(50);function et(e){typeof e=="object"&&(e=ty(e));let t=KM.get(e);if(t)return t;const i=new og(1e4),s=IM();return s.font=e,t=new xx(s,n=>{let o=i.get(n);return o||(o=s.measureText(n),i.set(n,o),o)}),KM.set(e,t),t}et.clear=()=>KM.clear();function en(e,t){let i={segments:[],width:0,height:0,ascent:0,descent:0};const s=[i];for(const a of e){const{text:r,fontSize:l=t.fontSize,fontStyle:c=t.fontStyle,fontWeight:h=t.fontWeight,fontFamily:d=t.fontFamily,...u}=a,p={fontSize:l,fontStyle:c,fontWeight:h,fontFamily:d},f=et(p),y=Dt(r).split(gr);for(let x=0;x0&&(i={segments:[],width:0,height:0,ascent:0,descent:0},s.push(i)),b&&(i.width+=v.width,i.ascent=Math.max(i.ascent,v.ascent),i.descent=Math.max(i.descent,v.descent),i.height=Math.max(i.height,i.ascent+i.descent),i.segments.push({...p,...u,text:b,textMetrics:v}))}}let n=0,o=0;for(const a of s)n=Math.max(n,a.width),o+=a.height;return{width:n,height:o,lineMetrics:s}}function ke(e,t,i){const s=kl().createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const n of t.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function jt(e){return kl().createElementNS("http://www.w3.org/2000/svg",e)}function UM(e,t){const i=kl("body"),s=ke("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>s.remove())}function FN(e,t){return t.overflow==="hide"&&e.some(mr)}function du(e,t){return Ae(e)?vx(e,t):uu(Dt(e),t).join(` `)}function Pa(e,t){return uu(e,t).join(` `)}function uu(e,t){return bx(e,t)}function Hl(e,t,i,s){const n=t.textWidth(Wc),o=Ma(e);let a=0,r=0;for(const c of o){const h=t.textWidth(c);if(a+h>i)break;a+=h,r+=c.length}if(r===e.length&&(!s||a+n<=i))return s?iy(e):e;e=e.slice(0,r).trimEnd();const l=Ma(e);for(;l.length&&t.textWidth(e)+n>i;){for(l.pop();l.length&&l.at(-1).trim()==="";)l.pop();e=l.join("")}return iy(e)}function bx(e,t,i=0){const s=e.split(gr),n=et(t.font),o=[];if(t.textWrap==="never"){for(const c of s){const h=Hl(c.trimEnd(),n,Math.max(0,t.maxWidth-i));if(!h)break;o.push(h),i=0}return FN(o,t)?[]:o}const a=t.textWrap==="hyphenate",r=t.textWrap==null||t.textWrap==="on-space";for(const c of s){let h=c.trimEnd();if(h===""){o.push(h);continue}let d=Ma(h),u=0,p=0,f=0,y=0;for(o.length||(f=i);ut.maxWidth){if(u===0){h="";break}let b=n.textWidth(h.slice(0,p+x.length));if(o.length||(b+=i),b<=t.maxWidth){f=b,p+=x.length,u++;continue}if(y){const D=PG(h,y+1),I=n.textWidth(D);if(I<=t.maxWidth){o.push(h.slice(0,y).trimEnd()),h=h.slice(y).trimStart(),d=Ma(h),u=0,p=0,f=0,y=0;continue}else r&&I>t.maxWidth&&o.push(h.slice(0,y).trimEnd(),Hl(h.slice(y).trimStart(),n,t.maxWidth,!0))}else if(r){const D=Hl(h,n,t.maxWidth,!0);D&&o.push(D)}if(r){h="";break}const v=a?"-":"";let S=h.slice(0,p).trim();const M=Ma(S);for(;M.length&&n.textWidth(S+v)>t.maxWidth;){for(M.pop();M.length&&M.at(-1).trim()==="";)M.pop();S=M.join("")}if(S&&S!==Ld)o.push(sy(S)+v);else{h="";break}h=h.slice(S.length).trimStart(),d=Ma(h),u=0,p=0,f=0,y=0;continue}p+=x.length,u++}h&&o.push(h)}EG(o,n,t);const l=YM(o,n,t);return FN(l,t)?[]:l}function PG(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}function YM(e,t,i){if(!je(i.maxHeight))return e;const{height:s,lineMetrics:n}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let o=0,a=0;oi.maxHeight){if(i.overflow==="hide"||o===0)return[];const r=e.slice(0,o),l=r.pop();return r.concat(mr(l)?l:Hl(l,t,i.maxWidth,!0))}return e}function EG(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:s}=e,n=e[s-1],o=e[s-2];if(Ma(o).lengthi){s.length&&a();break}if(n+r<=t.maxWidth){n+=r,o+=l,s.push(...c);continue}for(const h of c){if(n+h.textMetrics.width<=t.maxWidth){n+=h.textMetrics.width,s.push(h);continue}const d=et(h),u=S0(h.text),p={...t,font:h,maxHeight:i-o};let f=bx(u,{...p,overflow:"hide"},n);if(f.length===0)if(t.textWrap==="never")f=bx(u,p,n);else{f=bx(u,p);const b=s.at(-1);b&&(b.text+=` `,n=0)}if(f.length===0){a();break}const y=f.findIndex(mr);y!==-1&&(f=f.slice(0,y+1));const x=f.at(-1);for(const b of f){const v=M0(b),S=d.measureText(v),M={...h,text:v,textMetrics:S};b===x?n+=S.width:(M.text+=` `,n=0),o+=S.height,s.push(M)}if(y!==-1)break}}return s}function Zg(e,[t,i],[s,n]){const o=n-s,a=i-t,r=t+a*e[0],l=t+a*e[1];return[(r-s)/o,(l-s)/o]}var oh=1e3,Br=oh*60,Gl=Br*60,jl=Gl*24,ZM=jl*7,Sx=jl*30,pu=jl*365,gu=new Date().getTimezoneOffset()*Br,fu={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:oh,hierarchy:"day",encode(e,t){const i=t?0:gu;return Math.floor((e.getTime()-i)/oh)},decode(e,t){const i=t?0:gu;return new Date(i+e*oh)}},minute:{milliseconds:Br,hierarchy:"day",encode(e,t){const i=t?0:gu;return Math.floor((e.getTime()-i)/Br)},decode(e,t){const i=t?0:gu;return new Date(i+e*Br)}},hour:{milliseconds:Gl,hierarchy:"day",encode(e,t){const i=t?0:gu;return Math.floor((e.getTime()-i)/Gl)},decode(e,t){const i=t?0:gu;return new Date(i+e*Gl)}},day:{milliseconds:jl,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*Br;return Math.floor((e.getTime()-i)/jl)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:Sx,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const i=Math.floor(e/12),s=e-i*12;return new Date(Date.UTC(i,s,1))}else{const i=Math.floor(e/12),s=e-i*12;return new Date(i,s,1)}}},year:{milliseconds:pu,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){let i;return t?(i=new Date,i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):i=new Date(e,0,1,0,0,0,0),i}}};function mu(e){return typeof e=="string"?{unit:e,step:1,epoch:void 0,utc:!1}:{unit:e.unit,step:e.step??1,epoch:e.epoch,utc:e.utc??!1}}function Xg(e,t,i,s){if(i==null)return 0;const n=fu[e];return Math.floor(n.encode(new Date(i),s))%t}function yu(e,t,i,s,n){const o=fu[t];return Math.floor((o.encode(new Date(e),s)-n)/i)}function xu(e,t,i,s,n){return fu[t].decode(e*i+n,s)}function Mx(e,t,i,s,n){const o=new Date(e),a=yu(o,t,i,s,n);return xu(a,t,i,s,n)}function Dx(e,t,i,s,n){const o=new Date(Number(e)-1),a=yu(o,t,i,s,n);return xu(a+1,t,i,s,n)}function tn(e,t){const{unit:i,step:s,epoch:n,utc:o}=mu(e),a=Xg(i,s,n,o);return Mx(t,i,s,o,a)}function XM(e,t){const{unit:i,step:s,epoch:n,utc:o}=mu(e),a=Xg(i,s,n,o);return Dx(t,i,s,o,a)}function qM(e,t){const{unit:i,step:s,epoch:n,utc:o}=mu(e),a=Xg(i,s,n,o);return xu(yu(Dx(t,i,s,o,a),i,s,o,a)-1,i,s,o,a)}function Ix(e,t){const{unit:i,step:s,epoch:n,utc:o}=mu(e),a=Xg(i,s,n,o);return xu(yu(Mx(t,i,s,o,a),i,s,o,a)+1,i,s,o,a)}function kx(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const s=t.valueOf()-e.valueOf(),n=e.valueOf();e=new Date(n+i[0]*s),t=new Date(n+i[1]*s)}return[new Date(e),new Date(t)]}function qg(e,t,i,{extend:s=!1,visibleRange:n=[0,1],limit:o,defaultAlignment:a="start"}={}){const r=mu(e),{unit:l,step:c,utc:h}=r;let d;r.epoch!=null?d=r.epoch:a==="interval"?d=void 0:t.valueOf()>i.valueOf()?d=i:d=t;const u=Xg(r.unit,r.step,d,r.utc);let[p,f]=kx(t,i,n);p=s?Mx(p,l,c,h,u):Dx(p,l,c,h,u),f=s?Dx(f,l,c,h,u):Mx(f,l,c,h,u);const y=yu(p,l,c,h,u);let x=yu(f,l,c,h,u);return o!=null&&x-y>o&&(x=y+o),{range:[y,x],unit:l,step:c,utc:h,offset:u}}function Qg(e,t,i,s){const{range:[n,o]}=qg(e,t,i,s);return Math.abs(o-n)}function mn(e,t,i,s){const{range:[n,o],unit:a,step:r,utc:l,offset:c}=qg(e,t,i,s),h=[];for(let d=n;d<=o;d+=1){const u=xu(d,a,r,l,c);h.push(u)}return h}function QM(e,t,i,s){const{range:[n,o],unit:a,step:r,utc:l,offset:c}=qg(e,t,i,s),h=Math.max(0,o-n+1),d=new Array(h);for(let u=0;u0?1:-1))}else if(s.setMonth(e.getMonth()+t),t!==0)for(;s.getMonth()===e.getMonth();)s.setDate(s.getDate()+(t>0?1:-1));return s}},year:{adjust(e,t,i){const s=new Date(e.getTime());return i?s.setUTCFullYear(e.getUTCFullYear()+t):s.setFullYear(e.getFullYear()+t),s}}};function tD(e,t){const{unit:i,step:s,utc:n}=mu(e);return BG[i].adjust(t,-s,n)}function wo(e){return typeof e=="string"?e:e.unit}function Jo(e){return typeof e=="string"?1:e.step??1}function Wl(e){return typeof e=="string"?void 0:e.epoch}function bu(e){return fu[wo(e)].hierarchy}function Yi(e){return Jo(e)*fu[wo(e)].milliseconds}var _N=["millisecond","second","minute","hour","day","month","year"];function iD(e){return Ge(e)?"unit"in e&&_N.includes(e.unit):!1}function sD(e){return Pt(e)&&_N.includes(e)}var Xt=(e,t)=>({duration:Yi(e)*t,timeInterval:e,step:t}),Jg=[Xt({unit:"second"},1),Xt({unit:"second"},5),Xt({unit:"second"},15),Xt({unit:"second"},30),Xt({unit:"minute"},1),Xt({unit:"minute"},5),Xt({unit:"minute"},15),Xt({unit:"minute"},30),Xt({unit:"hour"},1),Xt({unit:"hour"},3),Xt({unit:"hour"},6),Xt({unit:"hour"},12),Xt({unit:"day"},1),Xt({unit:"day"},2),Xt({unit:"day",step:7},1),Xt({unit:"day",step:7},2),Xt({unit:"day",step:7},3),Xt({unit:"month"},1),Xt({unit:"month"},2),Xt({unit:"month"},3),Xt({unit:"month"},4),Xt({unit:"month"},6),Xt({unit:"year"},1)],HN=[1,2,5,10];function GN(e,t){return Math.abs(Math.round(e)-e)=i?Math.abs(t-e)/i+1:1}function ah(e,t,i,s,n,o){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(i<2)return{ticks:[e,t],count:2,firstTickIndex:0};const a=rh(e,t,i,s,n);if(!Number.isFinite(a))return{ticks:[],count:0,firstTickIndex:void 0};let r=e,l=t;GN(r/a,1e-12)||(r=Math.ceil(r/a)*a),GN(l/a,1e-12)||(l=Math.floor(l/a)*a),o!=null&&(o=Zg(o,[e,t],[r,l]));const{ticks:c}=lh(r,l,a,o),h=c.at(0);return{ticks:c,count:jN(r,l,a),firstTickIndex:h==null?void 0:Math.round((h-r)/a)}}var FG=Math.floor(2*ZM/Sx*10)/10;function WN({timeInterval:e,step:t}){const i=Yi(e)*t,s=bu(e),n=s?Yi(s):void 0;return i<=(n??1/0)*FG}function wx(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function vu(e,t,i,s,n,{weekStart:o,primaryOnly:a=!1,targetInterval:r}){if(i<=0)return;const l=r??Math.abs(t-e)/Math.max(i,1),c=Jg.findLast(p=>(!a||WN(p))&&l>p.duration),h=Jg.find(p=>(!a||WN(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max(rh(e,t,i,s,n),1)};if(h==null)return{unit:"year",step:r==null?rh(e/pu,t/pu,i,s,n):1};const{timeInterval:d,step:u}=l-c.duration=s&&d<=n;if(c&&!u)continue;const p=Math.abs(d-i);(l>p||c!==u)&&(c||(c=u),l=p,r=h)}return r*a}function $N(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function Cx(e,t){const i=fg(t??",f");if(i==null)return;(i.precision==null||Number.isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n))return 0;const[o,a]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(o!=="1"&&o!=="-1"?1:0)+$N(a)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const o=Math.floor(Math.log10(Math.abs(n))),a=i.type?6:12,r=n.toExponential(a-1).split(/[.e]/g)[1],l=$N(r);return Math.max(0,l-o)}))));const s=uy(i);return n=>s(Number(n))}function lh(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const n=10**Uc(i),o=Math.min(e,t),a=Math.max(e,t);let r,l;if(s!=null&&(s[0]!==0||s[1]!==1)){const d=t-e,u=e+d*s[0],p=t-d*(1-s[1]);r=Math.min(u,p),l=Math.max(u,p)}else r=o,l=a;r=Math.floor(r*n)/n,l=Math.ceil(l*n)/n;const c=[];for(let d=0;;d+=1){const u=Math.round((o+i*d)*n)/n;if(u>a)break;u>=r&&u<=l&&c.push(u)}const h=c.at(0);return{ticks:c,count:jN(o,a,i),firstTickIndex:h==null?void 0:Math.round((h-o)/i)}}function $l(e,t){return e>=t?(Bn("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function Lx(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let n=1/0,o=[e,t];for(const a of HN){const r=a*s,l=Math.floor(e/r)*r,c=Math.ceil(t/r)*r,h=1-i/Math.abs(c-l);n>h&&(n=h,o=[l,c])}return o}function Nx(e,t,i,s,n,o){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,e/(n+1)),i??(i=o),s??(s=e),i>s&&(i===o?i=s:s=i),i=Math.max(i,1);const a=Math.max(1,Math.floor(e/(t*i))),r=Math.min(a,Math.ceil(e/(t*s))),l=se(r,Math.floor(n/t),a);return{minTickCount:r,maxTickCount:a,tickCount:l}}function Zi(e){return e instanceof Date?e.getTime():e}function Su(e){return e{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}function Tx(e){return e!=null&&Object.hasOwn(e,"toString")&&Pt(e.toString())}function nD(e){return e!=null&&Object.hasOwn(e,"valueOf")&&je(e.valueOf())}function ch(e){return je(e)||Sa(e)||nD(e)}function oD(e,t){return e!=null&&(!t||ch(e))}function nf(e){return Tx(e)&&Object.hasOwn(e,"id")?e.id:e}function Ox(e){return Tx(e)&&Object.hasOwn(e,"value")?e.value:e}var H={};$s(H,{add:()=>_G,angle:()=>$G,apply:()=>ej,distance:()=>GG,distanceSquared:()=>jG,equal:()=>QG,from:()=>JG,gradient:()=>UG,intercept:()=>YG,intersectAtX:()=>XG,intersectAtY:()=>ZG,length:()=>Px,lengthSquared:()=>KN,multiply:()=>HG,normalized:()=>WG,origin:()=>UN,required:()=>tj,rotate:()=>KG,round:()=>qG,sub:()=>aD});function _G(e,t){return typeof t=="number"?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function aD(e,t){return typeof t=="number"?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function HG(e,t){return typeof t=="number"?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function Px(e){return Math.hypot(e.x,e.y)}function KN(e){return e.x*e.x+e.y*e.y}function GG(e,t){return Px(aD(e,t))}function jG(e,t){return KN(aD(e,t))}function WG(e){const t=Px(e);return{x:e.x/t,y:e.y/t}}function $G(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function KG(e,t,i=UN()){const s=Px(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function UG(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function YG(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function ZG(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function XG(e,t,i=0,s){const n=e===1/0?1/0:e*i+t;return{x:i,y:s==null?n:s-n}}function qG(e,t=2){return{x:Vd(e.x,t),y:Vd(e.y,t)}}function QG(e,t){return e.x===t.x&&e.y===t.y}function JG(e,t){if(typeof e=="number")return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function ej(e,t){return e.x=t.x,e.y=t.y,e}function tj(e){return{x:e?.x??0,y:e?.y??0}}function UN(){return{x:0,y:0}}var Se={};$s(Se,{bottomCenter:()=>aj,center:()=>oj,clone:()=>hj,collides:()=>dj,end:()=>sj,from:()=>uj,height:()=>lj,normalise:()=>Ex,origin:()=>pj,round:()=>cj,start:()=>ij,topCenter:()=>nj,width:()=>rj});function ij(e){return{x:e.x1,y:e.y1}}function sj(e){return{x:e.x2,y:e.y2}}function nj(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function oj(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function aj(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function rj(e){return Math.abs(e.x2-e.x1)}function lj(e){return Math.abs(e.y2-e.y1)}function cj(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function hj(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function dj(e,t){const i=Ex(e),s=Ex(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function Ex(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function uj(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return Ex({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)}function pj(){return{x1:0,y1:0,x2:0,y2:0}}function qt(e){return me(e)&&e.type=="gradient"}function YN(e){return Ae(e)&&e.every(qt)}function rD(e){return Ae(e)&&e.every(t=>typeof t=="string")}function Un(e){return e!==null&&me(e)&&e.type=="pattern"}function ea(e){return e!==null&&me(e)&&e.type=="image"}function ZN(e){return qt(e)||Un(e)}function ta(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function of(e,t,i,s,n){if(n<=Math.min(e,s))return e=Math.max(e,s))return e0&&l<1)return[l]}return[]}const r=o*o-4*n*a;if(r>=0){const l=Math.sqrt(r),c=(-o+l)/(2*n),h=(-o-l)/(2*n);return[c,h].filter(d=>d>0&&d<1)}return[]}function lD(e,t,i,s,n,o,a,r){const l=XN(e,i,n,a),c=XN(t,s,o,r);return[...l,...c]}function cD(e,t,i){const s=ta(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=ta(e[0].y,e[1].y,e[2].y,e[3].y,.5),o=Math.hypot(s-t,n-i),a=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:o,minDistance:a}}function hD(e,t,i,s,n,o,a,r,l,c,h=1){let u={value:cD([{x:e,y:t},{x:i,y:s},{x:n,y:o},{x:a,y:r}],l,c),next:null},p;for(;u!=null;){const{points:f,distance:y,minDistance:x}=u.value;if(u=u.next,(p==null||yt.minDistance-e.minDistance;function gj({point:e,anchor:t},i,s,n,o){if(e.size===0)return!1;let a=e.x,r=e.y;t!=null&&(a-=(t.x-.5)*e.size,r-=(t.y-.5)*e.size);let l=a;ai+n&&(l=i+n);let c=r;rs+o&&(c=s+o);const h=a-l,d=r-c;return Math.hypot(h,d)<=e.size/2}function dD(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var fj={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function uD(e,t,i=5){const s=new Map,n=[],o=new Map(Array.from(e.entries(),([r,l])=>[r,l.toSorted((c,h)=>h.point.size-c.point.size)])),a=[...o.values()].flat();for(const[r,l]of o.entries()){const c=[];if(l[0]?.label){for(let h=0,d=l.length;h0&&u.placement!=null){const A=fj[u.placement];M=(b/2+S+i)*A.x,D=(v/2+S+i)*A.y}let I=p.x-b/2+M,k=p.y-v/2+D;if(y&&(I-=(y.x-.5)*p.size,k-=(y.y-.5)*p.size),Wg(t,I,k,b,v)&&!a.some(A=>gj(A,I,k,b,v))&&!n.some(A=>nx(A,I,k,b,v))){const A={index:h,text:x,x:I,y:k,width:b,height:v,datum:u};c.push(A),n.push(A)}}s.set(r,c)}}return s}function QN(e){return e.type==="continuous"||e.type==="log"}function JN(e){return e.type==="category"}function _r(e){return"variant"in e&&e.variant==="unit-time"}function eT(e){return!("variant"in e)}function ia(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:QN(e)&&QN(t)?e.type===t.type&&Vn(e.domain,t.domain)&&Vn(e.range,t.range):JN(e)&&JN(t)?_r(e)&&_r(t)?e.firstBandTime===t.firstBandTime&&e.lastBandTime===t.lastBandTime&&e.bandCount===t.bandCount&&e.intervalMs===t.intervalMs&&e.inset===t.inset&&e.step===t.step:eT(e)&&eT(t)?e.inset===t.inset&&e.step===t.step&&Vn(e.domain,t.domain):!1:!1}function Kl(e){return e==null?!1:e.type==="category"?_r(e)?Number.isFinite(e.firstBandTime)&&Number.isFinite(e.lastBandTime)&&Number.isFinite(e.bandCount)&&e.bandCount>0:e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function cs(e){switch(e.type){case"linear":case"step":case"multi-line":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function mj(e){const t=cs(e);return t[0].x>t[1].x&&t.reverse(),t}function af(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,midPoints:e.midPoints.map(()=>({x:i,y:s}))}}}function hh(e,t,i){const[s,n]=cs(e),o=n.x===s.x?0:(i.x-t.x)/(n.x-s.x),a=n.y===s.y?0:(i.y-t.y)/(n.y-s.y);switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*o,cp1y:i.y-(e.cp2y-s.y)*a,cp2x:i.x-(e.cp1x-s.x)*o,cp2y:i.y-(e.cp1y-s.y)*a,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*o};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,midPoints:e.midPoints.map(r=>({x:t.x+(r.x-s.x)*o,y:t.y+(r.y-s.y)*a}))}}}function Rx(e,t,i){const{moveTo:s}=e,[n,o]=mj(e),{x:a,y:r}=n,{x:l,y:c}=o;if(il)return hh(e,o,o);switch(e.type){case"linear":{const h=r===c?void 0:(c-r)/(l-a),d=h==null?r:h*(t-a)+r,u=h==null?r:h*(i-a)+r;return{type:"linear",moveTo:s,x0:t,y0:d,x1:i,y1:u}}case"step":if(i<=e.stepX){const h=e.y0;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:i}}else if(t>=e.stepX){const h=e.y1;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:t}}else{const{y0:h,y1:d,stepX:u}=e;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:d,stepX:u}}case"cubic":{const h=of(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[d,u]=Du(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=of(u[0].x,u[1].x,u[2].x,u[3].x,i);return[u,d]=Du(u[0].x,u[0].y,u[1].x,u[1].y,u[2].x,u[2].y,u[3].x,u[3].y,p),{type:"cubic",moveTo:s,cp0x:u[0].x,cp0y:u[0].y,cp1x:u[1].x,cp1y:u[1].y,cp2x:u[2].x,cp2y:u[2].y,cp3x:u[3].x,cp3y:u[3].y}}case"multi-line":{const{midPoints:h}=e,d=h.findLastIndex(I=>I.x<=t);let u=h.findIndex(I=>I.x>=i);u===-1&&(u=h.length);const p=d>=0?h[d]:void 0,f=p?.x??a,y=p?.y??r,x=u(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(pD||{});function gD(e){const t=[];let i=0,s=Number.NaN,n=Number.NaN;for(const{x:o,y:a}of e){if(i>0){const r=i===1;t.push({type:"linear",moveTo:r,x0:s,y0:n,x1:o,y1:a})}i+=1,s=o,n=a}return t}var yj={start:0,middle:.5,end:1};function fD(e,t){const i=[];let s=0,n=Number.NaN,o=Number.NaN;const a=typeof t=="number"?t:yj[t];for(const{x:r,y:l}of e){if(s>0){const c=s===1,h=n+(r-n)*a;i.push({type:"step",moveTo:c,x0:n,y0:o,x1:r,y1:l,stepX:h})}s+=1,n=r,o=l}return i}function mD(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=.05,n=i.map((a,r)=>{const l=r===0?a:i[r-1],c=r===i.length-1?a:i[r+1],h=r===0||r===i.length-1;if(Math.sign(l.y-a.y)===Math.sign(c.y-a.y))return 0;if(!h){const d=Math.abs(l.y-c.y),u=Math.abs(a.y-l.y)/d,p=Math.abs(a.y-c.y)/d;if(u<=s||1-u<=s||p<=s||1-p<=s)return 0}return(c.y-l.y)/(c.x-l.x)});n[1]===0&&(n[0]*=2),n.at(-2)===0&&(n[n.length-1]*=2);const o=[];for(let a=1;aMath.abs(u)&&(p*=Math.abs(u/f),f=Math.sign(f)*Math.abs(u)),l===0&&Math.abs(x)>Math.abs(u)&&(y*=Math.abs(u/x),x=Math.sign(x)*Math.abs(u)),o.push({type:"cubic",moveTo:a===1,cp0x:r.x,cp0y:r.y,cp1x:r.x+p,cp1y:r.y+f,cp2x:c.x-y,cp2y:c.y-x,cp3x:c.x,cp3y:c.y})}return o}var yn=0,Ai=1;function Lt(e){return{x:{min:e?.x?.min??yn,max:e?.x?.max??Ai},y:{min:e?.y?.min??yn,max:e?.y?.max??Ai}}}var dh=class extends q{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},zx={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function yD(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function tT(e,t){const s=new Date(e.getFullYear(),0,1).getDay(),n=(t-s+7)%7,o=new Date(e.getFullYear(),0,n+1);return o<=e?Math.floor(yD(e,o)/7)+1:0}var xj=0,iT=1,sT=4;function nT(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(sT-s+7)%7,o=new Date(t,0,n-(sT-iT)+1);return o<=e?Math.floor(yD(e,o)/7)+1:nT(e,t-1)}function bj(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${hs(Math.floor(i/60),2,"0")}${hs(Math.floor(i%60),2,"0")}`}var vj={a:e=>zx.shortDays[e.getDay()],A:e=>zx.days[e.getDay()],b:e=>zx.shortMonths[e.getMonth()],B:e=>zx.months[e.getMonth()],c:"%x, %X",d:(e,t)=>hs(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>hs(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>hs(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":hs(i,2,t??"0")},j:(e,t)=>hs(yD(e)+1,3,t??"0"),m:(e,t)=>hs(e.getMonth()+1,2,t??"0"),M:(e,t)=>hs(e.getMinutes(),2,t??"0"),L:(e,t)=>hs(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>hs(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>hs(tT(e,xj),2,t??"0"),V:(e,t)=>hs(nT(e),2,t??"0"),w:(e,t)=>hs(e.getDay(),2,t??"0"),W:(e,t)=>hs(tT(e,iT),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>hs(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>hs(e.getFullYear(),4,t??"0"),Z:e=>bj(e),"%":()=>"%"},Sj={_:" ",0:"0","-":""};function hs(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function uh(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const r=i>0?e.substring(0,i):e;t.push(r)}if(i<0)break;const s=e[i+1],n=Sj[s];n!=null&&i++;const o=e[i+1],a=vj[o];if(typeof a=="function")t.push([a,n]);else if(typeof a=="string"){const r=uh(a);t.push([r,n])}else t.push(`${n??""}${o}`);e=e.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return t.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}function Iu(e,t){const i=ke("button",Vx("ag-charts-input ag-charts-button",t));return e.label===void 0?(i.append(SD(e.icon)),i.ariaLabel=e.altText):i.append(e.label),i.addEventListener("click",e.onPress),Do(i,t),i}function xD(e,t){const i=ke("input",Vx("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",s=>e.onChange(i.checked,s)),i.addEventListener("keydown",s=>{gx(s)&&(s.preventDefault(),i.click())}),Do(i,t),i}function bD(e,t){const i=ke("select",Vx("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const n=ke("option");return n.value=s.value,n.textContent=s.label,n})),Fe(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),Do(i,t),i}function vD(e,t){const i=ke("textarea",Vx("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),Do(i,t),Fe(i,"data-preventdefault",!1),i}function SD(e){const t=ke("span",`ag-charts-icon ag-charts-icon-${e}`);return Fe(t,"aria-hidden",!0),t}function Vx(e,t){return t==null?e:`${e} ${t.class}`}var MD=e=>e,oT=e=>1-Math.cos(e*Math.PI/2),Ea=e=>Math.sin(e*Math.PI/2),aT=e=>-(Math.cos(e*Math.PI)-1)/2,rT=e=>e*e,lT=e=>1-(1-e)**2,cT=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,DD=e=>2*Math.asin(e)/Math.PI,ph=(e,t)=>e===t;function K(e){return function(t,i){const s=`__${i}`;t[i]||ID(t,i,s,e)}}function rf(e){return K(e)}function Hr(e){return K(e)}function ku(e){const t=e??{};return t.equals=Vn,K(e)}function Ee(e){return function(t,i){const s=`__${i}`;t[i]||ID(t,i,s,e)}}function Au(e){return function(t,i){const s=`__${i}`;t[i]||ID(t,i,s,e)}}function ID(e,t,i,s){const{changeCb:n,convertor:o,checkDirtyOnAssignment:a=!1}=s??{},r={changeCb:n,checkDirtyOnAssignment:a,convertor:o},l=Ij(i,Dj(Mj(kj(i,r),r),r),r);function c(){return this[i]}Object.defineProperty(e,t,{set:l,get:c,enumerable:!0,configurable:!0})}function Mj(e,t){const{convertor:i}=t;if(i){let n=function(a){e.call(this,o(a))};var s=n;const o=i;return n}return e}var hT=Symbol("no-change");function Dj(e,t){const{changeCb:i}=t;if(i){let n=function(a){const r=e.call(this,a);return r!==hT&&o.call(this,this),r};var s=n;const o=i;return n}return e}function Ij(e,t,i){const{checkDirtyOnAssignment:s}=i;if(s){let o=function(a){const r=t.call(this,a);return a?._dirty===!0&&this.markDirty(e),r};var n=o;return o}return t}function kj(e,t){const{equals:i=ph}=t;function s(n){const o=this[e];return i(n,o)?hT:(this[e]=n,this.onChangeDetection(e),n)}return s}var dT={ariaInitSeriesArea:"interactive chart",ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceStandaloneChart:"chart, ${caption}",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColor:"Color",ariaLabelColorPicker:"Color picker",ariaLabelColorPickerAlpha:"Transparency",ariaLabelColorPickerHue:"Hue",ariaLabelColorPickerMultiColor:"Multi Color",ariaLabelColorPickerPalette:"Palette",ariaLabelFinancialCharts:"Financial Charts",ariaLabelGaugeTarget:"Target",ariaLabelGaugeValue:"Value",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelScrollbarHorizontal:"X-axis scrollbar",ariaLabelScrollbarVertical:"Y-axis scrollbar",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaRoleDescription2DSlider:"2D slider",ariaValueColorPalette:"s ${s}[percent0to2dp], v ${v}[percent0to2dp]",ariaValueColorPaletteFirstV:"v ${v}[percent0to2dp], s ${s}[percent0to2dp]",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarRangeSelectRange:"Select range",toolbarRangeSelectRangeAria:"Select range",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"};function uT(e,t,i,s){return{unit:e,step:t,epoch:i,utc:s,every(n){return uT(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var pT={};function fi(e,t=1,i,s=!1){W.warnOnce("time import is deprecated, use object notation instead");const n=`${e}:${t}:${i?.getTime()??0}:${s}`;let o=pT[n];return o==null&&(o=uT(e,t,i,s),pT[n]=o),o}var Aj={get millisecond(){return fi("millisecond")},get second(){return fi("second")},get minute(){return fi("minute")},get hour(){return fi("hour")},get day(){return fi("day")},get monday(){return fi("day",7,new Date(1970,0,5))},get tuesday(){return fi("day",7,new Date(1970,0,6))},get wednesday(){return fi("day",7,new Date(1970,0,7))},get thursday(){return fi("day",7,new Date(1970,0,1))},get friday(){return fi("day",7,new Date(1970,0,2))},get saturday(){return fi("day",7,new Date(1970,0,3))},get sunday(){return fi("day",7,new Date(1970,0,4))},get month(){return fi("month")},get year(){return fi("year")},get utcMillisecond(){return fi("millisecond",1,void 0,!0)},get utcSecond(){return fi("second",1,void 0,!0)},get utcMinute(){return fi("minute",1,void 0,!0)},get utcHour(){return fi("hour",1,void 0,!0)},get utcDay(){return fi("day",1,void 0,!0)},get utcMonth(){return fi("month",1,void 0,!0)},get utcYear(){return fi("year",1,void 0,!0)}},Bx=Symbol("interpolate"),Fx=e=>e[Bx]!=null,lf=class ig{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromObject({x:t,y:i,width:s,height:n}){return new ig(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,o=-1/0;for(const a of t)a.xn&&(n=Os(a.x,a.width)),Os(a.y,a.height)>o&&(o=Os(a.y,a.height));return new ig(i,s,n-i,o-s)}static nearestBox(t,i,s){return hu(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:Os(this.x,this.width),bottom:Os(this.y,this.height),toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new ig(t,i,s,n)}equals(t){return $g(this,t)}containsPoint(t,i){return Wg(this,t,i)}intersectsWith(t){return!(this.x+this.width<=t.x||t.x+t.width<=this.x||this.y+this.height<=t.y||t.y+t.height<=this.y)}intersection(t){const i=Math.max(this.x,t.x),s=Math.max(this.y,t.y),n=Math.min(Os(this.x,this.width),Os(t.x,t.width)),o=Math.min(Os(this.y,this.height),Os(t.y,t.height));if(!(i>n||s>o))return new ig(i,s,n-i,o-s)}collidesBBox(t){return this.xt.x&&this.yt.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,i){if(this.containsPoint(t,i))return 0;const s=t-se(this.x,t,Os(this.x,this.width)),n=i-se(this.y,i,Os(this.y,this.height));return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[Bx](t,i){return new ig(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};lf.zero=Object.freeze(new lf(0,0,0,0)),lf.NaN=Object.freeze(new lf(Number.NaN,Number.NaN,Number.NaN,Number.NaN));var re=lf;function Os(e,t){return e===-1/0&&t===1/0?1/0:e+t}function gT({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function fT(e){if(ve.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function mT(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var kD;function wj(){const e=rg();return kD??(kD=new e(1,1)),kD}var AD=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[o,a]=mT(t,i,s),r=rg();this.canvas=new r(o,a),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),fT(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.width<1||this.canvas.height<1?wj().transferToImageBitmap():this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[o,a]=mT(e,t,i);s.width=o,s.height=a}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){gT(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},wD=(e,t)=>Math.sign(e-t);function yT(e,t){if(typeof e=="number"&&typeof t=="number")return wD(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let o=0;o(e[e.All=0]="All",e[e.None=1]="None",e))(xT||{}),Cj=5,gh=class wL{constructor(t){this.serialNumber=wL._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=gi(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=t?.name,this.tag=t?.tag??Number.NaN,this.zIndex=t?.zIndex??0,this.scene=t?.scene,(t?.debugDirty??wL._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const o=jt("svg");if(o.setAttribute("width",String(i)),o.setAttribute("height",String(s)),o.setAttribute("viewBox",`0 0 ${i} ${s}`),o.setAttribute("overflow","visible"),n.defs?.length){const a=jt("defs");a.append(...n.defs),o.append(a)}return o.append(...n.elements),o.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=Cj)throw i.errorCount=s,i;W.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){t&&(yield this);let i=this.parentNode;for(;i;)yield i,i=i.parentNode}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode&&this.remove()}batchedUpdate(t){this.batchLevel++;try{t()}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}}setProperties(t){this.batchLevel++;try{Ay(this,t)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}setPropertiesWithKeys(t,i){this.batchLevel++;try{Ay(this,t,i)}finally{this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}return this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox??(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],s=new Error("Stack trace for property change tracking").stack?.split(` `).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,i)}debugDirtyProperties(){if(this._debugDirtyProperties!=null){if(!this._debugDirtyProperties.has("__first__"))for(const[t,i]of this._debugDirtyProperties.entries())i.length>1&&W.logGroup(`Property changed multiple times before render: ${this.constructor.name}.${t} (${i.length}x)`,()=>{for(const s of i)W.log(s)});this._debugDirtyProperties.clear()}}static handleNodeZIndexChange(t){t.onZIndexChange()}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}resolveFont(){}toSVG(){}};gh.className="AbstractNode",gh._nextSerialNumber=0,gh._debugEnabled=!1,g([Ee()],gh.prototype,"visible",2),g([Ee({equals:Ht,changeCb:gh.handleNodeZIndexChange})],gh.prototype,"zIndex",2);var Gr=gh,_x=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},Hx=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})};function bT(e,t,i){if(i==null||i[0]===0&&i[1]===1)return;const s=se(0,Math.floor(i[0]*e.length),e.length),n=se(0,Math.ceil(i[1]*e.length),e.length),o=t?e.length-n:s,a=t?e.length-s:n;return[o,a]}function vT(e,t,i){return bT(e,t,i)??[0,e.length]}function ST(e,t,i){const s=bT(e,t,i);if(s==null)return{ticks:e,count:e.length,firstTickIndex:0};const[n,o]=s;return{ticks:e.slice(n,o),count:e.length,firstTickIndex:n}}function Gx(e){const t=Ox(e.at(0)),i=Ox(e.at(-1));return t!=null&&i!=null?[t,i]:[void 0,void 0]}var MT=e=>{const t=Ne.fromString(e),[i,s,n]=Ne.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},CD=1e-6,DT=e=>e.c1-CD,Lj=(e,t,i)=>{i=se(0,i,1);let s;if(DT(e))s=t.h;else if(DT(t))s=e.h;else{const r=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),s=r*(1-i)+l*i}const n=e.c*(1-i)+t.c*i,o=e.l*(1-i)+t.l*i,a=e.a*(1-i)+t.a*i;return Ne.fromOKLCH(o,n,s,a)},wu=class extends _x{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(MT)}update(){const{domain:e,range:t}=this;e.length<2&&(W.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;in){W.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((o,a)=>o-a);break}}if(t.length0?t[0]:"black");this.parsedRange=this.range.map(MT)}normalizeDomains(...e){return{domain:e.map(t=>t.domain).flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],o=t.at(-1),a=i[0],r=i.at(-1);if(e<=n)return a;if(e>=o)return r;let l,c;if(t.length===2){const u=(e-n)/(o-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(u*(i.length-1)),i.length-2),c=(u-l*p)/p}else{for(l=0;l{const{stop:s}=t,n=e.at(i+1)?.color;return n==null?[t]:[t,{stop:s,color:n}]})}function Ej(e,t){const i=t==="discrete"?1:0,s=e.map((n,o,{length:a})=>({stop:(o+i)/(a-1+i),color:n}));return t==="discrete"?IT(s):s}function kT(e,t,i,s="continuous"){const n=e.map(f=>typeof f=="string"?{color:f}:f);if(n.length===0)return Ej(t,s);if(!Pj(n))return W.warnOnce("[fills] must have the stops defined in ascending order"),[];const o=Math.min(...i),a=Math.max(...i),r=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let f=0;f=h){h=n.length-1;for(let b=f+1;bf.color!=null)?.color,u;const p=n.map((f,y)=>{let x=f?.color;const b=l[y];return x!=null?d=x:d==null?(u==null&&(u=new wu,u.domain=[0,1],u.range=t),x=u.convert(b)):x=d,{stop:b,color:x}});return s==="discrete"?IT(p):p}var Rj=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[n,o]=this.getSize(t.width,t.height,i,s);return n<1||o<1?(W.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let o=e,a=t,r=1;const l=i/s,c=e/t;return n==="stretch"||e===0||t===0?(o=i,a=s):n==="contain"?r=c>l?i/e:s/t:n==="cover"&&(r=c>l?s/t:i/e),[Math.max(1,o*r),Math.max(1,a*r)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:o}=this,a=this.imageLoader?.loadImage(i);if(!a)return;const r=qo(s),l=Math.cos(r),c=Math.sin(r),[h,d]=this.getSize(a.width,a.height,n??t.width,o??t.height),u=h/a.width,p=d/a.height,f=t.x+t.width/2,y=t.y+t.height/2,x=l*h-c*d,b=c*h+l*d,v=x/2,S=b/2,M=Zm();e?.setTransform(new M([l*u,c*p,-c*u,l*p,f-v,y-S]))}createPattern(e,t,i,s){const n=this.width??t,o=this.height??i,a=this._cache;if(a?.ctx===e&&a.width===n&&a.height===o)return a.pattern;const r=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(e,r,n,o);if(l!=null)return this._cache={ctx:e,pattern:l,width:n,height:o},l}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:o}=this,{x:a,y:r,width:l,height:c}=e,h=jt("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(a)),h.setAttribute("y",String(r)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const d=jt("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(o)),h.appendChild(d);const u=jt("image");return u.setAttribute("href",i),u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("preserveAspectRatio","none"),u.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(u),h}},zj=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,At=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,Vj=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,AT=/^[01]/,Bj={z:[],h:[At],v:[At],m:[At,At],l:[At,At],t:[At,At],s:[At,At,At,At],q:[At,At,At,At],c:[At,At,At,At,At,At],a:[At,At,At,AT,AT,At,At]};function Fj(e){if(!e)return;const t=[];let i=0,s;for(;i=0&&i<=1?[i]:[]}function Gj(e,t,i,s=1e-6){if(Math.abs(e)=0&&a<=1&&o.push(a)}else if(n>0){const a=Math.sqrt(n),r=(-t-a)/(2*e),l=(-t+a)/(2*e);r>=0&&r<=1&&o.push(r),l>=0&&l<=1&&o.push(l)}return o}function jj(e,t,i,s,n=1e-6){if(Math.abs(e)=0){const p=Math.sqrt(h),f=Math.sign(c+p)*Math.pow(Math.abs(c+p),d),y=Math.sign(c-p)*Math.pow(Math.abs(c-p),d),x=Math.abs(Math.sqrt(3)*(f-y)/2),b=-d*o+(f+y);if(b>=0&&b<=1&&u.push(b),Math.abs(x)=0&&v<=1&&u.push(v)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),f=d*o,y=2*Math.sqrt(-l),x=y*Math.cos(d*p)-f,b=y*Math.cos(d*(p+2*Math.PI))-f,v=y*Math.cos(d*(p+4*Math.PI))-f;x>=0&&x<=1&&u.push(x),b>=0&&b<=1&&u.push(b),v>=0&&v<=1&&u.push(v)}return u}function cf(e,t,i,s,n,o,a,r){const l=(i-e)*(r-o)-(s-t)*(a-n);if(l===0)return 0;const c=((a-n)*(t-o)-(e-n)*(r-o))/l,h=((i-e)*(t-o)-(s-t)*(e-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function Wj(e,t,i,s,n,o,a,r,l,c,h,d){let u=0;const p=c-d,f=h-l,y=l*(d-c)-c*(h-l),x=wT(e,i,n,a),b=wT(t,s,o,r),v=p*x[0]+f*b[0],S=p*x[1]+f*b[1],M=p*x[2]+f*b[2],D=p*x[3]+f*b[3]+y,I=jj(v,S,M,D);for(const k of I){const A=k*k,w=k*A,C=x[0]*w+x[1]*A+x[2]*k+x[3],T=b[0]*w+b[1]*A+b[2]*k+b[3];let O;l===h?O=(T-c)/(d-c):O=(C-l)/(h-l),O>=0&&O<=1&&u++}return u}function wT(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}var Cu=class{constructor(){this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0,this.cx=Number.NaN,this.cy=Number.NaN,this.sx=Number.NaN,this.sy=Number.NaN,this.openedPath=!1,this.closedPath=!1;const e=kd();this.path2d=new e}isEmpty(){return this.commandsLength===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commandsLength||this.previousParams.length!==this.paramsLength||this.previousCommands.toString()!==this.commands.slice(0,this.commandsLength).toString()||this.previousParams.toString()!==this.params.slice(0,this.paramsLength).toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands[this.commandsLength++]=0,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands[this.commandsLength++]=1,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,o){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,o),this.commands[this.commandsLength++]=2,this.params[this.paramsLength++]=e,this.params[this.paramsLength++]=t,this.params[this.paramsLength++]=i,this.params[this.paramsLength++]=s,this.params[this.paramsLength++]=n,this.params[this.paramsLength++]=o}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=Number.NaN,this.sy=Number.NaN,this.path2d.closePath(),this.commands[this.commandsLength++]=3,this.openedPath=!1,this.closedPath=!0)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,o,a,r=!1){const l=i,c=s/i,h=Math.cos(n),d=Math.sin(n),u=-c*d,p=c*h,f=l*Math.cos(o),y=l*Math.sin(o),x=e+h*f+u*y,b=t+d*f+p*y,v=(x-this.cx)**2+(b-this.cy)**2;this.openedPath?v>1e-6&&this.lineTo(x,b):this.moveTo(x,b);let S=r?-Qe(o-a):Qe(a-o);Math.abs(Math.abs(a-o)-2*Math.PI)<1e-6&&S<2*Math.PI&&(S+=2*Math.PI*(r?-1:1));const M=Math.max(Math.ceil(Math.abs(S)/(Math.PI/2)),1),D=S/M,I=4/3*Math.tan(D/4);for(let k=0;k=1?(b=Math.sqrt(b),i*=b,s*=b):(b=Math.sqrt(1/b-1),o===a&&(b=-b),M=b*i*x,D=-b*s*y,v+=u*M-d*D,S+=d*M+u*D);const I=Math.atan2((f-D)/s,(p-M)/i),k=Math.atan2((-f-D)/s,(-p-M)/i)-I,A=I+k,w=!!(1-a);this.ellipse(v,S,i,s,n,I,A,w)}clear(e){e?(this.previousCommands=this.commands.slice(0,this.commandsLength),this.previousParams=this.params.slice(0,this.paramsLength),this.previousClosedPath=this.closedPath,this.commands=[],this.params=[],this.commandsLength=0,this.paramsLength=0):(this.commandsLength=0,this.paramsLength=0);const t=kd();this.path2d=new t,this.openedPath=!1,this.closedPath=!1}isPointInPath(e,t){const i=this.commands,s=this.params,n=this.commandsLength,o=-1e4,a=-1e4;let r=Number.NaN,l=Number.NaN,c=0,h=0,d=0;for(let u=0,p=0;u({x:t,y:i})){const t=[],{commands:i,params:s}=this,n=(a,r)=>{t.push(a);for(let l=0;l{i=Math.min(p,i),s=Math.min(u,s),n=Math.max(u,n),o=Math.max(p,o),a=u,r=p};let d=0;for(let u=0;un!==0)){const n=i.length%2===1?[...i,...i]:i;e.setAttribute("stroke-dasharray",n.join(" ")),s!=null&&e.setAttribute("stroke-dashoffset",String(s))}}var Xi=class extends Gr{constructor(){super(...arguments),this.drawingMode="overlay",this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(t){if(qt(t))return this.createGradient(t)}createGradient(t){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:o=0,reverse:a=!1}=t;if(n==null)return;let r=kT(n,["black"],[0,1]);switch(a&&(r=r.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new Tj(i,r,o);case"radial":return new Oj(i,r);case"conic":return new Nj(i,r,o)}}getPattern(t){if(Un(t))return this.createPattern(t)}createPattern(t){return new Kj(t)}getImage(t){if(ea(t))return this.createImage(t)}createImage(t){return new Rj(this.imageLoader,t)}onFillChange(){typeof this.fill=="object"&&Ht(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(t,i){return Fi(this.layerManager?.canvas?.pixelRatio??1,t,i)}markDirty(t){super.markDirty(t),this.cachedDefaultGradientFillBBox=void 0}fillStroke(t,i){this.__drawingMode==="cutout"&&(t.globalCompositeOperation="destination-out",this.executeFill(t,i),t.globalCompositeOperation="source-over"),this.renderFill(t,i),this.renderStroke(t,i)}renderFill(t,i){const{__fill:s,__fillOpacity:n=1,fillImage:o}=this;if(s!=null&&s!=="none"&&n>0){const a=t.globalAlpha;o&&(t.globalAlpha=o.backgroundFillOpacity,t.fillStyle=o.backgroundFill,this.executeFill(t,i),t.globalAlpha=a),this.applyFillAndAlpha(t),this.applyShadow(t),this.executeFill(t,i),t.globalAlpha=a,this.fillShadow?.enabled&&(t.shadowColor="rgba(0, 0, 0, 0)")}}executeFill(t,i){i?t.fill(i):t.fill()}applyFillAndAlpha(t){const{__fill:i,fillGradient:s,fillPattern:n,fillImage:o,__fillOpacity:a=1,__opacity:r=1}=this,l=r*a;if(l!==1&&(t.globalAlpha*=l),s){const{fillBBox:c=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:h}=this;t.fillStyle=s.createGradient(t,c,h)??"black"}else if(n){const{x:c,y:h}=this.getBBox(),d=this.layerManager?.canvas?.pixelRatio??1,u=n.createPattern(t,d);n.setPatternTransform(u,d,c,h),u?t.fillStyle=u:(t.fillStyle=n.fill,t.globalAlpha*=n.fillOpacity)}else if(o){const c=this.getBBox(),h=o.createPattern(t,c.width,c.height,this);o.setImageTransform(h,c),t.fillStyle=h??"transparent"}else t.fillStyle=typeof i=="string"?i:"black"}applyStrokeAndAlpha(t){const{__stroke:i,__strokeOpacity:s=1,strokeGradient:n,__opacity:o=1}=this;t.strokeStyle=n?.createGradient(t,this.getBBox())??(typeof i=="string"?i:void 0)??"black";const a=o*s;a!==1&&(t.globalAlpha*=a)}applyShadow(t){const i=this.layerManager?.canvas.pixelRatio??1,{__fillShadow:s}=this;s?.enabled&&(t.shadowColor=s.color,t.shadowOffsetX=s.xOffset*i,t.shadowOffsetY=s.yOffset*i,t.shadowBlur=s.blur*i)}renderStroke(t,i){const{__stroke:s,__strokeWidth:n=0,__strokeOpacity:o=1,__lineDash:a,__lineDashOffset:r,__lineCap:l,__lineJoin:c,__miterLimit:h}=this;if(s!=null&&s!=="none"&&n>0&&o>0){const{globalAlpha:d}=t;this.applyStrokeAndAlpha(t),t.lineWidth=n,a&&t.setLineDash(a),r&&(t.lineDashOffset=r),l&&(t.lineCap=l),c&&(t.lineJoin=c),h!=null&&(t.miterLimit=h),this.executeStroke(t,i),t.globalAlpha=d}}executeStroke(t,i){i?t.stroke(i):t.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox??(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(t,i){return this.isPointInPath(t,i)}applySvgFillAttributes(t,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")t.setAttribute("fill",s);else if(qt(s)&&this.fillGradient){i??(i=[]);const o=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),a=cu();o.setAttribute("id",a),i.push(o),t.setAttribute("fill",`url(#${a})`)}else if(Un(s)&&this.fillPattern){i??(i=[]);const o=this.fillPattern.toSvg(),a=cu();o.setAttribute("id",a),i.push(o),t.setAttribute("fill",`url(#${a})`)}else if(ea(s)&&this.fillImage){i??(i=[]);const o=this.layerManager?.canvas?.pixelRatio??1,a=this.fillImage.toSvg(this.getBBox(),o),r=cu();a.setAttribute("id",r),i.push(a),t.setAttribute("fill",`url(#${r})`)}else t.setAttribute("fill","none");return t.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(t){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=this;Uj(t,{stroke:Pt(i)?i:void 0,strokeOpacity:s,strokeWidth:n}),Yj(t,{lineDash:o,lineDashOffset:a})}static handleFillChange(t){t.onFillChange()}static handleStrokeChange(t){t.onStrokeChange()}setStyleProperties(t,i,s){const n=t?.opacity??1,o=t?.fill,a=(t?.fillOpacity??1)*n,r=(t?.strokeOpacity??1)*n,l=t?.strokeWidth??0,c=t?.lineDashOffset??0;let h=!1;this.__fillOpacity!==a&&(this.__fillOpacity=a,h=!0),this.__strokeOpacity!==r&&(this.__strokeOpacity=r,h=!0),this.__strokeWidth!==l&&(this.__strokeWidth=l,h=!0),this.__lineDashOffset!==c&&(this.__lineDashOffset=c,h=!0),this.__lineDash!==t?.lineDash&&(this.__lineDash=t?.lineDash,h=!0),this.setFillProperties(o,i,s),o!==this.fill&&(this.fill=o),t?.stroke!==this.stroke&&(this.stroke=t?.stroke),h&&this.markDirty()}setFillProperties(t,i,s){const n=i==null||!qt(t)||t.bounds==null||t.bounds==="item"?void 0:i[t.bounds];let o=!1;this.__fillBBox!==n&&(this.__fillBBox=n,o=!0),this.__fillParams!==s&&(this.__fillParams=s,o=!0),o&&(this.onFillChange(),this.markDirty())}};g([Ee()],Xi.prototype,"drawingMode",2),g([Ee()],Xi.prototype,"fillOpacity",2),g([Ee()],Xi.prototype,"strokeOpacity",2),g([Au({equals:Ht,changeCb:Xi.handleFillChange})],Xi.prototype,"fill",2),g([Hr({equals:Ht,changeCb:Xi.handleStrokeChange})],Xi.prototype,"stroke",2),g([Ee()],Xi.prototype,"strokeWidth",2),g([ku()],Xi.prototype,"lineDash",2),g([Ee()],Xi.prototype,"lineDashOffset",2),g([Ee()],Xi.prototype,"lineCap",2),g([Ee()],Xi.prototype,"lineJoin",2),g([Ee()],Xi.prototype,"miterLimit",2),g([Ee({convertor:e=>se(0,e??1,1)})],Xi.prototype,"opacity",2),g([Hr({equals:ph,checkDirtyOnAssignment:!0})],Xi.prototype,"fillShadow",2),g([Au({equals:$g,changeCb:e=>e.onFillChange()})],Xi.prototype,"fillBBox",2),g([Au({equals:Ht,changeCb:e=>e.onFillChange()})],Xi.prototype,"fillParams",2);var fh=Xi,PT=[1,0,0,1,0,0],mh=class US{get e(){return[...this.elements]}constructor(t=PT){this.elements=[...t]}setElements(t){const i=this.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],this}get identity(){const t=this.elements;return Be(t[0],1)&&Be(t[1],0)&&Be(t[2],0)&&Be(t[3],1)&&Be(t[4],0)&&Be(t[5],0)}AxB(t,i,s){const n=t[0]*i[0]+t[2]*i[1],o=t[1]*i[0]+t[3]*i[1],a=t[0]*i[2]+t[2]*i[3],r=t[1]*i[2]+t[3]*i[3],l=t[0]*i[4]+t[2]*i[5]+t[4],c=t[1]*i[4]+t[3]*i[5]+t[5];s=s??t,s[0]=n,s[1]=o,s[2]=a,s[3]=r,s[4]=l,s[5]=c}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const i=[Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN,Number.NaN];return t instanceof US?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new US(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],n=t[2],o=t[3];const a=t[4],r=t[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,new US([o,-s,-n,i,n*r-o*a,s*a-i*r])}invertSelf(){const t=this.elements;let i=t[0],s=t[1],n=t[2],o=t[3];const a=t[4],r=t[5],l=1/(i*o-s*n);return i*=l,s*=l,n*=l,o*=l,t[0]=o,t[1]=-s,t[2]=-n,t[3]=i,t[4]=n*r-o*a,t[5]=s*a-i*r,this}transformPoint(t,i){const s=this.elements;return{x:t*s[0]+i*s[2]+s[4],y:t*s[1]+i*s[3]+s[5]}}transformBBox(t,i){const s=this.elements,n=s[0],o=s[1],a=s[2],r=s[3],l=t.width*.5,c=t.height*.5,h=t.x+l,d=t.y+c,u=Math.abs(l*n)+Math.abs(c*a),p=Math.abs(l*o)+Math.abs(c*r);return i??(i=new re(0,0,0,0)),i.x=h*n+d*a+s[4]-u,i.y=h*o+d*r+s[5]-p,i.width=u+u,i.height=p+p,i}toContext(t){if(this.identity)return;const i=this.elements;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(t,i,s,n,o,a,r){const l=i,c=s;let h,d;l===1&&c===1?(h=0,d=0):(h=r?.scalingCenterX??0,d=r?.scalingCenterY??0);const u=n,p=Math.cos(u),f=Math.sin(u);let y,x;u===0?(y=0,x=0):(y=r?.rotationCenterX??0,x=r?.rotationCenterY??0);const b=o,v=a,S=h*(1-l)-y,M=d*(1-c)-x;return t.setElements([p*l,f*l,-f*c,p*c,p*S-f*M+y+b,f*S+p*M+x+v]),t}};function Ul(e){return RT(e.constructor)}var ET=Symbol("isMatrixTransform");function RT(e){return e[ET]===!0}function OD(e){var t,i;const s=e;if(RT(e))return e;const n=Symbol("matrix_combined_transform");class o extends s{constructor(){super(...arguments),this[i]=new mh,this._dirtyTransform=!0}onChangeDetection(r){super.onChangeDetection(r),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(r){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(PT),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].transformBBox(r)}toParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].transformPoint(r,l)}fromParent(r){return this.computeTransformMatrix(),this[n].identity?r.clone():this[n].inverse().transformBBox(r)}fromParentPoint(r,l){return this.computeTransformMatrix(),this[n].identity?{x:r,y:l}:this[n].inverse().transformPoint(r,l)}computeBBox(){const r=super.computeBBox();return r&&this.toParent(r)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(r,l){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNode(r,l)}pickNodes(r,l,c){return{x:r,y:l}=this.fromParentPoint(r,l),super.pickNodes(r,l,c)}render(r){this.computeTransformMatrix();const{ctx:l}=r,c=this[n];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(r)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const r=super.toSVG(),l=this[n];if(l.identity||r==null)return r;const c=jt("g");c.append(...r.elements);const[h,d,u,p,f,y]=l.e;return c.setAttribute("transform",`matrix(${h} ${d} ${u} ${p} ${f} ${y})`),{elements:[c],defs:r.defs}}}return t=ET,i=n,o[t]=!0,o}function Lu(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends OD(i){constructor(){super(...arguments),this[t]=new mh,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(a){super.updateMatrix(a);const{rotation:r,rotationCenterX:l,rotationCenterY:c}=this;r!==0&&(mh.updateTransformMatrix(this[s],1,1,r,0,0,{rotationCenterX:l,rotationCenterY:c}),a.multiplySelf(this[s]))}}return t=s,g([K()],n.prototype,"rotationCenterX",2),g([K()],n.prototype,"rotationCenterY",2),g([K()],n.prototype,"rotation",2),n}function Zj(e){return"scalingX"in e&&"scalingY"in e&&"scalingCenterX"in e&&"scalingCenterY"in e}function jx(e){var t;const i=e,s=Symbol("matrix_scale");class n extends OD(i){constructor(){super(...arguments),this[t]=new mh,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(a){super.updateMatrix(a);const{scalingX:r,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;r===1&&l===1||(mh.updateTransformMatrix(this[s],r,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),a.multiplySelf(this[s]))}resetScalingProperties(a,r,l,c){this.__scalingX=a,this.__scalingY=r,this.__scalingCenterX=l,this.__scalingCenterY=c,this.onChangeDetection("scaling")}}return t=s,g([K()],n.prototype,"scalingX",2),g([K()],n.prototype,"scalingY",2),g([K()],n.prototype,"scalingCenterX",2),g([K()],n.prototype,"scalingCenterY",2),n}function Nu(e){var t;const i=e,s=Symbol("matrix_translation");class n extends OD(i){constructor(){super(...arguments),this[t]=new mh,this.translationX=0,this.translationY=0}updateMatrix(a){super.updateMatrix(a);const{translationX:r,translationY:l}=this;r===0&&l===0||(mh.updateTransformMatrix(this[s],1,1,0,r,l),a.multiplySelf(this[s]))}}return t=s,g([K()],n.prototype,"translationX",2),g([K()],n.prototype,"translationY",2),n}var zt=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())Ul(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return Ul(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():Ul(e)&&(t=e.toParent(t));for(const i of e.traverseUp())Ul(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())Ul(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return Ul(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){Ul(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())Ul(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},Wx,PD=class Hm extends Gr{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this._childFontDirty=!0,this.layer=void 0,this.image=void 0,this._lastWidth=Number.NaN,this._lastHeight=Number.NaN,this._lastDevicePixelRatio=Number.NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=t?.renderToOffscreenCanvas===!0,this.optimizeForInfrequentRedraws=t?.optimizeForInfrequentRedraws===!0}static is(t){return t instanceof Hm}static computeChildrenBBox(t,i=!0){return re.merge(Gr.extractBBoxes(t,i))}static compareChildren(t,i){return yT(t.__zIndex,i.__zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return Hm.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const u of this.descendants())u instanceof fh&&(s=Math.max(s,u.strokeWidth));const o=Math.max(1,s/2*n),{x:a,y:r}=zt.toCanvasPoint(this,0,0),l=NT(t,a+i.x-o)-a,c=NT(t,r+i.y-o)-r,h=Math.ceil(i.x+i.width-l+o),d=Math.ceil(i.y+i.height-c+o);return new re(l,c,h,d)}prepareSharedCanvas(t,i,s){return Wx?.pixelRatio===s?Wx.resize(t,i,s):Wx=new AD({width:t,height:i,pixelRatio:s}),Wx}setScene(t){const i=this.scene;super.setScene(t),this.layer&&i&&i!==t&&(i.layersManager.removeLayer(this.layer),this.layer=void 0);for(const s of this.children())s.setScene(t)}resolveFont(){if(!this.renderToOffscreenCanvas)return this.resolveChildFont()}resolveChildFont(){if(this._childFontDirty){this._cachedChildFont=void 0;for(const t of this.children()){const i=t.resolveFont();if(i!=null){this._cachedChildFont=i;break}}this._childFontDirty=!1}return this._cachedChildFont}markDirty(t){this.dirty=!0,this._childFontDirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of U0(t))i.remove(),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);t.parentNode=void 0,t.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const a=s[n].pickNode(t,i);if(a!=null)return a}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:o,layer:a}=this,r=a!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,o||r||l}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const s of this.children()){const n=s.preRender(t);i.groups+=n.groups,i.nonGroups+=n.nonGroups,i.complexity+=n.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t},o=this.isDirty(t);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:a,stats:r,devicePixelRatio:l}=t;let{image:c}=this;if(o){c?.bitmap.close(),c=void 0;const d=i?void 0:this.computeSafeClippingBBox(l),u=(p,...f)=>{const y=p.context;y.direction=n.direction,n.ctx=y,p.clear(),y.save();try{y.setTransform(...f),y.globalAlpha=1,this.renderInContext(n)}finally{y.restore(),y.verifyDepthZero?.()}};if(i)u(i,a.getTransform());else if(d){const{x:p,y:f,width:y,height:x}=d,b=Math.floor(y*l),v=Math.floor(x*l);if(b>0&&v>0){const S=this.prepareSharedCanvas(y,x,l);u(S,l,0,0,l,-p*l,-f*l),c={bitmap:S.transferToImageBitmap(),x:p,y:f,width:y,height:x}}}this.image=c,r&&r.layersRendered++}else r&&r.layersSkipped++;const{globalAlpha:h}=a;if(a.globalAlpha=h*this.opacity,i){a.save();try{a.resetTransform(),i.drawImage(a)}finally{a.restore()}}else if(c){const{bitmap:d,x:u,y:p,width:f,height:y}=c;a.drawImage(d,0,0,f*l,y*l,u,p,f,y)}a.globalAlpha=h,super.render(n)}applyClip(t,i){const{x:s,y:n,width:o,height:a}=i;t.beginPath(),t.rect(s,n,o,a),t.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&(this.sortChildren(Hm.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity;const n=this.resolveChildFont();n!=null&&i.font!==n&&(i.font=n),this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=zt.toCanvas(this,this.clipRect));for(const o of this.children()){if(!o.visible){s&&(s.nodesSkipped+=o.childNodeCounts.nonGroups+o.childNodeCounts.groups,s.opsSkipped+=o.childNodeCounts.complexity);continue}o.isolatedRender(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*excludeChildren(t){for(const i of this.children())(t.instance&&!(i instanceof t.instance)||t.name&&i.name!==t.name)&&(yield i)}*descendants(){for(const t of this.children())yield t,t instanceof Hm&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?zt.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};PD.className="Group",g([K({convertor:e=>se(0,e,1)})],PD.prototype,"opacity",2);var Le=PD,Xj=class extends jx(Le){},Ioe=class extends Lu(Le){},ds=class extends Nu(Le){},Tu=class extends Lu(Nu(Le)){},qj=class{constructor(){this.stats=new Map,this.lastLogTime=Date.now(),this.LOG_INTERVAL_MS=1e4,this.startPeriodicLogging()}startPeriodicLogging(){ve.check("scene:stats","scene:stats:verbose")&&(this.stopPeriodicLogging(),this.intervalId=setInterval(()=>{this.logAccumulatedStats()},this.LOG_INTERVAL_MS))}stopPeriodicLogging(){this.intervalId&&(clearInterval(this.intervalId),this.intervalId=void 0)}recordTiming(e,t){const i=this.stats.get(e);i?(i.min=Math.min(i.min,t),i.max=Math.max(i.max,t),i.sum+=t,i.count+=1):this.stats.set(e,{min:t,max:t,sum:t,count:1})}recordTimings(e){for(const[t,i]of Object.entries(e))t!=="start"&&typeof i=="number"&&this.recordTiming(t,i)}logAccumulatedStats(){if(this.stats.size===0)return;const e=(Date.now()-this.lastLogTime)/1e3,t=Array.from(this.stats.keys()).sort((o,a)=>o==="\u23F1\uFE0F"?-1:a==="\u23F1\uFE0F"?1:o.localeCompare(a)),i=[];for(const o of t){const a=this.stats.get(o),r=a.sum/a.count;i.push(`${o}[${a.min.toFixed(1)}/${r.toFixed(1)}/${a.max.toFixed(1)}]ms`)}const n=this.stats.get("\u23F1\uFE0F")?.count??0;W.log(`\u{1F4CA} Stats (${e.toFixed(0)}s, ${n} renders): ${i.join(" ")}`),this.stats.clear(),this.lastLogTime=Date.now()}destroy(){this.stopPeriodicLogging(),this.stats.clear()}},Ou,yh=0;function Qj(){return Ou??(Ou=new qj),Ou}function Jj(){yh++;let e=!1;return()=>{e||yh===0||(e=!0,yh--,yh===0&&FT())}}function eW(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function tW(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[t,e,i])typeof n=="number"&&s.push(eW(n));return`Heap ${s.join(" / ")}`}function zT(e,t,i,s,n={},o=re.zero,a){if(!ve.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:r=0,layersSkipped:l=0,nodesRendered:c=0,nodesSkipped:h=0,opsPerformed:d=0,opsSkipped:u=0}=s??{},p=performance.now(),{start:f,...y}=t,x=p-f,b=Qj();b.recordTimings(y),b.recordTiming("\u23F1\uFE0F",x);const v=Object.entries(y).map(([F,_])=>BT(F,_)).filter(F=>F!=null).join(" + "),S=Object.entries(n).map(([F,_])=>`${F}: ${JSON.stringify(_)}`).join(" ; "),M=ve.check("scene:stats:verbose"),D=M?tW():null,I=M?yo.flush():{},k=Object.entries(I),A=[],w=[];for(const[F,_]of k)F.endsWith(":aggregation")&&Array.isArray(_)?A.push(`${F.replace(":aggregation","")}(${_.join(",")})`):F.endsWith(":nodeData")&&typeof _=="number"&&w.push(`${F.replace(":nodeData","")}(${_})`);const C=A.length>0?`Aggregation: ${A.join(", ")}`:null,T=w.length>0?`NodeData: ${w.join(", ")}`:null,O=[`${BT("\u23F1\uFE0F",f,p)} (${v})`,`${S}`,C,T,`Layers: ${M?ED(r,l):e.size}`,M?`Nodes: ${ED(c,h)}`:null,M?`Ops: ${ED(d,u)}`:null,D].filter(Pt),V=new xx(i),z=new Map(O.map(F=>[F,V.measureText(F)])),R=Math.max(...Array.from(z.values(),F=>F.width)),B=rW(z.values(),F=>F.height),G=2+o.x;i.save();try{i.fillStyle=a?.background??"white",i.fillRect(G,0,R,B),i.fillStyle=a?.foreground??"black";let F=0;for(const[_,Y]of z.entries())F+=Y.height,i.fillText(_,G,F)}catch(F){W.warnOnce("Error during debug stats rendering",F)}finally{i.restore()}}function iW(e){const t=Dd(Go("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/Axis-\d+-axis/):i.push(s);e.debugNodeSearch=i}function sW(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const n=zt.toCanvas(s);if(!n){W.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}}catch(i){W.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var nW=new Set,oW=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function aW(e){const{...t}=e;for(const i of Object.keys(t))oW.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(nW.add(i),delete t[i]);return t}function $x(e,t){if(!ve.check(!0,"scene"))return{};let i=0;return{node:t==="json"?aW(e):e,name:e.name??e.id,dirty:e instanceof Le?e.dirty:void 0,...Array.from(e instanceof Le?e.children():[],s=>$x(s,t)).reduce((s,n)=>{let{name:o}=n;const{node:{visible:a,opacity:r,zIndex:l,translationX:c,translationY:h,rotation:d,scalingX:u,scalingY:p},node:f}=n;(!a||r<=0)&&(o=`(${o})`),Le.is(f)&&f.renderToOffscreenCanvas&&(o=`*${o}*`);const y=Array.isArray(l)?`(${l.join(", ")})`:l,x=[`${(i++).toString().padStart(3,"0")}|`,`${o??""}`,`z: ${y}`,c&&`x: ${c}`,h&&`y: ${h}`,d&&`r: ${d}`,u!=null&&u!==1&&`sx: ${u}`,p!=null&&p!==1&&`sy: ${p}`].filter(S=>!!S).join(" ");let b=x,v=1;for(;s[b]!=null&&v<100;)b=`${x} (${v++})`;return s[b]=n,s},{})}}function VT(e){const t=e instanceof Le?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof Le?e.children():[],o=>VT(o)).filter(o=>o.paths.length>0),s=Le.is(e)?e.name??e.id:e.id,n=i.length?i.flatMap(o=>o.paths).map(o=>`${s}.${o}`):[s];return{dirtyTree:{name:s,node:e,dirty:t,...i.map(o=>o.dirtyTree).filter(o=>o.dirty!=null).reduce((o,a)=>(o[a.name??""]=a,o),{})},paths:n}}function ED(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function BT(e,t,i){const s=i==null?t:i-t;return`${e}: ${Math.round(s*100)/100}ms`}function rW(e,t){let i=0;for(const s of e)i+=t(s);return i}function FT(e=!1){if(!Ou){e&&(yh=0);return}!e&&yh>0||(Ou.destroy(),Ou=void 0,e&&(yh=0))}var lW=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise((t,i)=>{this.acquireQueue.push([e,t,i]),this.available&&this.dispatchNext().catch(i)})}async acquireImmediately(e){return this.available?(await this.acquire(e),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t,i]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(s){i?.(s)}[e,t,i]=this.acquireQueue.shift()??[]}this.available=!0}},_T=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if(typeof t!="function")throw new TypeError("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);i!=null&&(i.delete(t),i.size===0&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){const t=this.eventListeners.get(e.type);if(t)for(const i of t)i(e)}};function cW(e,t){function i(n,o){return e.requestAnimationFrame(n)}function s(n){e.cancelAnimationFrame(n)}return HT(i,t,s)}function RD(e){function t(s,n=0){if(n===0){queueMicrotask(s);return}return setTimeout(s,n)}function i(s){clearTimeout(s)}return HT(t,e,i)}function HT(e,t,i){let s=0,n=!1,o,a,r;function l(){return n}function c(){n=!1,r=void 0,a?.(),a=void 0,o=void 0,s>0&&(r=e(h))}function h(){const y=s;s=0,n=!0;const x=t({count:y});if(!x){c();return}x.then(c,c)}function d(y){s===0&&!l()&&(r=e(h,y)),s++}function u(){r!=null&&i&&(i(r),r=void 0,s=0)}async function p(){if(l())for(o??(o=new Promise(f));l();)await o}function f(y){a=y}return{schedule:d,cancel:u,waitForCompletion:p}}var hf=(e,{x0:t,y0:i,x1:s,y1:n,cx:o,cy:a},r,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==n){const c=Math.atan2(i-a,t-o),h=Math.atan2(n-a,s-o);e.arc(o,a,r,c,h)}else e.lineTo(t,i)},wi=class extends fh{constructor(){super(...arguments),this.path=new Cu,this._clipX=Number.NaN,this._clipY=Number.NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=Number.NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!Number.isNaN(this._clipX)&&!Number.isNaN(this._clipY)){t.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Cu),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t)}finally{t.restore()}}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=jt("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};wi.className="Path",g([K()],wi.prototype,"clip",2),g([K()],wi.prototype,"clipX",1),g([K()],wi.prototype,"clipY",1);function Kx(e,t,i,s,n){let o=!1,a=!1,r=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return r>e?(o=!0,r=e,l=i-Math.sqrt(Math.max(n**2-(s-e)**2))):Be(r,0)&&(r=0),h>t?(a=!0,c=s-Math.sqrt(Math.max(n**2-(i-t)**2)),h=t):Be(h,0)&&(h=0),{leading0:r,leading1:l,trailing0:c,trailing1:h,leadingClipped:o,trailingClipped:a}}function Ux(e,t,i,s,n,o,a){let{topLeft:r,topRight:l,bottomRight:c,bottomLeft:h}=o;const d=Math.max(r+h,l+c),u=Math.max(r+l,h+c);if(d<=0&&u<=0){if(a==null)e.rect(t,i,s,n);else{const k=Math.max(t,a.x),A=Math.min(t+s,a.x+a.width),w=Math.max(i,a.y),C=Math.min(i+n,a.y+a.height);e.rect(k,w,A-k,C-w)}return}else if(a==null&&r===l&&r===c&&r===h){e.roundRect(t,i,s,n,r);return}if(s<0&&(t+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(a==null)a=new re(t,i,s,n);else{const k=Math.max(t,a.x),A=Math.min(t+s,a.x+a.width),w=Math.max(i,a.y),C=Math.min(i+n,a.y+a.height);a=new re(k,w,A-k,C-w)}const p=Math.max(d/n,u/s,1);p>1&&(r/=p,l/=p,c/=p,h/=p);let f=!0,y=!0,x=!0,b=!0,v,S,M,D;if(f){const k=Kx(a.height,a.width,Math.max(t+r-a.x,0),Math.max(i+r-a.y,0),r);k.leadingClipped&&(b=!1),k.trailingClipped&&(y=!1);const A=Math.max(a.x+k.leading1,a.x),w=Math.max(a.y+k.leading0,a.y),C=Math.max(a.x+k.trailing1,a.x),T=Math.max(a.y+k.trailing0,a.y),O=t+r,V=i+r;v={x0:A,y0:w,x1:C,y1:T,cx:O,cy:V}}if(y){const k=Kx(a.width,a.height,Math.max(i+l-a.y,0),Math.max(a.x+a.width-(t+s-l),0),l);k.leadingClipped&&(f=!1),k.trailingClipped&&(x=!1);const A=Math.min(a.x+a.width-k.leading0,a.x+a.width),w=Math.max(a.y+k.leading1,a.y),C=Math.min(a.x+a.width-k.trailing0,a.x+a.width),T=Math.max(a.y+k.trailing1,a.y),O=t+s-l,V=i+l;S={x0:A,y0:w,x1:C,y1:T,cx:O,cy:V}}if(x){const k=Kx(a.height,a.width,Math.max(a.x+a.width-(t+s-c),0),Math.max(a.y+a.height-(i+n-c),0),c);k.leadingClipped&&(y=!1),k.trailingClipped&&(b=!1);const A=Math.min(a.x+a.width-k.leading1,a.x+a.width),w=Math.min(a.y+a.height-k.leading0,a.y+a.height),C=Math.min(a.x+a.width-k.trailing1,a.x+a.width),T=Math.min(a.y+a.height-k.trailing0,a.y+a.height),O=t+s-c,V=i+n-c;M={x0:A,y0:w,x1:C,y1:T,cx:O,cy:V}}if(b){const k=Kx(a.width,a.height,Math.max(a.y+a.height-(i+n-h),0),Math.max(t+h-a.x,0),h);k.leadingClipped&&(x=!1),k.trailingClipped&&(f=!1);const A=Math.max(a.x+k.leading0,a.x),w=Math.min(a.y+a.height-k.leading1,a.y+a.height),C=Math.max(a.x+k.trailing0,a.x),T=Math.min(a.y+a.height-k.trailing1,a.y+a.height),O=t+h,V=i+n-h;D={x0:A,y0:w,x1:C,y1:T,cx:O,cy:V}}let I=!1;f&&v!=null&&(hf(e,v,r,!I),I||(I=!0)),y&&S!=null&&(hf(e,S,l,!I),I||(I=!0)),x&&M!=null&&(hf(e,M,c,!I),I||(I=!0)),b&&D!=null&&hf(e,D,h,!I),e.closePath()}var Ci=class extends wi{constructor(){super(...arguments),this.borderPath=new Cu,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.__strokeWidth,this.effectiveStrokeWidth=this.__strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.__strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,__crisp:i,__topLeftCornerRadius:s,__topRightCornerRadius:n,__bottomRightCornerRadius:o,__bottomLeftCornerRadius:a}=this;let{__x:r,__y:l,__width:c,__height:h,__strokeWidth:d,__clipBBox:u}=this;const f=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(e.clear(),t.clear(),c===0||h===0){this.effectiveStrokeWidth=0,this.lastUpdatePathStrokeWidth=0,this.microPixelEffectOpacity=0;return}if(i&&(c<=f&&(y*=c/f),h<=f&&(y*=h/f),c=this.align(r,c),h=this.align(l,h),r=this.align(r),l=this.align(l),u=u==null?void 0:new re(this.align(u.x),this.align(u.y),this.align(u.x,u.width),this.align(u.y,u.height))),d)if(c0?s-d:0,topRight:n>0?n-d:0,bottomRight:o>0?o-d:0,bottomLeft:a>0?a-d:0};this.borderClipPath=void 0,c>0&&h>0&&(v==null||v?.width>0&&v?.height>0)&&(Ux(e,r,l,c,h,S,v),Ux(t,r,l,c,h,S,v))}else this.borderClipPath=this.borderClipPath??new Cu,this.borderClipPath.clear(),this.borderClipPath.rect(r,l,c,h),t.rect(r,l,c,h);else{const b={topLeft:s,topRight:n,bottomRight:o,bottomLeft:a};this.borderClipPath=void 0,Ux(e,r,l,c,h,b,u)}if([s,n,o,a].every(hW)){let b=function(M,D){return S.getBBox().distanceSquared(M,D)};var x=b;const v=this.getBBox();this.hittester=v.containsPoint.bind(v);const S=this;this.distanceSquared=b}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=d,this.lastUpdatePathStrokeWidth=d,this.microPixelEffectOpacity=y}computeBBox(){const{__x:e,__y:t,__width:i,__height:s,__clipBBox:n}=this;return n?.clone()??new re(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.__x+this.__width/2,y:this.__y+this.__height/2}}setStaticProperties(e,t,i,s,n,o,a,r){this.__drawingMode=e,this.__topLeftCornerRadius=t,this.__topRightCornerRadius=i,this.__bottomRightCornerRadius=s,this.__bottomLeftCornerRadius=n,this.__visible=o,this.__crisp=a,this.__fillShadow=r,this.dirtyPath=!0,this.markDirty()}resetAnimationProperties(e,t,i,s,n,o){this.__x=e,this.__y=t,this.__width=i,this.__height=s,this.__opacity=n,this.__clipBBox=o,this.dirtyPath=!0,this.markDirty()}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{lineDash:n,lineDashOffset:o,lineCap:a,lineJoin:r,borderPath:l,borderClipPath:c}=this;c&&e.clip(c.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),o&&(e.lineDashOffset=o),a&&(e.lineCap=a),r&&(e.lineJoin=r),e.stroke(l.getPath2D()),e.globalAlpha=s}}};Ci.className="Rect",g([Ee()],Ci.prototype,"x",2),g([Ee()],Ci.prototype,"y",2),g([Ee()],Ci.prototype,"width",2),g([Ee()],Ci.prototype,"height",2),g([Ee()],Ci.prototype,"topLeftCornerRadius",2),g([Ee()],Ci.prototype,"topRightCornerRadius",2),g([Ee()],Ci.prototype,"bottomRightCornerRadius",2),g([Ee()],Ci.prototype,"bottomLeftCornerRadius",2),g([Ee({equals:$g})],Ci.prototype,"clipBBox",2),g([Ee()],Ci.prototype,"crisp",2);function hW(e){return e===0}var xn=class En extends fh{constructor(t){super(t),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontCache=void 0,this.fontSize=En.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic",this.boxPadding=0,this.trimText=t?.trimText??!0}onTextChange(){if(this.richText?.clear(),this.textMap?.clear(),Ae(this.text))this.lines=[],this.richText??(this.richText=new Le),this.richText.setScene(this.scene),this.richText.append(this.text.flatMap(t=>Dt(t.text).split(gr)).filter(Boolean).map(()=>new En({trimText:!1})));else{const t=Dt(this.text).split(gr);this.lines=this.trimText?t.map(i=>i.trim()):t}}get font(){return this.fontCache??(this.fontCache=ty(this)),this.fontCache}resolveFont(){if(this.hasRenderableText())return this.font}static measureBBox(t,i,s,n){if(Ae(t)){const{font:o,lineHeight:a,textAlign:r,textBaseline:l}=n,{width:c,height:h,lineMetrics:d}=en(t,o),u=a?a*d.length:h,p=En.calcTopOffset(u,d[0],l),f=En.calcLeftOffset(c,r);return new re(i-f,s-p,c,u)}else return En.computeBBox(Dt(t).split(gr),i,s,n)}static computeBBox(t,i,s,n){const{font:o,lineHeight:a,textAlign:r,textBaseline:l,isRtl:c}=n,{width:h,height:d,lineMetrics:u}=et(o).measureLines(t),p=a?a*u.length:d,f=En.calcTopOffset(p,u[0],l),y=En.calcLeftOffset(h,r,c);return new re(i-y,s-f,h,p)}static calcTopOffset(t,i,s){switch(s){case"alphabetic":return i?.ascent??0;case"middle":return t/2;case"bottom":return t;default:return 0}}static calcSegmentedTopOffset(t,i,s){switch(s){case"alphabetic":return i[0]?.ascent??0;case"middle":return i.length===1?i[0].ascent+i[0].segments.reduce((n,o)=>Math.min(n,et(o).baselineDistance("middle")),0):t/2;case"bottom":return t;default:return 0}}static calcLeftOffset(t,i,s){let n=0;switch(i){case"center":n=.5;break;case"right":case(s?"start":"end"):n=1}return t*n}getBBox(){const t=super.getBBox();if(!this.textMap?.size||!Ae(this.text))return t;const{height:i,lineMetrics:s}=en(this.text,this),n=En.calcSegmentedTopOffset(i,s,this.textBaseline),o=this.y-n;return t.y===o?t:new re(t.x,o,t.width,t.height)}computeBBox(){if(!this.hasRenderableText())return new re(this.x,this.y,0,0);if(this.generateTextMap(),this.textMap?.size){const l=re.merge(this.textMap.values());return l.x=this.x-En.calcLeftOffset(l.width,this.textAlign),l.y=this.y,l}const t=this.scene?.isRtl,{x:i,y:s,lines:n,textBaseline:o,textAlign:a}=this,r=En.computeBBox(n,i,s,{font:this,textBaseline:o,textAlign:a,isRtl:t});return this.boxing!=null&&r.grow(this.boxPadding),r}getTextMeasureBBox(){return this.computeBBox()}getPlainText(){return Oe(this.text)}isPointInPath(t,i){return this.getBBox()?.containsPoint(t,i)??!1}setScene(t){this.richText?.setScene(t),super.setScene(t)}generateTextMap(){if(!Ae(this.text)||this.textMap?.size)return;this.textMap??(this.textMap=new Map);let t=0;const i=this.richText.children();for(const{width:s,height:n,ascent:o,segments:a}of en(this.text,this).lineMetrics){let r=0;for(const{color:l,textMetrics:c,...h}of a){const d=i.next().value;d.x=this.x-s/2+r,d.y=o+t,d.setProperties({...h,fill:l??this.fill});const u=d.getBBox();this.textMap.set(d,u),r+=c.width}t+=n}}render(t){const{ctx:i,stats:s}=t;if(!this.layerManager||!this.hasRenderableText()){s&&(s.nodesSkipped+=1);return}if(Ae(this.text)&&this.richText){this.generateTextMap();const n=this.richText.getBBox(),{width:o,height:a,lineMetrics:r}=en(this.text,this);let l=0;switch(this.textAlign){case"left":case"start":l=o/2;break;case"right":case"end":l=o/-2}const c=this.y-En.calcSegmentedTopOffset(a,r,this.textBaseline);this.renderBoxing(t,n.clone().translate(l,c)),i.save(),i.translate(l,c),this.richText.opacity=this.opacity,this.richText.render(t),i.restore()}else this.renderText(t);if(En.debug.check()){const n=this.getBBox();i.lineWidth=this.textMap?.size?2:1,i.strokeStyle=this.textMap?.size?"blue":"red",i.strokeRect(n.x,n.y,n.width,n.height)}super.render(t)}markDirty(t){return this.textMap?.clear(),super.markDirty(t)}renderText(t){const{fill:i,stroke:s,strokeWidth:n,font:o,textAlign:a}=this;if(!i&&!(s&&n)||!this.layerManager)return super.render(t);const{ctx:r}=t;r.font!==o&&(r.font=o),r.textAlign=a,this.renderBoxing(t),this.fillStroke(r)}renderBoxing(t,i){if(!this.boxing)return;const s=i??En.computeBBox(this.lines,this.x,this.y,this);if(s.width===0||s.height===0)return;const{x:n,y:o,width:a,height:r}=s.grow(this.boxPadding);this.boxing.opacity=this.opacity,this.boxing.x=n,this.boxing.y=o,this.boxing.width=a,this.boxing.height=r,this.boxing.preRender(t),this.boxing.render(t)}executeFill(t){this.renderLines((i,s,n)=>t.fillText(i,s,n))}executeStroke(t){this.renderLines((i,s,n)=>t.strokeText(i,s,n))}renderLines(t){const{x:i,y:s,lines:n}=this;if(!Number.isFinite(i)||!Number.isFinite(s))return;const o=et(this),{lineMetrics:a}=o.measureLines(n),{textBaseline:r,lineHeight:l=o.lineHeight()}=this;let c=0;r==="top"?c=a[0].ascent:(r==="middle"||r==="bottom")&&(c=l*(1-n.length),r==="middle"?(c/=2,c-=o.baselineDistance(r)):c-=a[0].descent);for(const h of a)t(h.text,i,s+c),c+=l}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}setBoxing(t){const i=t.border?.enabled?t.border?.stroke:void 0;t.fill!=null||i!=null?(this.boxing??(this.boxing=new Ci({scene:this.scene})),this.boxing.fill=t.fill,this.boxing.fillOpacity=t.fillOpacity??1,this.boxing.cornerRadius=t.cornerRadius??0,this.boxing.stroke=i,this.boxing.strokeWidth=t.border?.strokeWidth??0,this.boxing.strokeOpacity=t.border?.strokeOpacity??1,this.boxPadding=t.padding??0):this.boxing&&(this.boxing.destroy(),this.boxing=void 0)}hasBoxing(){return this.boxing!=null}getBoxingProperties(){const{fill:t,fillOpacity:i,cornerRadius:s,stroke:n,strokeWidth:o,strokeOpacity:a}=this.boxing??{};return{border:{enabled:n!=null,stroke:n,strokeWidth:o,strokeOpacity:a},cornerRadius:s,fill:t,fillOpacity:i,padding:this.boxPadding}}toSVG(){if(!this.visible||!this.hasRenderableText())return;const t=this.text;if(t==null)return;const i=jt("text");if(Ae(t))for(const s of t){const n=jt("tspan");OT(n,{fontSize:s.fontSize??this.fontSize,fontFamily:s.fontFamily??this.fontFamily,fontWeight:s.fontWeight??this.fontWeight,fontStyle:s.fontStyle??this.fontStyle}),this.applySvgFillAttributes(n),n.textContent=Dt(s.text),i.append(n)}else this.applySvgFillAttributes(i),OT(i,this),i.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),i.setAttribute("alignment-baseline",this.textBaseline),i.setAttribute("x",String(this.x)),i.setAttribute("y",String(this.y)),i.textContent=Dt(t);return{elements:[i]}}hasRenderableText(){const{text:t}=this;return t==null?!1:Ae(t)?!0:Dt(t)!==""}};xn.className="Text",xn.debug=ve.create(!0,"scene:text"),xn.defaultFontSize=10,g([K()],xn.prototype,"x",2),g([K()],xn.prototype,"y",2),g([rf({changeCb:e=>e.onTextChange()})],xn.prototype,"text",2),g([K({changeCb:e=>{e.fontCache=void 0}})],xn.prototype,"fontStyle",2),g([K({changeCb:e=>{e.fontCache=void 0}})],xn.prototype,"fontWeight",2),g([K({changeCb:e=>{e.fontCache=void 0}})],xn.prototype,"fontSize",2),g([K({changeCb:e=>{e.fontCache=void 0}})],xn.prototype,"fontFamily",2),g([K()],xn.prototype,"textAlign",2),g([K()],xn.prototype,"textBaseline",2),g([K()],xn.prototype,"lineHeight",2);var bn=xn,GT=class extends Lu(bn){},Pu=class extends Lu(Nu(bn)){},Eu=class extends ri{constructor(e){super(),this.ctx=e,this.rectNode=new Ci,this.textNode=new bn,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}createNode(){return new Le({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};g([m,St("node","visible")],Eu.prototype,"visible",2),g([m,St("rectNode","fill")],Eu.prototype,"fill",2),g([m],Eu.prototype,"image",2),g([m,St("textNode")],Eu.prototype,"text",2);var Wt=class extends q{constructor(){super(...arguments),this.id=gi(this),this.node=new GT({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0,this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n,truncate:o}=this,a=o?e:1/0,r=o?t:1/0,l=Math.min(this.maxWidth??1/0,a)-s*2,c=this.maxHeight??r-s*2,h={maxWidth:l,maxHeight:c,font:this,textWrap:n};if(!Number.isFinite(l)&&!Number.isFinite(c)){this.node.text=i;return}let d;Ae(i)?(d=vx(i,h),this.truncated=d.some(ug)):(d=Pa(Dt(i),h),this.truncated=mr(d)),this.node.text=d}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(!this.enabled||!this.text){this.destroyProxyText();return}const s=zt.toCanvas(this.node);if(!s)return;const{id:n}=this;this.proxyText==null&&(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t}),this.proxyTextListeners=[this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))]);const o=Oe(this.text);o!==this.lastProxyTextContent&&(this.proxyText.textContent=o,this.lastProxyTextContent=o);const{lastProxyBBox:a}=this;(a==null||s.x!==a.x||s.y!==a.y||s.width!==a.width||s.height!==a.height)&&(this.proxyText.setBounds(s),this.lastProxyBBox={x:s.x,y:s.y,width:s.width,height:s.height})}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.truncated){const{x:i,y:s}=zt.toCanvas(this.node),n=t.sourceEvent.offsetX+i,o=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:o,showArrow:!1},[{type:"structured",title:Oe(this.text)}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id,void 0,!0)}destroy(){this.destroyProxyText()}destroyProxyText(){if(this.proxyText!=null){for(const e of this.proxyTextListeners??[])e();this.proxyTextListeners=void 0,this.proxyText.destroy(),this.proxyText=void 0,this.lastProxyTextContent=void 0,this.lastProxyBBox=void 0}}};Wt.className="Caption",g([m,St("node","visible")],Wt.prototype,"enabled",2),g([m,St("node")],Wt.prototype,"text",2),g([m,St("node")],Wt.prototype,"textAlign",2),g([m,St("node")],Wt.prototype,"fontStyle",2),g([m,St("node")],Wt.prototype,"fontWeight",2),g([m,St("node")],Wt.prototype,"fontSize",2),g([m,St("node")],Wt.prototype,"fontFamily",2),g([m,St("node","fill")],Wt.prototype,"color",2),g([m],Wt.prototype,"spacing",2),g([m],Wt.prototype,"maxWidth",2),g([m],Wt.prototype,"maxHeight",2),g([m],Wt.prototype,"wrapping",2),g([m],Wt.prototype,"truncate",2),g([m],Wt.prototype,"padding",2),g([m],Wt.prototype,"layoutStyle",2);var Yx=class extends Array{destroy(){for(const e of this)e.destroy();this.length=0}findById(e){return this.find(t=>t.id===e)}matches(e){return this.length===Object.keys(e).length&&Y0(e,(t,i)=>me(i)&&"type"in i&&this.findById(t)?.type===i.type)}getById(e){const t=this.findById(e);if(!t)throw new Error(`Could not find axis by id [${e}].`);return t}},dW=class extends Yx{get x(){return this.getById("x")}get y(){return this.getById("y")}perpendicular(e){const t=e.direction==="x"?"y":"x";return this[t]}},uW=class extends Yx{get angle(){return this.getById("angle")}get radius(){return this.getById("radius")}},Zx=class{constructor(){this.title=new Wt,this.subtitle=new Wt,this.footnote=new Wt}positionCaptions({layoutBox:e}){const{title:t,subtitle:i,footnote:s}=this,n=e.height/10;t.enabled&&(this.positionCaption("top",t,e,n),this.shrinkLayoutByCaption("top",t,e)),i.enabled&&(this.positionCaption("top",i,e,n),this.shrinkLayoutByCaption("top",i,e)),s.enabled&&(this.positionCaption("bottom",s,e,n),this.shrinkLayoutByCaption("bottom",s,e))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:n}=e.series;for(const o of[t,i,s])if(o.layoutStyle==="overlay"){if(o.textAlign==="left")o.node.x=n.x+o.padding;else if(o.textAlign==="right"){const a=o.node.getBBox();o.node.x=n.x+n.width-a.width-o.padding}}}computeX(e,t){return e==="left"?t.x:e==="right"?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){if(!t.text)return;const{lineMetrics:n}=Ae(t.text)?en(t.text,t):et(t).measureLines(Dt(t.text)),o=Math.max(n[0].height,s);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+(e==="top"?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,o)}shrinkLayoutByCaption(e,t,i){if(t.layoutStyle==="block"){const s=t.node.getBBox().clone(),{spacing:n=0}=t;e==="bottom"&&Ae(t.text)&&(s.y-=s.height),i.shrink(Math.ceil(e==="top"?s.y-i.y+s.height+n:i.y+i.height-s.y+n),e)}}};g([m],Zx.prototype,"title",2),g([m],Zx.prototype,"subtitle",2),g([m],Zx.prototype,"footnote",2);var pW=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],gW=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e??(e="candlestick"),e}guardMemento(e){return e==null||pW.includes(e)}restoreMemento(e,t,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>W.error("error restoring state",n))}},de="13.2.1",jT=Symbol("previous-memento-not-found"),fW=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=ve.create(!0,"history"),this.cleanup=new ot,this.cleanup.register(e.on("series:undo",this.undo.bind(this)),e.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndexthis.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of t){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const i=this.findPreviousMemento(t);if(i===jT)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):jT}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(de,de,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},mW=class{constructor(){this.caretaker=new Fy(de),this.state=new Map}setState(e,t){Ht(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const s=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:s},e)}},yW=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0;height:0;position:absolute;pointer-events:none}.ag-charts-canvas-background{position:absolute}.ag-charts-canvas-center{position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{position:absolute;inset:0;pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-canvas-overlay>[role=presentation]{left:0}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-color: #e4f2fe;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border-width: 1px;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border-width: 1px;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border-width: 1px;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border-width: 1px;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border-width: 1px;--ag-charts-border: var(--ag-charts-border-width) solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-filled-down{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMTYiIGhlaWdodD0iMTYiIHZpZXdCb3g9IjAgMCAxNiAxNiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMy42NjcgNS4zMzQgOCAxMC42NjdsNC4zMzQtNS4zMzN6IiBmaWxsPSIjMTgxZDFmIi8+PC9zdmc+)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-button-border-radius);border-style:solid;border-width:var(--ag-charts-button-border-width);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-inline-start:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-input-border-radius);border-style:solid;border-width:var(--ag-charts-input-border-width);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-legend-toolbar{pointer-events:auto}.ag-charts-proxy-legend-toolbar>div[role=listitem]{pointer-events:none}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem[data-focus-override=true],.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-proxy-elem[data-focus-override=false]{outline:none;box-shadow:none}.ag-charts-proxy-elem svg{display:block}.ag-charts-proxy-scrollbar-slider:focus-visible{outline:none;box-shadow:none}.ag-charts-proxy-scrollbar-thumb-focus{border:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);box-sizing:border-box;opacity:0;pointer-events:none}.ag-charts-proxy-scrollbar-slider:focus-visible~.ag-charts-proxy-scrollbar-thumb-focus{opacity:1}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-tooltip-border-radius);border-style:solid;border-width:var(--ag-charts-tooltip-border-width);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-border-width);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-menu__label{grid-column:-1 / span 1;text-wrap:nowrap}.ag-charts-toolbar{--toolbar-size: 34px;--toolbar-border-radius: var(--ag-charts-border-radius);--toolbar-button-background-color: var(--ag-charts-chrome-background-color);--toolbar-button-border-color: var(--ag-charts-border-color);--toolbar-button-border-width: var(--ag-charts-button-border-width);--toolbar-button-gap: 0;--toolbar-button-padding: 6px;--toolbar-button-text-color: var(--ag-charts-button-text-color);--toolbar-button-background-color--active: var(--ag-charts-focus-color);--toolbar-button-border-color--active: var(--ag-charts-accent-color);--toolbar-button-text-color--active: var(--ag-charts-accent-color);--toolbar-button-background-color--disabled: var(--ag-charts-button-disabled-background-color);--toolbar-button-border-color--disabled: var(--toolbar-button-border-color);--toolbar-button-text-color--disabled: var(--ag-charts-button-disabled-text-color);--toolbar-button-background-color--hover: var(--ag-charts-focus-color);--toolbar-button-border-color--hover: var(--toolbar-button-border-color);--toolbar-button-text-color--hover: var(--toolbar-button-text-color);align-items:center;display:flex;flex-wrap:nowrap;gap:var(--toolbar-button-gap);position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--toolbar-button-background-color);border-color:var(--toolbar-button-border-color);border-style:solid;border-width:var(--toolbar-button-border-width);color:var(--toolbar-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--toolbar-button-background-color--hover);border-color:var(--toolbar-button-border-color--hover);color:var(--toolbar-button-text-color--hover);z-index:1}.ag-charts-toolbar__button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{background:var(--toolbar-button-background-color--active);border-color:var(--toolbar-button-border-color--active);color:var(--toolbar-button-text-color--active);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--toolbar-button-background-color--disabled);border-color:var(--toolbar-button-border-color--disabled);color:var(--toolbar-button-text-color--disabled);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{border-inline-end-width:0}.ag-charts-toolbar__button--first{border-end-start-radius:var(--toolbar-border-radius);border-start-start-radius:var(--toolbar-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-end-radius:var(--toolbar-border-radius);border-start-end-radius:var(--toolbar-border-radius);border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:0}.ag-charts-toolbar__button:hover,.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:var(--toolbar-button-border-width);margin-inline-end:calc(-1 * var(--toolbar-button-border-width));&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button:hover+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-color:var(--toolbar-button-border-color--hover)}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color--active)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-start-start-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-end-start-radius:var(--ag-charts-border-radius);border-end-end-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__label+.ag-charts-toolbar__icon{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}.ag-charts-toolbar__button:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--hover)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{border-inline-end-width:0;margin-inline-end:0;+.ag-charts-toolbar__button:not(.ag-charts-toolbar__button--active){border-inline-start-width:var(--toolbar-button-border-width);border-inline-start-color:var(--toolbar-button-border-color--active)}&.ag-charts-toolbar__button--last{margin-inline-end:0}}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border-color:var(--ag-charts-border-color);border-style:solid;border-width:var(--ag-charts-border-width);border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius);border-inline-end-width:0;cursor:grab;display:flex;justify-content:center;min-width:24px;padding-inline-start:0;padding-inline-end:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing} `,zD=class{constructor(){this.cleanup=new ot,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},xW=class YS{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new ot,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(t){this.guardTabIndex=t,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(t,i){this.cleanup.register(mt(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;Fe(this.topTabGuard,"tabindex",i),Fe(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let s;t.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(t,i){const s=t.ownerDocument.defaultView;return Array.from(t.querySelectorAll(i)).filter(n=>{if(Ad(n)){const o=s.getComputedStyle(n);return o.display!=="none"&&o.visibility!=="none"}return!1})}findEnterTarget(t){const i=YS.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=YS.queryFocusable(this.element.ownerDocument.body,"[tabindex]").filter(o=>o.tabIndex>0).sort((o,a)=>o.tabIndex-a.tabIndex),{before:s,after:n}=YS.findBeforeAndAfter(i,this.guardTabIndex);return t?s:n}static findBeforeAndAfter(t,i){let s=0,n=t.length-1,o,a;for(;s<=n;){const r=Math.floor((s+n)/2),l=t[r].tabIndex;if(l===i){o=t[r-1]||void 0,a=t[r+1]||void 0;break}else l{i.matches||(this.devicePixelRatio=this.agDocument.devicePixelRatio,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))},this.devicePixelRatio=e.devicePixelRatio}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=this.agDocument.matchMedia(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},vW=class{constructor(e){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0;for(const[i,s,n]of this.queuedObserveRequests)this.observe(i,s,n);this.queuedObserveRequests=[],this.observeWindow()},this.resizeObserver=e.createResizeObserver(i=>{for(const{target:s,contentRect:{width:n,height:o}}of i){const a=this.elements.get(s);this.checkSize(a,s,n,o)}});let t;this.pixelRatioObserver=new bW(e,()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=e.isReady(),this.documentReady?this.observeWindow():this.removeLoadListener=e.attachListener("load",this.onLoad)}destroy(){this.removeLoadListener?.(),this.removeLoadListener=void 0,this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:n},e.cb(e.size,t)}}observe(e,t,i){if(!this.documentReady){this.queuedObserveRequests.push([e,t,i]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const s={cb:t};if(this.elements.set(e,s),!i?.skipInitialRead){const n=e.ownerDocument.defaultView?.getComputedStyle(e),o=e.clientWidth-(Number.parseFloat(n?.paddingLeft??"0")+Number.parseFloat(n?.paddingRight??"0")),a=e.clientHeight-(Number.parseFloat(n?.paddingTop??"0")+Number.parseFloat(n?.paddingBottom??"0"));(o>0||a>0)&&this.checkSize(s,e,o,a)}}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},Xx=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),t!==void 0&&super.set(e,t),delete this.cachedState,delete this.cachedValue,this}delete(e){return delete this.cachedState,delete this.cachedValue,super.delete(e)}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},SW=["translate"],qx=class{constructor(e,t){this.element=e,this.cache={},this.pendingWrites=new Map,this.deferredMode=t?.deferredMode,this.sizeMonitor=t?.sizeMonitor,this.skipInitialRead=t?.skipInitialRead??!1}get isConnected(){return this.element.isConnected}scheduleFlush(){this.deferredMode?this.deferredMode.scheduleFlush():this.flush()}contains(e){return this.element.contains(e)}addEventListener(e,t,i){this.element.addEventListener(e,t,i)}removeEventListener(e,t,i){this.element.removeEventListener(e,t,i)}get innerHTML(){return this.pendingWrites?this.cache.innerHTML??"":this.element.innerHTML}changed(e,t){return this.cache[e]===t?!1:(this.cache[e]=t,!0)}invalidate(e){delete this.cache[e]}setProperty(e,t){const i=`p:${e}`;if(this.changed(i,t)){if(SW.includes(e)){this.element.style.setProperty(e,t);return}this.pendingWrites.set(i,()=>{this.element.style.setProperty(e,t)}),this.scheduleFlush()}}toggleClass(e,t){const i=`c:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,()=>{this.element.classList.toggle(e,t)}),this.scheduleFlush())}setAttr(e,t){const i=`a:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,()=>{t==null?this.element.removeAttribute(e):this.element.setAttribute(e,t)}),this.scheduleFlush())}setData(e,t){const i=`d:${e}`;this.changed(i,t)&&(this.pendingWrites.set(i,()=>{this.element.dataset[e]=t}),this.scheduleFlush())}getData(e){const t=`d:${e}`;return this.pendingWrites?this.cache[t]:this.element.dataset[e]}setInnerHTML(e){return this.changed("innerHTML",e)?(this.pendingWrites.set("innerHTML",()=>{this.element.innerHTML=e}),this.scheduleFlush(),this.invalidate("contentStyles"),!0):!1}setContentStyles(e){if(this.changed("contentStyles",JSON.stringify(e))){const t=()=>{const i=this.element.firstElementChild??this.element;Object.assign(i.style,e)};this.pendingWrites.set("contentStyles",t),this.scheduleFlush()}}flush(){if(this.pendingWrites){for(const e of this.pendingWrites.values())e();this.pendingWrites.clear()}}flushKey(e){const t=this.pendingWrites.get(e);t&&(t(),this.pendingWrites.delete(e))}togglePopover(e){e?this.changed("popover",!0)&&(this.pendingWrites.set("popover",()=>{this.element.togglePopover(!0)}),this.scheduleFlush()):(this.pendingWrites.delete("popover"),this.changed("popover",!1)&&this.element.togglePopover(!1))}appendChild(e){this.element.appendChild(e)}set innerText(e){this.element.innerText=e,this.invalidate("innerHTML")}addResizeListener(e){const{sizeMonitor:t,element:i,skipInitialRead:s}=this;if(t==null)throw new Error("AG Charts - addResizeListener requires a SizeMonitor");return t.observe(i,n=>e(n),{skipInitialRead:s}),()=>t.unobserve(i)}reset(){this.cache={}}},MW='',DW=["styles","canvas","canvas-background","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],IW=new Set(["styles","canvas-container","canvas","tooltip-container"]),WT={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},kW=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function AW(e,t,i){const s=e.createIntersectionObserver(n=>{for(const o of n)o.target===t&&i(o.intersectionRatio)},{root:t});return s?.observe(t),s}var $T={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return $T}};function KT(e,t){const i=ke("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var Qx=class vd extends zD{constructor(t,i,s,n,o,a,r="normal"){super(),this.eventsHub=t,this.chart=i,this.agDocument=s,this.styleContainer=o,this.skipCss=a,this.mode=r,this.anchorName=`--${gi(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.cursorState=new Xx("default"),this._lastCursor=void 0,this._lastCenterSize=void 0,this.deferredProxies=new Map,this.deferredMode={scheduleFlush:this.scheduleFlush.bind(this)},this.minWidth=0,this.minHeight=0,this._isRtl=!1,this._deferring=!1,this.sizeMonitor=new vW(s),this.element=this.initDOM(),this.elementProxy=new qx(this.element,{deferredMode:this.deferredMode}),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName),this.sizeMonitor.observe(this.rootElements.canvas.element,()=>this.invalidateRectCaches(),{skipInitialRead:this.mode==="minimal"});let l=!1;if(this.observer=AW(s,this.element,c=>{c===0&&!l&&this.eventsHub.emit("dom:hidden",null),l=c===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",yW),this.setContainer(n),this.cleanup.register(VM(this.element)),this.setupGlobalListeners(),this.mode==="normal"){const c=this.rootElements["canvas-center"].element;if(c==null)throw new Error("Error initializing tab guards");const h=KT(c,"beforebegin"),d=KT(c,"afterend");this.tabGuards=new xW(c,h,d)}}initDOM(){if(this.mode==="normal"){const s=ke("div");return s.innerHTML=MW,s.firstChild}const t=ke("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=ke("div");return t.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:i}=this,s={};for(const n of DW){const o=`ag-charts-${n}`;let a;if(t==="normal"?a=i.classList.contains(o)?i:i.getElementsByClassName(o)[0]:IW.has(n)?a=i:a=i.getElementsByClassName(o)[0]??ke("div"),a==null)throw new Error(`AG Charts - unable to find DOM element ${o}`);s[n]={element:a,children:new Map,listeners:[]}}return s}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.sizeMonitor.unobserve(this.rootElements.canvas.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0;for(const t of Object.values(this.rootElements)){for(const i of t.children.values())i.remove();t.element.remove()}this.element.remove()}scheduleFlush(){this._deferring||this._pendingFlush==null&&(this._pendingFlush=setTimeout(()=>{this._pendingFlush=void 0,!this._deferring&&this.flushDeferredProxies()}))}flushDeferredProxies(){this._pendingFlush!=null&&(clearTimeout(this._pendingFlush),this._pendingFlush=void 0),this.elementProxy.flush();for(const t of this.deferredProxies.values())t.flush();this.updateStylesLocation(),this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(vd.batchedUpdateContainer.length===0&&setTimeout(this.applyBatchedUpdateContainer.bind(this),0),vd.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of vd.batchedUpdateContainer)t.destroyed||t.updateContainer();vd.batchedUpdateContainer.splice(0)}updateStylesLocation(){if(!(this.initiallyConnected===!0||this.container?.isConnected===!1)){this.documentRoot=this.getShadowDocumentRoot(this.container),this.initiallyConnected=!0;for(const t of this.rootElements.styles.children.keys())this.removeChild("styles",t);for(const[t,i]of this.styles)this.addStyles(t,i)}}setSizeOptions(t=300,i=300,s,n){const{style:o}=this.element;this.minWidth=s??t,this.minHeight=n??i,o.minWidth=`${this.minWidth}px`,o.minHeight=`${this.minHeight}px`,this.updateContainerClassName()}updateContainerSize(){const t=this.containerSize==null?"hidden":"",i=this.containerSize?`${this.containerSize.width??0}px`:"",s=this.containerSize?`${this.containerSize.height??0}px`:"",n=this._lastCenterSize;if(n==null||n.visibility!==t||n.width!==i||n.height!==s){this._lastCenterSize={visibility:t,width:i,height:s};const{style:o}=this.rootElements["canvas-center"].element;o.visibility=t,o.width=i,o.height=s}this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(!(t==null||t===this.container)){if(this.container&&(this.element.remove(),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t,this.pendingContainer=void 0,this.agDocument.setContainer(t),this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=t.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.invalidateRectCaches(),this.eventsHub.emit("dom:resize",null)},{skipInitialRead:this.mode==="minimal"}),this.invalidateAllCaches(),this.updateRtl(),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(t){const i="ag-charts-theme-";for(const s of Array.from(this.element.classList))s.startsWith(i)&&s!==t&&this.element.classList.remove(s);this.element.classList.add(t)}setThemeParameters(t){this.setCSSVariables("--ag-charts",void 0,void 0,t)}setModuleCSSVariables(t,i,s,n,o){this.setCSSVariables(`--ag-charts-${t}`,i,s,n,o)}setCSSVariables(t,i,s,n,o){for(const[a,r]of rt(n)){let l=a,c=`${r}`;a.endsWith("Size")||a.endsWith("Radius")||o?.includes(a)?c=`${r}px`:a.endsWith("Border")&&typeof r=="boolean"&&(l=`${a}Width`,c=r?"var(--ag-charts-border-width)":"0"),l=`${t}${i?"__":""}${i??""}-${A0(l)}${s?"--":""}${s??""}`,this.element.style.setProperty(l,c)}}updateCanvasLabel(t){Fe(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:t}addEventListener(t,i,s){const n=this.getEventElement(this.element,t);return mt(n,t,i,s)}removeEventListener(t,i,s){this.getEventElement(this.element,t).removeEventListener(t,i,s)}getBoundingClientRect(){return this._cachedCanvasRect??(this._cachedCanvasRect=this.rootElements.canvas.element.getBoundingClientRect()),this._cachedCanvasRect}getOverlayClientRect(){const{innerWidth:t,innerHeight:i}=this.agDocument,s=new re(0,0,t,i),n=this.getRawOverlayClientRect();return s.intersection(n)?.toDOMRect()??$T}findScrollableContainer(){if(this._cachedScrollableContainer!==void 0)return this._cachedScrollableContainer;let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let s;if(i!=null&&t===i)s=!0;else{const o=t.computedStyleMap?.()?.get("overflow-y")?.toString();s=o==="auto"||o==="scroll"}if(s)return this._cachedScrollableContainer=t,t;t=t.parentElement}return this._cachedScrollableContainer=null,null}getRawOverlayClientRect(){if(this._cachedRawOverlayRect!=null)return this._cachedRawOverlayRect;const t=this.findScrollableContainer();if(t!=null)return this._cachedRawOverlayRect=re.fromObject(t.getBoundingClientRect()),this._cachedRawOverlayRect;if(this.documentRoot!=null)return this._cachedRawOverlayRect=re.fromObject(this.documentRoot.getBoundingClientRect()),this._cachedRawOverlayRect;const{innerWidth:i,innerHeight:s}=this.agDocument;return this._cachedRawOverlayRect=new re(0,0,i,s),this._cachedRawOverlayRect}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??this.agDocument.body;for(;t!=null;){if(t===i)return;if(l0(t.parentNode))return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:i}=this.rootElements[t],s=[];for(const n of i.values())s.push(re.fromObject(n.getBoundingClientRect()));return re.merge(s)}isManagedChildDOMElement(t,i,s){const{children:n}=this.rootElements[i],o=n?.get(s);return o!=null&&t.contains(o)}contains(t,i){return i==null?this.element.contains(t):this.rootElements[i].element.contains(t)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),this.container==null||this.skipCss)return;const n=r=>r.getAttribute(s)===t,o=r=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const u of r.children){if(c&&l.has(u.tagName)){h=u;continue}if(c=!1,n(u))return;u.hasAttribute(s)&&(h=u)}const d=ke("style");return this.chart.styleNonce!=null&&(d.nonce=this.chart.styleNonce),h==null?r.prepend(d):r.insertBefore(d,h.nextSibling),d};let a;this.styleContainer?a=o(this.styleContainer):this.initiallyConnected===!1?a=this.addChild("styles",t):this.documentRoot==null&&!vd.headStyles.has(t)?(a=o(this.agDocument.head),vd.headStyles.add(t)):this.documentRoot!=null&&(a=this.addChild("styles",t)),!(a==null||n(a))&&(a.setAttribute(s,t),a.innerHTML=i)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,i){this.cursorState.set(t,i);const s=this.cursorState.stateValue();s!==this._lastCursor&&(this._lastCursor=s,this.element.style.cursor=s)}getCursor(){return this.element.style.cursor}get isRtl(){return this._isRtl}setEnableRtl(t){this.enableRtl=t,this.updateRtl()}updateRtl(){const t=this.enableRtl??(this.mode==="minimal"?!1:$c(this.container??this.pendingContainer));t!==this._isRtl&&(this._isRtl=t,this.element.dir=t?"rtl":"ltr",this.eventsHub.emit("rtl:change",null))}addChild(t,i,s,n){const{element:o,children:a,listeners:r}=this.rootElements[t];if(!a)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(a.has(i))return a.get(i);const{childElementType:l="div"}=kW.get(t)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??ke(l);for(const[h,d,u]of r)c.addEventListener(h,d,u);if(a.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),n){const h=o.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else o?.appendChild(c);return c}addProxyChild(t,i){const s=this.addChild(t,i),n=this.mode==="minimal";return new qx(s,{sizeMonitor:this.sizeMonitor,skipInitialRead:n})}addDeferredProxyChild(t,i){const s=this.addChild(t,i),n=this.mode==="minimal",o=new qx(s,{deferredMode:this.deferredMode,sizeMonitor:this.sizeMonitor,skipInitialRead:n});return this.deferredProxies.set(`${t}:${i}`,o),o}setDeferring(t){this.mode!=="minimal"&&(this._deferring=t,t||this.flushDeferredProxies())}removeChild(t,i){const{children:s}=this.rootElements[t];s&&(s.get(i)?.remove(),s.delete(i),this.deferredProxies.delete(`${t}:${i}`))}incrementDataCounter(t){const i=this.elementProxy.getData(t)??"0";this.elementProxy.setData(t,String(Number(i)+1))}setDataBoolean(t,i){this.elementProxy.setData(t,String(i))}setDataNumber(t,i){this.elementProxy.setData(t,String(i))}getDocument(){return this.agDocument}invalidateRectCaches(){this._cachedCanvasRect=void 0,this._cachedRawOverlayRect=void 0}invalidateAllCaches(){this.invalidateRectCaches(),this._cachedScrollableContainer=void 0}setupGlobalListeners(){const t=this.element.ownerDocument.defaultView;if(t==null)return;const i=()=>this.invalidateRectCaches(),s=()=>this.invalidateAllCaches();t.addEventListener("scroll",i,{capture:!0,passive:!0}),t.addEventListener("resize",i,{capture:!0,passive:!0}),this.element.ownerDocument.addEventListener("fullscreenchange",s),this.cleanup.register(()=>{t.removeEventListener("scroll",i,{capture:!0}),t.removeEventListener("resize",i,{capture:!0}),this.element.ownerDocument.removeEventListener("fullscreenchange",s)})}updateContainerClassName(){const{element:t,containerSize:i,minWidth:s,minHeight:n}=this;t.classList.toggle(WT.safeHorizontal,s>=(i?.width??1/0)),t.classList.toggle(WT.safeVertical,n>=(i?.height??1/0))}};Qx.className="DOMManager",Qx.batchedUpdateContainer=[],Qx.headStyles=new Set;var UT=Qx;function Ru(e,t,i){const{offsetX:s,offsetY:n,clientX:o,clientY:a}=t,{currentX:r,currentY:l}=Yl.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:t}}function Jx(e,t,i){return{type:e,sourceEvent:t}}function koe(){}var YT={change:{isNative:!0,allocator(e,t){return{type:"change",sourceEvent:e}}},blur:{isNative:!0,allocator(e,t){return{type:"blur",sourceEvent:e}}},focus:{isNative:!0,allocator(e,t){return{type:"focus",sourceEvent:e}}},keydown:{isNative:!0,allocator(e){return{type:"keydown",sourceEvent:e}}},keyup:{isNative:!0,allocator(e){return{type:"keyup",sourceEvent:e}}},contextmenu:{isNative:!0,allocator(e,t){return Ru("contextmenu",e,t)}},click:{isNative:!0,allocator(e,t){return Ru("click",e,t)}},dblclick:{isNative:!0,allocator(e,t){return Ru("dblclick",e,t)}},mouseenter:{isNative:!0,allocator(e,t){return Ru("mouseenter",e,t)}},mousemove:{isNative:!0,allocator(e,t){return Ru("mousemove",e,t)}},mouseleave:{isNative:!0,allocator(e,t){return Ru("mouseleave",e,t)}},wheel:{isNative:!0,allocator(e,t){const{offsetX:i,offsetY:s,clientX:n,clientY:o}=e,a=e.deltaMode===0?.01:1;let r=e.deltaX*a,l=e.deltaY*a;return Math.abs(e.deltaX)===0&&e.shiftKey&&([r,l]=[l,r]),{type:"wheel",offsetX:i,offsetY:s,clientX:n,clientY:o,deltaX:r,deltaY:l,sourceEvent:e}}},touchstart:{isNative:!0,allocator(e,t){return Jx("touchstart",e,t)}},touchmove:{isNative:!0,allocator(e,t){return Jx("touchmove",e,t)}},touchend:{isNative:!0,allocator(e,t){return Jx("touchend",e,t)}},touchcancel:{isNative:!0,allocator(e,t){return Jx("touchcancel",e,t)}},"drag-start":void 0,"drag-move":void 0,"drag-end":void 0,"collapse-widget":void 0,"expand-widget":void 0,"expand-controlled-widget":void 0},Yl=class{static alloc(e,t,i){const s=YT[e].allocator;return s(t,i)}static isHTMLEvent(e){return YT[e]?.isNative===!0}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},wW=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const s=o=>{const a=Yl.alloc(e,o,t.getElement());this.dispatch(e,t,a)},n={};(e.startsWith("touch")||e==="wheel")&&(n.passive=!1),this.initSourceHandler(e,s),t.getElement().addEventListener(e,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const s=this.lazyGetWidgetListeners(e,t),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(e){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of rt(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const s of this.widgetListeners?.[e]??[])s(i,t)}},CW=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.cleanup=new ot,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{mousegeneral:n,mousemove:o,mouseup:a}=this,r=s.view;this.cleanup.register(mt(r,"mousedown",n,{capture:!0}),mt(r,"mouseenter",n,{capture:!0}),mt(r,"mouseleave",n,{capture:!0}),mt(r,"mouseout",n,{capture:!0}),mt(r,"mouseover",n,{capture:!0}),mt(r,"mousemove",o,{capture:!0}),mt(r,"mouseup",a,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function LW(e,t,i,s){if(e.globalMouseDragCallbacks==null)return new CW(e,t,i,s)}var NW=500,TW=100;function OW(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}var VD=!1,PW=class{constructor(e,t,i,s,n){this.glob=e,this.self=t,this.initialTouch=s,this.target=n,this.cleanup=new ot,this.longTapInterrupted=!1,this.longtap=()=>{const{target:r,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new ot;r.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),VD=!0;const h=y=>y.preventDefault(),d=y=>{VD=!1,y.preventDefault(),c.flush()};c.register(mt(r,"touchmove",h,{passive:!1}),mt(r,"touchend",d,{passive:!1}),mt(r,"touchcancel",d,{passive:!1}));const{clientX:u,clientY:p}=l,f=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:r.ownerDocument.defaultView,clientX:u,clientY:p,pointerType:"touch"});r.dispatchEvent(f)}},this.touchmove=r=>{const{glob:l,self:c,initialTouch:h}=this,d=this.findInitialFinger(r.targetTouches);d!=null&&(this.longTapInterrupted=this.longTapInterrupted||OW(h,d)>TW,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(r,d))},this.touchend=r=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(r.changedTouches,r.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(r,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,NW);const{touchmove:o,touchend:a}=this;this.cleanup.register(mt(n,"touchmove",o,{passive:!1}),mt(n,"touchstart",a,{passive:!1}),mt(n,"touchend",a,{passive:!1}),mt(n,"touchcancel",a,{passive:!1})),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.flatMap(i=>Array.from(i));return Array.from(t).find(i=>i.identifier===this.initialTouch.identifier)}};function EW(e,t,i,s,n){if(!(e.globalTouchDragCallbacks!=null||VD))return new PW(e,t,i,s,n)}function BD(e,t,i,s){const{currentX:n,currentY:o}=Yl.calcCurrentXY(e.getElement(),s),a=s.pageX-i.pageX,r=s.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+a,offsetY:i.offsetY+r,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:o,originDeltaX:a,originDeltaY:r,sourceEvent:s}}function RW(e,{pageX:t,pageY:i}){const{x:s,y:n}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-n}}function FD(e,t,i,s,n){const{currentX:o,currentY:a}=Yl.calcCurrentXY(e.getElement(),n),r=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+r,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:o,currentY:a,originDeltaX:r,originDeltaY:l,sourceEvent:s}}var ZT={},XT=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return t===void 0&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(t);break}}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(this.dragTriggerRemover==null){const t=e.getElement(),i=new ot;i.register(mt(t,"mousedown",s=>this.triggerMouseDrag(e,s)),mt(t,"touchstart",s=>this.triggerTouchDrag(e,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){if(t.button===0){if(t.view==null){const i=e.getElement().ownerDocument.defaultView;t=new i.MouseEvent(t.type,{...t,view:i})}this.startMouseDrag(e,t)}}startMouseDrag(e,t){const i={pageX:Number.NaN,pageY:Number.NaN,offsetX:Number.NaN,offsetY:Number.NaN};Ng(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:n=>{const o=BD(e,"drag-start",i,n);this.dispatch("drag-start",e,o)},mousemove:n=>{const o=BD(e,"drag-move",i,n);this.dispatch("drag-move",e,o)},mouseup:n=>{const o=BD(e,"drag-end",i,n);this.dispatch("drag-end",e,o),this.endDrag(e,o)}};this.mouseDragger=LW(ZT,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const n=e.getElement(),o=n.getBoundingClientRect();Wg(o,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];t.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const s={pageX:Number.NaN,pageY:Number.NaN,...RW(e,i)};Ng(["pageX","pageY"],s,i);const n={touchmove:(r,l)=>{const c=FD(e,"drag-move",s,r,l);this.dispatch("drag-move",e,c)},touchend:(r,l)=>{const c=FD(e,"drag-end",s,r,l);this.dispatch("drag-end",e,c)}},o=e.getElement();this.touchDragger=EW(ZT,this,n,i,o);const a=FD(e,"drag-start",s,t,i);this.dispatch("drag-start",e,a)}dispatch(e,t,i){for(const s of this.getListenerSet(e))s(i,t);this.dispatchCallback(e,i)}},zW=class{constructor(e){this.elem=e}setBounds(e){dg(this.elemContainer??this.elem,e)}getBounds(){return m0(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();dg(t,i),MM(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Zl=class extends zW{constructor(){super(...arguments),this.index=Number.NaN,this.children=[]}set id(e){Fe(this.elem,"id",e)}get id(){return Bl(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.destroyListener?.(),this.destroyListener=void 0,this.remove();for(const e of this.children)e.parent=void 0,e.destroy();this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){Io(this.elem,"display",e?"none":void 0)}isHidden(){const{defaultView:e}=this.elem.ownerDocument;return e?.getComputedStyle(this.elem).display==="none"}setCursor(e){Io(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){Fe(this.elem,"aria-describedby",e)}setAriaHidden(e){Fe(this.elem,"aria-hidden",e)}setAriaLabel(e){Fe(this.elem,"aria-label",e)}setAriaExpanded(e){Fe(this.elem,"aria-expanded",e)}setAriaControls(e){Fe(this.elem,"aria-controls",e)}setAriaHasPopup(e){Fe(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){Io(this.elem,"pointer-events",e)}setCSSVariable(e,t){this.elem.style.setProperty(e,t)}isDisabled(){return Bl(this.elem,"aria-disabled",!1)}hasPopup(){const e=Bl(this.elem,"aria-haspopup");return e!==void 0&&e!=="false"}parseFloat(e){return e===""?0:Number.parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){Fe(this.elem,"data-focus-override",e)}setPreventsDefault(e){Fe(this.elem,"data-preventdefault",e)}setTabIndex(e){Fe(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.indexOf(e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){e.getElement().remove()}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(e!==void 0)return this.children.filter(t=>t.domIndex!==void 0&&t.domIndex>e).reduce((t,i)=>!t||i.domIndexthis.removeListener(e,t)}removeListener(e,t){Yl.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new XT(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...t,...Yl.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,n)}i=i.parent}}},VW=class extends Zl{constructor(){super(ke("div")),this.textElement=jt("text"),this.textElement.role="presentation",this.svgElement=jt("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},BW=class{constructor(e,t){this.getDispatcher=t,this.onExpanded=()=>{this.controller.setAriaExpanded(!0);const i=this.getDispatcher();if(i&&this.controls){const s={type:"expand-controlled-widget",controlled:this.controls};i.dispatch("expand-controlled-widget",this.controller,s)}},this.onCollapsed=i=>{this.controller.setAriaExpanded(!1),i.mode==="0"&&this.controller.focus()},e.setAriaExpanded(!1),this.controller=e}destroy(){this.controls?.collapse({mode:"2"}),this.setControlled(void 0)}setControlled(e){this.controls&&(this.controls.removeListener("expand-widget",this.onExpanded),this.controls.removeListener("collapse-widget",this.onCollapsed)),this.controls=e,this.controls&&(this.controller.setAriaControls(this.controls.id),this.controls.addListener("expand-widget",this.onExpanded),this.controls.addListener("collapse-widget",this.onCollapsed))}getControlled(){return this.controls}expandControlled(e){this.controller.isDisabled()||this.controls?.expand({controller:this.controller,sourceEvent:void 0,overrideFocusVisible:e?.overrideFocusVisible})}},_D=class extends Zl{constructor(e,t){super(e),Fe(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{gx(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}lazyControllerImpl(){return this.controllerImpl??(this.controllerImpl=new BW(this,()=>this.internalListener)),this.controllerImpl}destructor(){this.controllerImpl?.destroy()}setEnabled(e){Fe(this.elem,"aria-disabled",!e)}setControlled(e){return this.lazyControllerImpl().setControlled(e)}getControlled(){return this.lazyControllerImpl().getControlled()}expandControlled(e){return this.lazyControllerImpl().expandControlled(e)}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},eb=class extends _D{constructor(){super(ke("button"))}},qT=class extends Zl{constructor(){super(ke("div")),Fe(this.elem,"role","group")}destructor(){}},HD=class extends Zl{constructor(e,t){super(ke("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,o=$c(this.elem);let a,r;n==="both"?(a=lu("horizontal",o),r=lu("vertical")):(a=lu(n,o),r=void 0);let l=-1;if(ru(i.sourceEvent)){const c=i.sourceEvent.key;c===a.nextKey||c===r?.nextKey?l=s.index+1:(c===a.prevKey||c===r?.prevKey)&&(l=s.index-1)}this.children[l]?.focus()},Fe(this.elem,"role",t),this.orientation=e}get orientation(){return Bl(this.elem,"aria-orientation")??"both"}set orientation(e){Fe(this.elem,"aria-orientation",e==="both"?void 0:e)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,s=t===e.index;for(let n=0;nthis.getElement().step=t.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return Bl(this.elem,"aria-orientation")??"both"}set orientation(t){Fe(this.elem,"aria-orientation",t==="both"?void 0:t),Gm.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),n=se(t,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(t,i){const{divider:s}=this.step,n=Math.round(t*1e4)/s,{ariaValueText:o=wM(n/s)}=i??{},a=this.getElement();a.value=`${n}`,a.ariaValueText=o,a.ariaValueNow=`${n}`}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",Gm.onKeyDown):t.addListener("keydown",Gm.onKeyDown)}static onKeyDown(t,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};GD.STEP_ONE={attributeValue:"1",divider:1},GD.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var jD=GD,_W=class extends eb{constructor(){super(),Fe(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){Fe(this.elem,"aria-checked",e)}},tb=class extends HD{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function Vu(e,t){return t.params?.type===e}function HW(e){if(e==="button")return new eb;if(e==="slider")return new jD;if(e==="toolbar")return new tb;if(e==="group")return new qT;if(e==="list")return new FW;if(e==="region")return new zu(ke("div"));if(e==="text")return new VW;if(e==="listswitch")return new _W;throw new Error("AG Charts - error allocating meta")}function QT(e){const t={params:e,result:void 0};return t.result=HW(t.params.type),t}var GW=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new ot}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=QT(e),{params:i,result:s}=t,n=s.getElement();this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.role??i.type,Vu("toolbar",t)&&(t.result.orientation=t.params.orientation);const{ariaLabel:o}=i;return o&&this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(o.id,o.params)}),s}createProxyElement(e){const t=QT(e);if(Vu("button",t)){const{params:i,result:s}=t,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:o}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(o.id,o.params)})}this.setParent(t.params,t.result)}if(Vu("slider",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.type="range",n.role=i.role??"presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(t.params,t.result)}if(Vu("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(Vu("listswitch",t)){const{params:i,result:s}=t;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(Vu("region",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.role=i.role??"region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return Io(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),e.classList?.length&&i.classList.add(...e.classList),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,n=this.initElement(e,t);i!==void 0&&(n.tabIndex=i),s!==void 0&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i),t.destroyListener=()=>{this.domManager.removeChild("canvas-proxy",e.domManagerId)}}}},jW=/\$\{(\w+)}(?:\[(\w+)])?/gi,WD={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},WW=({defaultValue:e,variables:t})=>e?.replaceAll(jW,(i,s,n)=>{const o=t[s],a=n==null?null:WD[n];return n!=null&&a==null&&W.warnOnce(`Format style [${n}] is not supported`),a!=null?a.format(o):typeof o=="number"?WD.number.format(o):o instanceof Date?WD.datetime.format(o):String(o)}),$W=class{constructor(e){this.eventsHub=e,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.eventsHub.emit("locale:change",null))}t(e,t={}){const{localeText:i=dT,getLocaleText:s}=this,n=i[e];return String(s?.({key:e,defaultValue:n,variables:t})??WW({key:e,defaultValue:n,variables:t})??e)}},KW=class{constructor(e){this.width=600,this.height=300,this.direction="ltr";const{width:t,height:i,willReadFrequently:s=!1}=e;this.element=e.canvasElement,this.pixelRatio=e.pixelRatio,this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:s}),this.context.direction=this.direction,this.resize(t??0,i??0,this.pixelRatio),fT(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:n}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),n.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}setDirection(e){this.direction=e?"rtl":"ltr",this.element.dir=this.direction,this.context.direction=this.direction}clear(){gT(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.(),this.context.direction=this.direction}},UW=class extends zn{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=a0(),o=new n;return this.imageLoadingCount++,o.onload=()=>{s.image=o;for(const a of s.nodes)a.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},o.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},o.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){for(const e of this.cache.values())e.nodes.clear();this.cache.clear()}},YW=class{constructor(e){this.canvas=e,this.debug=ve.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i);for(const{canvas:s}of this.layersMap.values())s.resize(e,t,i)}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:n}=e,o=new AD({width:t,height:i,pixelRatio:s});return this.layersMap.set(o,{id:this.nextLayerId++,name:n,canvas:o}),this.debug("Scene.addLayer() - layers",this.layersMap),o}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() - layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},ib=class extends zn{constructor(e){super(),this.debug=ve.create(!0,"scene"),this.id=gi(this),this.imageLoader=new UW,this.root=null,this.pendingSize=null,this.isDirty=!1,this.direction="ltr",this.cleanup=new ot,this.updateDebugFlags(),this.canvas=new KW(e),this.layersManager=new YW(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{W.warnOnce(`Unable to load image ${t}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}get isRtl(){return this.direction==="rtl"}setContainer(e){const{element:t}=this.canvas;return t.remove(),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){ve.inDevelopmentMode(()=>Gr._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>e.remove()}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return e.remove(),this}download(e,t){UM(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}setDirection(e){this.direction=e?"rtl":"ltr",this.canvas.setDirection(e)}updateBaseFont(){const e=this.root?.resolveFont();e!=null&&e!==this._baseFont&&(this._baseFont=e,this.canvas.context.font=e)}applyPendingResize(){return this.pendingSize?(this.layersManager.resize(...this.pendingSize),this.pendingSize=null,this._baseFont!=null&&(this.canvas.context.font=this._baseFont),!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s,debugColors:n}=e??{},{canvas:o,canvas:{context:a}={},root:r,width:l,height:c,pixelRatio:h}=this;if(!a)return;const d=ve.check("scene:stats","scene:stats:verbose");d&&this.ensureDebugStatsRegistration();const u=performance.now(),p=this.applyPendingResize();if(r&&!r.visible){this.isDirty=!1;return}let f;if(r instanceof Le&&(f=r.dirty),r!=null&&f===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:$x(r,"console")}),d&&zT(this.layersManager,t,a,void 0,i,s,n);return}const y={ctx:a,direction:this.direction,width:l,height:c,devicePixelRatio:h,debugNodes:{}};ve.check("scene:stats:verbose")&&(y.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),iW(y);let x=!1;if((f!==!1||p)&&(x=!0,o.clear()),r&&ve.check("scene:dirtyTree")){const{dirtyTree:b,paths:v}=VT(r);ve.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:b,paths:v})}if(r&&x){if(r.visible&&r.preRender(y),this.debug.check()){const b=$x(r,"console");this.debug("Scene.render() - before",{canvasCleared:x,tree:b})}if(r.visible)try{a.save(),r.render(y),a.restore()}catch(b){throw this.canvas.reset(),b}}t["\u270D\uFE0F"]=performance.now()-u,a.verifyDepthZero?.(),this.isDirty=!1,d&&zT(this.layersManager,t,a,y.stats,i,s,n),sW(a,y.debugNodes),r&&this.debug.check()&&this.debug("Scene.render() - after",{tree:$x(r,"console"),canvasCleared:x})}ensureDebugStatsRegistration(){if(this.releaseDebugStats)return;const e=Jj(),t=()=>{e(),this.releaseDebugStats=void 0};this.releaseDebugStats=t,this.cleanup.register(t)}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return Gr.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),FT(),Object.assign(this,{canvas:void 0})}};ib.className="Scene";var ZW=class{constructor(e,t,i){this.eventsHub=e,this.annotationRoot=t,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||Ae(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return ce(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Pe([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(e.remove(),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},XW=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new Le({name:"Axes-Grids",zIndex:2}),this.axisGroup=new Le({name:"Axes",zIndex:3}),this.axisLabelGroup=new Le({name:"Axes-Labels",zIndex:15}),this.axisCrosslineRangeGroup=new Le({name:"Axes-Crosslines-Range",zIndex:6}),this.axisCrosslineLineGroup=new Le({name:"Axes-Crosslines-Line",zIndex:10}),this.axisCrosslineLabelGroup=new Le({name:"Axes-Crosslines-Label",zIndex:15}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of t){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}this.eventsHub.emit("axis:change",null)}getAxisIdContext(e){for(const[,t]of this.axes)for(const i of t)if(i.axisId===e)return i}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.axisGroup.remove(),this.axisGridGroup.remove()}},$D=class{constructor(e,t,i){this.eventsHub=e,this.caller=t,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=ve.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){typeof e=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(e){const{pendingData:t}=this;if(t!=null&&(t.params.windowStart==null&&t.params.windowEnd==null||t.params.windowStart?.valueOf()===e.windowStart?.valueOf()&&t.params.windowEnd?.valueOf()===e.windowEnd?.valueOf())){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,t.data);return}this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:e}=this;if(!e)return;const{params:t,fetchRequest:i}=e,s=await i;return{params:t,data:s}}restoreData(e){this.pendingData=e}createThrottledFetch(e){return oy(t=>this.fetch(t).catch(i=>W.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return oy((t,i)=>this.dispatch(t,i),e,{leading:!0,trailing:!0})}dispatch(e,t){this.debug(`DataService - dispatching 'data-load' | ${e}`),this.eventsHub.emit("data:load",{data:t})}async fetch(e){"context"in this.caller&&(e.context=this.caller.context);const t=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),s=this.requestCounter++;this.debug(`DataService - requesting | ${s}`);let n;try{n=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(a){this.debug(`DataService - request failed | ${s}`),W.errorOnce(`DataService - request failed | [${a}]`)}this.isLoadingInitialData=!1;const o=this.freshRequests.indexOf(t);return o===-1||this.dispatchOnlyLatest&&o!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${s}`),n):(this.freshRequests=this.freshRequests.slice(o+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(s,n):this.eventsHub.emit("data:error",null),n)});this.latestRequest={params:e,fetchRequest:t},this.freshRequests.push(t),await t}};g([Ze({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],$D.prototype,"dispatchThrottle",2),g([Ze({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],$D.prototype,"requestThrottle",2);var qW=class{constructor(e,t){this.domManager=e,this.eventsHub=t,this.observers=[]}updateFonts(e){if(!(!e||e.size===0)){this.loadFonts(e);for(const t of e)this.observeFontStatus(t)}}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(o=>encodeURIComponent(o)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${t.join(s)}${i}&display=swap'); `;this.domManager.addStyles(`google-font-${t.join("-")}`,n)}observeFontStatus(e){const t=r0();if(t===void 0)return;const s=this.domManager.getDocument().createElement("div",{position:"absolute",top:"0",margin:"0",padding:"0",overflow:"hidden",visibility:"hidden",width:"auto",maxWidth:"none",fontSynthesis:"none",fontFamily:e,fontSize:"16px",whiteSpace:"nowrap"});s.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,s);const n=new t(o=>{const a=o?.at(0)?.contentBoxSize.at(0)?.inlineSize;a!=null&&a>0&&(et.clear(),this.eventsHub.emit("font:load",null))});n.observe(s),this.observers.push(n)}},JT=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===e);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(s){W.errorOnce(s)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},Ra={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},QW={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},Ps={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},JW=/%[-_0]?L/,e4=/%[-_0]?S/,t4=/%[-_0]?M/,i4=/%[-_0]?[HI]/,s4=/^%[-_0]?[de]$/,n4=/^%[-_0]?[Bbm]$/,o4=/^%[-_0]?[Yy]$/;function a4(e,t,i){if(typeof e=="string")return e;e??(e=Ra);const{millisecond:s=Ra.millisecond,second:n=Ra.second,minute:o=Ra.minute,hour:a=Ra.hour,day:r=Ra.day,month:l=Ra.month,year:c=Ra.year}=e,h=Ps[t],d=QW[t],u=i?Ps[i]:-1;if(u=Ps.year&&!o4.test(c)||u=Ps.month&&!n4.test(l)||u=Ps.day&&!s4.test(r))return d;let p;switch(t){case"year":return c;case"month":return u=Ps.hour&&!i4.test(p)||h>=Ps.minute&&!t4.test(p)||h>=Ps.second&&!e4.test(p)||h>=Ps.millisecond&&!JW.test(p))return d;let f;return u{const a=ZS.mergeSpecifiers(t,i)??Ra;return ZS.getFormatter("date",a,s,n,{truncateDate:o})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const s of t)Ge(s)&&Ge(i)?i={...i,...s}:i=s;return i}static getFormatter(t,i,s,n="long",{truncateDate:o}={}){if(Ge(i)){if(t!=="date"){W.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const a=n==="component"?i?.[s]??Ra[s]:a4(i,s,o);return uh(a)}switch(t){case"number":{const a=fg(i);return a==null?void 0:uy(a)}case"date":return uh(i);case"category":return a=>i.replace("%s",String(a))}}setFormatter(t){this.formatter!==t&&(this.formatter=t,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:s,truncateDate:n,allowNull:o}={}){if(i.value==null&&!o)return;const{formatter:a}=this;if(a==null)return;if(typeof a=="function"){const h=t(a,i);return h==null?void 0:String(h)}const r=a[i.property];if(r==null)return;if(typeof r=="function"){const h=t(r,i);return h==null?h:Dt(h)}else if(i.type==="date"){const{unit:h,style:d}=i;return this.dateFormatter(r,s,h,d,n)?.(i.value)}const l=s??r;if(typeof l!="string")return;let c=this.formats.get(l);return c==null&&(c=ZS.getFormatter(i.type,l),this.formats.set(l,c)),c?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(t,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,o=typeof n=="function"?void 0:n?.[t.property];switch(t.type){case"date":{const{unit:a,style:r}=t,l=o!=null&&typeof o!="function"?o:void 0;return this.dateFormatter(l,i,a,r,s)?.(t.value)??String(t.value)}case"number":return Ao(t.value,t.fractionDigits);case"category":return t.value==null?"":Array.isArray(t.value)?t.value.join(" - "):typeof t.value=="string"?t.value:typeof t.value=="number"?Ao(t.value):String(t.value)}}},e1={activeItem:{type:j(zd()("series-node","legend")),seriesId:L,itemId:j(Ie(L,P))},frozen:E},df={mode:Q(U("integrated","standalone")),withinStudio:Q(E),container:cy,context:()=>!0,theme:le,series:dn,annotations:le,navigator:le,scrollbar:le,initialState:{active:e1,chartType:L,annotations:le,legend:Ft({visible:E,seriesId:L,itemId:L,legendItemName:L},"legend state array"),zoom:le}},r4={...we,...df,axes:xr,data:dn,dataIdKey:L},l4={...we,...df,axes:xr,data:dn,dataIdKey:L},c4={...we,...df,data:dn,dataIdKey:L,topology:Fl},h4={...we,...df,data:dn,dataIdKey:L},t1=(e=>(e[e.Default=64]="Default",e[e.ZoomDrag=32]="ZoomDrag",e[e.Annotations=16]="Annotations",e[e.ContextMenu=8]="ContextMenu",e[e.Animation=4]="Animation",e[e.AnnotationsSelected=2]="AnnotationsSelected",e[e.Frozen=1]="Frozen",e[e.Hoverable=82]="Hoverable",e[e.Clickable=83]="Clickable",e[e.Focusable=69]="Focusable",e[e.Keyable=87]="Keyable",e[e.ContextMenuable=72]="ContextMenuable",e[e.AnnotationsMoveable=18]="AnnotationsMoveable",e[e.AnnotationsDraggable=114]="AnnotationsDraggable",e[e.ZoomDraggable=101]="ZoomDraggable",e[e.ZoomClickable=69]="ZoomClickable",e[e.ZoomWheelable=119]="ZoomWheelable",e[e.All=126]="All",e))(t1||{}),i1=class{constructor(){this.stateQueue=68}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}},d4=class{constructor(e,t,i,s,n){this.chartService=e,this.eventsHub=t,this.interactionManager=s,this.fireEvent=n,this.mementoOriginatorKey="active",this.updateable=!0,this.didLayout=!1,this.pendingMemento=void 0;const o=i.addListener("pre-scene-render",()=>{this.didLayout=!0;const{pendingMemento:a}=this;a&&(this.restoreMemento(a.version,a.mementoVersion,a.memento),this.pendingMemento=void 0),o()})}isFrozen(){return this.interactionManager.isState(1)}clear(){return this.update(void 0,void 0)}update(e,t){return this.performUpdate("user-interaction",e,t,!1)}performUpdate(e,t,i,s){if(!this.updateable)return!1;const n=this.currentItem;let o=!1;if(s||!Ht(n,t)){const{frozen:a,activeItem:r}=this.createMementoWithItem(t),{datum:l}=i??{};this.fireEvent({type:"activeChange",source:e,frozen:a,activeItem:r,datum:l,dataIdKey:i?.series.data?.dataIdKey,preventDefault:()=>{o=!0}})}return o||(this.currentItem=t,this.eventsHub.emit("active:update",t)),o}createMemento(){return this.createMementoWithItem(this.currentItem)}createMementoWithItem(e){const t=this.isFrozen();switch(e?.type){case"series-node":case"legend":{const{type:i,seriesId:s,itemId:n}=e;return{frozen:t,activeItem:{type:i,seriesId:s,itemId:n}}}default:return e?.type,{frozen:t}}}guardMemento(e,t){if(e==null)return!0;const i=ki(e,df.initialState.active);return t.push(...i.invalid.map(s=>s.toString())),i.invalid.length===0}restoreMemento(e,t,i){if(!this.didLayout){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.updateable=!1;const[s,n]=this.performRestoration(i?.activeItem);this.updateable=!0;const o=this.isFrozen(),a=i?.frozen,r=a===void 0?!1:o!==a;a===!0?this.interactionManager.pushState(1):a===!1&&this.interactionManager.popState(1),this.performUpdate("state-change",s,n,r)}performRestoration(e){let t=!1;const i=()=>t=!0;let s;const n=r=>s=r,o=this.pendingMemento!==void 0,a=this.chartService.id;return this.eventsHub.emit("active:load-memento",{initialState:o,chartId:a,activeItem:e,reject:i,setDatum:n}),t?[void 0,void 0]:[e,s]}};function u4(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function s1(e,t){if(typeof e=="string")try{e=Ne.fromString(e)}catch{e=Ne.fromArray([0,0,0])}if(typeof t=="string")try{t=Ne.fromString(t)}catch{t=Ne.fromArray([0,0,0])}return i=>Ne.mix(e,t,i).toRgbaString()}var KD=.2,uf=["initial","remove","update","add","trailing","end","none"],pf={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:KD,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+KD,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}};function p4(e){return e.every(t=>t instanceof Gr)}function UD(e){return p4(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function YD(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>YD(i,t[s])):Fx(e)&&Fx(t)?e.equals(t):Ge(e)&&Ge(t)?Sy(e,t,YD):!1}var g4=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??MD,this.phase=e.phase;const t=e.duration??pf[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,e.skip===!0&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),e.collapsable!==!1&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return YD(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(s-t)):0}get delta(){return this.ease(se(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||Fx(t))return this.interpolateValue(e,t);if(Array.isArray(t)){const s=[];for(let n=0;n{const o=[];for(const a of s)o.push(a(n));return o}}const i=[];for(const s of Object.keys(t)){const n=this.createInterpolator(e[s],t[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[o,a]of i)n[o]=a(s);return n}}interpolateValue(e,t){if(!(e==null||t==null)){if(Fx(e))return i=>e[Bx](t,i);try{switch(typeof e){case"number":return u4(e,t);case"string":return s1(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}};function f4(e,t,i,s){return t=e.endIndex)return!1;if(t<=e.startIndex&&s>=e.endIndex)e.startIndex=t,e.endIndex=t;else if(t<=e.startIndex){const n=s-e.startIndex,o=e.endIndex-e.startIndex;e.startIndex=t,e.endIndex=e.startIndex+Math.max(0,o-n)}else s>=e.endIndex?e.endIndex=Math.max(e.startIndex,t):e.endIndex=Math.max(e.startIndex,e.endIndex-i);return!0}function n1(e,t){const i=Math.ceil(e/1e3);return Math.max(t,i)}function o1(e,t){return Math.max(1,Math.ceil(e/t))}function y4(e){return e.filter(t=>t.endIndex>t.startIndex)}function x4(e,t,i){if(!t.enableBanding||e0&&e.handleInsertion(i.index,i.insertCount),i.deleteCount>0&&e.handleRemoval(i.index,i.deleteCount)}function v4(e,t){for(const i of t)e.handleInsertion(i,0)}function S4(e,t){b4(e,t.spliceOps),t.updatedIndices.size>0&&v4(e,t.updatedIndices)}var M4=1e3,D4=10,a1=class{constructor(e={}){this.bands=[],this.dataSize=0,this.config={minDataSizeForBanding:e.minDataSizeForBanding??M4,targetBandCount:e.targetBandCount??D4,maxBandSize:e.maxBandSize??1/0,enableBanding:e.enableBanding??!0}}applyIndexMap(e){S4(this,e)}initializeBands(e){this.dataSize=Math.max(0,e),this.bands=x4(this.dataSize,this.config,(t,i)=>this.createBand(t,i))}getBandCount(){return this.bands.length}handleInsertion(e,t){if(this.dataSize+=t,this.bands.length===0){this.initializeBands(this.dataSize);return}const i=n1(this.dataSize,this.config.targetBandCount),s=o1(this.dataSize,i),n=Math.ceil(s*1.1);for(let o=0;o0){a.endIndex-a.startIndex>=s?this.bands.push(this.createBand(e,e+t)):(a.endIndex+=t,a.isDirty=!0);break}f4(a,e,t,r)&&(a.isDirty=!0,t>0&&en&&this.splitBand(o,s))}}handleRemoval(e,t){if(t<=0||this.bands.length===0)return;const i=Math.min(t,Math.max(0,this.dataSize-e));if(!(i<=0)){this.dataSize=Math.max(0,this.dataSize-i);for(const s of this.bands)m4(s,e,i)&&(s.isDirty=!0);this.bands=y4(this.bands)}}splitBand(e,t){const i=this.bands[e],s=i.endIndex-i.startIndex,n=Math.min(t,Math.floor(s/2)),o=i.startIndex+n,a=this.createBand(i.startIndex,o),r=this.createBand(o,i.endIndex);this.bands.splice(e,1,a,r)}getStats(){const e=this.bands.filter(t=>t.isDirty);return{totalBands:this.bands.length,dirtyBands:e.length,dataSize:this.dataSize}}markRangeDirty(e,t){for(const i of this.bands)ei.startIndex&&(i.isDirty=!0)}},Yn=class $_{constructor(){this.domain=new Set,this.dateTimestamps=new Set,this.hasDateValues=!1,this.sortedValues=null,this.sortOrder=void 0,this.isSortedUnique=!1}static is(t){return t instanceof $_}setSortedUniqueMode(t,i){i&&(this.isSortedUnique=!0,this.sortOrder=t,this.sortedValues=[])}extend(t){this.isSortedUnique&&this.sortedValues?(this.sortedValues.push(t),t instanceof Date&&(this.hasDateValues=!0)):t instanceof Date?(this.hasDateValues=!0,this.dateTimestamps.add(t.valueOf())):this.domain.add(t)}getDomain(){if(this.isSortedUnique&&this.sortedValues){let t=!1;return this.sortedValues.filter(i=>{if(i==null)return t?!1:(t=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(t)return!1;t=!0}return!0})}if(this.hasDateValues){const t=Array.from(this.dateTimestamps,i=>new Date(i));return this.domain.size>0?[...t,...Array.from(this.domain)]:t}return Array.from(this.domain)}isDateDomain(){return this.hasDateValues}isSortedUniqueMode(){return this.isSortedUnique}getSortOrder(){return this.sortOrder}mergeFrom(t){if(this.isSortedUnique&&t.isSortedUnique&&this.sortOrder===t.sortOrder&&this.sortOrder!==void 0&&t.sortedValues){t.hasDateValues&&(this.hasDateValues=!0),this.sortedValues??(this.sortedValues=[]),this.sortedValues.push(...t.sortedValues);return}if(this.convertToSetMode(),t.hasDateValues&&(this.hasDateValues=!0),t.isSortedUnique&&t.sortedValues)for(const i of t.sortedValues)i instanceof Date?this.dateTimestamps.add(i.valueOf()):this.domain.add(i);else{for(const i of t.dateTimestamps)this.dateTimestamps.add(i);for(const i of t.domain)this.domain.add(i)}}convertToSetMode(){if(this.isSortedUnique){if(this.sortedValues){for(const t of this.sortedValues)t instanceof Date?this.dateTimestamps.add(t.valueOf()):this.domain.add(t);this.sortedValues=null}this.isSortedUnique=!1,this.sortOrder=void 0}}},Zn=class K_{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof K_}static extendDomain(t,i=[1/0,-1/0]){for(const s of t)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]t&&(this.domain[0]=t),this.domain[1]1&&super.splitBand(e,t)}markBandsDirty(e,t){this.markRangeDirty(e,t),this.fullDomainCache=null}markAllBandsDirty(){for(const e of this.bands)e.isDirty=!0;this.fullDomainCache=null}extendBandsFromData(e,t){const i=e.length;for(const s of this.bands){if(!s.isDirty)continue;const n=this.domainFactory();this.isDiscrete&&this.sortOrder!==void 0&&this.isUnique&&Yn.is(n)&&n.setSortedUniqueMode(this.sortOrder,this.isUnique),s.subDomain=n;const{startIndex:o,endIndex:a}=s;for(let r=o;re.isDirty)}extend(e){this.markAllBandsDirty(),this.fullDomainCache=null}canUseSortedConcatenation(){if(!this.sortOrder||!this.isUnique||!this.isDiscrete)return!1;for(const e of this.bands)if(!Yn.is(e.subDomain)||!e.subDomain.isSortedUniqueMode()||e.subDomain.getSortOrder()!==this.sortOrder)return!1;return!0}concatenateSortedDomains(){const e=new Yn;e.setSortedUniqueMode(this.sortOrder,this.isUnique);for(const t of this.bands)Yn.is(t.subDomain)&&e.mergeFrom(t.subDomain);return e.getDomain()}deduplicateNulls(e){let t=!1;return e.filter(i=>{if(i==null)return t?!1:(t=!0,!0);if(i instanceof Date&&Number.isNaN(i.valueOf())){if(t)return!1;t=!0}return!0})}getDomain(){if(this.fullDomainCache!==null)return this.fullDomainCache;if(this.bands.length===0)return this.fullDomainCache=[],[];if(this.bands.length===1){const e=this.bands[0].subDomain.getDomain();return this.fullDomainCache=this.isDiscrete?this.deduplicateNulls(e):e,this.fullDomainCache}if(this.isDiscrete){const e=this.bands[0].subDomain;if(Yn.is(e))if(this.canUseSortedConcatenation())this.fullDomainCache=this.deduplicateNulls(this.concatenateSortedDomains());else{const t=new Yn;for(const i of this.bands)Yn.is(i.subDomain)&&t.mergeFrom(i.subDomain);this.fullDomainCache=this.deduplicateNulls(t.getDomain())}else{const t=new Set;for(const i of this.bands)for(const s of i.subDomain.getDomain())t.add(s);this.fullDomainCache=Array.from(t)}}else{let e,t;for(const i of this.bands){const s=i.subDomain.getDomain();if(s.length===2){const[n,o]=s;(e===void 0||n!=null&&e!=null&&nt)&&(t=o)}}e!==void 0&&t!==void 0?this.fullDomainCache=[e,t]:this.fullDomainCache=[]}return this.fullDomainCache}getStats(){const e=this.bands.filter(i=>i.isDirty).length,t=this.bands.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);return{bandCount:this.bands.length,dirtyBandCount:e,averageBandSize:this.bands.length>0?t/this.bands.length:0,dataSize:this.dataSize}}};function r1(e,t=[0,0]){for(const i of e)typeof i=="number"&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function I4(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,aggregateFunction:s=>r1(s),groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function k4(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>Zn.extendDomain(s)}}function l1(e,t){const i=t?.visible??!0;return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(s,n=[0,0])=>(i&&(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0),n)}}function A4(e,t){const i=t?.visible??!0;return{id:e,matchGroupIds:t?.matchGroupId?[t?.matchGroupId]:void 0,type:"aggregate",aggregateFunction:n=>r1(n),groupAggregateFunction:(n,o=[0,0,-1])=>(i&&(o[0]+=n?.[0]??0,o[2]++,o[1]+=n?.[1]??0),o),finalFunction:(n=[0,0,0])=>{const o=n[0]+n[1];return o>=0?[0,o/n[2]]:[o/n[2],0]}}}function c1(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,o=[])=>{const a=o[1]-o[0];return t.aggregateFunction(n).map(r=>r/a)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function w4(e){return()=>{let t=0;return i=>je(i)?(t+=e?Math.max(0,i):i,t):i}}function C4(){return()=>{let e=0;return t=>{if(!je(t))return t;const i=e;return e+=t,i}}}var ZD="\0__AG_NULL__\0",XD="\0__AG_UNDEFINED__\0";function h1(e){return e===null?ZD:e===void 0?XD:Array.isArray(e)?"["+e.map(h1).join(",")+"]":me(e)?JSON.stringify(e):String(e)}function qD(e){return e.map(h1).join("-")}function vn(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function d1(e,t){return t?.get(e.id)??0}function QD(e){return"scopes"in e&&Array.isArray(e.scopes)}function za(e,t){const i=[];for(let s=0;s{let i=t;for(const s of e)i=i[s];return i}}var T4=class{constructor(e,t,i){this.ctx=e,this.scopeCacheManager=t,this.resolvers=i}aggregateUngroupedData(e){const t=this.ctx.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i,dataSources:s}=e,n=Ks(s.keys()),o=e.keys.map(l=>l.get(n)),a=s.get(n)?.data??[],r=this.ctx.keys.some(l=>l.allowNullKey===!0);e.aggregation=a?.map((l,c)=>{const h=[];for(const[d,u]of this.ctx.aggregates.entries()){const p=this.valueGroupIdxLookup(u);let f=u.groupAggregateFunction?.()??[1/0,-1/0];const y=p.map(S=>i[S][c]),x=JD(o,c,r),b=x==null?void 0:u.aggregateFunction(y,x);b&&(f=u.groupAggregateFunction?.(b,f)??Zn.extendDomain(b,f));const v=u.finalFunction?.(f)??f;h[d]=v,Zn.extendDomain(v,t[d])}return h})}aggregateGroupedData(e){const t=this.ctx.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,n]of this.ctx.aggregates.entries()){const o=this.valueGroupIdxLookup(n);for(let a=0;ar.datumIndices[u]?.length??0));for(let u=0;u{const x=r.datumIndices[y]?.[u];if(x==null)return;const b=this.resolvers.resolveAbsoluteIndex(a,x);return i[y][b]}),f=n.aggregateFunction(p,l);f&&(c=n.groupAggregateFunction?.(f,c)??Zn.extendDomain(f,c))}const d=n.finalFunction?.(c)??c;r.aggregation[s]=d,Zn.extendDomain(d,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this.ctx,{columnScopes:i,columns:s,invalidData:n}=e;for(const o of t){const a=this.valueGroupIdxLookup(o),r=o.adjust()();for(let l=0;lnew Yn:()=>new Zn,this.ctx.bandingConfig,s),t.set(e,n)),n&&s&&n.setSortOrderMetadata(i?.sortOrder,i?.isUnique??!1),n||(s?new Yn:new Zn)}extendDomainFromData(e,t,i){if(e instanceof gf)e.extendBandsFromData(t,i);else for(let s=0;st.includes(i))}function p1(e,t){if(e.valueType==="category"){for(const i of t)if(i.property===e.property&&i.valueType===e.valueType&&E4(i.scopes,e.scopes)&&i.validation===e.validation)return i}}var R4=class{constructor(e,t,i){this.ctx=e,this.initializer=t,this.scopeCacheManager=i,this.processValueFactory=new P4(e)}recomputeDomains(e){const t=this.ctx.debug.check()?performance.now():0,i=e[ff];let s;const n=e[Xl],o=this.setupDefinitionDomains(this.ctx.keys,i,n),a=new Map;for(const h of this.ctx.values){const d=p1(h,this.ctx.keys);d&&a.set(h,d)}const r=this.setupValueDomainsWithSharing(this.ctx.values,i,o,a),l=new Set;for(const[,h]of a){const d=o.get(h);d&&l.add(d)}this.initializeDomainBands(this.ctx.keys,o,h=>{const d=e.keys[h];return Math.max(...Array.from(d.values()).map(u=>u.length))},h=>String(h.property)),this.initializeDomainBands(this.ctx.values,r,h=>e.columns[h].length,h=>String(h.property));const c=new Map;if(i.size>0){s={totalBands:0,dirtyBands:0,totalData:0};for(const h of i.values())if(h instanceof gf){const d=h.getStats();c.set(h,d),s.totalBands+=d.bandCount,s.dirtyBands+=d.dirtyBandCount,s.totalData=Math.max(s.totalData,d.dataSize)}}if(this.extendDomainsFromData(this.ctx.keys,o,(h,d)=>e.keys[h]?.get(d),h=>h.scopes??[],h=>e.invalidKeys?.get(h)),this.extendDomainsFromData(this.ctx.values,r,(h,d)=>e.columns[h],h=>[Ks(h.scopes)],h=>e.invalidKeys?.get(h),l),e.domain.keys=this.ctx.keys.map(function(d){const u=o.get(d),p=u.getDomain();return Zn.is(u)&&p[0]>p[1]?[]:p}),e.domain.values=this.ctx.values.map(function(d){const u=r.get(d),p=u.getDomain();return Zn.is(u)&&p[0]>p[1]?[]:p}),e.type==="grouped"&&(e.domain.groups=e.groups.map(h=>h.keys)),this.collectDomainBandingMetadata(e,o,r,i,c),this.ctx.debug.check()&&t>0){const d=performance.now()-t;if(s&&s.totalBands>0){const u=s.dirtyBands/s.totalBands,p=Math.round(u*s.totalData);this.ctx.debug(`recomputeDomains with banding: ${d.toFixed(2)}ms, bands: ${s.dirtyBands}/${s.totalBands} dirty, data scanned: ~${p}/${s.totalData} (${(u*100).toFixed(1)}%)`)}else this.ctx.debug(`recomputeDomains: ${d.toFixed(2)}ms (no banding)`)}}setupDefinitionDomains(e,t,i){const s=new Map;for(const[n,o]of e.entries()){const a=i?.get(n);s.set(o,this.initializer.setupDomainForDefinition(o,t,a))}return s}initializeDomainBands(e,t,i,s){for(const[n,o]of e.entries()){const a=t.get(o);if(!a)continue;const r=i(n);this.initializer.initializeBandedDomain(a,r,s(o))}}extendDomainsFromData(e,t,i,s,n,o){for(const[a,r]of e.entries()){const l=t.get(r);if(l&&!o?.has(l))for(const c of s(r)){if(!c)continue;const h=i(a,c);if(!h)continue;const d=n(c);this.initializer.extendDomainFromData(l,h,d)}}}setupValueDomainsWithSharing(e,t,i,s){const n=new Map;for(const o of e){const a=s.get(o);if(a){const r=i.get(a);if(r){n.set(o,r);continue}}n.set(o,this.initializer.setupDomainForDefinition(o,t))}return n}initDataDomainProcessor(e){const{keys:t,values:i}=this.ctx,s=new Set;for(const u of i)if(u.scopes)for(const p of u.scopes)s.add(p);const n=new Map,o=new Map;let a=!0;const r=()=>{for(const u of t)u.valueType==="category"?n.set(u,new Yn):n.set(u,new Zn);for(const u of i){const p=p1(u,t);if(p){const f=n.get(p);if(f){n.set(u,f),a&&(a=(u.scopes?.length??0)===s.size);continue}}u.valueType==="category"?n.set(u,new Yn):(n.set(u,new Zn),a&&(a=(u.scopes?.length??0)===s.size))}};r();const l=this.scopeCacheManager.buildAccessors(Cr(t,i)),c=new WeakMap;for(const u of Cr(t,i)){const p=l.get(u.property),f=n.get(u),y={value:void 0,missing:!1,valid:!1},x=this.processValueFactory.createProcessValueFn(u,p,f,y,o,e);c.set(u,x)}function h(u){const p=c.get(u);if(!p)throw new Error("AG Charts - missing processValue function for definition");return p}function d(u,p,f,y){return h(u)(p,f,y)}return{dataDomain:n,processValue:d,getProcessValue:h,initDataDomain:r,scopes:s,allScopesHaveSameDefs:a}}collectDomainBandingMetadata(e,t,i,s,n){e.optimizations??(e.optimizations={});const o=(l,c)=>l.map(h=>{const d=c.get(h),u=s.get(h),p=d instanceof gf;let f;p||(f=h.valueType==="category"?"discrete domain":"not configured");let y;if(p&&u){const x=n.get(u)??u.getStats(),b=x.bandCount>0?x.dirtyBandCount/x.bandCount:0;y={totalBands:x.bandCount,dirtyBands:x.dirtyBandCount,dataSize:x.dataSize,scanRatio:b}}return{property:String(h.property),applied:p,reason:f,stats:y}}),a=o(this.ctx.keys,t),r=o(this.ctx.values,i);e.optimizations.domainBanding={keyDefs:a,valueDefs:r}}};function z4(){return{lastValue:void 0,sortOrder:0,isUnique:!0,isOrdered:!0}}function V4(e,t){const i=typeof t=="number"?t:t?.valueOf?.();if(typeof i!="number"||!Number.isFinite(i))return;if(e.lastValue===void 0){e.lastValue=i;return}const s=i-e.lastValue;if(s===0)e.isUnique=!1;else if(e.isOrdered){const n=s>0?1:-1;e.sortOrder===0?e.sortOrder=n:e.sortOrder!==n&&(e.isOrdered=!1)}e.lastValue=i}function B4(e){return{sortOrder:e.isOrdered&&e.sortOrder!==0?e.sortOrder:void 0,isUnique:e.isUnique,isDirty:!1}}var F4=class{constructor(e,t){this.ctx=e,this.domainManager=t}extractData(e){const{dataDomain:t,getProcessValue:i,allScopesHaveSameDefs:s}=this.domainManager.initDataDomainProcessor("extend"),{keys:n,values:o}=this.ctx,{invalidData:a,invalidKeys:r,invalidKeyCount:l,invalidDataCount:c,missingData:h,allKeyMappings:d,keySortOrders:u}=this.extractKeys(n,e,i),{columns:p,columnScopes:f,columnNeedValueOf:y,partialValidDataCount:x,maxDataLength:b}=this.extractValues(a,c,h,o,e,r,i),v=S=>{const M=t.get(S),D=M.getDomain();return Zn.is(M)&&D[0]>D[1]?[]:D};return{type:"ungrouped",input:{count:b},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...d.values()],columns:p,columnScopes:f,columnNeedValueOf:y,invalidKeys:r,invalidKeyCount:l,invalidData:a,invalidDataCount:c,missingData:h,domain:{keys:n.map(v),values:o.map(v)},defs:{allScopesHaveSameDefs:s,keys:n,values:o},partialValidDataCount:x,time:0,version:0,[tI]:new Map,[Xl]:u,[eI]:new Map,[ff]:new Map,[xh]:new Map}}extractKeys(e,t,i){const s=new Map,n=new Map,o=new Map,a=new Map,r=new Map,l=new Map,c=new Map;let h,d;const u=e.map(f=>i(f)),p=(f,y)=>{const x=d.get(f);h.set(y,h.get(x)),s.has(x)&&(s.set(y,s.get(x)),n.set(y,n.get(x)),a.set(y,a.get(x)))};for(const[f,y]of e.entries()){const{invalidValue:x,scopes:b}=y,v=u[f];h=new Map,d=new Map,l.set(y,h);const S=z4();for(const M of b??[]){const D=t.get(M)?.data??[];if(d.has(D)){p(D,M);continue}const I=[];h.set(M,I),d.set(D,M);let k,A,w=0,C;for(let T=0;Ta(p));for(const[p,f]of s.entries()){const{invalidValue:y}=f,x=u[p];if(new Set(f.scopes.map(A=>n.get(A))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(f)}`);const v=new Set(f.scopes),S=Ks(f.scopes),M=n.get(S)?.data??[],D=new Array,I=o.get(S);let k=!1;for(let A=0;A0?1-x/f:0;e.optimizations.batchMerging={originalBatchCount:f,mergedBatchCount:x,mergeRatio:S}}const b=y.length===1,v=Object.freeze(za(y[0][1].length,u1));for(const[S,M,D,I,k,A]of y){const w=n[Ks(M)];for(let C=0;CF[C]);if(T==null||T.length===0)throw new Error("AG Charts - no keys found for scope(s): "+S.join(", "));const O=t?.(T)??T,V=d==null?void 0:qD(O);let z=d?.get(V),R,B,G=!1;if(z==null?(R={keys:O,datumIndices:[],aggregation:[],validScopes:l},B=p++,z=[B,R],G=!0,d?.set(V,z),c.push(R.keys),h.push(R)):([B,R]=z,u=!1),k?.[C]===!0){R.validScopes===l&&(R.validScopes=new Set(l.values()));for(const F of I)R.validScopes.delete(F)}if(G&&C===B&&b)R.datumIndices=v;else{!G&&R.datumIndices===v&&(R.datumIndices=v.map(F=>[...F]));for(const F of M)(i=R.datumIndices)[F]??(i[F]=[]),R.datumIndices[F].push(C-B)}}}return{...e,type:"grouped",domain:{...e.domain,groups:c},groups:h,groupsUnique:u,optimizations:e.optimizations,[ff]:e[ff],[xh]:e[xh]}}groupBatches(e,t,i,s,n,o){const a=[],r=new Set;for(const l of e){const c=t.map((f,y)=>y).filter(f=>!r.has(f)&&i[f].has(l));if(c.length===0)continue;for(const f of c)r.add(f);const h=new Set;for(const f of c)for(const y of i[f])h.add(y);const d=s.map(f=>f.get(l)).filter(f=>f!=null),u=n?.get(l),p=o?.get(l);a.push([l,c,d,h,u,p])}return this.mergeCompatibleBatches(a)}areBatchesCompatible(e,t){const[,,i,,s,n]=e,[,,o,,a,r]=t;return i.every((l,c)=>l===o[c])&&n===r&&s===a}mergeCompatibleBatches(e){const t=[],i=new Set;for(let s=0;s0}function H4(e){return e.removedIndices.size===0&&e.totalAppendCount===0&&e.totalPrependCount>0}function G4(e){return e.removedIndices.size===0}function j4(e){return e.removedIndices.size===0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0&&t.deleteCount===0)}function W4(e){return e.removedIndices.size>0&&e.totalPrependCount===0&&e.totalAppendCount===0&&e.spliceOps.every(t=>t.insertCount===0)}function $4(e){return sI(e.removedIndices)>0}function sI(e){if(e.size===0)return 0;const t=Array.from(e).sort((i,s)=>i-s);if(t[0]!==0)return 0;for(let i=0;i0&&e.totalPrependCount===0}var U4=class{constructor(e,t){this.indexMap=e,this.prependValues=t.prependValues,this.appendValues=t.appendValues,this.insertionValues=t.insertionValues}getRemovedIndices(){return Array.from(this.indexMap.removedIndices).sort((e,t)=>e-t)}getUpdatedIndices(){return Array.from(this.indexMap.updatedIndices).sort((e,t)=>e-t)}forEachPreservedIndex(e){const{originalLength:t,removedIndices:i,totalPrependCount:s}=this.indexMap;let n=0;const o=Array.from(i).sort((r,l)=>r-l);let a=0;for(let r=0;r0?Array.from({length:a.insertCount},function(h,d){return t(a.index+d)}):[],l=e.splice(a.index,a.deleteCount,...r);i&&l.length>0&&i(l,a)}e.length!==n&&(e.length=n)}}},Y4=class extends a1{constructor(e={}){super(e),this.lastDirtyBandCount=0,this.lastScanRatio=0,this.statsCaptured=!1}createBand(e,t){return{startIndex:e,endIndex:t,cachedResult:void 0,isDirty:!0}}initializeBands(e){super.initializeBands(e),this.statsCaptured=!1}getBands(){return this.bands}evaluateFromData(e,t,i=!1){const s=e.reducer();for(const n of this.bands){if(i&&!n.isDirty)continue;const o=e.needsOverlap&&n.startIndex>0?Math.max(0,n.startIndex-1):n.startIndex,a=this.evaluateRange(e,s,t,o,n.endIndex);n.cachedResult=a,n.isDirty=!1}}getResult(e){const t=this.bands.map(i=>i.cachedResult);return e.combineResults(t)}evaluateRange(e,t,i,s,n){let o=e.initialValue;const{keyColumns:a,keysParam:r,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;hi.isDirty),t=e.reduce((i,s)=>i+(s.endIndex-s.startIndex),0);this.lastDirtyBandCount=e.length,this.lastScanRatio=this.dataSize>0?t/this.dataSize:0,this.statsCaptured=!0}getStats(){const e=this.bands.filter(s=>!s.isDirty&&s.cachedResult!==void 0);let t,i;if(this.statsCaptured)t=this.lastDirtyBandCount,i=this.lastScanRatio;else{const s=this.bands.filter(o=>o.isDirty),n=s.reduce((o,a)=>o+(a.endIndex-a.startIndex),0);t=s.length,i=this.dataSize>0?n/this.dataSize:0}return{totalBands:this.bands.length,dirtyBands:t,dataSize:this.dataSize,scanRatio:i,cacheHits:e.length}}},f1=class{constructor(e={}){this.bandingConfig=e}static evaluateRange(e,t,i,s,n){let o=e.initialValue;const{keyColumns:a,keysParam:r,rawData:l}=i,c=Math.min(n,l.length);for(let h=s;ha.get(i)).filter(a=>a!=null),o=n.map(()=>{});return{scopeId:i,rawData:s,keyColumns:n,keysParam:o}}},Z4=class{constructor(e,t){this.ctx=e,this.reducerManager=t}isReprocessingSupported(e){if(e.type==="grouped"){if(!e.groupsUnique||this.getUniqueDataSets(e).size!==1)return!1;const n=Ks(e.scopes);if(e.invalidKeys?.get(n)?.some(a=>a))return!1}return this.ctx.aggregates.length>0||this.ctx.reducers.some(s=>s.supportsBanding!==!0||typeof s.combineResults!="function")||this.ctx.processors.some(s=>s.incrementalCalculate===void 0)||this.ctx.propertyProcessors.length>0?!1:this.ctx.groupProcessors.every(s=>s.supportsReprocessing??!1)}reprocessData(e,t,i,s,n,o){const a=performance.now(),r=this.collectScopeChanges(e,t);if(r.size===0)return e;this.commitPendingTransactions(e);const l=this.buildDefinitionProcessors(this.ctx.keys,i),c=this.buildDefinitionProcessors(this.ctx.values,i),h=this.processAllInsertions(e,r,l,c);this.processAllUpdates(e,r,l,c,h),this.updateBandsForChanges(e,r);const d=this.transformKeysArrays(e,r,h);this.transformColumnsArrays(e,r,h),this.transformInvalidityArrays(e,r,h),this.reprocessBandedReducers(e,r),e.type==="grouped"&&(this.transformGroupsArray(e,r,h),this.ctx.groupProcessors.length>0&&s(e,r)),this.invalidateSortOrdersForChanges(e,r),n(e),this.reprocessProcessors(e),e.reduced?.diff!=null&&r.size>0&&this.generateDiffMetadata(e,r,d),this.updateProcessedDataMetadata(e);const u=performance.now();e.time=u-a,e.version+=1,o(e,"reprocess");const p=sb(r);return e.changeDescription=p.size===1?p.values().next().value:void 0,e}updateBandsForChanges(e,t){const i=e[ff];if(i.size===0)return;const s=sb(t);for(const n of s){const{indexMap:o}=n;for(const a of i.values())a.applyIndexMap(o)}}reprocessBandedReducers(e,t){if(e.type!=="ungrouped")return;const i=this.ctx.reducers.filter(s=>s.supportsBanding&&typeof s.combineResults=="function");if(i.length!==0){e.reduced??(e.reduced={});for(const s of i){const n=this.reducerManager.evaluate(s,e,{reuseCleanBands:!0,beforeEvaluate:(o,a)=>{if(!a.scopeId)return;const r=t.get(a.scopeId);r&&o.applyIndexMap(r.indexMap)}});n!==void 0&&(e.reduced[s.property]=n)}}}collectScopeChanges(e,t){const i=new Map;for(const[s,n]of e.dataSources){const o=t?.get(n)??n.getChangeDescription();o&&i.set(s,o)}return i}commitPendingTransactions(e){const t=this.getUniqueDataSets(e);for(const i of t)i.commitPendingTransactions()}buildDefinitionProcessors(e,t){return e.map((i,s)=>({def:i,index:s,processValue:t(i)}))}processAllInsertions(e,t,i,s){const n=new Map;for(const[o,a]of t){const r=e.dataSources.get(o);if(!r)continue;const l=this.processInsertionsOnce(o,a,r,i,s);n.set(o,l)}return n}processAllUpdates(e,t,i,s,n){for(const[o,a]of t){const r=e.dataSources.get(o);if(!r)continue;const l=a.getUpdatedIndices();if(l.length===0)continue;let c=n.get(o);c||(c=new Map,n.set(o,c));for(const h of l){if(h<0||h>=r.data.length)continue;const d=this.processDatum(r,h,o,i,s);d&&c.set(h,d)}}}processInsertionsOnce(e,t,i,s,n){const o=new Map,{finalLength:a}=t.indexMap;for(const r of t.indexMap.spliceOps)if(!(r.insertCount<=0))for(let l=0;l=a)continue;const h=this.processDatum(i,c,e,s,n);h&&o.set(c,h)}return o}processDatum(e,t,i,s,n){const o=e.data[t],a=new Map,r=new Map;let l=!1,c=!1,h=!1;if(o==null||typeof o!="object")l=!0,c=!0;else{for(const{index:d,def:u,processValue:p}of s){if(!u.scopes?.includes(i))continue;const f=p(o,t,i);a.set(d,{value:f.value,valid:f.valid}),f.valid||(l=!0)}for(const{index:d,def:u,processValue:p}of n){if(!u.scopes?.includes(i))continue;const f=p(o,t,u.scopes);r.set(d,{value:f.value,valid:f.valid}),f.valid||(c=!0),f.missing&&(h=!0)}}return{keys:a,values:r,hasInvalidKey:l,hasInvalidValue:c,hasMissingValue:h}}transformArraysWithCache(e,t,i,s,n,o){for(const[a,r]of e.entries())for(const l of n(r)){const c=t.get(l);if(!c)continue;const h=s(a,l);if(!h)continue;const d=i.get(l);this.applyChangeDescWithCache(c,h,d,(u,p)=>o(u,r,a))}}transformKeysArrays(e,t,i){const s=new Map,n=r=>{let l=s.get(r);return l||(l={tuples:[]},s.set(r,l)),l},o=new WeakSet;for(const[r,l]of this.ctx.keys.entries())for(const c of l.scopes??[]){const h=t.get(c);if(!h)continue;const d=e.keys[r]?.get(c);if(!d)continue;if(o.has(d)){const y=Array.from(e.keys[r].entries()).find(([x,b])=>b===d)?.[0];y&&y!==c&&s.has(y)&&s.set(c,s.get(y));continue}o.add(d);const u=i.get(c),p=n(c);let f=0;this.applyChangeDescWithCache(h,d,u,y=>{const x=y?.keys.get(r);return x?.valid?x.value:l.invalidValue},y=>{for(const x of y)p.tuples[f]||(p.tuples[f]=new Array(this.ctx.keys.length)),p.tuples[f][r]=x,f+=1})}const a=new Map;for(const[r,{tuples:l}]of s){if(l.length===0)continue;const c=new Set;for(const h of l){const d=[];for(const[u,p]of h.entries())this.ctx.keys[u].scopes?.includes(r)&&d.push(p);d.length>0&&c.add(qD(d))}a.set(r,c)}return a}transformColumnsArrays(e,t,i){this.transformArraysWithCache(this.ctx.values,t,i,s=>e.columns[s],s=>[Ks(s.scopes)],(s,n,o)=>{if(s){if(s.hasInvalidKey)return n.invalidValue;const a=s.values.get(o);return a?.valid?a.value:n.invalidValue}return n.invalidValue})}transformInvalidityMap(e,t,i,s){const n=new Set;for(const[o,a]of t){let r=e.get(o);if(!r){const c=i.get(o);if(c&&Array.from(c.values()).some(s))r=za(a.indexMap.originalLength,!1),e.set(o,r);else continue}if(n.has(r))continue;n.add(r);const l=i.get(o);this.applyChangeDescWithCache(a,r,l,(c,h)=>s(c))}}transformInvalidityArrays(e,t,i){e.invalidKeys&&this.transformInvalidityMap(e.invalidKeys,t,i,s=>s?.hasInvalidKey??!1),e.invalidData&&this.transformInvalidityMap(e.invalidData,t,i,s=>s?s.hasInvalidKey||s.hasInvalidValue:!1),e.missingData&&this.transformInvalidityMap(e.missingData,t,i,s=>s?.hasMissingValue??!1)}applyChangeDescWithCache(e,t,i,s,n){e.applyToArray(t,a=>{const r=i?.get(a);return s(r,a)},n);const o=e.getUpdatedIndices();if(o.length!==0)for(const a of o){if(a<0||a>=t.length)continue;const r=i?.get(a);t[a]=s(r,a)}}transformGroupsArray(e,t,i){const s=Ks(e.scopes),n=t.get(s);if(!n)return;const o=i.get(s);for(const[,r]of o??[])if(r.hasInvalidKey)throw new Error("AG Charts - reprocessing grouped data with invalid keys not supported. This typically indicates a data quality issue that requires full reprocessing.");n.applyToArray(e.groups,r=>this.createDataGroupForInsertion(r,e,s,o));const a=n.getUpdatedIndices();if(a.length>0)for(const r of a)r<0||r>=e.groups.length||(e.groups[r]=this.createDataGroupForInsertion(r,e,s,o))}createDataGroupForInsertion(e,t,i,s){const n=[];for(const d of t.keys){const u=d.get(i);u&&n.push(u[e])}const o=t.groups[0],a=()=>Object.freeze(za(t.columnScopes.length,u1)),r=o?.datumIndices??a(),c=s?.get(e)?.hasInvalidValue??!1;let h;return c?(h=new Set(t.scopes),h.delete(i)):h=t.scopes,{keys:n,datumIndices:r,aggregation:[],validScopes:h}}generateDiffMetadata(e,t,i){const s=(n,o)=>{const a=[];for(const r of e.keys){const l=r.get(n);if(!l)return;a.push(l[o])}return a.length>0?qD(a):void 0};for(const[n,o]of t){const a={changed:!0,added:new Set,removed:i.get(n)??new Set,updated:new Set,moved:new Set};for(const c of o.indexMap.spliceOps)if(c.insertCount>0)for(let h=0;h0)for(let c=l;c0)for(let c=0;c{if(c!==h){const d=s(n,h);d&&a.moved.add(d)}});e.reduced.diff[n]=a}}updateProcessedDataMetadata(e){let t=0;for(const s of e.dataSources.values())t=Math.max(t,s.data.length);e.input.count=t;let i=0;for(const[s,n]of e.invalidData??new Map){const o=e.invalidKeys?.get(s);for(let a=0;a{if(typeof a=="number")return a;if(a instanceof Date)return a.valueOf()};let n=s(t);const o=e.sortOrder;for(const a of i){const r=s(a);if(r===void 0)continue;if(n===void 0){n=r;continue}const l=r-n;if(l===0&&(e.isUnique=!1),e.sortOrder!==void 0){let c=0;l>0?c=1:l<0&&(c=-1),c!==0&&c!==o&&(e.sortOrder=void 0)}n=r}}updateKeySortOrdersForAppend(e,t){for(const[i,s]of e.keys.entries()){const n=e[Xl].get(i);if(!n)continue;const o=Ks(s.values());if(!o||o.length<=t)continue;const a=t>0?o[t-1]:void 0,r=o.slice(t);this.updateSortOrderForAppend(n,a,r)}}invalidateSortOrdersForChanges(e,t){const i=sb(t);let s=!0,n=!1,o=!1,a,r;for(const l of i){const{indexMap:c}=l;j4(c)||(g1(c)?(n=!0,a=c.originalLength):W4(c)||(K4(c)?(o=!0,r={originalLength:c.originalLength,removedCount:c.removedIndices.size}):s=!1))}s?n&&a!==void 0?this.updateKeySortOrdersForAppend(e,a):o&&r&&this.updateKeySortOrdersForRollingWindow(e,r):(e[Xl].clear(),e[eI].clear())}updateKeySortOrdersForRollingWindow(e,t){const{originalLength:i,removedCount:s}=t;for(const[n,o]of e.keys.entries()){const a=e[Xl].get(n);if(!a)continue;const r=Ks(o.values());if(!r||r.length===0)continue;const l=i-s,c=l>0?r[l-1]:void 0,h=r.slice(l);this.updateSortOrderForAppend(a,c,h)}}invalidateCachesForChanges(e){this.markDomainRangesDirty(e[tI])}markDomainRangesDirty(e){for(const t of e.values())t.isDirty=!0}recountInvalid(e,t){if(!(!e||!t))for(const[i,s]of e){const n=s.filter(Boolean).length;n===0?(e.delete(i),t.delete(i)):t.set(i,n)}}reprocessProcessors(e){if(this.ctx.processors.length!==0){e.reduced??(e.reduced={});for(const t of this.ctx.processors){const i=e.reduced[t.property],s=t.incrementalCalculate?.(e,i)??t.calculate(e,i);e.reduced[t.property]=s}}}getUniqueDataSets(e){return new Set(e.dataSources.values())}},bh=0,vh=1,Va=2,X4=class jm{constructor(t){this.isDirty=!1;const i=t.reduce((o,a)=>Math.max(o,a.length),0),{maxLevelSize:s,buffer:n}=jm.createBuffer(i);this.maxLevelSize=s,this.buffer=n,this.dataLength=i,this.populateBuffer(t)}static computeMaxLevelSize(t){let s=1<<32-Math.clz32(t);return t===s/2&&(s=s>>>1),s}static createBuffer(t){const i=jm.computeMaxLevelSize(t),s=new Float64Array((i*2-1)*2).fill(Number.NaN);return{maxLevelSize:i,buffer:s}}populateBuffer(t){const{maxLevelSize:i,buffer:s}=this,n=i-1;for(const o of t){const a=o.length;for(let r=0;rd)&&(s[c+1]=l)}}for(let o=i>>>1;o>=1;o>>>=1){const a=o-1,r=a+o<<1;let l=a<<1,c=r;for(let h=0;hy?f:y,l+=2,c+=4}}}rebuild(t){const i=t.reduce((n,o)=>Math.max(n,o.length),0);if(jm.computeMaxLevelSize(i)===this.maxLevelSize)this.buffer.fill(Number.NaN);else{const{maxLevelSize:n,buffer:o}=jm.createBuffer(i);this.maxLevelSize=n,this.buffer=o}this.dataLength=i,this.populateBuffer(t)}updateValue(t,i){const{maxLevelSize:s,buffer:n}=this,o=s+t-1,a=Math.trunc(o*Va)+bh,r=Math.trunc(o*Va)+vh;n[a]=Number.NaN,n[r]=Number.NaN;for(const l of i){const c=Number(l),h=n[a],d=n[r];(!Number.isFinite(h)||cd)&&(n[r]=c)}this.propagateUp(o)}updateValues(t){for(const{index:i,values:s}of t)this.updateValue(i,s)}propagateUp(t){const{buffer:i}=this;for(;t>0;){const s=Math.trunc((t-1)/2),n=2*s+1,o=2*s+2,a=i[Math.trunc(n*Va)+bh],r=i[Math.trunc(n*Va)+vh],l=i[Math.trunc(o*Va)+bh],c=i[Math.trunc(o*Va)+vh];i[Math.trunc(s*Va)+bh]=!Number.isFinite(l)||ac?r:c,t=s}}computeRangeInto(t,i,s,n,o,a,r){const l=o+a-1;if(l=s)return r;if(o>=i&&l1&&(n=Math.trunc(n*2),a=Math.trunc(a/2),this.computeRangeInto(t,i,s,Math.trunc(n+1),o,a,r),this.computeRangeInto(t,i,s,Math.trunc(n+2),o+a,a,r));return r}rangeBetween(t,i,s){const n=s??[0,0];if(t>i)return n[0]=Number.NaN,n[1]=Number.NaN,n;const{maxLevelSize:o,buffer:a}=this;return n[0]=1/0,n[1]=-1/0,this.computeRangeInto(a,t,i,0,0,o,n),n}getRange(t){const{buffer:i}=this,s=t??[0,0];return s[0]=i[bh],s[1]=i[vh],s}get range(){const{buffer:t}=this;return[t[bh],t[vh]]}get length(){return this.dataLength}};function q4(e,t){const i=e.length;if(e.length<=1)return 1;let s=0,n=e[0];for(let o=1;othis.resolveProcessedDataIndexById(e,d)),a=n.input.count;if(i<=0&&s>=a){const d=n.domain.values;let u=1/0,p=-1/0;for(const f of o){const y=d[f];y!=null&&(y[0]p&&(p=y[1]))}return this.rangeBetweenBuffer[0]=u,this.rangeBetweenBuffer[1]=p,this.rangeBetweenBuffer}const r=o.join(":"),l=n[tI],c=o.map(d=>n.columns[d]);let h=l.get(r);return h==null?(h=new X4(c),l.set(r,h)):h.isDirty&&(h.rebuild(c),h.isDirty=!1),h.rangeBetween(i,s,this.rangeBetweenBuffer)}getSortOrder(e,t,i,s){const n=i.get(t);if(n==null||n.isDirty){const o={sortOrder:q4(e,s)};return i.set(t,o),o.sortOrder}return n.sortOrder}getKeySortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s]?.get(e.id);return n?this.getSortOrder(n,s,i[Xl],!0):void 0}getKeySortEntry(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i[Xl].get(s);return n?.isDirty?void 0:n}getColumnSortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.columnNeedValueOf?.[s]??!0;return this.getSortOrder(i.columns[s],s,i[eI],n)}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}},J4=class{constructor(e){this.ctx=e}processScopeCache(){this.ctx.scopeCache.clear();for(const e of Cr(this.ctx.keys,this.ctx.values,this.ctx.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(!this.ctx.scopeCache.has(t))this.ctx.scopeCache.set(t,new Map([[s,e]]));else{if(this.ctx.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.ctx.scopeCache.get(t).set(s,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.ctx.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,s=typeof t=="string"?t:t.id,n=a=>{if(a.idsMap){for(const[r,l]of a.idsMap)if(e?.includes(r)&&l.has(s))return!0}return!1},o=this.ctx.values.reduce((a,r,l)=>((r.scopes==null||i&&!r.scopes.length||r.scopes.some(h=>e?.includes(h)))&&(r.property===s||r.id===s||n(r))&&a.push(l),a),[]);if(o.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return o}buildAccessors(e){const t=new Map;if(this.ctx.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=L4(i.property);if(n==null){W.warnOnce("Invalid property path [%s]",i.property);continue}const o=N4(n);t.set(i.property,o)}return t}},nI=class{constructor(e,t="standalone",i=!1,s){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=ve.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[];let n=!0;for(const c of e.props){if(c.type==="key"&&!n)throw new Error("AG Charts - internal config error: keys must come before values.");c.type==="value"&&n&&(n=!1)}const o=({matchGroupIds:c=[]})=>{for(const h of c)if(this.values.every(d=>d.groupId!==h))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${h}).`)},a=new Set,r=new Set;for(const c of e.props){const h=c.type==="key"?a:r;if(QD(c)&&c.scopes)for(const d of c.scopes)h.add(d);switch(c.type){case"key":this.keys.push({...c,index:this.keys.length,missing:new Map});break;case"value":if(c.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(c)}`);this.values.push({...c,index:this.values.length,missing:new Map});break;case"aggregate":o(c),this.aggregates.push({...c,index:this.aggregates.length});break;case"group-value-processor":o(c),this.groupProcessors.push({...c,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...c,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...c,index:this.reducers.length});break;case"processor":this.processors.push({...c,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const c=new Set(r.values());for(const h of a)c.delete(h);if(c.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...c.values()]}`)}const l={keys:this.keys,values:this.values,aggregates:this.aggregates,groupProcessors:this.groupProcessors,propertyProcessors:this.propertyProcessors,reducers:this.reducers,processors:this.processors,debug:this.debug,mode:this.mode,bandingConfig:this.opts.domainBandingConfig,suppressFieldDotNotation:this.suppressFieldDotNotation,scopeCache:this.scopeCache};this.resolvers=new Q4(l),this.scopeCacheManager=new J4(l),this.domainInitializer=new O4(l),this.domainManager=new R4(l,this.domainInitializer,this.scopeCacheManager),this.reducerManager=new f1(this.opts.domainBandingConfig),this.dataExtractor=new F4(l,this.domainManager),this.dataGrouper=new _4(l),this.aggregator=new T4(l,this.scopeCacheManager,this.resolvers),this.incrementalProcessor=new Z4(l,this.reducerManager)}resolveProcessedDataDefById(e,t){return this.resolvers.resolveProcessedDataDefById(e,t)}resolveProcessedDataIndexById(e,t){return this.resolvers.resolveProcessedDataIndexById(e,t)}resolveKeysById(e,t,i){return this.resolvers.resolveKeysById(e,t,i)}hasColumnById(e,t){return this.resolvers.hasColumnById(e,t)}resolveColumnById(e,t,i){return this.resolvers.resolveColumnById(e,t,i)}resolveColumnNeedsValueOf(e,t,i){return this.resolvers.resolveColumnNeedsValueOf(e,t,i)}resolveMissingDataCount(e){return this.resolvers.resolveMissingDataCount(e)}*forEachDatum(e,t,i,s){const n=t.columnScopes.findIndex(o=>o.has(e.id));for(const o of i.datumIndices[n]??[]){const a=this.resolvers.resolveAbsoluteIndex(s,o);yield t.columns[n][a]}}getUniqueDataSets(e){return new Set(e.dataSources.values())}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(o=>o.has(e.id)),s={groupIndex:0,columnIndex:i},n=[];for(const o of t.groups){s.group=o;for(const a of o.datumIndices[i]??n)s.datumIndex=this.resolvers.resolveAbsoluteIndex(s.groupIndex,a),yield s;s.groupIndex++}}getDomain(e,t,i,s){const n=this.resolvers.getDomain(e,t,i,s);if(i==="key"&&n.length>0){const o=this.getKeySortMetadata(e,t,s);return{domain:n,sortMetadata:o}}return{domain:n}}getDomainBetweenRange(e,t,[i,s],n){return this.resolvers.getDomainBetweenRange(e,t,[i,s],n)}getKeySortOrder(e,t,i){return this.resolvers.getKeySortOrder(e,t,i)}getColumnSortOrder(e,t,i){return this.resolvers.getColumnSortOrder(e,t,i)}getKeySortMetadata(e,t,i){const s=this.resolvers.getKeySortEntry(e,t,i);if(s?.sortOrder!=null)return{sortOrder:s.sortOrder,isUnique:s.isUnique}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:n,reducers:o,processors:a,propertyProcessors:r}=this,l=performance.now();if(t&&this.keys.length===0)return;let c=this.extractData(e);t?c=this.dataGrouper.groupData(c):i&&(c=this.dataGrouper.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.aggregator.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregator.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregator.aggregateGroupedData(c),r.length>0&&this.postProcessProperties(c),o.length>0&&this.reduceData(c),a.length>0&&this.postProcessData(c),this.warnDataMissingProperties(e);const h=performance.now();return c.time=h-l,c.version+=1,this.collectOptimizationMetadata(c,"full-process"),this.debug.check()&&e$(c),this.processScopeCache(),c}isReprocessingSupported(e){return this.incrementalProcessor.isReprocessingSupported(e)}reprocessData(e,t){if(!this.isReprocessingSupported(e)){this.debug.check()&&this.debug("Falling back to full reprocessing - incremental not supported for current configuration");const o=this.getUniqueDataSets(e);for(const a of o)a.commitPendingTransactions();return this.processData(e.dataSources)}const{getProcessValue:i}=this.initDataDomainProcessor("skip"),s=this.incrementalProcessor.reprocessData(e,t,i,this.reprocessGroupProcessors.bind(this),this.recomputeDomains.bind(this),this.collectOptimizationMetadata.bind(this)),{diff:n}=s.reduced??{};return n&&this.eventsHub?.emit("datamodel:diff",{diff:n}),s}recomputeDomains(e){this.domainManager.recomputeDomains(e)}warnDataMissingProperties(e){this.dataExtractor.warnDataMissingProperties(e)}processScopeCache(){this.scopeCacheManager.processScopeCache()}valueGroupIdxLookup(e){return this.scopeCacheManager.valueGroupIdxLookup(e)}valueIdxLookup(e,t){return this.scopeCacheManager.valueIdxLookup(e,t)}extractData(e){return this.dataExtractor.extractData(e)}reprocessGroupProcessors(e,t){const{groupProcessors:i}=this,{columns:s}=e;for(const o of i)if(!o.supportsReprocessing)throw new Error("AG Charts - attempted to reprocess group processor that does not support reprocessing. This is an internal error that should not occur.");const n=sb(t);for(const o of i){const a=this.valueGroupIdxLookup(o),r=o.adjust()();for(const l of n){const{indexMap:c}=l;for(const h of c.spliceOps)if(h.insertCount>0)for(let d=0;dr.get(s)).filter(r=>r!=null),a=o.map(()=>{});return f1.evaluateRange(e,i,{rawData:n,keyColumns:o,keysParam:a},0,n.length)}postProcessData(e){e.reduced??(e.reduced={});for(const i of this.processors)e.reduced[i.property]=i.calculate(e,e.reduced[i.property]);const{diff:t}=e.reduced;t&&this.eventsHub?.emit("datamodel:diff",{diff:t})}initDataDomainProcessor(e){return this.domainManager.initDataDomainProcessor(e)}collectOptimizationMetadata(e,t){const i=e.optimizations?.domainBanding,s=e[xh];this.reducers.length>0&&s&&this.collectReducerBandingMetadata(e,s);const n=e.optimizations?.reducerBanding;e.optimizations={performance:{processingTime:e.time,pathTaken:t},...i&&{domainBanding:i},...n&&{reducerBanding:n}};const o=this.isReprocessingSupported(e),a=t==="reprocess";let r;if(!o){const l=[];if(e.type==="grouped"){e.groupsUnique||l.push("groupsUnique=false"),this.getUniqueDataSets(e).size!==1&&l.push("multiple data sources");const h=Ks(e.scopes);e.invalidKeys?.get(h)?.some(u=>u)&&l.push("has invalid keys")}this.aggregates.length>0&&l.push("has aggregates"),this.reducers.filter(c=>!c.supportsBanding).length>0&&l.push("has reducers"),this.processors.filter(c=>c.incrementalCalculate===void 0).length>0&&l.push("has processors"),this.propertyProcessors.length>0&&l.push("has property processors"),r=l.length>0?l.join(", "):void 0}if(e.optimizations.reprocessing={applied:a,reason:r},e.type==="grouped"){let l=0;const c=e.groups[0];if(c){const h=c.datumIndices;for(const d of e.groups)d.datumIndices===h&&l++}e.optimizations.sharedDatumIndices={applied:l>0,sharedGroupCount:l,totalGroupCount:e.groups.length}}}collectReducerBandingMetadata(e,t){if(this.reducers.length===0)return;e.optimizations??(e.optimizations={});const i=[];for(const s of this.reducers){const n=t.get(s.property),o=this.shouldUseReducerBanding(s,e)&&n!=null;let a;o||(s.supportsBanding!==!0?a="reducer does not support banding":e.type!=="ungrouped"?a="grouped data not supported":s.combineResults===void 0?a="missing combineResults function":a="banding not applied");let r;o&&n&&(r=n.getStats()),i.push({property:String(s.property),applied:o,reason:a,stats:r})}e.optimizations.reducerBanding={reducers:i}}buildAccessors(e){return this.scopeCacheManager.buildAccessors(e)}};function e$(e){const t=(i,s)=>{s.length>0&&(W.log(`DataModel.processData() - ${i}`),W.table(s))};if(W.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[]),e.optimizations){W.log("DataModel.processData() - Optimization Summary");const i=e.optimizations;if(i.performance&&W.log(` Performance: ${i.performance.processingTime.toFixed(2)}ms (${i.performance.pathTaken})`),i.reprocessing){const s=i.reprocessing.applied?"\u2713":"\u2717",n=i.reprocessing.reason?` (${i.reprocessing.reason})`:"";W.log(` Reprocessing: ${s}${n}`)}if(i.domainBanding){const s=i.domainBanding.keyDefs.filter(r=>r.applied),n=i.domainBanding.valueDefs.filter(r=>r.applied),o=s.length+n.length,a=i.domainBanding.keyDefs.length+i.domainBanding.valueDefs.length;if(o>0){W.log(` Domain Banding: \u2713 (${o}/${a} definitions)`);for(const r of[...s,...n])if(r.stats){const l=(r.stats.scanRatio*100).toFixed(1);W.log(` ${r.property}: scanned ${r.stats.dirtyBands}/${r.stats.totalBands} bands (${l}%)`)}}else{const r=[...i.domainBanding.keyDefs.filter(c=>!c.applied).map(c=>c.reason),...i.domainBanding.valueDefs.filter(c=>!c.applied).map(c=>c.reason)],l=[...new Set(r)].join(", ");W.log(` Domain Banding: \u2717 (${l})`)}}if(i.sharedDatumIndices){const s=i.sharedDatumIndices.applied?"\u2713":"\u2717",n=`${i.sharedDatumIndices.sharedGroupCount}/${i.sharedDatumIndices.totalGroupCount}`;W.log(` Shared DatumIndices: ${s} (${n} groups)`)}if(i.batchMerging){const s=(i.batchMerging.mergeRatio*100).toFixed(0),n=`${i.batchMerging.originalBatchCount} \u2192 ${i.batchMerging.mergedBatchCount}`;W.log(` Batch Merging: ${n} (${s}% reduction)`)}}}var m1=1e3;function y1(e,t,i){const s=e.filter(n=>typeof n=="number"&&Number.isFinite(n));return s.length>0?i(s):t}function Co(e){return e.input.count<=m1}function x1(e){return e!=null&&ch(e)}function t$(e){return e!=null}function i$(e){return!0}function b1(e,t){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return x1;default:return t?i$:t$}}function v1(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function ql(e,t,i={}){const s=i.allowNullKey??!1;return{property:e,type:"key",valueType:v1(t),validation:i.validation??b1(t,s),...i}}function Vt(e,t,i={}){const s=i.allowNullKey??!1;return{property:e,type:"value",valueType:v1(t),validation:i.validation??b1(t,s),...i}}function s$(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:function(){return function(){return 1}},...t}}var n$=function(e){return e};function S1(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>n$:t.length===1?t[0]:function(){const s=t.map(n=>n());return function(o,a){return s.reduce((r,l)=>l(r,a),o)}}}function o$(e,t={}){const{min:i=-1/0,max:s=1/0,processor:n,...o}=t;return{type:"value",property:e,valueType:"range",validation:x1,processor:S1(n,function(){return function(l){return je(l)?se(i,l,s):l}}),...o}}function oI(e,t,i={}){const{onlyPositive:s,processor:n,...o}=i;return{...Vt(e,t,o),processor:S1(n,w4(s))}}function a$(e,t,i={}){return{...Vt(e,t,i),processor:C4()}}function Sh(e,t,i,s){return[Vt(e,s,i),y$(i.groupId,t,i.separateNegative),...i.rangeId==null?[]:[k4(i.rangeId,i.groupId)]]}var M1={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer(){let e=Number.NaN;return function(i,s){const n=s[0],o=typeof n=="number"?n:Number(n);if(!Number.isFinite(o))return i;const a=e;if(e=o,!Number.isFinite(e))return i;const r=Math.abs(o-a),l=i??1/0;return r>0&&rMath.min(...t))},needsOverlap:!0},D1={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer(){let e=Number.NaN;return function(i,s){const n=s[0],o=typeof n=="number"?n:Number(n);if(!Number.isFinite(o))return i;const a=e;if(e=o,!Number.isFinite(e))return i;const r=Math.abs(o-a),l=i??-1/0;return r>0&&r>l?r:l}},supportsBanding:!0,combineResults(e){return y1(e,-1/0,t=>Math.max(...t))},needsOverlap:!0},r$={type:"processor",property:"sortedGroupDomain",calculate:function({domain:{groups:t}}){return t?.slice().sort((i,s)=>{for(let n=0;n{if(s===0)return 0;const n=(i??0)*e/s;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(i,s,n,o)=>{const a=c$(i,s,n,o);for(const r of s){const l=n.datumIndices[r];if(l!=null)for(const c of l){const h=o+c,d=i[r],u=d[h];if(u==null){d[h]=void 0;continue}d[h]=t(u,a)}}}}function c$(e,t,i,s){const n=[0,0];for(const o of t){const a=e[o],r=i.datumIndices[o];if(r!=null)for(const l of r){const c=s+l,h=a[c];if(h==null)continue;const d=typeof h=="number"?h:Math.max(...h.map(p=>p??0)),u=d<0?0:1;u===0?n[u]=Math.min(n[u],d):n[u]=Math.max(n[u],d)}}return Math.max(Math.abs(n[0]),n[1])}function ab(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:nh({normaliseTo:t},l$)}}function h$({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const n=e[1]-e[0],o=function(r,l,c){const h=e[0]+(r-l)/c*n;return c===0?t:h>=e[1]?e[1]:hh.scopes.includes(e)&&h.id===t),r=n.defs.values.findIndex(h=>h.scopes.includes(e)&&h.id===i),l=n.columns[a],c=n.columns[r];if(l.length!==c.length)return!0;for(let h=0;hMath.abs(l[h]))return!0;return!1}}function u$(e,t,i){return{type:"processor",property:"filteredValueExceedUnfiltered",calculate:nh([e,t,i],d$)}}var xf=1,rb=2;function p$(e,t,i){let s=xf|rb;if(e.valueType==="category")return t.lengtha)&&(s&=~rb),Number.isFinite(a)&&n===a&&(s&=~xf),n=a}return s}function g$(e){return function(i,s){if(!Co(i))return;const{keys:n,values:o}=i.defs,{input:a,domain:{values:r},columns:l}=i;let c=!0,h=!0;if(a.count!==0){const d=i[Xl];for(let u=0;(c||h)&&u0){let u=xf|rb;for(let p=0;u!==0&&pv.get(e)),h=s.keys.map(v=>v.get(e)),d=t.columns,u=s.columns,p=x$(e,t,s);if(p==null)return n;const f=Math.max(t.input.count,s.input.count),y=s.defs.keys.some(v=>v.allowNullKey===!0);for(let v=0;v0||r.size>0||l.size>0,added:new Set(a.keys()),updated:new Set(r.keys()),removed:new Set(l.keys()),moved:new Set(o.keys())};return{...n,[e]:b}}}}function us(...e){if(e.length===1){const t=nf(e[0]);if(t===null)return ZD;if(t===void 0)return XD;if(typeof t=="boolean"||typeof t=="number"||typeof t=="string")return t}return e.map(t=>{const i=nf(t);return i===null?ZD:i===void 0?XD:i}).join("___")}var k1=class{constructor(e){this.maxAnimationTime=e,this.debug=ve.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(uf.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(uf[this.currentPhase])??[]}checkOverlappingId(e){e!=null&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(uf.indexOf(e.phase)=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=uf[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:pf[c]}};let{phase:s,phaseControllers:n,phaseMeta:o}=i();const a=()=>uf[this.currentPhase]==null,r=()=>{for({phase:s,phaseControllers:n,phaseMeta:o}=i();!a()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:o}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=t,h=o.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let d=0;for(const u of n)h?u.stop():t=Math.min(u.update(c),t),u.isComplete&&(d++,this.removeAnimation(u));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${n.length} controllers; ${d} completed`,n),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),r()}while(t>0&&!a());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&pf[t.phase].skipIfNoEarlierAnimations!==!0){e=!1;break}if(!e)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(e=!0){if(this.skipAnimations===!1&&e===!0){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(t){W.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(e){if(e!=null&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){for(const e of this.stoppedCbs)e();this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,s]of this.phases)s.length!==0&&(e!=null&&e!==i||(t+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}};function A1(e){return e==null?!0:!Number.isNaN(e)&&e>=0&&e<=2}var b$=class{constructor(e,t,i){this.agDocument=e,this.interactionManager=t,this.chartUpdateMutex=i,this.defaultDuration=1e3,this.maxAnimatableItems=m1,this.batch=new k1(this.defaultDuration*1.5),this.debug=ve.create(!0,"animation"),this.events=new zn,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0,this.cumulativeAnimationTime=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(r){this.failsafeOnError(r);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()&&!e.forceAnimation||e.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:o}=e;if(!A1(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!A1(o))throw new Error(`Animation duration of ${o} is unsupported (${i})`);const a=new g4({...e,id:i,skip:s,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(a,this.defaultDuration))return this.batch.addAnimation(a),a}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}getCumulativeAnimationTime(){return this.cumulativeAnimationTime}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error("Stack trace for animation skip tracking").stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=this.agDocument.requestAnimationFrame(t=>{e(t).catch(i=>W.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(e??i);e=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(4);try{this.batch.progress(n),this.cumulativeAnimationTime+=n}catch(o){this.failsafeOnError(o)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))})};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){this.requestId!==null&&(this.agDocument.cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){W.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new k1(this.defaultDuration*1.5),e===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(4),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},v$=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},S$=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},M$=class{constructor(){this.items=new v$,this.lists=new S$}},w1=class{constructor(e){this.eventsHub=e,this.builtins=new M$,this.hiddenActions=new Set,this.toggle("zoom-to-cursor","hide"),this.toggle("pan-to-cursor","hide"),this.toggle("reset-zoom","hide")}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,s){const{widgetEvent:n}=t;if(n.sourceEvent.defaultPrevented)return;const o=s?.x??t.canvasX,a=s?.y??t.canvasY,r={showOn:e,x:o,y:a,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",r),this.eventsHub.emit("context-menu:complete",r)}isVisible(e){return!this.hiddenActions.has(e)}toggle(e,t){switch(t??(t=this.isVisible(e)?"hide":"show"),t){case"show":this.hiddenActions.delete(e);break;case"hide":this.hiddenActions.add(e);break}}},C1=class U_{constructor(t){this.eventsHub=t,this.highlightStates=new Xx,this.pendingUnhighlights=new Map,this.unhighlightDelay=100,this.highlightInViewport=!0}updateHighlight(t,i,s=!1,n){const o=this.getActiveHighlight();if(i==null&&s&&this.unhighlightDelay>0){if(!this.pendingUnhighlights.has(t)){const r=RD(()=>{this.applyPendingUnhighlight(t)});this.pendingUnhighlights.set(t,{scheduler:r}),r.schedule(this.unhighlightDelay)}return}const a=this.pendingUnhighlights.get(t);a&&(a.scheduler.cancel(),this.pendingUnhighlights.delete(t)),i?this.highlightStates.set(t,i):this.highlightStates.delete(t),this.maybeEmitChange(t,o,n)}maybeEmitChange(t,i,s){const n=s??!0,o=this.getActiveHighlight();if(!this.isEqual(o,i)||this.highlightInViewport!==n){const a=o?.series?.isHighlightEnabled()===!1;this.highlightInViewport=n,this.eventsHub.emit(U_.HIGHLIGHT_CHANGE_EVENT,{callerId:t,currentHighlight:o,previousHighlight:i,highlightSuppressed:a,highlightInViewport:n})}}applyPendingUnhighlight(t){if(!this.pendingUnhighlights.has(t))return;this.pendingUnhighlights.delete(t);const i=this.getActiveHighlight();this.highlightStates.delete(t),this.maybeEmitChange(t,i,!0)}getActiveHighlight(){return this.highlightStates.stateValue()}destroy(){for(const{scheduler:t}of this.pendingUnhighlights.values())t.cancel();this.pendingUnhighlights.clear()}isEqual(t,i){return t===i?!0:t!=null&&i!=null&&t.series===i.series&&this.idsMatch(t,i)&&this.pointsMatch(t,i)&&t.datum===i.datum}idsMatch(t,i){return t.itemId!=null&&i.itemId!=null&&t.itemId===i.itemId||t.datumIndex!=null&&i.datumIndex!=null&&Ht(t.datumIndex,i.datumIndex)}pointsMatch(t,i){return this.pointsAreEqual(t.point,i.point)&&this.pointsAreEqual(t.midPoint,i.midPoint)&&this.pointsAreEqual(t.xBar?.lowerPoint,i.xBar?.lowerPoint)&&this.pointsAreEqual(t.xBar?.upperPoint,i.xBar?.upperPoint)&&this.pointsAreEqual(t.yBar?.lowerPoint,i.yBar?.lowerPoint)&&this.pointsAreEqual(t.yBar?.upperPoint,i.yBar?.upperPoint)}pointsAreEqual(t,i){return t===i||t!==void 0&&i!==void 0&&t.x===i.x&&t.y===i.y}};C1.HIGHLIGHT_CHANGE_EVENT="highlight:change";var L1=C1,N1=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.Series=2]="Series",e[e.OtherSeries=3]="OtherSeries",e[e.OtherItem=4]="OtherItem",e))(N1||{}),lI=[0,1,2,3,4];function D$(e){switch(e){case 1:return["highlightedItem","highlightedSeries"];case 4:return["unhighlightedItem","highlightedSeries"];case 2:return["highlightedSeries"];case 3:return["unhighlightedSeries"];case 0:return[]}}function Fu(e){const t=i=>i;switch(e){case 1:return"highlighted-item";case 4:return"unhighlighted-item";case 2:return"highlighted-series";case 3:return"unhighlighted-series";case 0:return"none";default:return t(e)}}var Ql=class extends q{};g([m],Ql.prototype,"fill",2),g([m],Ql.prototype,"fillOpacity",2),g([m],Ql.prototype,"stroke",2),g([m],Ql.prototype,"strokeWidth",2),g([m],Ql.prototype,"strokeOpacity",2),g([m],Ql.prototype,"lineDash",2),g([m],Ql.prototype,"lineDashOffset",2);var jr=class extends q{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.bringToFront=!0,this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getStyle(e){const t=D$(e);return t.length===0?{}:ce(...t.map(i=>this[i]))}};g([m],jr.prototype,"enabled",2),g([m],jr.prototype,"range",2),g([m],jr.prototype,"bringToFront",2),g([m],jr.prototype,"highlightedItem",2),g([m],jr.prototype,"unhighlightedItem",2),g([m],jr.prototype,"highlightedSeries",2),g([m],jr.prototype,"unhighlightedSeries",2);var Ba=class extends q{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],Ba.prototype,"start",2),g([m],Ba.prototype,"stop",2),g([m],Ba.prototype,"fill",2),g([m],Ba.prototype,"fillOpacity",2),g([m],Ba.prototype,"stroke",2),g([m],Ba.prototype,"strokeWidth",2),g([m],Ba.prototype,"strokeOpacity",2),g([m],Ba.prototype,"lineDash",2),g([m],Ba.prototype,"lineDashOffset",2);var cb=class{constructor(){this.key="x",this.segments=new Bi(Ba)}};g([m],cb.prototype,"enabled",2),g([m],cb.prototype,"key",2),g([m],cb.prototype,"segments",2);var Jl=class extends q{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1,this.colorSpace="rgb"}};g([m],Jl.prototype,"type",2),g([m],Jl.prototype,"colorStops",2),g([m],Jl.prototype,"bounds",2),g([m],Jl.prototype,"gradient",2),g([m],Jl.prototype,"rotation",2),g([m],Jl.prototype,"reverse",2),g([m],Jl.prototype,"colorSpace",2);var Li=class extends q{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};g([m],Li.prototype,"type",2),g([m],Li.prototype,"colorStops",2),g([m],Li.prototype,"bounds",2),g([m],Li.prototype,"gradient",2),g([m],Li.prototype,"rotation",2),g([m],Li.prototype,"scale",2),g([m],Li.prototype,"reverse",2),g([m],Li.prototype,"path",2),g([m],Li.prototype,"pattern",2),g([m],Li.prototype,"width",2),g([m],Li.prototype,"height",2),g([m],Li.prototype,"padding",2),g([m],Li.prototype,"fill",2),g([m],Li.prototype,"fillOpacity",2),g([m],Li.prototype,"backgroundFill",2),g([m],Li.prototype,"backgroundFillOpacity",2),g([m],Li.prototype,"stroke",2),g([m],Li.prototype,"strokeOpacity",2),g([m],Li.prototype,"strokeWidth",2);var Wr=class extends q{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};g([m],Wr.prototype,"type",2),g([m],Wr.prototype,"url",2),g([m],Wr.prototype,"rotation",2),g([m],Wr.prototype,"scale",2),g([m],Wr.prototype,"backgroundFill",2),g([m],Wr.prototype,"backgroundFillOpacity",2),g([m],Wr.prototype,"repeat",2),g([m],Wr.prototype,"fit",2);var sa=class extends q{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new jr}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context")),"allowNullKeys"in t&&(this.allowNullKeys=t.allowNullKeys,e.delete("allowNullKeys"))}};g([m],sa.prototype,"id",2),g([m],sa.prototype,"visible",2),g([m],sa.prototype,"focusPriority",2),g([m],sa.prototype,"showInLegend",2),g([m],sa.prototype,"cursor",2),g([m],sa.prototype,"nodeClickRange",2),g([m],sa.prototype,"highlight",2);function T1(e,t){if(t.length===0)return[!1,!1];const i=t[0],s=t.at(-1);if(typeof i=="string"||i===null||i===void 0)return[e===i,e===s];if(e==null)return[!1,!1];const n=e.valueOf();if(i==null||s==null)return[!1,!1];let o=i.valueOf(),a=s.valueOf();return o>a&&([o,a]=[a,o]),[n===o,n===a]}function cI(e,t,i,s,n,o){const[a,r]=T1(t,o),[l,c]=T1(e,n);return{xKey:i,yKey:s,xValue:e,yValue:t,first:l,last:c,min:a,max:r}}function vf(e,t,[i,s],n){let o=ih(0,t-1,r=>{const l=e===1?r:t-r,c=n(l)?.[1]??Number.NaN;return!Number.isFinite(c)||c>=i})??0,a=ko(0,t-1,r=>{const l=e===1?r:t-r,c=n(l)?.[0]??Number.NaN;return!Number.isFinite(c)||c<=s})??t-1;return e===-1&&([o,a]=[t-a,t-o]),o=Math.max(o,0),a=Math.min(a+1,t),[o,a]}function hI(e,t,i){if(i){const{x:n,y:o,width:a,height:r}=i;return{canvasX:n+a/2,canvasY:o+r/2}}const s=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(s){const{x:n,y:o}=zt.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(o)}}}function I$(e,t,i,s,n){let o=-1,a=0,r=0,l=!1;for(;a=0&&(r+=1),l&&r<0&&(r-=1),ct){l=!0;continue}n(c)&&(a+=1)}return a}function dI(e){const t={};for(const i of lI)t[i]=e(void 0,!1,i);return t}function k$(e,...t){const i={};for(const s of t??["default"])for(const n of lI){const o=i[s]??(i[s]={});o[n]=e(void 0,!1,n,s)}return i}function uI(e){return(e?.opacity??1)<1||(e?.fillOpacity??1)<1||(e?.strokeOpacity??1)<1}var O1=new Map;function A$(e){if(e==null)return!1;const t=e.fill;if(!Pt(t))return!1;const i=t.trim(),s=i.toLowerCase();if(s==="transparent"||s==="none")return!1;let n=O1.get(i);if(n==null){try{n=Ne.fromString(i).a===1}catch{n=!1}O1.set(i,n)}return n}function w$(e,t){return e!=="cutout"?e:A$(t)?"cutout":"overlay"}function P1(e,t,i){for(const s of t??[])switch(typeof e){case"string":if(s.itemId===e)return s;if(s.itemId===void 0&&i!==void 0){const n=s.datum?.[i];if(n!=null&&String(n)===e)return s}break;case"number":if(s.datumIndex===e||s.itemId===void 0&&i!==void 0&&s.datum?.[i]===e)return s;break;default:return e}}var hb=class{constructor(e,t,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new Xx,this.suppressState=new Xx(!1),this.appliedState=null,this.pendingRemovals=new Map,this.removeDelay=100,this.cleanup=new ot,this.cleanup.register(s.setup(t,i),e.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){for(const{scheduler:e}of this.pendingRemovals.values())e.cancel();this.pendingRemovals.clear(),this.cleanup.flush()}updateTooltip(e,t,i,s){const n=this.pendingRemovals.get(e);n&&(n.scheduler.cancel(),this.pendingRemovals.delete(e)),i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:s}),this.applyStates()}removeTooltip(e,t,i=!1){if(i&&this.removeDelay>0){const n=this.pendingRemovals.get(e);if(n){t&&(n.lastMeta=t);return}const o=RD(()=>{this.applyPendingRemoval(e)});this.pendingRemovals.set(e,{scheduler:o,lastMeta:t}),o.schedule(this.removeDelay);return}const s=this.pendingRemovals.get(e);s&&(s.scheduler.cancel(),this.pendingRemovals.delete(e)),this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyPendingRemoval(e){this.pendingRemovals.has(e)&&(this.pendingRemovals.delete(e),this.stateTracker.delete(e),this.applyStates())}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||t?.meta==null||t?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(Ht(this.appliedState?.content,t?.content)&&Ht(this.appliedState?.pagination,t?.pagination)){const n=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,n)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,s){const{canvasX:n,canvasY:o}=e,a=t.properties.tooltip,{placement:r,anchorTo:l,xOffset:c,yOffset:h}=a.position,d=hI(t,i,s);return{canvasX:n,canvasY:o,nodeCanvasX:d?.canvasX??n,nodeCanvasY:d?.canvasY??o,enableInteraction:a.interaction?.enabled??!1,showArrow:a.showArrow,position:{placement:r,anchorTo:l,xOffset:c,yOffset:h}}}},E1=3,C$=505,R1=30;function pI(e,t){const{device:i,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}=t;return{type:e,device:i,offsetX:s,offsetY:n,clientX:o,clientY:a,currentX:r,currentY:l,sourceEvent:c}}function z1(e,t){const i=e*e+t*t,s=E1*E1;return i>=s}function L$(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY,n=i*i+s*s,o=R1*R1;return n=2){const i=t[0];this.domainNeedsValueOf=i!=null&&typeof i=="object",this.domainNeedsValueOf?(this.d0Cache=t[0].valueOf(),this.d1Cache=t[1].valueOf()):(this.d0Cache=t[0],this.d1Cache=t[1])}else this.d0Cache=Number.NaN,this.d1Cache=Number.NaN}normalizeDomains(...t){return B1(...t)}calcBandwidth(t=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let a=Math.abs(this.d1Cache-this.d0Cache)/t+1;if(i!==0){const r=Math.floor(n);a=Math.min(a,r)}return n/Math.max(1,a)}convert(t,i){const{domain:s}=this;if(!s||s.length<2||t==null)return Number.NaN;const{range:n}=this,o=i?.clamp??this.defaultClamp;let a=this.d0Cache,r=this.d1Cache,l=typeof t=="number"?t:t.valueOf();if(this.transform&&(a=this.transform(a),r=this.transform(r),l=this.transform(l)),o){const[h,d]=kt([a,r]);if(ld)return n[1]}if(a===r)return(n[0]+n[1])/2;if(l===a)return n[0];if(l===r)return n[1];const c=n[0];return c+(l-a)/(r-a)*(n[1]-c)}invert(t,i){const{domain:s}=this;if(s.length<2)return;let n=this.d0Cache,o=this.d1Cache;this.transform&&(n=this.transform(n),o=this.transform(o));const{range:a}=this,[r,l]=a;let c;return r===l?c=this.toDomain((n+o)/2):c=this.toDomain(n+(t-r)/(l-r)*(o-n)),this.transformInvert?this.transformInvert(c):c}getDomainMinMax(){return Gx(this.domain)}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};V1.defaultTickCount=5;var xt=V1;function B1(...e){let t,i=1/0,s,n=-1/0;for(const o of e){const a=o.domain;for(const r of a){const l=r.valueOf();ln&&(n=l,s=r)}}return t!=null&&s!=null?{domain:[t,s],animatable:!0}:{domain:[],animatable:!1}}var fI=class Y_ extends _x{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof Y_}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(t){t=se(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=se(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=se(0,t,1)}get paddingOuter(){return this._paddingOuter}getBandCountForUpdate(){return this.bands.length}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&W.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t,i?.alignment,i?.alignmentExclusive);return s==null||s<0||s>=this.getBandCountForUpdate()?Number.NaN:this.ordinalRange(s)}getDomainMinMax(){return Gx(this.domain)}invertNearestIndex(t){this.refresh();const i=this.getBandCountForUpdate();if(i===0)return-1;let s=0,n=i-1,o=1/0,a=0;for(;s<=n;){const r=Math.trunc((n+s)/2),l=this.ordinalRange(r),c=Math.abs(l-t);if(c===0)return r;c0,c=l?Math.floor(r):r;let h=t+(a-c*(o-s))/2,d=c*(1-s);l&&(h=Math.round(h),d=Math.round(d)),this._step=c,this._inset=h,this._bandwidth=d,this._rawBandwidth=r*(1-s)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,o=Math.min(n[0],n[1]),a=Math.max(n[0],n[1]);return se(o,i+s*t,a)}};g([Hx],fI.prototype,"range",2),g([Hx],fI.prototype,"round",2);var na=fI,O$=1e3,F1=20;function _1(e,t=0,i=e.length-1){const s=i-t+1;if(s<2)return{isUniform:!1};if(t<0||i>=e.length)return{isUniform:!1};const n=Array.from({length:F1},(l,c)=>t+Math.floor(c*(s-1)/(F1-1))),o=n.map(l=>e[l].valueOf()),a=(o.at(-1)-o[0])/(s-1);if(!Number.isFinite(a)||a===0)return{isUniform:!1};const r=Math.abs(a*.01);for(let l=1;lr)return{isUniform:!1}}return{isUniform:!0,interval:a}}var $r=class Z_ extends na{static is(t){return t instanceof Z_}toDomain(t){return new Date(t)}get reversed(){const{domain:t}=this;return t.length>0&&t[0].valueOf()>t.at(-1).valueOf()}get numericBands(){return this.bands.map(t=>t.valueOf())}convert(t,i){this.refresh(),t instanceof Date||(t=new Date(t));const{domain:s,reversed:n}=this,o=this.numericBands,a=o.length;if(s.length<=0)return Number.NaN;const r=this.ordinalRange(0),l=this.ordinalRange(a-1);if(a===0)return r;if(i?.clamp===!0){const{range:S}=this;if(t.valueOf()o.at(-1))return S[1]}if((i?.alignment??0)!==2){const S=super.convert(t,i);return n?l-(S-r):S}const h=t.valueOf();let d=this.findIndex(t)??0,u;n?(d=Math.min(Math.max(d,1),a-1),u=-1):(d=Math.min(Math.max(d,0),a-2),u=1);const p=o[d],f=o[d+u],y=this.ordinalRange(d),x=this.ordinalRange(d+u),v=(h-p)/(f-p)*(x-y)+y;return n?l-(v-r):v}invert(t,i=!1){this.refresh();const{domain:s}=this;if(s.length<=0)return;const n=this.bands,o=this.getBandCountForUpdate(),a=s[0].valueOf()>s.at(-1).valueOf();let r;return i?r=this.invertNearestIndex(t-this.bandwidth/2):r=ih(0,o-1,c=>this.ordinalRange(c)>=t)??o-1,n[a?o-1-r:r]}getUniformityCache(t){}findIndex(t,i=0,s=!1){if(t==null)return;const n=this.numericBands,o=n.length;if(o===0)return;if(o===1)return 0;const a=t.valueOf();return i===1!==s?ih(0,o-1,l=>n[l]>=a):ko(0,o-1,l=>n[l]<=a)}},H1=(e=>(e[e.None=0]="None",e[e.WhenViewportTooSmallScaleXYProportionally=1]="WhenViewportTooSmallScaleXYProportionally",e[e.WhenViewportTooSmallScaleXYDisproportionally=2]="WhenViewportTooSmallScaleXYDisproportionally",e))(H1||{});function ec(e,t,i,s,n){return t+(s-t)*((n-e)/(i-e))}function G1(e,t,i,s,n){return e+(n-t)*((i-e)/(s-t))}function j1(e,t,i){return[G1(e,i.min,t,i.max,0),G1(e,i.min,t,i.max,1)]}function P$(e,t,i){const[s,n]=j1(e.x1,e.x2,t),[o,a]=j1(e.y1,e.y2,i);return{x1:s,x2:n,y1:o,y2:a}}function W1(e,t){const i=t.width>e.width,s=t.height>e.height;return{x:i,y:s}}function $1(e,t,i,s,n,o){if(i<=n&&o<=s)return i;const a=n-i,r=o-s,l=Math.abs(a)Ve((t,{options:i})=>!xt.is(e?.scale)&&!$r.is(e?.scale)||t==null||i.end==null?!0:t1)&&(W.warnOnce(`Attempted to update axis (${t}) zoom to an invalid ratio of [{ min: ${s}, max: ${n} }], expecting a ratio of 0 to 1. Ignoring.`),delete e[t])}}function Y1(e,t){const i={};for(const{id:s,direction:n}of e){const{min:o,max:a}=t[s]??{min:0,max:1};i[s]={min:o,max:a,direction:n}}return i}function Z1(e,t){const i=Ko(e),s=Ko(t);if(i.length!==s.length)return!1;for(const n of i)if(!s.includes(n))return!1;for(const n of i){const o=e[n],a=t[n];if(o!==a&&(o==null||a==null||o.direction!==a.direction||o.min!==a.min||o.max!==a.max))return!1}return!0}function _$(e){return{source:"user-interaction",sourceDetail:e}}var X1=class extends zD{constructor(e,t,i){super(),this.eventsHub=e,this.fireChartEvent=i,this.mementoOriginatorKey="zoom",this.state={},this.axes=[],this.didLayoutAxes=!1,this.lastRestoredState={},this.restoreRequiredRangeIterations=0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.debug=ve.create(!0,"zoom"),this.panToBBoxScalingMode=2,this.pendingMemento=void 0,this.cleanup.register(e.on("zoom:change-request",s=>{this.constrainZoomToRequiredWidth(s)}),t.addListener("pre-series-update",({requiredRangeRatio:s,requiredRangeDirection:n,requiredRange:o})=>{this.didLayoutAxes=!0;const{pendingMemento:a}=this;a?this.restoreMemento(a.version,a.mementoVersion,a.memento):this.restoreRequiredRange(s,n,o),this.updateZoom({source:"chart-update",sourceDetail:"unspecified"})}),t.addListener("update-complete",({wasShortcut:s})=>{if(!s&&this.pendingZoomEventSource){const n=this.pendingZoomEventSource;this.fireChartEvent({type:"zoom",source:n,...this.getMementoRanges()}),this.pendingZoomEventSource=void 0}}))}toCoreZoomState(e){const t={};let i;const{state:s}=this;if(this.independentAxes){const n=this.getPrimaryAxisId("x"),o=this.getPrimaryAxisId("y");i=[],n&&i.push(n),o&&i.push(o)}else i=Ko(s);for(const n of i){const{direction:o}=s[n]??{};if(o!=null){const a=e[o];if(a){const{min:r,max:l}=a;t[n]={min:r,max:l,direction:o}}}}return t}toZoomState(e){let t,i;for(const s of Ko(e)){const{min:n,max:o,direction:a}=e[s];a==="x"?t??(t={min:n,max:o}):a==="y"&&(i??(i={min:n,max:o}))}if(t||i)return{x:t,y:i}}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!me(e))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:U1(i),end:le},rangeY:{start:U1(s),end:le},ratioX:{start:le,end:le},ratioY:{start:le,end:le},autoScaledAxes:le},{invalid:o}=ki(e,n);return o.length>0?(t.push(...o.map(String)),!1):!0}restoreMemento(e,t,i){if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.pendingMemento=void 0;const s=Lt(this.getZoom());i?.rangeX?s.x=this.rangeToRatioDirection("x",i.rangeX)??{min:0,max:1}:i?.ratioX?s.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:s.x={min:0,max:1};const{navigatorModule:n,zoomModule:o}=this;this.eventsHub.emit("zoom:load-memento",{zoom:s,memento:i,navigatorModule:n,zoomModule:o});const a=this.toCoreZoomState(s);this.lastRestoredState=Us(Pe(a)),this.updateChanges({source:"state-change",sourceDetail:"internal-restoreMemento",changes:a,isReset:!1})}findAxis(e){for(const t of this.axes)if(t.id===e)return t}getAxes(){return this.axes}setAxes(e){const{axes:t}=this;t.length=0;for(const n of e)"range"in n&&t.push(n);const i=this.state,s=Y1(e,i);this.state=s,this.lastRestoredState=Y1(e,this.lastRestoredState),this.updateChanges({source:"chart-update",sourceDetail:"internal-setAxes",changes:s,isReset:!1})}setIndependentAxes(e=!0){this.independentAxes=e}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom({source:e,sourceDetail:t},i){const s=this.toCoreZoomState(i??{});return this.updateChanges({source:e,sourceDetail:t,changes:s,isReset:!1})}computeChangedAxesIds(e){const t=[],i=this.state;for(const s of Ko(e)){const n=e[s]??{min:0,max:1},o=i[s];(o==null||o.min!==n.min||o.max!==n.max)&&t.push(s)}return t}updateChanges(e){const{source:t,sourceDetail:i,isReset:s,changes:n}=e;F$(n);const o=this.computeChangedAxesIds(n),a=Pe(this.state),r=Pe(this.state);for(const l of o){const c=r[l];c!=null&&(c.min=n[l]?.min??0,c.max=n[l]?.max??1)}return this.state=r,this.dispatch(t,i,o,s,a)}resetZoom({source:e,sourceDetail:t}){this.updateChanges({source:e,sourceDetail:t,changes:this.getRestoredZoom(),isReset:!0})}resetAxisZoom({source:e,sourceDetail:t},i){this.updateChanges({source:e,sourceDetail:t,changes:{[i]:this.getRestoredZoom()[i]},isReset:!0})}panToBBox(e,t){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const i=this.getZoom();if(i===void 0||!i.x&&!i.y)return!1;const{panToBBoxScalingMode:s}=this;if(!(e.width>0&&e.height>0&&(s!==0||Math.abs(t.width)<=Math.abs(e.width)&&Math.abs(t.height)<=Math.abs(e.height))))return W.warnOnce("cannot pan to target BBox - chart too small?"),!1;const o=R$(s,e,i,t),a=this.toCoreZoomState(o);return this.updateChanges({source:"user-interaction",sourceDetail:"internal-panToBBox",changes:a,isReset:!1})}fireZoomPanStartEvent(e){this.eventsHub.emit("zoom:pan-start",{callerId:e})}updateWith({source:e,sourceDetail:t},i,s){const n=this.getPrimaryAxis(i);if(!n)return;const o=n.scale.getDomainMinMax();if(!o)return;const[a,r]=n.visibleRange,l=this.getRange(n.id,{min:a,max:r});if(!l)return;const[c,h]=o,{start:d,end:u}=l,p=s(c,h,d,u,e);if(!this.isValidUpdateWithResult(p)){this.resetZoom({source:e,sourceDetail:t});return}const[f,y]=p,x=this.rangeToRatioAxis(n,{start:f,end:y});x&&this.updateChanges({source:e,sourceDetail:t,changes:{[i]:x},isReset:!1})}isValidUpdateWith(e,t,i){const s=this.getPrimaryAxis(e);if(!s)return!0;const n=s.scale.getDomainMinMax();if(!n)return!0;const[o,a]=s.visibleRange,r=this.getRange(s.id,{min:o,max:a});if(!r)return!0;const[l,c]=n,{start:h,end:d}=r,u=t(l,c,h,d,i);if(!this.isValidUpdateWithResult(u))return!0;const[p,f]=u;let y=!0;return p!=null&&y&&(y=p>=l),f!=null&&y&&(y=f<=c),p!=null&&f!=null&&y&&(y=p<=f),y}getZoom(){return this.toZoomState(this.state)}getAxisZoom(e){return this.state[e]??{min:0,max:1}}getAxisZooms(){return this.state}getCoreZoom(){return this.state}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}getBoundSeries(){const e=this.getPrimaryAxis("x"),t=this.getPrimaryAxis("y");let i;if(this.independentAxes){const s=new Set(e?.boundSeries??[]),n=new Set(t?.boundSeries??[]);i=new Set;for(const o of s)n.has(o)&&i.add(o)}else i=new Set([...e?.boundSeries??[],...t?.boundSeries??[]]);return i}constrainZoomToItemCount(e,t,i){let s=[e.x.min,e.x.max],n=i?void 0:[e.y.min,e.y.max];for(const r of this.getBoundSeries()){const l=r.getZoomRangeFittingItems(s,n,t);l!=null&&(s=l.x,n=l.y)}const o={min:s[0],max:s[1]},a=n?{min:n[0],max:n[1]}:void 0;return Lt({x:o,y:a})}isVisibleItemsCountAtLeast(e,t,i){const s=this.getBoundSeries(),n=[e.x.min,e.x.max],o=!i.includeYVisibleRange&&i.autoScaleYAxis?void 0:[e.y.min,e.y.max];let a=0;for(const r of s){const l=t-(a??0),c=r.getVisibleItems(n,o,l);if(a+=c,a>=t)return!0}return s.size===0}getMementoRanges(){const e=Lt(this.getZoom()),t={rangeX:this.getRangeDirection("x",e.x),rangeY:this.getRangeDirection("y",e.y),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:void 0};return this.eventsHub.emit("zoom:save-memento",{memento:t}),t}restoreRequiredRange(e,t,i){const{lastRestoredRequiredRange:s,lastRestoredRequiredRangeDirection:n}=this;this.lastRequiredRange!==i&&(this.lastRequiredRange=i,this.restoreRequiredRangeIterations=0),this.restoreRequiredRangeIterations+=1;const o=t!=="x"&&t!=="y",a=n===t&&s===e,r=e===0&&(s==null||s===0);if(o||a||r||this.restoreRequiredRangeIterations>1){this.restoreRequiredRangeIterations=0;return}const l=this.getPrimaryAxisId(t);if(!l)return;const c=this.getAxisZoom(l),h=Math.min(1,1/e);let d=0,u=1;t==="x"?(d=se(0,1-h,c.min),u=se(0,d+h,1)):(u=Math.min(1,c.max),d=u-h,d<0&&(u-=d,d=0),d=se(0,d,1),u=se(0,u,1)),this.lastRestoredRequiredRange=e,this.lastRestoredRequiredRangeDirection=t;const p={[t]:{min:d,max:u}},f=this.toCoreZoomState(p);this.lastRestoredState=Us(Pe(f)),this.updateChanges({source:"state-change",sourceDetail:"internal-requiredWidth",changes:f,isReset:!1})}constrainZoomToRequiredWidth(e){if(this.lastRestoredRequiredRange==null||this.lastRestoredRequiredRangeDirection==null)return;const t=this.lastRestoredRequiredRangeDirection,i=this.getPrimaryAxisId(this.lastRestoredRequiredRangeDirection);if(!i)return;const s=e.stateAsDefinedZoom(),n=e.oldState[i],o=s[t].max-s[t].min,a=1/this.lastRestoredRequiredRange;Math.abs(o-a)<1e-12||o<=a||e.constrainZoom({...s,[t]:{min:n.min,max:n.min+a}})}dispatch(e,t,i,s,n){const{x:o,y:a}=this.getZoom()??{},r=this.state;let l;const c=this.debug,h=this,d={source:e,sourceDetail:t,isReset:s,changedAxes:i,state:r,oldState:n,x:o,y:a,stateAsDefinedZoom(){return Lt(h.toZoomState(d.state))},constrainZoom(p){this.constrainChanges(h.toCoreZoomState(p))},constrainChanges(p){c.check()&&c("ZoomManager.constrainChanges()",r,"->",p,new Error().stack),l??(l=Pe(r));for(const f of Ko(p)){const y=p[f],x=l[f];y&&x&&(x.min=y.min,x.max=y.max)}d.state=l}};this.eventsHub.emit("zoom:change-request",d),l&&!Z1(r,l)&&(this.state=l);const u=!Z1(n,this.state);if(u){const p=this.getZoom()??{};this.eventsHub.emit("zoom:change-complete",{source:e,sourceDetail:t,x:p.x}),this.pendingZoomEventSource=e}return u}getRange(e,t){return this.getRangeAxis(this.findAxis(e),t)}getRangeDirection(e,t){return this.getRangeAxis(this.getPrimaryAxis(e),t)}getRangeAxis(e,t){if(!e)return;const i=this.getDomainPixelExtents(e);if(!i)return;const[s,n]=i;let o,a;return s<=n?(o=e.scale.invert(0,!0),a=e.scale.invert(s+(n-s)*t.max,!0)):(o=e.scale.invert(s-(s-n)*t.min,!0),a=e.scale.invert(0,!0)),{start:o,end:a}}rangeToRatio(e,t){return this.rangeToRatioAxis(this.findAxis(e),t)}rangeToRatioDirection(e,t){return this.rangeToRatioAxis(this.getPrimaryAxis(e),t)}rangeToRatioAxis(e,t){if(!e)return;const i=this.getDomainPixelExtents(e);if(!i)return;const[s,n]=i,{scale:o}=e,{start:a,end:r}=t,[l=0,c=1]=K1(a,r);let h=a==null?s:o.convert(a,{alignment:l,alignmentExclusive:!0}),d=r==null?n:o.convert(r,{alignment:c,alignmentExclusive:!0})+(o.bandwidth??0);if(!je(h)||!je(d))return;const[u,p]=[Math.min(s,n),Math.max(s,n)];h=se(u,h,p),d=se(u,d,p);const f=n-s;if(f===0)return;const y=Math.abs((h-s)/f),x=Math.abs((d-s)/f);if(!(y>=x))return{min:y,max:x}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainPixelExtents(e){const[t,i]=e.scale.range;if(!(!je(t)||!je(i)))return[t,i]}isValidUpdateWithResult(e){return e==null||!Array.isArray(e)||e.length<1?!1:e.every(t=>t==null||typeof t=="number"||Sa(t))}},mI=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Scrollbar=4]="Scrollbar",e[e.Navigator=5]="Navigator",e[e.Overlay=6]="Overlay",e))(mI||{}),H$=class{constructor(e){this.eventsHub=e,this.elements=new Map}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i={width:e,height:t,layoutBox:new re(0,0,e,t),scrollbars:{}};for(const s of Object.values(mI)){if(typeof s!="number")continue;const n=this.elements.get(s);if(n)for(const o of n)o(i)}return i}emitLayoutComplete({width:e,height:t},i){this.eventsHub.emit("layout:complete",{axes:i.axes??{},chart:{width:e,height:t},clipSeries:i.clipSeries??!1,series:i.series,layoutBox:i.layoutBox})}},G$=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=re.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},n=new Set(e.map(a=>a.id));for(const a of this.labelData.keys())n.has(a)||this.labelData.delete(a);for(const a of e){const r=a.getLabelData();r.every(dD)&&this.labelData.set(a.id,r)}const o=uD(this.labelData,s,5);for(const a of e)a.updatePlacedLabelData?.(o.get(a.id)??[])}},j$=class{constructor(e){this.eventsHub=e,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return e==null||Ae(e)}restoreMemento(e,t,i){if(i)for(const s of i){const{seriesId:n,data:o}=this.getRestoredData(s)??{};!n||!o||this.updateData(n,o)}this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:s,visible:n}=e;if(t){const a=(this.legendDataMap.get(t)??[]).map(r=>{const l=r.seriesId===t&&(!i||r.itemId===i);return l&&r.isFixed&&this.warnFixed(r.seriesId,r.itemId),!r.isFixed&&l?{...r,enabled:n}:r});return{seriesId:t,data:a}}if(!(i==null&&s==null))for(const o of this.getData()){if(i!=null&&o.itemId!==i||s!=null&&o.legendItemName!==s)continue;if(o.isFixed){this.warnFixed(o.seriesId,i);return}const a=(this.legendDataMap.get(o.seriesId)??[]).map(r=>r.itemId===i||r.legendItemName===s?{...r,enabled:n}:r);return{seriesId:o.seriesId,data:a}}}warnFixed(e,t){W.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.eventsHub.emit("legend:change",{legendData:e??this.getData()})}updateData(e,t=[]){this.eventsHub.emit("legend:change-partial",{seriesId:e,legendData:t}),this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,s){if(s){for(const r of this.getData()){const l=(this.legendDataMap.get(r.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:e}:c);this.updateData(r.seriesId,l)}return}const n=this.getData(t),o=n.length===1,a=n.map(r=>i==null&&o||r.itemId===i?{...r,enabled:e}:r);this.updateData(t,a)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,s])=>t.concat(s),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(i=>i.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(i=>i.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},W$=class{updateCallback(e){this.resolvePartialCallback=e}resolvePartial(e,t,i){return this.resolvePartialCallback?.(e,t,i)}},$$=class extends na{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this._hasFixedWidth=!1,this._paddingInnerWidth=0,this._domain=[],this._bandRanges=new Map}set domain(e){this._domain!==e&&(e.length===0&&(this._bandRanges.clear(),this._hasFixedWidth=!1),this.invalid=!0,this._domain=e)}get domain(){return this._domain}get bands(){return this.domain}get paddingInnerWidth(){return this._hasFixedWidth?this._paddingInnerWidth:this.paddingInner*this._bandwidth}addBand(e,t,i){this._domain.push(this.getDomainValue(e,t)),this._bandRanges.has(e)||this._bandRanges.set(e,new Map),this._bandRanges.get(e).set(t,i),this._hasFixedWidth||(this._hasFixedWidth=i!=null),this.invalid=!0}getDomainValue(e,t){return`${e}-${t}`}findIndex(e){let t=0;for(const i of this._bandRanges.keys()){if(i===e)return t;t++}}convert(e){const{_bandwidth:t,_bandRanges:i,_inset:s,_paddingInnerWidth:n}=this;let o=s;const a=e.split("-"),r=Number(a[0]);if(!this._hasFixedWidth)return super.convert(r);for(let l=0;l0&&h>=0?h/o:r/s,p=u;a===s&&h>0&&(d+=h/2),this.round&&Math.floor(p)>0&&(d=Math.round(d),p=Math.round(p)),h<0&&(u=0,p=0),this._inset=d,this._bandwidth=p,this._rawBandwidth=u,this._paddingInnerWidth=l}normalizeDomains(...e){return{domain:[],animatable:!1}}toDomain(e){}},K$=class{constructor(){this.groups=new Map,this.groupScales=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,width:s,type:n}){if(!t)return;let o=this.groups.get(n);o==null&&(o=new Map,this.groups.set(n,o)),o.set(e,{grouping:t,visible:i,width:s})}updateSeries({internalId:e,seriesGrouping:t,visible:i,width:s,type:n}){if(!t)return;const o=this.groups.get(n)?.get(e);o&&(o.grouping=t,o.width=s,o.visible=i)}deregisterSeries({internalId:e,type:t}){const i=this.groups.get(t);i!=null&&(i.delete(e),i.size===0&&this.groups.delete(t))}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set,o=this.groups.get(e);for(const r of o?.values()??[])r.visible&&(s.add(r.grouping.groupIndex),r.grouping.groupIndex===t.groupIndex&&n.add(r.grouping.stackIndex));const a=Array.from(s);return a.sort((r,l)=>r-l),{visibleGroupCount:a.length,visibleSameStackCount:n.size,index:a.indexOf(t.groupIndex)}}updateGroupScale({type:e},t,i){const s=this.groupScales.get(e)??new $$;this.groupScales.set(e,s),s.domain=[];const n=this.groups.get(e);for(const o of n?.values()??[])o.visible&&s.addBand(o.grouping.groupIndex,o.grouping.stackIndex,o.width);s.domain.length===0&&s.addBand(0,0,void 0),s.range=[0,t],i.type==="grouped-category"?s.paddingInner=i.groupPaddingInner:i.type==="category"||i.type==="unit-time"?(s.paddingInner=i.groupPaddingInner,s.round=s.padding!==0):s.padding=0,s.update()}getGroupScale({type:e}){return this.groupScales.get(e)}getGroupBandWidth(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const s=this.groups.get(e.type);if(!s)return i.bandwidth;let n=0;for(const o of s.values())o.visible&&o.grouping.groupIndex===t.groupIndex&&(n=Math.max(n,o.width??i.bandwidth));return n||i.bandwidth}getGroupOffset(e){const{seriesGrouping:t}=e;if(!t)return 0;const i=this.getGroupScale(e);if(!i)return 0;const s=i.getDomainValue(t.groupIndex,t.stackIndex);return i.convert(s)}getStackOffset(e,t){const{seriesGrouping:i}=e;if(!i)return 0;const s=this.groups.get(e.type);if(!s)return 0;const n=this.getGroupScale(e);if(!n||(i.stackCount??0)<1)return 0;let a=0;for(const r of s.values())r.visible&&r.grouping.groupIndex===i.groupIndex&&(a=Math.max(a,r.width??n.bandwidth));return a===0?0:a/2-t/2}getDatumOffset(e,t,i,s){const n=this.groups.get(e.type);if(!e.visible||!e.seriesGrouping||!n||t.get(e.internalId)?.[s]||i.get(e.internalId)?.[s])return 0;const o=new Set;for(const[u,p]of n)p.visible&&!t.get(u)?.[s]&&!i.get(u)?.[s]&&o.add(p.grouping.groupIndex);if(o.size===e.seriesGrouping?.groupCount)return 0;const a=this.groupScales.get(e.type),r=new Map,l=new Map;for(const[u,p]of n)u!==e.internalId&&p.visible&&(o.has(p.grouping.groupIndex)||(e.seriesGrouping.groupIndexp.grouping.groupIndex&&r.set(p.grouping.groupIndex,Math.max(p.width??a?.bandwidth??0,r.get(p.grouping.groupIndex)??0))));let c=0;for(const[,u]of l)c+=u;for(const[,u]of r)c-=u;c/=2;const h=(a?.paddingInnerWidth??0)/2,d=(l.size-r.size)*h;return c+d}},U$=class{constructor(){this.events=new zn}addListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}dispatchUpdateComplete(e,t){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e,wasShortcut:t})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSeriesUpdate(e,t,i){this.events.emit("pre-series-update",{type:"pre-series-update",requiredRangeRatio:e,requiredRangeDirection:t,requiredRange:i})}dispatchPreSceneRender(e){this.events.emit("pre-scene-render",{type:"pre-scene-render",apiUpdate:e})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},Y$=class{constructor(e,t){this.eventsHub=new zn,this.callbackCache=new xM,this.highlightManager=new L1(this.eventsHub),this.formatManager=new Bu,this.layoutManager=new H$(this.eventsHub),this.localeManager=new $W(this.eventsHub),this.seriesStateManager=new K$,this.stateManager=new mW,this.seriesLabelLayoutManager=new G$,this.cleanup=new ot;const{scene:i,root:s,syncManager:n,agDocument:o,container:a,fireEvent:r,updateMutex:l,styleContainer:c,skipCss:h,chartType:d,domMode:u,withDragInterpretation:p}=t;this.chartService=e,this.syncManager=n,this.agDocument=o,this.domManager=new UT(this.eventsHub,this.chartService,this.agDocument,a,c,h,u),this.widgets=new T$(this.domManager,{withDragInterpretation:p});const f=this.agDocument.window,y=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new ib({canvasElement:y,pixelRatio:f.devicePixelRatio??1}),this.scene.setRoot(s),this.axisManager=new XW(this.eventsHub,s),this.legendManager=new j$(this.eventsHub),this.annotationManager=new ZW(this.eventsHub,e.annotationRoot,r),this.chartTypeOriginator=new gW(e),this.interactionManager=new i1,this.contextMenuRegistry=new w1(this.eventsHub),this.optionsGraphService=new W$,this.updateService=new U$,this.activeManager=new d4(this.chartService,this.eventsHub,this.updateService,this.interactionManager,r),this.proxyInteractionService=new GW(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new qW(this.domManager,this.eventsHub),this.historyManager=new fW(this.eventsHub),this.animationManager=new b$(this.agDocument,this.interactionManager,l),this.dataService=new $D(this.eventsHub,e,this.animationManager),this.tooltipManager=new hb(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new X1(this.eventsHub,this.updateService,r);for(const x of ye.listModulesByType("plugin"))(!x.chartType||x.chartType===d)&&x.patchContext?.(this)}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.cleanup.flush()}},ub=class extends q{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.drawingMode="cutout"}};g([m],ub.prototype,"enabled",2),g([m],ub.prototype,"range",2),g([m],ub.prototype,"drawingMode",2);function Z$(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function X$(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const n=t.get(i);if(n==null||!Z$(s,n))return!1}return!0}function q$(e,t){if(e.length!==t.length)return!1;for(let i=0;it.type==="key").map(t=>t.property).join(";")}var yI=class Ho{constructor(t,i,s){this.mode=t,this.suppressFieldDotNotation=i,this.eventsHub=s,this.debug=ve.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,o)=>{this.requested.push({id:t,opts:s,dataSet:i,resolve:n,reject:o})})}execute(t){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed";const i=new Map;for(const r of this.requested)r.dataSet.hasPendingTransactions()&&i.set(r.dataSet,r.dataSet.getChangeDescription()),r.dataSet.commitPendingTransactions();this.debug("DataController.execute() - requested",this.requested);const s=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",s);const n=this.mergeRequested(s);this.debug("DataController.execute() - merged",n),this.debug.check()&&(Go().processedData=[]);const o=[];for(const{dataSet:r,ids:l,opts:c,resolves:h,rejects:d}of n){let u=function(S){return J$(S,r,l,c)};var a=u;const p=t?.find(u),f=(S,M)=>{if(this.debug.check()&&Go("processedData").push(M),M==null){for(const D of d)D(new Error("AG Charts - no processed data generated"));return}o.push({opts:c,dataSet:r,dataLength:r.data.length,ids:l,dataModel:S,processedData:M});for(const D of h)D({dataModel:S,processedData:M})},y=()=>{try{const S=new nI(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(s.map(I=>[I.id,I.dataSet])),D=S.processData(M);return f(S,D),S}catch(S){for(const M of d)M(S)}};if(p==null){y();continue}const{dataModel:x,processedData:b}=p,v=i.get(r);if(b&&v&&x.isReprocessingSupported(b)){if(this.debug("DataController.execute() - reprocessing data",b,r),x.reprocessData(b,i),ve.check("data-model:reprocess-diff")){const S=new nI(c,this.mode,this.suppressFieldDotNotation,this.eventsHub),M=new Map(s.map(w=>[w.id,w.dataSet])),D=S.processData(M),I=JSON.parse(JSON.stringify(b,Ho.jsonReplacer)),k=JSON.parse(JSON.stringify(D,Ho.jsonReplacer));delete I.time,delete I.optimizations,delete k.time,delete k.optimizations;const A=Kn(k,I);A?(W.log("\u26A0\uFE0F DATA-MODEL REPROCESS DIFF DETECTED \u26A0\uFE0F"),W.log("Difference between incremental update and full reprocess:"),W.log(""),W.log("BASELINE (full reprocess):"),W.log(JSON.stringify(k,null,2)),W.log(""),W.log("REPROCESSED (incremental update):"),W.log(JSON.stringify(I,null,2)),W.log(""),W.log("DIFF (what changed):"),W.log(JSON.stringify(A,null,2))):W.log("\u2705 Data-model reprocess matches baseline (no diff)")}f(x,b);continue}y()}return o}validateRequests(t){const i=[];for(const[s,n]of t.entries())s>0&&n.dataSet.data.length!==t[0].dataSet.data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(t){const i=[];for(const s of t){const n=i.find(Ho.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Ho.mergeRequests)}static groupMatch({dataSet:t,opts:i}){const{groupByData:s,groupByKeys:n=!1,groupByFn:o,props:a}=i,r=q1(a);return([l])=>(s===!1||l.dataSet===t)&&(l.opts.groupByKeys??!1)===n&&l.opts.groupByFn===o&&q1(l.opts.props)===r}static mergeRequests(t){const i={ids:[],rejects:[],resolves:[],dataSet:t[0].dataSet,opts:{...t[0].opts,props:[]}},s=new Map,n=new Map;let o=0;for(const a of t){const{id:r,dataSet:l,resolve:c,reject:h,opts:{props:d,...u}}=a;i.ids.push(r),i.rejects.push(h),i.resolves.push(c),i.dataSet??(i.dataSet=l),i.opts??(i.opts={...u,props:[]});for(const p of d){const f={...p,scopes:[r],data:l.data};Ho.createIdsMap(r,f);let y;Ho.crossScopeMergableTypes.has(f.type)?y=-1:n.has(l.data)?y=n.get(l.data):(y=o++,n.set(l.data,y));const x=`${f.type}-${y}-${f.groupId}`,b=s.get(x),v=b?.find(S=>Ho.deepEqual(S,f));if(b==null){i.opts.props.push(f),s.set(x,[f]);continue}else if(v==null){i.opts.props.push(f),b.push(f);continue}f.scopes!=null&&(v.scopes??(v.scopes=[]),v.scopes.push(...f.scopes)),(v.type==="key"||v.type==="value")&&f.idsMap?.size&&(v.idsMap??(v.idsMap=new Map),Ho.mergeIdsMap(f.idsMap,v.idsMap))}}return i}static mergeIdsMap(t,i){for(const[s,n]of t){const o=i.get(s);if(o==null)i.set(s,new Set(n));else for(const a of n)o.add(a)}}static createIdsMap(t,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(t)?i.idsMap.get(t).add(i.id):i.idsMap.set(t,new Set([i.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(t)){if(n=t.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Ho.deepEqual(t[s],i[s]))return!1;return!0}const o=Object.keys(t);if(n=o.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const a=o[s];if(!Ho.skipKeys.has(a)&&(!Object.hasOwn(i,a)||!Ho.deepEqual(t[a],i[a])))return!1}return!0}return!1}static jsonReplacer(t,i){return i instanceof Map?{__type:"Map",value:Array.from(i.entries())}:i instanceof Set?{__type:"Set",value:Array.from(i)}:i}};yI.crossScopeMergableTypes=new Set(["key","group-value-processor"]),yI.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Q1=yI,Sf=class XS{constructor(t,i){this.data=t,this.dataIdKey=i,this.pendingTransactions=[]}static empty(t){return new XS([],t)}static wrap(t,i){return new XS(t,i)}netSize(){if(!this.hasPendingTransactions())return this.data.length;const t=this.getChangeDescription();return t?t.indexMap.finalLength:this.data.length}addTransaction(t){const i=this.normalizeTransaction(t);this.pendingTransactions.push(i),this.cachedChangeDescription=void 0}deepClone(){return new XS([...this.data],this.dataIdKey)}normalizeTransaction(t){const{add:i,addIndex:s,prepend:n,append:o,remove:a,update:r}=t;if(i===void 0)return t;const l={remove:a,update:r};if(n&&(l.prepend=n),o&&(l.append=o),i&&i.length>0){const c=this.netSize();s===void 0||s>=c?l.append=o?[...o,...i]:i:s===0?l.prepend=n?[...i,...n]:i:l.insertions=[{index:s,items:i}]}return l}hasPendingTransactions(){return this.pendingTransactions.length>0}getPendingTransactionCount(){return this.pendingTransactions.length}commitPendingTransactions(){if(this.dataIdKey!=null&&this.data.length>0&&this.getIdToIndexMap(),!this.hasPendingTransactions())return!1;const t=this.getChangeDescription();if(!t)return!1;const i=t.getPrependedValues(),s=t.getInsertionValues(),n=t.getAppendedValues(),o=[...i,...s,...n];let a=0;if(t.applyToArray(this.data,function(l){if(a>=o.length)throw new Error(`AG Charts - Internal error: No insertion value found for index ${l}`);return o[a++]}),this.cachedPendingReplacements&&this.cachedPendingReplacements.size>0){const{updatedIndices:r}=t.indexMap;for(const l of r){const c=this.getIdValue(this.data[l]);c!==void 0&&this.cachedPendingReplacements.has(c)&&(this.data[l]=this.cachedPendingReplacements.get(c))}}return this.pendingTransactions=[],this.cachedChangeDescription=void 0,this.cachedPendingReplacements=void 0,this.updateItemToIndexCache(t,n,i,s),this.updateIdToIndexCache(t,n,i,s),!0}updateItemToIndexCache(t,i,s,n){if(!this.itemToIndexCache)return;if(this.dataIdKey){this.itemToIndexCache=void 0;return}const{indexMap:o}=t,{totalPrependCount:a,totalAppendCount:r,removedIndices:l}=o,c=l.size>0,h=n.length>0;if(!c&&a===0&&r===0&&!h)return;if(h){this.itemToIndexCache=void 0;return}const d=sI(l);if(c&&d===0){this.itemToIndexCache=void 0;return}const u=this.itemToIndexCache,p=a-d;if(p!==0)for(const[y,x]of u)l.has(x)?u.delete(y):u.set(y,x+p);else if(c)for(const[y,x]of u)l.has(x)&&u.delete(y);for(let y=0;y0,h=n.length>0;if(!c&&a===0&&r===0&&!h)return;if(h){this.idToIndexCache=void 0;return}const d=sI(l);if(c&&d===0){this.idToIndexCache=void 0;return}const u=this.idToIndexCache,p=a-d;if(p!==0)for(const[y,x]of u)l.has(x)?u.delete(y):u.set(y,x+p);else if(c)for(const[y,x]of u)l.has(x)&&u.delete(y);for(let y=s.length-1;y>=0;y--){const x=this.getIdValue(s[y]);x!==void 0&&u.set(x,y)}const f=o.finalLength-r;for(let y=0;y0;)i.has(s[n])?(i.delete(s[n]),s.splice(n,1)):n++;if(i.size===0)break}}buildIndexMap(){const t=this.data.length,i=this.collectTransactionEffects(),s=i.prependsList.flat(),n=i.appendsList.flat(),o=i.insertionsList.flat(),a=s.length,r=n.length,l=o.length,c=t-i.removedOriginalIndices.size,h=a+c+l+r,d=i.removedOriginalIndices.size>0?this.getSortedRemovedIndices(i.removedOriginalIndices):void 0,u=this.buildSpliceOperations(a,l,r,c,i.trackedInsertions,d?.desc,d?.asc),p=this.resolveUpdatedIndices(a,l,c,i.updateTracking,d?.asc,i.updatedOriginalIndices,i.trackedInsertions);return{indexMap:{originalLength:t,finalLength:h,spliceOps:u,removedIndices:i.removedOriginalIndices,updatedIndices:p,totalPrependCount:a,totalAppendCount:r},prependValues:s,appendValues:n,insertionValues:o,pendingReplacements:i.pendingReplacements}}getSortedRemovedIndices(t){const i=Array.from(t).sort((s,n)=>s-n);return{asc:i,desc:[...i].reverse()}}collectTransactionEffects(){const t={prependsList:[],appendsList:[],insertionsList:[],trackedInsertions:[],removedOriginalIndices:new Set,updatedOriginalIndices:new Set,virtualLength:this.data.length};for(const i of this.pendingTransactions){const{prepend:s,append:n,insertions:o,remove:a,update:r}=i;this.applyPrepends(s,t),this.applyInsertions(o,t),this.applyAppends(n,t),this.applyRemovals(a,t),this.applyUpdates(r,t)}return{prependsList:t.prependsList,appendsList:t.appendsList,insertionsList:t.insertionsList,trackedInsertions:t.trackedInsertions,removedOriginalIndices:t.removedOriginalIndices,updatedOriginalIndices:t.updatedOriginalIndices,updateTracking:t.updateTracking,pendingReplacements:t.pendingReplacements}}applyPrepends(t,i){!Array.isArray(t)||t.length===0||(i.prependsList.unshift([...t]),i.virtualLength+=t.length)}applyInsertions(t,i){if(Array.isArray(t))for(const{index:s,items:n}of t)s>=0&&s<=i.virtualLength&&n.length>0&&(i.trackedInsertions.push({virtualIndex:s,items:[...n]}),i.insertionsList.push([...n]),i.virtualLength+=n.length)}applyAppends(t,i){!Array.isArray(t)||t.length===0||(i.appendsList.push([...t]),i.virtualLength+=t.length)}applyRemovals(t,i){!Array.isArray(t)||t.length===0||(this.dataIdKey?this.applyRemovalsById(t,i):this.applyRemovalsByRef(t,i))}applyRemovalsByRef(t,i){const s=new Set(t);if(this.removeFromGroups(i.prependsList,s),s.size>0&&this.removeFromGroups(i.insertionsList,s),i.trackedInsertions.length>0&&this.removeFromTrackedInsertions(t,i),s.size>0&&this.removeFromGroups(i.appendsList,s),s.size>0)for(let n=0;n0;n++){const o=this.data[n];s.has(o)&&(i.removedOriginalIndices.add(n),s.delete(o),i.virtualLength--)}s.size>0&&W.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}applyRemovalsById(t,i){const s=new Set;for(const n of t){const o=this.getIdValue(n);o===void 0?W.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):s.add(o)}if(s.size!==0){if(this.removeFromGroupsById(i.prependsList,s),s.size>0&&this.removeFromGroupsById(i.insertionsList,s),i.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(t,i),s.size>0&&this.removeFromGroupsById(i.appendsList,s),s.size>0){const n=this.getIdToIndexMap();for(const o of s){const a=n.get(o);a!==void 0&&(i.removedOriginalIndices.add(a),i.virtualLength--,s.delete(o))}}s.size>0&&W.warnOnce("applyTransaction() remove includes items not present in current data; ignoring missing items.")}}applyUpdates(t,i){!Array.isArray(t)||t.length===0||(this.dataIdKey?this.applyUpdatesById(t,i):this.applyUpdatesByRef(t,i))}applyUpdatesByRef(t,i){const s=new Set(t),n=this.collectUpdatedIndicesFromGroups(i.prependsList,s),o=s.size>0?this.collectUpdatedIndicesFromGroups(i.insertionsList,s):[],a=s.size>0?this.collectUpdatedIndicesFromGroups(i.appendsList,s):[];s.size>0&&this.collectUpdatedOriginalIndices(s,i),i.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:a,updatedInsertionsIndices:o},s.size>0&&W.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}applyUpdatesById(t,i){const s=new Map;for(const r of t){const l=this.getIdValue(r);l===void 0?W.warnOnce(`applyTransaction() update item is missing '${this.dataIdKey}' field; ignoring.`):s.set(l,r)}if(s.size===0)return;const n=this.collectUpdatedIndicesFromGroupsById(i.prependsList,s),o=s.size>0?this.collectUpdatedIndicesFromGroupsById(i.insertionsList,s):[],a=s.size>0?this.collectUpdatedIndicesFromGroupsById(i.appendsList,s):[];s.size>0&&this.collectUpdatedOriginalIndicesById(s,i),i.updateTracking={updatedPrependsIndices:n,updatedAppendsIndices:a,updatedInsertionsIndices:o},s.size>0&&W.warnOnce("applyTransaction() update includes items not present in current data; ignoring missing items.")}collectUpdatedIndicesFromGroups(t,i){if(i.size===0||t.length===0)return[];const s=[];let n=0;for(const o of t){for(const a of o)i.has(a)&&(s.push(n),i.delete(a)),n++;if(i.size===0)break}return s}getItemToIndexMap(){if(this.itemToIndexCache===void 0){this.itemToIndexCache=new Map;for(let t=0;t0&&W.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}removeFromGroupsById(t,i){for(const s of t){let n=0;for(;n0;){const o=this.getIdValue(s[n]);o!==void 0&&i.has(o)?(i.delete(o),s.splice(n,1)):n++}if(i.size===0)break}}collectUpdatedIndicesFromGroupsById(t,i){if(i.size===0||t.length===0)return[];const s=[];let n=0;for(const o of t){for(let a=0;a0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,s,n,o,a)}}removeFromTrackedInsertionsById(t,i){const s=new Set;for(const n of t){const o=this.getIdValue(n);o!==void 0&&s.add(o)}if(s.size!==0)for(let n=0;n0&&this.adjustLaterInsertionsAfterRemoval(i.trackedInsertions,n,o,a,r),s.size===0)break}}adjustLaterInsertionsAfterRemoval(t,i,s,n,o){const a=o.length;for(let r=i+1;r0&&(l.virtualIndex-=h)}}buildSpliceOperations(t,i,s,n,o,a,r){const l=[];if(t>0&&l.push({index:0,deleteCount:0,insertCount:t}),a&&a.length>0){let c=a[0],h=1;for(let d=1;d0)for(const c of o){const h=this.countRemovalsBeforeIndex(r,t,c.virtualIndex),d=c.virtualIndex-h;l.push({index:d,deleteCount:0,insertCount:c.items.length})}return s>0&&l.push({index:t+n+i,deleteCount:0,insertCount:s}),l}countRemovalsBeforeIndex(t,i,s){if(!t||t.length===0)return 0;let n=0;for(const o of t)if(o+i0){const c=Array.from(a).sort((d,u)=>d-u);let h=0;for(const d of c){if(o)for(;h0&&r.length>0){let h=0;for(const d of r){const u=this.countRemovalsBeforeIndex(o,t,d.virtualIndex),p=d.virtualIndex-u;for(let f=0;fi!==this.chart)}getGroupSyncMode(t=Il.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return Il.chartsGroups.get(t)}};xI.chartsGroups=new Map,xI.DEFAULT_GROUP=Symbol("sync-group-default");var eK=xI,pb=class extends q{constructor(){super(...arguments),this.enabled=!1,this.initialFocus="data-start"}};g([m],pb.prototype,"enabled",2),g([m],pb.prototype,"tabIndex",2),g([m],pb.prototype,"initialFocus",2);var J1={};$s(J1,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>oa,fromToMotion:()=>mi,staticFromToMotion:()=>Kr});var oa={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function mi(e,t,i,s,n,o,a){const{fromFn:r,toFn:l,applyFn:c=(f,y)=>f.setProperties(y)}=n,{nodes:h,selections:d}=UD(s),u=(f,y)=>{let x,b=0,v=0;for(const S of y){const M=f[b]===S,D={last:v>=y.length-1,lastLive:b>=f.length-1,prev:y[v-1],prevFromProps:x,prevLive:f[b-1],next:y[v+1],nextLive:f[b+(M?1:0)]},I=`${e}_${t}_${S.id}`;i.stopByAnimationId(I);let k="unknown";M?o&&a&&(k=tK(S,S.datum,o,a)):k="removed",S.transitionOut=k==="removed";const{phase:A,start:w,finish:C,delay:T,duration:O,...V}=r(S,S.datum,k,D),{phase:z,start:R,finish:B,delay:G,duration:F,..._}=l(S,S.datum,k,D),Y=C==null;i.animate({id:I,groupId:e,phase:A??z??"update",duration:O??F,delay:T??G,from:V,to:_,ease:Ea,collapsable:Y,onPlay:()=>{const Z={...w,...R,...V};c(S,Z,"start")},onUpdate(Z){c(S,Z,"update")},onStop:()=>{const Z={...w,...R,...V,..._,...C,...B};c(S,Z,"end")}}),M&&b++,v++,x=V}};let p=0;for(const f of d){const y=f.nodes(),x=y.filter(b=>!f.isGarbage(b));u(x,y),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:Ea,onStop(){f.cleanup()}}),p++}u(h,h)}function Kr(e,t,i,s,n,o,a){const{nodes:r,selections:l}=UD(s),{start:c,finish:h,phase:d}=a;i.animate({id:`${e}_${t}`,groupId:e,phase:d??"update",from:n,to:o,ease:Ea,onPlay:()=>{if(c){for(const u of r)u.setProperties(c);for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const y of p)y.setProperties(c)})}}},onUpdate(u){for(const p of r)p.setProperties(u);for(const p of l){const f=p.nodes();p.batchedUpdate(function(){for(const x of f)x.setProperties(u)})}},onStop:()=>{for(const u of r)u.setProperties({...o,...h});for(const u of l){const p=u.nodes();u.batchedUpdate(function(){for(const y of p)y.setProperties({...o,...h});u.cleanup()})}}})}function tK(e,t,i,s){const n=i(e,t);return s.added.has(n)?"added":s.removed.has(n)?"removed":e.previousDatum==null&&e.datum!=null?"added":e.previousDatum!=null&&e.datum==null?"removed":"updated"}var eO={};$s(eO,{resetMotion:()=>qi});function qi(e,t){const{nodes:i,selections:s}=UD(e);for(const n of s){const o=n.nodes();n.batchedUpdate(function(){for(const r of o){const l=t(r,r.datum);r.setProperties(l)}n.cleanup()})}for(const n of i){const o=t(n,n.datum);n.setProperties(o)}}var yi=class Sd{constructor(t,i,s=!0){this.parentNode=t,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=ve.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Gr,i)?()=>new i:i}static select(t,i,s=!0){return new Sd(t,i,s)}static selectAll(t,i){const s=[],n=o=>{if(i(o)&&s.push(o),o instanceof Le)for(const a of o.children())n(a)};return n(t),s}static selectByClass(t,...i){return Sd.selectAll(t,s=>i.some(n=>s instanceof n))}static selectByTag(t,i){return Sd.selectAll(t,s=>s.tag===i)}createNode(t,i,s){const n=this.nodeFactory(t);return n.datum=t,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(t,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),s&&this._nodesMap.size===0&&this._nodes.length>0)for(const n of this._nodes)this.garbageBin.add(n);if(!s&&this._nodesMap.size>0&&this._nodesMap.clear(),s){const n=new Map,o=new Map;for(let a=0;a=t.length?this.garbageBin.add(this._nodes[o]):o>=this._nodes.length?this.createNode(t[o],i):(this._nodes[o].datum=t[o],this.garbageBin.delete(this._nodes[o]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){if(this.garbageBin.size===0)return this;const t=this;function i(s){return t.garbageBin.has(s)?(t._nodesMap.delete(s),t.garbageBin.delete(s),s.destroy(),!1):!0}return this._nodes=this._nodes.filter(i),this}clear(){this.update([]);for(const t of this._nodesMap.keys())this.garbageBin.add(t);return this._nodesMap.clear(),this}isGarbage(t){return this.garbageBin.has(t)}each(t){const i=this._nodes;return this.parentNode.batchedUpdate(function(){for(const n of i.entries())t(n[1],n[1].datum,n[0])}),this}*[Symbol.iterator](){for(let t=0;toD(o,s)&&!Number.isNaN(t.convert(o,{clamp:!0}));if(e.type==="range"){const[o,a]=i;return n(o)&&n(a)}else return n(i)}var iK={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},sK={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},nK={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},oK={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},Dh=class extends qn{constructor(){super(...arguments),this.padding=5}};g([m],Dh.prototype,"enabled",2),g([m],Dh.prototype,"padding",2),g([m],Dh.prototype,"text",2),g([m],Dh.prototype,"position",2),g([m],Dh.prototype,"rotation",2),g([m],Dh.prototype,"parallel",2);var Es=class extends q{constructor(){super(),this.id=gi(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Dh,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.position="top",this.rangeGroup=new Le({name:this.id}),this.lineGroup=new Le({name:this.id}),this.labelGroup=new Le({name:this.id}),this.crossLineRange=this.lineGroup.appendChild(new Fa),this.crossLineLabel=this.labelGroup.appendChild(new Pu),this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(e){const{enabled:t,type:i,data:s,scale:n}=this;if(!n||!t||!e||!iO(this,n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateNodes();const o=i==="range";o!==this._isRange&&(o?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=o}calculateLayout(e){if(this.data=void 0,!e)return;const{type:t,range:i,value:s,scale:n,clippedRange:o,strokeWidth:a=0}=this;if(!n)return;const r=n.bandwidth??0,l=n.step??0,c=n instanceof na?(l-r)/2:0;let[h,d]=kt(o);h-=r,d+=r;let u,p,f,y;if(t==="line"){const x=r/2;if(u=n.convert(s)+x,p=Number.NaN,f=n.convert(s,{clamp:!0})+x,y=Number.NaN,f>=d||f<=h)return}else if(i){const[x,b]=i,[v,S]=K1(x,b);if(u=n.convert(x,{alignment:v}),p=n.convert(b,{alignment:S}),f=n.convert(x,{clamp:!0,alignment:v}),y=n.convert(b,{clamp:!0,alignment:S}),f>y&&([f,y]=[y,f],[u,p]=[p,u]),f>=d||y<=h)return;Number.isFinite(u)&&(f-=c),Number.isFinite(p)&&(p+=r,y+=r+c)}else return;f=Jc(f,o),y=Jc(y,o),u-c>=f&&(u-=c),p+c<=y&&(p+=c),this.startLine=a>0&&u>=f&&u<=f+c,this.endLine=a>0&&p>=y-r-c&&p<=y,this.data=[f,y],this.label.enabled===!1||this.label.text}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:s,gridPadding:n}=this,o=Number.isFinite(i)?i-t:0,a=e==="bottom"||e==="right"?-1:1,r=Math.min(a*n,a*(s+n));let l;switch(e){case"top":case"bottom":l=new re(t,r,o,s);break;case"left":case"right":l=new re(r,t,s,o)}this.updateRangeNode(l);const{label:c}=this;c.enabled!==!1&&c.text&&(this.updateLabel(),this.positionLabel(l))}updateRangeNode(e){const{type:t,position:i,crossLineRange:s,startLine:n,endLine:o,fill:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d}=this;s.x1=e.x,s.x2=e.x+e.width,s.y1=e.y,s.y2=e.y+e.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=o,s.fill=t==="range"?a:void 0,s.fillOpacity=r??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=d}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fill=t.color,e.text=t.text,e.textAlign="center",e.textBaseline="middle",e.setFont(t),e.setBoxing(t))}get anchor(){const e=this.position==="left"||this.position==="right",t=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return t?(e?nK:oK)[i]:(e?iK:sK)[i]}positionLabel(e){const{crossLineLabel:t,label:{padding:i,rotation:s},anchor:n}=this;t.rotation=lt(s??0);const o=t.getBBox();if(!o)return;const{width:a,height:r}=o,l=typeof i=="number"?0:(i.right??0)-(i.left??0),c=typeof i=="number"?0:(i.bottom??0)-(i.top??0);let h=a/2,d=r/2;typeof i=="number"&&!t.hasBoxing()&&(h+=i,d+=i);const u=e.x+e.width*(n.rangeH+1)/2-h*n.labelH-l/2,p=e.y+e.height*(n.rangeV+1)/2-d*n.labelV-c/2;t.x=u,t.y=p,t.rotationCenterX=u,t.rotationCenterY=p}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new Pu;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=lt(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(e){const{label:{padding:t},anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:o}=s,a=typeof t=="number"?t*2:(t.left??0)+(t.right??0),r=typeof t=="number"?t*2:(t.top??0)+(t.bottom??0),l=a+n,c=r+o,h=this.position==="left"||this.position==="right";h&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,l):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,l))),h||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,c):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,c)))}};Es.className="CrossLine",g([m],Es.prototype,"enabled",2),g([m],Es.prototype,"type",2),g([m],Es.prototype,"range",2),g([m],Es.prototype,"value",2),g([m],Es.prototype,"defaultColorRange",2),g([m],Es.prototype,"fill",2),g([m],Es.prototype,"fillOpacity",2),g([m],Es.prototype,"stroke",2),g([m],Es.prototype,"strokeWidth",2),g([m],Es.prototype,"strokeOpacity",2),g([m],Es.prototype,"lineDash",2),g([m],Es.prototype,"label",2);var gb=class{constructor(){this.enabled=!0,this.width=1,this.style=[{fill:void 0,fillOpacity:1,stroke:void 0,strokeWidth:void 0,lineDash:[]}]}};g([m],gb.prototype,"enabled",2),g([m],gb.prototype,"width",2),g([m],gb.prototype,"style",2);var Ih=class extends q{};g([m],Ih.prototype,"placement",2),g([m],Ih.prototype,"step",2),g([m],Ih.prototype,"values",2),g([m],Ih.prototype,"minSpacing",2),g([m],Ih.prototype,"maxSpacing",2);var Nt=class extends q{constructor(){super(...arguments),this.enabled=!0,this.border=new Mh,this.wrapping="never",this.truncate=!1,this.spacing=5,this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(e,t,i,s){const{formatter:n,format:o}=this,{type:a,value:r,domain:l,boundSeries:c}=t,h=t.type==="number"?t.fractionDigits:void 0,d=t.type==="date"?t.unit:void 0;let u;if(n!=null){const p=t.type==="date"?t.step:void 0,f=t.type==="number"?t.visibleDomain:void 0;u=e(n,{value:r,index:i,domain:l,fractionDigits:h,unit:d,step:p,boundSeries:c,visibleDomain:f})}if(o!=null&&u==null){const{specifier:p,dateStyle:f="long",truncateDate:y}=s??{},x=`${f}:${y??"none"}`;let b=this._formatters[x];const v=Bu.mergeSpecifiers(p,o);(b?.type!==a||b?.unit!==d||!Ht(b?.mergedFormat,v))&&(b={type:a,mergedFormat:v,unit:d,formatter:Bu.getFormatter(a,v,d,f,{truncateDate:y})},this._formatters[x]=b),u=b.formatter?.(r,h)}return u==null||Ae(u)?u:String(u)}};g([m],Nt.prototype,"enabled",2),g([m],Nt.prototype,"border",2),g([m],Nt.prototype,"cornerRadius",2),g([m],Nt.prototype,"fill",2),g([m],Nt.prototype,"fillOpacity",2),g([m],Nt.prototype,"fontStyle",2),g([m],Nt.prototype,"fontWeight",2),g([m],Nt.prototype,"fontSize",2),g([m],Nt.prototype,"fontFamily",2),g([m],Nt.prototype,"wrapping",2),g([m],Nt.prototype,"truncate",2),g([m],Nt.prototype,"spacing",2),g([m],Nt.prototype,"minSpacing",2),g([m],Nt.prototype,"color",2),g([m],Nt.prototype,"rotation",2),g([m],Nt.prototype,"avoidCollisions",2),g([m],Nt.prototype,"mirrored",2),g([m],Nt.prototype,"padding",2),g([m],Nt.prototype,"parallel",2),g([m],Nt.prototype,"itemStyler",2),g([m],Nt.prototype,"formatter",2),g([m],Nt.prototype,"format",2);var fb=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};g([m],fb.prototype,"enabled",2),g([m],fb.prototype,"width",2),g([m],fb.prototype,"stroke",2);var kh=class extends q{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};g([m],kh.prototype,"enabled",2),g([m],kh.prototype,"width",2),g([m],kh.prototype,"size",2),g([m],kh.prototype,"stroke",2);var Sn=class extends q{constructor(){super(...arguments),this.caption=new Wt,this.enabled=!1,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.truncate=!0}};g([m],Sn.prototype,"enabled",2),g([m],Sn.prototype,"text",2),g([m],Sn.prototype,"spacing",2),g([m],Sn.prototype,"fontStyle",2),g([m],Sn.prototype,"fontWeight",2),g([m],Sn.prototype,"fontSize",2),g([m],Sn.prototype,"fontFamily",2),g([m],Sn.prototype,"color",2),g([m],Sn.prototype,"maxWidth",2),g([m],Sn.prototype,"maxHeight",2),g([m],Sn.prototype,"wrapping",2),g([m],Sn.prototype,"truncate",2),g([m],Sn.prototype,"formatter",2);var sO=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))(sO||{});function aK(e){const[t,i]=kt(e.range),s=Math.floor(t),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var vI=Math.PI*2,rK=vI/2;function lK(e,t){return Math.abs(t-e)t?t+vI:t-vI}function cK(e){const{min:t,max:i}=e,s=l=>li;return{tick:{fromFn(l,c,h){let{x1:d,x2:u,y1:p,y2:f}=l,y=l.opacity;return(h==="added"||s(c.offset))&&({x1:d,x2:u,y1:p,y2:f}=c,y=0),{x1:d,x2:u,y1:p,y2:f,opacity:y,phase:oa[h]}},toFn(l,c,h){const{x1:d,x2:u,y1:p,y2:f}=c;let y=1;return h==="removed"&&(y=0),{x1:d,x2:u,y1:p,y2:f,opacity:y}},applyFn(l,c){l.setProperties(c),l.visible=!s(l.y)}},line:{fromFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=l.previousDatum??c;return{x1:h,x2:d,y1:u,y2:p,phase:oa.updated}},toFn(l,c){const{x1:h,x2:d,y1:u,y2:p}=c;return{x1:h,x2:d,y1:u,y2:p}}},label:{fromFn(l,c,h){const d=l.previousDatum??c;let{x:u,y:p,rotationCenterX:f,rotationCenterY:y,rotation:x}=d,b=l.opacity;return h==="removed"||s(d.y)?x=c.rotation:(h==="added"||s(l.datum.y))&&({x:u,y:p,rotationCenterX:f,rotationCenterY:y,rotation:x}=c,b=0),{x:u,y:p,rotationCenterX:f,rotationCenterY:y,rotation:x,opacity:b,phase:oa[h]}},toFn(l,c,h){const{x:d,y:u,rotationCenterX:p,rotationCenterY:f}=c;let y=0,x=1;return h==="added"?y=c.rotation:h==="removed"?(x=0,y=c.rotation):y=lK(l.previousDatum?.rotation??c.rotation,c.rotation),{x:d,y:u,rotationCenterX:p,rotationCenterY:f,rotation:y,opacity:x,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:d}=l;return{translationX:h,translationY:d,phase:oa.updated}},toFn(l,c){const{translationX:h,translationY:d}=c;return{translationX:h,translationY:d}}}}}function hK(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function mb(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function nO(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:o}=t;return{x1:i,x2:s,y1:n,y2:o}}}function dK(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:o}=t;return{x:i,y:n,width:s-i,height:o-n}}}var oO=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(oO||{});function aO(e,t){return e.domain===t.domain&&e.rangeExtent===t.rangeExtent&&e.nice[0]===t.nice[0]&&e.nice[1]===t.nice[1]&&e.gridLength===t.gridLength&&e.visibleRange[0]===t.visibleRange[0]&&e.visibleRange[1]===t.visibleRange[1]&&e.scrollbarKey===t.scrollbarKey&&e.initialPrimaryTickCount?.unzoomed===t.initialPrimaryTickCount?.unzoomed&&e.initialPrimaryTickCount?.zoomed===t.initialPrimaryTickCount?.zoomed}function rO(e,t,i){const s=e.bandwidth??0,o=((e.step??0)-s)/2,a=e.convert(i),r=a-o,l=a+s+o;return[a,Jc(r,t),Jc(l,t)]}var tc=class X_{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id="unknown",this._crossLines=[],this.nice=!0,this.reverse=!1,this.interval=new Ih,this.dataDomain={domain:[],clipped:!1},this.allowNull=!1,this.title=new Sn,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"justify",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new Le({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new Tu({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new Tu({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new Le({name:`${this.id}-Labels`,zIndex:11}),this.gridGroup=new ds({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridFillGroup=this.gridGroup.appendChild(new Le({name:`${this.id}-gridFills`})),this.gridLineGroup=this.gridGroup.appendChild(new Le({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new Tu({name:`${this.id}-CrossLines-Range`,zIndex:6}),this.crossLineLineGroup=new Tu({name:`${this.id}-CrossLines-Line`,zIndex:10}),this.crossLineLabelGroup=new Tu({name:`${this.id}-CrossLines-Label`,zIndex:15}),this.tickLabelGroupSelection=yi.select(this.tickLabelGroup,Pu,!1),this.line=new fb,this.tick=new kh,this.gridLine=new gb,this.label=this.createLabel(),this.defaultTickMinSpacing=X_.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format},labelThickness:0},this.axisContext=void 0,this.cleanup=new ot,this.isHovering=!1,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.tickLayout=void 0,this.formatterBoundSeries=new kM(()=>{const{direction:s,boundSeries:n}=this;return Us(n.flatMap(o=>o.getFormatterContext(s)))}),this.moduleMap=new bI,this.range=this.scale.range.slice();for(const s of this.crossLines)this.initCrossLine(s);this.cleanup.register(this.moduleCtx.widgets.containerWidget.addListener("mousemove",s=>this.onMouseMove(s)),this.moduleCtx.widgets.containerWidget.addListener("mouseleave",()=>this.endHovering()))}set crossLines(t){const{CrossLineConstructor:i}=this.constructor;for(const s of this._crossLines)this.detachCrossLine(s);this._crossLines=t.map(s=>{const n=new i;return n.set(s),n});for(const s of this._crossLines)this.attachCrossLine(s),this.initCrossLine(s)}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}isCategoryLike(){return!1}resetAnimation(t){}onMouseMove(t){const s=this.tickLabelGroup.pickNode(t.currentX,t.currentY)?.datum,{textUntruncated:n=void 0}=s??{};n?(this.moduleCtx.tooltipManager.updateTooltip(this.id,{canvasX:t.currentX,canvasY:t.currentY,showArrow:!1},[{type:"structured",title:n}]),this.isHovering=!0):this.endHovering()}endHovering(){this.isHovering&&(this.moduleCtx.tooltipManager.removeTooltip(this.id,void 0,!0),this.isHovering=!1)}attachCrossLine(t){this.crossLineRangeGroup.appendChild(t.rangeGroup),this.crossLineLineGroup.appendChild(t.lineGroup),this.crossLineLabelGroup.appendChild(t.labelGroup)}detachCrossLine(t){t.rangeGroup.remove(),t.lineGroup.remove(),t.labelGroup.remove()}destroy(){this.moduleMap.destroy(),this.cleanup.flush()}setScaleRange(t){const{range:i,scale:s}=this,n=(i[1]-i[0])/(t[1]-t[0]),o=n*t[0],a=i[0]-o;s.range=[a,a+n]}updateScale(){const{range:[t,i]}=this;this.setScaleRange(this.visibleRange);for(const s of this.crossLines)s.clippedRange=[t,i]}setCrossLinesVisible(t){this.crossLineRangeGroup.visible=t,this.crossLineLineGroup.visible=t,this.crossLineLabelGroup.visible=t}attachAxis(t){t.gridNode.appendChild(this.gridGroup),t.axisNode.appendChild(this.axisGroup),t.labelNode.appendChild(this.labelGroup),t.crossLineRangeNode.appendChild(this.crossLineRangeGroup),t.crossLineLineNode.appendChild(this.crossLineLineGroup),t.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(){this.gridGroup.remove(),this.axisGroup.remove(),this.labelGroup.remove(),this.crossLineRangeGroup.remove(),this.crossLineLineGroup.remove(),this.crossLineLabelGroup.remove()}attachLabel(t){this.labelGroup.append(t)}inRange(t,i=0){const[s,n]=kt(this.range);return t>=s-i&&t<=n+i}getRangeOverflow(t){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[o,a]=kt([i[0]-n*s[0],i[0]-n*s[0]+n]);return ta?t-a:0}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange();for(const s of this.crossLines)this.initCrossLine(s)}onGridVisibilityChange(){}createLabel(){return new Nt}update(){this.formatterBoundSeries.clear(),this.updatePosition(),this.updateSelections(),this.gridLineGroup.visible=this.gridLine.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(t,i,s=this.label){const n={border:s.border,color:s.color,cornerRadius:s.cornerRadius,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,padding:s.padding,spacing:s.spacing};let o;s.itemStyler&&(o=this.cachedCallWithContext(s.itemStyler,{...t,...n}));const a=ce(o,i,n);return{border:a.border,color:a.color,cornerRadius:a.cornerRadius,fill:a.fill,fillOpacity:a.fillOpacity,fontFamily:a.fontFamily,fontSize:a.fontSize,fontStyle:a.fontStyle,fontWeight:a.fontWeight,padding:a.padding,spacing:a.spacing}}getTickSize(t=this.tick){return t.enabled?t.size:0}getTickSpacing(t=this.tick){if(!t.enabled)return 0;const i=this.chartLayout?.scrollbars?.[this.id];return!i?.enabled||i.placement!=="inner"?0:i.tickSpacing??0}processData(){this.invalidateLayoutCache();const{includeInvisibleDomains:t,boundSeries:i,direction:s}=this,o=(t?i:i.filter(a=>a.isEnabled())).map(a=>a.getDomain(s));this.setDomains(...o)}getDomainExtentsNice(){return[this.nice,this.nice]}setDomains(...t){let i,s;if(t.length>0){const n=this.scale.normalizeDomains(...t);i={domain:n.domain,sortMetadata:{sortOrder:1}},s=n.animatable}else i={domain:[]},s=!0;this.dataDomain=this.normaliseDataDomain(i),this.allowNull=this.dataDomain.domain.some(function(n){return n==null}),this.reverse&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()}),this.animatable=s}calculateDomain(t,i="none"){const{dataDomain:{domain:s},range:n,scale:o,gridLength:a}=this,r=Aa(n),l=[0,1],c=this.getDomainExtentsNice();this.updateScale();const{unzoomedTickLayoutCache:h}=this;let d;if(h==null||!aO(h,{domain:s,rangeExtent:r,nice:c,gridLength:a,visibleRange:l,initialPrimaryTickCount:t,scrollbarKey:i})){const u=o.range;this.setScaleRange([0,1]);const p=c.map(f=>f?0:2);d=this.calculateTickLayout(s,p,[0,1],t),o.range=u,this.unzoomedTickLayoutCache={domain:s,rangeExtent:r,nice:c,gridLength:a,visibleRange:l,initialPrimaryTickCount:t,scrollbarKey:i,tickLayout:d}}else d=h.tickLayout;return this.updateScale(),o.domain=d.niceDomain,{unzoomedTickLayout:d,domain:o.domain}}calculateLayout(t,i){this.chartLayout=i;const s=this.getScrollbarLayoutCacheKey(i),{visibleRange:n}=this,o=n[0]===0&&n[1]===1,{unzoomedTickLayout:a,domain:r}=this.calculateDomain(t,s),l=this.getDomainExtentsNice();let c;if(o)c=a;else{const{range:y,gridLength:x}=this,b=Aa(y),v=l.map(M=>M?1:2),{tickLayoutCache:S}=this;S==null||!aO(S,{domain:r,rangeExtent:b,nice:l,gridLength:x,visibleRange:n,initialPrimaryTickCount:t,scrollbarKey:s})?(c=this.calculateTickLayout(r,v,n,t),this.tickLayoutCache={domain:r,rangeExtent:b,nice:l,gridLength:x,visibleRange:n,initialPrimaryTickCount:t,scrollbarKey:s,tickLayout:c}):c=S.tickLayout}const{rawTickCount:h=0,fractionDigits:d,bbox:u}=c,p=a.rawTickCount??0,f=h!==0&&p!==0?{zoomed:h,unzoomed:p}:void 0;return this.tickLayout=c.layout,this.layout.label={fractionDigits:d,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:f,bbox:u}}invalidateLayoutCache(){this.unzoomedTickLayoutCache=void 0,this.tickLayoutCache=void 0,this.tickLayout=void 0}getScrollbarLayoutCacheKey(t){const i=t?.scrollbars?.[this.id];return i?.enabled?`${i.placement}:${i.spacing}:${i.thickness}:${i.tickSpacing}`:"none"}updateCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.gridPadding=this.gridPadding,i.update(t)}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:o}=this,a=Math.floor(o.x),r=Math.floor(o.y);n.setProperties({translationX:a,translationY:r}),t.setProperties({translationX:a,translationY:r}),i.setProperties({translationX:a,translationY:r}),s.setProperties({translationX:a,translationY:r})}tickFormatter(t,i,s,n,o,a="long"){const{moduleCtx:r,label:l}=this,{formatManager:c}=r,h=s?this.primaryLabel:void 0,d=this.tickFormatParams(t,i,n,o),u=this.formatterBoundSeries.get();let p,f,y;if(d.type==="number")p=d.fractionDigits;else if(d.type==="date"){const{unit:I,step:k,epoch:A}=d;f={unit:I,step:k,epoch:A},y=d.truncateDate}const x=this.uncachedCallWithContext.bind(this),b={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.getFormatterProperty(),domain:t,boundSeries:u},v=h??l,S=s?l.format:void 0,{allowNull:M}=this,D={specifier:Bu.mergeSpecifiers(h?.format,l.format),truncateDate:y,allowNull:M};return(I,k)=>{const A=this.datumFormatParams(I,b,p,f,a);return A.value=I,v.formatValue(x,A,k,{specifier:S,dateStyle:a,truncateDate:y})??c.format(x,A,D)??c.defaultFormat(A,D)}}formatDatum(t,i,s,n,o,a,r,l,c,h,d){if(i==null&&!d)return"";const{moduleCtx:u,dataDomain:p}=this;l??(l=p.domain);const{formatManager:f}=u,y=this.formatterBoundSeries.get();let x;switch(s){case"crosshair":case"annotation-label":x=this.layout.label.fractionDigits+1;break;case"series-label":x=2;break;case"tooltip":x=3;break;case"legend-label":x=void 0;break}const b=this.datumFormatParams(i,{source:s,datum:a,seriesId:n,legendItemName:o,key:r,property:this.getFormatterProperty(),domain:l,boundSeries:y},x,void 0,"long"),{type:v,value:S}=b,M=this.createCallWithContext(t),D=c?.formatValue(M,v,S,h??b)??f.format(M,b,{allowNull:d})??this.label.formatValue(M,b,Number.NaN)??f.defaultFormat(b);return Ae(D)?D:String(D)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength,t.gridPadding=this.gridPadding}hasVisibleSeries(){return this.boundSeries.some(t=>t.isEnabled())}clipTickLines(t,i,s,n){this.tickLineGroup.setClipRect(new re(t,i,s,n))}clipGrid(t,i,s,n){this.gridGroup.setClipRect(new re(t,i,s,n))}getFormatterProperty(){const{direction:t,boundSeries:i}=this;let s=t;for(const n of i){const o=n.resolveKeyDirection(t);if(o!==t){s=o;break}}return s}getTitleFormatterParams(t){const{direction:i}=this,s=this.formatterBoundSeries.get();return{domain:t,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(t){return{domain:[...t.domain],clipped:!1}}getLayoutTranslation(){return this.translation}getLayoutState(){return{id:this.id,rect:this.getBBox(),translation:this.getLayoutTranslation(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}getUpdateTypeOnResize(){return 5}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:t}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:xt.is(t)||$r.is(t),getCanvasBounds:()=>zt.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>{const n=s.getKeyProperties(this.direction);for(const o of n)i.add(o);return i},new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleInvert:i=>t.invert(i,!0),scaleInvertNearest:i=>t.invert(i,!0),formatScaleValue:(i,s,n)=>{const{allowNull:o}=this;return this.formatDatum(void 0,i,s,void 0,void 0,void 0,void 0,void 0,n,void 0,o)},attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i),measureBand:i=>this.measureBand(i)}}pickBand(t){if(!na.is(this.scale))return;const{scale:i,range:s,id:n}=this,o=i.invert(this.isVertical()?t.y:t.x,!0),[a,r,l]=rO(i,s,o);return{id:n,value:o,band:[r,l],position:a}}measureBand(t){if(!na.is(this.scale))return;const[,i,s]=rO(this.scale,this.range,t);return{band:[i,s]}}isVertical(){return this.direction==="y"}isReversed(){return this.reverse}cachedCallWithContext(t,i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],t,i)}uncachedCallWithContext(t,i){const{chartService:s}=this.moduleCtx;return ls([this,s],t,i)}createCallWithContext(t){const{chartService:i}=this.moduleCtx;return(s,n)=>ls([t,this,i],s,n)}};tc.defaultTickMinSpacing=50,tc.CrossLineConstructor=Es,g([m],tc.prototype,"nice",2),g([m],tc.prototype,"reverse",2),g([m],tc.prototype,"interval",2),g([m],tc.prototype,"title",2),g([Rt((e,t,i)=>e.onGridLengthChange(t,i))],tc.prototype,"gridLength",2);var SI=tc,MI=class extends Nt{constructor(){super(...arguments),this.autoRotateAngle=335}};g([m],MI.prototype,"autoRotate",2),g([m],MI.prototype,"autoRotateAngle",2);var Hu=class q_ extends na{constructor(){super(...arguments),this.type="category",this.defaultTickCount=0,this.index=new Map,this.indexInitialized=!1,this._domain=[]}static is(t){return t instanceof q_}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index.clear(),this.indexInitialized=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let i;const s=new Set;let n=!0;for(const o of t){const a=o.domain;s.has(a)||(s.add(a),i==null?i=lO(a):(n&&(n=uK(a,i)),i=lO([...i,...a])))}return i??(i=[]),{domain:i,animatable:n}}toDomain(t){}invert(t,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,t-s));return i||t===this.ordinalRange(n)?this.domain[n]:void 0}ticks(t,i=this.domain,s){const{bands:n}=this;let{tickCount:o}=t;if(o===0){const y=n.length>1?1:0;return{ticks:n[y]?[n[y]]:[],count:void 0,firstTickIndex:y}}let a=o!=null&&o!==0?Math.trunc(n.length/o):1;if(a=Hy(a),a<=1)return ST(i,!1,s);o=Math.trunc(n.length/a);const r=a*o,l=Hy(Math.trunc((n.length-r)/2)),c=se(0,Math.floor((s?.[0]??0)*n.length),n.length),h=se(0,Math.ceil((s?.[1]??1)*n.length),n.length),d=Math.floor((c-l)/a)*a+l,u=Math.ceil((h-l)/a)*a+l,p=[];for(let y=d;y=0&&y0?this.findIndex(p[0]):void 0;return f!=null&&(f=Math.floor((f-l)/a)),{ticks:p,count:void 0,firstTickIndex:f}}findIndex(t){const{index:i,indexInitialized:s}=this;if(!s){const{domain:n}=this;for(let o=0;oa%d.duration===0);if(r){const{timeInterval:d,step:u,duration:p}=r,f={...d,step:u*Jo(d)*Math.round(a/p),epoch:wx(d,{weekStart:yb})};return mn(f,new Date(e),new Date(t),{visibleRange:n,extend:o})}let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+a);return h}function gK(e,t,i,s){const{interval:n}=i,o=Math.min(Zi(e),Zi(t)),a=Math.max(Zi(e),Zi(t));let r;if(Ge(n)||typeof n=="string")r=n;else{let d;typeof n=="number"&&(d=(a-o)/Math.max(n,1),$l(d,s)&&(d=void 0)),d??(d=i.tickCount??xt.defaultTickCount),r=vu(o,a,d,i.minTickCount,i.maxTickCount,{weekStart:yb})}if(r==null)return[e,t];const l=mn(r,new Date(o),new Date(a),{extend:!0});if(l==null||l.length<2)return[e,t];const c=l[0],h=l.at(-1);return e<=t?[c,h]:[h,c]}var fK=1e3,ic=class J_ extends $r{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=xt.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof J_}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this.isReversed=hO(t))}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}get numericBands(){return this._numericBands??(this._numericBands=this.bands.map(t=>t.valueOf())),this._numericBands}getUniformityCache(t){const{bands:i}=this,s=i.length;if(!t||t[0]===0&&t[1]===1)return s>fK&&this._uniformityCache===void 0&&(this._uniformityCache=_1(i)),this._uniformityCache;const n=Math.floor(t[0]*s),o=Math.min(Math.ceil(t[1]*s),s-1);return _1(i,n,o)}normalizeDomains(...t){const i=t.filter(o=>o.domain.length>0);if(i.length===0)return{domain:[],animatable:!1};const s=i[0].domain,n=i.every(o=>o.domain===s);if(i.length===1||n){const o=i[0];let a=o.domain,r,l=!1;return o.sortMetadata?.sortOrder===void 0?r=lx(a):(r=o.sortMetadata.sortOrder,l=o.sortMetadata.isUnique??!1),r===-1?a=a.slice().reverse():r==null&&(a=l?a.slice().sort((c,h)=>c.valueOf()-h.valueOf()):rx(a.slice())),{domain:a,animatable:!0}}return{domain:rx(i.map(o=>o.domain).flat()),animatable:!0}}ticks(t,i,s=[0,1],{extend:n=!1,dropInitial:o=!1}={}){const{interval:a,maxTickCount:r,tickCount:l=r}=t,{bands:c,reversed:h}=this;if(!c.length)return;if(h&&(s=[1-s[1],1-s[0]]),this.refresh(),a==null){const{ticks:S,tickOffset:M,tickEvery:D}=this.getDefaultTicks(i,l,s,n);let I=S.length>0?this.findIndex(S[0]):void 0;return I=I==null?void 0:Math.floor((I-M)/D),{ticks:S,count:void 0,firstTickIndex:I}}let d,u;i&&i.length>=2?(d=i[0].valueOf(),u=i.at(-1).valueOf()):(d=c[0].valueOf(),u=c.at(-1).valueOf());const[p,f]=this.range,y=Math.abs(f-p),x=cO({start:d,stop:u,interval:a,availableRange:y,visibleRange:s,extend:n})??this.getDefaultTicks(i,l,s,n).ticks,b=[];let v=-1;for(const S of x){const M=this.findIndex(S,1)??-1,D=M===v;v=M,!(o&&M===0)&&M!==-1&&!D&&b.push(c[M])}return{ticks:b,count:void 0,firstTickIndex:void 0}}stepTicks(t,i,s=[0,1],n=!0){const o=i?this.bandDomainIndices(i):void 0,a=this.ticksEvery(o,s,t,0,!1),r=a.at(-1),l=n&&t>1?o?.[1]:void 0,c=l!=null&&r!=null?this.findIndex(r):void 0;return c!=null&&l!=null&&l-c0&&e[0]>e.at(-1)}var mK=1e3,DI=5e7,sc=class eH extends $r{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=1/0,this._domain=[],this._bands=void 0}static is(t){return t instanceof eH}static supportsInterval(t,i){return dO(t,i)}set domain(t){if(t!==this._domain){if(t.length===this._domain.length&&t.length>=2&&t[0].valueOf()===this._domain[0].valueOf()&&t[1].valueOf()===this._domain[1].valueOf()){this._domain=t;return}this._domain=t,this.invalidateCaches()}}get domain(){return this._domain}get interval(){return this._interval}set interval(t){this._interval!==t&&(this._interval=t,this.invalidateCaches())}invalidateCaches(){this._bands=void 0,this._numericBands=void 0,this._uniformityCache=void 0,this._domainBoundaries=void 0,this._bandRangeCache=void 0,this._encodedBands=void 0,this._encodingParams=void 0,this._linearParams=void 0}get bands(){if(this._bands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const t=this._encodingParams;this._bands=this._encodedBands.map(i=>JM(i,t))}else this._bands=[];return this._bands}get numericBands(){if(this._numericBands===void 0)if(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null){const t=this._encodingParams;this._numericBands=this._encodedBands.map(i=>Fr(i,t))}else this._numericBands=[];return this._numericBands}ensureEncodedBands(){if(this._encodedBands!==void 0)return;const{domain:t,interval:i}=this;if(t.length<2||i==null){this._encodedBands=[];return}const s=this.getCachedBandRange();if(s==null){this._encodedBands=[];return}const[n,o]=s,a={visibleRange:[0,1],extend:!1};if(Qg(i,n,o,a)>DI){W.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),this._encodedBands=[];return}const{encodedValues:r,encodingParams:l}=QM(i,n,o,a);this._encodedBands=r,this._encodingParams=l}getBandCountForUpdate(){return this.ensureEncodedBands(),this._encodedBands?.length??0}getUniformityCache(t){const i=this.getBandCountForUpdate();if(!t||t[0]===0&&t[1]===1){if(i>mK&&this._uniformityCache===void 0)if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=Fr(this._encodedBands[0],this._encodingParams),n=Fr(this._encodedBands[1],this._encodingParams);this._uniformityCache={isUniform:!0,interval:n-s}}else this._uniformityCache={isUniform:!1};return this._uniformityCache}if(this.ensureEncodedBands(),this._encodingParams!=null&&this._encodedBands!=null&&this._encodedBands.length>=2){const s=Fr(this._encodedBands[0],this._encodingParams);return{isUniform:!0,interval:Fr(this._encodedBands[1],this._encodingParams)-s}}return{isUniform:!1}}normalizeDomains(...t){return B1(...t)}getCachedBandRange(){const{domain:t,interval:i}=this;if(!(t.length<2||i==null))return this._bandRangeCache??(this._bandRangeCache={start:tn(i,t[0]),stop:tn(i,t[1])}),[this._bandRangeCache.start,this._bandRangeCache.stop]}getDomainBoundaries(){const{interval:t}=this;if(t!=null){if(this._domainBoundaries===void 0){const i=this.getCachedBandRange();if(i==null)return;const[s,n]=i,o=Math.min(s.valueOf(),n.valueOf()),a=Math.max(s.valueOf(),n.valueOf()),r=Ix(t,new Date(a)).valueOf();this._domainBoundaries={d0:o,dNext:r}}return this._domainBoundaries}}getLinearParams(){if(this._linearParams===void 0&&(this.ensureEncodedBands(),this._encodedBands!=null&&this._encodingParams!=null&&this._encodedBands.length>=2)){const t=Fr(this._encodedBands[0],this._encodingParams),i=Fr(this._encodedBands[1],this._encodingParams);this._linearParams={firstBandTime:t,intervalMs:i-t}}return this._linearParams}isLinearUnit(){const t=this._encodingParams?.unit;return t==="millisecond"||t==="second"||t==="minute"||t==="hour"}findIndex(t,i=0){if(t==null)return;const s=this.getBandCountForUpdate();if(s===0)return;if(s===1)return 0;const n=this.getLinearParams();if(n==null||n.intervalMs===0)return super.findIndex(t,i);const{firstBandTime:o,intervalMs:a}=n,r=t.valueOf(),l=(r-o)/a;let c=i===1?Math.ceil(l):Math.floor(l);if(c=Math.max(0,Math.min(c,s-1)),this.isLinearUnit()){if(i===1){if(o+c*ar&&c===0)return;return c}const h=this.numericBands;if(i===1){for(;c>0&&h[c-1]>=r;)c--;for(;c0&&h[c]>r;)c--;if(h[c]>r)return}return c}convert(t,i){this.refresh(),t instanceof Date||(t=new Date(t));const{domain:s,interval:n}=this;if(s.length<2)return Number.NaN;if(i?.clamp!==!0&&n!=null){const o=this.getDomainBoundaries();if(o!=null){const a=t.valueOf();if(a=o.dNext)return Number.NaN}}return super.convert(t,i)}calculateBands(t,i,s=!1){const n=t===this.domain&&i[0]===0&&i[1]===1&&!s;if(n&&this._bands!=null)return{bands:this._bands,firstBandIndex:0};if(t.length<2)return{bands:[],firstBandIndex:void 0};const{interval:o}=this;if(o==null)return{bands:[],firstBandIndex:void 0};const a={visibleRange:i,extend:s};if(!dO(t,o,a))return{bands:[],firstBandIndex:void 0};const r=t===this.domain?this.getCachedBandRange():II(t,o);if(r==null)return{bands:[],firstBandIndex:void 0};const[l,c]=r;if(Qg(o,l,c,a)>DI)return W.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),{bands:[],firstBandIndex:void 0};const h=mn(o,l,c,a),d=Ax(o,l,c,a);return n&&(this._bands=h),{bands:h,firstBandIndex:d}}ticks({interval:t},i=this.domain,s=[0,1],{extend:n=!1}={}){if(i.length<2)return;const o=i===this.domain&&!n;if(o&&t!=null)return this.ticksFromNumericBands(t,i,s);let a,r,l;return o?({bands:a}=this.calculateBands(i,[0,1],!1),l=vT(a,!1,s),r=l[0]):{bands:a,firstBandIndex:r}=this.calculateBands(i,s,n),t==null?{ticks:a,count:void 0,firstTickIndex:r}:this.ticksFromBands(t,a,i,s,n,l,r)}ticksFromNumericBands(t,i,s){const n=this.numericBands,o=n.length;if(o===0)return{ticks:[],count:0,firstTickIndex:void 0};const a=vT(n,!1,s),r=a[0],l=this.interval?Yi(this.interval):1/0,c=Math.min(i[0].valueOf(),i[1].valueOf()),h=Math.max(i[0].valueOf(),i[1].valueOf());let d,u,p;if(Ge(t)||typeof t=="string")d=mn(t,i[0],i[1],{extend:!0,visibleRange:s}).map(S=>S.valueOf()),u=0,p=d.length-1;else{const v=a[0],S=a[1]-1;d=n,u=ko(v,S,M=>n[M]<=c)??v,p=ko(v,S,M=>n[M]<=h)??S}const f=[];let y;for(let v=u;v<=p;v++){const S=d[v],M=ko(0,o-1,D=>n[D]<=S);M!=null&&M!==y&&S-n[M]<=l&&f.push(n[M]),y=M}const[x,b]=this.sliceTickWindow(f,c,h,!1);return{ticks:f.slice(x,b+1).map(v=>new Date(v)),count:f.length,firstTickIndex:r}}ticksFromBands(t,i,s,n,o,a,r){const l=this.interval?Yi(this.interval):1/0,c=Math.min(s[0].valueOf(),s[1].valueOf()),h=Math.max(s[0].valueOf(),s[1].valueOf());let d,u,p;if(Ge(t)||typeof t=="string")d=mn(t,s[0],s[1],{extend:!0,visibleRange:n}),u=0,p=d.length-1;else{const S=a?a[0]:0,M=a?a[1]-1:i.length-1;d=i,u=ko(S,M,D=>i[D].valueOf()<=c)??S,p=ko(S,M,D=>i[D].valueOf()<=h)??M}const f=[];let y;for(let S=u;S<=p;S++){const M=d[S].valueOf(),D=ko(0,i.length-1,k=>i[k].valueOf()<=M),I=D!=null&&D!=y?i[D]:void 0;y=D,I!=null&&M-I.getTime()<=l&&f.push(I)}const x=f.map(S=>S.valueOf()),[b,v]=this.sliceTickWindow(x,c,h,o);return{ticks:f.slice(b,v+1),count:f.length,firstTickIndex:r}}sliceTickWindow(t,i,s,n){let o,a;if(this.interval){const c=II([new Date(i),new Date(s)],this.interval);o=c[0].valueOf(),a=c[1].valueOf()}else o=i,a=s;let r=ih(0,t.length-1,c=>t[c]>=o)??0,l=ko(0,t.length-1,c=>t[c]<=a)??t.length-1;return n&&(r=Math.max(r-1,0),l=Math.min(l+1,t.length-1)),[r,l]}};function dO(e,t,i){const[s,n]=II(e,t);return Qg(t,s,n,i)<=DI}function II(e,t){const i=tn(t,e[0]),s=tn(t,e[1]);return[i,s]}function yK(e,t,i,s,n){let[o,a]=kt(t.map(Number));const r=Math.floor(i.unzoomed);if(r<=1){const[b,v]=xK(o,a),S=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:M}=ah(b,v,S,void 0,void 0,n),D=[e.toDomain(b),e.toDomain(v)];return s&&D.reverse(),{domain:D,ticks:M}}if(o===a){const b=Math.floor(Math.log10(o)),v=Math.pow(10,b),S=Math.min(v,1),M=r-1;o-=S*Math.floor(M/2),a=o+S*M}let l=o,c=a;l=bK(l,c,r);const h=SK(l,c,r),d=r-1;c=l+d*h;const u=Math.floor(l/h)*h,p=Math.floor(c/h)*h;u<=o&&p>=a&&(l=u,c=p);const f=[e.toDomain(l),e.toDomain(c)];s&&f.reverse();const y=h*((i.unzoomed-1)/(i.zoomed-1)),x=vK(l,y,Math.floor(i.zoomed));return{domain:f,ticks:x}}function xK(e,t){let i=e,s=t,n=0;do{[i,s]=Lx(i,s);const{ticks:o}=ah(i,s,5);if(o.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[e,t]}function bK(e,t,i){e=Math.floor(e);const s=Math.abs(t-e)/(i-1),n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return Math.floor(e/o)*o}function vK(e,t,i){const s=Uc(t),n=Math.pow(10,s),o=[];for(let a=0;a0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:e}var DK=18,IK=[1,2,3,4,6,8,9,10,12];function uO(e,t=0){const i=[];for(const s of e){const{x:n,y:o,width:a,height:r}=s;if(i.some(l=>nx(l,n,o,a+t,r+t)))return!0;i.push(s)}return!1}function kK(e,t,i,s){if(e==null)return t;if(typeof e!="number"){const r=t[0],l=typeof e=="string"?{unit:e,epoch:r}:{...e,epoch:r};return mn(l,t[0],t[1],{visibleRange:i,extend:s})}const n=[],o=t[0].valueOf(),a=t[1].valueOf();for(let r=o;r<=a;r+=e)n.push(new Date(r));return n}function pO(e,t){if(e.length!==t.length)return!1;for(let i=0;i{const S=na.is(c)&&c.bandwidth||1/0,M=(c.bandwidth??0)/2,D=CK(h.enabled,n,t,i,r,l,d);let I=p?f:S,k=p?S:f;if(h.rotation){const w=ex(h.rotation,I,k);I=w.width,k=w.height}const A={font:h,maxWidth:I,maxHeight:k,overflow:h.truncate?"ellipsis":"hide",textWrap:h.wrapping};for(let w=0;w(d?c:h)?.(u,p)??String(u)}function LK(e,t,i,s,n,o,a,r){if(!Gu.is(e)&&!$r.is(e))return;const l=bu(o);if(l==null)return;a&&(t=[1-t[1],1-t[0]]);const c=Math.min(e.domain[0].valueOf(),e.domain.at(-1).valueOf()),h=Math.max(e.domain[0].valueOf(),e.domain.at(-1).valueOf());let[d,u]=kx(new Date(c),new Date(h),t);d=tn(l,d),d.valueOf()>=c&&(d=qM(l,d)),u=XM(l,u),u.valueOf()<=h&&(u=Ix(l,u));const p=mn(l,d,u),f=Yi(o),y=ic.is(e),x={...n,interval:o},b=[];let v,S,M,D=0;if(ic.is(e)){const I=wo(o);S=r!=null&&Yi(r)>=Yi(I)?2:3,M=1;const k=i/s,A=e.bandCount(t)/(k*DK);D=IK.findLast(w=>A>=w)??1}else sc.is(e)&&(e.interval==null||Yi(e.interval)>=f)?S=1:(S=0,M=2);for(let I=0;IG.valueOf(){switch(S){case 0:case 3:return G.valueOf()+f>A.valueOf();case 1:case 2:return G.valueOf()>=A.valueOf()}}),V.length===0)continue;const z=V[0],R=ax(z,k);(S===0?R===0:R<=f)&&(!y||!w)&&(v??(v=new Set),v.add(b.length)),b.push(...V)}return v?.size===1&&v.has(0)&&(v=void 0),{ticks:b,primaryTicksIndices:v,alignment:M}}function NK(e,t,i,s,n){const o=fO(e.format,s);if(o==null)return{width:0,height:0};const a=uh(o),r=s?bu(s):void 0,l=fO(t?.format,r),c=l?uh(l):a,h=new Date(i[0]),d=new Date(i.at(-1)),u=r?mn(r,new Date(i[0]),new Date(i.at(-1)),{extend:!0}):void 0;let p=0,f=0;if(a!=null){const y=_u(e),x=y.left+y.right,b=y.top+y.bottom;let v,S;u!=null&&u.length>1?(v=u[0],S=u[1]):(v=h,S=d);const M=mn(s,v,S,{limit:50});for(const D of M){const I=a(D),{width:k,height:A}=n.measureLines(I);p=Math.max(p,k+x),f=Math.max(f,A+b)}}if(c!=null&&u!=null){const y=_u(t),x=y.left+y.right,b=y.top+y.bottom;for(const v of u){const S=c(v),{width:M,height:D}=n.measureLines(S);p=Math.max(p,M+x),f=Math.max(f,D+b)}}return{width:Math.ceil(p),height:Math.ceil(f)}}function TK(e,t,i,s){return e&&!t?i*s===-1?"top":"bottom":"middle"}function OK(e,t,i,s,n){const o=t>0&&t<=Math.PI,a=i>0&&i<=Math.PI,r=o||a?-1:1;if(e)if(t||i){if(s*r===-1)return"right"}else return"center";else if(s*n===-1)return"right";return"left"}function fO(e,t){if(e!=null){if(typeof e=="string")return e;if(Ge(e)&&t!=null)return e[wo(t)]}}function PK(e,t,i=0){const s=qo(e),n=!s&&i>=0&&i<=Math.PI?-1:1,o=!s&&i-Math.PI/2>=0&&i-Math.PI/2<=Math.PI?-1:1,a=t?n*(Math.PI/2):0;return{configuredRotation:s,defaultRotation:a,parallelFlipFlag:n,regularFlipFlag:o}}var EK=new Date(1970,0,4);function mO(e){const{label:t,domain:i,axisRotation:s,labelOffset:n,sideFlag:o}=e,{defaultRotation:a,configuredRotation:r,parallelFlipFlag:l,regularFlipFlag:c}=PK(t.rotation,t.parallel,s),h=r+a,d=(A,w=0)=>{const C=t.minSpacing??(r===0&&w===0?10:0),T=h+w,O=_u(t);return uO(VK(e,A,T),C)||uO(BK(A.ticks,n,T,O),C)},{maxTickCount:u}=yO(e),p=RK(e),f=t.enabled&&t.avoidCollisions,y=Number.isFinite(u)?u:10,x=f&&t.autoRotate&&t.rotation==null;let b=0,v=0,S=!0,M={tickDomain:[],niceDomain:i,ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0};for(;S&&b<=y;)({tickData:M,index:b}=zK(e,p,M,b)),v=x&&d(M,0)?qo(t.autoRotateAngle):0,S=f&&d(M,v);const D=OK(t.parallel,r,v,o,c),I=TK(t.parallel,r,o,l),k=r+v;return{tickData:M,textAlign:D,textBaseline:I,rotation:k}}function RK(e){return e.interval?.values?2:e.primaryTickCount!=null?1:0}function yO({scale:e,domain:t,range:i,visibleRange:s,label:n,defaultTickMinSpacing:o,interval:{minSpacing:a,maxSpacing:r}}){const{defaultTickCount:l}=e,c=Aa(i),h=Aa(s);if(Hu.is(e)||ic.is(e)&&t.length<1e3){const d=Hu.is(e)?t.length:Math.min(t.length,Math.max(1,Math.floor(c/(h*o)))),u=Math.ceil(c/(h*n.fontSize));return{tickCount:Math.min(u,d),minTickCount:0,maxTickCount:d}}return Nx(c,h,a,r,l,o)}function zK(e,t,i,s){const{step:n,values:o}=e.interval,{maxTickCount:a,minTickCount:r,tickCount:l}=yO(e),c=w=>Math.max(l-w,r),h=n==null&&o==null&&c(s)>r,d=i.rawTicks,u=l-r,p={minTickCount:r,maxTickCount:a,tickCount:c(s)};let f=xO(e,t,p);if(h&&pO(f.rawTicks,d)){let w=s,C=u;for(;w<=C;){s=Math.trunc((w+C)/2),p.tickCount=c(s);const T=xO(e,t,p);pO(T.rawTicks,d)?w=s+1:(f=T,C=s-1)}}const{tickDomain:y,niceDomain:x,rawTicks:b,rawTickCount:v,rawFirstTickIndex:S,generatePrimaryTicks:M,primaryTicksIndices:D,alignment:I,fractionDigits:k,timeInterval:A}=f;return{tickData:{tickDomain:y,niceDomain:x,rawTicks:b,rawTickCount:v,fractionDigits:k,timeInterval:A,ticks:wK(e,{niceDomain:x,rawTicks:b,rawFirstTickIndex:S,generatePrimaryTicks:M,primaryTicksIndices:D,alignment:I,fractionDigits:k,timeInterval:A})},index:s+1}}function xO(e,t,i){const{domain:s,reverse:n,visibleRange:o,scale:a,interval:r,primaryLabel:l,niceMode:c,primaryTickCount:h,minimumTimeGranularity:d}=e,u={nice:c.map(w=>w===0),interval:r.step,...i},p={...u,nice:c.map(w=>w===0||w===1)};let f;t===1&&h!=null&&xt.is(a)&&(f=yK(a,s,h,n,o));const y=c.includes(0)?f?.domain??a.niceDomain(u,s):s;let x=y,b,v,S,M,D,I;const k=l?.enabled===!0&&p.interval==null;gO(a,y,()=>{switch(t){case 2:if(x=r.values,b=r.values,v=b.length,ic.is(a)?I=1:sc.is(a)&&(I=2),xt.is(a)){const[w,C]=kt(y.map(Number));b=b.filter(T=>Number(T)>=w&&Number(T)<=C).sort((T,O)=>Number(T)-Number(O))}break;case 1:if(f)b=f.ticks,v=f.ticks.length;else{const w=a.ticks(p,y,o);b=w?.ticks,v=w?.count}break;default:{const{tickCount:w,minTickCount:C,maxTickCount:T}=i;if(y.length>0&&p.interval==null&&(sc.is(a)||k&&(Gu.is(a)||ic.is(a)))){const z=y,R=Math.min(z[0].valueOf(),z.at(-1).valueOf()),B=Math.max(z[0].valueOf(),z.at(-1).valueOf());M=vu(R,B,w,C,T,{weekStart:l==null?EK:void 0,primaryOnly:!0})}let O;ic.is(a)?O=d:sc.is(a)&&(O=a.interval),O!=null&&M!=null&&Yi(O)>=Yi(M)&&(M=O);const V=M?LK(a,o,w,T,p,M,n,d):void 0;if(V)({ticks:b,primaryTicksIndices:D,alignment:I}=V);else{const z=sc.is(a)&&p.interval==null&&M!=null?{...p,interval:M}:p,R=a.ticks(z,y,o);if(b=R?.ticks,v=R?.count,S=R?.firstTickIndex,Gu.is(a)||$r.is(a)){const B=typeof p.interval=="number"?Su(p.interval):p.interval;M??(M=B??R?.timeInterval)}}}}}),b??(b=[]);let A=0;for(const w of b){if(typeof w!="number")continue;const C=Uc(w);C>A&&(A=C)}return k||(D=void 0),{tickDomain:x,niceDomain:y,rawTicks:b,rawTickCount:v,rawFirstTickIndex:S,generatePrimaryTicks:k,primaryTicksIndices:D,alignment:I,fractionDigits:A,timeInterval:M}}function VK(e,t,i){const{niceDomain:s,ticks:n,timeInterval:o}=t;if(o==null)return[];const a=AK(n),{label:r,labelOffset:l,primaryLabel:c,domain:h}=e,{width:d,height:u}=NK(r,c,s??h,o,et(r)),p=[];for(const f of[0,a]){const{x:y,y:x}=tx(l,f,i);p.push({x:y,y:x,width:d,height:u})}return p}function BK(e,t,i,s){const n=[],o=s.left+s.right,a=s.top+s.bottom;for(const{tickLabel:r,textMetrics:l,translation:c}of e){if(!r)continue;const{x:h,y:d}=tx(t,c,i),u=l.width+o,p=l.height+a;n.push({x:h,y:d,width:u,height:p})}return n}var Mf=class tH extends SI{constructor(t,i){super(t,i),this.maxThicknessRatio=.3,this.crossAxisTranslation={x:0,y:0},this.minimumTimeGranularity=void 0,this.headingLabelGroup=this.axisGroup.appendChild(new ds({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new ds({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new Xn({zIndex:1})),this.tickLineGroupSelection=yi.select(this.tickLineGroup,Xn,!1),this.gridLineGroupSelection=yi.select(this.gridLineGroup,Xn,!1),this.gridFillGroupSelection=yi.select(this.gridFillGroup,Ci,!1),this.tempText=new Pu({debugDirty:!1}),this.tempCaption=new Wt,this.animationManager=t.animationManager,this.animationState=new he("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let s;this.cleanup.register(t.eventsHub.on("layout:complete",n=>{const o=[n.chart.width,n.chart.height];s!=null&&!Vn(o,s)&&this.animationState.transition("resize"),s=o}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof tH}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){}resetAnimation(t){t==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new MI}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(t,i){return this.updateDirection(),super.calculateLayout(t,i)}layoutCrossLines(){const t=this.hasDefinedDomain()||this.hasVisibleSeries();for(const i of this.crossLines)i.calculateLayout?.(t)}calculateTickLayout(t,i,s,n){const o=this.label.getSideFlag(),a=o*(this.getTickSize()+this.getTickSpacing()+this.label.spacing+this.seriesAreaPadding),r=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(r);if(i[0]===2&&i[1]===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:ue,spacing:ge}=this.measureAxisLayout(t,[],[],r,l);return{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:ue,layout:{ticks:[],tickLines:[],gridLines:[],gridFills:[],labels:[],spacing:ge}}}const{label:c,primaryLabel:h,scale:d,range:u,interval:p,reverse:f,defaultTickMinSpacing:y,minimumTimeGranularity:x}=this,b=mO({label:c,scale:d,interval:p,primaryLabel:h,domain:t,range:u,reverse:f,niceMode:i,visibleRange:s,defaultTickMinSpacing:y,minimumTimeGranularity:x,sideFlag:o,labelOffset:a,primaryTickCount:n,axisRotation:this.horizontal?Math.PI/-2:0,isVertical:this.direction==="y",sizeLimit:this.chartLayout?.sizeLimit,inRange:ue=>this.inRange(ue,.001),tickFormatter:(...ue)=>this.tickFormatter(...ue)}),{tickData:v}=b;if(this.label.avoidCollisions&&this.horizontal&&v.ticks.length>2&&(xt.is(this.scale)||$r.is(this.scale))){const ue=this.chartLayout?.padding.right??0,ge=v.ticks.at(-1);ge?.tickLabel!=null&&ge.translation+ge.textMetrics.width/2>u[1]+ue&&(ge.tickLabel=void 0,s[0]===0&&s[1]===1&&(v.ticks[0].tickLabel=void 0))}const{ticks:M,tickDomain:D,rawTicks:I,rawTickCount:k,fractionDigits:A,timeInterval:w,niceDomain:C}=v,T=M.map(ue=>this.getTickLabelProps(ue,b,l)),{position:O,gridPadding:V,gridLength:z}=this,R=O==="bottom"||O==="right"?-1:1,B=R*V,G=R*(z+V),F=this.calculateGridLines(M,B,G),_=this.calculateGridFills(M,B,G),Y=this.calculateTickLines(M,R,l),{bbox:Z,spacing:ne}=this.measureAxisLayout(D,M,T,r,l);return{ticks:I,rawTickCount:k,tickDomain:D,niceDomain:C,fractionDigits:A,timeInterval:w,bbox:Z,layout:{ticks:M,gridLines:F,gridFills:_,tickLines:Y,labels:T,spacing:ne}}}calculateGridLines(t,i,s){return t.map((n,o)=>this.calculateGridLine(n,o,i,s,t))}calculateGridLine({index:t,tickId:i,translation:s},n,o,a,r){const{gridLine:l,horizontal:c}=this,[h,d,u,p]=c?[s,o,s,a]:[o,s,a,s],{style:f}=l,{stroke:y,strokeWidth:x=0,lineDash:b}=f[t%f.length]??{};return{tickId:i,offset:s,x1:h,y1:d,x2:u,y2:p,stroke:y,strokeWidth:x,lineDash:b}}calculateGridFills(t,i,s){const{horizontal:n,range:o,type:a}=this,r=[];if(t.length==0)return r;let l=0;const c=!n&&a==="unit-time";if(c&&t[0].translationo[0]){const d={tickId:`before:${t[0].tickId}`,translation:o[0]};r.push(this.calculateGridFill(d,-1,t[0].index,i,s,t)),l=1}return r.push(...t.map((d,u)=>this.calculateGridFill(d,u,d.index+l,i,s,t))),r}calculateGridFill({tickId:t,translation:i},s,n,o,a,r){const{gridLine:l,horizontal:c,range:h}=this,d=r[s+1],u=i,p=d?d.translation:h[1],[f,y,x,b]=c?[u,Math.max(o,a),p,Math.min(o,a)]:[Math.min(o,a),Math.min(u,p),Math.max(o,a),Math.max(u,p)],{fill:v,fillOpacity:S}=l.style[n%l.style.length]??{};return{tickId:t,x1:f,y1:y,x2:x,y2:b,fill:v,fillOpacity:S}}calculateTickLines(t,i,s=0){return t.map(n=>this.calculateTickLine(n,n.index,i,t,s))}calculateTickLine({isPrimary:t,tickId:i,translation:s},n,o,a,r=0){const{horizontal:l,tick:c,primaryTick:h}=this,d=t&&h?h:c,u=this.getTickSize(d),p=this.getTickSpacing(d),f=-o*(r+p),y=-o*u,[x,b,v,S]=l?[s,f,s,f+y]:[f,s,f+y,s],{stroke:M,width:D}=d;return{tickId:i,offset:s,x1:x,y1:b,x2:v,y2:S,stroke:M,strokeWidth:D,lineDash:void 0}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),a=>a.datum.tickId);super.update();const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:a}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const r=a.map(c=>c.tickId),l=AM(t,r);this.animationState.transition("update",l)}}const{enabled:s,stroke:n,width:o}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:s?o:0}),this.updateTickLines(),this.updateGridLines(),this.updateGridFills()}getAxisTransform(){return{translationX:Math.floor(this.translation.x+this.crossAxisTranslation.x),translationY:Math.floor(this.translation.y+this.crossAxisTranslation.y)}}getLayoutTranslation(){const{translationX:t,translationY:i}=this.getAxisTransform();return{x:t,y:i}}getLayoutState(){return{...super.getLayoutState(),position:this.position}}updatePosition(){super.updatePosition();const t=this.getAxisTransform();this.tickLineGroup.datum=t,this.tickLabelGroup.datum=t,this.lineNodeGroup.datum=t,this.headingLabelGroup.datum=t}setAxisVisible(t){this.tickLineGroup.visible=t&&(this.tick.enabled||(this.primaryTick?.enabled??!1)),this.tickLabelGroup.visible=t&&(this.label.enabled||(this.primaryTick?.enabled??!1)),this.lineNodeGroup.visible=t,this.headingLabelGroup.visible=t}getAxisLineCoordinates(){const{horizontal:t}=this,[i,s]=kt(this.lineRange??this.range);return t?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(t,i){const{translation:s}=t,{position:n,primaryTick:o}=this;let a=this.getTickSize();o?.enabled&&(a=Math.max(a,this.getTickSize(o)));const r=n==="bottom"||n==="right"?-1:1,l=this.getTickSpacing(this.tick),c=-r*(i+l),h=c,d=c-r*(a+l),u=Math.min(h,d),p=Math.max(h,d);switch(n){case"top":return new re(s,u,0,p-u);case"bottom":return new re(s,u,0,p-u);case"left":return new re(u,s,p-u,0);case"right":return new re(u,s,p-u,0)}}lineNodeBBox(){const{position:t,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),o=n-s;switch(t){case"top":return new re(s,-i,o,i);case"bottom":return new re(s,0,o,i);case"left":return new re(-i,s,i,o);case"right":return new re(0,s,i,o)}}titleBBox(t,i){const{tempCaption:s}=this,n=Math.abs(this.range[1]-this.range[0])||1/0;return s.node.setProperties(this.titleProps(s,t,i)),s.computeTextWrap(n,this.thickness??1/0),s.node.getBBox()}getScrollbarThickness(t){return t?.enabled&&t.placement==="inner"?t.spacing+t.thickness:0}resolveScrollbarLayout(t,i){if(!t)return;const{position:s}=this,n=s==="top"||s==="left"?-1:1;if(t.placement==="inner"){const a=n===1?t.spacing:-t.spacing-t.thickness;return{...t,offset:a}}const o=n===1?i+t.spacing:-i-t.spacing-t.thickness;return{...t,offset:o}}applyScrollbarLayout(t,i,s){const n=this.resolveScrollbarLayout(s,i);let o=i;if(n){const{offset:a,thickness:r,placement:l}=n;l==="outer"&&(o+=n.spacing+r),this.horizontal?t.push(new re(0,a,0,r)):t.push(new re(a,0,r,0))}return{spacing:o,scrollbarLayout:n}}measureAxisLayout(t,i,s,n,o){const{tick:a,primaryTick:r,label:l,primaryLabel:c,title:h,position:d,horizontal:u,seriesAreaPadding:p}=this,f=[];if(f.push(this.lineNodeBBox()),a.enabled||r?.enabled)for(const D of i)f.push(this.getTickLineBBox(D,o));const{tempText:y}=this;if(l.enabled)for(const D of s){if(!D.visible)continue;y.setProperties(D);const I=y.getBBox();I&&f.push(I)}if(c?.enabled&&d==="bottom"&&(f.push(new re(0,Fn(l.fontSize)+2,1,this.getTickSize(a)+this.getTickSpacing(a)+l.spacing+p)),c.format!=null)){const{format:I}=c,A=(Ge(I)?Object.values(I):[I]).reduce((w,C)=>Math.max(w,I0(C)),0);f.push(new re(0,this.getTickSize(r??a)+this.getTickSpacing(r??a)+c.spacing+p,1,A*Fn(c.fontSize)+2))}const x=re.merge(f),b=u?x.height:x.width,{spacing:v,scrollbarLayout:S}=this.applyScrollbarLayout(f,b,n);return this.layout.labelThickness=b,this.layout.scrollbar=S,h.enabled&&f.push(this.titleBBox(t,v)),{bbox:re.merge(f),spacing:v}}titleProps(t,i,s){const{title:n}=this;if(!n.enabled)return t.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};t.enabled=!0,t.color=n.color,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.fontWeight=n.fontWeight,t.wrapping=n.wrapping,t.truncate=n.truncate,t.maxWidth=n.maxWidth,t.maxHeight=n.maxHeight;const{range:o}=this,a=(o[0]+o[1])/2,r=n.spacing+s;let l,c,h,d;switch(this.position){case"top":l=a,c=-r,h=0,d="bottom";break;case"bottom":l=a,c=r,h=0,d="top";break;case"left":l=-r,c=a,h=Math.PI/-2,d="bottom";break;case"right":l=r,c=a,h=Math.PI/2,d="bottom";break}const{formatter:u=f=>f.defaultValue}=n,p=this.cachedCallWithContext(u,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:d,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(t,i,s){const{horizontal:n,primaryLabel:o,primaryTick:a,seriesAreaPadding:r,scale:l}=this,{tickId:c,tickLabel:h="",translation:d,isPrimary:u,textUntruncated:p}=t,f=u&&o?.enabled?o:this.label,y=u&&a?.enabled?a:this.tick,{rotation:x,textBaseline:b,textAlign:v}=i,{range:S}=l,M=this.label.getSideFlag(),D=_u(f)[this.position];let I=M*(this.getTickSize(y)+this.getTickSpacing(y)+f.spacing+r)-D;s&&(I+=M*s);const k=h!=="",A=n?d:I,w=n?-I:d;return{...this.getLabelStyles({value:t.tick,formattedValue:h},void 0,f),tickId:c,rotation:x,text:h,textAlign:v,textBaseline:b,textUntruncated:p,visible:k,x:A,y:w,rotationCenterX:A,rotationCenterY:w,range:S}}updateSelections(){if(!this.tickLayout)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,gridFills:n,labels:o}=this.tickLayout,a=r=>r.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,a),this.gridFillGroupSelection.update(this.gridLine.enabled?n:[],void 0,a),this.tickLineGroupSelection.update(i,void 0,a),this.tickLabelGroupSelection.update(o,void 0,a)}updateGridLines(){this.gridLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateGridFills(){this.gridFillGroupSelection.each((t,i)=>{t.fill=i.fill,t.fillOpacity=i.fillOpacity??1})}updateTickLines(){this.tickLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTitle(t,i){const{caption:s}=this.title,n=this.titleProps(s,t,i);if(s.node.visible=n.visible,s.node.text=n.text,s.node.textBaseline=n.textBaseline,s.node.datum=n,n.visible){const o=Math.abs(this.range[1]-this.range[0])||1/0;s.computeTextWrap(o,this.thickness??1/0)}}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.pointerEvents=i.textUntruncated==null?1:0,t.setFont(i),t.setBoxing(i)})}animateReadyUpdate(t){const{animationManager:i}=this.moduleCtx,s=aK(this),n=cK(s);mi(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),mi(this.id,"line",i,[this.lineNode],n.line),mi(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(o,a)=>a.tickId,t),mi(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(o,a)=>a.tickId,t),mi(this.id,"title",i,[this.title.caption.node],n.label,(o,a)=>a.tickId,t)}resetSelectionNodes(){qi([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],hK()),qi([this.gridLineGroupSelection,this.tickLineGroupSelection],nO()),qi([this.gridFillGroupSelection],dK()),qi([this.tickLabelGroupSelection],mb()),qi([this.title.caption.node],mb()),qi([this.lineNode],nO())}};g([m],Mf.prototype,"thickness",2),g([m],Mf.prototype,"maxThicknessRatio",2),g([m],Mf.prototype,"position",2),g([m],Mf.prototype,"crossAt",2);var Df=Mf,bO=["right","top","left","bottom"];function FK(e){return typeof e=="string"&&bO.includes(e)}function _K(e){const t=[],i=[],s=[...bO];for(const n of e)n instanceof Df&&(FK(n.position)?i.push(n.position):t.push(n));for(const n of t){let o;do o=s.pop();while(o&&i.includes(o));if(o==null)break;n.position=o}}var vO=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function HK(e,t,i){const s=new Map,n=d=>{if(d===void 0)return vO;if(s.has(d))return s.get(d);const u=ye.getSeriesModule(d)?.matchingKeys??vO;return s.set(d,u),u},o=(d,u,p)=>{const f=n(d),y=[d];for(const x of f)x in u&&u[x]!=null&&y.push(`${x}=${u[x]}`);return p?.seriesGrouping&&y.push(`seriesGrouping.groupId=${p?.seriesGrouping.groupId}`),y.join(";")},a=new Map;let r=0;for(const d of e){const u=o(d.type,d.properties,i?.[r]);a.has(u)||a.set(u,[]),a.get(u)?.push([d,r++])}const l=new Map;r=0;for(const d of t){const u=o(d.type,d,d);l.has(u)||l.set(u,[]),l.get(u)?.push([d,r++])}if(![...a.keys()].some(d=>l.has(d)))return{status:"no-overlap",oldKeys:a.keys(),newKeys:l.keys()};const h=[];for(const[d,u]of l.entries())for(const[p,f]of u){const y=a.get(d);if(y==null||y.length<1){h.push({opts:p,targetIdx:f,idx:f,status:"add"}),a.delete(d);continue}const[x,b]=y.shift(),v=i?.[b]??{},S=Kn(v,p??{}),{groupIndex:M,stackIndex:D}=S?.seriesGrouping??{};M!=null||D!=null?h.push({opts:p,series:x,diff:S,targetIdx:f,idx:b,status:"series-grouping"}):S?h.push({opts:p,series:x,diff:S,targetIdx:f,idx:b,status:"update"}):h.push({opts:p,series:x,targetIdx:f,idx:b,status:"no-op"}),y.length===0&&a.delete(d)}for(const d of a.values())for(const[u,p]of d)h.push({series:u,idx:p,targetIdx:-1,status:"remove"});return{status:"overlap",changes:h}}var nc=new Map([{type:"chart",name:"cartesian",moduleId:"CartesianChartModule"},{type:"chart",name:"standalone",moduleId:"StandaloneChartModule",enterprise:!0},{type:"chart",name:"polar",moduleId:"PolarChartModule"},{type:"chart",name:"topology",moduleId:"TopologyChartModule",enterprise:!0},{type:"axis",name:"number",chartType:"cartesian",moduleId:"NumberAxisModule"},{type:"axis",name:"log",chartType:"cartesian",moduleId:"LogAxisModule"},{type:"axis",name:"time",chartType:"cartesian",moduleId:"TimeAxisModule"},{type:"axis",name:"unit-time",chartType:"cartesian",moduleId:"UnitTimeAxisModule"},{type:"axis",name:"category",chartType:"cartesian",moduleId:"CategoryAxisModule"},{type:"axis",name:"grouped-category",chartType:"cartesian",moduleId:"GroupedCategoryAxisModule"},{type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,moduleId:"OrdinalTimeAxisModule"},{type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,moduleId:"AngleCategoryAxisModule"},{type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,moduleId:"AngleNumberAxisModule"},{type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,moduleId:"RadiusCategoryAxisModule"},{type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,moduleId:"RadiusNumberAxisModule"},{type:"series",name:"bar",chartType:"cartesian",moduleId:"BarSeriesModule"},{type:"series",name:"scatter",chartType:"cartesian",moduleId:"ScatterSeriesModule"},{type:"series",name:"bubble",chartType:"cartesian",moduleId:"BubbleSeriesModule"},{type:"series",name:"line",chartType:"cartesian",moduleId:"LineSeriesModule"},{type:"series",name:"area",chartType:"cartesian",moduleId:"AreaSeriesModule"},{type:"series",name:"pie",chartType:"polar",moduleId:"PieSeriesModule"},{type:"series",name:"donut",chartType:"polar",moduleId:"DonutSeriesModule"},{type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,moduleId:"BoxPlotSeriesModule"},{type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,moduleId:"CandlestickSeriesModule"},{type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,moduleId:"ConeFunnelSeriesModule"},{type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,moduleId:"FunnelSeriesModule"},{type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,moduleId:"OhlcSeriesModule"},{type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,moduleId:"HeatmapSeriesModule"},{type:"series",name:"histogram",chartType:"cartesian",moduleId:"HistogramSeriesModule"},{type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,moduleId:"RangeAreaSeriesModule"},{type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,moduleId:"RangeBarSeriesModule"},{type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,moduleId:"WaterfallSeriesModule"},{type:"series",name:"nightingale",chartType:"polar",enterprise:!0,moduleId:"NightingaleSeriesModule"},{type:"series",name:"radar-area",chartType:"polar",enterprise:!0,moduleId:"RadarAreaSeriesModule"},{type:"series",name:"radar-line",chartType:"polar",enterprise:!0,moduleId:"RadarLineSeriesModule"},{type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,moduleId:"RadialBarSeriesModule"},{type:"series",name:"radial-column",chartType:"polar",enterprise:!0,moduleId:"RadialColumnSeriesModule"},{type:"series",name:"map-shape",chartType:"topology",enterprise:!0,moduleId:"MapShapeSeriesModule"},{type:"series",name:"map-line",chartType:"topology",enterprise:!0,moduleId:"MapLineSeriesModule"},{type:"series",name:"map-marker",chartType:"topology",enterprise:!0,moduleId:"MapMarkerSeriesModule"},{type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,moduleId:"MapShapeBackgroundSeriesModule"},{type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,moduleId:"MapLineBackgroundSeriesModule"},{type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,moduleId:"PyramidSeriesModule"},{type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,moduleId:"LinearGaugeModule"},{type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,moduleId:"RadialGaugeModule"},{type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,moduleId:"SunburstSeriesModule"},{type:"series",name:"treemap",chartType:"standalone",enterprise:!0,moduleId:"TreemapSeriesModule"},{type:"series",name:"chord",chartType:"standalone",enterprise:!0,moduleId:"ChordSeriesModule"},{type:"series",name:"sankey",chartType:"standalone",enterprise:!0,moduleId:"SankeySeriesModule"},{type:"plugin",name:"animation",enterprise:!0,moduleId:"AnimationModule"},{type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,moduleId:"AnnotationsModule"},{type:"plugin",name:"legend",moduleId:"LegendModule"},{type:"plugin",name:"locale",moduleId:"LocaleModule"},{type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,moduleId:"ChartToolbarModule"},{type:"plugin",name:"contextMenu",enterprise:!0,moduleId:"ContextMenuModule"},{type:"plugin",name:"statusBar",chartType:"cartesian",enterprise:!0,moduleId:"StatusBarModule"},{type:"plugin",name:"dataSource",enterprise:!0,moduleId:"DataSourceModule"},{type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,moduleId:"SyncModule"},{type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,moduleId:"RangesModule"},{type:"plugin",name:"zoom",enterprise:!0,moduleId:"ZoomModule"},{type:"plugin",name:"flashOnUpdate",enterprise:!0,moduleId:"FlashOnUpdateModule"},{type:"plugin",name:"gradientLegend",enterprise:!0,moduleId:"GradientLegendModule"},{type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,moduleId:"NavigatorModule"},{type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,moduleId:"ScrollbarModule"},{type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,moduleId:"CrosshairModule"},{type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",enterprise:!0,moduleId:"BandHighlightModule"},{type:"series:plugin",name:"errorBar",chartType:"cartesian",enterprise:!0,moduleId:"ErrorBarsModule"},{type:"preset",name:"gauge-preset",chartType:"standalone",enterprise:!0,moduleId:"GaugePresetModule"},{type:"preset",name:"price-volume",chartType:"cartesian",enterprise:!0,moduleId:"PriceVolumePresetModule"},{type:"preset",name:"sparkline",moduleId:"SparklinePresetModule"}].map(e=>[e.name,e]));function GK(e){const t=nc.get(e);return t?.type==="series"?t.chartType:void 0}function If(e){const t=e.series?.[0]?.type??"line";return ye.getSeriesModule(t)?.chartType??GK(t)??"unknown"}function jK(e){return If(e)==="cartesian"}var WK=class extends bI{*legends(){for(const e of ye.listModulesByType("plugin"))(e.name==="legend"||e.name==="gradientLegend")&&(yield{legendType:e.name==="legend"?"category":"gradient",legend:this.getModule(e.name)})}},kI="ag-charts-overlay",$K="ag-charts-dark-overlay",Ah=class extends q{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return Ae(this.text)?Oe(this.text):this.rendererAsText?this.rendererAsText:e.t(Dt(this.text)||this.defaultMessageId)}getElement(e,t,i,s){if(this.content?.remove(),this.rendererAsText=void 0,this.focusBox=s,this.renderer){const n={},o=ls(e,this.renderer,n);if(Ad(o))this.content=o;else{const a=ke("div");a.innerHTML=o;const{firstElementChild:r}=a;Ad(r)&&a.childElementCount===1?this.content=r:this.content=a}this.rendererAsText=this.content?.textContent?.trim()}else{const n=ke("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});if(Ae(this.text)){const o=ke("div");for(const a of this.text){const r=ke("span",{color:a.color,fontSize:`${a.fontSize}px`,fontFamily:a.fontFamily??"inherit",fontWeight:String(a.fontWeight),fontStyle:a.fontStyle});r.innerText=Dt(a.text),o.appendChild(r)}n.appendChild(o)}else n.innerText=this.getText(i);this.content=n,this.content.classList.add(this.className),t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(o){n.style.opacity=String(o)},onStop(){n.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};g([m],Ah.prototype,"enabled",2),g([m],Ah.prototype,"text",2),g([m],Ah.prototype,"renderer",2);var ju=class extends q{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Ah("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Ah("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Ah("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Ah("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(t.focusBox!==void 0)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};g([m],ju.prototype,"darkTheme",2),g([m],ju.prototype,"loading",2),g([m],ju.prototype,"noData",2),g([m],ju.prototype,"noVisibleSeries",2),g([m],ju.prototype,"unsupportedBrowser",2);function KK(e,t,i){const{animationDuration:s}=pf.add,n=s*i,o=e.createElement("div",`${kI}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${n}ms linear 50ms both`}),a=e.createElement("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),r=e.createElement("p",{marginTop:"1em"});r.innerText=t;const l=e.createElement("div",`${kI}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),c=e.createElement("style");return c.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),o.replaceChildren(c,a,r,l),o}var kf=class extends q{constructor(e){super(),this.ctx=e,this.rectNode=new Ci,this.border=new Pr(this.rectNode),this.cornerRadius=0,this.padding=0,this.cleanup=new ot,this.node=this.createNode(),this.node.append([this.rectNode]),this.rectNode.fill=void 0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}destroy(){this.cleanup.flush()}getPadding(){const{border:e,padding:t}=this,i=e.enabled?e.strokeWidth:0;if(typeof t=="number"){const s=t+i;return{top:s,right:s,bottom:s,left:s}}return{top:(t.top??0)+i,right:(t.right??0)+i,bottom:(t.bottom??0)+i,left:(t.left??0)+i}}createNode(){return new Le({name:"series-area-container",zIndex:4})}onLayoutComplete(e){const{x:t,y:i,width:s,height:n}=e.series.paddedRect;this.rectNode.x=t,this.rectNode.y=i,this.rectNode.width=s,this.rectNode.height=n}};g([m],kf.prototype,"border",2),g([m],kf.prototype,"clip",2),g([St("rectNode","cornerRadius"),m],kf.prototype,"cornerRadius",2),g([m],kf.prototype,"padding",2);function xb(e,t){if(e.itemId!==void 0)return e.itemId;if(t!==void 0){const i=e.datum?.[t];if(i!=null)return typeof i=="number"?i:String(i)}return typeof e.datumIndex=="number"?e.datumIndex:JSON.stringify(e.datumIndex)}function AI(e,t){return e.series===t.series&&Ht(e.datumIndex,t.datumIndex)}function UK(e,t){return t==null?-1:e.findIndex(i=>AI(i,t))}var YK=class{constructor(e,t){this.activeManager=e,this.tooltipProperties=t,this.candidates=[],this.blockEntrance=!1,this.activationPrevented=!1}clear(){this.candidates.length=0,this.pendingPickedNodes=void 0}popPendingPickedNodes(){const e=this.pendingPickedNodes;return this.pendingPickedNodes=void 0,e}getActivationArgs(e){if(e===void 0)return[void 0,void 0];{const t=e.series.id,i=xb(e,e.series.data?.dataIdKey);return[{type:"series-node",seriesId:t,itemId:i},e]}}maybeActivate(e,t,i){if(this.blockEntrance)throw new Error("PickManager.maybeActivate is not re-entrant");try{this.activationPrevented=!1,this.blockEntrance=!0;const[s,n]=this.getActivationArgs(e);this.activeManager.update(s,n)?this.activationPrevented=!0:(this.active=e,t(i?.defaultCbArg))}finally{this.blockEntrance=!1}}onClearUI(){this.activeManager.clear(),this.clear()}onClearAPI(){this.clear()}onPickedNodesHighlight(e){if(e!==void 0){const i=this.active;if(this.tooltipProperties.pagination&&i!==void 0){const s=e.matches.find(n=>AI(n,i));if(s)return s}}return e?.matches[0]}onPickedNodesTooltip(e){if(e!==void 0&&this.tooltipProperties.pagination){const i=this.active,s=e.matches;this.candidates=s;let n=UK(s,i);n===-1&&(n=0);const o=s[n],a={index:n,length:s.length};return{active:o,paginationState:a}}return{active:e?.matches[0]}}onPickedNodesAPI(e){return this.pendingPickedNodes=e,e.matches[0]}onPickedNodesAPIDebounced(){return{active:this.onPickedNodesHighlight(this.popPendingPickedNodes())}}nextCandidate(){if(this.tooltipProperties.pagination){const{candidates:e}=this,t=this.active,i=t==null?-1:e.findIndex(a=>AI(a,t));if(i===-1)return{active:void 0,paginationState:void 0};let s=i+1;s>=e.length&&(s=0);const n=e[s],o={index:s,length:this.candidates.length};return{active:n,paginationState:o}}return{active:this.active}}wasActivationPrevented(){return this.activationPrevented}};function SO(e,t,i,s){if(qt(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse,colorSpace:e.colorSpace??t.colorSpace};if(Un(e)){const n=e.pattern??i.pattern;let o=e.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?o??(o=i.strokeWidth):o??(o=0);const a=e.width??e.height??i.width,r=e.height??e.width??i.height;return{type:"pattern",pattern:n,width:a,height:r,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:o,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return ea(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function wI(e,t,i,s){return!qt(e?.fill)&&!Un(e?.fill)&&!ea(e?.fill)?e:{...e,fill:SO(e.fill,t,i,s)}}var MO=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(MO||{}),ZK=.25,XK=.125,bb=class{constructor(e,t,i,s){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id,this.dataIdKey=s.data?.dataIdKey,this.itemId=xb(i,this.dataIdKey)}preventDefault(){this.defaultPrevented=!0}},CI=class{constructor(e,t){this.series=e,this.seriesGrouping=t,this.type="groupingChanged"}};function DO(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function LI(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius";default:return"x"}}var Af=class extends _T{constructor(e){super(),this.cleanup=new ot,this.usesPlacedLabels=!1,this.alwaysClip=!1,this.hasChangesOnHighlight=!1,this.seriesGrouping=void 0,this.NodeEvent=bb,this.internalId=gi(this),this.contentGroup=new ds({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new ds({name:`${this.internalId}-highlight`,zIndex:1}),this.highlightNodeGroup=this.highlightGroup.appendChild(new Le({name:`${this.internalId}-highlight-node`})),this.highlightLabelGroup=this.highlightGroup.appendChild(new Le({name:`${this.internalId}-highlight-label`,zIndex:2})),this.annotationGroup=new ds({name:`${this.internalId}-annotation`}),this.labelGroup=new ds({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this.moduleMap=new bI,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this.declarationOrder=-1,this._broughtToFront=!1,this.events=new zn,this._pickNodeCache=new og(5),this.fireEventWrapper=l=>super.fireEvent(l);const{moduleCtx:t,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:o=!1,usesPlacedLabels:a=!1,alwaysClip:r=!1}=e;this.ctx=t,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=o,this.usesPlacedLabels=a,this.pickModes=i,this.alwaysClip=r,this.highlightLabelGroup.pointerEvents=1,this.cleanup.register(this.ctx.eventsHub.on("data:update",l=>this.setChartData(l)),this.ctx.eventsHub.on("highlight:change",l=>this.onChangeHighlight(l)))}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){const e=this.data;return e==null?!1:e.netSize()>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this.processedDataUpdated=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}isHighlightEnabled(){return this.properties.highlight.enabled}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:n}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0}),this.fireEvent(new CI(this,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){this.contentGroup.remove(),this.highlightGroup.remove(),this.labelGroup.remove(),this.annotationGroup.remove()}setSeriesIndex(e,t=!1){const i=this.bringToFront();return!t&&e===this.declarationOrder&&i===this._broughtToFront?!1:(this.declarationOrder=e,this._broughtToFront=i,this.setZIndex(i?Number.MAX_VALUE:e),this.fireEvent(new CI(this,this.seriesGrouping)),!0)}setZIndex(e){this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e}renderToOffscreenCanvas(){return!1}hasHighlightOpacity(){if(!this.properties.highlight.enabled)return!1;const e=this.ctx.highlightManager.getActiveHighlight();if(e==null||e.series?.isHighlightEnabled()===!1)return!1;const{unhighlightedItem:t,unhighlightedSeries:i}=this.properties.highlight;return uI(t)||uI(i)}getDrawingMode(e,t="cutout"){return e?t:this.hasHighlightOpacity()?this.ctx.chartService.highlight?.drawingMode??"overlay":"overlay"}getAnimationDrawingModes(){const e=this.getDrawingMode(!1);return{start:{drawingMode:"overlay"},finish:{drawingMode:e}}}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,t){const i=DO(e),s=i==null?e:LI(this.resolveKeyDirection(i)),n=t?.[s],o=[];if(!n)return o;const a=(...r)=>{for(const l of r)Array.isArray(l)?a(...l):typeof l=="object"?a(...Object.values(l)):o.push(l)};return a(...n.map(r=>this.properties[r])),o}getKeyAxis(e){}getKeys(e){return this.getPropertyValues(LI(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(LI(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),s=this.getPropertyValues(e,this.propertyNames),n=[];for(let o=0;os.getDomain(e)).flat();return i.length===0?t:{domain:t.domain.concat(i)}}getRange(e,t){return this.getSeriesRange(e,t)}getMinimumRangeSeries(e){}getMinimumRangeChart(e){return 0}getZoomRangeFittingItems(e,t,i){}getVisibleItems(e,t,i){return 1/0}toCanvasFromMidPoint(e){const{x:t=0,y:i=0}=e.midPoint??{};return zt.toCanvasPoint(this.contentGroup,t,i)}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){const{internalId:e,seriesGrouping:t,type:i,visible:s}=this;this.ctx.seriesStateManager.updateSeries({internalId:e,type:i,visible:s,seriesGrouping:t,width:"width"in this.properties?this.properties.width:0})}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:t=1}=this.getHighlightStyle();return t}getHighlightState(e,t,i,s){return this.properties.highlight.enabled?t?1:e?.series==null||e.series.isHighlightEnabled()===!1?0:this.isSeriesHighlighted(e,s)?this.isItemHighlighted(e,i)==null?2:4:3:0}getHighlightStateString(e,t,i,s){return Fu(this.getHighlightState(e,t,i,s))}onChangeHighlight(e){const t=e.previousHighlight,i=e.currentHighlight,s=this.getHighlightState(i),n=this.getHighlightState(t);this.setSeriesIndex(this.declarationOrder);const o=this.hasItemStylers();if(!o&&s===n){this.hasChangesOnHighlight=!1;return}const{highlightedSeries:a,unhighlightedItem:r,unhighlightedSeries:l}=this.properties.highlight;this.hasChangesOnHighlight=o||!Td(a)||!Td(r)||!Td(l)}bringToFront(){return this.properties.highlight.enabled&&this.properties.highlight.bringToFront&&this.isSeriesHighlighted(this.ctx.highlightManager.getActiveHighlight())}isSeriesHighlighted(e,t){return this.properties.highlight.enabled?e?.series===this:!1}isItemHighlighted(e,t){if(!(e?.datumIndex==null||t==null))return e.datumIndex===t}getHighlightStyle(e,t,i,s){const n=this.ctx.highlightManager?.getActiveHighlight();return i??(i=this.getHighlightState(n,e,t,s)),this.properties.highlight.getStyle(i)}resolveMarkerDrawingModeForState(e,t){return w$(e,t)}filterItemStylerFillParams(e){return qt(e)?ee(e,["bounds","colorSpace","gradient","reverse"]):Un(e)?ee(e,["padding"]):e}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:s,pickModeAxis:n,visible:o,contentGroup:a}=this;if(!o||!a.visible)return;let r=1/0;if(t==="tooltip"||t==="highlight-tooltip"){const{tooltip:u}=this.properties;r=typeof u.range=="number"?u.range:1/0,i||(i=u.range==="exact")}else if(t==="event"||t==="context-menu"){const{nodeClickRange:u}=this.properties;r=typeof u=="number"?u:1/0,i||(i=u==="exact")}const l=s.filter(u=>!i||u===0),{x:c,y:h}=e,d=JSON.stringify({x:c,y:h,maxDistance:r,selectedPickModes:l});if(this._pickNodeCache.has(d))return this._pickNodeCache.get(d);for(const u of l){let p;switch(u){case 0:{const f=this.pickNodesExactShape(e);p=f.length===0?void 0:{datums:f,distance:0};break}case 1:{const f=this.pickNodeClosestDatum(e),y=f?.distance===0?this.pickNodesExactShape(e):void 0;y!=null&&y.length!==0?p={datums:y,distance:0}:f?p={datums:[f.datum],distance:f.distance}:p=void 0;break}case 2:{const f=n==null?void 0:this.pickNodeMainAxisFirst(e,n==="main-category");p=f==null?void 0:{datums:[f.datum],distance:f.distance};break}}if(p&&p.distance<=r)return this._pickNodeCache.set(d,{pickMode:u,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(d,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const s=i.closestDatum();typeof s=="object"&&s!=null&&s.missing!==!0&&t.push(s)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=hu(e.x,e.y,t),s=i.nearest?.closestDatum();if(typeof s=="object"&&s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireEvent(e){ls([this.properties,this.ctx.chartService],this.fireEventWrapper,e)}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:s,legendItemName:n}=t??{};this.toggleSeriesItem(i,e,s,n)}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendType:n}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,r=o!=null&&o===e.legendItemName;(s.id===this.id||r||a!=null)&&this.toggleSeriesItem(t,n,i,o,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:n,legendType:o}=e,a="legendItemName"in this.properties?this.properties.legendItemName:void 0,r="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=a!=null&&a===e.legendItemName;s.id===this.id||l||r!=null?this.toggleSeriesItem(!0,o,i,a,e):t&&n===1?this.toggleSeriesItem(!0,o,void 0,a):this.toggleSeriesItem(!1,o,void 0,a)}toggleSeriesItem(e,t,i,s,n){const o=this.id;(e||t!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const a={type:"seriesVisibilityChange",seriesId:o,itemId:i,legendItemName:n?.legendItemName??s,visible:e};this.fireEvent(a),this.ctx.legendManager.toggleItem(e,o,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getAxisValueText(e,t,i,s,n,o,a){const{id:r,properties:l}=this;return e.formatDatum(l,i,t,r,o,s,n,void 0,void 0,void 0,a)}getLabelText(e,t,i,s,n,o,a,r=!1){if(e==null&&!r)return"";const{axes:l,canHaveAxes:c,ctx:h,id:d,properties:u}=this,p="series-label",f="legendItemName"in u?u.legendItemName:void 0,y={seriesId:this.id,...a},x=c?DO(s):void 0,b=x==null?void 0:l[this.resolveKeyDirection(x)];if(b!=null)return b.formatDatum(u,e,p,d,f,t,i,n,o,y,r);const{formatManager:v}=h,S=this.callWithContext.bind(this),M=I=>o.formatValue(S,I.type,I.value,y)??v.format(S,I)??(e==null?"":String(e)),D=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return M({type:"number",value:e,datum:t,seriesId:d,legendItemName:f,key:i,source:p,property:s,domain:n,boundSeries:D,fractionDigits:void 0,visibleDomain:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return M({type:"category",value:e,datum:t,seriesId:d,legendItemName:f,key:i,source:p,property:s,domain:n,boundSeries:D})}}getMarkerStyle(e,{datumIndex:t,datum:i,point:s},n,o,a={size:s?.size??e.size??0},r){const{itemStyler:l}=e,{highlightState:c,isHighlight:h=!1,checkForHighlight:d=!0,resolveMarkerSubPath:u=["marker"],resolveStyler:p=!1}=o??{},f=["series",`${this.declarationOrder}`,...u];if(p){const v={permissivePath:!0},S=this.ctx.optionsGraphService.resolvePartial(f,a,v);S&&(a={...S,size:S.size??a.size})}const y=d?this.getHighlightStyle(h,t,c):void 0;let b=ce(y,a,e.getStyle(),r);if(l&&n){const v=this.ctx.highlightManager?.getActiveHighlight(),S=this.getHighlightStateString(v,h,t),M=this.filterItemStylerFillParams(b.fill),D=this.cachedCallWithContext(l,{seriesId:this.id,...b,fill:M,...n,highlightState:S,datum:i}),I=this.ctx.optionsGraphService.resolvePartial(f,D);b=ce(I,b)}return b}applyMarkerStyle(e,t,i,s,{applyTranslation:n=!0,selected:o=!0}={}){const{shape:a,size:r=0}=e,l=this.visible&&r>0&&i&&!Number.isNaN(i.x)&&!Number.isNaN(i.y);if(t.setStyleProperties(e,s),n?t.setProperties({visible:l,shape:a,size:r,x:i?.x,y:i?.y,scalingCenterX:i?.x,scalingCenterY:i?.y}):t.setProperties({visible:l,shape:a,size:r}),o||(t.fillOpacity*=ZK,t.strokeOpacity*=XK),typeof a=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const c=t.getBBox();if(i!=null&&c.isFinite()){const h=c.computeCenter(),[d,u]=["x","y"].map(p=>(e.strokeWidth??0)+Math.abs(h[p]-i[p]));i.focusSize=Math.max(c.width+d,c.height+u)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:Number.NaN,seriesRectHeight:Number.NaN}}checkResize(e){const{width:t,height:i}=e??{width:Number.NaN,height:Number.NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,n=Kn(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(e){}pickViewportFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,s=i.get(e);if(s!=null)return s;try{const n=t();return i.set(e,n),n}catch(n){W.error(String(n))}}cachedCallWithContext(e,t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,t)}callWithContext(e,t){return ls([this.properties,this.ctx.chartService],e,t)}formatTooltipWithContext(e,t,i){return e.formatTooltip([this.properties,this.ctx.chartService],t,i)}minTimeInterval(){}needsDataModelDiff(){return!this.ctx.animationManager.isSkipped()||!!this.chart?.flashOnUpdateEnabled}};Af.className="Series",g([Ze({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],Af.prototype,"seriesGrouping",2);var qK=class{constructor(e){this.swapChain=e,this.focusVisibleStyle=!1,this.div=ke("div"),this.svg=jt("svg"),this.outerPath=jt("path"),this.innerPath=jt("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=ke("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(e,t,i){if(t!=null)if(e instanceof wi){const s=(o,a)=>{let{x:r,y:l}=zt.toCanvasPoint(e,o,a);return r-=t.x??0,l-=t.y??0,{x:r,y:l}},n=e.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(e.x-t.x,0),o=Math.max(e.y-t.y,0),a=Math.min(e.x+e.width-t.x,t.width),r=Math.min(e.y+e.height-t.y,t.height);s=new re(n,o,a-n,r-o)}else s=new re(e.x-t.x,e.y-t.y,e.width,e.height);dg(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(){return this.focusVisible??this.focusVisibleStyle}onFocus(){this.overrideFocusVisible(void 0);const e=this.element.parentElement,t=this.element.ownerDocument.defaultView;return this.focusVisibleStyle=e!=null&&t.getComputedStyle(e).opacity==="1",this.focusVisibleStyle}onBlur(){this.overrideFocusVisible(void 0),this.focusVisibleStyle=!1}},QK=class{constructor(e,t,i,s){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>(Io(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>(Io(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),Fe(this.label1,"id",Rr()),Fe(this.label2,"id",Rr()),Io(this.label1,"display","none"),Io(this.label2,"display","none"),this.label1.textContent=s,this.label2.textContent=s,this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),Fe(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap(s)}createAnnouncer(e){const t=ke("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),e==="swap"&&t(this.activeAnnouncer)}dispatch(e,t){e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1);for(const i of this.listeners[e])i(t)}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],Do(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Do(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},JK={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},home:{bindings:[{code:"Home"}]},end:{bindings:[{code:"End"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1},panxleft:{bindings:[{key:"PageUp"},{code:"PageUp"}],activatesFocusIndicator:!0},panxright:{bindings:[{key:"PageDown"},{code:"PageDown"}],activatesFocusIndicator:!0}};function eU(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(i.key===e.key&&(i.shift===void 0||i.shift===e.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===e.ctrlKey||i.ctrlOrMeta===e.metaKey))return!0;return!1}function tU(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of rt(JK))if(eU(e,s))return{name:t,activatesFocusIndicator:i}}function iU(e,t,i){const s=hI(e,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof re){const{x:o,y:a}=n.computeCenter();return{x:t.x+o,y:t.y+a}}return zt.toCanvas(n).computeCenter()}}function NI({bounds:e}){return e instanceof re?e:e!=null?zt.toCanvas(e):re.NaN}function sU(e,t,i){const{x:s,y:n}=iU(e,t,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}var IO=.1,kO=200,AO=12,nU=.5,oU=class{constructor(e){this.agDocument=e,this.events=new zn,this.x1=Number.NaN,this.y1=Number.NaN,this.x=Number.NaN,this.y=Number.NaN,this.vx=0,this.vy=0,this.t0=Number.NaN,this.animationFrameHandle=void 0}reset(){this.x=Number.NaN,this.y=Number.NaN,this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(this.agDocument.cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle??(this.animationFrameHandle=this.agDocument.requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const o=.001,a=Math.trunc(Math.ceil(n/(o*1e3)));let{x:r,y:l,vx:c,vy:h}=this;for(let d=0;d"))}function wf(e,t){const{path:i,size:s}=e,{x:n,y:o}=e;i.clear();let a=!1;for(const[r,l]of t){const c=n+(r-.5)*s,h=o+(l-.5)*s;a?i.lineTo(c,h):i.moveTo(c,h),a=!0}i.closePath()}var aU={circle({path:e,x:t,y:i,size:s}){const n=s/2;e.arc(t,i,n,0,Math.PI*2),e.closePath()},cross(e){wf(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){wf(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const n=s/4;i=i+n/2,e.arc(t-n,i-n,n,lt(130),lt(330)),e.arc(t+n,i-n,n,lt(220),lt(50)),e.lineTo(t,i+n),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.891-.5)*s,i+(.391-.5)*s),e.cubicCurveTo(t+(.891-.5)*s,i+(.606-.5)*s,t+(.5-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.5-.5)*s,i+(1-.5)*s,t+(.109-.5)*s,i+(.606-.5)*s,t+(.109-.5)*s,i+(.391-.5)*s),e.cubicCurveTo(t+(.109-.5)*s,i+(.175-.5)*s,t+(.284-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.716-.5)*s,i+(0-.5)*s,t+(.891-.5)*s,i+(.175-.5)*s,t+(.891-.5)*s,i+(.391-.5)*s),e.closePath()},plus(e){wf(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:s,pixelRatio:n}){const o=s/2;e.moveTo(Fi(n,t-o),Fi(n,i-o)),e.lineTo(Fi(n,t+o),Fi(n,i-o)),e.lineTo(Fi(n,t+o),Fi(n,i+o)),e.lineTo(Fi(n,t-o),Fi(n,i+o)),e.closePath()},star({path:e,x:t,y:i,size:s}){const o=s/2,a=o/2,r=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?o:a,h=l*Math.PI/5-r,d=t+Math.cos(h)*c,u=i+Math.sin(h)*c;e.lineTo(d,u)}e.closePath()},triangle(e){wf(e,[[.5,0],[1,.87],[0,.87]])}},Cf=class extends wi{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(e,t){return this.distanceSquared(e,t)<=0}get midPoint(){return{x:this.x,y:this.y}}distanceSquared(e,t){const i=Ni.anchor(this.shape),s=e-this.x+(i.x-.5)*this.size,n=t-this.y+(i.y-.5)*this.size,o=this.size/2;return Math.max(s*s+n*n-o*o,0)}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,o=this.layerManager?.canvas?.pixelRatio??1,a=Ni.anchor(t),r={path:e,x:i-(a.x-.5)*n,y:s-(a.y-.5)*n,size:n,pixelRatio:o};e.clear(),typeof t=="string"?aU[t](r):typeof t=="function"&&t(r)}computeBBox(){const{x:e,y:t,size:i}=this,s=Ni.anchor(this.shape);return new re(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};g([Au({equals:ph})],Cf.prototype,"shape",2),g([Ee()],Cf.prototype,"x",2),g([Ee()],Cf.prototype,"y",2),g([Ee({convertor:Math.abs})],Cf.prototype,"size",2);var Ni=class extends Lu(jx(Nu(Cf))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}resetAnimationProperties(e,t,i,s,n,o){this.__x=e,this.__y=t,this.__size=i,this.__opacity=s,this.resetScalingProperties(n,o,e,t),this.dirtyPath=!0,this.markDirty()}};function rU(e,t,i=t*(5/3)){const s=new Le,n=Math.min(e.marker.strokeWidth??1,2),o=e.line?.enabled?Math.min(e.line.strokeWidth,2):0,a=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),r=Math.max(e.marker.enabled===!1?0:t,o);if(e.line?.enabled){const{stroke:l,strokeOpacity:c,lineDash:h}=e.line,d=new Xn;d.x1=0,d.y1=r/2,d.x2=a,d.y2=r/2,d.stroke=l,d.strokeOpacity=c,d.strokeWidth=o,d.lineDash=h,s.append(d)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:d,strokeOpacity:u,lineDash:p,lineDashOffset:f}=e.marker,y=new Ni;y.shape=l??"square",y.size=t,y.fill=c,y.fillOpacity=h??1,y.stroke=d,y.strokeOpacity=u??1,y.strokeWidth=n,y.lineDash=p,y.lineDashOffset=f??0;const x=Ni.anchor(l),b=a/2+(x.x-.5)*t,v=r/2+(x.y-.5)*t,S=t/(t+n);y.x=b,y.y=v,y.scalingCenterX=b,y.scalingCenterY=v,y.scalingX=S,y.scalingY=S,s.append(y)}return Le.toSVG(s,a,r)}var Qi="ag-charts-tooltip",lU="ag-charts-tooltip--dark";function Ur(e){return e==null?!1:Array.isArray(e)?e.some(t=>Ur(t.text)):Dt(e).trim()!==""}function wh(e,t=!1){return e==null?!t:typeof e=="number"&&!Number.isFinite(e)}function cU(e){return e.type==="raw"||!e.data||e.data.length===0?!1:e.data.every(t=>t.missing===!0)}function wO(e){const t=[],i=new Map;for(const s of e)if(!cU(s))if(s.type==="structured"){const{heading:n}=s,o=Ur(n)?i.get(n):void 0,a={type:"structured",heading:n,items:[s]};o==null?(i.set(n,a),t.push(a)):o.items.push(s)}else t.push(s);return t}function hU(e){const t=kl().createElement("div");t.innerHTML=e;const i=t.textContent?.trim();return i??(W.warnOnce("cannot retrieve tooltip textContent (required for aria-label)"),"")}function dU(e){const t=wO(e),i=[];for(const s of t){if(s.type==="raw"){i.push(hU(s.rawHtmlString));continue}Ur(s.heading)&&i.push(Oe(s.heading));for(const n of s.items)if(Ur(n.title)&&i.push(Oe(n.title)),n.data)for(const o of n.data)o.missing!==!0&&i.push(o.label??o.fallbackLabel,Oe(o.value))}return i.filter(s=>s!=="").join("; ")}function CO(e,t,i){let s="";Ur(e)?(s+=`${Wu(e)}`,s+=" ",s+=`${Wu(t)}`):s+=`${Wu(t)}`;const n=[`${Qi}-row`];return i&&n.push(`${Qi}-row--inline`),s=`
${s}
`,s}function uU(e){let t="";if(e.data?.length&&e.data.every(o=>o.missing===!0))return t;const i=Ur(e.title),s=!i&&e.data?.length===1,n=e.symbol==null?void 0:rU(e.symbol,12);if(n!=null&&(i||e.data?.length)&&(t+=`${n}`),i&&(t+=`${Wu(e.title)}`,t+=" "),e.data)for(const o of e.data)o.missing!==!0&&(t+=CO(o.label??o.fallbackLabel,Oe(o.value),s),t+=" ");return t}function LO(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return``}function NO(e,t,i,s){const n=t.items.length===1?t.items[0]:void 0;let o,a,r;switch(i){case"compact":o=!0,a=Oe(n?.title);break;case"single":const h=Ur(t.heading);o=n!=null&&(!h||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,r=Oe(h?t.heading:n?.title);break;case"shared":o=!1}let l="";if(o&&n!=null){if(Ur(a)&&(l+=`${Wu(a)}`),n.data)for(const h of n.data)h.missing!==!0&&(l+=CO(h.label??r,Oe(h.value),!1),l+=" ")}else{Ur(t.heading)&&(l+=`${Wu(Oe(t.heading))}`,l+=" ");for(const h of t.items)l+=uU(h)}if(l.length===0)return;const c=i!=="compact"&&s!=null?LO(e,s):void 0;return c+null&&(l+=c),l=`
${l.trimEnd()}
`,l}function pU(e,t){const i=t==null?void 0:LO(e,t);return i==null?"":`
${i}
`}function gU(e,t,i,s){const n=wO(t);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return NO(e,n[0],i,s);{const o=n.map(a=>a.type==="structured"?NO(e,a,i):a.rawHtmlString);return s!=null&&o.push(pU(e,s)??""),o.join("")}}}var fU={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},mU={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},yU={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},TO={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},xU={pointer:"top",node:"top",chart:"top-left"},$u=class extends q{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};g([m],$u.prototype,"xOffset",2),g([m],$u.prototype,"yOffset",2),g([m],$u.prototype,"anchorTo",2),g([m],$u.prototype,"placement",2);var aa=class extends q{constructor(e){super(),this.agDocument=e,this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new $u,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new ot,this.springAnimation=new oU(this.agDocument),this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",()=>{this.updateTooltipPosition()}))}get interactive(){return this.enableInteraction}setup(e,t){this.elementProxy=t.addDeferredProxyChild("tooltip-container",Qi),this.elementProxy.toggleClass(Qi,!0),this.elementProxy.setProperty("position-anchor",t.anchorName),this.elementProxy.setAttr("popover","manual");const i=this.elementProxy.addResizeListener(s=>{this._elementSize=s,this.updateTooltipPosition()});return this.localeManager=e,()=>{t.removeChild("tooltip-container",Qi),this.cleanup.flush(),i()}}isVisible(){return this._visible}contains(e){return this.elementProxy?.contains(e)??!1}updateTooltipPosition(){const{elementProxy:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:o}=i,{x:a,y:r}=this.springAnimation,l=o.position?.anchorTo??"pointer";let c=o.position?.placement??xU[l];Array.isArray(c)||(c=[c]);const h=o.position?.xOffset??0,d=o.position?.yOffset??0,u=n.x,p=n.y,f=n.width-t.width-1+u,y=n.height-t.height+p;let x=0,b,v,S=!1;do{b=c[x],x+=1;const A=this.getTooltipBounds({elementSize:t,placement:b,anchorTo:l,canvasX:a,canvasY:r,yOffset:d,xOffset:h,canvasRect:s});v=yx(t.width,t.height,n,A),S=!1,TO[b]&1&&(S||(S=v.xf)),TO[b]&2&&(S||(S=v.yy))}while(x{(r.relatedTarget==null||lg(r.relatedTarget)&&!this.contains(r.relatedTarget))&&this.popInteractiveLeaveCallback()}},o.addEventListener("focusout",this.interactiveLeave.listener),o.addEventListener("mouseout",this.interactiveLeave.listener)),a}popInteractiveLeaveCallback(){const{interactiveLeave:e,elementProxy:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.elementProxy?.isConnected&&this._visible!==e&&(this._visible=e,this.elementProxy.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback(),this.elementProxy.reset()))}updateClassModifiers(){if(!this.elementProxy?.isConnected)return;const{elementProxy:e}=this,{enableInteraction:t,arrowPosition:i,mode:s,darkTheme:n,wrapping:o}=this,a=(r,l)=>e.toggleClass(`${Qi}--${r}`,l);a("no-interaction",!t),a("arrow-top",i===1),a("arrow-right",i===3),a("arrow-bottom",i===2),a("arrow-left",i===0),a("compact",s==="compact"),e.toggleClass(lU,n);for(const r of this.wrapTypes)e.toggleClass(`${Qi}--wrap-${r}`,r===o)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:s,canvasX:n,canvasY:o,yOffset:a,xOffset:r,canvasRect:l}=e,{width:c,height:h}=t,d={width:c,height:h};if(i==="node"||i==="pointer"){const u=fU[s],p=mU[s];return d.top=o+a+h*(p-1)/2+8*p,d.left=n+r+c*(u-1)/2+8*u,d}switch(s){case"top":return d.top=a,d.left=l.width/2-c/2+r,d;case"right":return d.top=l.height/2-h/2+a,d.left=l.width-c+r,d;case"left":return d.top=l.height/2-h/2+a,d.left=r,d;case"bottom":return d.top=l.height-h+a,d.left=l.width/2-c/2+r,d;case"top-left":return d.top=a,d.left=r,d;case"top-right":return d.top=a,d.left=l.width-c+r,d;case"bottom-right":return d.top=l.height-h+a,d.left=l.width-c+r,d;case"bottom-left":return d.top=l.height-h+a,d.left=r,d}return d}};g([m],aa.prototype,"enabled",2),g([m],aa.prototype,"mode",2),g([m],aa.prototype,"showArrow",2),g([m],aa.prototype,"delay",2),g([m],aa.prototype,"range",2),g([m],aa.prototype,"wrapping",2),g([m],aa.prototype,"position",2),g([m],aa.prototype,"pagination",2),g([m],aa.prototype,"darkTheme",2),g([m],aa.prototype,"bounds",2);function bU(e,t){for(const i of e)if(zt.toCanvas(i.node).intersectsWith(t))return!0;return!1}function vU(e){switch(e.sourceDetail){case"keyboard-page(1)":case"keyboard-page(-1)":return"viewport-start";case"keyboard-page(home)":return"data-start";case"keyboard-page(end)":return"data-end";default:return}}var OO=class extends zD{constructor(e){super(),this.chart=e,this.id=gi(this),this.series=[],this.announceMode="when-changed",this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.activeState={lastActive:void 0,highlightInViewport:!0},this._device="pointer",this.focus={initialized:!1,sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0,pendingViewportFocus:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=this.createHoverScheduler(),this.pickManager=new YK(e.ctx.activeManager,e.tooltip);const t=e.ctx.localeManager.t("ariaInitSeriesArea"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),s=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new QK(i,s,"img",t),this.swapChain.addListener("blur",r=>this.onBlur(r)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new qK(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:n,seriesWidget:o,containerWidget:a}=e.ctx.widgets;o.setTabIndex(-1),this.cleanup.register(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),o.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),o.addListener("mousemove",r=>this.onHover(r,o)),o.addListener("wheel",r=>this.onWheel(r)),o.addListener("mouseleave",r=>this.onLeave(r)),o.addListener("keydown",r=>this.onKeyDown(r)),o.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),a.addListener("contextmenu",(r,l)=>this.onContextMenu(r,l)),a.addListener("click",(r,l)=>this.onClick(r,l)),a.addListener("dblclick",(r,l)=>this.onClick(r,l)),e.ctx.animationManager.addListener("animation-start",()=>this.onAnimationStart()),e.ctx.eventsHub.on("active:load-memento",r=>this.onActiveLoadMemento(r)),e.ctx.eventsHub.on("active:update",r=>this.onActiveUpdate(r)),e.ctx.eventsHub.on("dom:resize",()=>this.onResize()),e.ctx.eventsHub.on("dom:container-change",()=>this.resetHoverScheduler()),e.ctx.eventsHub.on("highlight:change",r=>this.changeHighlightDatum(r)),e.ctx.eventsHub.on("highlight:selection-updated",r=>this.onHighlightSelectionUpdate(r)),e.ctx.eventsHub.on("layout:complete",r=>this.layoutComplete(r)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.eventsHub.on("zoom:change-complete",r=>this.onZoomChangeComplete(r)),e.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),n&&this.cleanup.register(n.events.on("drag-move",r=>this.onDragMove(r,o)),n.events.on("click",r=>this.onClick(r,o)),n.events.on("dblclick",r=>this.onClick(r,o)))}get bbox(){return(this.seriesRect??re.zero).clone()}setHoverDevice(e){(e==="setState"||!this.isState(1))&&(this._device=e)}getHoverDevice(){return this._device}initFocus(e){if(!this.focus.initialized)switch(this.focus.initialized=!0,e){case"data-end":{this.focus.datumIndex=Number.MAX_VALUE;break}case"viewport-start":case"viewport-end":{this.focus.pendingViewportFocus=e;break}default:}}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(18))}dataChanged(){var e;this.cachedTooltipContent=void 0,this.highlight.appliedHoverEvent&&((e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.clearHighlight()),this.getHoverDevice()!=="setState"&&(this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear())}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.tooltip.lastHover??this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0),this.getHoverDevice()==="setState"&&this.refreshSetState()}updateComplete(){const{pendingViewportFocus:e}=this.focus;e&&this.focus.series!==void 0?(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(e)):this.isState(69)&&this.focusIndicator?.isFocusVisible()&&(this.announceMode!=="always"&&(this.announceMode="never"),this.refreshFocus())}update(e,t){this.chart.ctx.eventsHub.emit("chart:request-update",{type:e,opts:t})}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let s=t.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[t.declarationOrder,i.declarationOrder]),sn?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.rect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.rect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onAnimationStart(){this.getHoverDevice()!=="setState"&&this.clearAll()}onResize(){const e=this.chart.ctx.highlightManager.getActiveHighlight();this.clearAll(),this.pickManager.wasActivationPrevented()&&e!==void 0&&(this.setHoverDevice("setState"),this.activeState.lastActive={itemId:xb(e),seriesId:e.series.id})}onZoomChangeComplete(e){this.clearAll(),this.focus.pendingViewportFocus=vU(e)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(t!==this.chart.ctx.widgets.seriesWidget){if(this.isState(72)){const{currentX:c,currentY:h}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:c,canvasY:h},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=zt.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(72)){const c=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");c&&(this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id)}),s=c.matches[0])}const o=s?.series;this.clearAll();const a=e.currentX+t.cssLeft(),r=e.currentY+t.cssTop(),{datumIndex:l}=s??{};o&&s&&l!=null?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:a,canvasY:r},{pickedSeries:o,pickedNode:{...s,datumIndex:l}},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:a,canvasY:r},void 0,n)}onLeave(e){!this.isState(82)||e.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.getHoverDevice()!=="keyboard"&&this.clearAll(!0))}onWheel(e){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.setHoverDevice("pointer"))}onDragMove(e,t){this.isState(82)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(83)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(this.isIgnoredTouch(e)||(e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),t!==this.chart.ctx.widgets.seriesWidget))return;this.tooltip.lastHover=e,this.setHoverDevice("pointer"),this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule();let i;if(this.isState(65)){const{currentX:n,currentY:o}=e;i=this.pickNodes({x:n,y:o},"event");const a=i?.matches,r=a?.[0];r?.series.hasEventListener("seriesNodeClick")||r?.series.hasEventListener("seriesNodeDoubleClick")||a!=null&&a.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}const s=!!i?.matches.length;this.emitSeriesAreaHoverEvent(e,s)}onClick(e,t){if(e.device==="keyboard"||(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),e.device==="touch"&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(83)))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t);const i=t===this.chart.ctx.widgets.seriesWidget;if(this.isState(18)){i&&this.emitSeriesAreaClickEvent(e,!1);return}if(i){if(this.checkSeriesNodeClick(e)){this.emitSeriesAreaClickEvent(e,!0),this.update(7),e.sourceEvent.preventDefault();return}this.emitSeriesAreaClickEvent(e,!1)}const s={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(s)}emitSeriesAreaHoverEvent(e,t){const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e),n={canvasX:i,canvasY:s,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:hover",n)}emitSeriesAreaClickEvent(e,t){if(!("currentX"in e))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e),n={canvasX:i,canvasY:s,consumed:t,sourceEvent:e.sourceEvent};this.chart.ctx.eventsHub.emit("series-area:click",n)}toCanvasCoordinates(e){return{canvasX:e.currentX+(this.hoverRect?.x??this.seriesRect?.x??0),canvasY:e.currentY+(this.hoverRect?.y??this.seriesRect?.y??0)}}onFocus(){if(!this.isState(69)||!this.focusIndicator)return;this.initFocus(this.chart.keyboard.initialFocus);const e=this.focusIndicator.onFocus();this.setHoverDevice(e?"keyboard":"pointer");const{pendingViewportFocus:t}=this.focus;this.refreshFocus()===4&&t&&(this.focus.pendingViewportFocus=void 0,this.pickViewportFocus(t))}onBlur(e){this.isState(69)&&(this.setHoverDevice("pointer"),!this.isState(1)&&!this.maybeEnterInteractiveTooltip(e)&&this.clearAll(!0),this.focusIndicator?.onBlur())}onKeyDown(e){if(!this.isState(87))return;const t=tU(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.getHoverDevice()==="keyboard"),t?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:e});case"panxleft":return this.onPage(-1,e);case"panxright":return this.onPage(1,e);case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"home":return this.onHome(e);case"end":return this.onEnd(e);case"submit":return this.onSubmit(e);case"delete":return;default:t?.name}}onPage(e,t){if(!this.chart.hasPgUpPgDownSupport()||!this.onNav(t))return;const i=this.focus.series?.axes.x?.reverse??!1;this.chart.ctx.eventsHub.emit("series:keynav-panx",{delta:e,reverse:i,widgetEvent:t})}onNav(e){return this.isState(69)?(this.setHoverDevice("keyboard"),this.focusIndicator?.overrideFocusVisible(!0),e.sourceEvent.preventDefault(),!0):!1}onArrow(e,t,i){this.onNav(i)&&(this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocusFromUserInput({datumIndexDelta:t,otherIndexDelta:e}))}onHome(e){if(this.chart.hasViewportSupport())return this.onPage("home",e);this.onNav(e)&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:0})}onEnd(e){if(this.chart.hasViewportSupport())return this.onPage("end",e);if(!this.onNav(e))return;const t=this.focus.series?.data?.data.length;t!==void 0&&this.handleFocusFromUserInput({otherIndex:this.focus.seriesIndex,datumIndex:t-1})}onSubmit(e){if(!this.onNav(e))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!=null&&i!=null?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s})}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event"),s=this.pickManager.onPickedNodesTooltip(i);if(i===void 0||s.active===void 0)return!1;const n=s.paginationState==null?i.distance:0;if(e.type==="click"){if(s.active.series.fireNodeClickEvent(e.sourceEvent,s.active)){const a=this.pickManager.nextCandidate();if(a.active!==void 0){const{active:r}=a,{canvasX:l,canvasY:c}=this.toCanvasCoordinates(e);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1,{active:r,defaultCb:()=>{this.showTooltip(r,l,c,a.paginationState)}})}}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=n===0,s.active.series.fireNodeDoubleClickEvent(e.sourceEvent,s.active),!0):!1}handleFocusFromUserInput(e){this.handleFocus(e),this.chart.ctx.eventsHub.emit("series:focus-change",null)}refreshFocus(){return this.handleFocus({datumIndexDelta:0,otherIndexDelta:0})}handleFocus(e){const t=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);if(t==null){const i=this.handleSeriesFocus(e);return i===0?this.announceMode="when-changed":this.announceMode="always",i}else return this.focusIndicator?.update(t.rect,this.seriesRect,!1),this.swapChain.update(t.text),this.announceMode="always",0}handleSeriesFocus(e){return"datumIndexDelta"in e?this.handleSeriesFocusDeltas(e):this.handleSeriesFocusIndices(e)}makeUpdateFocusParamsFromDeltas(e){const{otherIndexDelta:t,datumIndexDelta:i}=e;if(this.chart.chartType==="standalone"){this.focus.series=this.focus.sortedSeries[0];const c=this.focus.datumIndex,h=this.focus.seriesIndex,d=this.focus.datumIndex-i,u=this.focus.seriesIndex-t;return{datumIndex:c,datumIndexDelta:i,oldDatumIndex:d,otherIndex:h,otherIndexDelta:t,oldOtherIndex:u}}const{focus:s}=this,n=s.sortedSeries.filter(c=>c.visible&&c.focusable);if(n.length===0)return 1;const o=s.datumIndex-i,a=s.seriesIndex-t;s.seriesIndex=se(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const r=this.focus.datumIndex,l=this.focus.seriesIndex;return{datumIndex:r,datumIndexDelta:i,oldDatumIndex:o,otherIndex:l,otherIndexDelta:t,oldOtherIndex:a}}handleSeriesFocusDeltas(e){const t=this.makeUpdateFocusParamsFromDeltas(e);return t===1?1:this.pickFocus(t)}handleSeriesFocusIndices(e){const{datumIndex:t,otherIndex:i}=e,s=this.focus.datumIndex,n=this.focus.seriesIndex;return this.pickFocus({datumIndex:t,datumIndexDelta:t-s,oldDatumIndex:s,otherIndex:i,otherIndexDelta:i-n,oldOtherIndex:n})}pickFocus(e){const{datumIndex:t,datumIndexDelta:i,otherIndex:s,otherIndexDelta:n}=e,{focus:o,hoverRect:a,seriesRect:r}=this;if(o.series==null||a==null)return 1;const l={datumIndex:t,datumIndexDelta:i,otherIndex:s,otherIndexDelta:n,seriesRect:r},c=o.series.pickFocus(l);return c?this.updatePickedFocus(e,c):2}pickViewportFocus(e){const{focus:t,hoverRect:i}=this;if(t.series==null||i==null)return 1;const s=t.series.pickViewportFocus({where:e,hoverRect:i,otherIndex:t.seriesIndex});if(!s)return 2;const n={datumIndex:s.datumIndex,datumIndexDelta:0,oldDatumIndex:this.focus.datumIndex,otherIndex:s.otherIndex??this.focus.seriesIndex,otherIndexDelta:0,oldOtherIndex:this.focus.seriesIndex};return this.updatePickedFocus(n,s)}updatePickedFocus(e,t){const{datumIndexDelta:i,oldDatumIndex:s,otherIndexDelta:n,oldOtherIndex:o}=e,{focus:a,hoverRect:r}=this;if(a.series==null||r==null)return 1;if(a.pendingViewportFocus!==void 0)return 4;const{datum:l}=t;if(a.datum=l,a.datumIndex=t.datumIndex,t.otherIndex!=null&&(a.seriesIndex=t.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const d=NI(t),{x:u,y:p}=d.computeCenter();if(!r.containsPoint(u,p)&&this.chart.ctx.zoomManager.panToBBox(r,d))return 3;const{x1:f,x2:y,y1:x,y2:b}=Se.from(d),v=r.containsPoint(f,x),S=r.containsPoint(y,x),M=r.containsPoint(f,b),D=r.containsPoint(y,b);if(!(v||S||M||D)){const I=Se.from(r);t.movedBounds=d.clone(),fI.x2&&y>I.x2&&(t.movedBounds.x=I.x2-2,t.movedBounds.width=4),xI.y2&&b>I.y2&&(t.movedBounds.y=I.y2-2,t.movedBounds.height=4)}}this.focusIndicator?.update(t.movedBounds??t.bounds,this.seriesRect,t.clipFocusBox);const c=this.getTooltipContent(l,"aria-label"),h=sU(a.series,r,t);if(h!=null&&this.getHoverDevice()==="keyboard"&&(this.clearCachedEvents(),!this.isState(1))){const d=hb.makeTooltipMeta(h,a.series,l,t.movedBounds);this.pickManager.maybeActivate(l,({series:u})=>{this.chart.ctx.highlightManager.updateHighlight(this.id,l),this.isTooltipEnabled(u)&&this.chart.ctx.tooltipManager.updateTooltip(this.id,d,c)},{defaultCbArg:{series:a.series}})}return this.maybeAnnouncePickedFocus(i,s,n,o,t,c),0}maybeAnnouncePickedFocus(e,t,i,s,n,o){const{focus:a}=this;let r;this.announceMode==="when-changed"?e===0&&i===0||t!==n.datumIndex||s!==(n.otherIndex??a.seriesIndex)?r="always":r="never":r=this.announceMode,r==="always"&&this.swapChain.update(this.getDatumAriaText(n.datum,o))}getDatumAriaText(e,t){const i=t==null?"":dU(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(e=!1){this.pickManager.maybeActivate(void 0,()=>{this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,e)})}clearTooltip(e=!1){this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,e),this.tooltip.lastHover=void 0}clearAll(e=!1){this.isState(1)||(this.pickManager.onClearUI(),this.clearHighlight(e),this.pickManager.wasActivationPrevented()||this.clearTooltip(e),this.focusIndicator?.clear())}clearStaleHighlightTooltip(){this.getHoverDevice()==="setState"&&(this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0))}clearUnpreventable(){this.activeState.lastActive=void 0,this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1)}clearCachedEvents(){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0}createHoverScheduler(){return cW(this.chart.ctx.domManager.getDocument(),()=>{if(this.getHoverDevice()==="setState")return this.handleHoverFromState();if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=7){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}})}resetHoverScheduler(){this.hoverScheduler.cancel(),this.hoverScheduler=this.createHoverScheduler()}handleHoverFromState(){const{active:e,paginationState:t}=this.pickManager.onPickedNodesAPIDebounced();e!==void 0&&this.pickManager.maybeActivate(e,()=>{const i=hI(e.series,e,void 0);if(this.chart.tooltip.enabled){if(!e.series.visible)this.clearStaleHighlightTooltip();else if(i){const{canvasX:s,canvasY:n}=i,o=this.activeState.highlightInViewport;this.chart.ctx.highlightManager.updateHighlight(this.id,e,!1,o),o?this.showTooltip(e,s,n,t):this.clearTooltip()}}})}handleHoverHighlight(e,t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const i=this.highlight.appliedHoverEvent;if(!i||!this.isState(82))return;const{canvasX:s,canvasY:n}=this.toCanvasCoordinates(i);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(s,n)){this.clearHighlight();return}const{range:o}=this.chart.highlight,a=o==="tooltip"?"highlight-tooltip":"highlight",r=t?.active??this.pickManager.onPickedNodesHighlight(this.pickNodes({x:i.currentX,y:i.currentY},a));r===void 0?this.pickManager.maybeActivate(void 0,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0),t?.defaultCb()}):this.pickManager.maybeActivate(r,()=>{this.chart.ctx.highlightManager.updateHighlight(this.id,r,!1),t?.defaultCb()})}handleHoverTooltip(e,t){if(!this.isState(82))return;const{canvasX:i,canvasY:s}=this.toCanvasCoordinates(e),n=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(i,s)){this.getHoverDevice()=="pointer"&&this.clearTooltip();return}if(n&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(n,"canvas-overlay",Qi))return;const o=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip"),{active:a,paginationState:r}=this.pickManager.onPickedNodesTooltip(o);this.pickManager.wasActivationPrevented()||(a===void 0?this.getHoverDevice()=="pointer"&&this.clearTooltip(!0):this.showTooltip(a,i,s,r))}showTooltip(e,t,i,s){const n=this.getTooltipContent(e,"tooltip");if(n!=null){const{series:a}=e,r=hb.makeTooltipMeta({type:"pointermove",canvasX:t,canvasY:i},a,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,r,n,s)}else this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.pickManager.maybeActivate(void 0,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0,!0)})})}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&i.properties.cursor!=="default"&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor);const s=t?.isHighlightEnabled()??!1;if(e.highlightSuppressed&&!s)return;const n=e.highlightSuppressed!==!s;this.getHoverDevice()==="setState"||i==null||t==null||n?this.update(7,{clearCallbackCache:!0}):this.update(7,{seriesToUpdate:new Set([t,i].filter(Boolean)),clearCallbackCache:!0})}onHighlightSelectionUpdate(e){if(!this.isState(1)||!this.seriesRect){this.activeState.highlightInViewport=!0;return}if(e.highlightSelection.length===0)return;const t=bU(e.highlightSelection,this.seriesRect);this.activeState.highlightInViewport=t}pickNodes(e,t,i){const s=[...this.series].reverse(),n=t==="event"||t==="context-menu",o=t==="tooltip"||t==="highlight-tooltip",a=u=>{if(n)return u.properties.nodeClickRange;if(o)return u.properties.tooltip.range},{x:r,y:l}=e,c=new Set;for(const u of s)u.visible&&u.contentGroup.visible&&a(u)==="area"&&u.isPointInArea?.(r,l)&&c.add(u);const h=c.size>0;let d;for(const u of s){if(!u.visible||!u.contentGroup.visible||h&&!(a(u)==="area"&&c.has(u)))continue;const p=u.pickNodes(e,t,i);if(p==null||p.datums.length===0)continue;const{datums:f,distance:y}=p;if(p.datums.length!==0)if(y===0){d?.distance!==0&&(d={matches:[],distance:0});for(const x of f)d.matches.push(x)}else(d==null||d.distance>y)&&(d={matches:f,distance:y})}return d}isTooltipEnabled(e){return e.tooltipEnabled??this.chart.tooltip.enabled}getTooltipContent(e,t){const{series:i,datumIndex:s}=e;let n;if(t==="aria-label"||this.isTooltipEnabled(i)){const{cachedTooltipContent:o}=this;if(o?.series===i&&o.datumIndex===s)n=o.content;else{const a=this.chart.getTooltipContent(i,s,e,t);this.cachedTooltipContent={series:i,datumIndex:s,content:a},n=a}}else this.cachedTooltipContent=void 0;return n}onActiveLoadMemento(e){switch(e.activeItem?.type){case void 0:case"legend":return this.onActiveClear();case"series-node":return this.onActiveDatum(e.activeItem,e);default:return e.activeItem?.type}}onActiveUpdate(e){e?.type==="legend"&&(this.clearStaleHighlightTooltip(),this.activeState.lastActive="legend")}onActiveClear(){this.pickManager.onClearAPI(),this.setHoverDevice("setState"),this.activeState.lastActive=void 0,this.clearHighlight(),this.clearTooltip()}refreshSetState(){if(this.activeState.lastActive===void 0)this.pickManager.onClearUI(),this.clearHighlight(!1),this.clearTooltip(!1);else if(this.activeState.lastActive!=="legend"){const{seriesId:e,itemId:t}=this.activeState.lastActive,i=this.findPickedNodes(e,t);i===void 0?this.clearUnpreventable():i==="series-hidden"?this.isState(1)?this.clearStaleHighlightTooltip():this.pickManager.maybeActivate(void 0,()=>{this.activeState.lastActive=void 0,this.clearCachedEvents(),this.chart.ctx.highlightManager.updateHighlight(this.id,void 0),this.chart.ctx.tooltipManager.removeTooltip(this.id,void 0)}):(this.pickManager.onPickedNodesAPI(i),this.hoverScheduler.schedule())}}onActiveDatum(e,t){const{seriesId:i,itemId:s}=e,n=this.findPickedNodes(i,s);if(n===void 0)t.reject(),this.onActiveClear();else{if(n!=="series-hidden"){const o=this.pickManager.onPickedNodesAPI(n);t.setDatum(o)}this.setHoverDevice("setState"),this.activeState.lastActive={seriesId:i,itemId:s},t.initialState?(this.chart.ctx.scene.applyPendingResize(),this.handleHoverFromState()):(this.clearCachedEvents(),this.hoverScheduler.schedule())}}findPickedNodes(e,t){const i=this.series.find(n=>n.id===e);if(i==null){W.warn(`Cannot find seriesId: "${e}"`);return}if(!i.visible)return"series-hidden";const s=i.findNodeDatum(t);if(s==null){W.warn(`Cannot find itemId: ${JSON.stringify(t)}`);return}return{matches:[s],distance:0}}};OO.className="SeriesAreaManager";var PO=30,SU=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}getGroupIndex(e){const{internalId:t,seriesGrouping:i}=e;return i?.groupIndex??t}getGroupType(e,t){return t?"top":e.type}requestGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),o=this.getGroupIndex(e),a=this.series.get(t);if(a!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(a)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=PO?"aggressive-grouping":"normal");let r=this.groups.get(n);r==null&&(r=new Map,this.groups.set(n,r));const l=this.lookupIdx(o);let c=r.get(l);return c==null&&(c={type:n,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new Le({name:`${e.contentGroup.name??n}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},r.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e,bringToFront:s}),c.seriesIds.push(t),c.group.appendChild(i),c.group}changeGroup(e){const{internalId:t,contentGroup:i}=e,s=e.bringToFront(),n=this.getGroupType(e,s),o=this.series.get(t),a=o?this.getGroupType(o.seriesConfig,o.bringToFront):void 0,r=this.getGroupIndex(e),l=this.lookupIdx(r),c=this.groups.get(n)?.get(l);if(!(a===n&&c?.seriesIds.includes(t)===!0))return this.series.has(t)&&this._releaseGroup({internalId:t,contentGroup:i,type:a}),this.requestGroup(e)}releaseGroup(e){const{internalId:t,contentGroup:i}=e,s=this.getGroupType(e,e.bringToFront());this._releaseGroup({internalId:t,contentGroup:i,type:s})}_releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const n=this.series.get(t)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(o=>o!==t),i.remove()),n?.seriesIds.length===0?(n.group.remove(),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(t)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(t)}updateLayerCompositing(){for(const e of this.groups.values())for(const t of e.values()){const{group:i,seriesIds:s}=t;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)}}lookupIdx(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!Number.isFinite(e))?0:Math.floor(se(0,e/this.expectedSeriesCount,1)*PO)}destroy(){for(const e of this.groups.values())for(const t of e.values())t.group.remove();this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){let t;for(const i of e){const n=this.series.get(i)?.seriesConfig.contentGroup.zIndex??1;if(t==null||n==null){t=n;continue}t=yT(t,n)<=0?t:n}return t??1}},EO=class extends q{constructor(){super(...arguments),this.dragAction="drag"}};g([m],EO.prototype,"dragAction",2);var MU=class{constructor(e,t,i,s,n,o){this.chart=e,this.eventsHub=t,this.dataService=i,this.updateService=s,this.zoomManager=n,this.animationManager=o,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new ot,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",a=>this.onUpdateComplete(a)),this.eventsHub.on("zoom:change-complete",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.eventsHub.emit("chart:request-update",{type:1})}onDataError(){this.eventsHub.emit("chart:request-update",{type:5})}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){!e.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||e.wasShortcut||this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,s=!0;if(t){const n=this.zoomManager.getAxisZoom(t.id);i=this.getAxisWindow(t,n),s=this.shouldRefresh(e,t,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>e.type==="time")}shouldRefresh(e,t,i){if(e.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(t.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(t.id,i),!0)}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||i.length===0||Number.isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*t.min),o=new Date(Number(i[0])+s*t.max);return{min:n,max:o}}},DU=/^((?!chrome|android).)*safari/i,IU=/Version\/(\d+(\.\d+)?)/,kU=/Chrome/,AU=/Chrome\/(\d+)/,wU=/Edg/,CU=/OPR/;function LU(){const{userAgent:e}=Go("navigator");if(DU.test(e)){const t=IU.exec(e);if(t==null)return!1;const i=Number.parseFloat(t[1]),s=Math.floor(i)>16;return s||W.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}else if(kU.test(e)&&!wU.test(e)&&!CU.test(e)){const t=AU.exec(e);if(t==null)return!1;const i=Number.parseInt(t[1],10),s=i>126;return s||W.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}var NU=new Set(["map-shape-background","map-line-background"]),TU=class{constructor(e,t,i,s,n,o,a){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=o,this.domManager=a,this.cleanup=new ot,this.overlayElem=this.domManager.addProxyChild("canvas-overlay","overlay"),this.overlayElem.setAttr("role","status"),this.overlayElem.setAttr("aria-atomic","false"),this.overlayElem.setAttr("aria-live","polite"),this.overlayElem.toggleClass(kI,!0),this.cleanup.register(this.eventsHub.on("layout:complete",r=>this.onLayoutComplete(r)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!NU.has(c.type));this.overlayElem.toggleClass($K,this.overlays.darkTheme),this.overlayElem.setProperty("left",`${e.x}px`),this.overlayElem.setProperty("top",`${e.y}px`),this.overlayElem.setProperty("width",`${e.width}px`),this.overlayElem.setProperty("height",`${e.height}px`);const n=t,o=!t&&!i,a=i&&!s,r=this.overlays.unsupportedBrowser.enabled&&LU();n?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),o?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),a?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),r?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||o||a||r;this.overlayElem.setAttr("aria-hidden",String(!l))}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Lo=ve.create(!0,"opts"),Tt=class iH extends _T{constructor(t,i){var s;super(),this.id=gi(this),this.seriesRoot=new ds({name:`${this.id}-series-root`,zIndex:7}),this.annotationRoot=new ds({name:`${this.id}-annotation-root`,zIndex:11}),this.titleGroup=new Le({name:"titles",zIndex:15,renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0}),this.debug=ve.create(!0,"chart"),this.extraDebugStats={},this.data=Sf.empty(),this._firstAutoSize=!0,this._autoSizeNotify=new jg,this._requiredRange=0,this._requiredRangeDirection="x",this.chartCaptions=new Zx,this.padding=new Vr(20),this.keyboard=new pb,this.touch=new EO,this.mode="standalone",this.withinStudio=void 0,this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.dataIdKey=void 0,this.destroyed=!1,this.cleanup=new ot,this.chartAnimationPhase="initial",this.modulesManager=new WK,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=u=>super.fireEvent(u),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new jg,this.performUpdateType=10,this.runningUpdateType=10,this.currentProcessingUpdateType=10,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new lW,this.clearCallbackCacheOnUpdate=!1,this.updateRequestors={},this.performUpdateTrigger=RD(({count:u})=>{this.destroyed||this.updateMutex.acquire(this.tryPerformUpdate.bind(this,u)).catch(p=>W.errorOnce(p))}),this._performUpdateSplits={},this._previousSplit=0,this.axes=this.createChartAxes(),this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=u=>{this.fireEvent(u)},this.onSeriesNodeDoubleClick=u=>{this.fireEvent(u)},this.onSeriesVisibilityChange=u=>{this.fireEvent(u)},this.seriesGroupingChanged=u=>{if(!(u instanceof CI))return;const{series:p,seriesGrouping:f}=u;if(p.contentGroup.isRoot())return;const y=this.seriesLayerManager.changeGroup({internalId:p.internalId,type:p.type,contentGroup:p.contentGroup,bringToFront:()=>p.bringToFront(),renderToOffscreenCanvas:()=>p.renderToOffscreenCanvas(),seriesGrouping:f});y!=null&&p.attachSeries(y,this.seriesRoot,this.annotationRoot)},this.chartOptions=t;const n=i?.scene,o=i?.container??t.processedOptions.container??void 0,a=i?.styleContainer??t.specialOverrides.styleContainer,r=t.specialOverrides.skipCss;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const l=new Le({name:"root"});l.visible=!1,l.append(this.seriesRoot),l.append(this.annotationRoot),l.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node);const c=new bM(t.specialOverrides.document,t.specialOverrides.window);this.tooltip=new aa(c),this.seriesLayerManager=new SU(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const h=this.ctx=new Y$(this,{chartType:this.getChartType(),scene:n,root:l,container:o,styleContainer:a,skipCss:r,agDocument:c,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new eK(this),fireEvent:u=>this.fireEvent(u),updateMutex:this.updateMutex});t.optionMetadata.presetType==="sparkline"&&(h.highlightManager.unhighlightDelay=0,h.tooltipManager.removeDelay=0),this.cleanup.register(h.eventsHub.on("dom:resize",()=>this.parentResize(h.domManager.containerSize)),h.eventsHub.on("font:load",()=>{this.title.node.markDirty(),this.subtitle.node.markDirty(),this.footnote.node.markDirty(),this.update(5)}),h.eventsHub.on("rtl:change",()=>{h.scene.setDirection(h.domManager.isRtl),this.update(5)}),h.eventsHub.on("chart:request-update",u=>this.update(u.type,u.opts)),h.scene.on("scene-changed",()=>this.update(9))),h.scene.setDirection(h.domManager.isRtl),this.overlays=new ju,(s=this.overlays.loading).renderer??(s.renderer=()=>KK(h.agDocument,this.overlays.loading.getText(h.localeManager),h.animationManager.defaultDuration)),this.processors=[new MU(this,h.eventsHub,h.dataService,h.updateService,h.zoomManager,h.animationManager),new TU(this,this.overlays,h.eventsHub,h.dataService,h.localeManager,h.animationManager,h.domManager)],this.highlight=new ub,this.container=o;const d=this.getModuleContext();this.background=zi.createBackground?.(d)??new Eu(d),this.foreground=zi.createForeground?.(d),this.seriesArea=new kf(d),h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",0),this.seriesAreaManager=new OO(this.initSeriesAreaDependencies()),this.cleanup.register(h.layoutManager.registerElement(0,u=>{u.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(u)}),h.eventsHub.on("layout:complete",u=>this.chartCaptions.positionAbsoluteCaptions(u)),h.eventsHub.on("data:load",u=>{this.data=this.createDataSet(u.data)}),this.title.registerInteraction(d,"beforebegin"),this.subtitle.registerInteraction(d,"beforebegin"),this.footnote.registerInteraction(d,"afterend"),()=>this.title.destroy(),()=>this.subtitle.destroy(),()=>this.footnote.destroy(),this.ctx.agDocument.attachListener("pagehide",u=>{u.persisted||this.destroy()}),h.animationManager.addListener("animation-frame",()=>{this.update(9),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.animationManager.addListener("animation-start",()=>h.domManager.setDataBoolean("animating",!0)),h.animationManager.addListener("animation-stop",()=>{h.domManager.setDataBoolean("animating",!1),h.domManager.setDataNumber("animationTimeMs",h.animationManager.getCumulativeAnimationTime())}),h.eventsHub.on("zoom:change-complete",()=>{const u=this.chartAnimationPhase==="initial";for(const p of this.series)p.animationState?.transition("updateData");if(u)for(const p of this.axes)p.resetAnimation(this.chartAnimationPhase);this.update(5,{forceNodeDataRefresh:!0,skipAnimations:!u})})),this.parentResize(h.domManager.containerSize)}static getInstance(t){return iH.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}isDataTransactionSupported(){return!0}createDataSet(t){return new Sf(t,this.dataIdKey)}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}fireEvent(t){ls(this,this.fireEventWrapper,t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:s,keyboard:n,overlays:o,seriesRoot:a,mode:r}=this,l=this.getChartType(),c=()=>this.hasViewportSupport(),h=()=>this.hasPgUpPgDownSupport(),d=this.fireEvent.bind(this);return{hasViewportSupport:c,hasPgUpPgDownSupport:h,fireEvent:d,getUpdateType:()=>this.performUpdateType,getTooltipContent:(f,y,x,b)=>this.getTooltipContent(f,y,x,b),chartType:l,ctx:t,tooltip:i,highlight:s,keyboard:n,overlays:o,seriesRoot:a,mode:r}}getModuleContext(){return this.ctx}getTooltipContent(t,i,s,n){const a=n==="aria-label"||t.properties.tooltip.enabled!==!1?t.getTooltipContent(i,s):void 0,r=a==null?[]:[a];if(this.tooltip.mode!=="shared"||this.series.length===1)return r;const l=t.getCategoryValue(i);return l==null?r:this.series.flatMap(c=>{if(c===t)return r;if(!c.isEnabled()||c.properties.tooltip.enabled===!1)return[];const h=c.datumIndexForCategoryValue(l),d=h==null?void 0:c.getTooltipContent(h,void 0);return d==null?[]:[d]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}refreshSeriesUserVisibility(t,i){for(let s=0;s{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>W.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const t of this.series)t.resetDatumCallbackCache()}update(t=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:o=this.series,newAnimationBatch:a,apiUpdate:r=!1,clearCallbackCache:l=!1}=i??{};if(this.apiUpdate=r,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s)for(const c of this.series)c.markNodeDataDirty();for(const c of o)this.seriesToUpdate.add(c);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),a&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),(t===0||l)&&(this.clearCallbackCacheOnUpdate=!0),this.debug.check()){let c=new Error("Stack trace for update tracking").stack??"";c=c.replaceAll(/\([^)]*/g,""),this.updateRequestors[c]=t,this.currentProcessingUpdateType!==10&&this.currentProcessingUpdateType>=t&&this.debug.group(`Chart.update() - \u26A0\uFE0F received update for earlier update stage ${Gn[t]} \u26A0\uFE0F`,()=>{this.debug(`Current processing update type: ${Gn[this.currentProcessingUpdateType]}`),this.debug("Update from: ",c)})}t0?"\u26A0\uFE0F redo #"+this.updateShortcutCount+" \u26A0\uFE0F ":""}`;await this.debug.group(`Chart.performUpdate() ${i}`,async()=>{await this.performUpdate(t)})}catch(i){W.error("update error",i,i.stack)}}async performUpdate(t){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:o}=this,a=[...this.seriesToUpdate];switch(this.clearCallbackCacheOnUpdate&&(this.clearCallbackCacheOnUpdate=!1,this.clearCallbackCache()),this.performUpdateType=10,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.currentProcessingUpdateType=i,this.updateShortcutCount===0&&i<9&&(o.animationManager.startBatch(this._performUpdateSkipAnimations),o.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",Gn[i]),this._previousSplit=performance.now(),n.start??(n.start=this._previousSplit),o.domManager.setDeferring(!0),i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;this.updateData(),this.updateSplits("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;if(await this.processData(),this.seriesAreaManager.dataChanged(),this.pendingLocaleText){const l=this.modulesManager.getModule("locale");l&&"localeText"in l&&(l.localeText=this.pendingLocaleText),this.pendingLocaleText=void 0}this.updateSplits("\u{1F4CA}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),this.updateSplits("\u26F0\uFE0F");case 4:if(this.checkUpdateShortcut(4))break;this.processRanges(),this.updateSplits("\u{1F4D0}");case 5:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(5))break;await this.processLayout(),this.updateSplits("\u2316");case 6:if(this.checkUpdateShortcut(6))break;this.preSeriesUpdate(),this.updateSplits("\u2753");case 7:{if(this.checkUpdateShortcut(7))break;this.seriesRoot.renderToOffscreenCanvas=this.highlight.drawingMode==="cutout",await this.updateSeries(a),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing(),this.updateSplits("\u{1F914}")}case 8:if(this.checkUpdateShortcut(8))break;o.updateService.dispatchPreSceneRender(this.apiUpdate),o.scene.updateBaseFont(),this.updateSplits("\u2196");case 9:if(this.checkUpdateShortcut(9))break;o.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,o.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect,debugColors:ve.check("scene:stats","scene:stats:verbose")?this.getDebugColors():void 0}),this.extraDebugStats={};for(const l of Object.keys(n))delete n[l];this.ctx.domManager.incrementDataCounter("sceneRenders");case 10:this.updateShortcutCount=0,this.updateRequestors={},this.currentProcessingUpdateType=10,this._performUpdateSkipAnimations=!1,o.animationManager.endBatch()}this.destroyed||(o.updateService.dispatchUpdateComplete(this.apiUpdate,this.updateShortcutCount>0),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=10,this.syncStatus="ready"),this._performUpdateNotify.notify(),o.domManager.setDeferring(!1);const r=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Vd(r-n.start),count:t,performUpdateType:Gn[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}default-dark`];let s=i[0],n=!1,{theme:o}=this.chartOptions.processedOptions;for(;typeof o!="string"&&o!=null;)o=o.baseTheme;typeof o=="string"&&(s=o.replace("ag-",t),n=o.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return this.destroyed?!0:this.updateShortcutCount>3?(W.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t?(this.debug("Chart.checkUpdateShortcut() - BLOCKED AT: ",Gn[t]," BY REQUEST FOR: ",Gn[this.performUpdateType]),this.updateShortcutCount++,!0):(this.debug("Chart.checkUpdateShortcut() - PROCEEDING TO: ",Gn[t]),this.currentProcessingUpdateType=t,!1)}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.waitForCompletion(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}createChartAxes(){return new Yx}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const s=i?.filter(n=>!t.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(t.length);for(const n of t){if(i?.includes(n))continue;const o=this.seriesLayerManager.requestGroup(n);n.attachSeries(o,this.seriesRoot,this.annotationRoot),n.chart={},Object.defineProperty(n.chart,"mode",{get:()=>this.mode}),Object.defineProperty(n.chart,"isMiniChart",{get:()=>!1}),Object.defineProperty(n.chart,"flashOnUpdateEnabled",{get:()=>!!this.modulesManager.getModule("flashOnUpdate")?.enabled}),Object.defineProperty(n.chart,"seriesRect",{get:()=>this.seriesRect}),n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n)}this.seriesAreaManager?.seriesChanged(t)}destroySeries(t){if(t)for(const i of t)i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const i of this.axes){let s=function(n){return n.axes[i.direction]===i};var t=s;i.boundSeries=this.series.filter(s)}}assignAxesToSeries(){for(const t of this.series)for(const i of t.directions){const s=t.getKeyAxis(i)??i,n=this.axes.findById(s);if(!n){W.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}t.axes[i]=n}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=t;const{pixelRatio:n}=t;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[o=0,a=0,r=1]=this._lastAutoSize??[];o===i&&a===s&&r===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:o,inHeight:a,inMinWidth:r,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(r??this.minWidth,l??this.minHeight,o??this.width,a??this.height);const h=o??this.width??this._lastAutoSize?.[0],d=a??this.height??this._lastAutoSize?.[1],u=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:h,height:d,pixelRatio:u,stack:new Error("Stack trace for resize tracking").stack}),!(h==null||d==null||!je(h)||!je(d))&&s.resize(h,d,u)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1);let f=5;for(const y of this.axes){const x=y.getUpdateTypeOnResize();xs.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new Q1(this.mode,this.suppressFieldDotNotation,this.ctx.eventsHub),i=[];for(const s of this.series)i.push(s.processData(t)??Promise.resolve());for(const s of this.modulesManager.modules())s?.processData&&i.push(s.processData(t)??Promise.resolve());this._cachedData=t.execute(this._cachedData),this.updateSplits("\u{1F3ED}"),await Promise.all(i),this.updateLegends()}async processDomains(){for(const t of this.axes)t.processData();for(const t of this.series)t.updatedDomains()}processRanges(){var t;const i={},s={},n=new Map;this._requiredRangeDirection="x";for(const o of this.series)o.visible&&(i[t=o.type]??(i[t]=[]),o.getMinimumRangeSeries(i[o.type]),o.resolveKeyDirection("x")==="y"&&(this._requiredRangeDirection="y"),n.has(o.type)||n.set(o.type,o));for(const[o,a]of n)s[o]=a.getMinimumRangeChart(i[o]);Object.keys(s).length===0?this._requiredRange=0:this._requiredRange=Math.ceil(Math.max(...Object.values(s)));for(const o of this.axes)o.requiredRange=this._requiredRange}updateLegends(t){for(const i of ye.listModulesByType("plugin"))switch(i.name){case"legend":this.setCategoryLegendData(t);break;case"gradientLegend":const s=this.modulesManager.getModule("gradientLegend");s.data=this.series.filter(n=>n.properties.showInLegend).flatMap(n=>n.getLegendData("gradient"));break}}setCategoryLegendData(t){const{legendManager:i,stateManager:s}=this.ctx;if(t)for(const o of this.series){const a=t.find(r=>r.seriesId===o.id);o.onLegendInitialState("category",a)}const n=this.series.flatMap(o=>{const a=o.getLegendData("category");return i.updateData(o.id,a),a});if(t){s.setStateAndRestore(i,t);return}if(this.mode!=="integrated"){const o={},a=new Map(this.series.map(r=>[r.id,r]));for(const{seriesId:r,symbol:{marker:l},label:c}of n.filter(h=>!h.hideInLegend)){if(l.fill==null)continue;const h=a.get(r);if(!h?.hasData)continue;const d=h.type,u=o[d]??(o[d]=new Map);u.has(c.text)?u.get(c.text)!==l.fill&&W.warnOnce(`legend item '${Oe(c.text)}' has multiple fill colours, this may cause unexpected behaviour.`):u.set(c.text,l.fill)}}i.update()}async processLayout(){const t=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}getDebugColors(){const t=this.background.fill;if(t)try{const i=Ne.fromString(t),[s]=Ne.RGBtoOKLCH(i.r,i.g,i.b);return{background:t,foreground:s>.5?"black":"white"}}catch{return{background:t}}}preSeriesUpdate(){const{_requiredRange:t,seriesRect:i}=this;if(i==null)return;const s=this._requiredRangeDirection==="x"?i.width:i.height,n=t/s||0;this.ctx.updateService.dispatchPreSeriesUpdate(n,this._requiredRangeDirection,t)}async updateSeries(t){const{seriesRect:i}=this;function s(n){return n.update({seriesRect:i})}await Promise.all(t.map(s).filter(n=>n!=null)),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(n=>n.visible&&n.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t,i){const s=Go("agChartsDebugTimeout");s==null?(t??(t=1e4),i??(i=!1)):(t=s,i??(i=!0));const n=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==10||this.runningUpdateType!==10||this.ctx.scene.waitingForUpdate()||this.data.hasPendingTransactions())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==10||this.runningUpdateType!==10||this.data.hasPendingTransactions())&&await this._performUpdateNotify.waitForCompletion(),performance.now()-n>t){const o=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(o);W.warnOnce(o)}y0()&&await sx(),this.ctx.scene.waitingForUpdate()&&await sx(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){t.seriesWithUserVisibility&&this.refreshSeriesUserVisibility(this.chartOptions,t.seriesWithUserVisibility);const i=5,s=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){Lo("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(i,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,o=t.processedOptions;Lo("Chart.applyOptions() - applying delta",s);const a=this.applyModules(),r=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter","displayNullData","enableRtl"];"listeners"in s&&this.registerListeners(this,s.listeners),"enableRtl"in s&&this.ctx.domManager.setEnableRtl(s.enableRtl),au(this,s,{skip:r});let l=!1,c="no-op";s.series!=null&&(c=this.applySeries(this,s.series,n?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,o,n,c,[])&&(l=!0);const{userDeltaKeys:h}=t,d=h===void 0||h.has("data");let u=!1;if(s.data&&d){const v=s.data,S=t.userOptions.data,D=Array.isArray(v)&&v!==S?v.slice():v;this.data=this.createDataSet(D),u=!0}if("dataIdKey"in s&&!(s.data&&d)&&this.data.dataIdKey!==this.dataIdKey&&(this.data=this.createDataSet(this.data.data),u=!0),c==="replaced"&&!u&&(this.data=this.createDataSet(this.data.data)),"legend"in s&&s.legend&&"listeners"in s.legend&&this.modulesManager.isEnabled("legend")){const v=s.legend.listeners;v?Object.assign(this.legend.listeners,v):this.legend.listeners.clear()}s.locale?.localeText&&(this.pendingLocaleText=s.locale?.localeText),this.chartOptions=t;const p=this.modulesManager.getModule("navigator");this.hasViewportSupport()||this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"internal-applyOptions"},{x:{min:0,max:1}});const f=p?.miniChart,y=o.navigator?.miniChart?.series??o.series;f?.enabled===!0&&y!=null?this.applyMiniChartOptions(f,y,o,n):f?.enabled===!1&&(f.series=[],f.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const b=l||a?0:i;if(this.maybeResetAnimations(c),this.shouldClearLegendData(o,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(o),this.ctx.formatManager.setFormatter(o.formatter),Lo("Chart.applyOptions() - update type",Gn[b],{seriesStatus:c,forceNodeDataRefresh:l}),t.optionsProcessingTime!==void 0){this._performUpdateSplits["\u2699\uFE0F"]=t.optionsProcessingTime;const v=performance.now()-t.optionsProcessingTime;this._performUpdateSplits.start=v}this.update(b,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0,clearCallbackCache:!0}),this.firstApply=!1}applyInitialState(t){const{activeManager:i,annotationManager:s,chartTypeOriginator:n,historyManager:o,stateManager:a,zoomManager:r}=this.ctx,{initialState:l}=t;if("annotations"in t&&t.annotations?.enabled&&l?.annotations!=null){const c=l.annotations.map(h=>{const d=s.getAnnotationTypeStyles(h.type);return ce(h,d)});a.setState(s,c)}l?.chartType!=null&&a.setState(n,l.chartType),this.needsViewportSupport(t)&&l?.zoom!=null&&a.setState(r,l.zoom),l?.active!=null&&a.setState(i,l.active),l?.legend!=null&&this.updateLegends(l.legend),l!=null&&o.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(t,i){const s=!!t.data||i==="data-change"||i==="replaced",n=["legend","gradientLegend"].some(a=>t[a]!=null),o=t.title!=null&&t.subtitle!=null||t.formatter!=null;return s||n||o}shouldClearLegendData(t,i,s){const n=s==="replaced"||s==="series-count-changed"||s==="series-grouping-change"||s==="updated"&&(t.series?.length!==i.series?.length||!t.series?.every((a,r)=>a.type===i.series?.[r].type)),o=i.legend!=null&&i.legend.enabled!==!1&&(t.legend==null||t.legend.enabled===!1);return n||o}applyMiniChartOptions(t,i,s,n){const o=n?.navigator?.miniChart?.series??n?.series,a=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(o));this.applyAxes(t,s,n,a,["tick","thickness","title","crosshair","gridLine","label"]);const r=t.series;for(const h of r)h.properties.id=void 0;const l=t.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,d=h?.label,u=h?.label?.interval;if(c.line.enabled=!1,c.label.set(ee(d,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let f=1;fthis.createSeries(u));return this.initSeriesDeclarationOrder(d),t.series=d,"replaced"}Lo("Chart.applySeries() - matchResult",n);const o=[];let a=!1,r=!1,l=!1,c=!1;const h=n.changes.toSorted((d,u)=>d.targetIdx-u.targetIdx);for(const d of h)switch(r||(r=d.status==="series-grouping"),a||(a=d.diff?.data!=null),l||(l=d.status!=="no-op"),c||(c=d.status==="add"||d.status==="remove"),d.status){case"add":{const u=this.createSeries(d.opts);o.push(u),Lo("Chart.applySeries() - created new series",u);break}case"remove":Lo(`Chart.applySeries() - removing series at previous idx ${d.idx}`,d.series);break;case"no-op":o.push(d.series),Lo(`Chart.applySeries() - no change to series at previous idx ${d.idx}`,d.series);break;case"series-grouping":case"update":default:{const{series:u,diff:p,idx:f}=d;Lo(`Chart.applySeries() - applying series diff previous idx ${f}`,p,u),this.applySeriesValues(u,p),u.markNodeDataDirty(),o.push(u)}}return this.initSeriesDeclarationOrder(o),Lo("Chart.applySeries() - final series instances",o),t.series=o,r?"series-grouping-change":c?"series-count-changed":a?"data-change":l?"updated":"no-op"}applyAxes(t,i,s,n,o=[]){if(!("axes"in i)||!i.axes)return!1;o=["type",...o];const a=i.axes;if(!(n==="replaced")&&t.axes.matches(a)&&jK(s)){for(const c of t.axes){const h=s.axes?.[c.id]??{},d=Kn(h,a[c.id]);Lo(`Chart.applyAxes() - applying axis diff idx ${c.id}`,d),au(c,d,{skip:o})}return!0}return Lo(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),t.axes=this.createAxes(a,o),!0}createSeries(t){const s=ye.getSeriesModule(t.type).create(this.getModuleContext());return this.applySeriesOptionModules(s,t),this.applySeriesValues(s,t),s}applySeriesOptionModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const o of ye.listModulesByType("series:plugin"))o.name in i&&(o.seriesTypes?.includes(t.type)??!0)&&n.addModule(o.name,o.create(s))}applySeriesValues(t,i){const s=t.getModuleMap(),{type:n,data:o,listeners:a,seriesGrouping:r,showInMiniChart:l,...c}=i;for(const h of ye.listModulesByType("series:plugin"))if(h.name in c){const d=s.getModule(h.name);if(d){const u=c[h.name];d.properties.set(u),delete c[h.name]}}c.visible!=null&&(t.visible=c.visible),t.properties.set(c),"data"in i&&t.setOptionsData(o==null?void 0:Sf.wrap(o)),"listeners"in i&&(this.registerListeners(t,a),this.series.includes(t)&&this.addSeriesListeners(t)),"seriesGrouping"in i&&(r==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...r})}createAxes(t,i){const s=this.createChartAxes(),n=this.getModuleContext();for(const[o,a]of rt(t)){const r=ye.getAxisModule(a.type).create(n);r.id=o,this.applyAxisModules(r,a),au(r,a,{skip:i}),s.push(r)}return _K(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const o of ye.listModulesByType("axis:plugin")){const a=i[o.name]!=null;a!==n.isEnabled(o.name)&&(a?(n.addModule(o.name,o.create(s)),t[o.name]=n.getModule(o.name)):(n.removeModule(o.name),delete t[o.name]))}}registerListeners(t,i){if(t.clearEventListeners(),i&&typeof i=="object")for(const[s,n]of rt(i))n!=null&&t.addEventListener(s,n)}async applyTransaction(t){await this.updateMutex.acquire(()=>{this.data.addTransaction(t),this.update(1,{apiUpdate:!0,skipAnimations:!0})}),await this.waitForUpdate()}onSyncActiveClear(){this.seriesAreaManager.onActiveClear()}needsViewportSupport(t){return!!t.navigator?.enabled||!!t.zoom?.enabled||!!t.scrollbar?.enabled}hasViewportSupport(){return this.needsViewportSupport({navigator:this.modulesManager.getModule("navigator"),zoom:this.modulesManager.getModule("zoom"),scrollbar:this.modulesManager.getModule("scrollbar")})}hasPgUpPgDownSupport(){return!0}};Tt.className="Chart",Tt.chartsInstances=new WeakMap,g([Ze({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),Tt.chartsInstances.set(e,this))},oldValue(e){Tt.chartsInstances.delete(e)}})],Tt.prototype,"container",2),g([Ze({newValue(e){this.resize("width option",{inWidth:e})}})],Tt.prototype,"width",2),g([Ze({newValue(e){this.resize("height option",{inHeight:e})}})],Tt.prototype,"height",2),g([Ze({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],Tt.prototype,"minWidth",2),g([Ze({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],Tt.prototype,"minHeight",2),g([Ze({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],Tt.prototype,"overrideDevicePixelRatio",2),g([m],Tt.prototype,"padding",2),g([m],Tt.prototype,"keyboard",2),g([m],Tt.prototype,"touch",2),g([m],Tt.prototype,"mode",2),g([m],Tt.prototype,"withinStudio",2),g([m],Tt.prototype,"styleNonce",2),g([Gt("chartCaptions.title")],Tt.prototype,"title",2),g([Gt("chartCaptions.subtitle")],Tt.prototype,"subtitle",2),g([Gt("chartCaptions.footnote")],Tt.prototype,"footnote",2),g([m],Tt.prototype,"formatter",2),g([m],Tt.prototype,"suppressFieldDotNotation",2),g([m],Tt.prototype,"loadGoogleFonts",2),g([m],Tt.prototype,"dataIdKey",2),g([Ze({changeValue(e,t){this.onAxisChange(e,t)}})],Tt.prototype,"axes",2),g([Ze({changeValue(e,t){this.onSeriesChange(e,t)}})],Tt.prototype,"series",2);var Sb=Tt;function RO(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var xi={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Yr={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},TI="white",OU={"radial-gauge":!0,"linear-gauge":!0};function Ku(e){return{$some:[{$and:[{$or:[{$isSeriesType:"line"},{$isSeriesType:"scatter"},{$isSeriesType:"area"},{$isSeriesType:"radar"},{$isSeriesType:"rangeArea"}]},{$isUserOption:[`/series/$index/${e}`,{$lessThan:[{$path:`/series/$index/${e}`},1]},!1]}]},{$path:"/series"}]}}function PU(e){return OU[e]===!0}var Jn=class sg{static getDefaultColors(){return{fills:xi,fillsFallback:Object.values(xi),strokes:Yr,sequentialColors:fn(xi),divergingColors:[xi.ORANGE,xi.YELLOW,xi.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Ne.interpolate([Ne.fromHexString(xi.BLUE),Ne.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[xi.GREEN,xi.YELLOW,xi.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:xi.GREEN,stroke:Yr.GREEN},down:{fill:xi.RED,stroke:Yr.RED},neutral:{fill:xi.GRAY,stroke:Yr.GRAY},altUp:{fill:xi.BLUE,stroke:Yr.BLUE},altDown:{fill:xi.ORANGE,stroke:Yr.ORANGE},altNeutral:{fill:xi.GRAY,stroke:Yr.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:TI,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:Uo,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"},separationLinesColor:{$foregroundBackgroundMix:.17}}}static getPrivateParameters(){return{focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.12]}}}static getAxisDefaults({title:t,time:i},s){return ce(s,t&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:li.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},i&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},border:{enabled:{$or:[{$isUserOption:["../border",!0,!1]},{$path:"../../../label/border/enabled"}]},strokeWidth:{$path:"../../../label/border/strokeWidth"},stroke:{$path:"../../../label/border/stroke"}},fill:{$path:"../../label/fill"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},cornerRadius:{$path:"../../label/cornerRadius"},padding:{$path:"../../label/padding"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0,cornerRadius:4,border:{enabled:!1,strokeWidth:1,stroke:{$foregroundOpacity:.08}},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]}},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,width:1,style:{$apply:[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]},[{fillOpacity:1,stroke:{$ref:"gridLineColor"},strokeWidth:{$path:"../../width"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:{$if:[{$path:"./border/enabled"},{left:12,right:12,top:8,bottom:8},5]},color:{$ref:"textColor"},cornerRadius:4,border:{enabled:!1,stroke:{$foregroundOpacity:.08},strokeOpacity:1,strokeWidth:1}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["../type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["../type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{border:{enabled:!1,stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:1},cornerRadius:4,padding:{$if:[{$path:"./border/enabled"},5,0]}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:li.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Ta,textAlign:Or},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:li.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Ta,textAlign:Or},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:li.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Ta,textAlign:Or},highlight:{enabled:!0,drawingMode:{$if:[{$or:[Ku("highlight/highlightedItem/opacity"),Ku("highlight/unhighlightedItem/opacity"),Ku("highlight/highlightedSeries/opacity"),Ku("highlight/unhighlightedSeries/opacity"),Ku("fillOpacity"),Ku("marker/fillOpacity")]},"overlap","cutout"]}},tooltip:{enabled:!0,darkTheme:zl,delay:0,pagination:!1,mode:{$if:[{$or:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]},{$and:[{$isChartType:"polar"},{$greaterThan:[{$size:{$path:"/series"}},1]},{$lessThan:[{$size:{$path:"/series"}},4]}]}]},"shared","single"]}},overlays:{darkTheme:zl},listeners:{},series:{tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","exact"]},"area"]},"exact",{$path:["/tooltip/range","exact"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(t={}){const{overrides:i,palette:s,params:n}=Pe(t),o=this.createChartConfigPerChartType(this.getDefaults()),a={};i&&this.processOverrides(a,i);const{fills:r,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=Us(ce(s,{fills:Object.values(r),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=RO(s),this.params=ce(n,this.getThemeParameters()),this.config=Us(Pe(o)),this.overrides=Us(i),this.presets=Us(a)}processOverrides(t,i){for(const s of ye.listModulesByType("series")){const n=s.name,o=i[n];PU(n)&&(t[n]=o,delete i[n])}}createChartConfigPerChartType(t){var i;for(const s of ye.listModulesByType("chart"))for(const n of ye.listModulesByType("series"))n.chartType===s.name&&(t[i=n.name]??(t[i]=s.themeTemplate));return t}getDefaults(){const t=(n,o)=>{const a={},r=ce({axes:{}},...Array.from(ye.listModulesByType("plugin"),l=>({[l.name]:l.themeTemplate})),ye.getChartModule(n)?.themeTemplate,this.getChartDefaults());for(const l of o){a[l]=ce(RU(l),a[l]??r);const{axes:c}=a[l];for(const h of ye.listModulesByType("axis"))c[h.name]=ce(c[h.name],!h.chartType||h.chartType===n?EU(h.name):null,sg.axisDefault[h.name]);(l==="map-shape-background"||l==="map-line-background")&&delete a[l].series.tooltip}return a},i=[...ye.listModulesByType("series")],s=Id(i,n=>n.chartType||"unknown");return ce(...Object.keys(s).map(n=>t(n,s[n]?.map(o=>o.name)??[])))}static applyTemplateTheme(t,i,s){if(Ae(t))for(let n=0;na.enterprise?"enterprise":"community");if(s.length){const a=ye.isEnterprise()||o.enterprise?.length?"enterprise":"community";W.errorOnce(["required modules are not registered. Check if you have registered the modules:","",ye.isUmd()?"Install and register 'ag-charts-enterprise' before creating the chart.":_U(s.map(BU),a),"",`See ${n} for more details.`].join(` `))}}function BU(e){return e.moduleId??e.name}function VO(e){return` ${e},`}function FU(e,t){return e.length?`import { ${e.map(VO).join(` `)} } from 'ag-charts-${t}';`:null}function _U(e,t){const i=FU(["ModuleRegistry"].concat(e),t),s=e.map(VO).join(` `);return`${i} ModuleRegistry.registerModules([ ${s} ]);`}function HU(e,t){const i=new Map,s="axes"in t&&me(t.axes)?t.axes:{},n=new Set(Object.values(s).map(r=>r?.type).filter(vt)),o=new Set(t.series?.map(r=>r.type).filter(vt));function a(r){i.set(r.name,r)}for(const r of nc.values())if(!ye.hasModule(r.name)&&!zU.has(r.name)&&!(e&&r.chartType&&e!==r.chartType))switch(r.type){case"chart":break;case"axis":if(n.has(r.name)){for(const h of Object.keys(s))s?.[h].type===r.name&&delete s[h];a(r)}break;case"series":o.has(r.name)&&(t.series=t.series.filter(h=>h.type!==r.name),a(r));break;case"plugin":const l=r.name,c=t[l];me(c)&&(c.enabled!==!1&&a(r),delete t[l]);break;case"axis:plugin":for(const h of Object.values(s)){const d=r.name;h?.[d]&&(h[d].enabled!==!1&&a(r),delete h[d])}break;case"series:plugin":for(const h of t.series??[])h[r.name]&&(delete h[r.name],a(r));break}for(const r of o){const l=nc.get(r);l?.type==="series"&&!ye.hasModule(l.name)&&!i.has(l.name)&&(t.series=t.series.filter(c=>c.type!==l.name),a(l))}return Array.from(i.values())}function BO(e,t){const i="axes"in t&&me(t.axes),s="series"in t&&Ae(t.series),n=a=>e==null||!a.chartType||a.chartType===e,o=[];for(const a of ye.listModules())if(ye.isModuleType("plugin",a))n(a)||(delete t[a.name],o.push(a.name));else if(ye.isModuleType("axis:plugin",a)){if(i&&!n(a)){for(const r of Object.values(t.axes))delete r[a.name];o.push(a.name)}}else if(ye.isModuleType("series:plugin",a)&&s&&!n(a)){for(const r of t.series)delete r[a.name];o.push(a.name)}return o}var OI="#192232",ps={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Ch={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Uu=class extends ra{getDefaultColors(){return{fills:ps,fillsFallback:Object.values(ps),strokes:Ch,sequentialColors:fn(ps),divergingColors:[ps.ORANGE,ps.YELLOW,ps.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[ps.GREEN,ps.YELLOW,ps.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:ps.GREEN,stroke:Ch.GREEN},down:{fill:ps.RED,stroke:Ch.RED},neutral:{fill:ps.GRAY,stroke:Ch.GRAY},altUp:{fill:ps.BLUE,stroke:Ch.BLUE},altDown:{fill:ps.ORANGE,stroke:Ch.ORANGE},altNeutral:{fill:ps.GRAY,stroke:Ch.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:OI,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},focusColor:{$mix:[{$ref:"backgroundColor"},{$ref:"accentColor"},.22]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},separationLinesColor:{$foregroundBackgroundMix:.44},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(zl,!0),e.set(Bg,OI),e.set(Ts,ps.BLUE),e.set(_g,"#fff"),e.set(rs,ps.BLUE),e.set(Yd,OI),e.set(Zd,"#28313e"),e.set(Xd,"#4b525d"),e.set(qd,"#fff"),e.set(Qd,"#fff"),e.set(tu,"#28313e"),e.set(iu,"#4b525d"),e.set(su,"#fff"),e}constructor(e){super(e)}},Mn={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Lh={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},GU=class extends Uu{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Mn},fillsFallback:Object.values({...Mn}),strokes:{...Lh},sequentialColors:fn(Mn),divergingColors:[Mn.GREEN,Mn.BLUE,Mn.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:Mn.GREEN,stroke:Lh.GREEN},down:{fill:Mn.RED,stroke:Lh.RED},neutral:{fill:Mn.BLUE,stroke:Lh.BLUE},altUp:{fill:Mn.GREEN,stroke:Lh.GREEN},altDown:{fill:Mn.RED,stroke:Lh.RED},altNeutral:{fill:Mn.GRAY,stroke:Lh.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,Mn.BLUE),e.set(rs,Mn.BLUE),e.set(Ta,"overlay"),e.set(Or,"left"),e.set(nu,"bottom"),e}},Dn={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Nh={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},jU=class extends ra{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Dn},fillsFallback:Object.values({...Dn}),strokes:{...Nh},sequentialColors:fn(Dn),divergingColors:[Dn.GREEN,Dn.BLUE,Dn.RED],up:{fill:Dn.GREEN,stroke:Nh.GREEN},down:{fill:Dn.RED,stroke:Nh.RED},neutral:{fill:Dn.BLUE,stroke:Nh.BLUE},altUp:{fill:Dn.GREEN,stroke:Nh.GREEN},altDown:{fill:Dn.RED,stroke:Nh.RED},altNeutral:{fill:Dn.GRAY,stroke:Nh.GRAY}}}getThemeParameters(){return{...super.getThemeParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,Dn.BLUE),e.set(rs,Dn.BLUE),e.set(Ta,"overlay"),e.set(Or,"left"),e.set(nu,"bottom"),e}},gs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Th={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},WU=class extends Uu{getDefaultColors(){return{...super.getDefaultColors(),fills:gs,fillsFallback:Object.values(gs),strokes:Th,sequentialColors:fn(gs),divergingColors:[gs.ORANGE,gs.YELLOW,gs.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[gs.GREEN,gs.YELLOW,gs.RED],up:{fill:gs.GREEN,stroke:Th.GREEN},down:{fill:gs.RED,stroke:Th.RED},neutral:{fill:gs.GRAY,stroke:Th.GRAY},altUp:{fill:gs.BLUE,stroke:Th.BLUE},altDown:{fill:gs.RED,stroke:Th.RED},altNeutral:{fill:gs.GRAY,stroke:Th.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,gs.BLUE),e.set(rs,gs.BLUE),e}},fs={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Oh={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},$U=class extends ra{getDefaultColors(){return{...super.getDefaultColors(),fills:fs,fillsFallback:Object.values(fs),strokes:Oh,sequentialColors:fn(fs),divergingColors:[fs.ORANGE,fs.YELLOW,fs.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[fs.GREEN,fs.YELLOW,fs.RED],up:{fill:fs.GREEN,stroke:Oh.GREEN},down:{fill:fs.RED,stroke:Oh.RED},neutral:{fill:fs.GRAY,stroke:Oh.GRAY},altUp:{fill:fs.BLUE,stroke:Oh.BLUE},altDown:{fill:fs.RED,stroke:Oh.RED},altNeutral:{fill:fs.GRAY,stroke:Oh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,fs.BLUE),e.set(rs,fs.BLUE),e}},Qt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ph={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},KU=class extends Uu{getDefaultColors(){return{fills:Qt,fillsFallback:Object.values(Qt),strokes:Ph,sequentialColors:fn(Qt),divergingColors:[Qt.BLUE,Qt.RED],hierarchyColors:[],secondSequentialColors:[Qt.BLUE,Qt.PURPLE,Qt.MAGENTA,Qt.PINK,Qt.RED,Qt.ORANGE,Qt.YELLOW,Qt.GREEN],secondDivergingColors:[Qt.BLUE,Qt.RED],secondHierarchyColors:[],up:{fill:Qt.GREEN,stroke:Ph.GREEN},down:{fill:Qt.RED,stroke:Ph.RED},neutral:{fill:Qt.GRAY,stroke:Ph.GRAY},altUp:{fill:Qt.BLUE,stroke:Ph.BLUE},altDown:{fill:Qt.RED,stroke:Ph.RED},altNeutral:{fill:Qt.GRAY,stroke:Ph.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,Qt.BLUE),e.set(rs,Qt.BLUE),e}},Jt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Eh={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},UU=class extends ra{getDefaultColors(){return{...super.getDefaultColors(),fills:Jt,fillsFallback:Object.values(Jt),strokes:Eh,sequentialColors:fn(Jt),divergingColors:[Jt.BLUE,Jt.RED],hierarchyColors:[],secondSequentialColors:[Jt.BLUE,Jt.PURPLE,Jt.MAGENTA,Jt.PINK,Jt.RED,Jt.ORANGE,Jt.YELLOW,Jt.GREEN],secondDivergingColors:[Jt.BLUE,Jt.RED],secondHierarchyColors:[],up:{fill:Jt.GREEN,stroke:Eh.GREEN},down:{fill:Jt.RED,stroke:Eh.RED},neutral:{fill:Jt.GRAY,stroke:Eh.GRAY},altUp:{fill:Jt.BLUE,stroke:Eh.BLUE},altDown:{fill:Jt.RED,stroke:Eh.RED},altNeutral:{fill:Jt.GRAY,stroke:Eh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,Jt.BLUE),e.set(rs,Jt.BLUE),e}},Ti={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},oc={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},YU=class extends Uu{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ti,RED:Ti.ORANGE},fillsFallback:Object.values({...Ti,RED:Ti.ORANGE}),strokes:{...oc,RED:oc.ORANGE},sequentialColors:fn({...Ti,RED:Ti.ORANGE}),divergingColors:[Ti.ORANGE,Ti.YELLOW,Ti.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Ti.GREEN,Ti.YELLOW,Ti.ORANGE],up:{fill:Ti.GREEN,stroke:oc.GREEN},down:{fill:Ti.ORANGE,stroke:oc.ORANGE},neutral:{fill:Ti.GRAY,stroke:oc.GRAY},altUp:{fill:Ti.BLUE,stroke:oc.BLUE},altDown:{fill:Ti.ORANGE,stroke:oc.ORANGE},altNeutral:{fill:Ti.GRAY,stroke:oc.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,Ti.BLUE),e.set(rs,Ti.BLUE),e}},_i={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},Zr={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},ZU=class extends ra{getDefaultColors(){return{...super.getDefaultColors(),fills:{..._i,RED:_i.ORANGE},fillsFallback:Object.values({..._i,RED:_i.ORANGE}),strokes:{...Zr,RED:Zr.ORANGE},sequentialColors:fn({..._i,RED:_i.ORANGE}),divergingColors:[_i.ORANGE,_i.YELLOW,_i.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[_i.GREEN,_i.YELLOW,_i.ORANGE],secondHierarchyColors:[],up:{fill:_i.GREEN,stroke:Zr.GREEN},down:{fill:_i.ORANGE,stroke:Zr.ORANGE},neutral:{fill:Zr.GRAY,stroke:Zr.GRAY},altUp:{fill:_i.BLUE,stroke:Zr.BLUE},altDown:{fill:_i.ORANGE,stroke:Zr.ORANGE},altNeutral:{fill:_i.GRAY,stroke:Zr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,_i.BLUE),e.set(rs,_i.BLUE),e}},Yu={enabled:E,text:L,padding:_n,border:Sr,cornerRadius:$,...$e,...ie},Xr=Ve({enabled:E,type:j(U("line","range")),range:We(Ve((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),xe(le),br(2,2)),value:We(Ve((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),le),label:Yu,fill:J,fillOpacity:oe,...X,...ae},"cross-line options"),FO={...Xr,label:{...Yu,position:U("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:$}},ac={enabled:E,rotation:$,avoidCollisions:E,minSpacing:P,spacing:P,formatter:Ki(pn),itemStyler:Xe({...$e,...Hn,spacing:$}),...$e,...Hn},Mb={autoRotate:E,autoRotateAngle:$,wrapping:U("never","always","hyphenate","on-space"),truncate:E,...ac},_O={format:gn,...Mb},Db={format:Ie(L,xr),...Mb},HO={enabled:E,width:P,size:P,stroke:J},PI={enabled:E,label:Db,tick:HO},GO={values:xe(le),minSpacing:P},Zu={reverse:E,gridLine:{enabled:E,width:P,style:Ft({fill:J,fillOpacity:P,stroke:Ie(J,Fd),strokeWidth:P,lineDash:xe(P)},"a grid-line style object array")},interval:GO,label:ac,line:{enabled:E,width:P,stroke:J},tick:HO,context:()=>!0};Zu.layoutConstraints=Q({stacked:j(E),align:j(U("start","end")),unit:j(U("percent","px")),width:j(P)});var EI={enabled:E,text:pn,spacing:P,maxWidth:P,maxHeight:P,wrapping:U("never","always","hyphenate","on-space"),truncate:E,formatter:Ki(pn),...$e},rc={...Zu,title:EI,crossAt:{value:j(Ie($,ns,L,xe(L))),sticky:E},crossLines:Ft(FO,"a cross-line options array"),position:U("top","right","bottom","left"),thickness:P,maxThicknessRatio:oe};rc.title._enabledFromTheme=Q(E);var Ib={enabled:E,...ie,...X,...ae};function Rh(e,t){const i={enabled:E,xOffset:$,yOffset:$,formatter:Ki(L),renderer:Ki(Ie(L,Et({text:L,color:J,backgroundColor:J,opacity:oe},"crosshair label renderer result object")))};let s;return e&&(s={...i,format:t?Ie(L,Et({millisecond:L,second:L,hour:L,day:L,month:L,year:L})):L}),{enabled:E,snap:E,label:s??i,...X,...ae}}function Lf(e,t){return{min:We(e,os("max")),max:We(e,as("min")),preferredMin:We(e,os("preferredMax"),os("max")),preferredMax:We(e,as("preferredMin"),as("min")),nice:E,interval:{step:t?Ie(un,Ll,Yc):un,values:xe(e),minSpacing:We(P,os("maxSpacing")),maxSpacing:We(P,as("minSpacing"))}}}var jO={step:Ie(un,Ll,Yc),values:xe(Ie($,ns)),minSpacing:We(P,os("maxSpacing")),maxSpacing:We(P,as("minSpacing")),placement:U("on","between")},Xu={...rc,type:Ce("category"),label:Mb,paddingInner:oe,paddingOuter:oe,groupPaddingInner:oe,crosshair:Rh(),bandAlignment:U("justify","start","center","end"),bandHighlight:Ib,interval:{...GO,placement:U("on","between")},skipNullBars:E},qu={...rc,type:Ce("grouped-category"),label:Mb,crosshair:Rh(),bandHighlight:Ib,paddingInner:oe,groupPaddingInner:oe,depthOptions:Ft({label:{enabled:E,avoidCollisions:E,wrapping:U("never","always","hyphenate","on-space"),truncate:E,rotation:$,spacing:$,...$e,...Hn},tick:{enabled:E,stroke:J,width:P}},"depth options objects array")},Qu={...rc,...Lf($),type:Ce("number"),label:_O,crosshair:Rh(!0)},Ju={...rc,...Lf($),type:Ce("log"),base:We(un,Ve(e=>e!==1,"not equal to 1")),label:_O,crosshair:Rh(!0)},ep={...rc,...Lf(Ie($,ns),!0),type:Ce("time"),label:Db,parentLevel:PI,crosshair:Rh(!0,!0)},tp={...rc,type:Ce("unit-time"),unit:Ie(Yc,Ll),label:Db,parentLevel:PI,paddingInner:oe,paddingOuter:oe,groupPaddingInner:oe,crosshair:Rh(!0,!0),bandAlignment:U("justify","start","center","end"),bandHighlight:Ib,skipNullBars:E,min:We(Ie($,ns),os("max")),max:We(Ie($,ns),as("min")),preferredMin:We(Ie($,ns),os("preferredMax"),os("max")),preferredMax:We(Ie($,ns),as("preferredMin"),as("min")),interval:jO},ip={...rc,type:Ce("ordinal-time"),paddingInner:oe,paddingOuter:oe,groupPaddingInner:oe,label:Db,parentLevel:PI,interval:jO,crosshair:Rh(!0,!0),bandHighlight:Ib,bandAlignment:U("justify","start","center","end"),skipNullBars:E},WO={...Zu,...Lf($),type:Ce("angle-number"),crossLines:Ft(Xr),startAngle:$,endAngle:$,label:{...ac,orientation:U("fixed","parallel","perpendicular"),format:gn}},RI={...Zu,type:Ce("angle-category"),shape:U("polygon","circle"),crossLines:Ft(Xr),startAngle:$,endAngle:$,paddingInner:oe,groupPaddingInner:oe,label:{...ac,orientation:U("fixed","parallel","perpendicular")}};RI.innerRadiusRatio=oe;var $O={...Zu,...Lf($),type:Ce("radius-number"),shape:U("polygon","circle"),positionAngle:$,innerRadiusRatio:oe,title:EI,crossLines:Ft({...Xr,label:{...Yu,positionAngle:$}},"cross-line options"),label:{...ac,format:gn}},KO={...Zu,type:Ce("radius-category"),positionAngle:$,innerRadiusRatio:oe,paddingInner:oe,paddingOuter:oe,groupPaddingInner:oe,label:ac,title:EI,crossLines:Ft({...Xr,label:{...Yu,positionAngle:$}},"cross-line options")},UO=_t(It,It),XU=Xe({...X,...ie,...ae,marker:Ir}),YO={showInMiniChart:E,connectMissingData:E,interpolation:kg,label:ft,styler:XU,marker:So,tooltip:W0,shadow:$o,...Ke,...ie,...X,...ae,highlight:UO,segmentation:Ia},zI={...YO,...qe,highlight:UO,type:j(Ce("area")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,legendItemName:L,stacked:E,stackGroup:L,normalizedTo:$};zI.selectedKey=Q(L);var ZO=_t(vo,vo),XO=Xe({...ie,...X,...ae,cornerRadius:P}),VI={direction:U("horizontal","vertical"),showInMiniChart:E,cornerRadius:P,styler:XO,itemStyler:XO,crisp:E,label:{...ft,placement:U("inside-center","inside-start","inside-end","outside-start","outside-end"),spacing:P},errorBar:Gd,shadow:$o,tooltip:Ue,...Ke,highlight:ZO,...ie,...X,...ae,segmentation:Ia,width:un,widthRatio:oe};VI.sparklineMode=Q(E);var sp={...VI,...qe,highlight:ZO,type:j(Ce("bar")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,direction:U("horizontal","vertical"),grouped:E,stacked:E,stackGroup:L,normalizedTo:$,legendItemName:L,errorBar:jd};sp.yFilterKey=Q(L),sp.pickOutsideVisibleMinorAxis=Q(E),sp.focusPriority=Q($),sp.simpleItemStyler=Q(at);var qO={title:L,domain:xe($),maxSize:P,showInMiniChart:E,label:{placement:U("top","right","bottom","left"),...ft},tooltip:Ue,styler:Xe({...So,maxSize:P}),maxRenderedItems:$,...Ke,...ee(So,["enabled"]),highlight:_t(It,It)},QO={...qO,...qe,type:j(Ce("bubble")),xKey:j(L),yKey:j(L),sizeKey:j(L),labelKey:L,xName:L,yName:L,sizeName:L,labelName:L,legendItemName:L,xKeyAxis:L,yKeyAxis:L,highlight:_t(It,It)};QO.selectedKey=Q(L);var JO={showInMiniChart:E,cornerRadius:P,label:ft,tooltip:Ue,shadow:$o,...Ke,...ie,...X,...ae,highlight:_t(It,It),areaPlot:E,aggregation:U("count","sum","mean"),bins:xe(xe($)),binCount:P},qU={...qe,...JO,type:j(Ce("histogram")),xKey:j(L),yKey:L,xKeyAxis:L,yKeyAxis:L,xName:L,yName:L},e2=_t(It,vr),QU=Xe({...X,...ae,marker:Ir}),BI={title:L,showInMiniChart:E,connectMissingData:E,interpolation:kg,label:ft,styler:QU,marker:So,tooltip:Ue,errorBar:Gd,...Ke,...X,...ae,highlight:e2,segmentation:B0};BI.sparklineMode=Q(E);var Nf={...BI,...qe,highlight:e2,type:j(Ce("line")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,stacked:E,stackGroup:L,normalizedTo:$,legendItemName:L,errorBar:jd};Nf.selectedKey=Q(L),Nf.pickOutsideVisibleMinorAxis=Q(E),Nf.focusPriority=Q($);var t2={title:L,showInMiniChart:E,label:{placement:U("top","right","bottom","left"),...ft},tooltip:Ue,errorBar:Gd,styler:Xe(So),maxRenderedItems:$,...Ke,...ee(So,["enabled"]),highlight:_t(It,It)},i2={...t2,...qe,type:j(Ce("scatter")),xKey:j(L),yKey:j(L),labelKey:L,xName:L,yName:L,labelName:L,legendItemName:L,xKeyAxis:L,yKeyAxis:L,errorBar:jd,highlight:_t(It,It)};i2.selectedKey=Q(L);var s2=_t(It,It),FI={...Ke,radiusMin:P,radiusMax:P,rotation:$,outerRadiusOffset:$,outerRadiusRatio:oe,hideZeroValueSectorsInLegend:E,sectorSpacing:P,cornerRadius:P,itemStyler:Xe({...ie,...X,...ae,cornerRadius:P}),title:{enabled:E,text:L,showInLegend:E,spacing:P,...$e},calloutLabel:{enabled:E,offset:$,minAngle:P,avoidCollisions:E,formatter:Ki(pn),format:L,itemStyler:Xe({enabled:E,...Hn,...$e}),...Hn,...$e},sectorLabel:{enabled:E,positionOffset:$,positionRatio:oe,formatter:Ki(pn),format:L,itemStyler:Xe({enabled:E,...Hn,...$e}),...Hn,...$e},calloutLine:{colors:xe(J),length:P,strokeWidth:P,itemStyler:Xe({color:J,length:P,strokeWidth:P})},fills:xe(Ls),strokes:xe(J),tooltip:Ue,shadow:$o,highlight:s2,...ae,...ee(ie,["fill"]),...ee(X,["stroke"])},_a={...FI,...qe,type:j(Ce("pie")),angleKey:j(L),radiusKey:L,calloutLabelKey:L,sectorLabelKey:L,legendItemKey:L,angleName:L,radiusName:L,calloutLabelName:L,sectorLabelName:L,highlight:s2};_a.angleFilterKey=Q(L),_a.defaultColorRange=Q(xe(xe(J))),_a.defaultPatternFills=Q(xe(J)),_a.title._enabledFromTheme=Q(E),_a.calloutLabel._enabledFromTheme=Q(E),_a.sectorLabel._enabledFromTheme=Q(E),_a.angleKeyAxis=Q(L),_a.radiusKeyAxis=Q(L);var n2={...FI,innerRadiusOffset:$,innerRadiusRatio:oe,innerCircle:{fill:L,fillOpacity:oe},innerLabels:{spacing:P,...$e,...Hn}},o2={...n2,..._a,type:j(Ce("donut")),innerLabels:Ft({text:j(L),spacing:P,...$e,...Hn},"inner label options array")};o2.angleFilterKey=Q(L);var np={lineStyle:U("solid","dashed","dotted"),...ae},zh={...ie,...X,...ae},Tf={visible:E,locked:E,readOnly:E,handle:zh,...$e},kb={position:U("top","center","bottom"),alignment:U("left","center","right"),...$e},a2={position:U("top","inside","bottom"),alignment:U("left","center","right"),...$e},JU={enabled:E,cornerRadius:P,...$e,...ie,...X,...ae},e3={visible:E,...np,...X},r2={divider:X,...ie,...X,...$e},l2={handle:zh,statistics:r2,...np,...ie,...X},Ab={visible:E,locked:E,readOnly:E,extendStart:E,extendEnd:E,handle:zh,text:kb,...np,...X},_I={visible:E,locked:E,readOnly:E,axisLabel:JU,handle:zh,text:kb,...np,...X},c2={visible:E,locked:E,readOnly:E,extendStart:E,extendEnd:E,handle:zh,text:a2,background:ie,...np,...X},h2={...c2},d2={...c2,middle:e3},HI={label:$e,showFill:E,isMultiColor:E,strokes:xe(J),rangeStroke:J,bands:U(4,6,10),...Ab},u2={...ie,...X,...Tf},p2={...ie,...X,...Tf},g2={...ie,...X,...Tf,background:{...ie,...X}},GI={visible:E,locked:E,readOnly:E,handle:zh,...ie},wb={visible:E,locked:E,readOnly:E,extendStart:E,extendEnd:E,handle:zh,text:kb,background:ie,statistics:r2,...np,...X},f2={visible:E,up:l2,down:l2},op={enabled:E,axesButtons:{enabled:E,axes:U("x","y","xy")},toolbar:{enabled:E,padding:P,buttons:Ft({...Dr,value:U("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:E,buttons:xe(Ie(Et({...Dr,value:j(U("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),Et({...Dr,value:j(U("lock")),checkedOverrides:Dr})))}};op.data=Q(dn),op.xKey=Q(L),op.volumeKey=Q(L),op.snap=Q(E);var Ha={...ie,...X,opacity:oe},m2={...ie,...X,...ae,cornerRadius:P,whisker:{...X,...ae},cap:{lengthRatio:oe}},y2={...m2,opacity:oe},x2=Xe({...ie,...X,...ae,cornerRadius:P,whisker:{...X,...ae},cap:{lengthRatio:oe}}),b2={direction:U("horizontal","vertical"),showInMiniChart:E,styler:x2,itemStyler:x2,tooltip:Ue,...Ke,...m2,highlight:_t(y2,y2),segmentation:Ia,width:un,widthRatio:oe},jI={cornerRadius:P,wick:{...X,...ae},...ie,...X,...ae},v2={...jI,opacity:oe},S2={item:{up:jI,down:jI},itemStyler:Xe({...ie,...X,...ae,cornerRadius:P,wick:{...X,...ae}}),showInMiniChart:E,tooltip:Ue,...Ke,highlight:_t(v2,v2)},M2={fills:xe(Ls),strokes:xe(J),label:{spacing:P,maxWidth:P,...ft},link:{tension:oe,itemStyler:Xe({...ie,...X,...ae,tension:oe}),...ie,...X,...ae},node:{width:P,spacing:P,itemStyler:Xe({...ie,...X,...ae}),...ie,...X,...ae},tooltip:Ue,...Ke},D2={direction:U("horizontal","vertical"),fills:xe(Ls),strokes:xe(J),label:{spacing:P,placement:U("before","middle","after"),...ft},stageLabel:{placement:U("before","after"),format:gn,...ac},tooltip:Ue,...ee(Ke,["showInLegend"]),...ee(ie,["fill"]),...ee(X,["stroke"]),...ae,highlight:fy(vr)},I2={direction:U("horizontal","vertical"),fills:xe(Ls),strokes:xe(J),itemStyler:Xe({...ie,...X,...ae}),spacingRatio:oe,crisp:E,dropOff:{enabled:E,...ie,...X,...ae},stageLabel:{placement:U("before","after"),format:gn,...ac},label:ft,tooltip:Ue,shadow:$o,...ee(Ke,["showInLegend"]),...ee(ie,["fill"]),...ee(X,["stroke"]),...ae},k2={title:L,textAlign:U("left","center","right"),verticalAlign:U("top","middle","bottom"),itemPadding:P,itemStyler:Xe({...ie,...X}),showInMiniChart:E,label:kr,tooltip:Ue,...Ke,...X},A2={showInMiniChart:E,itemStyler:Xe({...X,...ae}),item:{up:{...X,...ae},down:{...X,...ae}},tooltip:Ue,...Ke,highlight:_t(vr,vr)},w2={maxStrokeWidth:P,itemStyler:Xe({...X,...ae}),sizeDomain:xe(P),label:ft,tooltip:Ue,...Ke,...X,...ae,highlight:_t(vr,vr)},C2={...X,...ae},L2={colorRange:xe(J),maxSize:P,sizeDomain:xe(P),label:{placement:U("top","bottom","left","right"),...ft},tooltip:Ue,...Ke,...ee(So,["enabled"]),highlight:_t(It,It)},N2={colorRange:xe(J),padding:P,itemStyler:Xe({...ie,...X,...ae}),label:kr,tooltip:Ue,...Ke,...ie,...X,...ae,highlight:_t(It,It)},T2={...Ke,...ie,...X,...ae},ap=Xe({...ie,...X,...ae,cornerRadius:P}),O2={cornerRadius:P,styler:ap,itemStyler:ap,label:ft,tooltip:Ue,...Ke,...ie,...X,...ae,highlight:_t(vo,vo)},P2={direction:U("horizontal","vertical"),aspectRatio:P,spacing:P,reverse:E,itemStyler:Xe({...ie,...X,...ae}),fills:xe(Ls),strokes:xe(J),label:ft,stageLabel:{spacing:P,placement:U("before","after"),...ft},tooltip:Ue,shadow:$o,...Ke,...ee(ie,["fill"]),...ee(X,["stroke"]),...ae},E2={connectMissingData:E,marker:So,styler:Xe({marker:Ir,...ie,...X,...ae}),label:ft,tooltip:Ue,...Ke,...ie,...X,...ae,highlight:_t(It,It)},R2={connectMissingData:E,marker:So,styler:Xe({marker:Ir,...X,...ae}),label:ft,tooltip:Ue,...Ke,...X,...ae,highlight:_t(It,vr)},z2={cornerRadius:P,styler:ap,itemStyler:ap,label:ft,tooltip:Ue,...Ke,...ie,...X,...ae,highlight:_t(vo,vo)},V2={cornerRadius:P,columnWidthRatio:oe,maxColumnWidthRatio:oe,styler:ap,itemStyler:ap,label:ft,tooltip:Ue,...Ke,...ie,...X,...ae,highlight:_t(vo,vo)},t3={marker:So,...X,...ae},B2={marker:{enabled:E,...Ir},...X,...ae},F2={marker:Ir,...X,...ae},_2={showInMiniChart:E,connectMissingData:E,interpolation:kg,label:{...ft,placement:U("inside","outside"),spacing:P},tooltip:Ue,shadow:$o,...Ke,...ie,...t3,item:{low:{...B2},high:{...B2}},styler:Xe({...ie,item:{low:{...F2},high:{...F2}}}),highlight:_t(It,It),segmentation:Ia,invertedStyle:{enabled:E,...ie}},H2=Xe({...ie,...X,...ae,cornerRadius:P}),G2={direction:U("horizontal","vertical"),grouped:E,showInMiniChart:E,cornerRadius:P,styler:H2,itemStyler:H2,label:{...ft,placement:U("inside","outside"),spacing:P},tooltip:Ue,shadow:$o,...Ke,...ie,...X,...ae,highlight:_t(vo,vo),segmentation:Ia,width:un,widthRatio:oe},j2={fills:xe(Ls),strokes:xe(J),label:{...ft,spacing:P,placement:U("left","right","center"),edgePlacement:U("inside","outside")},link:{itemStyler:Xe({...ie,...X,...ae}),...ie,...X,...ae},node:{width:P,spacing:P,minSpacing:We(P,L0("spacing")),alignment:U("left","center","right","justify"),verticalAlignment:U("top","bottom","center"),sort:U("data","ascending","descending","auto"),itemStyler:Xe({...ie,...X,...ae}),...ie,...X,...ae},tooltip:Ue,...Ke},W2={fills:xe(Ls),strokes:xe(J),colorRange:xe(J),sectorSpacing:P,cornerRadius:P,padding:P,itemStyler:Xe({...ie,...X}),label:{spacing:P,...kr},secondaryLabel:kr,tooltip:Ue,...ee(Ke,["highlight","showInLegend"]),...ee(ie,["fill"]),...ee(X,["stroke"]),highlight:{highlightedItem:Ha,highlightedBranch:Ha,unhighlightedItem:Ha,unhighlightedBranch:Ha}},$2={fills:xe(Ls),strokes:xe(J),colorRange:xe(J),itemStyler:Xe({...ie,...X}),group:{gap:P,padding:P,cornerRadius:P,textAlign:U("left","center","right"),interactive:E,highlight:{highlightedItem:Ha,unhighlightedItem:Ha},label:{...ft,spacing:P},...ie,...X},tile:{gap:P,padding:P,cornerRadius:P,textAlign:U("left","center","right"),verticalAlign:U("top","middle","bottom"),label:{...ft,spacing:P,lineHeight:P,minimumFontSize:P,wrapping:U("never","always","hyphenate","on-space"),overflowStrategy:U("ellipsis","hide")},secondaryLabel:{...ft,lineHeight:P,minimumFontSize:P,wrapping:U("never","always","hyphenate","on-space"),overflowStrategy:U("ellipsis","hide")},highlight:{highlightedItem:Ha,highlightedBranch:Ha,unhighlightedItem:Ha,unhighlightedBranch:Ha},...ie,...X},tooltip:Ue,...ee(Ke,["highlight","showInLegend"])},WI={name:L,cornerRadius:P,itemStyler:Xe({...ie,...X,...ae,cornerRadius:P}),label:{...ft,placement:U("inside-start","inside-center","inside-end","outside-start","outside-end"),spacing:P},tooltip:Ue,shadow:$o,...ie,...X,...ae},K2={direction:U("horizontal","vertical"),showInMiniChart:E,item:{positive:WI,negative:WI,total:WI},line:{enabled:E,...X,...ae},tooltip:Ue,width:un,widthRatio:oe,...Ke},Cb=Et({__type:j(Ce("date")),value:Ie(L,$)},"a serializable date object"),U2={width:P,height:P,grip:E,fill:J,stroke:J,strokeWidth:P,cornerRadius:P},st={enabled:E,height:P,spacing:P,cornerRadius:$,mask:{fill:J,fillOpacity:oe,stroke:J,strokeWidth:P},minHandle:U2,maxHandle:U2,miniChart:{enabled:E,padding:{top:P,bottom:P},label:{enabled:E,avoidCollisions:E,spacing:P,format:gn,formatter:Ki(pn),interval:{minSpacing:P,maxSpacing:P,values:dn,step:$},...$e},series:le}},$I={...ie,...X,...ae,cornerRadius:P,opacity:oe},Y2={...$I,minSize:P,hoverStyle:{fill:ie.fill,stroke:X.stroke}},Z2={enabled:E,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:$I,thumb:Y2},i3={...Z2,position:U("top","bottom")},s3={...Z2,position:U("left","right")},Rs={enabled:E,enableAxisScrolling:E,enableSeriesAreaScrolling:E,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:$I,thumb:Y2,horizontal:i3,vertical:s3},Vh=ee(FO,["type","value","range"]),zs={number:{...ee(Qu,["type","crossLines"]),top:ee(Qu,["type","crossLines","position"]),right:ee(Qu,["type","crossLines","position"]),bottom:ee(Qu,["type","crossLines","position"]),left:ee(Qu,["type","crossLines","position"]),crossLines:Vh},log:{...ee(Ju,["type","crossLines"]),top:ee(Ju,["type","crossLines","position"]),right:ee(Ju,["type","crossLines","position"]),bottom:ee(Ju,["type","crossLines","position"]),left:ee(Ju,["type","crossLines","position"]),crossLines:Vh},category:{...ee(Xu,["type","crossLines"]),top:ee(Xu,["type","crossLines","position"]),right:ee(Xu,["type","crossLines","position"]),bottom:ee(Xu,["type","crossLines","position"]),left:ee(Xu,["type","crossLines","position"]),crossLines:Vh},time:{...ee(ep,["type","crossLines"]),top:ee(ep,["type","crossLines","position"]),right:ee(ep,["type","crossLines","position"]),bottom:ee(ep,["type","crossLines","position"]),left:ee(ep,["type","crossLines","position"]),crossLines:Vh},"unit-time":{...ee(tp,["type","crossLines"]),top:ee(tp,["type","crossLines","position"]),right:ee(tp,["type","crossLines","position"]),bottom:ee(tp,["type","crossLines","position"]),left:ee(tp,["type","crossLines","position"]),crossLines:Vh},"grouped-category":{...ee(qu,["type"]),top:ee(qu,["type","position"]),right:ee(qu,["type","position"]),bottom:ee(qu,["type","position"]),left:ee(qu,["type","position"]),crossLines:Vh},"ordinal-time":{...ee(ip,["type","crossLines"]),top:ee(ip,["type","crossLines","position"]),right:ee(ip,["type","crossLines","position"]),bottom:ee(ip,["type","crossLines","position"]),left:ee(ip,["type","crossLines","position"]),crossLines:Vh}},rp={"angle-category":{...ee(RI,["type","crossLines"]),crossLines:ee(Xr,["type"])},"angle-number":{...ee(WO,["type","crossLines"]),crossLines:ee(Xr,["type"])},"radius-category":{...ee(KO,["type","crossLines"]),crossLines:{...ee(Xr,["type"]),label:{...Yu,positionAngle:$}}},"radius-number":{...ee($O,["type","crossLines"]),crossLines:{...ee(Xr,["type"]),label:{...Yu,positionAngle:$}}}},ct={visible:Q(E)},n3={common:{...we,navigator:st,scrollbar:Rs,axes:{...zs,...rp},annotations:{...op,line:Ab,"horizontal-line":_I,"vertical-line":_I,"disjoint-channel":h2,"parallel-channel":d2,"fibonacci-retracement":HI,"fibonacci-retracement-trend-based":HI,callout:u2,comment:p2,note:g2,text:Tf,arrow:Ab,"arrow-up":GI,"arrow-down":GI,"date-range":wb,"price-range":wb,"date-price-range":wb,"quick-date-price-range":f2},chartToolbar:{enabled:E},initialState:{legend:Ft({visible:E,seriesId:L,itemId:L,legendItemName:L},"legend state array"),zoom:{rangeX:{start:Ie($,Cb),end:Ie($,Cb)},rangeY:{start:Ie($,Cb),end:Ie($,Cb)},ratioX:{start:oe,end:oe},ratioY:{start:oe,end:oe},autoScaledAxes:xe(Ce("y"))}}},line:{...we,axes:zs,series:BI,navigator:st,scrollbar:Rs,...ct},scatter:{...we,axes:zs,series:t2,navigator:st,scrollbar:Rs,...ct,paired:Q(E)},bubble:{...we,axes:zs,series:qO,navigator:st,scrollbar:Rs,...ct},area:{...we,axes:zs,series:YO,navigator:st,scrollbar:Rs,...ct},bar:{...we,axes:zs,series:VI,navigator:st,scrollbar:Rs,...ct},"box-plot":{...we,axes:zs,series:b2,navigator:st,scrollbar:Rs,...ct},candlestick:{...we,axes:zs,series:S2,navigator:st,scrollbar:Rs,...ct},"cone-funnel":{...we,axes:zs,series:D2,navigator:st,scrollbar:Rs,...ct},funnel:{...we,axes:zs,series:I2,navigator:st,scrollbar:Rs,...ct},ohlc:{...we,axes:zs,series:A2,navigator:st,scrollbar:Rs,...ct},histogram:{...we,axes:ee(zs,["category","grouped-category","unit-time","ordinal-time"]),series:JO,navigator:st,scrollbar:Rs,...ct},heatmap:{...we,axes:zs,series:k2,navigator:st,scrollbar:Rs,...ct},waterfall:{...we,axes:zs,series:K2,navigator:st,scrollbar:Rs,...ct},"range-bar":{...we,axes:zs,series:G2,navigator:st,scrollbar:Rs,...ct},"range-area":{...we,axes:zs,series:_2,navigator:st,scrollbar:Rs,...ct},donut:{...we,series:n2,navigator:st,...ct},pie:{...we,series:FI,navigator:st,...ct},"radar-line":{...we,axes:rp,series:R2,navigator:st,...ct},"radar-area":{...we,axes:rp,series:E2,navigator:st,...ct},"radial-bar":{...we,axes:rp,series:z2,navigator:st,...ct},"radial-column":{...we,axes:rp,series:V2,navigator:st,...ct},nightingale:{...we,axes:rp,series:O2,navigator:st,...ct},sunburst:{...we,series:W2,navigator:st,...ct},treemap:{...we,series:$2,navigator:st,...ct},"map-shape":{...we,series:N2,navigator:st,...ct},"map-line":{...we,series:w2,navigator:st,...ct},"map-marker":{...we,series:L2,navigator:st,...ct},"map-shape-background":{...we,series:T2,navigator:st,...ct},"map-line-background":{...we,series:C2,navigator:st,...ct},sankey:{...we,series:j2,navigator:st,...ct},chord:{...we,series:M2,navigator:st,...ct},pyramid:{...we,series:P2,navigator:st,...ct},"radial-gauge":{...we,...Eg,targets:ee(Og,["value"]),tooltip:{...Eg.tooltip,...we.tooltip}},"linear-gauge":{...we,...Pg,targets:ee(Tg,["value"]),tooltip:{...Pg.tooltip,...we.tooltip}}};function Lb(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var o3=Lb(n3,function e(t,i){if(Od(i))return t;if(jo(t))return Ie(t,Fd,Od);if(me(t))return Ie(Et(Ed in t?Lb(t,s=>me(s)?Lb(s,e):s):Lb(t,e)),Fd,Od);throw new Error(`Invalid theme override value: ${String(t)}`)}),ms={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Bh={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},a3=class extends Uu{getDefaultColors(){return{fills:ms,fillsFallback:Object.values(ms),strokes:Bh,sequentialColors:fn(ms),divergingColors:[ms.ORANGE,ms.YELLOW,ms.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ms.GREEN,ms.YELLOW,ms.RED],secondHierarchyColors:[],up:{fill:ms.GREEN,stroke:Bh.GREEN},down:{fill:ms.RED,stroke:Bh.RED},neutral:{fill:ms.GRAY,stroke:Bh.GRAY},altUp:{fill:ms.BLUE,stroke:Bh.BLUE},altDown:{fill:ms.ORANGE,stroke:Bh.ORANGE},altNeutral:{fill:ms.GRAY,stroke:Bh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,ms.BLUE),e.set(rs,ms.BLUE),e}},ys={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},Fh={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},r3=class extends ra{getDefaultColors(){return{...super.getDefaultColors(),fills:ys,fillsFallback:Object.values(ys),strokes:Fh,sequentialColors:fn(ys),divergingColors:[ys.ORANGE,ys.YELLOW,ys.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[ys.GREEN,ys.YELLOW,ys.RED],secondHierarchyColors:[],up:{fill:ys.GREEN,stroke:Fh.GREEN},down:{fill:ys.RED,stroke:Fh.RED},neutral:{fill:ys.GRAY,stroke:Fh.GRAY},altUp:{fill:ys.BLUE,stroke:Fh.BLUE},altDown:{fill:ys.ORANGE,stroke:Fh.ORANGE},altNeutral:{fill:ys.GRAY,stroke:Fh.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(Ts,ys.BLUE),e.set(rs,ys.BLUE),e}},KI=Ui(()=>new ra),l3=ve.create(!0,"perf"),la=(e,t,i)=>{l3("[CACHE] ChartTheme",e,t.name,i)},UI={"ag-default-dark":Ui(()=>new Uu),"ag-sheets-dark":Ui(()=>new YU,la),"ag-polychroma-dark":Ui(()=>new KU,la),"ag-vivid-dark":Ui(()=>new a3,la),"ag-material-dark":Ui(()=>new WU,la),"ag-financial-dark":Ui(()=>new GU,la),"ag-default":KI,"ag-sheets":Ui(()=>new ZU,la),"ag-polychroma":Ui(()=>new UU,la),"ag-vivid":Ui(()=>new r3,la),"ag-material":Ui(()=>new $U,la),"ag-financial":Ui(()=>new jU,la)},Nb=Ui(c3,la);function c3(e){if(e instanceof ra)return e;if(!p3(e))return KI();if(e==null||typeof e=="string"){const n=UI[e??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=ki(h3(e),d3,"theme");for(const n of i)W.warnOnce(String(n));const s=t?.baseTheme?Nb(t.baseTheme):KI();return t?new s.constructor(t):s}function h3(e){if(!me(e)||!me(e.baseTheme))return e;let t=e,i,s;const n=[];for(;typeof t=="object";)i??(i=t.palette),s??(s=t.params),t.overrides&&n.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:ce(...n),params:s,palette:i}}var d3={baseTheme:Ie(L,xr),overrides:o3,params:{accentColor:J,axisColor:J,backgroundColor:J,borderColor:J,borderRadius:$,chartBackgroundColor:J,chartPadding:$,focusShadow:L,foregroundColor:J,fontFamily:Sg,fontSize:$,fontWeight:_d,gridLineColor:J,popupShadow:L,subtleTextColor:J,textColor:J,separationLinesColor:J,chromeBackgroundColor:J,chromeFontFamily:Sg,chromeFontSize:$,chromeFontWeight:_d,chromeSubtleTextColor:J,chromeTextColor:J,buttonBackgroundColor:J,buttonBorder:E,buttonFontWeight:_d,buttonTextColor:J,inputBackgroundColor:J,inputBorder:E,inputTextColor:J,menuBackgroundColor:J,menuBorder:E,menuTextColor:J,panelBackgroundColor:J,panelSubtleTextColor:J,tooltipBackgroundColor:J,tooltipBorder:E,tooltipTextColor:J,tooltipSubtleTextColor:J,crosshairLabelBackgroundColor:J,crosshairLabelTextColor:J},palette:{fills:xe(Ls),strokes:xe(J),up:{fill:Ie(J,yg),stroke:J},down:{fill:Ie(J,yg),stroke:J},neutral:{fill:Ie(J,yg),stroke:J}}},u3=U("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function p3(e){const{invalid:t}=ki({theme:e},{theme:Ie(u3,xr)});for(const i of t)W.warnOnce(String(i));return t.length===0}var Bt="path",No="pathArray",Ot="default",In="override",xs="user",lc="userPartial",Ga="operation",ja="operationValue",lp="dependency",YI="autoEnable",X2="autoEnableValue",q2="prune",Q2="childrenSource";function ZI(e){return gt(e)&&e>=0&&e<=1}function Of(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return!1;i=i[s]}return!0}function Ji(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function cp(e,t,i){const s=t.length;if(s===0)return;let n=e;const o=s-1,a=t[o];for(let r=0;r=0;s--){const n=e[s];if(g3.test(n)&&(i++,i>t))return s}return-1}function hp(e,t=0){const i=f3(e,t);return Number(e[i])}function _h(e,t,i){const s=t.split("/");let n=[...e];t.startsWith("/")&&(n=[],s.shift());let o=!1;for(const a of s){if(a==="..")n.pop(),o||n.pop();else if(a===".")n.pop();else if(a==="$index"){const r=hp(e);if(Number.isNaN(r))return Wa;n.push(`${r}`)}else if(a==="$prevIndex"){const r=hp(e);if(Number.isNaN(r)||Number(r)<=0)return Wa;n.push(`${Number(r)-1}`)}else if(a.startsWith("$")){const r=i?.[a.slice(1)];if(r==null)return Wa;n.push(r)}else a.length!==0&&n.push(a);o=a===".."}return n}var Wa=Symbol("unresolvable-path"),kn=Symbol("resolved-to-branch");function Pf(e,t){if(e==null||typeof e!="object"||Array.isArray(e)||(t??(t=Object.keys(e)),t.length===0))return;const i=t[0];if(iP.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function m3(e,t,i){const s=Pf(e.getVertexValue(i));switch(s?.operation){case"$path":{const[n]=s.values,o=e.getPathArray(t),a=_h(o,n);return a===Wa?void 0:e.findVertexAtPath(a)}case"$value":return t}}var y3={$cacheMax:x3};function x3(e,t,i){const[s]=i,n=e.getPathArray(t),o=e.getCachedValue(n,"$cacheMax"),a=e.resolveVertexValue(t,s);if(typeof a!="number")return o;if(typeof o!="number")return e.setCachedValue(n,"$cacheMax",a),a;const r=Math.max(o,a);return e.setCachedValue(n,"$cacheMax",r),r}var b3={$hasSeriesType:{dependencies:XI,resolve:v3},$isChartType:{dependencies:XI,resolve:M3},$isSeriesType:{dependencies:XI,resolve:S3}};function XI(e,t,i){const s=e.findVertexAtPath(["series","0","type"]);s&&e.addEdge(t,s,lp)}function v3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getResolvedPath(["series"]);if(!Array.isArray(o))return!1;for(const a of o)if(a.type===n)return!0;return!1}function S3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return e.getResolvedPath(["series","0","type"])===n}function M3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getResolvedPath(["series","0","type"]);if(typeof o!="string")return!1;const a=ye.getSeriesModule(o);if(a==null)return!1;switch(n){case"cartesian":return a.chartType==="cartesian";case"polar":return a.chartType==="polar";case"standalone":return a.chartType==="standalone"}return!1}var D3={$foregroundBackgroundMix:I3,$foregroundOpacity:k3,$interpolate:A3,$isGradient:w3,$isImage:C3,$isPattern:L3,$mix:N3};function I3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getParamValue("foregroundColor"),a=e.getParamValue("backgroundColor");if(typeof o=="string"&&typeof a=="string"&&ZI(n))return Ne.mix(Ne.fromString(o),Ne.fromString(a),1-n).toString();ve.inDevelopmentMode(()=>W.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function k3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),o=e.getParamValue("foregroundColor");if(typeof o=="string"&&ZI(n)){const a=Ne.fromString(o);return new Ne(a.r,a.g,a.b,n).toString()}ve.inDevelopmentMode(()=>W.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function A3(e,t,i){const[s,n]=i,o=e.resolveVertexValue(t,s),a=e.resolveVertexValue(t,n);if(!(!Ae(o)||!gt(a)))return Ne.interpolate(o.map(r=>Ne.fromString(r)),a).map(r=>r.toString())}function w3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return qt(n)}function C3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return ea(n)}function L3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Un(n)}function N3(e,t,i){const[s,n,o]=i,a=e.resolveVertexValue(t,s),r=e.resolveVertexValue(t,n),l=e.resolveVertexValue(t,o),c=e.getPathArray(t),h=`\`$mix\` json operation failed on [${String(a)}, ${String(r)}, ${String(l)}] at [${c.join(".")}], expecting`,d=`${h} two colors and a number between 0 and 1.`;if(typeof r!="string"||!ZI(l)){ve.inDevelopmentMode(()=>W.warnOnce(d));return}if(typeof a=="string")try{return Ne.mix(Ne.fromString(a),Ne.fromString(r),l).toString()}catch{ve.inDevelopmentMode(()=>W.warnOnce(d));return}if(!qt(a)){ve.inDevelopmentMode(()=>W.warnOnce(d));return}let u=a.colorStops;try{u=u?.map(p=>{let f;return typeof p.color=="string"&&(f=Ne.mix(Ne.fromString(p.color),Ne.fromString(r),l).toString()),{...p,color:f}})}catch{ve.inDevelopmentMode(()=>W.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...a,colorStops:u}}var T3={$rem:O3};function O3(e,t,i){const[s,n]=i,o=e.getVertexValue(s),a=n?e.getVertexValue(n):"fontSize",r=e.getParamValue(a);if(typeof r=="number"&&typeof o=="number")return Math.round(o*r);ve.inDevelopmentMode(()=>W.warnOnce(`\`$rem\` json operation failed on [${String(o)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var P3={$and:E3,$eq:R3,$every:z3,$greaterThan:V3,$if:B3,$lessThan:F3,$not:_3,$or:H3,$some:G3,$switch:j3};function E3(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);if(i.length===1&&Array.isArray(n))return n.every(o=>!!o);if(!n)return!1}return!0}function R3(e,t,i){let s,n=!0;for(const o of i){const a=e.resolveVertexValue(t,o);if(n)s=a,n=!1;else if(a!==s)return!1}return!0}function z3(e,t,i){const[s,n]=i,o=e.getVertexValue(s),a=e.resolveVertexValue(t,n);if(!Array.isArray(a))return;let r=0;for(const l of a){if(!e.graftAndResolveOrphanValue(t,`${r}`,o,l))return!1;r++}return!0}function V3(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)>e.resolveVertexValue(t,n)}function B3(e,t,i){const[s,n,o]=i,r=e.resolveVertexValue(t,s)?n:o,l=e.neighboursWithEdgeValue(r,Bt);if(l)for(const c of l)e.addEdge(t,c,Bt);return e.resolveVertexValue(t,r)}function F3(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)!!o);if(n)return!0}return!1}function G3(e,t,i){const[s,n]=i,o=e.getVertexValue(s),a=e.resolveVertexValue(t,n);if(!Array.isArray(a))return;let r=0;for(const l of a){if(e.graftAndResolveOrphanValue(t,`${r}`,o,l))return!0;r++}return!1}function j3(e,t,i){const[s,n,...o]=i,a=e.resolveVertexValue(t,s);for(const r of o){const l=e.getVertexValue(r);if(!Array.isArray(l))continue;const[c,h]=l;if(a===c||Array.isArray(c)&&c.includes(a))return h}return e.resolveVertexValue(t,n)}var W3={$isUserOption:$3,$palette:K3,$mapPalette:U3,$path:{dependencies:tP,resolve:Y3},$pathString:{dependencies:tP,resolve:Z3},$ref:X3};function $3(e,t,i){const[s,n,o]=i,a=e.neighboursWithEdgeValue(s,Bt);if(a)for(const r of a){const l=e.findNeighbour(r,Ot);if(l&&J2(e,t,l))return e.resolveVertexValue(t,n)}else if(J2(e,t,s))return e.resolveVertexValue(t,n);return e.resolveVertexValue(t,o)}function J2(e,t,i){const s=e.resolveVertexValue(t,i);if(!Pt(s))throw new Error(`\`$isUserOption\` json operation failed on [${String(s)}], expecting a string.`);const n=e.getPathArray(t),o=_h(n,s);return o===Wa?!1:e.hasUserOption(o)}var eP=new Set(["fill","fillFallback","stroke","gradient","range2"]);function K3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!Pt(n))return;if(eP.has(n)){const a=e.getPathArray(t),r=hp(a);if(Number.isNaN(r))return;switch(n){case"fill":return mo(e.palette.fills,1,r)[0];case"fillFallback":return mo(e.palette.fillsFallback,1,r)[0];case"stroke":return mo(e.palette.strokes,1,r)[0];case"gradient":return mo(e.palette.sequentialColors,1,r)[0];case"range2":return mo(e.palette.fills,2,r)}return}if(n==="gradients")return e.palette.sequentialColors;if(n==="type")return e.paletteType;const o=Ji(e.palette,n.split("."));return Array.isArray(o)?[...o]:typeof o=="object"?{...o}:o}function U3(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!Pt(n))return;if(eP.has(n)){const a=e.getPathArray(t);let r=hp(a),l=0;const c=["series","0","type"];for(let h=0;h1,n=i.length>2,[o,a,r]=i,l=e.resolveVertexValue(t,o),c=n?e.resolveVertexValue(t,r):null;if(!Pt(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),d=_h(h,l);if(d===Wa)return;const u=c?Ji(c,d):e.getResolvedPath(d);if(u!=null)return u;if(s)return e.resolveVertexValue(t,a)}function Z3(e,t,i){const[s,n]=i,o=e.resolveVertexValue(t,s);if(!Pt(o))throw new Error(`\`$path\` json operation failed on [${String(o)}], expecting a string.`);let a;n&&(a=e.graftAndResolveOrphan(t,n));const r=e.getPathArray(t),l=_h(r,o,a);if(l===Wa)throw new Error(`Unresolvable path [${o}] at [${r.join(".")}]`);return l}function X3(e,t,i){const[s]=i,n=e.getVertexValue(s);return e.getParamValue(n)}var q3={$apply:Q3,$applyCycle:J3,$applySwitch:eY,$applyTheme:tY,$clone:iY,$findFirstSiblingNotOperation:sY,$map:nY,$merge:oY,$omit:aY,$size:rY,$shallow:cY,$shallowSimple:lY,$value:hY};function Q3(e,t,i){const[s,n,o,a]=i,r=e.getVertexValue(s);if(!Ge(r))return;const l=n?e.getVertexValue(n):void 0,c=e.neighboursWithEdgeValue(t,Bt),h=c&&c.length>0;if(!h&&l==null)return kn;const d=o?e.resolveVertexValue(t,o):void 0,u=a?e.resolveVertexValue(t,a):void 0;if(!h&&l!=null)if(Pf(l)){const p=e.resolveVertexValue(t,n);Ge(p)&&e.graftObject(t,p,[d,u])}else e.graftObject(t,l,[d,u]);if(!h)return kn;for(const p of c){const f=e.neighboursWithEdgeValue(p,Bt);if(!f||f.length===0){const y=e.addVertex({});e.addEdge(p,y,Ot)}else e.graftObject(p,r,[d,u])}return kn}function J3(e,t,i){const[s,n,o]=i,a=e.resolveVertexValue(t,s);if(typeof a!="number")return;const r=e.getPathArray(t),l=e.dangerouslyGetUserOption(r),c=e.hasThemeOverride(r),h=l==null?void 0:xs,d=l??e.resolveVertexValue(t,n);if(!Array.isArray(d))return;const u=o?e.getVertexValue(o):void 0;for(let p=0;p0)return;let l=0;for(const c of a)e.graftValue(t,`${l}`,o,c),l++;return kn}function oY(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);Ge(n)&&e.graftObject(t,n)}return kn}function aY(e,t,i){const[s,n]=i;let o=e.getVertexValue(s);if(!Array.isArray(o)){const r=m3(e,t,n);if(!r)return;o=e.resolveVertexValue(r,s)}const a=e.resolveVertexValue(t,n);if(!(!Array.isArray(o)||!Ge(a)))return ee(a,o)}function rY(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Nd(n)?"length"in n?n.length:Object.keys(n).length:0}function lY(e,t,i){const s=[];for(const n of i)s.push(e.getVertexValue(n));return s}function cY(e,t,i){const s=e.getPathArray(t),n=e.hasUserOption(s);if(!n&&i.length===1)return e.resolveVertexValue(t,i[0]);const o=[];for(const a of i)o.push(e.getVertexValue(a));return n?(e.prune(t,[In,Ot]),kn):(e.graftObject(t,o),kn)}function hY(e,t,i){const[s]=i,n=e.getVertexValue(s),o=e.getPathArray(t);if(n==="$index")return hp(o);if(n==="$parentIndex")return hp(o,1);if(n==="$1")return e.resolveValue$1(o)}var dY={$isEven:uY};function uY(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Number.isNaN(Number(n))?!1:Number(n)%2===0}var Ef={...y3,...b3,...D3,...T3,...W3,...P3,...dY,...q3},iP=new Set(Object.keys(Ef));function Rf(e){return iP.has(e)}var Mt=ve.create("opts","options-graph"),pY=Ui(gY);function gY(e,t){return Mt.group("OptionsGraph.constructor()",()=>{const i=new sP(e.config,t,e.params,e.palette,e.overrides,e.getTemplateParameters());return{resolve(){return i.resolve()},resolveParams(){return i.resolveParams()},resolveAnnotationThemes(){return i.resolveAnnotationThemes()},resolvePartial(s,n,o){return i.resolvePartial(s,n,o)},clearSafe(){return i.clearSafe()}}})}var cc=class ss extends LM{constructor(t={},i={},s=void 0,n={},o=void 0,a=new Map){super(Bt,Ga,new Set([lc,xs])),this.config=t,this.userOptions=i,this.palette=n,this.overrides=o,this.internalParams=a,this.edgePriority=[...ss.EDGE_PRIORITY],this.graftEdge=ss.GRAFT_EDGE,this.resolvedParams={},this.resolvedAnnotations={},this.value$1=new Map,this.cachedPathVertices=new Map,this.hasUnsafeClearKeys=!1,this.rollbackVertices=[],this.rollbackEdgesFrom=[],this.rollbackEdgesTo=[],this.rollbackEdgesValue=[],this.isRollingBack=!1,this.resolvedRootAncestorsPaths=new Set,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.paletteType=me(i?.theme)?RO(i.theme?.palette):"inbuilt";const r=i.series?.[0]?.type??"line";Mt("build user"),this.buildGraphFromObject(this.root,xs,ee(i,["theme"])),Mt("build defaults"),this.buildGraphFromObject(this.root,Ot,ee(t[r],ss.COMPLEX_KEYS));const l=o?ee(o[r],ss.COMPLEX_KEYS):{};Object.keys(l).length>0&&(Mt("build series overrides"),this.buildGraphFromObject(this.root,In,l));const c=o?ee(o.common,ss.COMPLEX_KEYS):{};Object.keys(c).length>0&&(Mt("build common overrides"),this.buildGraphFromObject(this.root,In,ye.getSeriesModule(r)?.chartType==="cartesian"?c:ee(c,["zoom","navigator"]))),s&&(Mt("build params"),this.buildGraphFromObject(this.params,Ot,s));const h=this.findNeighbourWithValue(this.root,"axes",Bt),d=this.findNeighbourWithValue(this.root,"series",Bt);h&&(Mt("build axes"),this.buildGraphFromObject(h,Ot,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]})),d&&(Mt("build series"),this.buildGraphFromObject(d,Ot,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]}));const u=ee(t[r]?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(u).length>0&&(Mt("build annotations type config"),this.buildGraphFromObject(this.annotations,Ot,u));const p=ee(o?.common?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(p).length>0&&(Mt("build annotations type overrides"),this.buildGraphFromObject(this.annotations,In,p));const f=Lg(t[r]?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(f).length>0&&(Mt("build annotations config"),this.buildGraphFromObject(this.root,Ot,{annotations:f}));const y=Lg(o?.common?.annotations??{},ss.ANNOTATIONS_OPTIONS_KEYS);Object.keys(y).length>0&&(Mt("build annotations overrides"),this.buildGraphFromObject(this.root,In,{annotations:y})),this.buildDependencyGraph()}static clearValueCache(){ss.valueCache.clear()}clear(){Mt.group("OptionsGraph.clear()",()=>{super.clear(),this.cachedPathVertices.clear(),this.root=void 0,this.params=void 0,this.annotations=void 0,Mt("cleared")})}clearSafe(){this.hasUnsafeClearKeys||this.clear()}resolve(){return Mt.group("OptionsGraph.resolve()",()=>(this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},Mt("resolve params"),this.resolveVertex(this.params,this.resolvedParams),Mt("resolve annotations"),this.resolveVertex(this.annotations,this.resolvedAnnotations),Mt("resolve root"),this.resolveVertex(this.root),Mt("resolved root",this.resolved),Mt("vertex count",this.getVertexCount()),Mt("edge count",this.getEdgeCount()),this.resolved))}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}addVertex(t){const i=super.addVertex(t);return this.isRollingBack&&this.rollbackVertices.push(i),i}addEdge(t,i,s){const n=(this.neighboursWithEdgeValue(t,s)?.indexOf(i)??-1)!==-1;this.isRollingBack&&!n&&(this.rollbackEdgesFrom.push(t),this.rollbackEdgesTo.push(i),this.rollbackEdgesValue.push(s)),super.addEdge(t,i,s)}resolvePartial(t,i,s){if(!i||!this.root)return;const{permissivePath:n,proxyPaths:o}=s??{},a=Object.keys(i);if(Mt.check()&&console.groupCollapsed(`OptionsGraph.resolvePartial() - ${t.join(".")} [${a}]`),a.length===0)return{};const r=this.findVertexAtPath(t);if(!r){if(n)return;throw new Error(`Could not find vertex in OptionsGraph at path [${t.join(".")}].`)}const l=this.findNeighbour(r,No);if(this.userPartialOptions={},cp(this.userPartialOptions,t,i),o)for(const p of Object.keys(o)){const f=o[p],y=Ji(i,[p]);y!=null&&(cp(i,f,y),cp(this.userPartialOptions,[...t,...f],y),delete i[p],delete this.userPartialOptions[p])}this.graftEdge=lc,this.edgePriority=[lc,...ss.EDGE_PRIORITY],this.snapshot(),this.buildGraphFromObject(r,lc,i,l);for(const p of a){const f=o?.[p]?this.findVertexAtPath([...t,...o[p]]):this.findNeighbourWithValue(r,p,Bt);f&&this.refreshPendingProcessingEdges(f)}this.buildDependencyGraph();const c={};if(this.resolveVertex(r,c),this.rollback(),this.graftEdge=ss.GRAFT_EDGE,this.edgePriority=ss.EDGE_PRIORITY,this.userPartialOptions=void 0,o)for(const p of Object.keys(o)){const f=o[p],y=Ji(c,[...t,...f]);cp(c,[...t,p],y)}const h=Ji(c,t),u=s?.pick??!0?Lg(Ji(c,t),a):h;return Mt("vertex count",this.getVertexCount()),Mt("edge count",this.getEdgeCount()),Mt("resolved partial",u),Mt.check()&&console.groupEnd(),u}findVertexAtPath(t){const i=t.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,t,Bt);if(s)return this.cachedPathVertices.set(i,s),s}hasUserOption(t){if(Of(this.userOptions,t))return!0;const s=this.findVertexAtPath(t);if(s){if(this.findNeighbour(s,xs)!=null||this.findNeighbour(s,lc)!=null)return!0;const n=this.findNeighbourValue(s,Q2);return n===xs||n===lc}return!1}dangerouslyGetUserOption(t){if(this.userPartialOptions){const i=Ji(this.userPartialOptions,t);if(i!=null)return i}return Ji(this.userOptions,t)}hasThemeOverride(t){if(this.overrides==null)return!1;if(t[0]==="axes"&&t.length>1){const i=this.getResolvedPath(["axes",t[1],"type"]);if(Of(this.overrides,["common","axes",i,...t.slice(2)]))return!0;const s=this.getResolvedPath(["series","0","type"]);return Of(this.overrides,[s,"axes",i,...t.slice(2)])}if(t[0]==="series"&&t.length>1){const i=this.getResolvedPath(["series",t[1],"type"]);return Of(this.overrides,[i,"series",...t.slice(2)])}return Of(this.overrides,t)}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],Bt);if(!i)return;const s=this.findNeighbour(i,Ot);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[t]=n,n}getPathArray(t){return this.findNeighbourValue(t,No)??[]}getResolvedPath(t){return Ji(this.resolved,t)}getCachedValue(t,i){const s=[...t,i].join(".");return ss.valueCache.get(s)}setCachedValue(t,i,s){const n=[...t,i].join(".");ss.valueCache.set(n,s)}prune(t,i){this.addEdge(t,this.addVertex(i),q2)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,Ga);if(s&&Rf(s)){const o=this.neighboursWithEdgeValue(i,ja),a=Ef[s],l=(typeof a=="function"?a:a.resolve)?.(this,t,o??[]);return l===kn?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const o={};this.resolveVertexChildren(i,o),n=Ji(o,this.getPathArray(t))}return this.resolveValueOrSymbol(n)}resolveValue$1(t){for(let i=t.length;i>=0;i--){const s=t.slice(0,i).join("."),n=this.value$1.get(s);if(n!=null)return n}}graftConfig(t,i,s){const n=Ji(this.config,i),o=this.findNeighbour(t,No);if(me(n)&&this.buildGraphFromObject(t,Ot,n,o,void 0,s),this.overrides){const a=Ji(this.overrides,i);me(a)&&this.buildGraphFromObject(t,In,a,o,void 0,s);const r=Ji(this.overrides,["common",...i.slice(1)]);me(r)&&this.buildGraphFromObject(t,In,r,o,void 0,s)}this.buildDependencyGraph()}graftObject(t,i,s,n=this.graftEdge){const o=this.findNeighbour(t,No);if(this.buildGraphFromObject(t,n,i,o),this.overrides&&s)for(const a of s){if(a==null)continue;const r=Ji(this.overrides,a);r&&this.buildGraphFromObject(t,In,r,o)}this.buildDependencyGraph()}graftValue(t,i,s,n,o=this.graftEdge){const a=[...this.getPathArray(t),i],r=this.findVertexAtPath(a)??this.addVertex(i);this.value$1.set(a.join("."),n),this.buildGraphFromValue(t,r,o,a,s),this.buildDependencyGraph()}graftAndResolveOrphan(t,i){const s={},n=this.addVertex(s),o=this.getPathArray(t);return this.graftAndResolveChildren(i,n,o,[]),this.resolveVertex(n,s),Ji(s,o)}graftAndResolveOrphanValue(t,i,s,n,o=this.graftEdge){const a={},r=this.addVertex(a),c=[...this.getPathArray(t),i],h=this.findVertexAtPath(c)??this.addVertex(i);return this.value$1.set(c.join("."),n),this.buildGraphFromValue(r,h,o,c,s),this.resolveVertex(r,a),Ji(a,c)}buildGraphFromObject(t,i,s,n,o=ss.SHALLOW_KEYS,a){const r=Object.keys(s),l=Pf(s,r);if(l){const f=this.addVertex(s);this.addEdge(t,f,i),this.buildGraphFromOperation(f,i,l,n);return}if(r.length===0){this.addEdge(t,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(t,i,s,void 0);return}const c=this.getVertexChildrenByKey(t),h=n?this.getVertexValue(n):[];let d;Array.isArray(s)&&this.addEdge(t,this.addVertex(i),Q2);const u=[...h],p=h.length;for(const f of r){if(a?.has(f))continue;const y=c?.get(f)??this.addVertex(f);u[p]=f,o?.has(f)?this.buildShallowGraphFromValue(t,y,i,u,s[f]):this.buildGraphFromValue(t,y,i,u,s[f],o),f==="enabled"&&(d=y)}this.buildGraphAutoEnable(t,i,s,d)}buildGraphAutoEnable(t,i,s,n){if(i===Ot&&!n||i===xs&&n||i!==Ot&&i!==xs&&i!==lc&&i!==In)return;let o=this.findNeighbour(t,YI);o||(o=this.addVertex(YI),this.addEdge(t,o,YI)),n&&this.addEdge(n,o,X2);const{enabled:a,_enabledFromTheme:r}=s;this.addEdge(o,this.addVertex({enabled:a,_enabledFromTheme:r,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(t){const i=this.neighboursWithEdgeValue(t,Bt);if(!i)return;const s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(t,i,s,n,o,a){this.addEdge(t,i,Bt);let r=this.findNeighbour(i,No);r||(r=this.addVertex([...n]),this.addEdge(i,r,No));const l=Pf(o);if(l){const c=this.addVertex(o);this.addEdge(i,c,s),this.addEdge(c,r,No),this.buildGraphFromOperation(c,s,l,r)}else if(Nd(o))this.buildGraphFromObject(i,s,o,r,a);else{const c=this.findNeighbour(i,s);if(c&&this.getVertexValue(c)===o)return;const h=this.addVertex(o);this.addEdge(i,h,s)}}buildShallowGraphFromValue(t,i,s,n,o){this.addEdge(t,i,Bt);let a=this.findNeighbour(i,No);a||(a=this.addVertex([...n]),this.addEdge(i,a,No));const r=this.addVertex(o);this.addEdge(i,r,s)}buildGraphFromOperation(t,i,s,n){const o=this.addVertex(s.operation);this.addEdge(t,o,Ga);for(const a of s.values)this.buildGraphFromOperationValue(t,a,i,n)}buildGraphFromOperationValue(t,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const o=this.addVertex(i);this.addEdge(t,n,No),this.addEdge(t,o,ja);const a=Pf(i);a?this.buildGraphFromOperation(o,s,a,n):Nd(i)&&this.buildGraphFromObject(o,s,i,n)}buildDependencyGraph(){for(let t=0;t1&&!this.resolvedRootAncestorsPaths.has(o)){const a=this.findVertexAtPath([o]);if(a){this.resolveVertex(a,i,s);return}}if(this.userPartialOptions==null&&i===this.resolved&&n.length>0){const a=Ji(i,n);if(a!=null&&!Ge(a))return}this.resolveVertexInEdgePriority(t,i,n,s),this.resolveVertexAutoEnable(t,i,n),this.resolveVertexChildren(t,i,s)}resolveVertexInEdgePriority(t,i,s,n){const o=this.neighboursWithEdgeValue(t,Bt),[a]=this.edgePriority;for(const r of this.edgePriority){const l=this.findNeighbour(t,r);if(l==null)continue;const c=this.resolveVertexValueInternal(t,l);if(!(c==null&&r!==a)&&!(o&&o.length>0&&r!==a)&&!(Array.isArray(n)&&n.includes(r))){if(this.hasUnsafeClearKeys||(this.hasUnsafeClearKeys=c!=null&&ss.UNSAFE_CLEAR_KEYS.has(s.at(-1))),s.length===0){if(c==null)continue;this.resolved=c}else cp(i,s,c);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,Ga);if(s&&Rf(s)){const n=this.neighboursWithEdgeValue(i,ja),o=Ef[s],r=(typeof o=="function"?o:o.resolve)?.(this,t,n??[]);return r===kn?void 0:r}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,s){const n=this.neighboursWithEdgeValue(t,X2)?.[0];if(!n)return;const o=this.findVertexAtPath(s),a=this.findNeighbourValue(n,Ot),r=this.findNeighbourValue(n,In),l=this.findNeighbourValue(n,xs),h=o&&this.findNeighbour(o,xs)!=null?void 0:this.findNeighbourValue(n,lc);(l!=null&&l.enabled==null||h!=null&&h.enabled==null)&&!a?._enabledFromTheme&&!r?._enabledFromTheme&&cp(i,s,!0)}resolveVertexChildren(t,i,s){const n=this.neighboursWithEdgeValue(t,Bt);if(n){s??(s=this.findNeighbourValue(t,q2));for(const o of n){const a=this.getVertexValue(o);n.length>1&&Rf(a)||a!=="_enabledFromTheme"&&this.resolveVertex(o,i,s)}}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,lp);if(i)for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(t,i,s,n){const o=this.neighboursWithEdgeValue(t,Bt);if(o)for(const a of o){const r=this.getVertexValue(a),l=[...s,r],c=[...n,r],h=this.addVertex(r),d=this.findNeighbourValue(a,Ot);this.addEdge(i,h,Bt);const u=this.addVertex(l);if(this.addEdge(h,u,No),me(d)){this.buildGraphFromObject(h,Ot,d,u);const p=this.findNeighbour(h,Ot);this.addEdge(p,this.addVertex(l),No);const f=this.findNeighbourValue(p,Ga);if(Rf(f)){const y=this.neighboursWithEdgeValue(p,ja),x=Ef[f];(typeof x=="function"?void 0:x.dependencies)?.(this,p,y??[])}}this.graftAndResolveChildren(a,h,l,c)}}resolveValueOrSymbol(t){return typeof t=="symbol"&&this.internalParams?.has(t)?this.internalParams.get(t):t}snapshot(){Mt("snapshot"),this.isRollingBack=!0}rollback(){Mt(`rollback ${this.rollbackEdgesFrom.length} edges and ${this.rollbackVertices.length} vertices`);for(let t=0;t0?o.join("."):"root";this.diagramNeighbours(t,a,i,s+1,n);let r=this.diagramKeys.get(a);r||(r=this.diagramKey(a),t.push(` ${r}["${i.value}"]`))}diagramNeighbours(t,i,s,n,o){for(const p of this.neighboursWithEdgeValue(s,Bt)??[]){const f=this.getPathArray(p),y=f.length>0?f.join("."):"root";n${l} ${this.diagramLabel(o,a,i)}`)}diagramChildWithNeighbours(t,i,s,n,o,a,r,l){this.diagramChild(t,i,s,n,o,a),this.diagramNeighbours(t,o,a,r+1,l)}};cc.EDGE_PRIORITY=[xs,In,Ot],cc.GRAFT_EDGE=Ot,cc.SHALLOW_KEYS=new Set(["context","data","topology"]),cc.COMPLEX_KEYS=["annotations","axes","series"],cc.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"],cc.UNSAFE_CLEAR_KEYS=new Set(["itemStyler","styler"]),cc.valueCache=new Map;var sP=cc,nP=e=>`'${e}'`,qI="__AXIS_ID_",Hh={top:"x",bottom:"x",left:"y",right:"y"},Gh=class $i{constructor(t,i,s,n,o,a,r=!1,l){this.themeParameters={},this.optionMetadata=o??{},this.processedOverrides=s??{};let c=null;t instanceof $i?(c=t,this.specialOverrides=c.specialOverrides,a&&(this.userDeltaKeys=new Set(Object.keys(a))),a??(a=Kn(c.userOptions,i,$i.JSON_DIFF_OPTS)),this.userOptions=Pe(Wd(a,c.userOptions),{...$i.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Pe(t??i,{...$i.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),this.findSeriesWithUserVisiblity(i,a),r&&this.removeLeftoverSymbols(this.userOptions);const h=t instanceof $i&&a?.data!==void 0&&a?.data?.length!==t.userOptions.data?.length;let d,u,p,f,y,x,b;if(!r&&this.seriesWithUserVisibility==null&&a!==void 0&&$i.isFastPathDelta(a)&&c!=null&&!h?({activeTheme:d,processedOptions:u,fastDelta:p}=this.fastSetup(a,c),f=c.themeParameters,y=c.annotationThemes):($i.perfDebug("ChartOptions.slowSetup()"),{activeTheme:d,processedOptions:u,themeParameters:f,annotationThemes:y,googleFonts:x,optionsGraph:b}=this.slowSetup(s,a,r)),this.activeTheme=d,this.processedOptions=u,this.fastDelta=p??void 0,this.themeParameters=f,this.annotationThemes=y,this.googleFonts=x,this.optionsGraph=b,l!==void 0&&typeof l=="number"&&!Number.isNaN(l)){const v=performance.now();this.optionsProcessingTime=v-l}ve.inDevelopmentMode(()=>Us(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return $i.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return $i.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}findSeriesWithUserVisiblity(t,i){for(const s of[t,i]){const n=s?.series;if(Array.isArray(n))for(let o=0;oOM(s,i.series?.[n]??{}))?delete t.series:t.series=t.series.map((s,n)=>Wd(s,i.series?.[n]??{})))}slowSetup(t,i,s=!1){let n=Pe(this.userOptions,$i.OPTIONS_CLONE_OPTS_FAST);i&&(n=ce(i,n),s&&this.removeLeftoverSymbols(n));let o=zO(Nb(n.theme));const{presetType:a}=this.optionMetadata;if(a!=null){const x=ye.getPresetModule(a);if(x){const{validate:b=ki}=x,v=n,S=n.type,M=S==null?void 0:o.presets[S],{cleared:D,invalid:I}=b(v,x.options,"");for(const k of I)W.warn(k);Cl(I,"")?n={}:($i.debug(">>> AgCharts.createOrUpdate() - applying preset",D),n=x.create(D,M,()=>this.activeTheme),o=zO(Nb(n.theme)))}}this.soloSeriesIntegrity(n),a!=null&&o.templateTheme(n,!1),BO(void 0,n);const r=this.validateSeriesOptions(n),l=If(n);if(this.chartDef=ye.getChartModule(l),!this.chartDef.placeholder){const{validate:x=ki}=this.chartDef,{cleared:b,invalid:v}=x(n,this.chartDef.options,"");for(const S of v)W.warn(S);n=b}this.validateAxesOptions(n),this.removeDisabledOptions(n);let c=this.processFonts(o.params);c=this.processFonts(n,c),this.processSeriesOptions(n);const h=this.processAxesOptions(n,l),d=pY(o,n),u=d.resolve(),p=d.resolveParams(),f=d.resolveAnnotationThemes();d.clearSafe();const y=ce(t,u);return BO(this.chartDef.name,y),VU(this.chartDef.name,y,r),this.validateSeriesOptions(y),this.validateAxesOptions(y,h),this.validatePluginOptions(y),this.processMiniChartSeriesOptions(y),y.loadGoogleFonts||c.clear(),$i.debug(()=>["ChartOptions.slowSetup() - processed options",Pe(y)]),{activeTheme:o,processedOptions:y,themeParameters:p,annotationThemes:f,googleFonts:c,optionsGraph:d}}validatePluginOptions(t){for(const i of ye.listModulesByType("plugin")){const s=i.name;if(s in t&&i.options!=null&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:o}=ki(t[s],i.options,i.name);for(const a of o)W.warn(a);t[s]=n}}}validateSeriesOptions(t){const i=this.chartDef?.name,s=[],n=t.series?.length??0,o=[];let a;for(let r=0;rx.type==="series"&&(f||!x.enterprise)&&(!i||x.chartType===i)).map(x=>x.name),"or",nP));const y=nc.get(c.type);if(c.type!=null&&y?.type==="series"){o.push(y);continue}W.warn(c.type==null?`Option \`${l}.type\` is required and has not been provided; expecting ${a}, ignoring.`:`Unknown type \`${c.type}\` at \`${l}.type\`; expecting ${a}, ignoring.`);continue}else if(i&&h.chartType!==i){W.warn(`Series type \`${h.name}\` at \`${l}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}if(h.options==null){s.push(c);continue}const{validate:d=ki}=h,{cleared:u,invalid:p}=d(c,h.options,l);for(const f of p)W.warn(f);Cl(p,l)||s.push(u)}return t.series=s,o}validateAxesOptions(t,i){if(!("axes"in t)||!t.axes)return;const s=this.chartDef?.name,n={};let o;for(const[a,r]of rt(t.axes)){if(!r)continue;if(r.type==null){n[a]=r;continue}const l=`axes.${i?.get(a)??a}`,c=ye.getAxisModule(r.type);if(c==null){const p=ye.isEnterprise();o??(o=yr(Array.from(nc.values()).filter(y=>y.type==="axis"&&(p||!y.enterprise)&&y.chartType===s).map(y=>y.name),"or",nP)),nc.get(r.type)?.type!=="axis"&&W.warn(`Unknown type \`${r.type}\` at \`${l}.type\`; expecting one of ${o}, ignoring.`);continue}else if(c.chartType!==s){W.warn(`Axis type \`${c.name}\` at \`${l}.type\` is not supported by chart type \`${s}\`, ignoring.`);break}const{validate:h=ki}=c,{cleared:d,invalid:u}=h(r,c.options,l);for(const p of u)W.warn(p);Cl(u,l)||(n[a]=d)}t.axes=n}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??Kn(t.processedOptions,this.processedOptions,$i.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.displayNullData,s=t.series?.map(n=>{const a=!!ye.getSeriesModule(n.type)?.options?.visible,r={};return a&&(r.visible=!0),i!==void 0&&n.allowNullKeys===void 0&&(r.allowNullKeys=i),ce(this.getSeriesGroupingOptions(n),n,r)});t.series=this.setSeriesGroupingOptions(s??[])}processAxesOptions(t,i){const s=i==="polar"?["angle","radius"]:["x","y"],n="axes"in t&&Object.keys(t.axes??{}).length>0,o=this.countNonDefaultSeriesAxisKeys(t,s),a=o>0,r=a&&o<(t?.series?.length??0),l=t.series?.[0],c=this.optionsType(t),h=this.predictAxes(c,s,l,t.data)??this.cloneDefaultAxes(c),d=me(l)&&"direction"in l&&l.direction==="horizontal"&&ye.getSeriesModule(l.type)?.axisKeysFlipped!=null;if(!n&&!a&&!d){t.axes=h;return}const u="axes"in t?new Set(Object.keys(t.axes??{})):new Set,p=this.getPrimaryAxisKeys(t,s,u,a),f=this.getRemappedAxisKeys(u,p,s,r),y={},x=new Map;for(const[b,v]of f)y[v]="axes"in t?_l(t.axes?.[b]):void 0,x.set(v,b);return this.remapSeriesAxisKeys(t,s,y,f,h,r),this.predictAxesMissingTypesAndPositions(t,s,y,h),this.alternateSecondaryAxisPositions(t,y,x),t.axes=y,x}getSeriesDirectionAxisKey(t,i){const s=ye.getSeriesModule(t.type);return s?"direction"in t&&t.direction==="horizontal"&&s.axisKeysFlipped?s.axisKeysFlipped[i]:s.axisKeys?.[i]:void 0}countNonDefaultSeriesAxisKeys(t,i){let s=0;for(const n of t.series??[])for(const o of i){const a=this.getSeriesDirectionAxisKey(n,o);!a||!Al(a,n)||n[a]!==o&&s++}return s}getPrimaryAxisKeys(t,i,s,n){const o=new Map;for(const a of i){let r=!1;if("axes"in t&&t.axes&&!(a in t.axes&&me(t.axes[a])&&!("position"in t.axes[a]))){for(const[l,c]of rt(t.axes))if("position"in c&&c.position&&a===Hh[c.position]){o.set(a,l),r=!0;break}}if(!r&&n)for(const l of t.series??[]){const c=this.getSeriesDirectionAxisKey(l,a);if(!c)continue;const h=l[c];if(!s.has(h)){if(!h){o.set(a,a);break}o.set(a,h);break}}}if(s.size===0||!("axes"in t)||!t.axes)return o;if(o.size===0)for(const a of i)a in t.axes&&o.set(a,a);if(o.size===0){for(const a of i)for(const[r,l]of rt(t.axes))if(l.type?.startsWith(a)){o.set(a,r);break}}if(o.size===0&&(t.series?.length??0)>0)for(const a of i)for(const r of t.series){const l=this.getSeriesDirectionAxisKey(r,a);if(!l)continue;const c=r[l];if(s.has(c)){o.set(a,c);break}}if(o.size<2){const a=new Set(o.values());for(const[r,l]of rt(t.axes))if(!(a.has(r)||"position"in l)){for(const c of i)if(!o.has(c)){o.set(c,r),a.add(r);break}if(o.size===2)break}}return o}getRemappedAxisKeys(t,i,s,n){const o=new Map;for(const[a,r]of i)o.set(r,a);for(const a of t)o.has(a)||o.set(a,`${qI}${o.size}`);if(n)for(const a of s)o.has(a)||o.set(a,`${qI}${o.size}`);return o}remapSeriesAxisKeys(t,i,s,n,o,a){for(const r of t.series??[])for(const l of i){const c=this.getSeriesDirectionAxisKey(r,l);if(!c)continue;s[l]??(s[l]=_l(o[l]));let h=l;if(c in r){const d=r[c];n.has(d)?h=n.get(d):(h=`${qI}${n.size}`,n.set(d,h),s[h]=_l(o[l]))}else n.has(l)&&a&&(h=n.get(l),s[h]??(s[h]=_l(o[l])));r[c]=h}}predictAxes(t,i,s,n){if(!s)return;const o=s?.data??n;if(!o?.length)return;const a=ye.getSeriesModule(t)?.predictAxis;if(!a)return;const r=new Map,l=s0(0,o.length-1,5);for(const c of l){const h=o[c];for(const d of i){const u=a(d,h,s);if(!r.has(d)){r.set(d,u);continue}const p=r.get(d);if(!(!u&&!p)){if(!u||!p)return;for(const f of Object.keys(p))if(p[f]!==u[f])return}}}for(const[c,h]of r)h||r.delete(c);if(r.size!==0){if(r.size===1){const[c]=r.values(),h=this.cloneDefaultAxes(t);return"position"in c?Zc(h,d=>"position"in d&&d.position===c.position?c:d):void 0}return Object.fromEntries(r)}}cloneDefaultAxes(t){const i=ye.getSeriesModule(t);return i?.defaultAxes?Pe(i.defaultAxes):{}}predictAxesMissingTypesAndPositions(t,i,s,n){for(const[o,a]of rt(s)){if(!Ge(a)||"type"in a&&"position"in a)continue;if(o in n){a.type??(a.type=n[o].type),a.position??(a.position=n[o].position);continue}this.predictAxisMissingTypeFromPosition(a,n)||(this.predictAxisMissingTypeAndPositionFromSeries(t,i,o,a,n),"type"in a||delete s[o])}}predictAxisMissingTypeFromPosition(t,i){if(!("position"in t)||!Al(t.position,Hh))return!1;for(const s of Object.values(i))if(Al(s.position,Hh)&&Hh[t.position]===Hh[s.position])return t.type=s.type,!0;for(const[s,n]of rt(Hh))if(t.position!==s&&n===Hh[t.position])return t.type=i[n].type,!0;return!1}predictAxisMissingTypeAndPositionFromSeries(t,i,s,n,o){for(const a of t.series??[])for(const r of i){const l=this.getSeriesDirectionAxisKey(a,r);if(!(!l||!Al(l,a))&&a[l]===s)return n.type??(n.type=o[r].type),n.position??(n.position=o[r].position),r==="y"}return!1}alternateSecondaryAxisPositions(t,i,s){let n=0,o=0;for(const[a,r]of rt(i)){if(!Ge(r)||!("position"in r))continue;const l=s.get(a),c="axes"in t&&t.axes&&l&&l in t.axes?t.axes[l]:void 0,h=c&&"position"in c?c.position:void 0;if(r.position==="top"||r.position==="bottom"?(n+=1,n===2&&h==null&&(r.position="top")):(r.position==="left"||r.position==="right")&&(o+=1,o===2&&h==null&&(r.position="right")),n>1&&o>1)break}}processMiniChartSeriesOptions(t){const i=t.navigator?.miniChart?.series;i!=null&&(t.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(t){const{groupable:i,stackable:s,stackedByDefault:n=!1}=ye.getSeriesModule(t.type);t.grouped&&!i&&W.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&W.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:o,stacked:a}=t;return a??(a=(n||t.stackGroup!=null)&&!(i&&o)),o??(o=!0),{stacked:s&&a,grouped:i&&o&&!(s&&a)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);$i.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((o,a)=>{var r;return a.groupType==="default"||(o[r=a.seriesType]??(o[r]=0),o[a.seriesType]+=a.groupType==="stack"?1:a.series.length),o},{});return i.flatMap(o=>{var a;switch(s[a=o.seriesType]??(s[a]=0),o.groupType){case"stack":{const r=s[o.seriesType]++;return o.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:o.groupId,groupIndex:r,groupCount:n[o.seriesType],stackIndex:c,stackCount:o.series.length}}))}case"group":return o.series.map(r=>Object.assign(r,{seriesGrouping:{groupId:o.groupId,groupIndex:s[o.seriesType]++,groupCount:n[o.seriesType],stackIndex:0,stackCount:0}}))}return o.series}).map(({stacked:o,grouped:a,...r})=>r)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const i=new Map;return t.reduce((s,n)=>{const o=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:o,series:[n],groupId:"__default__"});else{const a=this.getSeriesGroupId(n);if(!i.has(a)){const l={groupType:n.stacked?"stack":"group",seriesType:o,series:[],groupId:a};i.set(a,l),s.push(l)}i.get(a).series.push(n)}return s},[])}soloSeriesIntegrity(t){if(!Ae(t.series))return;const i=n=>ye.getSeriesModule(n)?.solo??!1,s=t.series;if(s&&s.length>1&&s.some(n=>i(n.type))){const n=this.optionsType(t);if(i(n))W.warn(`series[0] of type '${n}' is incompatible with other series types. Only processing series[0]`),t.series=s.slice(0,1);else{const{solo:o,nonSolo:a}=Id(s,l=>i(l.type)?"solo":"nonSolo"),r=ag(o.map(l=>l.type)).join(", ");W.warn(`Unable to mix these series types with the lead series type: ${r}`),t.series=a}}}static processFontOptions(t,i,s,n=new Set){if(typeof t=="object"&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const o=[];for(const a of t.fontFamily)typeof a=="object"&&"googleFont"in a?(o.push(a.googleFont),n?.add(a.googleFont)):o.push(a);t.fontFamily=o.join(", ")}else typeof t.fontFamily=="object"&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,n?.add(t.fontFamily));return n}processFonts(t,i=new Set){return Oa(t,$i.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(t){if("enabled"in t&&t.enabled===!1)for(const i of Object.keys(t))i!=="enabled"&&delete t[i]}removeDisabledOptions(t){Oa(t,$i.removeDisabledOptionJson,new Set(["data","theme","contextMenu","ranges"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!me(t)))for(const i of Object.keys(t)){const s=t[i];Od(s)&&delete t[i]}}removeLeftoverSymbols(t){Oa(t,$i.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=Go():o0(t.window),t.document==null?t.document=kl():n0(t.document),t.window==null)throw new Error("AG Charts - unable to resolve global window");if(t.document==null)throw new Error("AG Charts - unable to resolve global document");return t}};Gh.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Gh.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},Gh.JSON_DIFF_OPTS=new Set(["data","localeText"]),Gh.perfDebug=ve.create(!0,"perf"),Gh.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Gh.debug=ve.create(!0,"opts");var zf=Gh,Tb=ve.create(!0,"opts"),hc="AG Charts - Chart was destroyed, cannot perform request.",Vf=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){if(!this.chart)throw new Error(hc);return Tb.group("AgChartInstance.update()",async()=>{const i=ve.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.update(t,this,void 0,i),await this.chart?.waitForUpdate()})}async updateDelta(t){if(!this.chart)throw new Error(hc);return Tb.group("AgChartInstance.updateDelta()",async()=>{const i=ve.check("scene:stats","scene:stats:verbose")?performance.now():void 0;this.factoryApi.updateUserDelta(this,t,i),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(hc);const t=Pe(this.chart.getOptions(),zf.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){if(!this.chart)throw new Error(hc);return this.chart.waitForUpdate()}applyTransaction(t){const{chart:i}=this;if(!i)throw new Error(hc);if(t==null||typeof t!="object")throw new Error("AG Charts - applyTransaction expects a transaction object.");const{add:s,addIndex:n,remove:o,update:a}=t;if(s!=null&&!Array.isArray(s))throw new Error('AG Charts - transaction "add" must be an array.');if(n!=null){if(typeof n!="number"||!Number.isSafeInteger(n)||n<0)throw new Error('AG Charts - transaction "addIndex" must be a safe non-negative integer (0 to 9007199254740991).');if(s==null||s.length===0)throw new Error('AG Charts - transaction "addIndex" requires a non-empty "add" array.')}if(o!=null&&!Array.isArray(o))throw new Error('AG Charts - transaction "remove" must be an array.');if(a!=null&&!Array.isArray(a))throw new Error('AG Charts - transaction "update" must be an array.');return Tb.group("AgChartInstance.applyTransaction()",async()=>{if(!i.isDataTransactionSupported()){const r=i.data.deepClone();return r.addTransaction(t),r.commitPendingTransactions(),this.updateDelta({data:r.data})}return Tb("transaction",t),this.chart?.applyTransaction(t)})}async download(t){if(!this.chart)throw new Error(hc);const i=await this.prepareResizedChart(this,this.chart,t);try{i.chart?.download(t?.fileName,t?.fileFormat)}finally{i.destroy()}}async __toSVG(t){if(!this.chart)throw new Error(hc);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...t});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(t){if(!this.chart)throw new Error(hc);const i=await this.prepareResizedChart(this,this.chart,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){if(!this.chart)return;const{interactionManager:i,legendManager:s,zoomManager:n}=this.chart.ctx,o=this.getEnabledOriginators(),a=new Set(o);i.isState(2)||(a.has(s)&&a.has(n)?(a.delete(n),await this.setStateOriginators(t,Array.from(a)),await this.setStateOriginators(t,[n])):await this.setStateOriginators(t,o))}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(t,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,o=s.height??i.height??i.ctx.scene.canvas.height,a=t.getState(),r=i.chartOptions.specialOverrides.document??kl(),l={...i.chartOptions.processedOverrides,container:r.createElement("div"),width:n,height:o};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();if(ye.isEnterprise()){l.animation={enabled:!1};const x=this.licenseManager?.getWatermarkForegroundConfigForBrowser();x&&(l.foreground=x)}const h={...i.chartOptions.specialOverrides},d={...i.chartOptions.optionMetadata},u=await this.chart?.ctx.dataService.getData(),p=this.factoryApi.create(c,l,h,d,u);a.legend&&this.syncLegend(i,p,a),p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),await p.setState(a);const f={source:"chart-update",sourceDetail:"internal-prepareResizedChart"};p.chart?.ctx.zoomManager.updateZoom(f,i.ctx.zoomManager.getZoom()),p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate();const y=[];for(const x of i.modulesManager.legends())y.push(x.legend.pagination?.currentPage??0);for(const x of p.chart.modulesManager.legends()){const b=y.shift()??0;x.legend.pagination&&x.legend.pagination.setPage(b)}return p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),p}syncLegend(t,i,s){const n=new Map;for(const[o,a]of t.series.entries()){const r=i.chart?.series[o];r&&n.set(a.id,r.id)}s.legend=s.legend?.map(o=>({...o,seriesId:n.get(o.seriesId??"")??o.seriesId}))}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:o,legendManager:a},modulesManager:r}=this.chart,l=[];return"annotations"in t&&t.annotations?.enabled&&l.push(s),i.presetType==="price-volume"&&l.push(n),(t.navigator?.enabled||t.zoom?.enabled)&&l.push(o),r.isEnabled("legend")&&t.legend?.enabled!==!1&&l.push(a),l.push(this.chart.ctx.activeManager),l}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart?.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),await this.chart?.waitForUpdate()}};Vf.chartInstances=new WeakMap,g([Ze({oldValue(e){e.destroyed||(e.publicApi=void 0),Vf.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,Vf.chartInstances.set(e,this))}})],Vf.prototype,"chart",2);var oP=Vf,fY=1e3,QI=class jc{constructor(t,i,s,n,o,a=fY){this.name=t,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=o,this.cleanupTimeMs=a,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,n,o){return this.pools.has(t)||this.pools.set(t,new jc(t,i,s,n,o)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(t),jc.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):jc.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(t==null)throw new Error("AG Charts - pool has no free instances");return jc.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");jc.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),jc.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};QI.pools=new Map,QI.debug=ve.create(!0,"pool");var mY=QI,qr=ve.create(!0,"opts"),To=class{static licenseCheck(e){if(e.withinStudio)return;let t=this.licenseManager;return this.licenseChecked||(t=zi.licenseManager?.(e),this.licenseManager=t,t?.validateLicense(),this.licenseChecked=!0),t}static getLicenseDetails(e){return zi.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return aP.getInstance(e)}static create(e,t){const i=ve.check("scene:stats","scene:stats:verbose")?performance.now():void 0;return qr.group("AgCharts.create()",()=>{e=ve.inDevelopmentMode(()=>Us(Pe(e)))??e,this.licenseCheck(e);const s=this.licenseCheck(e),n=aP.createOrUpdate({userOptions:e,licenseManager:s,optionsMetadata:t,apiStartTime:i});return s?.isDisplayWatermark()&&zi.injectWatermark?.(n.chart.ctx.domManager,s.getWatermarkMessage()),n})}static createFinancialChart(e){return qr.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return qr.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return qr.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};To.licenseChecked=!1;var $a=class Wm{static getInstance(t){const i=Sb.getInstance(t);return i?oP.chartInstances.get(i):void 0}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:n,processedOverrides:o=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:a=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:r=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1,apiStartTime:d}=t,u=zi.styles==null?[]:[["ag-charts-enterprise",zi.styles]];if(ye.listModules().next().done)throw new Error(["AG Charts - No modules have been registered.","","Call ModuleRegistry.registerModules(...) with the modules you need before using AgCharts.create().","","See https://www.ag-grid.com/charts/r/module-registry/ for more details."].join(` `));qr(()=>[">>> AgCharts.createOrUpdate() user options",Pe(s)]);const{presetType:p}=r;let f=s;To.optionsMutationFn&&f&&(f=To.optionsMutationFn(Pe(f,zf.OPTIONS_CLONE_OPTS_FAST),p),qr(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Pe(f)]));const y=this.getPool(r);let x=!1,b,v=i?.chart;v==null&&y?.hasFree()&&(b=y.obtainFree(),v=b.item);const{document:S,window:M,styleContainer:D,skipCss:I,...k}=f??{},A=v?.getChartOptions(),w=new zf(A,k,o,{...a,document:S,window:M,styleContainer:D,skipCss:I},r,l,h,d);(v==null||If(w.processedOptions)!==If(v.chartOptions.processedOptions))&&(b?.release(),b=this.getPool(w.optionMetadata)?.obtain(w),b?v=b.item:(x=!0,v=Wm.createChartInstance(w,v))),w.optionsGraph&&v.ctx.optionsGraphService.updateCallback((C,T,O)=>w.optionsGraph?.resolvePartial(C,T,O));for(const[C,T]of u)v.ctx.domManager.addStyles(C,T);return v.ctx.fontManager.updateFonts(w.googleFonts),c!=null&&v.ctx.dataService.restoreData(c),i==null?(i=new oP(v,Wm.callbackApi,n),i.releaseChart=b?.release):(b||x)&&(i.releaseChart?.(),i.chart=v,i.releaseChart=b?.release),qr.check()&&typeof globalThis.window<"u"&&(globalThis.agChartInstances??(globalThis.agChartInstances={}),globalThis.agChartInstances[v.id]=v),v.queuedUserOptions.push(w.userOptions),v.queuedChartOptions.push(w),v.requestFactoryUpdate(C=>{qr.group(">>>> Chart.applyOptions()",()=>{C.applyOptions(w);const T=C.queuedUserOptions.indexOf(w.userOptions)+1;C.queuedUserOptions.splice(0,T),C.queuedChartOptions.splice(0,T)})}),i}static updateUserDelta(t,i,s){i=Pe(i,zf.OPTIONS_CLONE_OPTS_FAST);const n=Oa(i,Wm.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);qr(()=>[">>> AgCharts.updateUserDelta() user delta",Pe(i)]),Wm.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:n,apiStartTime:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0}),n=If(t.processedOptions);return ye.getChartModule(n).create(t,s)}static getPool(t){if(t.pool===!0)return mY.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};$a.caretaker=new Fy(de),$a.callbackApi={caretaker:$a.caretaker,create(e,t,i,s,n){return $a.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s,data:n})},update(e,t,i,s){return $a.createOrUpdate({userOptions:e,proxy:t,specialOverrides:i,apiStartTime:s})},updateUserDelta(e,t,i){return $a.updateUserDelta(e,t,i)}},$a.markRemovedProperties=(e,t,i,s)=>{let n=s??!1;if(typeof e!="object"||e==null)return n;for(const o of Ko(e))e[o]===void 0&&(Object.assign(e,{[o]:Symbol("UNSET")}),n||(n=!0));return n},$a.detachAndClear=e=>e.detachAndClear(),$a.destroy=e=>e.destroy();var aP=$a,N={};$s(N,{APPROXIMATE_THRESHOLD:()=>O$,AbstractBarSeries:()=>IP,AbstractBarSeriesProperties:()=>Hf,AggregationManager:()=>Kb,AnchoredPopover:()=>dE,ApproximateOrdinalTimeScale:()=>m5,Arc:()=>Ya,Axis:()=>SI,AxisGroupZIndexMap:()=>oO,AxisInterval:()=>Ih,AxisLabel:()=>Nt,AxisTick:()=>kh,BBox:()=>re,Background:()=>Eu,BandScale:()=>na,BaseToolbar:()=>Nk,Caption:()=>Wt,CartesianAxis:()=>Df,CartesianCrossLine:()=>Es,CartesianSeries:()=>dc,CartesianSeriesNodeEvent:()=>ok,CartesianSeriesProperties:()=>ca,CategoryAxis:()=>Ff,CategoryScale:()=>Hu,Chart:()=>Sb,ChartAxes:()=>Yx,ChartOptions:()=>zf,CollapseMode:()=>PP,ColorScale:()=>wu,ContextMenuRegistry:()=>w1,ContinuousScale:()=>xt,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>pp,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>gp,DEFAULT_POLAR_DIRECTION_KEYS:()=>XP,DEFAULT_POLAR_DIRECTION_NAMES:()=>qP,DOMElementProxy:()=>qx,DOMManager:()=>UT,DataController:()=>Q1,DataModel:()=>nI,DataModelSeries:()=>nk,DataSet:()=>Sf,DiscreteTimeAxis:()=>eE,DraggablePopover:()=>uE,DropShadow:()=>Ua,ExtendedPath2D:()=>Cu,FillGradientDefaults:()=>Jl,FillImageDefaults:()=>Wr,FillPatternDefaults:()=>Li,FloatingToolbar:()=>M5,FormatManager:()=>Bu,Group:()=>Le,GroupWidget:()=>qT,HierarchyHighlightState:()=>QP,HierarchyNode:()=>o5,HierarchySeries:()=>a5,HierarchySeriesProperties:()=>uc,HighlightManager:()=>L1,HighlightProperties:()=>jr,HighlightState:()=>N1,Image:()=>fp,InteractionManager:()=>i1,InteractionState:()=>t1,LARGEST_KEY_INTERVAL:()=>D1,Label:()=>Qn,LabelStyle:()=>qn,LayoutElement:()=>mI,Line:()=>Xn,LinearScale:()=>jh,LogScale:()=>ik,Marker:()=>Ni,Menu:()=>y5,MercatorScale:()=>r5,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>oa,NativeWidget:()=>zu,NiceMode:()=>sO,Node:()=>Gr,OrdinalTimeScale:()=>ic,PHASE_METADATA:()=>pf,PanToBBoxScalingModeEnum:()=>H1,Path:()=>wi,PointerEvents:()=>xT,PolarAxis:()=>Ak,PolarSeries:()=>Sk,QuadtreeNearest:()=>uP,RadialColumnShape:()=>ha,Range:()=>Fa,Rect:()=>Ci,Rotatable:()=>Lu,RotatableText:()=>GT,SMALLEST_KEY_INTERVAL:()=>M1,Scalable:()=>jx,ScalableGroup:()=>Xj,Scene:()=>ib,Sector:()=>vs,SectorBox:()=>oE,SegmentedPath:()=>sk,Selection:()=>yi,Series:()=>Af,SeriesItemHighlightStyle:()=>Ql,SeriesMarker:()=>sn,SeriesNodeEvent:()=>bb,SeriesNodePickMode:()=>MO,SeriesProperties:()=>sa,SeriesTooltip:()=>Qr,Shape:()=>fh,SliderWidget:()=>jD,StopProperties:()=>ND,SvgPath:()=>nE,Text:()=>bn,TimeAxisParentLevel:()=>up,TimeScale:()=>Gu,Toolbar:()=>v5,ToolbarButtonWidget:()=>pE,ToolbarWidget:()=>tb,TooltipManager:()=>hb,Transformable:()=>zt,TransformableGroup:()=>Tu,TransformableText:()=>Pu,Translatable:()=>Nu,TranslatableGroup:()=>ds,TranslatableSvgPath:()=>f5,UnitTimeScale:()=>sc,ZoomManager:()=>X1,accumulativeValueProperty:()=>oI,addHitTestersToQuadtree:()=>Rb,adjustLabelPlacement:()=>yP,angleCategoryAxisOptionsDefs:()=>RI,angleNumberAxisOptionsDefs:()=>WO,animationValidation:()=>bf,annotationCalloutStylesDefs:()=>u2,annotationChannelTextDefs:()=>a2,annotationCommentStylesDefs:()=>p2,annotationCrossLineStyleDefs:()=>_I,annotationDisjointChannelStyleDefs:()=>h2,annotationFibonacciStylesDefs:()=>HI,annotationLineStyleDefs:()=>Ab,annotationLineTextDefs:()=>kb,annotationMeasurerStylesDefs:()=>wb,annotationNoteStylesDefs:()=>g2,annotationOptionsDef:()=>op,annotationParallelChannelStyleDefs:()=>d2,annotationQuickMeasurerStylesDefs:()=>f2,annotationShapeStylesDefs:()=>GI,annotationTextStylesDef:()=>Tf,boxPlotSeriesThemeableOptionsDef:()=>b2,buildResetPathFn:()=>vk,calculateDataDiff:()=>YP,calculateLabelTranslation:()=>d5,calculateSegments:()=>Ob,candlestickSeriesThemeableOptionsDef:()=>S2,checkCrisp:()=>$P,chordSeriesThemeableOptionsDef:()=>M2,clippedRoundRect:()=>Ux,collapsedStartingBarPosition:()=>$f,computeBarFocusBounds:()=>pk,computeMarkerFocusBounds:()=>Gb,coneFunnelSeriesThemeableOptionsDef:()=>D2,createDatumId:()=>us,diff:()=>lb,drawCorner:()=>hf,drawMarkerUnitPolygon:()=>wf,findNodeDatumInArray:()=>P1,findQuadtreeMatch:()=>zb,fixNumericExtent:()=>vn,fromToMotion:()=>mi,funnelSeriesThemeableOptionsDef:()=>I2,generateTicks:()=>mO,getColorStops:()=>kT,getCrossLineValue:()=>tO,getItemId:()=>xb,getItemStyles:()=>dI,getItemStylesPerItemId:()=>k$,getLabelStyles:()=>Wh,getMarkerStyles:()=>jb,getMissCount:()=>d1,getRadialColumnWidth:()=>aE,getShapeFill:()=>SO,getShapeStyle:()=>wI,groupAccumulativeValueProperty:()=>Sh,hasDimmedOpacity:()=>uI,heatmapSeriesThemeableOptionsDef:()=>k2,initialStatePickedOptionsDef:()=>e1,interpolatePoints:()=>Wf,isTooltipValueMissing:()=>wh,keyProperty:()=>ql,makeSeriesTooltip:()=>Kh,mapLineBackgroundSeriesThemeableOptionsDef:()=>C2,mapLineSeriesThemeableOptionsDef:()=>w2,mapMarkerSeriesThemeableOptionsDef:()=>L2,mapShapeBackgroundSeriesThemeableOptionsDef:()=>T2,mapShapeSeriesThemeableOptionsDef:()=>N2,markerEnabled:()=>yk,markerFadeInAnimation:()=>Yf,markerSwipeScaleInAnimation:()=>mk,midpointStartingBarPosition:()=>e5,minimumTimeAxisDatumGranularity:()=>pP,motion:()=>I5,nightingaleSeriesThemeableOptionsDef:()=>O2,normaliseGroupTo:()=>ab,ohlcSeriesThemeableOptionsDef:()=>A2,ordinalTimeAxisOptionsDefs:()=>ip,pairUpSpans:()=>jf,pathFadeInAnimation:()=>bk,pathMotion:()=>Ub,pathSwipeInAnimation:()=>xk,plotAreaPathFill:()=>KP,plotInterpolatedLinePathStroke:()=>Bb,plotLinePathStroke:()=>hk,predictCartesianFinancialAxis:()=>yY,predictCartesianNonPrimitiveAxis:()=>Bf,prepareAreaFillAnimationFns:()=>UP,prepareBarAnimationFunctions:()=>Kf,prepareLinePathPropertyAnimation:()=>dk,processedDataIsAnimatable:()=>Co,pyramidSeriesThemeableOptionsDef:()=>P2,radarAreaSeriesThemeableOptionsDef:()=>E2,radarLineSeriesThemeableOptionsDef:()=>R2,radialBarSeriesThemeableOptionsDef:()=>z2,radialColumnSeriesThemeableOptionsDef:()=>V2,radiusCategoryAxisOptionsDefs:()=>KO,radiusNumberAxisOptionsDefs:()=>$O,rangeAreaSeriesThemeableOptionsDef:()=>_2,rangeBarSeriesThemeableOptionsDef:()=>G2,resetAxisLabelSelectionFn:()=>mb,resetBarSelectionsDirect:()=>Fb,resetBarSelectionsFn:()=>Uf,resetLabelFn:()=>$h,resetMarkerFn:()=>_b,resetMarkerPositionFn:()=>Zf,resetMarkerSelectionsDirect:()=>Hb,resetMotion:()=>qi,sankeySeriesThemeableOptionsDef:()=>j2,sectorBox:()=>tE,seriesLabelFadeInAnimation:()=>ei,seriesLabelFadeOutAnimation:()=>Pb,stackCartesianSeries:()=>fP,standaloneChartOptionsDefs:()=>h4,sunburstSeriesThemeableOptionsDef:()=>W2,toHierarchyHighlightString:()=>Xf,toHighlightString:()=>Fu,topologyChartOptionsDefs:()=>c4,trailingAccumulatedValueProperty:()=>a$,treemapSeriesThemeableOptionsDef:()=>$2,updateClipPath:()=>Wb,updateLabelNode:()=>mP,upsertNodeDatum:()=>gk,userInteraction:()=>_$,validateCrossLineValue:()=>iO,valueProperty:()=>Vt,visibleRangeIndices:()=>vf,waterfallSeriesThemeableOptionsDef:()=>K2});function rP(e){return e.isReversed()!==e.range[1]rP(c?t:i)?c?s.width+u:s.height+p:c?-u:-p,y=()=>rP(c?t:i)?c?-u:-p:c?s.width+u:s.height+p;return(b=>{const v=[];let S=-1;for(let M=0;MR.start!=null)?.start;let T=r.convert(I??w)-d,O=r.convert(k??C)+2*d;const V=I!=null&&Number.isNaN(T),z=k!=null&&Number.isNaN(O);V||z||(Number.isNaN(T)&&(T=f()),Number.isNaN(O)&&(O=y()),k!=null&&(S=M),v.push({start:T,stop:O,...A}))}return v})(e.segments).map(({stop:b,start:v,...S})=>{const M=c?v:-u,D=c?-p:v,I=c?b+h:s.width+u,k=c?s.height+p:b+h;return{clipRect:{x0:M,y0:D,x1:I,y1:k},...S}})}var lP=new Set(["time","timestamp","date","datetime"]);function JI(e,t,i,{allowPrimitiveTypes:s=!0}={}){if(e!=="x"&&e!=="y"||!me(t))return;const n=cP(e,i);if(n==null||!(n in t))return;const o=t[n],a=hP(e,i),r=xY(o);if(r)return{type:r,position:a};const l=bY(n,o);if(l)return{type:l,position:a};if(s)return typeof o=="number"?{type:"number",position:a}:{type:"category",position:a}}function Bf(e,t,i){return JI(e,t,i,{allowPrimitiveTypes:!1})}function yY(e,t,i){if(e!=="x"||!me(t))return;const s=cP(e,i);if(s==null||!(s in t))return;const n=t[s],o=hP(e,i),a=vY(s,n);if(a)return{type:a,position:o};if(Pt(n))return{type:"category",position:o}}function xY(e){if(Ae(e)&&e.every(t=>Pt(t)||t===null))return"grouped-category"}function bY(e,t){if(Cs(t)||lP.has(e)&>(t))return"time"}function vY(e,t){if(Cs(t)||lP.has(e)&>(t))return"ordinal-time"}function cP(e,t){if(e==="x"&&"xKey"in t)return t.xKey;if(e==="y"&&"yKey"in t)return t.yKey}function hP(e,t){return"direction"in t&&t.direction==="horizontal"?e==="x"?"left":"bottom":e==="x"?"bottom":"left"}var SY={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},MY=(e,t)=>Math.log(t)/Math.log(e);function ek(e,t,i){const s=Math.min(...t),n=SY[e]??MY;return s>=0?n(e,i):-n(e,-i)}var DY={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},IY=(e,t)=>e**t;function tk(e,t,i){const s=Math.min(...t),n=DY[e]??IY;return s>=0?n(e,i):-n(e,-i)}var ik=class sH extends xt{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>ek(this.base,this.domain,s),this.pow=s=>tk(this.base,this.domain,s)}static is(t){return t instanceof sH}transform(t){const[i,s]=kt(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,s]=kt(this.domain);return i>=0!=s>=0?Number.NaN:i>=0?Math.exp(t):-Math.exp(-t)}toDomain(t){return t}niceDomain(t,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,o]=i,a=n>o?Math.ceil:Math.floor,r=n>o?Math.floor:Math.ceil,l=tk(s,i,a(ek(s,i,n))),c=tk(s,i,r(ek(s,i,o)));return[t.nice[0]?l:i[0],t.nice[1]?c:i[1]]}ticks({interval:t,tickCount:i=xt.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const o=this.base,[a,r]=s,l=Math.min(a,r),c=Math.max(a,r);let h=this.log(l),d=this.log(c);if(t){const x=I=>I>=l&&I<=c,b=Math.min(Math.abs(t),Math.abs(d-h)),{ticks:v,count:S,firstTickIndex:M}=lh(h,d,b,n),D=v.map(this.pow).filter(x);if(!$l(D.length,this.getPixelRange()))return{ticks:D,count:S,firstTickIndex:M}}if(!T0(o)||d-h>=i){const x=Math.min(d-h,i),{ticks:b,count:v,firstTickIndex:S}=ah(h,d,x,void 0,void 0,n);return{ticks:b.map(this.pow),count:v,firstTickIndex:S}}const u=[],p=l>0;h=Math.floor(h)-1,d=Math.round(d)+1;const f=Aa(this.range)/i;let y=1/0;for(let x=h;x<=d;x++){const b=this.convert(this.pow(x+1));for(let v=1;v=f&&k>=f;M>=l&&M<=c&&(v===1||A||u.length===0)&&(u.push(M),y=D)}}return ST(u,p,n)}},sk=class extends wi{constructor(){super(...arguments),this.segmentPath=new wi}drawPath(e){if(!this.segments||this.segments.length===0){super.drawPath(e);return}e.save();const t=kd(),i=new t;dp(i,{x0:0,y0:0,x1:e.canvas.width,y1:e.canvas.height},!1);for(const n of this.segments)dp(i,n.clipRect);e.clip(i),super.drawPath(e),e.restore();const{segmentPath:s}=this;s.setProperties({opacity:this.opacity,visible:this.visible,lineCap:this.lineCap,lineJoin:this.lineJoin,pointerEvents:this.pointerEvents});for(const{clipRect:n,fill:o,stroke:a,...r}of this.segments){e.save(),s.path=this.path,s.setProperties(r),s.fill=this.fill==null?"none":o,s.stroke=this.stroke==null?"none":a;const l=new t;dp(l,n),e.clip(l),s.drawPath(e),e.restore()}}};g([rf()],sk.prototype,"segments",2);function dp(e,{x0:t,y0:i,x1:s,y1:n},o=!0){const a=Math.min(t,s),r=Math.min(i,n),l=Math.max(t,s),c=Math.max(i,n);e.moveTo(a,r),o?(e.lineTo(l,r),e.lineTo(l,c),e.lineTo(a,c)):(e.lineTo(a,c),e.lineTo(l,c),e.lineTo(l,r)),e.closePath()}var dP=class extends ds{constructor(){super(...arguments),this.segments=[],this.scalablePath=new(jx(wi))}renderInContext(e){if(!this.visible)return;const{ctx:t}=e;if(!this.segments||this.segments?.length===0)return super.renderInContext(e);t.save();const i=kd(),s=new i;dp(s,{x0:0,y0:0,x1:t.canvas.width,y1:t.canvas.height},!1);for(const o of this.segments)dp(s,o.clipRect);t.clip(s);for(const o of this.children())o.visible&&o.render(e);t.restore();const{scalablePath:n}=this;for(const{clipRect:o,...a}of this.segments){t.save();const r=new i;dp(r,o),t.clip(r),n.setProperties(a);for(const l of this.children())!l.visible||!(l instanceof wi)||(n.path=l.path,n.setProperties({opacity:l.opacity,lineCap:l.lineCap,lineJoin:l.lineJoin,...Zj(l)&&{scalingX:l.scalingX,scalingY:l.scalingY,scalingCenterX:l.scalingCenterX,scalingCenterY:l.scalingCenterY}}),n.render(e));t.restore()}}};g([rf()],dP.prototype,"segments",2);var uP=class{constructor(e,t,i){this.root=new wY(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(s,n)=>e.distanceSquared(s,n)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},kY=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},AY=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??re.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length1){const a=n>o?Math.ceil:Math.floor,r=n>o?Math.floor:Math.ceil,l=4;for(let c=0;cMath.min(a.minTimeInterval()??1/0,o),1/0);return Number.isFinite(n)?Su(n):gP(e,t,i,s)?.unit}function gP(e,t,i,s){let n=1/0,o=-1/0,a,r=0;const l=[];for(const u of e){if(!u.visible)continue;const{extent:p}=Ug(u.getDomain(t));if(p.length===0)continue;const f=p[0].valueOf(),y=p.at(-1).valueOf();l.push(f,y),n=Math.min(n??1/0,f,y),o=Math.max(o??-1/0,f,y);const x=Math.abs(y-f);if(x===0)continue;const b=u.dataCount();if(r=Math.max(r,b),b<=1)continue;const v=x/(b-1);a=Math.min(a??1/0,v)}if(n=Math.min(n,i?.valueOf()??1/0,s?.valueOf()??1/0),o=Math.max(o,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(n)||!Number.isFinite(o))return;a??(a=Math.abs(o-n)),a=Math.min(a,CY(l));const c=Su(a);let h=a/Yi(c);r<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const d=h===1?void 0:tn(c,n);return{unit:c,step:h,epoch:d}}function CY(e){e.sort((i,s)=>i-s);let t=1/0;for(let i=1;i0&&(t=Math.min(t,Math.abs(n-s)))}return t}var nk=class extends Af{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.data?.length??0}invalidDataCount(){return this.processedData?.invalidDataCount?.get(this.id)??0}missingDataCount(){return this.dataModel?.resolveMissingDataCount(this)??0}get hasData(){return Math.max(0,this.dataCount()-this.invalidDataCount()-this.missingDataCount())>0}getScaleInformation({xScale:e,yScale:t}){const i=xt.is(e),s=xt.is(t);return{isContinuousX:i,isContinuousY:s,xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await e.request(this.id,t??Sf.empty(),i);return this.dataModel=s,this.processedData=n,this.events.emit("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const{processedData:e,ctx:t}=this;if(!e)return!1;const i=this.getNodeData();if(i!=null&&i.length>t.animationManager.maxAnimatableItems)return!1;const s=e.reduced?.animationValidation;if(!s)return!0;const{orderedKeys:n,uniqueKeys:o}=s;return n&&o}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}findNodeDatum(e){return P1(e,this.getNodeData(),this.data?.dataIdKey)}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox:s}=this,n=t[i],o={...e,datumIndex:i},a=this.computeFocusBounds(o);if(a!==void 0)return{bounds:a,clipFocusBox:s,datum:n,datumIndex:i}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>i.datumIndex-s.datumIndex),t}isDatumEnabled(e,t){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=e[t];return!i&&s&&n}computeFocusDatumIndex(e,t){const i=(a,r)=>{for(;a>=0&&!this.isDatumEnabled(t,a);)a+=r;return a===-1?void 0:a},s=(a,r)=>{for(;a0?n=s(o,e.datumIndexDelta):n=s(o,1)??i(o,-1),n===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:n}dataModelPropertyIsKey(e){const{processedData:t}=this;return t?t.defs.keys.some(i=>i.id===e&&i.idsMap?.get(this.id)?.has(e)===!0):!1}keysOrValues(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:this.dataModelPropertyIsKey(e)?t.resolveKeysById(this,e,i):t.resolveColumnById(this,e,i)}sortOrder(e){const{dataModel:t,processedData:i}=this;if(!(!t||!i))return this.dataModelPropertyIsKey(e)?t.getKeySortOrder(this,e,i):t.getColumnSortOrder(this,e,i)}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();return!t||!i||!s||(t.invalidData?.get(this.id)?.[e]??!1)?void 0:this.keysOrValues(s)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const n=t.invalidData?.get(this.id),o=this.keysOrValues(s);for(let a=0;athis.nodeFactory()),this.highlightLabelSelection=yi.select(this.highlightLabelGroup,bn),this.annotationSelections=new Set,this.seriesBelowStackContext=void 0,this.debug=ve.create(),!r||!l)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,pathsZIndexSubOrderOffset:t,propertyKeys:r,propertyNames:l,animationResetFns:a,animationAlwaysUpdateSelections:s,animationAlwaysPopulateNodeData:n,datumSelectionGarbageCollection:i,segmentedDataNodes:o},this.paths=e.map(h=>new sk({name:`${this.id}-${h}`})),this.datumSelection=yi.select(this.dataNodeGroup,()=>this.nodeFactory(),i),this.animationState=new he("empty",{empty:{update:{target:"ready",action:h=>this.animateEmptyUpdateReady(h)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:h=>this.animateReadyHighlight(h),resize:h=>this.animateReadyResize(h),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:h=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(h):this.animateWaitingUpdateReady(h)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:h=>this.resetAllAnimation(h),reset:"empty"},clearing:{update:{target:"empty",action:h=>this.animateClearingUpdateEmpty(h)},reset:"empty",skip:"ready"}},this.checkProcessedDataAnimatable.bind(this)),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",h=>this.onLegendItemClick(h)),this.ctx.eventsHub.on("legend:item-double-click",h=>this.onLegendItemDoubleClick(h)))}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}getKeyAxis(e){if(this.shouldFlipXY()){if(e==="x")return this.properties.yKeyAxis;if(e==="y")return this.properties.xKeyAxis}if(e==="x")return this.properties.xKeyAxis;if(e==="y")return this.properties.yKeyAxis}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e){for(const t of e)this.contentGroup.appendChild(t)}detachPaths(e){for(const t of e)t.remove()}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>ak}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(e){if(!this.properties.highlight.enabled)return!1;const{series:t,legendItemName:i}=e??{},{legendItemName:s}=this.properties;return t===this||s!=null&&s===i}strokewidthChange(){const e=("strokeWidth"in this.properties&&this.properties.strokeWidth)??0,t=this.properties.highlight.highlightedSeries.strokeWidth??e,i=this.properties.highlight.highlightedItem?.strokeWidth??e;return e>i||t>i}update({seriesRect:e}){const{_contextNodeData:t}=this,i=this.checkResize(e),s=this.updateHighlightSelection(),n=this;this.contentGroup.batchedUpdate(function(){const r=n.updateSelections(),l=n.contextNodeData?.segments;n.opts.segmentedDataNodes?n.dataNodeGroup.segments=l??n.dataNodeGroup.segments:n.dataNodeGroup.segments=void 0,n.updateNodes(s,i||r)});const o=this.getAnimationData(e,t);o&&(i&&this.animationState.transition("resize",o),this.animationState.transition("update",o),this.processedDataUpdated=!1)}createStackContext(){}canIncrementallyUpdateNodes(e=!1){if(this.contextNodeData?.nodeData==null)return!1;const{processedData:i}=this;return i?i.changeDescription!=null||!Co(i)||e:!1}trimIncrementalNodeArray(e,t){t{this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:t})??t})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,n]=kt(t?.range??[0,1]),[o,a]=kt(i?.range??[0,1]),r=Md(this.getSeriesDomain("x")),l=[t?.scale.convert(r.at(0)),t?.scale.convert(r.at(-1))],c=Md(this.getSeriesDomain("y")),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[d,u]=kt(l),[p,f]=kt(h);return{axis:new re(s,o,n-s,a-o),series:new re(d,p,u-d,f-p)}}updateNodes(e,t){const{highlightSelection:i,datumSelection:s}=this,n=!this.ctx.animationManager.isSkipped(),o=this.visible&&this._contextNodeData!=null;this.contentGroup.visible=n||o,this.annotationGroup.visible=n||o,this.highlightGroup.visible=(n||o)&&e,this.updateDatumStyles({datumSelection:i,isHighlight:!0});const a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateDatumNodes({datumSelection:i,isHighlight:!0,drawingMode:a}),this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}),this.animationState.transition("highlight",i),this.ctx.eventsHub.emit("highlight:selection-updated",{highlightSelection:i});const{dataNodeGroup:r,labelSelection:l,paths:c,labelGroup:h}=this,{itemId:d}=this.contextNodeData??{};if(this.updatePathNodes({itemId:d,paths:c,visible:o,animationEnabled:n}),r.visible=n||o,h.visible=o,!r.visible)return;this.hasItemStylers()&&this.updateDatumStyles({datumSelection:s,isHighlight:!1});const u=this.strokewidthChange()||this.hasChangesOnHighlight;(t||u)&&(this.updateDatumNodes({datumSelection:s,isHighlight:!1,drawingMode:"overlay"}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:l,isHighlight:!1})}))}getHighlightData(e,t){return t?[{...t}]:void 0}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum&&s.itemId===t.itemId);return i.length===0?void 0:i}updateHighlightSelection(){const{highlightSelection:e,highlightLabelSelection:t,_contextNodeData:i}=this;if(!i)return!1;const s=this.ctx.highlightManager?.getActiveHighlight(),o=this.isSeriesHighlighted(s)&&s?.datum?s:void 0;if(o==null)return!1;const{nodeData:a,labelData:r}=i,l=this.getHighlightData(a,o);this.highlightSelection=this.updateHighlightSelectionItem({items:l,highlightSelection:e});const c=this.getHighlightLabelData(r,o)??[];return this.highlightLabelSelection=this.updateLabelSelection({labelData:c,labelSelection:t})??t,!0}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)e.datum.missing!==!0&&(yield e)}getQuadTree(){if(this.quadtree===void 0){const e=this.ctx.scene?.canvas??{width:0,height:0},t=new re(0,0,e.width,e.height);this.quadtree=new uP(100,10,t),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickViewportFocus(e){if(this.contextNodeData?.nodeData===void 0)return;const{otherIndex:t,where:i,hoverRect:s}=e;if(i==="data-start")return this.pickFocus({datumIndex:0,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0});if(i==="data-end"){const v=this.contextNodeData.nodeData.length-1;return this.pickFocus({datumIndex:v,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0})}let n,o=0,a,r=this.contextNodeData.nodeData.length-1;const l=this.axes.x?.reverse??!1;function c(v){const S=s.x+s.width;return v.x+v.width<=S}function h(v){return v.x>=s.x}function d(v,S){const M=NI(S);v(M)?(n=S,r=a-1):o=a+1}function u(v,S){const M=NI(S);v(M)?(n=S,o=a+1):r=a-1}const p={"viewport-start + true":{predicate:c,iterator:d},"viewport-start + false":{predicate:h,iterator:d},"viewport-end + true":{predicate:h,iterator:u},"viewport-end + false":{predicate:c,iterator:u}},{predicate:f,iterator:y}=p[`${i} + ${l}`];let x=0;const b=Math.ceil(Math.log2(this.contextNodeData.nodeData.length))+1;for(;o<=r&&x<=b;){a=Math.floor((o+r)/2);const v=this.pickFocus({datumIndex:a,datumIndexDelta:0,otherIndex:t,otherIndexDelta:0});if(v===void 0){W.error(`pickFocus (datumIndex: ${a}) failed`);return}y(f,v),x++}return n}pickNodeDataExactShape(e){const{x:t,y:i}=e,{dataNodeGroup:s}=this,n=s.pickNodes(t,i).filter(o=>o.datum.missing!==!0);if(n.length!==0)return n.map(a=>a.datum)}pickModulesExactShape(e){for(const t of this.moduleMap.modules()){const{datum:i}=t.pickNodeExact(e)??{};if(i!=null&&i?.missing!==!0)return[i]}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.length!==0?t:this.pickNodeDataExactShape(e)??this.pickModulesExactShape(e)??[]}pickNodeDataClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:n}=this;if(!n)return;const o=s.x,a=s.y,r={x:t,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(u)||!(o?.inRange(d)&&a?.inRange(u)))continue;const f=Math.max((r.x-d)**2+(r.y-u)**2,0);ff.isCategoryLike()).map(f=>f.direction);if(t&&c.length===0)return;const[h="x"]=c,d=[i,s];h!=="x"&&d.reverse();const u=[1/0,1/0];let p;for(const f of o.nodeData){const{x:y=Number.NaN,y:x=Number.NaN}=f.point??f.midPoint??{};if(Number.isNaN(y)||Number.isNaN(x)||f.missing===!0)continue;const b=[r?.inRange(y,1),l?.inRange(x,1)];if(h!=="x"&&b.reverse(),!b[0]||!a&&!b[1])continue;const v=[y,x];h!=="x"&&v.reverse();let S=!0;for(let M=0;Mu[M]){S=!1;break}else D{const h=i?.[c]??c;return this.xCoordinateRange(o[h],a,h)});return rthis.keysOrValues(f));let u=1/0,p=-1/0;for(const[f,y]of c.entries()){const[x,b]=this.xCoordinateRange(y,0,f);if(!(bl))for(let v=0;vp?[Number.NaN,Number.NaN]:[u,p]}domainForClippedRange(e,t,i){const{processedData:s,dataModel:n,axes:o}=this,r=LY(o[e==="x"?"y":"x"]);if(!r)return t.flatMap(y=>n.getDomain(this,y,"value",s).domain);const l=this.keysOrValues(i),c=this.sortOrder(i);if(c!=null){const y=NY(c,l.length,r,x=>l[x]);return n.getDomainBetweenRange(this,t,y,s)}const h=t.map(y=>this.keysOrValues(y)),d=r[0].valueOf(),u=r[1].valueOf();let p=1/0,f=-1/0;for(const[y,x]of l.entries()){const b=x.valueOf();if(!(bu))for(let v=0;vf?[Number.NaN,Number.NaN]:[p,f]}zoomFittingVisibleItems(e,t,i,s,n){const{dataModel:o,processedData:a}=this;if(!o||!a)return;const r=this.axes.x;if(s!=null)return;const l=this.sortOrder(e);if(l==null)return;const c=this.keysOrValues(e);if(n>c.length)return{x:[0,1],y:void 0};const h=r.scale,d=h.range;h.range=[0,1];let[u,p]=this.visibleRangeIndices(e,i,void 0,{sortOrder:l});p-=1;const f=0;this.xCoordinateRange(c[u],f,u)[0]i[1]&&(p-=1);let y;if(Math.abs(p-u)>=n-1)y=i;else{const x=(i[0]+i[1])/2;for(;Math.abs(p-u)0||po.resolveColumnById(this,k,a)),c=this.shouldFlipXY(),h=c?this.axes.y:this.axes.x,d=c?this.axes.x:this.axes.y,u=c?s??[0,1]:i,p=c?i:s??[0,1];if(s==null){const k=this.sortOrder(e);if(k!=null){const A=h.scale,w=A.range;A.range=[0,1];const C=this.keysOrValues(e);let[T,O]=this.visibleRangeIndices(e,u,void 0,{sortOrder:k});if(O-=1,Ou[1]&&(O-=1);const z=Math.abs(O-T)+1;return A.range=w,z}}const f=(k,A,w)=>k[0]+(w-A[0])/(A[1]-A[0])*(k[1]-k[0]),y=h.range.toSorted(),x=d.range.toSorted(),b=f(y,h.visibleRange,u[0]),v=f(y,h.visibleRange,u[1]),S=f(x,d.visibleRange,Math.min(...p)),M=f(x,d.visibleRange,Math.max(...p)),D=Math.round((u[0]+(u[1]-u[0])/2)*r.length),I=0;return I$(0,r.length-1,D,n,k=>{const[A,w]=this.xCoordinateRange(r[k],I,k),[C,T]=this.yCoordinateRange(l.map(O=>O[k]),I,k);return!je(A)||!je(w)||!je(C)||!je(T)?!1:A>=b&&w<=v&&C>=S&&T<=M})}minTimeInterval(){let e;try{e=this.keysOrValues("xValue")}catch{}if(e==null||e.length>1e3)return;let t=1/0,i=e[0],s;for(let n=1;ne.convert(s),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof xt){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof na){if(e instanceof sc){const t=e.getLinearParams(),i=e.getBandCountForUpdate();if(t!=null&&i>0)return{type:"category",variant:"unit-time",firstBandTime:t.firstBandTime,lastBandTime:t.firstBandTime+(i-1)*t.intervalMs,bandCount:i,intervalMs:t.intervalMs,inset:e.inset,step:e.step}}return{type:"category",domain:e.domain,inset:e.inset,step:e.step}}}calculateScaling(){const e={};for(const t of Object.values(_y)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function LY(e){let t,i;if((e instanceof eo||e instanceof Ka)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function NY(e,t,i,s){const n=i[0].valueOf(),o=i[1].valueOf();let a=ih(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),r=ko(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=o});return a==null||r==null?[0,0]:(e===-1&&([a,r]=[t-r,t-a]),a=Math.max(a,0),r=Math.min(r+1,t),[a,r])}function fP(e){const t=new Map;for(const i of e){if(!(i instanceof dc))continue;const n=(i.seriesGrouping?.stackCount??0)>0?i.seriesGrouping?.groupIndex:void 0;if(n==null){i.seriesBelowStackContext=void 0,i.createStackContext();continue}const o=`${i.type}-${n}`;let a=t.get(o);a==null&&(a=[],t.set(o,a)),a.push(i)}for(const i of t.values()){i.sort((n,o)=>(n.seriesGrouping?.stackIndex??0)-(o.seriesGrouping?.stackIndex??0));let s;for(const n of i)n.seriesBelowStackContext=s,s=n.createStackContext()}}function Wh(e,t,i,s,n,o,a=["series",`${e.declarationOrder}`,"label"]){if(e.visible&&s.itemStyler){const r=e.getHighlightStateString(o,n||t!=null&&o?.series===t.series&&o?.datumIndex===t.datumIndex,t?.datumIndex),l=typeof t?.datumIndex=="number"?t.datumIndex:t?.itemId,c={border:s.border,color:s.color,cornerRadius:s.cornerRadius,datum:t?.datum,enabled:s.enabled,fill:s.fill,fillOpacity:s.fillOpacity,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,itemId:l,itemType:t?.itemType,seriesId:e.id,padding:s.padding,highlightState:r},h=e.ctx.optionsGraphService.resolvePartial(a,e.cachedCallWithContext(s.itemStyler,{...i,...c}),{pick:!1})??{};return ce(h,c)}return s}function mP(e,t,i,s,n,o,a){if(e.visible&&s.enabled&&n){const r=Wh(e,t.datum,i,s,o,a);t.visible=!0,t.x=n.x,t.y=n.y,t.text=n.text,t.fill=r.color,t.setAlign(n),t.setFont(r),t.setBoxing(r)}else t.visible=!1}var TY={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function yP({isUpward:e,isVertical:t,placement:i,spacing:s=0,rect:n}){let o=n.x+n.width/2,a=n.y+n.height/2,r="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:d}=TY[i],u=(h+1)*.5;if(t){const p=e?n.y+n.height:n.y,f=n.height*c;a=p+f*u+s*d*c,l=d===c?"top":"bottom"}else{const p=e?n.x:n.x+n.width,f=n.width*c;o=p+f*u+s*d*c,r=d===c?"left":"right"}}return{x:o,y:a,textAlign:r,textBaseline:l}}function ei({id:e},t,i,...s){for(const n of s)n.cleanup();Kr(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Pb({id:e},t,i,...s){Kr(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function $h(e){return{opacity:1}}var sn=class extends dh{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};g([m,K()],sn.prototype,"enabled",2),g([m,Hr({equals:ph})],sn.prototype,"shape",2),g([m,K()],sn.prototype,"size",2),g([m,Hr({equals:Ht})],sn.prototype,"fill",2),g([m,K()],sn.prototype,"fillOpacity",2),g([m,K()],sn.prototype,"stroke",2),g([m,K()],sn.prototype,"strokeWidth",2),g([m,K()],sn.prototype,"strokeOpacity",2),g([m],sn.prototype,"lineDash",2),g([m],sn.prototype,"lineDashOffset",2),g([m,Hr({equals:ph})],sn.prototype,"itemStyler",2);function OY(e,t){if(e!=null)return{enabled:e.enabled??!0,stroke:e.stroke??t?.stroke??"transparent",strokeWidth:e.strokeWidth??t?.strokeWidth??1,strokeOpacity:e.strokeOpacity??t?.strokeOpacity??1,lineDash:e.lineDash??t?.lineDash??[]}}var xP=class extends q{constructor(){super(...arguments),this.enabled=!1}};g([m],xP.prototype,"enabled",2);var Qr=class extends q{constructor(){super(...arguments),this.interaction=new xP,this.position=new $u,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const s=this.renderer==null?void 0:ls(e,this.renderer,i);if(Pt(s)||gt(s)||Cs(s))return{type:"raw",rawHtmlString:Dt(s)};if(s!=null){const n=ce(s.symbol?.marker,t.symbol?.marker),o=s.symbol?.line??t.symbol?.line?ce(s.symbol?.line,t.symbol?.line):void 0,a=t.symbol||s.symbol?{marker:n,line:OY(o,n)}:void 0;return{type:"structured",...t,...s,symbol:a}}return{type:"structured",...t}}};g([m],Qr.prototype,"enabled",2),g([m],Qr.prototype,"showArrow",2),g([m],Qr.prototype,"renderer",2),g([m],Qr.prototype,"interaction",2),g([m],Qr.prototype,"position",2),g([m],Qr.prototype,"range",2),g([m],Qr.prototype,"class",2);function Kh(){return new Qr}var Jr=class oH extends Df{constructor(t,i=new Hu,s=!0){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=s,this.nice=!1}static is(t){return t instanceof oH}isCategoryLike(){return!0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t.domain,clipped:!1}}getUpdateTypeOnResize(){return this.bandAlignment==null||this.bandAlignment==="justify"?super.getUpdateTypeOnResize():3}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!je(t)||!je(i)){const s=this.reduceBandScalePadding();t??(t=s.inner),i??(i=s.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}calculateGridLines(t,i,s){const n=super.calculateGridLines(t,i,s);return this.interval.placement==="between"&&t.length>0&&n.push(super.calculateGridLine({index:t.at(-1).index+1,tickId:`after:${t.at(-1).tickId}`,translation:this.range[1]},t.length,i,s,t)),n}calculateGridLine({index:t,tickId:i,translation:s},n,o,a,r){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridLine({index:t,tickId:i,translation:s},n,o,a,r);const u=so[0]+a.step/2,h=t.at(-1),d=n&&h.translationthis.calculateGridFill(u,p,u.index,i,s,t))),d){const u={tickId:`after:${h.tickId}`,translation:h.translation+a.step};r.push(this.calculateGridFill(u,t.length,h.index+1,i,s,t))}return r}calculateGridFill({tickId:t,translation:i},s,n,o,a,r){const{gridLine:l,horizontal:c,interval:h,scale:d}=this;if(h.placement!=="between")return super.calculateGridFill({tickId:t,translation:i},s,n,o,a,r);const u=i-d.step/2,p=i+d.step/2,[f,y,x,b]=c?[u,Math.max(o,a),p,Math.min(o,a)]:[Math.min(o,a),u,Math.max(o,a),p],{fill:v,fillOpacity:S}=l.style[n%l.style.length]??{};return{tickId:t,x1:f,y1:y,x2:x,y2:b,fill:v,fillOpacity:S}}calculateTickLines(t,i,s=0){const n=super.calculateTickLines(t,i,s);return this.interval.placement==="between"&&t.length>0&&n.push(super.calculateTickLine({isPrimary:!1,tickId:`after:${t.at(-1)?.tickId}`,translation:this.range[1]},t.length,i,t,s)),n}calculateTickLine({isPrimary:t,tickId:i,translation:s},n,o,a,r=0){const{horizontal:l,interval:c,primaryTick:h,scale:d,tick:u}=this;if(c.placement!=="between")return super.calculateTickLine({isPrimary:t,tickId:i,translation:s},n,o,a,r);const p=t&&h?.enabled?h:u,f=-o*this.getTickSize(p),y=s{const s=i.getBandScalePadding?.();return s&&(t.inner>s.inner&&(t.inner=s.inner),t.outertypeof f!="string")&&(t=t.map(String)),{type:"category",value:t,datum:a,seriesId:r,legendItemName:l,key:c,source:h,property:d,domain:u,boundSeries:p}}};Jr.className="CategoryAxis",Jr.type="category",g([m],Jr.prototype,"groupPaddingInner",2),g([m],Jr.prototype,"paddingInner",2),g([m],Jr.prototype,"paddingOuter",2),g([St("layoutConstraints","align")],Jr.prototype,"bandAlignment",2),g([m],Jr.prototype,"skipNullBars",2),g([Ze({newValue(e){e==null||e<=0?(this.layoutConstraints.width=100,this.layoutConstraints.unit="percent"):(this.layoutConstraints.width=e,this.layoutConstraints.unit="px",this.animationManager.skipCurrentBatch())}})],Jr.prototype,"requiredRange",2);var Ff=Jr,PY=1e3,bP=class aH extends Hu{constructor(){super(...arguments),this.previousDomainJson=void 0,this.animatable=!0}static is(t){return t instanceof aH}set domain(t){if(t.length<=PY){const i=JSON.stringify(t);this.animatable=this.previousDomainJson===void 0||this.previousDomainJson===i,this.previousDomainJson=i}else this.animatable=this.previousDomainJson===void 0,this.previousDomainJson="";super.domain=t}get domain(){return super.domain}normalizeDomains(...t){const{domain:i}=super.normalizeDomains(...t);return{domain:i,animatable:!1}}findIndex(t){return super.findIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const i=JSON.stringify(t),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}},EY=class rH{constructor(t="",i,s){this.label=t,this.parent=i,this.refId=s,this.position=0,this.subtreeLeft=Number.NaN,this.subtreeRight=Number.NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.separatorDepth=0,this.leftmostLeaf=this,this.screen=0,this.depth=i?i.depth+1:0}insertTick(t,i){let s=this,n;for(let o=0;oh.label===a);if(c&&r)s=c,n=c;else{const h=new rH(a,s,i);h.index=l.length,l.push(h),r&&(s=h),n=h}}return n}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((t,i)=>i!==this.index)??[]}};function RY(e){const t=e.reduce((n,o)=>Math.max(n,o.length),0),i=new EY,s=new Map;for(let n=0;n=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}function FY(e,t){const i=e.getLeftSibling();if(i){let s=e,n=e,o=i,a=n.getLeftmostSibling(),r=n.mod,l=s.mod,c=o.mod,h=a.mod;for(;o.nextRight()&&n.nextLeft();){o=o.nextRight(),n=n.nextLeft(),a=a.nextLeft(),s=s.nextRight(),s.ancestor=e;const d=o.prelim+c-(n.prelim+r)+1;d>0&&(zY(VY(o,e,t),e,d),r+=d,l+=d),c+=o.mod,r+=n.mod,h+=a.mod,l+=s.mod}o.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!a.nextLeft()&&(a.mod+=r-h),t=e)}return t}function vP(e){const{children:t}=e;if(t.length){let[i]=t;for(const o of t)vP(o),i=FY(o,i);BY(e);const s=(t[0].prelim+t.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function SP(e,t,i){e.position=e.prelim+t,e.separatorDepth=e.index===0?1+(e.parent?.separatorDepth??0):0,i.insertNode(e);for(const s of e.children)SP(s,t+e.mod,i)}function MP(e){const{children:t}=e;let i=0;for(const s of t)MP(s),s.children.length?i+=s.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t.at(-1).subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2,e.leftmostLeaf=t[0].leftmostLeaf):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function _Y(e){const t=new HY,{root:i,tickNodes:s}=RY(e);return vP(i),SP(i,-i.prelim,t),MP(i),{layout:t,tickNodes:s}}var HY=class{constructor(){this.minPosition=1/0,this.maxPosition=-1/0,this.nodes=[],this.depth=0}insertNode(e){this.depththis.maxPosition&&(this.maxPosition=e.position),this.nodes.push(e)}scaling(e,t){let i=1;return e>0&&this.maxPosition!==this.minPosition&&(i=e/(this.maxPosition-this.minPosition)),t&&(i*=-1),i}resize(e,t,i,s){const n=Math.abs(e[1]-e[0])-t,o=this.scaling(n,e[0]>e[1]),a=i+s/2;let r=0;for(const l of this.nodes){const c=l.position*o;r>c&&(r=c),l.screen=c+a}for(const l of this.nodes)l.screen-=r}},Uh=5,Vs=class extends q{constructor(){super(...arguments),this.enabled=!0,this.border=new Mh}};g([m],Vs.prototype,"enabled",2),g([m],Vs.prototype,"avoidCollisions",2),g([m],Vs.prototype,"border",2),g([m],Vs.prototype,"color",2),g([m],Vs.prototype,"cornerRadius",2),g([m],Vs.prototype,"spacing",2),g([m],Vs.prototype,"rotation",2),g([m],Vs.prototype,"wrapping",2),g([m],Vs.prototype,"truncate",2),g([m],Vs.prototype,"fill",2),g([m],Vs.prototype,"fontStyle",2),g([m],Vs.prototype,"fontWeight",2),g([m],Vs.prototype,"fontSize",2),g([m],Vs.prototype,"fontFamily",2),g([m],Vs.prototype,"padding",2);var Eb=class extends q{constructor(){super(...arguments),this.enabled=!0}};g([m],Eb.prototype,"enabled",2),g([m],Eb.prototype,"width",2),g([m],Eb.prototype,"stroke",2);var rk=class extends q{constructor(){super(...arguments),this.label=new Vs,this.tick=new Eb}};g([m],rk.prototype,"label",2),g([m],rk.prototype,"tick",2);var _f=class extends Ff{constructor(e){super(e,new bP),this.tickScale=new bP,this.computedLayout=void 0,this.tickTreeLayout=void 0,this.tickNodes=void 0,this.leafNodeToKey=void 0,this.ftdPositions=new Map,this.ftdCandidates=new Set,this.ftdKept=new Set,this.ftdByDepth=[],this.ftdStack=[],this.depthOptions=new Bi(rk),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let o=0;o{e.fill=t.color,e.text=t.text,e.textBaseline=t.textBaseline,e.textAlign=t.textAlign??"center",e.pointerEvents=t.textUntruncated==null?1:0,e.setFont(t),e.setBoxing(t)})}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:n,horizontal:o,line:a}=this,r=this.chartLayout?.scrollbars?.[this.id],l=this.getScrollbarThickness(r),c=this.getTickSpacing();if(this.lineNode.datum=o?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:a.stroke,strokeWidth:a.enabled?a.width:0}),this.tickTreeLayout?.resize(this.scale.range,this.scale.step,this.scale.inset,this.scale.bandwidth),!this.tickTreeLayout?.depth)return{bbox:re.zero,spacing:0,tickSizeAtDepth:[],tickLabelLayout:[]};const{depth:h,nodes:d}=this.tickTreeLayout,u=o?-i.getSideFlag():i.getSideFlag(),p=[],f=new Map,y=new Pu,x=this.getDepthOptionsMap(h),b=u*(x[0].spacing+l+c),v=this.tickFormatter(this.scale.domain,this.scale.domain,!1),S=new Map,M={};for(const[_,Y]of d.entries()){const Z=h-Y.depth;if(M[Z]??(M[Z]=0),!Y.children.length&&epe){f.delete(_);continue}}const Re=y.getPlainText(),ze=y.getBoxingProperties();p.push({text:Re,textUntruncated:Z.truncatedText,visible:!0,tickId:C(Re),range:this.scale.range,border:ze.border,color:y.fill,cornerRadius:ze.cornerRadius,fill:ze.fill,fontFamily:y.fontFamily,fontSize:y.fontSize,fontStyle:y.fontStyle,fontWeight:y.fontWeight,padding:ze.padding,rotation:y.rotation,rotationCenterX:y.rotationCenterX,rotationCenterY:y.rotationCenterY,textAlign:y.textAlign,textBaseline:y.textBaseline,x:y.x,y:y.y}),f.set(_,zt.toCanvas(y))}const O=(I[h-1]??0)+l+c,V=[this.lineNodeBBox(),re.merge(f.values()),new re(0,0,O*u,0)],z=re.merge(V),R=o?z.height:z.width,{spacing:B,scrollbarLayout:G}=this.applyScrollbarLayout(V,R,r);this.layout.labelThickness=R,this.layout.scrollbar=G,t.enabled&&V.push(this.titleBBox(this.scale.domain,B));const F=re.merge(V);return this.layoutCrossLines(),{bbox:F,spacing:B,tickSizeAtDepth:I,tickLabelLayout:p}}buildDepthsMap(e){const{tickNodes:t,tickScale:i,tickTreeLayout:s}=this;if(!s||!t)return new Map;const n=s.depth,o=new Map;for(const a of e){const r=t.get(a),l=r==null?n-1:Math.min(r.separatorDepth,n-1);o.set(a,l)}if(i.step1){const a=e.at(-1);if(a&&!t.has(a)){const r=e.at(-2),l=r?o.get(r):void 0;l!=null&&o.set(a,l)}}return o}filterTicksTopDown(e,t){const{tickScale:i,tickTreeLayout:s,tickNodes:n,leafNodeToKey:o}=this;if(!s||n==null||o==null)return{ticks:e,depthsMap:new Map};const a=i.range,r=i.step,l=i.inset,c=i.bandwidth,h=t?.[0]??0,d=t?.[1]??1,u=this.filterTickCache;if(u&&u.range0===a[0]&&u.range1===a[1]&&u.step===r&&u.inset===l&&u.bandwidth===c&&u.vr0===h&&u.vr1===d)return u.result;const p=z=>(this.filterTickCache={range0:a[0],range1:a[1],step:r,inset:l,bandwidth:c,vr0:h,vr1:d,result:z},z);if(i.step>=Uh)return p({ticks:e,depthsMap:this.buildDepthsMap(e)});const f=this.ftdPositions;f.clear();const y=this.ftdCandidates;y.clear();const x=this.ftdKept;x.clear();const b=this.ftdStack;b.length=0;const v=z=>(f.has(z)||f.set(z,i.convert(z)),f.get(z)),S=z=>{let R=0;for(const B of z)if(Number.isFinite(v(B))&&(R+=1,R>1))break;return R};let M=e;if(t!=null&&(t[0]!==0||t[1]!==1)){const z=i.domain,R=z.length;if(R>0){const B=Math.max(0,Math.floor(t[0]*R)-1),G=Math.min(R-1,Math.ceil(t[1]*R));if(e.length===0)M=z.slice(B,G+1);else{const F=z[B],_=z[G],Y=e[0],Z=e.at(-1),ne=F!=null&&F!==Y,te=_!=null&&_!==Z;if(ne||te){const ue=ne?[F]:[];ue.push(...e),te&&ue.push(_),M=ue}}}}if(S(M)<=1)return p({ticks:M,positions:f,depthsMap:this.buildDepthsMap(M)});for(const z of M)y.add(z);for(const z of M){let B=n.get(z)?.parent;for(;B?.parent;){const G=o.get(B.leftmostLeaf);G!=null&&y.add(G),B=B.parent}}const D=Math.max(0,s.depth-1),I=z=>Math.min(D,s.depth-z.depth),k=s.nodes[0];if(!k?.children.length)return p({ticks:M,positions:f,depthsMap:this.buildDepthsMap(M)});const A=this.ftdByDepth;for(const z of A)z.positions.length=0,z.ticks.length=0;const w=(z,R)=>{const B=z.at(-1);return B!=null&&R-B{for(let B=R+1;B<=D;B++)if(w(A[B].positions,z))return!1;return!w(A[R].positions,z)},T=(z,R,B)=>{const G=A[B];G.positions.push(z),G.ticks.push(R)},O=(z,R)=>{if(R!==0)for(let B=0;B0&&z-G.positions.at(-1)=0;z--){const R=k.children[z],B=o.get(R.leftmostLeaf);B!=null&&y.has(B)&&b.push(R)}for(;b.length;){const z=b.pop(),R=o.get(z.leftmostLeaf);if(R==null||!y.has(R))continue;const B=v(R);if(B==null||!Number.isFinite(B))continue;if(x.has(R)){for(let F=z.children.length-1;F>=0;F--)b.push(z.children[F]);continue}const G=I(z);if(C(B,G)){x.add(R),T(B,R,G),O(B,G);for(let F=z.children.length-1;F>=0;F--)b.push(z.children[F])}}for(const z of M){if(n.has(z))continue;const R=v(z);if(R==null||!Number.isFinite(R)||x.has(z))continue;const B=0;C(R,B)&&(x.add(z),T(R,z,B),O(R,B))}const V=M.filter(z=>x.has(z));return p({ticks:V,positions:f,depthsMap:this.buildDepthsMap(V)})}update(){if(!this.computedLayout)return;this.scale.animatable||this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:s,visibleRange:n,tickTreeLayout:o}=this;if(!o)return;const{tickSizeAtDepth:a,spacing:r}=this.computedLayout,{depth:l}=o,c=this.chartLayout?.scrollbars?.[this.id],h=this.getScrollbarThickness(c),d=this.getTickSpacing(),{position:u,horizontal:p,gridPadding:f}=this,y=u==="bottom"||u==="right"?-1:1,x=f,b=y*s-f,v={nice:[!1,!1],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0};let{ticks:S}=e.ticks(v,void 0,n);const M=this.filterTicksTopDown(S,n);S=M.ticks;const{depthsMap:D}=M,I=A=>D.get(A)??l-1,k=S.map((A,w)=>({index:e.findIndex(A),tickId:us(w,...A),translation:Math.round(M.positions?.get(A)??e.convert(A))}));this.gridLineGroupSelection.update(i.enabled&&s?this.calculateGridLines(k,x,b):[]),this.gridFillGroupSelection.update(i.enabled&&s?this.calculateGridFills(k,x,b):[]),this.tickLineGroupSelection.update(t.enabled?S.map((A,w)=>{const{tickId:C,translation:T}=k[w],O=I(A),V=this.depthOptions[O]?.tick,z=a[O]??0,R=V?.stroke??t.stroke,B=V?.enabled===!1?0:V?.width??t.width,G=-y*z,F=-y*(h+d),[_,Y,Z,ne]=p?[T,F,T,F+G]:[F,T,F+G,T];return{tickId:C,offset:T,x1:_,y1:Y,x2:Z,y2:ne,stroke:R,strokeWidth:B,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateGridFills(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(e,t){this.chartLayout=t;const{tickSizeAtDepth:i,tickLabelLayout:s,spacing:n,bbox:o}=this.computeLayout();return this.computedLayout={tickSizeAtDepth:i,tickLabelLayout:s,spacing:n},{bbox:o,niceDomain:this.scale.domain}}onGridVisibilityChange(){super.onGridVisibilityChange(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(l=>l.visible).flatMap(l=>Md(l.getDomain(e)));this.dataDomain={domain:Qo(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&(this.dataDomain={...this.dataDomain,domain:this.dataDomain.domain.toReversed()});const i=this.dataDomain.domain.map(DP),{layout:s,tickNodes:n}=_Y(i);this.tickTreeLayout=s,this.tickNodes=n,this.leafNodeToKey=new Map;for(const[l,c]of n)this.leafNodeToKey.set(c,l);this.filterTickCache=void 0,this.ftdByDepth=Array.from({length:Math.max(0,s.depth-1)+1},()=>({positions:[],ticks:[]}));const o=[];for(const l of this.tickTreeLayout.nodes)l.leafCount||l.refId==null||o.push(this.dataDomain.domain[l.refId]);const a=e0(this.dataDomain.domain,o);this.scale.domain=a;const r=a.map(DP);r.push([""]),this.tickScale.domain=r}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=Ae(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};_f.className="GroupedCategoryAxis",_f.type="grouped-category",g([m],_f.prototype,"depthOptions",2);function DP(e){return Dd(me(e)&&"value"in e?e.value:e)}function Rb(e,t){for(const i of t){const s=i.datum;s===void 0?W.error("undefined datum"):e.addValue(i,s)}}function zb(e,t){const{x:i,y:s}=t,{nearest:n,distanceSquared:o}=e.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(o)}}var Hf=class extends ca{constructor(){super(...arguments),this.direction="vertical",this.width=void 0,this.widthRatio=void 0}};g([m],Hf.prototype,"direction",2),g([m],Hf.prototype,"width",2),g([m],Hf.prototype,"widthRatio",2);var IP=class extends dc{constructor(){super(...arguments),this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=je(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=Qo(e)??[Number.NaN,Number.NaN];return typeof t=="boolean"?n[t?0:1]-=(t?1:-1)*s:(n[0]-=s,n[1]+=s),vn(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getMinimumRangeSeries(e){const{width:t}=this.properties;if(t==null||!this.getCategoryAxis())return;const{index:s}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);e[s]=Math.max(e[s]??0,t)}getMinimumRangeChart(e){if(e.length===0)return 0;const t=this.getCategoryAxis();if(!(t instanceof _f||t instanceof Ff))return 0;const i=this.data?.netSize()??0;if(i===0)return 0;const s=this.getBandScalePadding(),{paddingInner:n=s.inner,paddingOuter:o=s.outer,groupPaddingInner:a}=t,r=e.reduce((u,p)=>u+p,0),l=r/e.length,{visibleGroupCount:c}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this),h=r+a*l*(c-1),d=(i-n+o*2)/(1-n);return h*d}validateCreateNodeDataPreconditions(){const e=this.getCategoryAxis(),t=this.getValueAxis();if(!(!e||!t||!this.dataModel||!this.processedData))return{xAxis:e,yAxis:t}}getBandwidth(e,t){return xt.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth??0}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t,0),n=xt.is(i)?s*-.5:0,o=i.convert(e)+n;return[o,o+s]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,s=e.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return kt(s)}getBarDimensions(){const e=this.getCategoryAxis(),t=this.getBandwidth(e);this.ctx.seriesStateManager.updateGroupScale(this,t,e);const i=this.getBarWidth(),s=this.getBarOffset(i);let n=this.getGroupOffset();if(this.ctx.domManager.isRtl&&this.seriesGrouping!=null){const o=this.ctx.seriesStateManager.getGroupBandWidth(this);n=t-n-o}return{groupOffset:n,barOffset:s,barWidth:i}}getGroupOffset(){return this.ctx.seriesStateManager.getGroupOffset(this)}getBarOffset(e){const t=this.ctx.seriesStateManager.getGroupScale(this),i=this.getCategoryAxis();let s=0;xt.is(i.scale)?s=-e/2:this.seriesGrouping==null&&t?s=(this.getGroupScaleRangeWidth(t)-e)/2:t&&this.properties.widthRatio!=null&&(s=(t.bandwidth-e)/2);const n=this.ctx.seriesStateManager.getStackOffset(this,e);return s+n}getBarWidth(){const{seriesGrouping:e}=this,{width:t}=this.properties;let{widthRatio:i}=this.properties;const s=this.ctx.seriesStateManager.getGroupScale(this),n=s?.bandwidth??0;if(e==null&&(i??(i=1)),i!=null){let o=t;return e==null&&o==null&&s&&(o=this.getGroupScaleRangeWidth(s)),o==null&&n<1&&s?s.rawBandwidth:(o??n)*i}return t??(n<1&&s?s.rawBandwidth:n)}getGroupScaleRangeWidth(e){let t=e.range[1]-e.range[0];return e.round&&t>0&&(t=Math.floor(t)),t}getDatumOffset(e){if(!this.processedData?.invalidData||!this.processedData?.missingData||!this.getCategoryAxis()?.skipNullBars)return 0;const t=this.ctx.seriesStateManager.getDatumOffset(this,this.processedData.invalidData,this.processedData.missingData,e);return this.ctx.domManager.isRtl?-t:t}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){Rb(e,this.datumNodesIter())}pickNodeClosestDatum(e){return zb(this,e)}};function Oi(e,t,i){return(t-e)*i+e}function kP(e,t){const{x0:i,y0:s,x1:n,y1:o}=e,r=(o-s)/(n-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:r,stepX:t,stepY0:r,stepY1:r,rightCp1x:t,rightCp1y:r,rightCp2x:n,rightCp2y:o}}function GY(e,t){const{cp0x:i,cp0y:s,cp1x:n,cp1y:o,cp2x:a,cp2y:r,cp3x:l,cp3y:c}=e,h=of(i,n,a,l,t),[d,u]=Du(i,s,n,o,a,r,l,c,h),p=d[3].y;return{leftCp1x:d[1].x,leftCp1y:d[1].y,leftCp2x:d[2].x,leftCp2y:d[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:u[1].x,rightCp1y:u[1].y,rightCp2x:u[2].x,rightCp2y:u[2].y}}function jY(e){const{x0:t,y0:i,x1:s,y1:n,stepX:o}=e;return{leftCp1x:(t+o)/2,leftCp1y:i,leftCp2x:(t+o)/2,leftCp2y:i,stepX:o,stepY0:i,stepY1:n,rightCp1x:(o+s)/2,rightCp1y:n,rightCp2x:(o+s)/2,rightCp2y:n}}function AP(e,t){return e.type==="linear"?kP(e,t):e.type==="cubic"?GY(e,t):e.type==="step"?jY(e):kP(e,t)}function wP(e,t,i,s,n,o,a){switch(t){case 0:a?e.moveTo(n,o):e.moveTo(i,s);break;case 1:a?e.lineTo(n,o):e.lineTo(i,s);break;case 2:break}}function CP(e,t,i,s,n,o){o?e.lineTo(t,i):e.lineTo(s,n)}function LP(e,t,i,s,n,o,a,r,l,c){c?e.cubicCurveTo(o,a,s,n,t,i):e.cubicCurveTo(s,n,o,a,r,l)}function NP(e,t,i,s,n,o,a){a?(e.lineTo(o,n),e.lineTo(o,i),e.lineTo(t,i)):(e.lineTo(o,i),e.lineTo(o,n),e.lineTo(s,n))}function WY(e,t,i,s,n,o,a){if(a){for(let r=o.length-1;r>=0;r--){const{x:l,y:c}=o[r];e.lineTo(l,c)}e.lineTo(t,i)}else{for(const{x:r,y:l}of o)e.lineTo(r,l);e.lineTo(s,n)}}function Gf(e,t,i,s){const[n,o]=cs(t);switch(wP(e,i,n.x,n.y,o.x,o.y,s),t.type){case"linear":CP(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":LP(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":NP(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break;case"multi-line":WY(e,t.x0,t.y0,t.x1,t.y1,t.midPoints,s);break}}function TP(e,t,i){const[s,n]=cs(e),[o,a]=cs(t),r=Oi(s.x,o.x,i),l=Oi(s.y,o.y,i),c=Oi(n.x,a.x,i),h=Oi(n.y,a.y,i);return[{x:r,y:l},{x:c,y:h}]}function lk(e,t,i,s,n,o){const[{x:a,y:r},{x:l,y:c}]=TP(t,i,s);if(wP(e,n,a,r,l,c,o),t.type==="cubic"&&i.type==="cubic"){const h=Oi(t.cp1x,i.cp1x,s),d=Oi(t.cp1y,i.cp1y,s),u=Oi(t.cp2x,i.cp2x,s),p=Oi(t.cp2y,i.cp2y,s);LP(e,a,r,h,d,u,p,l,c,o)}else if(t.type==="step"&&i.type==="step"){const h=Oi(t.stepX,i.stepX,s);NP(e,a,r,l,c,h,o)}else if(t.type==="linear"&&i.type==="linear")CP(e,a,r,l,c,o);else{let h;t.type==="step"?h=t.stepX:i.type==="step"?h=i.stepX:h=(a+l)/2;const d=AP(t,h),u=AP(i,h),p=Oi(d.leftCp1x,u.leftCp1x,s),f=Oi(d.leftCp1y,u.leftCp1y,s),y=Oi(d.leftCp2x,u.leftCp2x,s),x=Oi(d.leftCp2y,u.leftCp2y,s),b=Oi(d.stepX,u.stepX,s),v=Oi(d.stepY0,u.stepY0,s),S=Oi(d.stepY1,u.stepY1,s),M=Oi(d.rightCp1x,u.rightCp1x,s),D=Oi(d.rightCp1y,u.rightCp1y,s),I=Oi(d.rightCp2x,u.rightCp2x,s),k=Oi(d.rightCp2y,u.rightCp2y,s);o?(e.cubicCurveTo(I,k,M,D,b,S),e.lineTo(b,v),e.cubicCurveTo(y,x,p,f,a,r)):(e.cubicCurveTo(p,f,y,x,b,v),e.lineTo(b,S),e.cubicCurveTo(M,D,I,k,l,c))}}var OP=1e3,PP=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(PP||{});function $Y(e,t){return e==null||t==null||typeof e!="object"||typeof t!="object"?!1:"id"in e&&"id"in t?e.id===t.id:e.toString()===t.toString()}function Bs(e){return nf(e).valueOf()}function bs(e,t){if(!t)return Number.NaN;if(e instanceof Date&&(e=e.getTime()),t.type==="continuous"&&typeof e=="number")return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if(t.type==="log"&&typeof e=="number")return t.convert(e);if(t.type!=="category")return Number.NaN;if(_r(t)){if(typeof e=="number"){const{firstBandTime:n,intervalMs:o,bandCount:a,inset:r,step:l}=t,c=Math.round((e-n)/o);if(c>=0&&cBs(n)===i);return s===-1&&(s=t.domain.findIndex(n=>$Y(e,n))),s>=0?t.inset+t.step*s:Number.NaN}function EP({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(Bs(i.xValue0)),xValue1Index:t.indexOf(Bs(i.xValue1)),datumIndex:s}))}function RP(e){return Object.values(e.scales).every(t=>t.type==="category"?_r(t)?t.bandCount({axisValue:h,value:d}));s.sort((h,d)=>bs(h.value,e.scales.x)-bs(d.value,e.scales.x));const n=[];for(const{xValue0:h,xValue1:d}of t.data){const u=Bs(h),p=Bs(d);i.has(u)||(i.set(u,h),n.push({axisValue:u,value:h})),i.has(p)||(i.set(p,d),n.push({axisValue:p,value:d}))}n.sort((h,d)=>bs(h.value,t.scales.x)-bs(d.value,t.scales.x));const o=s;let a=0;for(const h of n){for(let d=o.length-1;d>=a;d-=1){const u=bs(h.value,t.scales.x),p=bs(o[d].value,t.scales.x);if(u>p){a=d+1;break}}o.splice(a,0,h),a+=1}if(!UY(o,t))return;const r=o.map(h=>h.axisValue),l=EP(t,r),c=EP(e,r);return{axisValues:r,oldDataAxisIndices:l,newDataAxisIndices:c}}function zP(e,t,i,s,n){if(n.xValue1Index===n.xValue0Index+1)return e;const o=cs(e);let a,r;if(t.scales.x?.type==="category"){const l=(o[1].x-o[0].x)/(n.xValue1Index-n.xValue0Index);a=o[0].x+(s-n.xValue0Index)*l,r=a+l}else{const l=i[s],c=i[s+1];a=bs(l,t.scales.x),r=bs(c,t.scales.x)}return Rx(e,a,r)}function VP(e,t){const[i,s]=cs(e),n=bs(0,t.scales.y);return hh(e,{x:i.x,y:n},{x:s.x,y:n})}function BP(e){const[t,i]=cs(e);return af(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function FP(e,t,i,s,n,o){let a,r;if(n.xValue0Index>=o.xValue1Index){const d=s.findLast(p=>p.xValue1Index<=o.xValue1Index)?.datumIndex,u=d==null?void 0:i.data[d];a=u?.xValue1,r=u?.yValue1}else if(n.xValue0Index<=o.xValue0Index){const d=s.find(p=>p.xValue0Index>=o.xValue0Index)?.datumIndex,u=d==null?void 0:i.data[d];a=u?.xValue0,r=u?.yValue0}if(a==null||r==null)switch(t){case 0:return VP(e,i);case 1:return BP(e)}const l=bs(a,i.scales.x),c=bs(r,i.scales.y),h={x:l,y:c};return hh(e,h,h)}function ck(e,t){if(t==null)return;const i=Bs(e.xValue0),s=Bs(e.xValue1);return t.find(n=>Bs(n.xValue0)===i&&Bs(n.xValue1)===s)?.span}function _P(e,t,i,s,n,o,a){const r=e.data[s.datumIndex],l=r.span,c=ck(r,n);if(c==null){const h=FP(l,t,e,i,s,o);a.added.push({from:h,to:l})}else a.removed.push({from:c,to:c}),a.moved.push({from:c,to:l}),a.added.push({from:l,to:l})}function HP(e,t,i,s,n,o,a){const r=e.data[s.datumIndex],l=r.span,c=ck(r,n);if(c==null){const h=FP(l,t,e,i,s,o);a.removed.push({from:l,to:h})}else a.removed.push({from:l,to:l}),a.moved.push({from:l,to:c}),a.added.push({from:c,to:c})}function GP(e,t,i,s,n){const o=s.scales.x,a=t[n.xValue0Index],r=t[n.xValue1Index];let l,c;if(o?.type==="continuous"||o?.type==="log"?(l=i.data.findLast(b=>Bs(b.xValue0)<=a),c=i.data.find(b=>Bs(b.xValue1)>=r)):(l=i.data.find(b=>Bs(b.xValue0)===a),c=i.data.find(b=>Bs(b.xValue1)===r)),l==null||c==null)return;const[{x:h},{x:d}]=cs(e),u=bs(l.xValue0,i.scales.x),p=bs(l.yValue0,i.scales.y),f=bs(c.xValue1,i.scales.x),y=bs(c.yValue1,i.scales.y);let x=s.data[n.datumIndex].span;return x=hh(x,{x:u,y:p},{x:f,y}),x=Rx(x,h,d),x}function ZY(e,t,i,s,n,o,a,r,l){const c=n+1,h=a.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),d=o.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),u=t.zeroData,p=e.zeroData;if(h==null&&d!=null){_P(e,i,o,d,u,r,l);return}else if(h!=null&&d==null){HP(t,i,a,h,p,r,l);return}else if(h==null||d==null)return;let f;h.xValue0Index===d.xValue0Index&&h.xValue1Index===d.xValue1Index?f=0:h.xValue0Index<=d.xValue0Index&&h.xValue1Index>=d.xValue1Index?f=-1:h.xValue0Index>=d.xValue0Index&&h.xValue1Index<=d.xValue1Index?f=1:f=0;const y=t.data[h.datumIndex],x=zP(y.span,t,s,n,h),b=e.data[d.datumIndex],v=zP(b.span,e,s,n,d);if(f===1){const S=GP(x,s,t,e,d);S==null?HP(t,i,a,h,p,r,l):(l.removed.push({from:x,to:S}),l.moved.push({from:S,to:v}),l.added.push({from:v,to:v}))}else if(f===-1){const S=GP(v,s,e,t,h);S==null?_P(e,i,o,d,u,r,l):(l.removed.push({from:x,to:x}),l.moved.push({from:x,to:S}),l.added.push({from:S,to:v}))}else l.removed.push({from:x,to:x}),l.moved.push({from:x,to:v}),l.added.push({from:v,to:v})}function XY(e,t,i,s){const n={removed:[],moved:[],added:[]},{axisValues:o,oldDataAxisIndices:a,newDataAxisIndices:r}=e,l={xValue0Index:Math.max(a.at(0)?.xValue0Index??-1/0,r.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(a.at(-1)?.xValue1Index??1/0,r.at(-1)?.xValue1Index??1/0)};for(let c=0;ce.data.length&&e.data.length>0){const a=e.data.at(-1).span,[,r]=cs(a),l=af(a,r);for(let c=o;ct.data.length&&t.data.length>0){const a=t.data.at(-1).span,[,r]=cs(a),l=af(a,r);for(let c=o;cn.point);let s=gD(i);switch(t.type){case"linear":break;case"smooth":s=mD(i,t.tension);break;case"step":s=fD(i,t.position);break}return s.map(function(o,a){return{span:o,xValue0:e[a].xDatum,yValue0:e[a].yDatum,xValue1:e[a+1].xDatum,yValue1:e[a+1].yDatum}})}function Vb(e,t,i=.001){return Math.abs(e.x-t.x)Bb(l,c,t.removed),o=(l,c)=>Bb(l,c,t.moved),a=(l,c)=>Bb(l,c,t.added),r=dk(e,i,s);return{status:e,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function dk(e,t,i=1){const s=t==="none"?"updated":e,n={fromFn(o,a){const r={phase:oa[s]},l=o.previousDatum??a;return l!=null&&(r.segments=l),e==="removed"?r.finish={visible:!1}:e==="added"&&(r.start={visible:!0}),r},toFn(o,a){const r={phase:oa[s]},l=a;return l!=null&&(r.segments=l),r}};return t==="fade"?{fromFn(o,a){const r=e==="added"?0:i,l=e==="removed"?o.previousDatum??a:a;return{...n.fromFn(o,a),opacity:r,segments:l}},toFn(o,a){const r=e==="removed"?0:i,l=e==="removed"?o.previousDatum??a:a;return{...n.toFn(o,a),opacity:r,segments:l}}}:n}function JY(e,t,i,s=1){const n=e.scales.x?.type==="category",o=t.scales.x?.type==="category";if(n!==o||!Kl(e.scales.x)||!Kl(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const r=jf({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(r==null)return;const l=WP(a,r,"fade",s),c=(i?.changed??!0)||!ia(e.scales.x,t.scales.x)||!ia(e.scales.y,t.scales.y)||a!=="updated";return{status:a,stroke:l,hasMotion:c}}function $P(e,t,i,s){if(t!=null){const[n,o]=t;if(n!==0||o!==1)return!1}if(xt.is(e)){const n=e.calcBandwidth(s)-e.calcBandwidth(i);if(n>0&&n<1)return!1}if(na.is(e)){const{bandwidth:n,step:o}=e;if(n>0&&n<1)return!1;const a=o-n;if(a>0&&a<1)return!1}return!0}var uk=e=>Kc(e.yValue??0);function $f(e,t,i){const{startingX:s,startingY:n}=t5(e,t);return{isVertical:e,calculate:(a,r)=>{let l=e?a.x:s,c=e?n:a.y,h=e?a.width:0,d=e?0:a.height;const{opacity:u=1}=a;r&&(Number.isNaN(l)||Number.isNaN(c))&&({x:l,y:c}=r,h=e?r.width:0,d=e?0:r.height,e&&!uk(r)?c+=r.height:!e&&uk(r)&&(l+=r.width));let p;return a.clipBBox==null?p=void 0:uk(a)?p=e?new re(l,c-d,h,d):new re(l-h,c,h,d):p=new re(l,c,h,d),{x:l,y:c,width:h,height:d,clipBBox:p,opacity:u}},mode:i}}function e5(e,t){return{isVertical:e,calculate:(i,s)=>{let n=e?i.x:i.x+i.width/2,o=e?i.y+i.height/2:i.y,a=e?i.width:0,r=e?0:i.height;return s&&(Number.isNaN(n)||Number.isNaN(o))&&(n=e?s.x:s.x+s.width/2,o=e?s.y+s.height/2:s.y,a=e?s.width:0,r=e?0:s.height),{x:n,y:o,width:a,height:r,clipBBox:i.clipBBox,opacity:i.opacity??1}},mode:t}}function Kf(e,t){const i=a=>a==null||Number.isNaN(a.x)||Number.isNaN(a.y);return{toFn:(a,r,l)=>l==="removed"&&a.datum==null&&e.mode==="fade"?{...Uf(a,r),opacity:0}:l==="removed"||i(r)?e.calculate(r,a.previousDatum):{x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1},fromFn:(a,r,l)=>{l==="updated"&&i(r)?l="removed":l==="updated"&&i(a.previousDatum)&&(l="added");let c;l==="unknown"||l==="added"?(a.previousDatum==null&&e.mode==="fade"?c={...Uf(a,r),opacity:0}:c=e.calculate(r,a.previousDatum),l==="unknown"&&(l=t)):c={x:a.x,y:a.y,width:a.width,height:a.height,clipBBox:a.clipBBox,opacity:a.opacity??1};const h=oa[l];return{...c,phase:h}},applyFn:(a,r,l)=>{a.resetAnimationProperties(r.x,r.y,r.width,r.height,r.opacity??1,r.clipBBox),a.crisp=l==="end"&&(a.datum?.crisp??!1)}}}function t5(e,t){const i=t[e?"y":"x"];let s=1/0,n=0;return i?(e?n=i.scale.convert(xt.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(xt.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function Uf(e,{x:t,y:i,width:s,height:n,clipBBox:o,opacity:a=1}){return{x:t,y:i,width:s,height:n,clipBBox:o,opacity:a,crisp:e.datum?.crisp??!1}}function Fb(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const n of i){const o=n.datum;o!=null&&(n.resetAnimationProperties(o.x,o.y,o.width,o.height,o.opacity??1,o.clipBBox),n.crisp=o.crisp??!1)}t.cleanup()})}}function pk(e,t){if(t===void 0)return;const{x:i,y:s,width:n,height:o}=t;return zt.toCanvas(e.contentGroup,new re(i,s,n,o))}function gk(e,t,i,s){const n=e.canIncrementallyUpdate&&e.nodeIndex=s;p-=1)Gf(e,i[p].span,1,!0);e.closePath(),Gf(e,r,0,!1),s=a}n=h,o=u}for(let a=t.length-1;a>=s;a-=1)Gf(e,i[a].span,1,!0);e.closePath()}function fk(e,{path:t},i,s){for(let n=0;nfk(l,c,t.removed,i.removed),o=(l,c)=>fk(l,c,t.moved,i.moved),a=(l,c)=>fk(l,c,t.added,i.added),r=dk(e,s);return{status:e,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function i5(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!Kl(e.scales.x)||!Kl(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const o=jf({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(o==null)return;const a=jf({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(a==null)return;const r=jf({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(r==null)return;const l="none",c=UP(n,o,a,l),h=WP(n,r,l);return{status:n,fill:c,stroke:h}}function YP(e,t,i,s,n,o,a){let r=o?.reduced?.diff?.[e];if(r?.changed)return r;if(!a)return{changed:!1,added:new Set,updated:new Set,removed:new Set,moved:new Set};const l=s5(s,n);return r==null&&o?.reduced?.diff!=null?(r={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},l?r.updated=new Set(Array.from(t,({datum:c})=>i(c))):r.added=new Set(Array.from(t,({datum:c})=>i(c)))):l&&(r={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:c})=>i(c))),removed:new Set,moved:new Set}),r}function ZP(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function s5(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!ia(i.x,s.x)||!ia(i.y,s.y))return!0;if(!ZP(e)||!ZP(t))return!1;const n=e.groupScale,o=t.groupScale;return!ia(n,o)}function Yf({id:e},t,i,s,...n){const o={...s,phase:s?.phase??(i?oa[i]:"trailing")};Kr(e,"markers",t,n,{opacity:0},{opacity:1},o);for(const a of n)a.cleanup()}function n5({id:e},t,...i){Kr(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"});for(const s of i)s.cleanup()}function mk({id:e,nodeDataDependencies:t},i,s,...n){const o=t.seriesRectWidth;mi(e,"markers",i,n,{fromFn:(l,c)=>{const h=c.midPoint?.x??o;let d=se(0,DD(h/o),1);return Number.isNaN(d)&&(d=0),{scalingX:0,scalingY:0,delay:s?.delay??d,duration:s?.duration??KD,phase:s?.phase??"initial",start:s?.start,finish:s?.finish}},toFn:()=>({scalingX:1,scalingY:1})})}function _b(e){return{opacity:1,scalingX:1,scalingY:1}}function Hb(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const n of i){const o=n.datum;if(o?.point==null)continue;const{x:a,y:r}=o.point;!Number.isFinite(a)||!Number.isFinite(r)||n.resetAnimationProperties(a,r,n.size,1,1,1)}t.cleanup()})}}function Zf(e,t){return{x:t.point?.x??Number.NaN,y:t.point?.y??Number.NaN,scalingCenterX:t.point?.x??Number.NaN,scalingCenterY:t.point?.y??Number.NaN}}function Gb(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const s=i[t],{point:n}=s??{};if(s==null||n==null)return;const o=e.getFormattedMarkerStyle(s),a=Ni.anchor(o.shape),r=n.focusSize??o.size,l=4+r,c=l/2,h=(a.x-.5)*r,d=(a.y-.5)*r,u=s.point.x-c-h,p=s.point.y-c-d;return zt.toCanvas(e.contentGroup,new re(u,p,l,l))}function yk(e,t,i,s=i){if(!(s.enabled??i.enabled))return!1;const o=1;return(t.step??Aa(t.range)/Math.max(1,e))>o}function jb(e,t,i,s){return s??(s={stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth}),lI.reduce((n,o)=>(n[o]=e.getMarkerStyle(i,{},void 0,{highlightState:o},void 0,s),n),{})}function xk({id:e,visible:t,nodeDataDependencies:i},s,...n){const{seriesRectWidth:o,seriesRectHeight:a}=i;Kr(e,"path_properties",s,n,{clipX:0},{clipX:o},{phase:"initial",start:{clip:!0,clipY:a,visible:t},finish:{clip:!1,visible:t}})}function bk({id:e},t,i,s="add",...n){Kr(e,t,i,n,{opacity:0},{opacity:1},{phase:s})}function vk(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function Wb({nodeDataDependencies:e},t){const i=s=>Number.isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var XP={angle:["angleKey"],radius:["radiusKey"]},qP={angle:["angleName"],radius:["radiusName"]},Sk=class extends nk{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new Le({name:"items"})),this.nodeData=[],this.itemSelection=yi.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=yi.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=yi.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=yi.select(this.highlightLabelGroup,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.maxChartMarkerSize=0,this.animationResetFns=s,this.animationState=new he("empty",{empty:{update:{target:"ready",action:o=>this.animateEmptyUpdateReady(o)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:o=>this.animateReadyHighlight(o),highlightMarkers:o=>this.animateReadyHighlightMarkers(o),resize:o=>this.animateReadyResize(o),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:o=>this.animateWaitingUpdateReady(o)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:o=>this.animateClearingUpdateEmpty(o)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",o=>this.onLegendItemClick(o)),this.ctx.eventsHub.on("legend:item-double-click",o=>this.onLegendItemDoubleClick(o)))}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}getKeyAxis(e){if(e==="angle")return this.properties.angleKeyAxis;if(e==="radius")return this.properties.radiusKeyAxis}setZIndex(e){super.setZIndex(e),this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3]}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new bn;return e.pointerEvents=1,e}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new re(-e,-e,e*2,e*2),axis:new re(-e,-e,e*2,e*2)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&qi([this.itemSelection,this.highlightSelection],e),t&&qi([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&qi([this.highlightSelection],t),i&&qi([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0)return this.itemSelection.select(i=>i instanceof wi&&i.datum===t)[0]}getSeriesRange(){return[Number.NaN,Number.NaN]}isSeriesHighlighted(e,t){if(!this.properties.highlight.enabled)return!1;const{series:i,legendItemName:s,datumIndex:n}=e??{},o=typeof n=="number"?t?.[n]:void 0;return i===this||o!=null&&o===s}},QP=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.OtherItem=2]="OtherItem",e[e.Branch=3]="Branch",e[e.OtherBranch=4]="OtherBranch",e))(QP||{});function Xf(e){const t=i=>i;switch(e){case 1:return"highlighted-item";case 2:return"unhighlighted-item";case 3:return"highlighted-branch";case 4:return"unhighlighted-branch";case 0:return"none";default:return t(e)}}var uc=class extends sa{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(xi),this.strokes=Object.values(Yr)}};g([m],uc.prototype,"childrenKey",2),g([m],uc.prototype,"sizeKey",2),g([m],uc.prototype,"colorKey",2),g([m],uc.prototype,"colorName",2),g([m],uc.prototype,"fills",2),g([m],uc.prototype,"strokes",2),g([m],uc.prototype,"colorRange",2);var JP=class qS{constructor(t,i,s,n,o,a,r,l,c,h,d){this.series=t,this.itemId=i,this.datumIndex=s,this.datum=n,this.sizeValue=o,this.colorValue=a,this.sumSize=r,this.depth=l,this.parent=c,this.children=h,this.style=d,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=qS.Walk.PreOrder){i===qS.Walk.PreOrder&&t(this);for(const s of this.children)s.walk(t,i);i===qS.Walk.PostOrder&&t(this)}find(t){if(t(this))return this;for(const i of this.children){const s=i.find(t);if(s!=null)return s}}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};JP.Walk={PreOrder:0,PostOrder:1};var o5=JP,a5=class extends Af{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new wu,this.animationState=new he("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){this.data?.commitPendingTransactions();const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let o=0,a=1/0,r=-1/0;const l=(u,p,f)=>{const y=f.depth==null?0:f.depth+1,x=t==null?void 0:u[t],b=x==null||x.length===0;let v=i==null?void 0:u[i];Number.isFinite(v)?v=Math.max(v,0):v=b?1:0;const S=v;o=Math.max(o,y);const M=s==null?void 0:u[s];typeof M=="number"&&(a=Math.min(a,M),r=Math.max(r,M));const D=this.getItemStyle({datumIndex:p,datum:u,depth:y,colorValue:M},b,!1);return c(new e(this,us(p.join(";")),p,u,v,M,S,y,f,[],D),x)},c=(u,p)=>{const{datumIndex:f}=u;if(p)for(const[y,x]of p.entries()){const b=l(x,f.concat(y),u);u.children.push(b),u.sumSize+=b.sumSize}return u},h=c(new e(this,"root",[],void 0,0,void 0,0,void 0,void 0,[],{}),this.data?.data),d=[a,r];this.colorScale.domain=at.itemId===e)}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(e){const{colorKey:t,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:o}=this;return e==="gradient"&&t!=null&&i!=null?[{legendType:"gradient",enabled:o&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if(Vn(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=se(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let n=this.removeMeIndexPathForIndex(t);const o=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&o.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=o.parent.children.length-1;n=n.slice(),n[n.length-1]=se(0,n.at(-1)+i,l)}const a=n.reduce((l,c)=>l.children[c],this.rootNode),r=this.computeFocusBounds(this.datumSelection.at(t+1));if(r!=null)return{datum:a,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:a.depth,bounds:r,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){W.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})}getCategoryValue(e){}datumIndexForCategoryValue(e){}getActiveHighlightNode(){if(!this.properties.highlight.enabled)return;const e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this)return e}getHierarchyHighlightState(e,t,i){if(e)return 1;if(t==null)return 0;const s=i.datumIndex?.[0],n=t.datumIndex?.[0];return s==null||n==null?0:s===n?3:4}getHierarchyHighlightStyles(e,t){switch(e){case 1:return ce(t.highlightedItem,t.highlightedBranch);case 3:return ce(t.unhighlightedItem,t.highlightedBranch);case 4:return t.unhighlightedBranch;default:return}}getHighlightStateString(e,t,i,s){if(!this.properties.highlight.enabled||i==null)return Xf(0);const n=i.reduce((r,l)=>r?.children[l],this.rootNode),o=this.getActiveHighlightNode();if(n==null)return Xf(0);const a=this.getHierarchyHighlightState(t??!1,o,n);return Xf(a)}},$b=Math.PI/180,Mk=e=>e*$b,Dk=e=>-Math.log(Math.tan(Math.PI*.25+e*$b*.5)),Ik=e=>e/$b,kk=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/($b*.5),r5=class NL extends _x{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=NL.bounds(t)}static bounds(t){const[[i,s],[n,o]]=t,a=Mk(i),r=Dk(s),l=Mk(n),c=Dk(o);return new re(Math.min(a,l),Math.min(r,c),Math.abs(l-a),Math.abs(c-r))}static fixedScale(){return new NL([[Ik(0),kk(0)],[Ik(1),kk(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,s=1/0,n=-1/0,o=1/0;for(const a of t){const r=a.domain;for(const[l,c]of r)i=Math.min(l,i),s=Math.max(l,s),n=Math.min(c,n),o=Math.max(c,o)}return{domain:[[i,n],[s,o]],animatable:!0}}convert([t,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[(Mk(t)-this.bounds.x)*r+s,(Dk(i)-this.bounds.y)*l+n]}invert([t,i]){const[[s,n],[o,a]]=this.range,r=(o-s)/this.bounds.width,l=(a-n)/this.bounds.height;return[Ik((t-s)/r+this.bounds.x),kk((i-n)/l+this.bounds.y)]}getDomainMinMax(){return Gx(this.domain)}},l5=class{constructor(e){this.minimumDelay=e?.minimumDelay??50,this.timeout=e?.timeout??100}schedule(e,t){this.cancel(),this.pending={computation:e,onComplete:t},this.minimumDelay>0?this.delayTimeoutId=setTimeout(()=>{this.delayTimeoutId=void 0,this.scheduleIdleCallback()},this.minimumDelay):this.scheduleIdleCallback()}demand(){if(this.pending)return this.cancelScheduled(),this.execute()}cancel(){this.cancelScheduled(),this.pending=void 0}isPending(){return this.pending!=null}scheduleIdleCallback(){const e=Math.max(0,this.timeout-this.minimumDelay);typeof requestIdleCallback=="function"?this.idleCallbackId=requestIdleCallback(this.execute.bind(this),{timeout:e}):this.idleCallbackId=setTimeout(()=>this.execute(),e)}cancelScheduled(){this.delayTimeoutId!=null&&(clearTimeout(this.delayTimeoutId),this.delayTimeoutId=void 0),this.idleCallbackId!=null&&(typeof cancelIdleCallback=="function"?cancelIdleCallback(this.idleCallbackId):clearTimeout(this.idleCallbackId),this.idleCallbackId=void 0)}execute(){const{pending:e}=this;if(!e)return;this.pending=void 0,this.delayTimeoutId=void 0,this.idleCallbackId=void 0;const t=e.computation();return e.onComplete(t),t}},Kb=class{constructor(){this._dataLength=0,this.executor=new l5}get filters(){return this._filters}aggregate(e){if(this.executor.cancel(),e.targetRange>1&&e.computePartial){const t=e.computePartial(this._filters);if(t){const{immediate:i,computeRemaining:s}=t;return s&&this.executor.schedule(s,n=>{this.mergeFilters(n)}),this._filters=i,i}}return this._filters=e.computeFull(this._filters),this._filters}ensureLevelForRange(e){if(!this._filters?.some(i=>i.maxRange>e)&&this.executor.isPending()){const i=this.executor.demand();i&&this.mergeFilters(i)}}getFilterForRange(e){return this._filters?.find(t=>t.maxRange>e)}cancel(){this.executor.cancel()}markStale(e){const t=this._dataLength>0?e/this._dataLength:0;if(t>=2||t<=.5||this._dataLength===0)this._filters=void 0;else if(this._filters)for(const i of this._filters)i.stale=!0;this._dataLength=e,this.executor.cancel()}mergeFilters(e){if(!this._filters||e.length===0)return;const t=[...this._filters,...e];t.sort((i,s)=>i.maxRange-s.maxRange),this._filters=t}},Ak=class extends SI{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}update(){super.update(),this.tickLineGroup.visible=this.tick.enabled,this.tickLabelGroup.visible=this.label.enabled}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.hasDefinedDomain()||this.hasVisibleSeries(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();for(const o of this.crossLines)o.sideFlag=-e,o.direction=i===-Math.PI/2?"angle":"radius",o.parallelFlipRotation=s,o.regularFlipRotation=n,o.calculateLayout?.(t,this.reverse)}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each(mb())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};g([m],Ak.prototype,"shape",2),g([m],Ak.prototype,"innerRadiusRatio",2);var eE=class extends Ff{calculateGridLine({index:e,tickId:t,translation:i},s,n,o,a){const{gridLine:r,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridLine({index:e,tickId:t,translation:i},s,n,o,a);const d=a[s-1],u=d?i-(i-d.translation)/2:h[0],[p,f,y,x]=l?[u,Math.max(n,o),u,Math.min(n,o)]:[Math.min(n,o),u,Math.max(n,o),u],{style:b}=r,{stroke:v,strokeWidth:S=0,lineDash:M}=b[e%b.length]??{};return{tickId:t,offset:u,x1:p,y1:f,x2:y,y2:x,stroke:v,strokeWidth:S,lineDash:M}}calculateGridFills(e,t,i){return this.interval.placement!=="between"?super.calculateGridFills(e,t,i):e.map((s,n)=>this.calculateGridFill(s,n,s.index,t,i,e))}calculateGridFill({tickId:e,translation:t},i,s,n,o,a){const{gridLine:r,horizontal:l,interval:c,range:h}=this;if(c.placement!=="between")return super.calculateGridFill({tickId:e,translation:t},i,s,n,o,a);const d=a[i-1],u=a[i+1],p=d?t-(t-d.translation)/2:h[0],f=u?t+(u.translation-t)/2:h[1],[y,x,b,v]=l?[p,Math.max(n,o),f,Math.min(n,o)]:[Math.min(n,o),p,Math.max(n,o),f],{fill:S,fillOpacity:M}=r.style[s%r.style.length]??{};return{tickId:e,x1:y,y1:x,x2:b,y2:v,fill:S,fillOpacity:M}}calculateTickLine({isPrimary:e,tickId:t,translation:i},s,n,o,a=0){const{horizontal:r,interval:l,primaryTick:c,range:h,tick:d}=this;if(l.placement!=="between")return super.calculateTickLine({isPrimary:e,tickId:t,translation:i},s,n,o,a);const u=e&&c?.enabled?c:d,p=-n*this.getTickSize(u),f=o[s-1],y=f?i-(i-f.translation)/2:h[0],x=-n*(a+this.getTickSpacing(u)),[b,v,S,M]=r?[y,x,y,x+p]:[x,y,x+p,y],{stroke:D,width:I}=u;return{tickId:t,offset:y,x1:b,y1:v,x2:S,y2:M,stroke:D,strokeWidth:I,lineDash:void 0}}},c5={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},h5={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function d5({yDirection:e,padding:t=0,position:i="top",bbox:s}){const n=e?c5:h5,{xTranslationDirection:o,yTranslationDirection:a}=n[i],r=o*(t+s.width/2),l=a*(t+s.height/2);return{xTranslation:r,yTranslation:l}}function Ub(e,t,i,s,n){const o=(d,u,p,f)=>{i.animate({id:`${e}_${t}_${u.id}_${d}`,groupId:e,from:p?1:0,to:1,ease:Ea,collapsable:p,onUpdate(y,x){x&&d!=="removed"||(u.path.clear(!0),f(y,u),u.checkPathDirty())},onStop(){d==="added"&&(u.path.clear(!0),f(1,u),u.checkPathDirty())},phase:oa[d]})},a=new wi,r=d=>(a.resetPathDirty(),d(0,a),a.resetPathDirty(),d(1,a),a.checkPathDirty(),a.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const d of s)i.isSkipped()||(o("removed",d,!r(h),h),o("updated",d,!r(c),c)),o("added",d,!r(l),l)}var Ua=class extends dh{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};g([m,K()],Ua.prototype,"enabled",2),g([m,K()],Ua.prototype,"color",2),g([m,K()],Ua.prototype,"xOffset",2),g([m,K()],Ua.prototype,"yOffset",2),g([m,K()],Ua.prototype,"blur",2);function tE({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let n=1/0,o=1/0,a=-1/0,r=-1/0;const l=(c,h)=>{n=Math.min(c,n),o=Math.min(h,o),a=Math.max(c,a),r=Math.max(h,r)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),Js(0,e,t)&&l(s,0),Js(Math.PI*.5,e,t)&&l(0,s),Js(Math.PI,e,t)&&l(-s,0),Js(Math.PI*1.5,e,t)&&l(0,-s),new re(n,o,a-n,r-o)}function wk(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:n,outerRadius:o}=i;if(i.startAngle===i.endAngle||sMath.max(n,o))return!1;const a=Gg(i.startAngle),r=Gg(i.endAngle),l=Math.atan2(t,e);return a=a:l<=r&&l>=-Math.PI||l>=a&&l<=Math.PI}function u5(e,t,i,s,n,o,a,r,l,c){if(Number.isNaN(e)||Number.isNaN(t))return 0;o&&([n,s]=[s,n]);const h=(c-r)/(l-a),d=r-h*a,u=Math.pow(h,2)+1,p=2*(h*(d-t)-e),f=Math.pow(e,2)+Math.pow(d-t,2)-Math.pow(i,2),y=Math.pow(p,2)-4*u*f;if(y<0)return 0;const x=(-p+Math.sqrt(y))/2/u,b=(-p-Math.sqrt(y))/2/u;let v=0;for(const S of[x,b]){if(!(S>=Math.min(a,l)&&S<=Math.max(a,l)))continue;const D=h*S+d,I=S-e,k=D-t,A=Math.atan2(k,I);Js(A,s,n)&&v++}return v}function iE(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:o}=t,a={x:o*Math.cos(i),y:o*Math.sin(i)},r={x:o*Math.cos(s),y:o*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return cf(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,l.x,l.y)||cf(e.start.x,e.start.y,e.end.x,e.end.y,r.x,r.y,c.x,c.y)||u5(0,0,o,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function p5(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},n={x:e.x,y:e.y+e.height},o={x:e.x+e.width,y:e.y+e.height};return iE({start:i,end:s},t)||iE({start:n,end:o},t)}function sE(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let o=0,a=1;for(let r=0;r<8;r+=1){const l=(o+a)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*s)/(e+l*s))-t<0?o=l:a=l}return o}var g5=1e-6;function pc(e,t){return Xo(e,t)=2*Math.PI?2*Math.PI:Qe(t-e);return e=pc(e,i),t=e+n,{startAngle:e,endAngle:t}}function Zb(e,t,i,s,n,o){const a=Math.sin(o),r=Math.cos(o),l=e**2+t**2-i**2;let c,h,d,u;if(r>.5){const S=a/r,M=1+S**2,D=-2*(e+t*S),I=D**2-4*M*l;if(I<0)return;const k=(-D+Math.sqrt(I))/(2*M),A=(-D-Math.sqrt(I))/(2*M);c=k,h=k*S,d=A,u=A*S}else{const S=r/a,M=1+S**2,D=-2*(t+e*S),I=D**2-4*M*l;if(I<0)return;const k=(-D+Math.sqrt(I))/(2*M),A=(-D-Math.sqrt(I))/(2*M);c=k*S,h=k,d=A*S,u=A}const p=r,f=a,y=c*p+h*f,x=d*p+u*f,b=y>0?pc(Math.atan2(h-t,c-e),s):Number.NaN,v=x>0?pc(Math.atan2(u-t,d-e),s):Number.NaN;if(b>=s&&b<=n)return b;if(v>=s&&v<=n)return v}function Xb(e,t,i,s,n,o){const a=Math.hypot(e,t),r=(a**2-i**2+o**2)/(2*a),l=a-r,c=Math.atan2(t,e),h=Math.acos(-l/i),d=pc(c+h,s),u=pc(c-h,s);if(d>=s&&d<=n)return d;if(u>=s&&u<=n)return u}var nE=class extends wi{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},f5=class extends Nu(nE){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},m5=class lH extends ic{static is(t){return t instanceof lH}setSourceScale(t){this._sourceScale=t;const i=n=>{Object.defineProperty(this,n,{get:()=>t[n],set:o=>{t[n]=o},configurable:!0})};i("domain"),i("range"),i("paddingInner"),i("paddingOuter"),i("round");const s=n=>{Object.defineProperty(this,n,{get:()=>t[n],configurable:!0})};s("bandwidth"),s("step"),s("inset"),s("rawBandwidth")}get bands(){return this._sourceScale?.bands??super.bands}refresh(){this._sourceScale?.refresh?.()}ordinalRange(t){return this._sourceScale?this._sourceScale.ordinalRange(t):super.ordinalRange(t)}convert(t,i){this.refresh();const s=this.findIndex(t,i?.alignment);return s==null||s<0||s>=this.bands.length?Number.NaN:this.ordinalRange(s)}findIndex(t,i=0){if(t==null)return;const{bands:s,reversed:n}=this,o=s.length;if(o===0)return;if(o===1)return 0;const a=s[0],r=s[o-1];if(a==null||r==null)return this._sourceScale?.findIndex(t,i);const l=t.valueOf(),c=a.valueOf(),h=r.valueOf(),d=(l-c)/(h-c),u=n?(1-d)*(o-1):d*(o-1);return i===0?Math.max(0,Math.min(o-1,Math.floor(u))):Math.max(0,Math.min(o-1,Math.ceil(u)))}},oE=class TL{constructor(t,i,s,n){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:n}=this;return new TL(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[Bx](t,i){return new TL(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}},fp=class extends Gr{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};g([K()],fp.prototype,"x",2),g([K()],fp.prototype,"y",2),g([K()],fp.prototype,"width",2),g([K()],fp.prototype,"height",2),g([K()],fp.prototype,"opacity",2);var Ya=class extends wi{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return Be(Qe(this.startAngle),Qe(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new re(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Ya.className="Arc",g([K()],Ya.prototype,"centerX",2),g([K()],Ya.prototype,"centerY",2),g([K()],Ya.prototype,"radius",2),g([K()],Ya.prototype,"startAngle",2),g([K()],Ya.prototype,"endAngle",2),g([K()],Ya.prototype,"counterClockwise",2),g([K()],Ya.prototype,"type",2);function qb(e,t,i){const s=Math.hypot(e,t),o=Math.atan2(t,e)+i;return{x:Math.cos(o)*s,y:Math.sin(o)*s}}var ha=class extends wi{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0}set cornerRadius(e){}computeBBox(){const{columnWidth:e}=this,[t,i]=this.normalizeRadii(this.innerRadius,this.outerRadius),s=this.getRotation(),n=-e/2,o=e/2,a=-i,r=-t;let l=1/0,c=1/0,h=-1/0,d=-1/0;for(let u=0;u<4;u+=1){const{x:p,y:f}=qb(u%2===0?n:o,u<2?a:r,s);l=Math.min(p,l),c=Math.min(f,c),h=Math.max(p,h),d=Math.max(f,d)}return new re(l,c,h-l,d-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=Xo(e,t);return Qe(e+i/2+Math.PI/2)}normalizeRadii(e,t){return e>t?[t,e]:[e,t]}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,path:t}=this,[i,s]=this.normalizeRadii(this.innerRadius,this.outerRadius),n=-e/2,o=e/2,a=-s,r=-i,l=this.getRotation(),c=[[n,r],[n,a],[o,a],[o,r]].map(([h,d])=>qb(h,d,l));t.clear(!0),t.moveTo(c[0].x,c[0].y),t.lineTo(c[1].x,c[1].y),t.lineTo(c[2].x,c[2].y),t.lineTo(c[3].x,c[3].y),t.closePath()}calculateCircleIntersection(e,t){const i=e*e;if(ts||Math.hypot(r,l)>s;if(!d&&!u&&!p){this.updateRectangularPath();return}const f=d?this.calculateBothIntersections(a,r,n):null,y=u?this.calculateBothIntersections(a,r,o):null,x=p?this.calculateAxisOuterIntersections(a,r,s):null;if(d&&!f||u&&!y||p&&!x){this.updateRectangularPath();return}t.clear(!0);const b={left:a,right:r,top:l,bottom:c,rotation:h};f?this.moveToRotated(a,f.left.y,h):this.moveToRotated(a,c,h),f?t.arc(0,0,n,h+f.left.angle,h+f.right.angle,!1):this.lineToRotated(r,c,h),y?(this.lineToRotated(r,y.right.y,h),t.arc(0,0,o,h+y.right.angle,h+y.left.angle,!0)):x?this.renderTopWithCornerClipping(s,x,b):(this.lineToRotated(r,l,h),this.lineToRotated(a,l,h)),t.closePath()}};ha.className="RadialColumnShape",g([K()],ha.prototype,"isBeveled",2),g([K()],ha.prototype,"columnWidth",2),g([K()],ha.prototype,"startAngle",2),g([K()],ha.prototype,"endAngle",2),g([K()],ha.prototype,"outerRadius",2),g([K()],ha.prototype,"innerRadius",2),g([K()],ha.prototype,"axisInnerRadius",2),g([K()],ha.prototype,"axisOuterRadius",2);function aE(e,t,i,s,n){const o=Xo(e,t),a=o*(1-s)/2;if(e+=a,t-=a,o<.001)return 2*i*n;if(o>=2*Math.PI){const p=e+o/2;e=p-Math.PI,t=p+Math.PI}const r=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),d=Math.floor(Math.hypot(r-c,l-h)),u=2*i*n;return Math.max(1,Math.min(u,d))}var Ck=class{constructor(e,t,i,s,n){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=Number.NaN,this.a1=Number.NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=Number.NaN,this.a1=Number.NaN))}},vs=class extends wi{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return tE(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:i}=Yb(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),o=Yb(e.startAngle,e.endAngle,t);return new oE(Math.max(t,o.startAngle),Math.min(i,o.endAngle),Math.max(s,e.innerRadius),Math.min(n,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,n,o,a,r){if(e<=0)return;const{startAngle:l,endAngle:c}=Yb(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:d}=this.normalizedRadii(),u=this.normalizedClipSector();if(r&&h<=0)return;const p=r?this.getAngleOffset(h+e):this.getAngleOffset(d-e),f=a?l+p+t:c-p-t,y=r?h+e:d-e,x=y*Math.cos(f),b=y*Math.sin(f);if(u!=null&&(!a&&!(f>=l-1e-6&&f<=u.endAngle-1e-6)||a&&!(f>=u.startAngle+1e-6&&f<=c-1e-6)||r&&yu.outerRadius+1e-6))return;const v=new Ck(x,b,e,i,s);if(u!=null){r?(v.clipStart(Zb(x,b,e,i,s,u.endAngle)),v.clipEnd(Zb(x,b,e,i,s,u.startAngle))):(v.clipStart(Zb(x,b,e,i,s,u.startAngle)),v.clipEnd(Zb(x,b,e,i,s,u.endAngle)));let k,A;if(a?(k=Xb(x,b,e,i,s,u.innerRadius),A=Xb(x,b,e,i,s,u.outerRadius)):(k=Xb(x,b,e,i,s,u.outerRadius),A=Xb(x,b,e,i,s,u.innerRadius)),v.clipStart(k),v.clipEnd(A),k!=null){const{x:w,y:C}=v.pointAt(k),T=pc(Math.atan2(C,w),l);a?o?.clipStart(T):n.clipEnd(T)}if(A!=null){const{x:w,y:C}=v.pointAt(A),T=pc(Math.atan2(C,w),l);a?n.clipStart(T):o?.clipEnd(T)}}if(u!=null){const{x:k,y:A}=v.pointAt((v.a0+v.a1)/2);if(!wk(k,A,u))return}const{x:S,y:M}=v.pointAt(a===r?v.a0:v.a1),D=pc(Math.atan2(M,S),l),I=r?o:n;return a?I?.clipStart(D):I?.clipEnd(D),v}updatePath(){const{path:t,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:o}=this;let{startOuterCornerRadius:a,endOuterCornerRadius:r,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:d}=Yb(this.startAngle,this.endAngle),{innerRadius:u,outerRadius:p}=this.normalizedRadii(),f=this.normalizedClipSector(),y=d-h,x=y>=2*Math.PI-1e-6;t.clear();const b=this.getAngleOffset(u),v=y-2*b,S=p-u,M=u>0&&v>0?2*u*Math.sin(v/2):0,D=p>0&&v>0?2*p*Math.sin(v/2):0;if(a=Math.floor(Math.max(0,Math.min(a,D/2,S/2))),r=Math.floor(Math.max(0,Math.min(r,D/2,S/2))),l=Math.floor(Math.max(0,Math.min(l,M/2,S/2))),c=Math.floor(Math.max(0,Math.min(c,M/2,S/2))),u===0&&p===0||u>p||M<0||D<=0)return;if((f?.startAngle??h)===(f?.endAngle??d))return;if(x&&this.clipSector==null&&a===0&&r===0&&l===0&&c===0){t.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),t.arc(i,s,p,h,d),u>n&&(t.moveTo(i+u*Math.cos(d),s+u*Math.sin(d)),t.arc(i,s,u,d,h,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(u-p)<1e-6){t.arc(i,s,p,h,d,!1),t.arc(i,s,p,d,h,!0),t.closePath();return}const k=this.getAngleOffset(p);if(y<2*k)return;const w=(f?.innerRadius??u)>n,C=u0?Math.min(S/T,1):1;a*=O,r*=O,l*=O,c*=O;const V=sE(p,y-2*k,-a,-r);if(a*=V,r*=V,!C&&w){const Me=sE(u,y-2*b,l,c);l*=Me,c*=Me}else l=0,c=0;const z=Math.max(a+l,r+c),R=z>0?Math.min(S/z,1):1;a*=R,r*=R,l*=R,c*=R;let B=0,G=0;const F=a/(p-a),_=r/(p-r);if(F>=0&&F<1-1e-6)B=Math.asin(F);else{B=y/2;const Me=p/(1/Math.sin(B)+1);a=Math.min(Me,a)}if(_>=0&&_<1-1e-6)G=Math.asin(_);else{G=y/2;const Me=p/(1/Math.sin(G)+1);r=Math.min(Me,r)}const Y=Math.asin(l/(u+l)),Z=Math.asin(c/(u+c)),ne=f?.outerRadius??p,te=this.getAngleOffset(ne),ue=new Ck(0,0,ne,h+te,d-te),ge=f?.innerRadius??u,be=this.getAngleOffset(ge),fe=w?new Ck(0,0,ge,h+be,d-be):void 0;f!=null&&(ue.clipStart(f.startAngle),ue.clipEnd(f.endAngle),fe?.clipStart(f.startAngle),fe?.clipEnd(f.endAngle));const He=this.arc(a,B,h-Math.PI*.5,h+B,ue,fe,!0,!1),Re=this.arc(r,G,d-G,d+Math.PI*.5,ue,fe,!1,!1),ze=this.arc(c,Z,d+Math.PI*.5,d+Math.PI-Z,ue,fe,!1,!0),Te=this.arc(l,Y,h+Math.PI+Y,h+Math.PI*1.5,ue,fe,!0,!0);if(!(C&&w)){if(C){const Me=y0&&Mee.equals(t)})],vs.prototype,"clipSector",2),g([K()],vs.prototype,"concentricEdgeInset",2),g([K()],vs.prototype,"radialEdgeInset",2),g([K()],vs.prototype,"startOuterCornerRadius",2),g([K()],vs.prototype,"endOuterCornerRadius",2),g([K()],vs.prototype,"startInnerCornerRadius",2),g([K()],vs.prototype,"endInnerCornerRadius",2);var Lk=class extends _D{constructor(){super(ke("div"),"menuitem")}},rE=class extends _D{constructor(){super(ke("div"),"menuitemradio")}setChecked(e){Fe(this.elem,"aria-checked",e)}},lE=class cH extends HD{constructor(t="vertical"){super(t,"menu"),this.handleMouseEnter=(i,s)=>{s.hasPopup()||this.expandSubMenu(i,void 0)},this.handleMouseMove=(i,s)=>{s.focus({preventScroll:!0})}}destructor(){this.collapse({mode:"2"})}addSeparator(){const t=this.elem.ownerDocument.createElement("div");return Fe(t,"role","separator"),this.elem.appendChild(t),t}toggleChildEnabledByIndex(t,i){this.children.at(t)?.setEnabled(i)}onChildAdded(t){super.onChildAdded(t),t.addListener("mouseenter",this.handleMouseEnter),t.addListener("mousemove",this.handleMouseMove)}onChildRemoved(t){super.onChildRemoved(t),t.removeListener("mouseenter",this.handleMouseEnter),t.removeListener("mousemove",this.handleMouseMove)}addSubMenu(){const t=new Lk,i=new cH(this.orientation);i.id=Rr();const s=()=>{this.collapseExpandedSubMenu(i),t.expandControlled()},n=o=>{const a=$c(this.elem)?"ArrowLeft":"ArrowRight";ru(o.sourceEvent)&&o.sourceEvent.code===a&&(this.collapseExpandedSubMenu(i),t.expandControlled())};return t.setControlled(i),t.setAriaHasPopup("menu"),t.addListener("click",s),t.addListener("mouseenter",s),t.addListener("keydown",n),this.addChild(t),{subMenuButton:t,subMenu:i}}expandSubMenu(t,i){const{expansionScope:s}=this;s&&(this.collapseExpandedSubMenu(i),i?.expand(t))}collapseExpandedSubMenu(t){const{expansionScope:i}=this;i&&(i.expandedSubMenu?.collapse({mode:"4"}),i.expandedSubMenu=t)}getCloseKeys(){return $c(this.elem)?["Escape","ArrowRight"]:["Escape","ArrowLeft"]}expand(t){if(this.expansionScope!=null)return;this.expansionScope={lastFocus:fx(t.sourceEvent),expandedSubMenu:void 0,abort:()=>this.collapse({mode:"1"}),close:()=>this.collapse({mode:"0"}),removers:new ot};const i=this.expansionScope,s=this.children.map(n=>n.getElement());Fe(i.lastFocus,"aria-expanded",!0),i.removers.register(EM(this.elem,i.abort),RM(this.elem,i.abort),...this.children.map(n=>dx(n.getElement(),i.close,()=>this.getCloseKeys())),t?.overrideFocusVisible&&zM(this.elem,s,t.overrideFocusVisible)),this.internalListener?.dispatch("expand-widget",this,{type:"expand-widget"}),this.children[0]?.focus({preventScroll:!0})}collapse(t){const{mode:i="0"}=t??{};if(this.expansionScope===void 0)return;const{lastFocus:s,removers:n,expandedSubMenu:o}=this.expansionScope;this.expansionScope=void 0,o?.collapse({mode:"3"}),Fe(s,"aria-expanded",!1),i==="0"&&s?.focus({preventScroll:!0}),n.flush(),this.internalListener?.dispatch("collapse-widget",this,{type:"collapse-widget",mode:i})}},cE="canvas-overlay",hE=class extends ri{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.setOwnedWidget=(()=>{let s;return n=>{s?.destroy(),s=n}})(),this.moduleId=`popover-${t}`,i?.detached?this.element=ke("div"):this.element=e.domManager.addChild(cE,this.moduleId),this.element.setAttribute("role","presentation"),this.hideFns.push(()=>this.setOwnedWidget(void 0)),this.cleanup.register(()=>e.domManager.removeChild(cE,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};if(this.element.children.length!==0){for(const i of this.hideFns)i();t?.focus(),this.lastFocus=void 0}}removeChildren(){this.element.replaceChildren()}initPopoverElement(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");return e??(e=ke("div","ag-charts-popover")),e.classList.toggle("ag-charts-popover",!0),t.ariaLabel!=null&&e.setAttribute("aria-label",t.ariaLabel),t.class!=null&&e.classList.add(t.class),t.minWidth!=null&&(e.style.minWidth=`${t.minWidth}px`),this.element.replaceChildren(e),e}showWidget(e,t,i){this.setOwnedWidget(t),this.initPopoverElement(t.getElement(),i),t.addListener("collapse-widget",()=>{this.hide(),e.setControlled(void 0),this.setOwnedWidget(void 0)}),e.setControlled(t),e.expandControlled(),i.onHide&&this.hideFns.push(i.onHide)}showWithChildren(e,t){const i=this.initPopoverElement(void 0,t);if(i.replaceChildren(...e),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const s=fx(t.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),e.x!=null&&t.style.setProperty("left",`${e.x}px`),e.y!=null&&t.style.setProperty("top",`${e.y}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},dE=class extends hE{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}updateAnchor(e){const t=e.anchor??this.anchor,i=e.fallbackAnchor??this.fallbackAnchor;t&&this.setAnchor(t,i)}showWidget(e,t,i){super.showWidget(e,t,i),this.updateAfterShow(i)}showWithChildren(e,t){const i=super.showWithChildren(e,t);return this.updateAfterShow(t),i}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const n=t.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:a}=s,{isRtl:r}=t.domManager,l=r?e.x-o:e.x;let c=se(0,l,n.width-o),h=se(0,e.y,n.height-a);if(c!==l&&i?.x!=null){const d=r?i.x:i.x-o;c=se(0,d,n.width-o)}h!==e.y&&i?.y!=null&&(h=se(0,i.y-a,n.height-a)),this.updatePosition({x:c,y:h})}updateAfterShow(e){this.updateAnchor(e),this.ctx.agDocument.requestAnimationFrame(()=>{this.repositionWithinBounds()})}},y5=class extends dE{show(e,t){const i=new lE("vertical");for(const s of t.items)i.addChild(this.createRow(t,s,i));i.addClass("ag-charts-menu"),this.showWidget(e,i,t)}allocRow(e,t){if(e.menuItemRole==null||e.menuItemRole==="menuitem")return new Lk;{e.menuItemRole;const i=new rE;return i.setChecked(e.value===t.value),i}}createRow(e,t,i){const s=t.value===e.value,n=this.allocRow(e,t);if(t.enabled!=null&&n.setEnabled(t.enabled),n.addClass("ag-charts-menu__row"),n.toggleClass("ag-charts-menu__row--active",s),typeof t.value=="string"&&(n.getElement().dataset.popoverId=t.value),t.icon!=null){const a=ke("span",`ag-charts-menu__icon ${fr(t.icon)}`);n.getElement().appendChild(a)}const o=t.strokeWidth!=null;if(o&&(n.toggleClass("ag-charts-menu__row--stroke-width-visible",o),n.setCSSVariable("--strokeWidth",o?`${t.strokeWidth}px`:null)),t.label!=null){const a=ke("span","ag-charts-menu__label");a.textContent=this.ctx.localeManager.t(t.label),n.getElement().appendChild(a)}return"altText"in t&&n.setAriaLabel(this.ctx.localeManager.t(t.altText)),n.addListener("click",({sourceEvent:a})=>{e.onPress?.(t),a.preventDefault(),a.stopPropagation(),i.collapse()}),n}},uE=class extends hE{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:H.from(e.clientX,e.clientY),position:H.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=H.sub(H.from(e.clientX,e.clientY),t.client),n=H.add(t.position,s),o=this.ctx.domManager.getBoundingClientRect(),a={};n.x>=0&&n.x+i.offsetWidth<=o.width&&(a.x=n.x),n.y>=0&&n.y+i.offsetHeight<=o.height&&(a.y=n.y),this.updatePosition(a)}onDragEnd(){this.dragStartState=void 0}},x5={"disjoint-channel":"false","fibonacci-menu":"menu","fibonacci-retracement":"false","fibonacci-retracement-trend-based":"false","fill-color":"dialog","horizontal-line":"false","line-color":"dialog","line-menu":"menu","line-stroke-width":"menu","line-style-type":"menu","measurer-menu":"menu","pan-end":"false","pan-left":"false","pan-right":"false","pan-start":"false","parallel-channel":"false","shape-menu":"menu","text-color":"dialog","text-menu":"menu","text-size":"menu","vertical-line":"false","zoom-in":"false","zoom-out":"false",callout:"false",clear:"false",comment:"false",delete:"false",line:"false",lock:"false",menu:"menu",note:"false",reset:"false",settings:"dialog",text:"false",millisecond:"false",second:"false",minute:"false",hour:"false",day:"false",month:"false",year:"false"};function b5(e){return typeof e!="string"?"false":x5[e]}var pE=class extends eb{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;if(e.tooltip){const n=t.t(e.tooltip);n!==this.lastTooltip&&(this.elem.title=n,this.lastTooltip=n)}let i="";if(e.icon!=null&&e.iconPosition!=="after"&&(i=``),e.label!=null){const n=t.t(e.label);i=`${i}${n}`}e.icon!=null&&e.iconPosition==="after"&&(i=`${i}`);const s=b5(e.value);s=="false"?(this.setAriaHasPopup(void 0),this.setAriaExpanded(void 0)):(this.setAriaHasPopup(s),this.setAriaExpanded(!1)),i!==this.lastInnerHTML&&(this.elem.innerHTML=i,this.lastInnerHTML=i)}setChecked(e){Fe(this.elem,"aria-checked",e)}},gE="ag-charts-toolbar__button--active",Nk=class extends tb{constructor({eventsHub:e,localeManager:t},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new JT,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=e,this.localeManager=t,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(e){this.ariaLabelId=e,this.updateAriaLabel()}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){this.expanded?.collapse({mode:"2"});for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[i,s]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=e.length;ithis.getButtonWidgetBounds(e))}getButtonWidget(e){return this.buttonWidgets.at(e)}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds(),s=e.getBoundingClientRect(),n=s.x-Math.floor(s.x),o=s.y-Math.floor(s.y);return new re(i.x+t.x+n,i.y+t.y+o,s.width,s.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,n;for(const[o,a]of e.entries())i=!t&&o===0||n!=a.section,s=o===e.length-1||a.section!=e.at(o+1)?.section,a.toggleClass("ag-charts-toolbar__button--first",i),a.toggleClass("ag-charts-toolbar__button--last",s),a.toggleClass("ag-charts-toolbar__button--group-first",o>0&&i),n=a.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:e,...t instanceof q?t.toJson():t},o=this.getButtonWidgetBounds(i),a={event:s,button:n,buttonBounds:o,buttonWidget:i};this.events.dispatch("button-pressed",a)}),i.addListener("focus",()=>{const s={button:{index:e}};this.events.dispatch("button-focused",s)}),i.addListener("expand-controlled-widget",s=>{this.expanded?.collapse({mode:"4"}),this.expanded=s.controlled;const n=this.expanded.addListener("collapse-widget",()=>{this.expanded=void 0,n()})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},v5=class extends Nk{createButtonWidget(){return new pE(this.localeManager)}},S5=class extends uE{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new re(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const n=e.position??"above",{offsetWidth:o,offsetHeight:a}=s;let r=e.y-a-i,l=e.x-o/2;n==="below"?r=e.y+i:n==="right"?(r=e.y-a/2,l=e.x+t):n==="above-left"&&(l=e.x),this.updatePosition({x:l,y:r})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor(se(0,e.x,i.width-t.width)),e.y=Math.floor(se(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},M5=class extends Nk{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new S5(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new D5(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new re(i.x+t.x-s.width,i.y+t.y,i.width,i.height)}},D5=class extends zu{constructor(e){super(ke("div","ag-charts-floating-toolbar__drag-handle"));const t=new zu(ke("span",`${fr("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},I5={...J1,...eO},qf={};$s(qf,{ButtonWidget:()=>eb,MenuItemRadioWidget:()=>rE,MenuItemWidget:()=>Lk,MenuWidget:()=>lE,NativeWidget:()=>zu,SliderWidget:()=>jD,ToolbarWidget:()=>tb,Widget:()=>Zl,WidgetEventUtil:()=>Yl});var fE={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Fg,lineDash:[0],label:{enabled:!1}}},Tk={...fE,nice:!1},Qb={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Ok={style:[{stroke:{$ref:"gridLineColor"}}],width:2},k5={number:{gridLine:Ok},time:{gridLine:Ok},category:{gridLine:Ok}},A5={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Tk,interval:{values:[0]}},log:{...Tk},time:{...Tk},category:{...fE}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Qb,position:{...Qb.position,anchorTo:"pointer"},range:"nearest"},axes:k5},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Qb},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Qb}}},mE=Ui(w5);function w5(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:mE(e.baseTheme,t)}:t}function yE(e){if(Array.isArray(e)&&e.length!==0){const t=e.find(i=>i!=null);if(typeof t=="number")return{data:e.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(s=>({x:s?.[0],y:s?.[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(e?.length===0)return{data:e,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:e}}function C5(e){switch(e?.type){case"number":{const{reverse:t,min:i,max:s}=e??{};return{type:"number",reverse:t,min:i,max:s}}case"time":{const{reverse:t,min:i,max:s}=e??{};return{type:"time",reverse:t,min:i,max:s}}case"category":default:{if(e==null)return{type:"category"};const{reverse:t,paddingInner:i,paddingOuter:s}=e;return{type:"category",reverse:t,paddingInner:i,paddingOuter:s}}}}function L5(e,t,i){const s={};return e?.stroke!=null&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),e?.strokeWidth!=null&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),e?.visible!=null&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var N5=Ui((e,t,i)=>s=>{const n=s.datum[s.xKey],o=s.datum[s.yKey],a=i==null?s.datum:s.datum[i],r=t?.renderer?.({context:e,datum:a,xValue:n,yValue:o});if(Pt(r)||gt(r)||Cs(r))return Dt(r);const l=r?.content??o.toFixed(2);return r?.title?{heading:void 0,title:void 0,data:[{label:r.title,value:l}]}:{heading:void 0,title:l,data:[]}});function T5(e){const{background:t,container:i,foreground:s,height:n,listeners:o,locale:a,minHeight:r,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,theme:u,data:p,crosshair:f,axis:y,min:x,max:b,tooltip:v,context:S,styleNonce:M,...D}=e,I={background:t,container:i,foreground:s,height:n,listeners:o,locale:a,minHeight:r,minWidth:l,overrideDevicePixelRatio:c,padding:h,width:d,styleNonce:M},{data:k,series:[A]=[],datumKey:w}=yE(p),C=D;A!=null&&Object.assign(C,A),C.tooltip={...v,renderer:N5(S,v,w)},I.theme=mE(u,A5),I.data=k,I.series=[C];const T=C.type==="bar"&&C.direction==="horizontal",[O,V]=T?["left","bottom"]:["bottom","left"],z={...C5(y),position:O,...f==null?{}:{crosshair:f}},R={type:"number",gridLine:L5(y,!1,e),position:V,...x==null?{}:{min:x},...b==null?{}:{max:b}};return I.axes=T?{x:R,y:z}:{x:z,y:R},I}var Pk=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Ek={visible:E,reverse:E,stroke:J,strokeWidth:P},Qf={context:()=>!0,tooltip:le,theme:le,background:le,container:le,width:le,height:le,minWidth:le,minHeight:le,padding:le,listeners:le,locale:le,data:le,styleNonce:L,axis:wl({number:{...Ek,min:We($,os("max")),max:We($,as("min"))},category:{...Ek,paddingInner:oe,paddingOuter:oe},time:{...Ek,min:We(Ie($,ns),os("max")),max:We(Ie($,ns),as("min"))}},"axis options","category"),min:We($,os("max")),max:We($,as("min")),crosshair:{enabled:E,snap:E,...X,...ae},xKey:L,yKey:L};Qf.overrideDevicePixelRatio=Q($),Qf.foreground=Q(le);var xE={type:"preset",name:"sparkline",version:de,options:wl({area:{...Qf,...ee(zI,Pk)},bar:{...Qf,...ee(sp,Pk)},line:{...Qf,...ee(Nf,Pk)}},"sparkline options"),create:T5,processData:yE},O5=["top","right","bottom","left"],Jf=class hH extends Sb{constructor(t,i){super(t,i),this.paired=!0,this.axes=this.createChartAxes(),this.lastUpdateClipRect=void 0,this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}createChartAxes(){return new dW}onAxisChange(t,i){super.onAxisChange(t,i),this.syncAxisChanges(t,i),this.ctx!=null&&this.ctx.zoomManager.setAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=Number.NaN,this.lastLayoutHeight=Number.NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(t),s.setClipRect(t)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const t of this.axes){const i=await this.getSyncedDomain(t);i!=null&&t.setDomains({domain:i})}}performLayout(t){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:o,visible:a}=this.updateAxes(t);this.seriesRoot.visible=a,this.seriesRect=o,this.animationRect=t.layoutBox;const{x:r,y:l}=o;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const f of[i,s])f.translationX=Math.floor(r),f.translationY=Math.floor(l);else{const{translationX:f,translationY:y}=i;Kr(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:f,translationY:y},{translationX:Math.floor(r),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=o.clone().grow(this.seriesArea.getPadding()),u=this.series.some(f=>f.alwaysClip)||(this.seriesArea.clip??!1)||n?c:void 0,{lastUpdateClipRect:p}=this;this.lastUpdateClipRect=u,this.ctx.animationManager.isActive()&&p!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:p,to:c,onUpdate:f=>this.setRootClipRects(f),onStop:()=>this.setRootClipRects(u),onComplete:()=>this.setRootClipRects(u)}):this.setRootClipRects(u),this.ctx.layoutManager.emitLayoutComplete(t,{axes:Z0(this.axes.map(f=>[f.id,f.getLayoutState()])),series:{visible:a,rect:o,paddedRect:c},clipSeries:n,layoutBox:t.layoutBox}),fP(this.series)}updateAxes(t){const{layoutBox:i,scrollbars:s}=t,{clipSeries:n,seriesRect:o,overflows:a}=this.resolveAxesLayout(i,s);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!a),this.clipAxis(r,o,i);return{clipSeries:n,seriesRect:o,visible:!a}}resolveAxesLayout(t,i){let s,n,o=0;const a=10,r=this.axes.filter(l=>l.crossAt?.value!=null);do if(n=s??this.getDefaultState(),s=this.updateAxesPass(new Map(n.axisAreaWidths),t.clone(),r,i),o++>a){W.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(s,n));return this.lastAreaWidths=s.axisAreaWidths,s}updateAxesPass(t,i,s,n){const o=new Map,a={};let r=!1,l=!1;const c=this.seriesArea.getPadding();for(const D of O5){const I=c[D]??0,k=this.axes.findLast(A=>A.position===D);k?k.seriesAreaPadding=I:i.shrink(I,D)}const h=(t.get("left")??0)+(t.get("right")??0),d=(t.get("top")??0)+(t.get("bottom")??0),u=this.buildCrossLinePadding(t),p=u.left+u.right,f=u.top+u.bottom;i.width<=h+p||i.height<=d+f?r=!0:i.shrink(u);const{scene:y}=this.ctx,x=i.clone().shrink(Object.fromEntries(t));for(const D of this.axes){const{position:I="left",direction:k}=D,A=k==="y";let w;this.sizeAxis(D,x,I),D.thickness==null?w=Rk(A,y)*(D.maxThicknessRatio??1):w=D.thickness;const C={sizeLimit:w-D.label.spacing,padding:this.padding,scrollbars:n},{primaryTickCount:T,bbox:O}=D.calculateLayout(D.nice?a[k]:void 0,C);a[k]??(a[k]=T),l||(l=D.dataDomain.clipped||D.visibleRange[0]>0||D.visibleRange[1]<1),D.thickness==null&&(w=Math.min(Rk(A,O)??0,w)),o.set(D.id,Math.ceil(w))}let b;s.length>0&&(b=this.calculateAxesCrossPositions(o,x,s));const v=Id(this.axes,D=>D.position??"left"),S=new Map,M=new Map;for(const[D,I]of rt(v)){let k=Rk(D!=="left"&&D!=="right",y)%y.pixelRatio,A=0;for(const w of I??[]){M.set(w.id,k);const C=o.get(w.id)??0;A=Math.max(A,k+C),w.layoutConstraints.stacked&&(k+=C+hH.AxesPadding)}S.set(D,Math.ceil(A))}for(const[D,I]of rt(v))this.positionAxes({axes:I??[],position:D,axisWidths:o,axisOffsets:M,axisAreaWidths:S,axisBound:i,seriesRect:x});return b!=null&&this.applyAxisCrossing(x,b),{clipSeries:l,seriesRect:x,axisAreaWidths:S,overflows:r}}calculateAxesCrossPositions(t,i,s){const n=new Map;for(const o of s){const{crossPosition:a,visible:r}=this.calculateAxisCrossPosition(o);o.setAxisVisible(r),this.adjustAxisWidth(o,t,a,i,r),a!=null&&n.set(o.id,a)}return n}calculateAxisCrossPosition(t){const i=this.axes.perpendicular(t),{scale:{domain:s,bandwidth:n},range:o}=i,a=(n??0)/2,r=i.scale.convert(t.crossAt?.value,{clamp:!1})+a;return i.inRange(r)?{crossPosition:r,visible:!0}:t.crossAt?.sticky===!1?{crossPosition:void 0,visible:!1}:{crossPosition:Number.isNaN(r)?o[s[0]]:Jc(r,o),visible:!0}}adjustAxisWidth(t,i,s,n,o){if(t.getModuleMap().getModule("crosshair")?.enabled||this.modulesManager.getModule("annotations")?.enabled===!0||this.ctx.annotationManager.createMemento().some(d=>{switch(d.type){case"vertical-line":return t.direction==="x";case"horizontal-line":return t.direction==="y"}}))return;const c=i.get(t.id)??0,h=o?this.calculateAxisBleedingWidth(t,c,s,n):0;i.set(t.id,h)}calculateAxisBleedingWidth(t,i,s,n){if(s==null)return i;switch(t.position){case"left":case"top":return Math.max(0,i-s);case"right":return Math.max(0,s+i-n.width);case"bottom":return Math.max(0,s+i-n.height);default:return i}}applyAxisCrossing(t,i){for(const s of this.axes){const n=i.get(s.id);if(n==null){s.crossAxisTranslation.x=0,s.crossAxisTranslation.y=0;continue}const o=s.direction==="x";s.crossAxisTranslation.x=o?0:t.x+n-s.translation.x,s.crossAxisTranslation.y=o?t.y+n-s.translation.y:0}}buildCrossLinePadding(t){var i;const s={top:0,right:0,bottom:0,left:0};for(const n of this.axes){const{position:o,label:a}=n;if(n.crossLines)for(const r of n.crossLines)r instanceof Es&&(r.position=o??"top",(i=r.label).parallel??(i.parallel=a.parallel)),r.calculatePadding?.(s)}for(const[n,o=0]of rt(s))s[n]=Math.max(o-(t.get(n)??0),0);return s}clampToOutsideSeriesRect(t,i,s,n){const o=s==="x"?t.x:t.y,a=s==="x"?t.width:t.height;return n===1?Math.min(i,o+a):Math.max(i,o)}async getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(t)}syncAxisChanges(t,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const o of t)n.delete(o);for(const o of n)s.removeAxis(o)}sizeAxis(t,i,s){const n=t instanceof eo,o=s==="left"||s==="right",{width:a,height:r}=i,l=o?r:a;let c=0,h=l,{min:d,max:u}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:f,align:y}=t.layoutConstraints;f==="px"?h=c+p:h=h*p/100;const x=h-c;if(y==="end")c=l-x,h=l;else if(y==="center"){const b=c+(l-c)/2;c=b-x/2,h=b+x/2}else y==="justify"&&(h=l);o&&(n?[c,h]=[h,c]:[d,u]=[1-u,1-d]),t.range=[c,h],t.visibleRange=[d,u],t.gridLength=o?a:r,t.lineRange=o?[r,0]:[0,a]}positionAxes(t){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:o,axisAreaWidths:a,seriesRect:r,position:l}=t,c=a.get(l)??0;let h="x",d="y",u=1;(l==="top"||l==="bottom")&&(h="y",d="x");let p=s[h];(l==="right"||l==="bottom")&&(u=-1,p+=h==="x"?s.width:s.height);for(const f of i){const y=a.get(d==="x"?"left":"top")??0,x=n.get(f.id)??0,b=o.get(f.id)??0;f.gridPadding=c-b-x,f.translation[d]=s[d]+y,f.translation[h]=this.clampToOutsideSeriesRect(r,p+u*(b+x),h,u)}}shouldFlipXY(){return this.series.every(t=>t instanceof dc&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&t.set(i,s)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const s of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const o=t.axisAreaWidths.get(s);if((n!=null||o!=null)&&n!==o)return!1}return!0}clipAxis(t,i,s){const n=Math.ceil(t.gridLine?.width??0),o=Math.ceil(t.line?.width??0);let{width:a,height:r}=i;switch(a+=t.direction==="x"?n:o,r+=t.direction==="y"?n:o,t.clipGrid(i.x,i.y,a,r),t.position){case"left":case"right":t.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":t.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};Jf.className="CartesianChart",Jf.type="cartesian",Jf.AxesPadding=15,g([Ze({changeValue(e,t){this.onAxisChange(e,t)}})],Jf.prototype,"axes",2);var P5=Jf;function Rk(e,t){return e?t?.width:t?.height}var E5=new Set(["number","log","time"]),R5=e=>me(e)&&e.type!=null&&!E5.has(e.type),hi={type:"chart",name:"cartesian",version:de,options:r4,create(e,t){return new P5(e,t)},validate(e,t,i){const s=[];e?.series?.[0]?.type==="histogram"&&Object.values(e?.axes??{}).some(R5)&&(s.push(new Da("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=ee(e,["axes"]));const n=ki(e,t,i);return n.invalid.push(...s),n}},zk=class extends Sb{constructor(e,t){super(e,t),this.axes=this.createChartAxes(),this.padding=new Vr(40),this.ctx.axisManager.axisGroup.zIndex=8}createChartAxes(){return new uW}getChartType(){return"polar"}isDataTransactionSupported(){return!this.series.some(e=>e.type==="pie"||e.type==="donut")}async performLayout(e){const t=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=t,this.animationRect=t,this.seriesRoot.translationX=t.x,this.seriesRoot.translationY=t.y,await this.computeCircle(t);for(const s of this.axes)s.update();let i=0;for(const s of this.series)i=Math.max(i,s.properties.marker?.size??0);for(const s of this.series.filter(bE))s.maxChartMarkerSize=i;this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:t,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}updateAxes(e,t,i,s){if(this.axes.length===0)return;const n=this.axes.angle,o=this.axes.radius,a=n.scale,r=o.innerRadiusRatio;n.innerRadiusRatio=r,n.computeRange(),n.gridLength=s,o.gridAngles=a.ticks({nice:[n.nice,n.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>a.convert(l)),o.gridRange=n.range,o.range=[s,s*r];for(const l of[n,o])l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()}async computeCircle(e){const t=this.series.filter(bE),i=(l,c,h)=>{this.updateAxes(e,l,c,h);for(const u of t)u.centerX=l,u.centerY=c,u.radius=h;const d=t.filter(u=>u.type==="donut"||u.type==="pie");if(d.length>1){const u=d.map(p=>{const f=p.getInnerRadius();return{series:p,innerRadius:f}}).sort((p,f)=>p.innerRadius-f.innerRadius);u.at(-1).series.surroundingRadius=void 0;for(let p=0;p{const c=[];for(const u of Cr(this.axes,t)){const p=await u.computeLabelsBBox({hideWhenNecessary:l},e);p&&c.push(p)}if(c.length===0){i(s,n,o);return}const h=re.merge(c),d=this.refineCircle(h,a,e);i(d.centerX,d.centerY,d.radius),a=d.radius};await r(),await r(),await r(),await r({hideWhenNecessary:!0}),await r({hideWhenNecessary:!0});for(const l of Cr(this.axes,t))await l.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:a,centerX:s,centerY:n}}refineCircle(e,t,i){const n=-t,o=-t,a=t,r=t;let l=Math.max(0,n-e.x),c=Math.max(0,o-e.y),h=Math.max(0,e.x+e.width-a),d=Math.max(0,e.y+e.height-r);l=h=Math.max(l,h),c=d=Math.max(c,d);const u=i.width-l-h,p=i.height-c-d;let f=Math.min(u,p)/2;const y=.5*i.width/2,x=.5*i.height/2,b=Math.min(y,x);if(fi.height){const I=i.height-2*f;Math.min(c,d)*2>I?(c=I/2,d=I/2):c>d?c=I-d:d=I-c}if(2*f+M>i.width){const I=i.width-2*f;Math.min(l,h)*2>I?(l=I/2,h=I/2):l>h?l=I-h:h=I-l}}const v=l+2*f+h,S=c+2*f+d;return{centerX:(i.width-v)/2+l+f,centerY:(i.height-S)/2+c+f,radius:f}}};zk.className="PolarChart",zk.type="polar";function bE(e){return e instanceof Sk}var el={type:"chart",name:"polar",version:de,options:l4,create(e,t){return new zk(e,t)},validate(e,t,i){const s=[],n=e?.series?.[0]?.type;(n==="pie"||n==="donut")&&e?.axes&&(s.push(new gg([],e.axes,i,"axes")),e=ee(e,["axes"]));const o=ki(e,t,i);return o.invalid.push(...s),o}};function z5({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:o=0,forceResult:a=!1}){const r=e==="horizontal",l={max:r?s:i,fn:r?u=>u.width:u=>u.height,padding:r?o:n},c={max:r?i:s,fn:r?u=>u.height:u=>u.width,padding:r?n:o};let h=0;const d=[];for(;h=1;){const l=B5(e,t,r,i,s,n);if(l==null&&r<=1)return;if(l==null){r--;continue}if(typeof l=="number"){if(l<=1)return;r=l1?l:r,r--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function B5(e,t,i,s,n,o){const a=[];let r=0,l=0,c=[];const h=[];for(let d=0;d0&&a.push(c),c=[]);const p=s.fn(e[d])+s.padding;h[u]=Math.max(h[u]??0,p),l=Math.max(l,n.fn(e[d])+n.padding);const f=r+l,y=!o||a.length>0;if(f>n.max&&y){c=[];break}if(h.reduce((b,v)=>b+v,0)>s.max&&!o)return h.length0&&a.push(c),a.length>0?a:void 0}function F5(e,t,i,s,n){let o=0,a=0;return{pages:e.map(l=>{t==="horizontal"&&(l=_5(l));let c=0;const h=l.map(p=>{const f=p.map(b=>(c=Math.max(b,c),i[b]));let y=0,x=0;for(const b of f)y+=b.height+s,x=Math.max(x,b.width+n);return{indices:p,bboxes:f,columnHeight:Math.ceil(y),columnWidth:Math.ceil(x)}});let d=0,u=0;for(const p of h)d+=p.columnWidth,u=Math.max(u,p.columnHeight);return o=Math.max(d,o),a=Math.max(u,a),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:d,pageHeight:u}}),maxPageWidth:o,maxPageHeight:a}}function _5(e){const t=[];for(const i of e[0])t.push([]);for(const[i,s]of e.entries())for(const[n,o]of s.entries())t[n][i]=o;return t}function H5(e,t){const i=e.length;let s=0;for(let n=0;nt.max)return i/n<2?Math.ceil(i/2):n;return i}var mp=class extends q{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([m],mp.prototype,"color",2),g([m],mp.prototype,"fontStyle",2),g([m],mp.prototype,"fontWeight",2),g([m],mp.prototype,"fontSize",2),g([m],mp.prototype,"fontFamily",2);var tl=class extends q{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};g([m],tl.prototype,"size",2),g([m],tl.prototype,"fill",2),g([m],tl.prototype,"fillOpacity",2),g([m],tl.prototype,"stroke",2),g([m],tl.prototype,"strokeWidth",2),g([m],tl.prototype,"strokeOpacity",2);var Jb=class extends q{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};g([Ze({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Jb.prototype,"shape",2),g([m],Jb.prototype,"size",2),g([m],Jb.prototype,"padding",2);var il=class extends q{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=gi(this),this.marker=new Jb(this),this.activeStyle=new tl,this.inactiveStyle=new tl,this.highlightStyle=new tl,this.label=new mp,this.group=new ds({name:"pagination"}),this.labelNode=new bn,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this.nextButton=new Ni,this.previousButton=new Ni,this.isRtl=!1,this.orientation="vertical",this.labelNode.setProperties({textBaseline:"middle",textAlign:"left",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}applyRotations(){const{isRtl:e}=this;switch(this.orientation){case"horizontal":{this.previousButton.rotation=e?Math.PI/2:-Math.PI/2,this.nextButton.rotation=e?-Math.PI/2:Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateButtonPositions()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateButtonPositions(){const t=this.labelNode.getBBox().width+(this.marker.size/2+this.marker.padding)*2;this.isRtl&&this.orientation==="horizontal"?(this.nextButton.translationX=0,this.previousButton.translationX=t):(this.previousButton.translationX=0,this.nextButton.translationX=t)}updateLabel(){const{isRtl:e,labelNode:t,currentPage:i,totalPages:s,label:{color:n,fontStyle:o,fontWeight:a,fontSize:r,fontFamily:l}}=this,c=[i+1,s];e&&c.reverse(),t.text=c.join(" / "),t.fill=n,t.fontStyle=o,t.fontWeight=a,t.fontSize=r,t.fontFamily=l}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:o,highlightStyle:a,highlightActive:r}=this,l=(c,h)=>h?o:c===r?a:n;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=t===0,s=e===t-1,n=e===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(e){e=se(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),t==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):t==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback()}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback()}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=zt.toCanvas(this.previousButton),t=zt.toCanvas(this.nextButton);return{prev:e,next:t}}};il.className="Pagination",g([m],il.prototype,"marker",2),g([m],il.prototype,"activeStyle",2),g([m],il.prototype,"inactiveStyle",2),g([m],il.prototype,"highlightStyle",2),g([m],il.prototype,"label",2),g([Rt(e=>{e.applyRotations(),e.updatePositions()})],il.prototype,"isRtl",2),g([Rt(e=>e.applyRotations())],il.prototype,"orientation",2);var G5=class{constructor(e,t){this.dirty=!0,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"}}),this.itemDescription=e.agDocument.createElement("p"),this.itemDescription.style.display="none",this.itemDescription.id=Rr(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}shouldApplyHoverOnFocus(e){const t=e.getElement();return[":hover",":focus-visible"].some(i=>t.matches(i))}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:n}=e,o=t.localeManager,a=i.length;i.each((r,l,c)=>{r.proxyButton?.destroy(),r.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(o,Oe(s.getItemLabel(l)),c,a),ariaChecked:!!r.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=r.proxyButton;h.addListener("click",d=>n.onClick(d.sourceEvent,r.datum,h)),h.addListener("dblclick",d=>n.onDoubleClick(d.sourceEvent,r.datum)),h.addListener("mouseenter",d=>n.onHover(d.sourceEvent,r)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",d=>n.onContextClick(d,r)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",d=>this.shouldApplyHoverOnFocus(h)?n.onHover(d.sourceEvent,r):n.onLeave()),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const n=zt.toCanvas(t);this.itemList.setBounds(n);const o=Math.max(...e.nodes().map(a=>a.getTextMeasureBBox().height));e.each((a,r)=>{if(a.proxyButton){const l=a.pageIndex===i.currentPage,{x:c,y:h,height:d,width:u}=zt.toCanvas(a,a.getTextMeasureBBox()),p=(o-d)/2,f={x:c-n.x,y:h-p-n.y,height:o,width:u},y=s&&l;a.proxyButton.setCursor("pointer"),a.proxyButton.setEnabled(y),a.proxyButton.setPointerEvents(y?void 0:"none"),a.proxyButton.setBounds(f)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{oldPages:s,newPages:n}=e,o=(s?.length??n.length)>1,a=n.length>1;o!==a&&(a?this.createPaginationButtons(e):this.destroyPaginationButtons()),this.paginationGroup.setAriaHidden(a?void 0:!0)}if(this.prevButton&&this.nextButton){const{prev:s,next:n}=i.computeCSSBounds(),o=re.merge([s,n]);s.x-=o.x,s.y-=o.y,n.x-=o.x,n.y-=o.y,this.paginationGroup.setBounds(o),this.prevButton.setBounds(s),this.nextButton.setBounds(n),this.prevButton.setEnabled(i.currentPage!==0),this.nextButton.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton.setCursor(i.getCursor("next")),this.prevButton.setCursor(i.getCursor("previous"))}}createPaginationButtons(e){const{ctx:t,pagination:i}=e;this.prevButton||(this.prevButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",s=>this.onPageButton(e,s,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0))),this.nextButton||(this.nextButton=t.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup}),this.nextButton.addListener("click",s=>this.onPageButton(e,s,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0)))}destroyPaginationButtons(){this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,n)=>{const[o,a]=[t[s],e[s]];return o.id!==a.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:n},o,a)=>{const r=n?.getElement();if(r!=null){const l=Oe(i.getItemLabel(o));r.textContent=this.getItemAriaText(e,l,a,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function vE(e,{itemId:t,seriesId:i,label:{text:s}},n){const o={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,event:n,text:Oe(s),preventDefault:()=>o.defaultPrevented=!0}};return o}var Oo=class extends ds{constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new Le({name:"legend-markerLabel-symbols",renderToOffscreenCanvas:!0,optimizeForInfrequentRedraws:!0})),this.label=this.appendChild(new bn),this.enabled=!0,this.pageIndex=Number.NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.isRtl=!1,this.marker=this.symbolsGroup.appendChild(new Ni({zIndex:1})),this.line=this.symbolsGroup.appendChild(new Xn({zIndex:0})),this.line.visible=!1,this.label.textBaseline="middle",this.label.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),re.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let n=0,o=0;if(e.visible){const{size:a}=e,r=Ni.anchor(e.shape);n=(r.x-.5)*a+i/2,o=(r.y-.5)*a,s?(e.x=0,e.y=0,e.translationX=n,e.translationY=o):(e.x=n,e.y=o,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t,isRtl:i}=this;this.label.x=i?-t:e+t,this.label.textAlign=i?"right":"left"}computeBBox(){return this.layout(),super.computeBBox()}};Oo.className="MarkerLabel",g([St("label")],Oo.prototype,"text",2),g([St("label")],Oo.prototype,"fontStyle",2),g([St("label")],Oo.prototype,"fontWeight",2),g([St("label")],Oo.prototype,"fontSize",2),g([St("label")],Oo.prototype,"fontFamily",2),g([St("label","fill")],Oo.prototype,"color",2),g([Rt(e=>e.layoutLabel())],Oo.prototype,"spacing",2),g([Rt(e=>e.layoutLabel())],Oo.prototype,"length",2),g([K()],Oo.prototype,"isCustomMarker",2),g([Rt(e=>e.layoutLabel())],Oo.prototype,"isRtl",2);function j5(e,t){switch(typeof t.itemId){case"number":return{series:e,itemId:void 0,datum:void 0,datumIndex:t.itemId,legendItemName:t.legendItemName};case"string":return{series:e,itemId:t.itemId,datum:void 0,datumIndex:void 0,legendItemName:t.legendItemName};default:return t.itemId}}var gc=class extends q{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([m],gc.prototype,"maxLength",2),g([m],gc.prototype,"color",2),g([m],gc.prototype,"fontStyle",2),g([m],gc.prototype,"fontWeight",2),g([m],gc.prototype,"fontSize",2),g([m],gc.prototype,"fontFamily",2),g([m],gc.prototype,"formatter",2);var yp=class extends q{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};g([m],yp.prototype,"shape",2),g([m],yp.prototype,"size",2),g([m],yp.prototype,"padding",2),g([m],yp.prototype,"strokeWidth",2),g([m],yp.prototype,"enabled",2);var Vk=class extends q{};g([m],Vk.prototype,"strokeWidth",2),g([m],Vk.prototype,"length",2);var fc=class extends q{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new yp,this.label=new gc,this.line=new Vk}};g([m],fc.prototype,"maxWidth",2),g([m],fc.prototype,"paddingX",2),g([m],fc.prototype,"paddingY",2),g([m],fc.prototype,"showSeriesStroke",2),g([m],fc.prototype,"marker",2),g([m],fc.prototype,"label",2),g([m],fc.prototype,"line",2);var Bk=class extends q{};g([m],Bk.prototype,"legendItemClick",2),g([m],Bk.prototype,"legendItemDoubleClick",2);var SE={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},ME={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:1,rotation:0,scale:1},DE={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},bi=class extends q{constructor(e){super(),this.ctx=e,this.id=gi(this),this.group=new ds({name:"legend",zIndex:16}),this.itemSelection=yi.select(this.group,Oo),this.containerNode=this.group.appendChild(new Ci({name:"legend-container"})),this.oldSize=[0,0],this.pages=[],this.paginationItemsOffsetX=0,this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new fc,this.listeners=new Bk,this.enabled=!1,this.position="bottom",this.border=new Pr(this.containerNode),this.cornerRadius=0,this.fillOpacity=1,this.padding=4,this.spacing=0,this.cleanup=new ot,this.size=[0,0],this._visible=!0,this.pagination=new il(()=>e.eventsHub.emit("chart:request-update",{type:9}),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),t["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(e.eventsHub.on("active:load-memento",i=>this.onActiveLoadMemento(i)),e.eventsHub.on("active:update",i=>this.onActiveUpdate(i)),e.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),e.eventsHub.on("legend:change-partial",this.onLegendDataChangePartial.bind(this)),e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new G5(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){Ht(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.data=e.filter(t=>!t.hideInLegend)}onLegendDataChangePartial(e){this.itemSelection.each(({proxyButton:t},{itemId:i})=>{if(t!=null)for(const s of e.legendData)s.itemId===i&&t.setChecked(s.enabled)})}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}getOrientation(){return this.orientation??"horizontal"}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}updateItemSelection(){const e=[...this.data];this.reverseOrder&&e.reverse(),this.itemSelection.update(e)}isInteractive(){const{toggleSeries:e,listeners:{legendItemClick:t,legendItemDoubleClick:i}}=this;return e||i!=null||t!=null}checkInteractionState(){return this.ctx.interactionManager.isState(1)}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:n,maxWidth:o,label:{maxLength:a=1/0,fontStyle:r,fontWeight:l,fontSize:c,fontFamily:h}}=this.item;this.updateItemSelection();const d=[],u=et(n),f=o??e*.8,{markerWidth:y,anyLineEnabled:x}=this.calculateMarkerWidth(),{isRtl:b}=this.ctx.domManager;if(this.itemSelection.each((C,T)=>{C.fontStyle=r,C.fontWeight=l,C.fontSize=c,C.fontFamily=h,C.isRtl=b;const O=this.updateMarkerLabel(C,T,y,x),V=T.itemId??T.id,z=this.getItemLabel(T),R=Oe(z,"").replace(gr," ");C.text=this.truncate(R,a,f,O,u,V),d.push(C.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!Number.isFinite(e))return{};[e,t]=this.updateContainer(e,t);const v=this.size,S=this.oldSize;v[0]=e,v[1]=t,(v[0]!==S[0]||v[1]!==S[1])&&(S[0]=v[0],S[1]=v[1]);const{pages:M,maxPageHeight:D,maxPageWidth:I}=this.updatePagination(d,e,t),k=this.pages;this.pages=M,this.maxPageSize=[I-i,D-s];const A=this.pagination.currentPage,w=this.pages[A];return this.pages.length<1||!w?(this.visible=!1,{oldPages:k}):(this.visible=!0,this.updatePositions(A),this.update(),{oldPages:k})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0),n=!!(e.line&&t),o=this.isCustomMarker(s,e.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:o}}calcSymbolsLengths(e,t,i){const{marker:s,line:n}=this.item;let o;const{shape:a}=e.marker;if(this.isCustomMarker(t,a)){const c=new Ni;c.shape=a,c.updatePath();const h=c.getBBox();o=Math.max(h.width,h.height)}const r=t?s.size:0,l=i?n.length??25:0;return{markerLength:r,lineLength:l,customMarkerSize:o}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:o,markerEnabled:a}=this.calcSymbolsEnabled(n),{markerLength:r,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,a,o);e=Math.max(e,l,c,r),t||(t=o)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,s){const{marker:n,paddingX:o}=this.item,{symbol:a}=t;let r=o;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(a),h=n.padding;(l||s)&&(r+=h+i);const{marker:d,line:u}=e;return d.visible=l,d.visible&&(d.shape=n.shape??a.marker.shape??"square",d.size=n.size,d.setStyleProperties(this.getMarkerStyles(Pe(a)))),u.visible=s,u.visible&&u.setStyleProperties(this.getLineStyles(a)),e.length=i,e.spacing=h,e.isCustomMarker=c,r}updateContainer(e,t){const i=this.getContainerStyles();return this.containerNode.width=0,this.containerNode.height=0,this.containerNode.setStyleProperties(i),this.containerNode.cornerRadius=i.cornerRadius,e-=i.strokeWidth*2+i.padding.left+i.padding.right,t-=i.strokeWidth*2+i.padding.top+i.padding.bottom,[e,t]}truncate(e,t,i,s,n,o){let a=!1;e.length>t&&(e=e.substring(0,t),a=!0);const r=Hl(e,n,i-s,a);return mr(r)?this.truncatedItems.add(o):this.truncatedItems.delete(o),r}updatePagination(e,t,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,e.length),{isRtl:o}=this.ctx.domManager;this.pagination.orientation=s,this.pagination.isRtl=o,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:a,maxPageHeight:r,maxPageWidth:l,paginationBBox:c,paginationVertical:h}=this.calculatePagination(e,t,i),d=a.findIndex(M=>M.endIndex>=n);this.pagination.currentPage=se(0,d,Math.max(0,a.length-1));const{paddingX:u,paddingY:p}=this.item,f=8,y=l-u,x=r-p;let b=0,v=-c.y-this.item.marker.size/2;h?(o&&(b=t-c.width+c.x),v+=x+f):o?(b=-c.x,v+=(x-c.height)/2):(b+=-c.x+y+f,v+=(x-c.height)/2),this.paginationItemsOffsetX=o&&!h&&this.pagination.visible?c.width+f:0,this.pagination.translationX=b,this.pagination.translationY=v,this.pagination.update(),this.pagination.updateMarkers();let S=0;return this.itemSelection.each((M,D,I)=>{I>(a[S]?.endIndex??1/0)&&S++,M.pageIndex=S}),{maxPageHeight:r,maxPageWidth:l,pages:a}}calculatePagination(e,t,i){const{paddingX:s,paddingY:n}=this.item,o=["left","left-top","left-bottom","right","right-top","right-bottom"],{placement:a}=Ol(this.position),r=this.getOrientation(),l=o.includes(a);let c=this.pagination.getBBox(),h=new re(0,0,0,0),d=[],u=0,p=0,f=0;const y=b=>b.width===c.width&&b.height===c.height,x=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(f++>10){W.warn("unable to find stable legend layout.");break}c=h;const b=t-(l?0:c.width),v=i-(l?c.height:0),S=z5({orientation:r,bboxes:e,maxHeight:v,maxWidth:b,itemPaddingY:n,itemPaddingX:s,forceResult:x});d=S?.pages??[],u=S?.maxPageWidth??0,p=S?.maxPageHeight??0;const M=d.length;if(this.pagination.visible=M>1,this.pagination.totalPages=M,this.pagination.update(),this.pagination.updateMarkers(),h=this.pagination.getBBox(),!this.pagination.visible)break}while(!y(h));return{maxPageWidth:u,maxPageHeight:p,pages:d,paginationBBox:h,paginationVertical:l}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:n,startIndex:o,endIndex:a}=s[e];let r=0,l=0;const c=n.length,h=n[0].indices.length,d=this.getOrientation()==="horizontal",u=n[0].bboxes[0].height+t,{isRtl:p}=this.ctx.domManager,f=[],y=n.reduce((x,b)=>x+b.columnWidth,0);i.each((x,b,v)=>{if(va){x.visible=!1;return}const S=v-o;let M,D;d?(M=S%c,D=Math.floor(S/c)):(M=Math.floor(S/h),D=S%h),x.visible=!0;const I=n[M];I&&(l=Math.floor(u*D),p?r=Math.floor(y-(f[D]??0)):r=Math.floor(f[D]??0),f[D]=(f[D]??0)+I.columnWidth,x.translationX=r+this.paginationItemsOffsetX,x.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:n}=this,o=n[e];if(!o)return;const{startIndex:a,endIndex:r}=o;a===0?this.paginationTrackingIndex=0:e===n.length-1?this.paginationTrackingIndex=r:this.paginationTrackingIndex=Math.floor((a+r)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:this.isInteractive()}),this.ctx.eventsHub.emit("chart:request-update",{type:9})}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){const e=this.toggleSeries?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-series-visibility",e),this.ctx.contextMenuRegistry.toggle("toggle-other-series",e)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=e.line??{},o=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??o,lineDash:n}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:o,lineDash:a,lineDashOffset:r}=e,l=Math.min(2,o??1);return Un(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),ea(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),wI({fill:t,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:a,lineDashOffset:r},SE,ME,DE)}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:o,padding:a}=this,r=typeof a=="number";return wI({cornerRadius:s,fill:n,fillOpacity:o,padding:{top:r?a:a.top??0,right:r?a:a.right??0,bottom:r?a:a.bottom??0,left:r?a:a.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0},SE,ME,DE)}computePagedBBox(){const e=Le.computeChildrenBBox(this.group.excludeChildren({name:"legend-container"}));if(this.pages.length>1){const[s,n]=this.maxPageSize;e.height=Math.max(n,e.height),e.width=Math.max(s,e.width)}const{strokeWidth:t,padding:i}=this.getContainerStyles();return e.grow(i).grow(t),e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===e.itemId)[0]??{};if(t===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i),this.clearHighlight()}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum),this.clearHighlight()}onContextClick(e,t){if(this.checkInteractionState())return;const{sourceEvent:i}=e,s=t.datum;this.clearHighlight(),this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const o=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0?"show":"hide";this.ctx.contextMenuRegistry.toggle("toggle-other-series",o);const{offsetX:a,offsetY:r}=i,{x:l,y:c}=zt.toCanvasPoint(t,a,r);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:l,canvasY:c},{legendItem:s})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:n},preventHidingAll:o,toggleSeries:a}=this;if(!t)return!1;const{legendType:r,seriesId:l,itemId:c,enabled:h,legendItemName:d}=t,u=n.series.find(y=>y.id===l);if(!u)return!1;let p=h;const f=vE("click",t,e);return s&&ls([u.properties,this.ctx.chartService],s,f.apiEvent),f.defaultPrevented||(a&&(p=!h,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.eventsHub.emit("legend:item-click",{legendType:r,series:u,itemId:c,enabled:p,legendItemName:d})),this.updateHighlight(p,t,u),this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1}})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!t)return!1;const{legendType:o,id:a,itemId:r,seriesId:l}=t,c=s.series.find(d=>d.id===a);if(!c)return!1;const h=vE("dblclick",t,e);if(i&&ls([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const d=s.series.flatMap(y=>y.getLegendData("category"));let u=0;const p=new Set;for(const y of d)y.enabled&&(u+=1,y.legendItemName!=null&&p.add(y.legendItemName));p.size>0&&(u=p.size);const f=d.find(y=>y.itemId===r&&y.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:o,series:c,itemId:r,numVisibleItems:u,enabled:f?.enabled??!1,legendItemName:f?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.eventsHub.emit("chart:request-update",{type:2,opts:{forceNodeDataRefresh:!0}}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=zt.toCanvas(t).computeCenter():(e.preventDefault(),i=zt.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(this.checkInteractionState())return;if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0);this.updateHighlight(i?.enabled,i,s)}onLeave(){this.checkInteractionState()||(this.ctx.tooltipManager.removeTooltip(this.id,void 0,!0),this.clearHighlight())}clearHighlight(){this.updateHighlight(void 0,void 0,void 0)}updateHighlight(e,t,i,s){if(this.checkInteractionState())return;const n=r=>{if(r===void 0)return this.ctx.activeManager.clear();{const l=r.nodeDatum.series.id,c=r.itemId;return this.ctx.activeManager.update({type:"legend",seriesId:l,itemId:c},void 0)}},o=r=>{n(r)||this.ctx.highlightManager.updateHighlight(this.id,r?.nodeDatum)},a=r=>{this.ctx.interactionManager.isState(64)||s?.initialState?o(r):this.ctx.interactionManager.isState(4)?this.ctx.animationManager.onBatchStop(()=>{o(r)}):r===void 0&&o(r)};if(e===!0&&i!==void 0&&t!==void 0){const r=t.itemId,l=j5(i,t);a({itemId:r,nodeDatum:l})}else a(void 0)}onActiveUpdate(e){e?.type==="series-node"&&this.ctx.highlightManager.updateHighlight(this.id,void 0)}onActiveLoadMemento(e){const{activeItem:t}=e;if(t?.type!=="legend")return this.ctx.highlightManager.updateHighlight(this.id,void 0);const i=this.data.find(n=>n.seriesId===t.seriesId&&n.itemId===t.itemId),s=this.ctx.chartService.series.find(n=>n.id===t.seriesId);if(s===void 0)W.warn(`Cannot find seriesId: "${t.seriesId}"`),e.reject();else if(i===void 0){const n=JSON.stringify({seriesId:t.seriesId,itemId:t.itemId});W.warn(`cannot find legend item: ${n}`),e.reject()}else this.updateHighlight(i.enabled,i,s,e)}onLocaleChanged(){this.updateItemSelection(),this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{placement:t,floating:i,xOffset:s,yOffset:n}=Ol(this.position),o=i?new re(0,0,e.width,e.height):e.layoutBox,{x:a,y:r,width:l,height:c}=o,[h,d]=this.calculateLegendDimensions(o),{oldPages:u}=this.calcLayout(h,d),p=this.computePagedBBox();if(this.visible){let y=function(S){};var f=y;const x=this.spacing;let b,v;switch(t){case"top":b=(l-p.width)/2,v=0;break;case"bottom":b=(l-p.width)/2,v=c-p.height;break;case"right":b=l-p.width,v=(c-p.height)/2;break;case"left":b=0,v=(c-p.height)/2;break;case"top-right":case"right-top":b=l-p.width,v=0;break;case"top-left":case"left-top":b=0,v=0;break;case"bottom-right":case"right-bottom":b=l-p.width,v=c-p.height;break;case"bottom-left":case"left-bottom":b=0,v=c-p.height;break;default:y(t)}if(!i){let S,M;switch(t){case"top":case"top-right":case"top-left":S=p.height+x,M="top";break;case"bottom":case"bottom-right":case"bottom-left":S=p.height+x,M="bottom";break;case"left":case"left-top":case"left-bottom":S=p.width+x,M="left";break;case"right":case"right-top":case"right-bottom":S=p.width+x,M="right";break;default:y(t)}o.shrink(S,M)}b+=s,v+=n,this.group.translationX=Math.floor(a+b-p.x),this.group.translationY=Math.floor(r+v-p.y),this.containerNode.x=p.x,this.containerNode.y=p.y,this.containerNode.width=p.width,this.containerNode.height=p.height}return u}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:s,pages:n,group:o}=this,a=this.visible&&this.enabled,r=this.isInteractive();this.domProxy.update({visible:a,interactive:r,ctx:t,itemSelection:i,group:o,pagination:s,oldPages:e,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,{placement:s}=Ol(this.position),n=t/i,o=.5,a=.2,r=.25;let l,c;function h(d){}switch(s){case"top":case"top-left":case"top-right":case"bottom":case"bottom-left":case"bottom-right":{const d=n<1?Math.min(o,a*(1/n)):a;l=this.maxWidth?Math.min(this.maxWidth,t):t,c=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*d);break}case"left":case"left-top":case"left-bottom":case"right":case"right-top":case"right-bottom":{const d=n>1?Math.min(o,r*n):r;l=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*d),c=this.maxHeight?Math.min(this.maxHeight,i):i;break}default:}return[l,c]}cachedCallWithContext(e,t){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],e,t)}};bi.className="Legend",g([m],bi.prototype,"toggleSeries",2),g([m],bi.prototype,"pagination",2),g([m],bi.prototype,"item",2),g([m],bi.prototype,"listeners",2),g([Rt((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:n}}=e;i===!1&&t===!0&&n.restoreState(s)}),m],bi.prototype,"enabled",2),g([m],bi.prototype,"position",2),g([m],bi.prototype,"maxWidth",2),g([m],bi.prototype,"maxHeight",2),g([m],bi.prototype,"reverseOrder",2),g([m],bi.prototype,"orientation",2),g([m],bi.prototype,"preventHidingAll",2),g([m],bi.prototype,"border",2),g([m],bi.prototype,"cornerRadius",2),g([m],bi.prototype,"fill",2),g([m],bi.prototype,"fillOpacity",2),g([m],bi.prototype,"padding",2),g([m],bi.prototype,"spacing",2),g([m],bi.prototype,"xOffset",2),g([m],bi.prototype,"yOffset",2);var Fk={type:"plugin",name:"legend",version:de,options:{enabled:E,position:Hd,orientation:U("horizontal","vertical"),maxWidth:P,maxHeight:P,spacing:P,border:Sr,cornerRadius:$,padding:_n,fill:Ls,fillOpacity:oe,preventHidingAll:E,reverseOrder:E,toggleSeries:E,item:{marker:{size:P,shape:Mr,padding:P,strokeWidth:P},line:{length:P,strokeWidth:P},label:{maxLength:P,formatter:at,...$e},maxWidth:P,paddingX:P,paddingY:P,showSeriesStroke:E},pagination:{marker:{size:P,shape:Mr,padding:P},activeStyle:{...ie,...X},inactiveStyle:{...ie,...X},highlightStyle:{...ie,...X},label:$e},listeners:{legendItemClick:at,legendItemDoubleClick:at}},themeTemplate:{...By,enabled:{$and:[{$greaterThan:[{$size:{$path:"/series"}},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"left-top"]},{$eq:[{$path:"./position"},"left-bottom"]},{$eq:[{$path:"./position"},"right"]},{$eq:[{$path:"./position"},"right-top"]},{$eq:[{$path:"./position"},"right-bottom"]},{$eq:[{$path:"./position/placement"},"left"]},{$eq:[{$path:"./position/placement"},"left-top"]},{$eq:[{$path:"./position/placement"},"left-bottom"]},{$eq:[{$path:"./position/placement"},"right"]},{$eq:[{$path:"./position/placement"},"right-top"]},{$eq:[{$path:"./position/placement"},"right-bottom"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:li.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}},fill:{$if:[{$path:["./position/floating",!1]},{$ref:"chartBackgroundColor"},"transparent"]}},create:e=>{const t=new bi(e);return t.attachLegend(e.scene),t}},xp=class extends eo{getVisibleDomain(e){const[t,i]=e,[s,n]=this.visibleRange;if(e.length<2)return[t,i];const o=Math.min(t,i),a=Math.max(t,i);if(o>=0){const r=Math.log(t),c=Math.log(i)-r;return[Math.exp(r+s*c),Math.exp(r+n*c)]}if(a<=0){const r=-Math.log(-t),c=-Math.log(-i)-r;return[-Math.exp(-(r+s*c)),-Math.exp(-(r+n*c))]}return[Number.NaN,Number.NaN]}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:n}=this,{extent:o,clipped:a}=sh(e.domain,t,i,s,n,void 0,e.sortMetadata?.sortOrder);return o[0]<0&&o[1]>0||e.domain[0]<0&&e.domain[1]>0?(W.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:a}):o[0]===0||o[1]===0||e.domain[0]===0||e.domain[1]===0?(W.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:a}):{domain:o,clipped:a}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new ik)}};xp.className="LogAxis",xp.type="log";var W5=10;function ev(e,t,i,s,n,o,a){const r=e[o];if(r===void 0)return-1;const l=Number.isFinite(t)?Wn(r,t,i,a):th(o,e.length),c=zg(l,n);return o===s[c+Zs]||o===s[c+Xs]||o===s[c+qs]||o===s[c+Qs]?c:-1}function IE(e,t,i,s,n,o,a,r,l){let c=0,h=0,d=-1;for(let x=0;xb.maxRange===h);let{indexData:u,valueData:p}=La(t,i,i,o,a,h,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),{indices:f,metaIndices:y}=IE(t,o,a,u,h,r,n,d?.indices,d?.metaIndices);const x=[{maxRange:h,metaIndices:y,indices:f,indexData:u,valueData:p}];for(;f.length>W5&&h>Nr;){const b=h,v=Math.trunc(b/2),S=c?.find(V=>V.maxRange===v),M=Rl(u,p,b,{reuseIndexData:S?.indexData,reuseValueData:S?.valueData});h=M.maxRange,u=M.indexData,p=M.valueData;const D=f;let I=0,k=0,A=-1;for(const V of D){const z=ev(t,o,a,u,h,V,r);z!==-1&&(I++,z!==A&&(k++,A=z))}k++;const w=S?.indices?.length===I?S.indices:new Uint32Array(I),C=S?.metaIndices?.length===k?S.metaIndices:new Uint32Array(k);let T=0,O=0;A=-1;for(const V of D){const z=ev(t,o,a,u,h,V,r);z!==-1&&(z!==A&&(C[O++]=T,A=z),w[T++]=V)}C[O]=I-1,f=w,y=C,x.push({maxRange:h,metaIndices:y,indices:f,indexData:u,valueData:p})}return x.reverse(),x}function $5(e,t,i,s){const n=t.length;if(nM.maxRange===u),{indexData:f,valueData:y}=La(t,i,i,o,a,u,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),{indices:x,metaIndices:b}=IE(t,o,a,f,u,r,n,p?.indices,p?.metaIndices),v={maxRange:u,indices:x,metaIndices:b,indexData:f,valueData:y};function S(){return _k([o,a],t,i,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:h})?.filter(D=>D.maxRange!==u)??[]}return{immediate:[v],computeRemaining:S}}function K5(e,t,i,s,n,o){const[a,r]=ci(e,s);return _k([a,r],t,i,{xNeedsValueOf:n,yNeedsValueOf:o})}var U5=zr(K5);function Y5(e,t,i,s,n,o){const a=t.resolveKeysById(n,"xValue",i),r=t.resolveColumnById(n,s,i),l=t.getDomain(n,"xValue","key",i),c=t.resolveColumnNeedsValueOf(n,"xValue",i),h=t.resolveColumnNeedsValueOf(n,s,i);if(o){const[d,u]=ci(e,l);return _k([d,u],a,r,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:o})}return U5(e,a,r,l,c,h)}function Z5(e,t,i,s,n,o,a){const r=t.resolveKeysById(n,"xValue",i),l=t.resolveColumnById(n,s,i),c=t.getDomain(n,"xValue","key",i),h=t.resolveColumnNeedsValueOf(n,"xValue",i),d=t.resolveColumnNeedsValueOf(n,s,i),[u,p]=ci(e,c);return $5([u,p],r,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:o,existingFilters:a})}var di=class extends ca{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Pl,this.shadow=new Ua,this.marker=new sn,this.label=new Qn,this.tooltip=Kh(),this.connectMissingData=!1}};g([m],di.prototype,"xKey",2),g([m],di.prototype,"xName",2),g([m],di.prototype,"yKey",2),g([m],di.prototype,"yName",2),g([m],di.prototype,"selectedKey",2),g([m],di.prototype,"stackGroup",2),g([m],di.prototype,"normalizedTo",2),g([m],di.prototype,"fill",2),g([m],di.prototype,"fillOpacity",2),g([m],di.prototype,"stroke",2),g([m],di.prototype,"strokeWidth",2),g([m],di.prototype,"strokeOpacity",2),g([m],di.prototype,"lineDash",2),g([m],di.prototype,"lineDashOffset",2),g([m],di.prototype,"interpolation",2),g([m],di.prototype,"styler",2),g([m],di.prototype,"shadow",2),g([m],di.prototype,"marker",2),g([m],di.prototype,"label",2),g([m],di.prototype,"tooltip",2),g([m],di.prototype,"connectMissingData",2);var Hk=class extends dc{constructor(e){super({moduleCtx:e,propertyKeys:pp,propertyNames:gp,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,pickModes:[2,0],animationResetFns:{path:vk({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:$h,datum:(t,i)=>({..._b(t),...Zf(t,i)})},clipFocusBox:!1}),this.properties=new di,this.connectsToYAxis=!0,this.aggregationManager=new Kb,this.backgroundGroup=new Le({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0,this.fillSpans=[],this.phantomSpans=[],this.strokeSpans=[]}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){const e=(this.contextNodeData?.nodeData?.length??0)>0;return super.renderToOffscreenCanvas()||e&&this.getDrawingMode(!1)==="cutout"||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>ak||this.contextNodeData.strokeData.spans.length>ak)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.backgroundGroup.remove()}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){e.remove(),t.remove()}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}isNormalized(){return this.properties.normalizedTo!=null}setSeriesIndex(e){const i=this.isStacked()===this._isStacked;return this._isStacked=i,super.setSeriesIndex(e,i)}setZIndex(e){super.setZIndex(e),this.isStacked()?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1])}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:o,yKey:a,selectedKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),d=this.axes.x?.scale,u=this.axes.y?.scale,{xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:d,yScale:u}),y=n>1||c!=null,x={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},b={invalidValue:null};(vt(c)||l)&&n>1&&(b.invalidValue=0),i||(b.forceValue=0);const v=this.properties.allowNullKeys??!1,S=[ql(o,p,{id:"xValue",allowNullKey:v}),Vt(a,f,{id:"yValueRaw",...b}),...r==null?[]:[Vt(r,"category",{id:"selectedRaw"})]];y&&S.push(...Sh(a,"normal",{id:"yValueCumulative",...b,groupId:x.marker},f)),vt(c)&&S.push(Vt(a,f,{id:"yValue",...b,groupId:x.value}),ab(Object.values(x),c)),h&&S.push(bf());const{dataModel:M,processedData:D}=await this.requestDataModel(e,t,{props:S,groupByKeys:y,groupByData:!y});this.aggregateData(M,D),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:s}=this;if(!t||!i)return{domain:[]};const n=s.y;if(e==="x"){const a=t.resolveProcessedDataDefById(this,"xValue"),r=t.getDomain(this,"xValue","key",i);return a?.def.type==="key"&&a.def.valueType==="category"?r:{domain:vn(Qo(r.domain))}}const o=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(n instanceof eo&&!(n instanceof xp)){const a=Number.isFinite(o[1]-o[0])?[Math.min(o[0],0),Math.max(o[1],0)]:[];return{domain:vn(a)}}else return{domain:vn(o)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t);return[Math.min(i,0),Math.max(s,0)]}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),Co(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>Z5(i.scale.type,e,t,this.yCumulativeKey(t),this,s,o),computeFull:o=>Y5(i.scale.type,e,t,this.yCumulativeKey(t),this,o),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&yo.record(`${this.type}:aggregation`,n.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}stackAggregatedData(e){const{indices:t,metaIndices:i}=e,{visible:s,axes:n,dataModel:o,processedData:a,seriesBelowStackContext:r}=this,l=n.x,c=n.y;if(!s)return this.phantomSpans=[],this.fillSpans=[],this.strokeSpans=[],r;if(l==null||c==null||o==null||a==null)return;const{scale:h}=l,{scale:d}=c,u=(h.bandwidth??0)/2,p=!this.isStacked()&&this.properties.connectMissingData,f=a.invalidData?.get(this.id),y=o.resolveKeysById(this,"xValue",a),x=o.resolveColumnById(this,this.yCumulativeKey(a),a);let[b,v]=vf(1,i.length-1,l.range,k=>{const A=i[k],w=i[k+1],C=t[A],T=t[w],O=y[C],V=y[T],{0:z}=this.xCoordinateRange(O,0),{1:R}=this.xCoordinateRange(V,0);return[z,R]});b=Math.max(b-1,0),v=Math.min(v+1,i.length-1);let S=[];if(r?.fillSpans)S=r?.fillSpans;else for(let k=b;kY.point),_={span:{type:"multi-line",moveTo:!1,x0:R.point.x,y0:R.point.y,x1:B.point.x,y1:B.point.y,midPoints:G},xValue0:R.xDatum,xValue1:B.xDatum,yValue0:R.yDatum,yValue1:B.yDatum};M.push(_),D.push(_)}return this.fillSpans=M,this.strokeSpans=D,{stack:[],fillSpans:M,strokeSpans:D}}hasInvalidDatumsInRange(e,t,i,s){const n=Math.min(i,s),o=Math.max(i,s);for(let a=n;a<=o;a++){if(e?.[a])return!0;const r=t[a];if(!Number.isFinite(r))return!0}return!1}stackYValueData(){const{visible:e,axes:t,dataModel:i,processedData:s,seriesBelowStackContext:n,properties:o}=this,a=t.x,r=t.y;if(a==null||r==null||i==null||s==null)return;const{interpolation:l}=o,{scale:c}=a,{scale:h}=r,d=(c.bandwidth??0)/2;let u=i.resolveKeysById(this,"xValue",s),p=i.resolveColumnById(this,this.yValueKey(),s);const f=!this.isStacked()&&this.properties.connectMissingData,y=s.invalidKeys?.get(this.id),b=(f?s.invalidData?.get(this.id):void 0)??y;b!=null&&(u=u.filter((T,O)=>b[O]===!1),p=p.filter((T,O)=>b[O]===!1));let[v,S]=vf(1,u.length,a.range,T=>this.xCoordinateRange(u[T],0));v=Math.max(v-2,0),S=Math.min(S+2,u.length);let M;if(n?.fillSpans)M=n?.fillSpans;else{const T=[];for(let O=v;O0,crossFiltering:this.properties.selectedKey!=null,styles:jb(this,this.properties,this.properties.marker),segments:void 0}}assembleResult(e,t){return t.segments=Ob(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene,!1),t}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t,i],visible:s,animationEnabled:n}=e,o=this.contextNodeData?.segments,a=ce(this.getHighlightStyle(),this.getStyle()),{strokeWidth:r,stroke:l,strokeOpacity:c,lineDash:h,lineDashOffset:d,fill:u,fillOpacity:p,opacity:f}=a;i.setProperties({segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:l,strokeWidth:r,strokeOpacity:c,lineDash:h,lineDashOffset:d,opacity:f,visible:s||n}),i.datum=o,t.setStyleProperties({fill:u,stroke:void 0,fillOpacity:p},this.getShapeFillBBox()),t.setProperties({segments:o,lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:f,visible:s||n}),t.datum=o,Wb(this,i),Wb(this,t)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),KP(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),hk(s,i),s.markDirty("AreaSeries")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{contextNodeData:s,processedData:n,axes:o,properties:a}=this,{marker:r,styler:l}=a,c=l?this.getStyle().marker:void 0,h=s?.crossFiltering===!0||yk(n.input.count,o.x.scale,r,c);r.isDirty()&&(i.clear(),i.cleanup());const d=h?t:[];return Co(this.processedData)?i.update(d,void 0,u=>us(u.xValue)):i.update(d)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();t.each((o,a)=>{if(!t.isGarbage(o)){const r=this.getHighlightState(n,e.isHighlight,a.datumIndex),l=this.getStyle(r),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,a.datumIndex,l.marker);a.style=this.getMarkerStyle(s,a,u,{isHighlight:i,highlightState:r},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,n=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),a=this.getDrawingMode(s,e.drawingMode);i.each((r,l)=>{const c=this.getHighlightState(o,s,l.datumIndex),h=l.style??t.styles[c];this.applyMarkerStyle(h,r,l.point,n,{selected:l.selected}),r.drawingMode=this.resolveMarkerDrawingModeForState(a,h)}),s||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((n,o)=>{const a=Wh(this,o,s,this.properties.label,t,i),{enabled:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=a;r&&o?.labelText?(n.fontStyle=l,n.fontWeight=c,n.fontSize=h,n.fontFamily=d,n.textAlign="center",n.textBaseline="bottom",n.text=o.labelText,n.x=o.x,n.y=o.y-10,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(t,o.datumIndex).opacity??1,n.setBoxing(a)):n.visible=!1})}makeStylerParams(e){const{id:t}=this,{marker:i,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}=this.properties,u=Fu(e??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:u,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,seriesId:t,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yKey:d}}makeItemStylerParams(e,t,i,s){const{xKey:n,yKey:o}=this.properties,a=e.resolveKeysById(this,"xValue",t)[i],r=e.resolveColumnById(this,"yValueRaw",t)[i],l=e.getDomain(this,"xValue","key",t).domain,c=e.getDomain(this,this.yCumulativeKey(t),"value",t).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...cI(a,r,n,o,l,c),xValue:a,yValue:r,...s,fill:h}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h,legendItemName:d}=o,u=o.allowNullKeys??!1,p=n.x,f=n.y;if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data?.[e],x=i.resolveKeysById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValueRaw",s)[e];if(x===void 0&&!u)return;const v=this.getStyle(),S=this.makeItemStylerParams(i,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:y},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",x,y,a,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",b,y,l,d),missing:wh(b)}]},{seriesId:t,datum:y,title:c,xKey:a,xName:r,yKey:l,yName:c,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,marker:a}=this.getStyle(),r=!a.enabled||a.fill==null,l=r?e:a.fill;return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:a.size,shape:a.shape,fill:l,fillOpacity:r?i:a.fillOpacity,stroke:a.stroke}),enabled:a.enabled||n<=0},line:{enabled:!0,stroke:t,strokeOpacity:s,strokeWidth:n,lineDash:o}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:e,id:t,itemId:n,legendItemName:a,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??o??n},symbol:this.legendItemSymbol(),hideInLegend:!r}]}resetDatumAnimation(e){Hb([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),xk(this,o,...n),qi([t],Zf),mk(this,o,{...this.getAnimationDrawingModes(),phase:"initial"},t),ei(this,"labels",o,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:o,previousContextData:a}=e,[r,l]=o;if(n.visible===!1&&a?.visible===!1||r==null&&l==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(o,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||a==null){c(),Yf(this,t,"added",this.getAnimationDrawingModes(),i),bk(this,"fill_path_properties",t,"add",r),bk(this,"stroke_path_properties",t,"add",l),ei(this,"labels",t,s);return}if(n.crossFiltering!==a.crossFiltering){h();return}const d=i5(n,a);if(d===void 0){h();return}else if(d.status==="no-op")return;Yf(this,t,void 0,this.getAnimationDrawingModes(),i),mi(this.id,"fill_path_properties",t,[r],d.fill.pathProperties),Ub(this.id,"fill_path_update",t,[r],d.fill.path),mi(this.id,"stroke_path_properties",t,[l],d.stroke.pathProperties),Ub(this.id,"stroke_path_update",t,[l],d.stroke.path),ei(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Ni}getStyle(e){const{styler:t,marker:i,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,stroke:r,strokeOpacity:l,strokeWidth:c}=this.properties,{size:h,shape:d,fill:u="transparent",fillOpacity:p}=i;let f={};if(t){const y=this.makeStylerParams(e),x=this.cachedCallWithContext(t,y)??{};f=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],x,{pick:!1})??{}}return f.marker??(f.marker={}),{fill:f.fill??s,fillOpacity:f.fillOpacity??n,lineDash:f.lineDash??o,lineDashOffset:f.lineDashOffset??a,stroke:f.stroke??r,strokeOpacity:f.strokeOpacity??l,strokeWidth:f.strokeWidth??c,marker:{enabled:f.marker.enabled??i.enabled,fill:f.marker.fill??u,fillOpacity:f.marker.fillOpacity??p,shape:f.marker.shape??d,size:f.marker.size??h,lineDash:f.marker.lineDash??i.lineDash??o,lineDashOffset:f.marker.lineDashOffset??i.lineDashOffset??a,stroke:f.marker.stroke??i.stroke??r,strokeOpacity:f.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:f.marker.strokeWidth??i.strokeWidth??c}}}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,t.marker);return this.getMarkerStyle(this.properties.marker,e,i,{isHighlight:!0},void 0,t)}isPointInArea(e,t){let i;for(const s of this.backgroundGroup.children())if(s instanceof wi){i=s;break}return i?.getBBox().containsPoint(e,t)?i.isPointInPath(e,t):!1}computeFocusBounds(e){return Gb(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Hk.className="AreaSeries",Hk.type="area";var X5={series:{nodeClickRange:"nearest",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Na,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["pattern",tt]]},stroke:{$palette:"stroke"}},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Kd,segmentation:Tl}},Gk={type:"series",name:"area",chartType:"cartesian",stackable:!0,version:de,dependencies:[hi],options:zI,predictAxis:Bf,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:X5,create:e=>new Hk(e)},q5=.001,jk=class extends Ci{constructor(){super(...arguments),this.direction="x",this.featherRatio=0}setStaticProperties(e,t,i,s,n,o,a,r,l,c){this.__direction=l??"x",this.__featherRatio=c??0,super.setStaticProperties(e,t,i,s,n,o,a,r)}get feathered(){return Math.abs(this.featherRatio)>q5}isPointInPath(e,t){return this.feathered?this.getBBox().containsPoint(e,t):super.isPointInPath(e,t)}updatePath(){if(!this.feathered){super.updatePath();return}const{path:e,borderPath:t,__direction:i,__featherRatio:s,__x:n,__y:o,__width:a,__height:r}=this;if(e.clear(),t.clear(),i==="x"){const l=Math.abs(s)*a;s>0?(e.moveTo(n,o),e.lineTo(n+a-l,o),e.lineTo(n+a,o+r/2),e.lineTo(n+a-l,o+r),e.lineTo(n,o+r),e.closePath()):(e.moveTo(n+l,o),e.lineTo(n+a,o),e.lineTo(n+a,o+r),e.lineTo(n+l,o+r),e.lineTo(n,o+r/2),e.closePath())}else{const l=Math.abs(s)*r;s>0?(e.moveTo(n,o+l),e.lineTo(n+a/2,o),e.lineTo(n+a,o+l),e.lineTo(n+a,o+r),e.lineTo(n,o+r),e.closePath()):(e.moveTo(n,o),e.lineTo(n+a,o),e.lineTo(n+a,o+r-l),e.lineTo(n+a/2,o+r),e.lineTo(n,o+r-l),e.closePath())}}renderStroke(e){if(!this.feathered){super.renderStroke(e);return}const{__stroke:t,__strokeWidth:i,__lineDash:s,__lineDashOffset:n,__lineCap:o,__lineJoin:a,path:r}=this;if(t&&i){const{globalAlpha:l}=e;this.applyStrokeAndAlpha(e),e.lineWidth=i,s&&e.setLineDash(s),n&&(e.lineDashOffset=n),o&&(e.lineCap=o),a&&(e.lineJoin=a),e.stroke(r.getPath2D()),e.globalAlpha=l}}};g([Ee()],jk.prototype,"direction",2),g([Ee()],jk.prototype,"featherRatio",2);function Wk(e,t,i,s,n){if(t.lengthM.maxRange===d);let{indexData:p,valueData:f,negativeIndexData:y,negativeValueData:x}=La(t,s,i??s,o,a,d,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:u?.positiveIndexData,reuseValueData:u?.positiveValueData,reuseNegativeIndexData:u?.negativeIndexData,reuseNegativeValueData:u?.negativeValueData});if(!y||!x)throw new Error("Negative aggregation data missing in split mode");let b=Zo(d,p,u?.positiveIndices),v=Zo(d,y,u?.negativeIndices);const S=[{maxRange:d,positiveIndices:b,positiveIndexData:p,positiveValueData:f,negativeIndices:v,negativeIndexData:y,negativeValueData:x}];for(;d>64;){const M=d,D=Math.trunc(M/2),I=h?.find(w=>w.maxRange===D),k=Rl(p,f,M,{reuseIndexData:I?.positiveIndexData,reuseValueData:I?.positiveValueData}),A=Rl(y,x,M,{reuseIndexData:I?.negativeIndexData,reuseValueData:I?.negativeValueData});d=k.maxRange,p=k.indexData,f=k.valueData,b=k.midpointData??Zo(d,p,I?.positiveIndices),y=A.indexData,x=A.valueData,v=A.midpointData??Zo(d,y,I?.negativeIndices),S.push({maxRange:d,positiveIndices:b,positiveIndexData:p,positiveValueData:f,negativeIndices:v,negativeIndexData:y,negativeValueData:x})}return S.reverse(),S}function Q5(e,t,i,s,n){if(t.lengthD.maxRange===p),{indexData:y,valueData:x,negativeIndexData:b,negativeValueData:v}=La(t,s,i??s,o,a,p,{split:!0,xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:f?.positiveIndexData,reuseValueData:f?.positiveValueData,reuseNegativeIndexData:f?.negativeIndexData,reuseNegativeValueData:f?.negativeValueData});if(!b||!v)throw new Error("Negative aggregation data missing in split mode");const S={maxRange:p,positiveIndices:Zo(p,y,f?.positiveIndices),positiveIndexData:y,positiveValueData:x,negativeIndices:Zo(p,b,f?.negativeIndices),negativeIndexData:b,negativeValueData:v};function M(){return Wk([o,a],t,i,s,{smallestKeyInterval:r,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:d})?.filter(I=>I.maxRange!==p)??[]}return{immediate:[S],computeRemaining:M}}function J5(e,t,i,s,n,o,a,r){const[l,c]=ci(e,n);return Wk([l,c],t,i,s,{smallestKeyInterval:o,xNeedsValueOf:a,yNeedsValueOf:r})}var eZ=zr(J5);function tZ(e,t,i,s,n){const o=t.resolveKeysById(s,"xValue",i),a=t.hasColumnById(s,"yValue-start"),r=a?t.resolveColumnById(s,"yValue-start",i):void 0,l=a?t.resolveColumnById(s,"yValue-end",i):t.resolveColumnById(s,"yValue-raw",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,a?"yValue-end":"yValue-raw",i);if(n){const[u,p]=ci(e,c);return Wk([u,p],o,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:n})}return eZ(e,o,r,l,c,i.reduced?.smallestKeyInterval,h,d)}function iZ(e,t,i,s,n,o){const a=t.resolveKeysById(s,"xValue",i),r=t.hasColumnById(s,"yValue-start"),l=r?t.resolveColumnById(s,"yValue-start",i):void 0,c=r?t.resolveColumnById(s,"yValue-end",i):t.resolveColumnById(s,"yValue-raw",i),h=t.getDomain(s,"xValue","key",i),d=t.resolveColumnNeedsValueOf(s,"xValue",i),u=t.resolveColumnNeedsValueOf(s,r?"yValue-end":"yValue-raw",i),[p,f]=ci(e,h);return Q5([p,f],a,l,c,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:d,yNeedsValueOf:u,targetRange:n,existingFilters:o})}var $k=class extends Qn{constructor(){super(...arguments),this.placement="inside-center",this.spacing=0}};g([m],$k.prototype,"placement",2),g([m],$k.prototype,"spacing",2);var $t=class extends Hf{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new Ua,this.label=new $k,this.tooltip=Kh(),this.sparklineMode=!1}};g([m],$t.prototype,"xKey",2),g([m],$t.prototype,"xName",2),g([m],$t.prototype,"yKey",2),g([m],$t.prototype,"yName",2),g([m],$t.prototype,"yFilterKey",2),g([m],$t.prototype,"stackGroup",2),g([m],$t.prototype,"normalizedTo",2),g([m],$t.prototype,"fill",2),g([m],$t.prototype,"fillOpacity",2),g([m],$t.prototype,"stroke",2),g([m],$t.prototype,"strokeWidth",2),g([m],$t.prototype,"strokeOpacity",2),g([m],$t.prototype,"lineDash",2),g([m],$t.prototype,"lineDashOffset",2),g([m],$t.prototype,"cornerRadius",2),g([m],$t.prototype,"crisp",2),g([m],$t.prototype,"styler",2),g([m],$t.prototype,"itemStyler",2),g([m],$t.prototype,"simpleItemStyler",2),g([m],$t.prototype,"shadow",2),g([m],$t.prototype,"label",2),g([m],$t.prototype,"tooltip",2),g([m],$t.prototype,"sparklineMode",2);var Kk=class extends IP{constructor(e){super({moduleCtx:e,propertyKeys:pp,propertyNames:gp,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Uf,label:$h}}),this.properties=new $t,this.connectsToYAxis=!0,this.aggregationManager=new Kb,this.phantomGroup=this.contentGroup.appendChild(new Le({name:"phantom",zIndex:-1})),this.phantomSelection=yi.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new Le({name:`${this.internalId}-highlight-node`})),this.phantomHighlightSelection=yi.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:n}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:a}=this,l=(this.seriesGrouping?.stackCount??0)>1||n!=null,c=l,h=!this.ctx.animationManager.isSkipped(),d=this.getCategoryAxis()?.scale,u=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:f,yScaleType:y}=this.getScaleInformation({xScale:d,yScale:u}),x=this.visible?{}:{forceValue:0},b=this.properties.allowNullKeys??!1,v=[ql(t,f,{id:"xValue",allowNullKey:b}),Vt(i,y,{id:"yValue-raw",invalidValue:null,...x})],S=[];if(l){const I=`bar-stack-${o}-yValues`,k=`${I}-trailing`;S.push(I,k),v.push(...Sh(i,"normal",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:I,separateNegative:!0,...x},y),...Sh(i,"trailing",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:k,separateNegative:!0,...x},y))}if(s!=null&&(v.push(Vt(s,y,{id:"yFilterValue-raw",invalidValue:null,...x})),l)){const I=`bar-stack-${o}-yFilterValues`,k=`${I}-trailing`;S.push(I,k),v.push(...Sh(s,"normal",{id:"yFilterValue-end",rangeId:"yFilterValue-range",invalidValue:null,missingValue:0,groupId:I,separateNegative:!0,...x},y),...Sh(s,"trailing",{id:"yFilterValue-start",invalidValue:null,missingValue:0,groupId:k,separateNegative:!0,...x},y),u$(this.id,"yValue-raw","yFilterValue-raw"))}p&&v.push(M1,D1),je(n)&&v.push(ab(S,Math.abs(n))),this.needsDataModelDiff()&&this.processedData&&v.push(lb(this.id,this.processedData)),(h||!c)&&v.push(bf());const{dataModel:M,processedData:D}=await this.requestDataModel(e,a,{props:v,groupByKeys:c,groupByData:!c});this.aggregateData(M,D),this.smallestDataInterval=D.reduced?.smallestKeyInterval,this.largestDataInterval=D.reduced?.largestKeyInterval,this.animationState.transition("updateData")}yCumulativeKey(e){return e.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw"}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(i==null||t==null)return{domain:[]};if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return o?.def.type==="key"&&o.def.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}let s;if(t.reduced?.filteredValueExceedUnfiltered===!0)s=this.domainForClippedRange(e,["yFilterValue-end"],"xValue");else{const o=this.yCumulativeKey(i);s=this.domainForClippedRange(e,[o],"xValue");const a=i.hasColumnById(this,"yFilterValue-raw")?i.getDomain(this,"yFilterValue-raw","value",t).domain:void 0;a!=null&&(s=[Math.min(s[0],a[0]),Math.max(s[1],a[1])])}const n=this.getValueAxis();if(n instanceof eo&&!(n instanceof xp)){const o=Number.isFinite(s[1]-s[0])?[Math.min(0,s[0]),Math.max(0,s[1])]:[];return{domain:vn(o)}}else return{domain:vn(s)}}getSeriesRange(e,t){if((this.properties.direction==="horizontal"?"x":"y")!==e)return[];const s=this.yCumulativeKey(this.dataModel),[n,o]=this.domainForVisibleRange("y",[s],"xValue",t);return[Math.min(n,0),Math.max(o,0)]}getZoomRangeFittingItems(e,t,i){const s=this.yCumulativeKey(this.dataModel);return this.zoomFittingVisibleItems("xValue",[s],e,t,i)}getVisibleItems(e,t,i){const s=this.yCumulativeKey(this.dataModel);return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),Co(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>iZ(i.scale.type,e,t,this,s,o),computeFull:o=>tZ(i.scale.type,e,t,this,o),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&yo.record(`${this.type}:aggregation`,n.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources?.get(this.id);if(n==null)return;const o=e.scale,a=t.scale,r=Math.abs(o.range[1]-o.range[0]);this.aggregationManager.ensureLevelForRange(r);const l=this.aggregationManager.getFilterForRange(r),c=s.reduced?.filteredValueExceedUnfiltered??!1,h=i.hasColumnById(this,"yValue-start"),{label:d}=this.properties,u=this.canIncrementallyUpdateNodes(l!=null),{groupOffset:p,barOffset:f,barWidth:y}=this.getBarDimensions();let x,b,v;if(c)x=i.resolveColumnById(this,"yFilterValue-start",s),b=i.resolveColumnById(this,"yFilterValue-end",s),v=void 0;else{const S=i.hasColumnById(this,"yFilterValue-raw");x=h?i.resolveColumnById(this,"yValue-start",s):void 0,b=h?i.resolveColumnById(this,"yValue-end",s):void 0,v=S?i.resolveColumnById(this,"yFilterValue-raw",s):void 0}return{dataSource:n,rawData:n.data,xValues:i.resolveKeysById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValue-raw",s),yStartValues:x,yEndValues:b,yFilterValues:v,xScale:o,yScale:a,xAxis:e,yAxis:t,groupOffset:p,barOffset:f,barWidth:y,range:r,yReversed:t.isReversed(),bboxBottom:a.convert(0),labelSpacing:d.spacing+(typeof d.padding=="number"?d.padding:0),crisp:l==null&&(this.properties.crisp??$P(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval)),isStacked:h,filteredValueExceedUnfiltered:c,animationEnabled:!this.ctx.animationManager.isSkipped(),dataAggregationFilter:l,canIncrementallyUpdate:u,phantomNodes:u?this.contextNodeData.phantomNodeData??[]:[],nodes:u?this.contextNodeData.nodeData:[],labels:u?this.contextNodeData.labelData:[],nodeIndex:0,phantomIndex:0,barAlongX:this.getBarDirection()==="x",shouldFlipXY:this.shouldFlipXY(),xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,label:d,yDomain:this.getSeriesDomain("y").domain}}computeXPosition(e,t){const i=e.xScale.convert(e.xValues[t]);return Number.isFinite(i)?i+e.groupOffset+e.barOffset+this.getDatumOffset(t):Number.NaN}prepareNodeDatumState(e,t,i,s,n){if(!Number.isFinite(n))return;const o=e.xValues[i];if(o===void 0&&!this.properties.allowNullKeys)return;const a=e.dataSource?.data[i],r=e.yRawValues[i],l=e.yFilterValues==null?void 0:Number(e.yFilterValues[i]);if(l!=null&&!Number.isFinite(l))return;const c=e.label.enabled&&r!=null?this.getLabelText(l??r,a,e.yKey,"y",e.yDomain,e.label,{datum:a,value:l??r,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0,h=r>=0&&!Object.is(r,-0);return t.datum=a,t.xValue=o,t.yRawValue=r,t.yFilterValue=l,t.labelText=c,t.inset=l!=null&&l>r,t.isPositive=h,t.precomputedBottomY=l==null?void 0:e.yScale.convert(s),t.precomputedIsUpward=l==null?void 0:h!==e.yReversed,t}createSkeletonNodeDatum(e,t,i){const s=t.nodeDatumScratch;return{series:this,datum:s.datum,datumIndex:t.datumIndex,cumulativeValue:0,phantom:i,xValue:s.xValue??"",yValue:0,yKey:e.yKey,xKey:e.xKey,capDefaults:{lengthRatioMultiplier:0,lengthMax:0},x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},opacity:t.opacity,featherRatio:t.featherRatio,topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,clipBBox:void 0,crisp:e.crisp,label:void 0,missing:!1,focusable:!i}}createNodeDatum(e,t){const i=this.prepareNodeDatumState(e,t.nodeDatumScratch,t.datumIndex,t.yStart,t.yEnd);if(!i)return{nodeData:void 0,phantomNodeData:void 0};const s=this.createSkeletonNodeDatum(e,t,!1);this.updateNodeDatum(e,s,t,i);let n;return i.yFilterValue!=null&&(n=this.createSkeletonNodeDatum(e,t,!0),this.updateNodeDatum(e,n,t)),{nodeData:s,phantomNodeData:n}}updateNodeDatum(e,t,i,s){if(s??(s=this.prepareNodeDatumState(e,i.nodeDatumScratch,i.datumIndex,i.yStart,i.yEnd)),!s)return;const n=t,o=t.phantom,a=i.yStart,r=o?s.yFilterValue:s.yFilterValue??s.yRawValue,l=o?s.yFilterValue:s.yFilterValue??i.yEnd,c=o?void 0:s.labelText;let h;o||s.yFilterValue==null?h=i.yEnd:h=i.yStart+s.yFilterValue;let d;o?d=i.yRange:d=Math.max(i.yStart+(s.yFilterValue??-1/0),i.yRange);let u;o?u=void 0:s.inset?u=.6:u=void 0;const p=s.precomputedIsUpward??s.isPositive!==e.yReversed,f=e.yScale.convert(h),y=s.precomputedBottomY??e.yScale.convert(a),x=e.yScale.convert(d),b=i.width*.5*(1-(u??1)),v=e.barAlongX?Math.min(f,y):i.x+b,S=e.barAlongX?i.x+b:Math.min(f,y),M=e.barAlongX?Math.abs(y-f):i.width*(u??1),D=e.barAlongX?i.width*(u??1):Math.abs(y-f),I=e.barAlongX?Math.min(e.bboxBottom,x):i.x+b,k=e.barAlongX?i.x+b:Math.min(e.bboxBottom,x),A=e.barAlongX?Math.abs(e.bboxBottom-x):i.width*(u??1),w=e.barAlongX?i.width*(u??1):Math.abs(e.bboxBottom-x);n.datum=s.datum,n.datumIndex=i.datumIndex,n.cumulativeValue=l,n.xValue=s.xValue,n.yValue=r,n.x=I,n.y=k,n.width=A,n.height=w;const C=n.midPoint;C.x=v+M/2,C.y=S+D/2;const T=e.shouldFlipXY?D:M;n.capDefaults.lengthRatioMultiplier=T,n.capDefaults.lengthMax=T,n.opacity=i.opacity,n.featherRatio=i.featherRatio,n.topLeftCornerRadius=e.barAlongX!==p,n.topRightCornerRadius=p,n.bottomRightCornerRadius=e.barAlongX===p,n.bottomLeftCornerRadius=!p;const O=n.clipBBox;if(O?(O.x=v,O.y=S,O.width=M,O.height=D):n.clipBBox=new re(v,S,M,D),n.crisp=e.crisp,c==null)n.label=void 0;else{const V=yP({isUpward:p,isVertical:!e.barAlongX,placement:e.label.placement,spacing:e.labelSpacing,rect:{x:v,y:S,width:M,height:D}}),z=n.label;z?(z.text=c,z.x=V.x,z.y=V.y,z.textAlign=V.textAlign,z.textBaseline=V.textBaseline):n.label={text:c,...V}}n.missing=wh(r)}createNodeDataWithAggregation(e,t,i){const s=e.yReversed?-1:1;for(let n=0;n<2;n+=1){const o=n===0,a=o?e.dataAggregationFilter.positiveIndices:e.dataAggregationFilter.negativeIndices,r=o?e.dataAggregationFilter.positiveIndexData:e.dataAggregationFilter.negativeIndexData,l=o?qs:Qs,c=o?Qs:qs,h=this.visibleRangeIndices("xValue",e.xAxis.range,a),d=h[0],u=h[1];for(let p=d;pe.range)continue;const D=Math.abs(x-y)+1,I=na.is(e.xScale)?Math.min(e.xScale.bandwidth*Math.max(D-1,1)/(e.xScale.step*D),1):1;if(i.datumIndex=v,i.x=S,i.width=M,i.opacity=I,e.isStacked)i.yStart=Number(e.yStartValues[b]),i.yEnd=Number(e.yEndValues[v]),i.featherRatio=0;else{const k=Number(e.yRawValues[v]),A=Number(e.yRawValues[b]);i.yStart=0,i.yEnd=k,i.featherRatio=(o?1:-1)*s*(1-A/k)}i.yRange=i.yEnd,this.upsertNodeDatum(e,i)}}}createNodeDataGrouped(e,t,i){const s=this.processedData,n=s.invalidData?.get(this.id),o=e.barWidth;let a;e.filteredValueExceedUnfiltered?a=this.dataModel.resolveProcessedDataIndexById(this,"yFilterValue-range"):e.isStacked?a=this.dataModel.resolveProcessedDataIndexById(this,"yValue-range"):a=-1;const r=s.columnScopes.findIndex(u=>u.has(this.id)),l=s.groups,c=vf(1,l.length,e.xAxis.range,u=>{const f=l[u].keys[0];return this.xCoordinateRange(f)}),h=c[0],d=c[1];for(let u=h;u=0&&!Object.is(S,-0),D=e.isStacked?Number(e.yStartValues?.[b]):0,I=e.isStacked?Number(e.yEndValues?.[b]):S;let k=I;e.isStacked&&(k=f[a][M?1:0]),i.datumIndex=b,i.x=v,i.width=o,i.yStart=D,i.yEnd=I,i.yRange=k,i.featherRatio=0,i.opacity=1,this.upsertNodeDatum(e,i)}}}createNodeDataSimple(e,t,i){const s=this.processedData.invalidData?.get(this.id),n=e.barWidth,o=this.visibleRangeIndices("xValue",e.xAxis.range);let a=o[0],r=o[1];this.processedData.input.count<1e3&&(a=0,r=this.processedData.input.count);for(let l=a;l=e.labels.length&&e.labels.push(o);else{const r=this.createNodeDatum(e,t);r.nodeData&&(e.nodes.push(r.nodeData),e.labels.push(r.nodeData)),a=r.phantomNodeData}if(e.nodeIndex++,!s)return{nodeData:e.nodes[e.nodeIndex]};if(n)a=e.phantomNodes[e.phantomIndex],this.updateNodeDatum(e,a,t);else if(a)e.phantomNodes.push(a);else{const r=this.createNodeDatum(e,t);r.phantomNodeData&&e.phantomNodes.push(r.phantomNodeData)}return e.phantomIndex++,{nodeData:o,phantomNodeData:a}}populateNodeData(e){const t=s=>this.computeXPosition(e,s),i={nodeDatumScratch:{datum:void 0,xValue:void 0,yRawValue:0,yFilterValue:void 0,labelText:void 0,inset:!1,isPositive:!1,precomputedBottomY:void 0,precomputedIsUpward:void 0},datumIndex:0,x:0,width:0,yStart:0,yEnd:0,yRange:0,featherRatio:0,opacity:1};e.dataAggregationFilter!=null?this.createNodeDataWithAggregation(e,t,i):this.processedData.type==="grouped"?this.createNodeDataGrouped(e,t,i):this.createNodeDataSimple(e,t,i)}initializeResult(e){return{itemId:this.properties.yKey,nodeData:e.nodes,phantomNodeData:e.phantomNodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),styles:dI(this.getItemStyle.bind(this)),segments:void 0}}finalizeNodeData(e){e.canIncrementallyUpdate&&(this.trimIncrementalNodeArray(e.nodes,e.nodeIndex),this.trimIncrementalNodeArray(e.phantomNodes,e.phantomIndex),this.trimIncrementalNodeArray(e.labels,e.nodes.length))}assembleResult(e,t){return t.segments=Ob(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene),t}nodeFactory(){return new jk}updateSeriesSelections(){super.updateSeriesSelections(),this.phantomSelection=this.updateDatumSelection({nodeData:this.contextNodeData?.phantomNodeData??[],datumSelection:this.phantomSelection})}updateHighlightSelectionItem(e){const t=super.updateHighlightSelectionItem(e),i=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(i)&&i?.datum?i:void 0;return this.phantomHighlightSelection=this.updateDatumSelection({nodeData:n?this.getHighlightData(this.contextNodeData?.phantomNodeData??[],n)??[]:[],datumSelection:this.phantomHighlightSelection}),t}updateNodes(e,t){super.updateNodes(e,t),this.updateDatumNodes({datumSelection:this.phantomSelection,isHighlight:!1,drawingMode:"overlay"}),this.updateDatumNodes({datumSelection:this.phantomHighlightSelection,isHighlight:!0,drawingMode:"overlay"})}getHighlightData(e,t){const i=e.find(s=>s.datum===t.datum);return i==null?void 0:[{...i}]}updateDatumSelection(e){return Co(this.processedData)?e.datumSelection.update(e.nodeData,void 0,this.getDatumId.bind(this)):e.datumSelection.update(e.nodeData)}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,stackGroup:r,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}=this.properties,p=Fu(e??0);return{cornerRadius:i,fill:s,fillOpacity:n,highlightState:p,lineDash:o,lineDashOffset:a,seriesId:t,stackGroup:r,stroke:l,strokeOpacity:c,strokeWidth:h,xKey:d,yKey:u}}makeItemStylerParams(e,t,i,s,n,o){const{id:a}=this,{xKey:r,yKey:l,stackGroup:c}=this.properties,h=t.dataSources.get(a)?.data?.[i],d=e.resolveColumnById(this,"yValue-raw",t)[i],u=e.getDomain(this,"xValue","key",t).domain,p=e.getDomain(this,this.yCumulativeKey(e),"value",t).domain,f=this.ctx.highlightManager?.getActiveHighlight(),y=this.getHighlightStateString(f,n,i),x=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:a,...cI(s,d,r,l,u,p),datum:h,xValue:s,yValue:d,stackGroup:c,highlightState:y,...o,fill:x}}getStyle(e,t){const{cornerRadius:i,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,stroke:r,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!e&&h){const u=this.makeStylerParams(t);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,u)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??s,fillOpacity:d.fillOpacity??n,lineDash:d.lineDash??o,lineDashOffset:d.lineDashOffset??a,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}getItemStyle(e,t,i){const{properties:s,dataModel:n,processedData:o}=this,{itemStyler:a,simpleItemStyler:r}=s,l=this.getHighlightStyle(t,e,i);if(r&&o!=null&&e!=null){const h=o.dataSources.get(this.id)?.data?.[e],d=r(h);return ce(d,l,this.getStyle(!1,i))}let c=ce(l,this.getStyle(e===void 0,i));if(a&&n!=null&&o!=null&&e!=null){const h=n.resolveKeysById(this,"xValue",o)[e],d=this.cachedDatumCallback(us(this.getDatumId({xValue:h,phantom:!1}),t?"highlight":"node"),()=>{const u=this.makeItemStylerParams(n,o,e,h,t,c);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(a,u))});d&&(c=ce(d,c))}return c}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight(),i=this;function s(n,o){if(!e.datumSelection.isGarbage(n)){const a=i.getHighlightState(t,e.isHighlight,o.datumIndex);o.style=i.getItemStyle(o.datumIndex,e.isHighlight,a)}}e.datumSelection.each(s)}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getCategoryDirection()==="x",o=this.getShapeFillBBox(),a=this.getBarDirection(),{drawingMode:r,isHighlight:l}=e,c=this,h=t.styles;function d(u,p){const f=p.style??h[c.getHighlightState(i,l,p.datumIndex)];u.setStyleProperties(f,o);const y=f.cornerRadius??0,x=n?(p.clipBBox?.width??p.width)>0:(p.clipBBox?.height??p.height)>0;u.setStaticProperties(r,p.topLeftCornerRadius?y:0,p.topRightCornerRadius?y:0,p.bottomRightCornerRadius?y:0,p.bottomLeftCornerRadius?y:0,x,p.crisp,s,a,p.featherRatio)}e.datumSelection.each(d)}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=1})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yKey,legendItemName:this.properties.legendItemName??this.properties.xName??this.properties.xKey},s=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((n,o)=>{n.fillOpacity=this.getHighlightStyle(t,o?.datumIndex).opacity??1,mP(this,n,i,this.properties.label,o.label,t,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,tooltip:d}=n,u=n.allowNullKeys??!1,p=this.getCategoryAxis(),f=this.getValueAxis();if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data?.[e],x=i.resolveKeysById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValue-raw",s)[e];if(x===void 0&&!u)return;const v=this.getItemStyle(e,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",x,y,o,c,u),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(f,"tooltip",b,y,r,c),missing:wh(b)}]},{seriesId:t,datum:y,title:l,xKey:o,xName:a,yKey:r,yName:l,legendItemName:c,stackGroup:h,...v,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.getStyle(!1,0);return{marker:{fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{showInLegend:t}=this.properties;if(e!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:o,yName:a,legendItemName:r}=this.properties;return[{legendType:"category",id:i,itemId:o,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:o}),label:{text:r??a??o},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!t}]}resetDatumAnimation(e){Fb([e.datumSelection,this.phantomSelection])}animateReadyHighlight(e){Fb([e,this.phantomHighlightSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const{phantomSelection:s}=this,n=Kf($f(this.isVertical(),this.axes,"normal"),"unknown");mi(this.id,"nodes",this.ctx.animationManager,[e,s],n),ei(this,"labels",this.ctx.animationManager,t),ei(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{phantomSelection:t}=this,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:o,previousContextData:a}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const r=YP(this.id,i,this.getDatumId.bind(this),e.contextData,a,this.processedData,this.processedDataUpdated),l=a==null?"fade":"normal",c=Kf($f(this.isVertical(),this.axes,l),"added");mi(this.id,"nodes",this.ctx.animationManager,[i,t],c,(h,d)=>this.getDatumId(d),r),(!r||r?.changed||!ia(o.groupScale,a?.groupScale))&&(ei(this,"labels",this.ctx.animationManager,s),ei(this,"annotations",this.ctx.animationManager,...n))}getDatumId(e){return us(e.xValue,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return pk(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.simpleItemStyler!=null||this.properties.label.itemStyler!=null}};Kk.className="BarSeries",Kk.type="bar";var sZ={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{...Ye,padding:{$isUserOption:["./spacing",0,8]},enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Na,xOffset:3,yOffset:3,blur:5},highlight:Ys,segmentation:Tl}},tv={type:"series",name:"bar",chartType:"cartesian",stackable:!0,groupable:!0,version:de,dependencies:[hi],options:sp,predictAxis:Bf,defaultAxes:$d,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:sZ,create:e=>new Kk(e)},iv=3,nZ=5,kE=.05;function oZ(e,t,i){const{xValues:s,yValues:n,xDomain:o,yDomain:a,xNeedsValueOf:r,yNeedsValueOf:l}=e,{x0:c,y0:h,x1:d,y1:u}=i;let p=0,f=1/0;const y=(c+d)/2,x=(h+u)/2;for(const b of t){const v=s[b],S=n[b];if(v==null||S==null)continue;const M=Wn(v,o.min,o.max,r),D=Wn(S,a.min,a.max,l),I=(M-y)**2+(D-x)**2;I=c&&b<=d&&v>=h&&v<=u&&(p+=1)}return p}function rZ(e,t,i){const{xValues:s,yValues:n,xDomain:o,yDomain:a,xNeedsValueOf:r,yNeedsValueOf:l}=e,{x0:c,y0:h,x1:d,y1:u}=i,p=[{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]},{x0:1,y0:1,x1:0,y1:0,indices:[]}],f=(c+d)/2,y=(h+u)/2;for(const b of t){const v=s[b],S=n[b];if(v==null||S==null)continue;const M=Wn(v,o.min,o.max,r),D=Wn(S,a.min,a.max,l),I=(M>f?1:0)+(D>y?2:0),k=p[I];k.indices.push(b),k.x0=Math.min(k.x0,M),k.y0=Math.min(k.y0,D),k.x1=Math.max(k.x1,M),k.y1=Math.max(k.y1,D)}const x=[];for(const b of p){const{indices:v,x0:S,x1:M,y0:D,y1:I}=b;if(v.length===0)continue;const k=Uk(e,v,{x0:S,y0:D,x1:M,y1:I});x.push(k)}return x}function Uk(e,t,i){const{x0:s,y0:n,x1:o,y1:a}=i;let l=t.lengthd){const b=Array.from({length:iv},()=>[]);for(let v=0;v=0&&DM),v=Uk(y,b,{x0:0,y0:0,x1:1,y1:1});v!=null&&x.push({sizeRatio:0,node:v})}return x.length>0?{xValues:i,yValues:s,xd0:r,xd1:l,yd0:c,yd1:h,filters:x,xNeedsValueOf:p,yNeedsValueOf:f}:void 0}function cZ(e,t,i,s,n,o,a,r,l,c){const[h,d]=ci(e,o),[u,p]=ci(t,a);return lZ([h,d],[u,p],i,s,n,[r[0],r[1]],{xNeedsValueOf:l,yNeedsValueOf:c})}function hZ(e,t,i,s,n,o,a){const r=i.resolveColumnById(a,"xValue",s),l=i.resolveColumnById(a,"yValue",s),c=o?i.resolveColumnById(a,"sizeValue",s):void 0,h=i.getDomain(a,"xValue","value",s),d=i.getDomain(a,"yValue","value",s),u=o?n.domain:[0,0],p=i.resolveColumnNeedsValueOf(a,"xValue",s),f=i.resolveColumnNeedsValueOf(a,"yValue",s);return cZ(e,t,r,l,c,h,d,u,p,f)}function AE(e,t,i,s,n,o){const{xRange:a,yRange:r,xVisibleRange:[l,c],yVisibleRange:[h,d],minSize:u,maxSize:p}=i,{xValues:f,yValues:y,xd0:x,xd1:b,yd0:v,yd1:S,xNeedsValueOf:M,yNeedsValueOf:D}=t,I=1/Math.min(a/(c-l),r/(d-h)),k={xValues:f,yValues:y,xDomain:{min:x,max:b},yDomain:{min:v,max:S},xNeedsValueOf:M,yNeedsValueOf:D};for(const{sizeRatio:A,node:w}of t.filters){const C=.5*(u+A*(p-u)),T=C*I,O=e*T,V=l-C/a,z=c+C/a,R=h-C/r,B=d+C/r,G=[w];for(;G.length>0;){const F=G.pop();if(!(F.x1z||F.y1B))if(e!==1&&F.scale<=O)s!=null&&(s.count+=1),n?.push({datumIndex:F.primaryDatumIndex,count:F.indices.length,area:(F.x1-F.x0)*(F.y1-F.y0),dilation:se(1,F.scale/T,e)});else if(F.children==null){const{indices:_}=F;if(s!=null){const Z=F.x0>=l&&F.x1<=c&&F.y0>=h&&F.y1<=d?_.length:aZ(k,_,{x0:l,y0:h,x1:c,y1:d});s.count+=Z}o?.push(..._)}else G.push(...F.children)}}}function sv(e,t,i){const s={count:0};return AE(e,t,i,s,void 0,void 0),s.count}var dZ=100,uZ=12;function pZ(e,t,i){if(sv(1,e,t)<=i)return 1;let s=1,n=2;for(;sv(n,e,t)>i&&ni?s=a:n=a}return(s+n)/2}function gZ(e,t,i){const s=[],n=[];return AE(e,t,i,void 0,s,n),{groupedAggregation:s,singleDatumIndices:n}}var Yk=class extends sn{constructor(){super(...arguments),this.maxSize=30}};g([m,K()],Yk.prototype,"maxSize",2),g([m,ku()],Yk.prototype,"domain",2);var wE=class extends Qn{constructor(){super(...arguments),this.placement="top"}};g([m],wE.prototype,"placement",2);var wt=class extends ca{constructor(){super(...arguments),this.label=new wE,this.tooltip=Kh(),this.maxRenderedItems=1/0,this.marker=new Yk}};g([m],wt.prototype,"xKey",2),g([m],wt.prototype,"yKey",2),g([m],wt.prototype,"sizeKey",2),g([m],wt.prototype,"labelKey",2),g([m],wt.prototype,"selectedKey",2),g([m],wt.prototype,"xName",2),g([m],wt.prototype,"yName",2),g([m],wt.prototype,"sizeName",2),g([m],wt.prototype,"labelName",2),g([m],wt.prototype,"title",2),g([Gt("marker.shape")],wt.prototype,"shape",2),g([Gt("marker.size")],wt.prototype,"size",2),g([Gt("marker.maxSize")],wt.prototype,"maxSize",2),g([Gt("marker.domain")],wt.prototype,"domain",2),g([Gt("marker.fill")],wt.prototype,"fill",2),g([Gt("marker.fillOpacity")],wt.prototype,"fillOpacity",2),g([Gt("marker.stroke")],wt.prototype,"stroke",2),g([Gt("marker.strokeWidth")],wt.prototype,"strokeWidth",2),g([Gt("marker.strokeOpacity")],wt.prototype,"strokeOpacity",2),g([Gt("marker.lineDash")],wt.prototype,"lineDash",2),g([Gt("marker.lineDashOffset")],wt.prototype,"lineDashOffset",2),g([Gt("marker.itemStyler")],wt.prototype,"itemStyler",2),g([m],wt.prototype,"styler",2),g([m],wt.prototype,"label",2),g([m],wt.prototype,"tooltip",2),g([m],wt.prototype,"maxRenderedItems",2);var fZ=class extends ok{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},nv=class extends dc{constructor(e){super({moduleCtx:e,propertyKeys:{...pp,label:["labelKey"],size:["sizeKey"]},propertyNames:{...gp,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],datumSelectionGarbageCollection:!1,animationResetFns:{label:$h,datum:_b},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=fZ,this.properties=new wt,this.dataAggregation=void 0,this.sizeScale=new jh,this.placedLabelData=[]}get pickModeAxis(){return"main-category"}get type(){return super.type}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),o=this.sizeScale.type,{xKey:a,yKey:r,sizeKey:l,selectedKey:c,labelKey:h,marker:d}=this.properties,u=this.properties.allowNullKeys??!1,{dataModel:p,processedData:f}=await this.requestDataModel(e,this.data,{props:[Vt(a,s,{id:"xValue",allowNullKey:u}),Vt(r,n,{id:"yValue",allowNullKey:u}),...c==null?[]:[Vt(c,"category",{id:"selectedValue"})],...l?[Vt(l,o,{id:"sizeValue"})]:[],...h?[Vt(h,"category",{id:"labelValue"})]:[]]}),y=l?p.resolveProcessedDataIndexById(this,"sizeValue"):void 0,x=d.domain?[d.domain[0],d.domain[1]]:void 0;this.sizeScale.domain=x??(y==null?void 0:f.domain.values[y])??[],this.dataAggregation=this.aggregateData(p,f),this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.x.scale.convert(e),l=a==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?o:n.convert(l[i]))*t;return[r-h,r+h]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:o,sizeKey:a}=s,r=this.axes.y.scale.convert(e[0]),l=a==null?void 0:this.dataModel.resolveColumnById(this,"sizeValue",this.processedData),h=.5*(l==null?o:n.convert(l[i]))*t;return[r-h,r+h]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};const s={x:"xValue",y:"yValue"},n=s[e],o=t.resolveProcessedDataDefById(this,n),a=t.getDomain(this,n,"value",i);if(o?.def.type==="value"&&o?.def.valueType==="category")return{domain:a.domain};const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l);return{domain:vn(Qo(c))}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){const{dataAggregation:s,axes:n}=this,o=n.x,a=n.y;if(s==null||o==null||a==null)return this.countVisibleItems("xValue",["yValue"],e,t,i);const r=this.aggregationOptions(o,a,e,t??[0,1]);return sv(0,s,r)}aggregateData(e,t){if(t.type==="grouped"||t.input.count<=this.properties.maxRenderedItems)return;const i=this.axes.x,s=this.axes.y;if(i==null||s==null)return;const n=i.scale,o=s.scale;if(!(!xt.is(n)||!xt.is(o)))return hZ(n.type,o.type,e,t,this.sizeScale,this.properties.sizeKey!=null,this)}aggregationOptions(e,t,i=e.visibleRange,s=t.visibleRange){const{processedData:n,dataModel:o}=this,{sizeKey:a}=this.properties,[r,l]=this.getSizeRange(),c=Math.abs(e.range[1]-e.range[0]),h=Math.abs(t.range[1]-t.range[0]),d=Math.max(r,1),u=a?Math.max(l,1):d,p=e.scale,f=t.scale;return n!=null&&o!=null&&(xt.is(p)&&(i=Zg(i,p.domain.map(Zi),o.getDomain(this,"xValue","value",n).domain.map(Zi))),xt.is(f)&&(s=Zg(s,f.domain.map(Zi),o.getDomain(this,"yValue","value",n).domain.map(Zi)))),{xRange:c,yRange:h,minSize:d,maxSize:u,xVisibleRange:i,yVisibleRange:s}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,sizeScale:n,visible:o}=this;if(!i||!s)return;const a=s.dataSources.get(this.id)?.data;if(a==null)return;const{xKey:r,yKey:l,sizeKey:c,selectedKey:h,labelKey:d,xName:u,yName:p,sizeName:f,labelName:y,label:x,legendItemName:b,marker:v}=this.properties,S=e.scale,M=t.scale,D=s.changeDescription!=null&&this.contextNodeData?.nodeData!=null;let I;d?I=[]:c?I=i.getDomain(this,"sizeValue","value",s).domain:I=[];const k=i.resolveColumnById(this,"xValue",s);return{xAxis:e,yAxis:t,rawData:a,xValues:k,xDataValues:k,yDataValues:i.resolveColumnById(this,"yValue",s),sizeDataValues:c==null?void 0:i.resolveColumnById(this,"sizeValue",s),labelDataValues:d==null?void 0:i.resolveColumnById(this,"labelValue",s),selectedDataValues:h==null?void 0:i.resolveColumnById(this,"selectedValue",s),xScale:S,yScale:M,sizeScale:n,xOffset:(S.bandwidth??0)/2,yOffset:(M.bandwidth??0)/2,xKey:r,yKey:l,sizeKey:c,labelKey:d,xName:u,yName:p,sizeName:f,labelName:y,legendItemName:b,labelsEnabled:x.enabled,labelPlacement:x.placement,labelAnchor:Ni.anchor(v.shape),labelTextDomain:I,labelPadding:_u(x),labelTextMeasurer:et(x),label:x,animationEnabled:!this.ctx.animationManager.isSkipped(),visible:o,canIncrementallyUpdate:D,nodes:D?this.contextNodeData.nodeData:[],nodeIndex:0}}populateNodeData(e){this.sizeScale.range=this.getSizeRange();const t={datum:void 0,xDatum:void 0,yDatum:void 0,sizeValue:void 0,x:0,y:0,selected:void 0,nodeLabel:{text:"",width:0,height:0},markerSize:0,count:1,dilation:1,area:0},{dataAggregation:i}=this;i==null?this.createNodeDataSimple(e,t):this.createNodeDataWithAggregation(e,t,e.xAxis,e.yAxis,i)}initializeResult(e){const{marker:t}=this.properties;return{itemId:e.yKey,nodeData:e.nodes,labelData:e.labelsEnabled?e.nodes:[],scales:this.calculateScaling(),visible:this.visible||e.animationEnabled,styles:jb(this,this.properties,t)}}upsertBubbleNodeDatum(e,t,i){this.prepareNodeDatumState(e,t,i)&&gk(e,{scratch:t,datumIndex:i},(s,n)=>{const o=this.createSkeletonNodeDatum(s,n.scratch,n.datumIndex);return this.updateNodeDatum(s,o,n.scratch,n.datumIndex),o},(s,n,o)=>this.updateNodeDatum(s,n,o.scratch,o.datumIndex))}createNodeDataSimple(e,t){const i=e.rawData.length;for(let s=0;sus(o.xValue,o.yValue,o.sizeValue,Oe(o.label.text))),i.update(t,void 0,n)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,sizeKey:o,labelKey:a,marker:r}=this.properties,l={xKey:s,yKey:n,sizeKey:o,labelKey:a},c=this.ctx.highlightManager.getActiveHighlight();t.each((h,d)=>{if(!t.isGarbage(h)){const u=this.getHighlightState(c,e.isHighlight,d.datumIndex),p=this.getStyle(u);d.style=this.getMarkerStyle(r,d,l,{isHighlight:i,highlightState:u,resolveMarkerSubPath:[]},p)}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s,drawingMode:n}=e;this.sizeScale.range=this.getSizeRange();const o=this.getShapeFillBBox(),a=this.dataAggregation!=null,r=this.ctx.highlightManager.getActiveHighlight();i.each((l,c,h)=>{const{point:{size:d},count:u,area:p,dilation:f}=c,y=this.getHighlightState(r,s,c.datumIndex),x={...c.style??t.styles[y]};if(x.size=d,f>1){const b=x.fillOpacity??0,v=.269669+683e-6*u+-37.534348*p+.004449*u*p+-0*u**2+44.428603*p**2;x.fillOpacity=se(b/f,b/.1*v,1)}this.applyMarkerStyle(x,l,c.point,o,{selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(n,x),l.zIndex=a?[-u,h]:0}),s||this.properties.marker.markClean()}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.updateHighlightLabelSelection()}updateHighlightLabelSelection(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=this.isSeriesHighlighted(e)&&e?.datum?e:void 0,i=t==null?[]:this.placedLabelData.filter(s=>s.datum.datumIndex===t.datumIndex).map(s=>({...s.datum,point:{x:s.x,y:s.y,size:s.datum.point.size}}));this.highlightLabelSelection=this.updateLabelSelection({labelData:i,labelSelection:this.highlightLabelSelection})??this.highlightLabelSelection,this.highlightLabelGroup.visible=i.length>0,this.highlightLabelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((n,o)=>{const a=Wh(this,o,s,this.properties.label,t,i);n.text=o.label.text,n.fill=a.color,n.x=o.point?.x??0,n.y=o.point?.y??0,n.fontStyle=a.fontStyle,n.fontWeight=a.fontWeight,n.fontSize=a.fontSize,n.fontFamily=a.fontFamily,n.textBaseline="top",n.fillOpacity=this.getHighlightStyle(t,o.datumIndex).opacity??1,n.setBoxing(a)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1})}makeStylerParams(e){const{id:t,properties:{size:i,maxSize:s,shape:n,fill:o,fillOpacity:a,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,sizeKey:f,labelKey:y}}=this,x=Fu(e??0);return this.type==="bubble"?{highlightState:x,size:i,maxSize:s,shape:n,fill:o,fillOpacity:a,lineDash:r,lineDashOffset:l,seriesId:t,sizeKey:f,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:y}:this.type==="scatter"?{highlightState:x,size:i,shape:n,fill:o,fillOpacity:a,lineDash:r,lineDashOffset:l,seriesId:t,stroke:c,strokeOpacity:h,strokeWidth:d,xKey:u,yKey:p,labelKey:y}:this.type}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:s,sizeKey:n,sizeName:o,labelKey:a,labelName:r,legendItemName:l}=this.properties;return{xKey:e,xName:t,yKey:i,yName:s,sizeKey:n,sizeName:o,labelKey:a,labelName:r,legendItemName:l}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o,ctx:a}=this,{formatManager:r}=a,{xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:f,labelName:y,title:x,tooltip:b,marker:v,legendItemName:S}=o,M=n.x,D=n.y;if(!i||!s||!M||!D)return;const I=s.dataSources.get(this.id)?.data?.[e],k=i.resolveColumnById(this,"xValue",s)[e],A=i.resolveColumnById(this,"yValue",s)[e],w=this.properties.allowNullKeys??!1;if(k===void 0&&!w)return;const C=[];if(this.isLabelEnabled()&&f!=null){const O=i.resolveColumnById(this,"labelValue",s)[e],V=r.format(this.callWithContext.bind(this),{type:"category",value:O,datum:I,seriesId:t,legendItemName:S,key:f,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});C.push({label:y,fallbackLabel:f,value:V??Ao(O)})}if(C.push({label:c,fallbackLabel:l,value:this.getAxisValueText(M,"tooltip",k,I,l,S,w),missing:wh(k,w)},{label:d,fallbackLabel:h,value:this.getAxisValueText(D,"tooltip",A,I,h,S,w),missing:wh(A,w)}),u!=null){const O=i.resolveColumnById(this,"sizeValue",s)[e];if(O!=null){const V=i.getDomain(this,"sizeValue","value",s).domain,z=r.format(this.callWithContext.bind(this),{type:"number",value:O,datum:I,seriesId:t,legendItemName:S,key:u,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:V,fractionDigits:void 0,visibleDomain:void 0});C.push({label:p,fallbackLabel:u,value:z??Ao(O)})}}const T=this.getMarkerStyle(v,{datum:I,datumIndex:e},{xKey:l,yKey:h,sizeKey:u,labelKey:f},{resolveMarkerSubPath:[]});return this.formatTooltipWithContext(b,{title:x,symbol:this.legendItemSymbol(),data:C},{seriesId:t,datum:I,title:h,xKey:l,xName:c,yKey:h,yName:d,sizeKey:u,sizeName:p,labelKey:f,labelName:y,legendItemName:S,...T,...this.getModuleTooltipParams()})}legendItemSymbol(){const e=this.getStyle();return{marker:this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1,resolveMarkerSubPath:[]},e)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:n,legendItemName:o,title:a,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:o??a??n??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!r}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){n5(this,this.ctx.animationManager,e),ei(this,"labels",this.ctx.animationManager,t)}resetDatumAnimation(e){Hb([e.datumSelection])}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new Ni}getStyle(e){const{properties:t}=this;let i={};if(t.styler){const s=this.makeStylerParams(e),n=this.cachedCallWithContext(t.styler,s)??{};i=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],n,{pick:!1})??{}}return{fill:i.fill??t.fill,fillOpacity:i.fillOpacity??t.fillOpacity,lineDash:i.lineDash??t.lineDash,lineDashOffset:i.lineDashOffset??t.lineDashOffset,shape:i.shape??t.shape,size:i.size??t.size,maxSize:i.maxSize??t.maxSize,stroke:i.stroke??t.stroke,strokeOpacity:i.strokeOpacity??t.strokeOpacity,strokeWidth:i.strokeWidth??t.strokeWidth}}getSizeRange(){const{size:e,maxSize:t}=this.getStyle();return[e,t]}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:n,marker:o}=this.properties;return this.getMarkerStyle(o,e,{xKey:t,yKey:i,sizeKey:s,labelKey:n},{resolveMarkerSubPath:[]})}computeFocusBounds(e){return Gb(this,e)}hasItemStylers(){const{styler:e,itemStyler:t,marker:i,label:s}=this.properties;return!!(e??t??i.itemStyler??s.itemStyler)}initQuadTree(e){Rb(e,this.datumNodesIter())}pickNodeDataClosestDatum(e){return zb(this,e)}};nv.className="BubbleSeries",nv.type="bubble";var mZ={series:{shape:"circle",size:7,maxSize:30,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Ys}},Zk={type:"series",name:"bubble",chartType:"cartesian",version:de,dependencies:[hi],options:QO,predictAxis:JI,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:mZ,create:e=>new nv(e)},Pi=class extends ca{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new Ua,this.label=new Qn,this.tooltip=Kh()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};g([m],Pi.prototype,"xKey",2),g([m],Pi.prototype,"yKey",2),g([m],Pi.prototype,"xName",2),g([m],Pi.prototype,"yName",2),g([m],Pi.prototype,"fill",2),g([m],Pi.prototype,"fillOpacity",2),g([m],Pi.prototype,"stroke",2),g([m],Pi.prototype,"strokeWidth",2),g([m],Pi.prototype,"strokeOpacity",2),g([m],Pi.prototype,"lineDash",2),g([m],Pi.prototype,"lineDashOffset",2),g([m],Pi.prototype,"cornerRadius",2),g([m],Pi.prototype,"areaPlot",2),g([m],Pi.prototype,"bins",2),g([m],Pi.prototype,"aggregation",2),g([m],Pi.prototype,"binCount",2),g([m],Pi.prototype,"shadow",2),g([m],Pi.prototype,"label",2),g([m],Pi.prototype,"tooltip",2);var CE=10,Xk=class extends dc{constructor(e){super({moduleCtx:e,propertyKeys:pp,propertyNames:gp,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!0,animationAlwaysPopulateNodeData:!0,alwaysClip:!0,animationResetFns:{datum:Uf,label:$h}}),this.properties=new Pi,this.calculatedBins=[]}get hasData(){return this.calculatedBins.length>0}deriveBins(e){const t=ah(e[0],e[1],CE).ticks,i=rh(e[0],e[1],CE),[s]=t,n=o=>[o,o+i];return[[s-i,s],...t.map(n)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],n=t||1,{start:o,binSize:a}=this.calculateNiceStart(i,s,n);return this.getBins(o,s,a,n)}getBins(e,t,i,s){const n=[],o=this.calculatePrecision(i);for(let a=0;a0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,n=Math.floor(Math.log10(s)),o=Math.pow(10,n);return{start:Math.floor(e/o)*o,binSize:s}}async processData(e){const{visible:t}=this,{xKey:i,yKey:s,areaPlot:n,aggregation:o}=this.properties,a=this.axes.x?.scale,r=this.axes.y?.scale,{xScaleType:l,yScaleType:c}=this.getScaleInformation({yScale:r,xScale:a}),h=t?{}:{forceValue:0},d=[ql(i,l),r$];if(s){let v=l1("groupAgg",{visible:t});o==="count"||(o==="sum"?v=I4("groupAgg",{visible:t}):o==="mean"&&(v=A4("groupAgg",{visible:t}))),n&&(v=c1("groupAgg",v)),d.push(Vt(s,c,{invalidValue:void 0,...h}),v)}else{d.push(s$("count"));let v=l1("groupAgg",{visible:t});n&&(v=c1("groupAgg",v)),d.push(v)}let u=[];const p=v=>{const S=vn(v.domain.keys[0]);if(S.length===0)return v.domain.groups=[],()=>[];const M=gt(this.properties.binCount)?this.calculateNiceBins(S,this.properties.binCount):this.properties.bins??this.deriveBins(S),D=M.length;return u=[...M],I=>{let k=I[0];if(Cs(k)&&(k=k.getTime()),!gt(k))return[];for(let A=0;A=w[0]&&k{const S=b.get(us(...v));if(S){const{group:M,groupIndex:D}=S,[[I,k]=[0,0]]=M.aggregation,A=[...f.forEachDatum(this,x,M,D)],w=this.frequency(M),C=I+k;return{domain:v,datum:A,groupIndex:D,frequency:w,total:C}}else return{domain:v,datum:[],groupIndex:-1,frequency:0,total:0}}),this.animationState.transition("updateData")}xCoordinateRange(){return[Number.NaN,Number.NaN]}yCoordinateRange(){return[Number.NaN,Number.NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return{domain:[]};const s=i.getDomain(this,"groupAgg","aggregate",t).domain,n=this.calculatedBins[0].domain[0],o=this.calculatedBins[(this.calculatedBins?.length??0)-1].domain[1];return e==="x"?{domain:vn([n,o])}:{domain:vn(s)}}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[Number.NaN,Number.NaN];const o=this.axes.x.scale,a=0;let r=-1/0;for(const{keys:l,aggregation:c}of n.groups){const[[h,d]=[0,0]]=c,[u,p]=l,[f,y]=kt([o.convert(u),o.convert(p)]);if(y>=t&&f<=i){const x=h+d;r=Math.max(r,x)}}return a>r?[Number.NaN,Number.NaN]:[a,r]}frequency(e){return e.datumIndices.reduce((t,i)=>t+i.length,0)}createNodeDatumContext(e,t){const{xKey:i,yKey:s,xName:n,yName:o,label:a}=this.properties,{contextNodeData:r,processedData:l}=this,c=r?.nodeData!=null&&l?.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:e.scale,yScale:t.scale,yAxisReversed:t.isReversed(),rawData:[],xValues:[],xKey:i,yKey:s,xName:n,yName:o,label:a,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:c,nodes:c?r.nodeData:[],nodeIndex:0}}createLabelData(e,t,i,s,n,o){const{label:a,yKey:r,xKey:l,xName:c,yName:h}=e,{total:d,datum:u}=t;if(!(!a.enabled||d===0))return{x:i+n/2,y:s+o/2,text:this.getLabelText(d,u,r,"y",[],a,{value:d,datum:u,xKey:l,yKey:r,xName:c,yName:h})}}createSkeletonNodeDatum(e,t){const{xKey:i,yKey:s}=e,{domain:n,datum:o,groupIndex:a,frequency:r,total:l}=t;return{series:this,datumIndex:a,datum:o,aggregatedValue:l,frequency:r,domain:n,yKey:s,xKey:i,x:0,y:0,xValue:0,yValue:0,width:0,height:0,midPoint:{x:0,y:0},topLeftCornerRadius:!1,topRightCornerRadius:!1,bottomRightCornerRadius:!1,bottomLeftCornerRadius:!1,label:void 0,crisp:!0}}updateNodeDatum(e,t,i){const{xScale:s,yScale:n,yAxisReversed:o}=e,{domain:a,datum:r,groupIndex:l,frequency:c,total:h}=i,d=t,[u,p]=a,f=s.convert(u),y=s.convert(p),x=n.convert(0),b=n.convert(h),v=Math.abs(y-f),S=Math.abs(b-x),M=Math.min(f,y),D=Math.min(x,b);d.datumIndex=l,d.datum=r,d.aggregatedValue=h,d.frequency=c,d.domain=a,d.x=M,d.y=D,d.xValue=f,d.yValue=b,d.width=v,d.height=S,d.midPoint?(d.midPoint.x=M+v/2,d.midPoint.y=D+S/2):d.midPoint={x:M+v/2,y:D+S/2},d.topLeftCornerRadius=!o,d.topRightCornerRadius=!o,d.bottomRightCornerRadius=o,d.bottomLeftCornerRadius=o,d.label=this.createLabelData(e,i,M,D,v,S)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}populateNodeData(e){const{processedData:t}=this;if(t?.type==="grouped")for(const i of this.calculatedBins)gk(e,i,(s,n)=>this.createNodeDatum(s,n),(s,n,o)=>this.updateNodeDatum(s,n,o))}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.nodes,scales:this.calculateScaling(),animationValid:!0,visible:this.visible||e.animationEnabled,styles:dI(this.getItemStyle.bind(this))}}finalizeNodeData(e){super.finalizeNodeData(e),e.nodes.sort((t,i)=>t.x-i.x)}nodeFactory(){return new Ci}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return Co(this.processedData)?i.update(t,void 0,s=>us(...s.domain)):i.update(t)}getItemStyle(e,t,i){const{properties:s}=this,n=this.getHighlightStyle(t,e,i);return ce(n,s.getStyle())}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e;t.each((s,n)=>{t.isGarbage(s)||(n.style=this.getItemStyle(n.datumIndex,i))})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const i=this.ctx.highlightManager.getActiveHighlight(),{shadow:s}=this.properties,n=this.getShapeFillBBox();e.datumSelection.each((o,a)=>{const r=a.style??t.styles[this.getHighlightState(i,e.isHighlight,a.datumIndex)],{cornerRadius:l=0}=r,{topLeftCornerRadius:c,topRightCornerRadius:h,bottomRightCornerRadius:d,bottomLeftCornerRadius:u}=a;o.setStyleProperties(r,n),o.topLeftCornerRadius=c?l:0,o.topRightCornerRadius=h?l:0,o.bottomRightCornerRadius=d?l:0,o.bottomLeftCornerRadius=u?l:0,o.crisp=a.crisp,o.fillShadow=s})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(e){const t=this.isLabelEnabled(),{isHighlight:i=!1}=e,s=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((n,o)=>{const a=Wh(this,o,this.properties,this.properties.label,i,s),{enabled:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=a;r&&t&&o?.label?(n.text=o.label.text,n.x=o.label.x,n.y=o.label.y,n.fontStyle=l,n.fontWeight=c,n.fontFamily=d,n.fontSize=h,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(i,o.datumIndex).opacity??1,n.setBoxing(a)):n.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof Le&&Rb(e,t.children())}pickNodeClosestDatum(e){return zb(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o,ctx:{localeManager:a}}=this,{xKey:r,xName:l,yKey:c,yName:h,tooltip:d,legendItemName:u}=o,p=n.x,f=n.y;if(!i||s?.type!=="grouped"||!p||!f)return;const y=s.groups[e],{aggregation:x,keys:b}=y,[[v,S]=[0,0]]=x,M=this.frequency(y),D=b,[I,k]=D,A=v+S,w={data:[...i.forEachDatum(this,s,y,e)],aggregatedValue:A,frequency:M,domain:D},C=[{label:l,fallbackLabel:r,value:`${this.getAxisValueText(p,"tooltip",I,w,r,u)} - ${this.getAxisValueText(p,"tooltip",k,w,r,u)}`},{label:a.t("seriesHistogramTooltipFrequency"),value:this.getAxisValueText(f,"tooltip",M,w,c,u)}];if(c!=null){let T;switch(o.aggregation){case"sum":T=a.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":T=a.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":T=a.t("seriesHistogramTooltipCount",{yName:h??c});break}C.push({label:T,value:this.getAxisValueText(f,"tooltip",A,w,c,u)})}return this.formatTooltipWithContext(d,{symbol:this.legendItemSymbol(),data:C},{seriesId:t,datum:w,title:h,xKey:r,xName:l,yKey:c,yName:h,xRange:[I,k],frequency:M,...this.getItemStyle(e,!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.properties;return{marker:{fill:Pe(e)??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:n,strokeWidth:s,lineDash:o,lineDashOffset:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!a}]}resetDatumAnimation(e){Fb([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Kf($f(!0,this.axes,"normal"),"unknown");mi(this.id,"datums",this.ctx.animationManager,[e],i),ei(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Kf($f(!0,this.axes,"normal"),"added"),i={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set};mi(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(s,n)=>us(...n.domain),i),i?.changed&&ei(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return pk(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.label.itemStyler!=null}};Xk.className="HistogramSeries",Xk.type="histogram";var yZ={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Na,xOffset:3,yOffset:3,blur:5},highlight:Ys}},qk={type:"series",name:"histogram",chartType:"cartesian",version:de,dependencies:[hi],options:qU,predictAxis:Bf,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:yZ,create:e=>new Xk(e)},xZ=10;function ov(e,t,i,s,n,o,a,r){const l=e[o];if(l===void 0)return!1;const c=Number.isFinite(t)?Wn(l,t,i,a):th(o,r),h=zg(c,n);return o===s[h+Zs]||o===s[h+Xs]||o===s[h+qs]||o===s[h+Qs]}function LE(e,t,i,s,n,o,a,r){let l=0;for(let d=0;dx.maxRange===h);let{indexData:u,valueData:p}=La(t,i,i,o,a,h,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:d?.indexData,reuseValueData:d?.valueData}),f=LE(t,o,a,u,h,r,n,d?.indices);const y=[{maxRange:h,indices:f,indexData:u,valueData:p}];for(;f.length>xZ&&h>64;){const x=h,b=Math.trunc(x/2),v=c?.find(M=>M.maxRange===b),S=Rl(u,p,x,{reuseIndexData:v?.indexData,reuseValueData:v?.valueData});h=S.maxRange,u=S.indexData,p=S.valueData,f=bZ(f,t,o,a,u,h,r,n,v?.indices),y.push({maxRange:h,indices:f,indexData:u,valueData:p})}return y.reverse(),y}function vZ(e,t,i,s){const n=t.length;if(nS.maxRange===u),{indexData:f,valueData:y}=La(t,i,i,o,a,u,{xNeedsValueOf:r,yNeedsValueOf:l,reuseIndexData:p?.indexData,reuseValueData:p?.valueData}),x=LE(t,o,a,f,u,r,n,p?.indices),b={maxRange:u,indices:x,indexData:f,valueData:y};function v(){return Qk([o,a],t,i,{xNeedsValueOf:r,yNeedsValueOf:l,existingFilters:h})?.filter(M=>M.maxRange!==u)??[]}return{immediate:[b],computeRemaining:v}}function SZ(e,t,i,s,n,o){const[a,r]=ci(e,s);return Qk([a,r],t,i,{xNeedsValueOf:n,yNeedsValueOf:o})}var MZ=zr(SZ);function DZ(e,t,i,s,n,o){const a=t.resolveColumnById(n,"xValue",i),r=t.resolveColumnById(n,s,i),l=t.getDomain(n,"xValue","value",i),c=t.resolveColumnNeedsValueOf(n,"xValue",i),h=t.resolveColumnNeedsValueOf(n,s,i);if(o){const[d,u]=ci(e,l);return Qk([d,u],a,r,{xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:o})}return MZ(e,a,r,l,c,h)}function IZ(e,t,i,s,n,o,a){const r=t.resolveColumnById(n,"xValue",i),l=t.resolveColumnById(n,s,i),c=t.getDomain(n,"xValue","value",i),h=t.resolveColumnNeedsValueOf(n,"xValue",i),d=t.resolveColumnNeedsValueOf(n,s,i),[u,p]=ci(e,c);return vZ([u,p],r,l,{xNeedsValueOf:h,yNeedsValueOf:d,targetRange:o,existingFilters:a})}var vi=class extends ca{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Pl,this.marker=new sn,this.label=new Qn,this.tooltip=Kh(),this.connectMissingData=!1,this.sparklineMode=!1}};g([m],vi.prototype,"xKey",2),g([m],vi.prototype,"yKey",2),g([m],vi.prototype,"xName",2),g([m],vi.prototype,"yName",2),g([m],vi.prototype,"selectedKey",2),g([m],vi.prototype,"stackGroup",2),g([m],vi.prototype,"normalizedTo",2),g([m],vi.prototype,"title",2),g([m],vi.prototype,"stroke",2),g([m],vi.prototype,"strokeWidth",2),g([m],vi.prototype,"strokeOpacity",2),g([m],vi.prototype,"lineDash",2),g([m],vi.prototype,"lineDashOffset",2),g([m],vi.prototype,"interpolation",2),g([m],vi.prototype,"styler",2),g([m],vi.prototype,"marker",2),g([m],vi.prototype,"label",2),g([m],vi.prototype,"tooltip",2),g([m],vi.prototype,"connectMissingData",2),g([m],vi.prototype,"sparklineMode",2);var Jk=class extends dc{constructor(e){super({moduleCtx:e,propertyKeys:pp,propertyNames:gp,categoryKey:"xValue",pickModes:[2,1,0],datumSelectionGarbageCollection:!1,segmentedDataNodes:!1,animationResetFns:{path:vk({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:$h,datum:(t,i)=>({..._b(t),...Zf(t,i)})},clipFocusBox:!1}),this.properties=new vi,this.aggregationManager=new Kb}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}isNormalized(){return this.properties.normalizedTo!=null}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:o,yKey:a,selectedKey:r,connectMissingData:l,normalizedTo:c}=this.properties,h=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:u,xScaleType:p,yScaleType:f}=this.getScaleInformation({xScale:h,yScale:d}),y=n>1||c!=null,x={invalidValue:null};l&&y&&(x.invalidValue=0),y&&!i&&(x.forceValue=0);const b={value:`area-stack-${s}-yValue`,marker:`area-stack-${s}-yValues-marker`},v=[],S=this.properties.allowNullKeys??!1;(!u||y)&&v.push(ql(o,p,{id:"xKey",allowNullKey:S})),v.push(Vt(o,p,{id:"xValue",allowNullKey:S}),Vt(a,f,{id:"yValueRaw",...x,invalidValue:void 0})),r!=null&&v.push(Vt(r,"category",{id:"selectedRaw"})),y&&v.push(...Sh(a,"normal",{id:"yValueCumulative",...x,groupId:b.marker},f)),vt(c)&&v.push(Vt(a,f,{id:"yValue",...x,groupId:b.value}),ab(Object.values(b),c)),this.needsDataModelDiff()&&(v.push(bf(u?["xValue"]:void 0)),this.processedData&&v.push(lb(this.id,this.processedData)));const{dataModel:M,processedData:D}=await this.requestDataModel(e,t,{props:v,groupByKeys:y,groupByData:!y});this.aggregateData(M,D),this.animationState.transition("updateData")}yValueKey(){return this.isNormalized()?"yValue":"yValueRaw"}yCumulativeKey(e){return e.type==="grouped"?"yValueCumulative":this.yValueKey()}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{dataModel:t,processedData:i,axes:s}=this;if(!t||!i)return{domain:[]};const n=s.y;if(e==="x"){const a=t.resolveProcessedDataDefById(this,"xValue"),r=t.getDomain(this,"xValue","value",i);if(a?.def.type==="value"&&a.def.valueType==="category"){const l=t.getKeySortMetadata(this,"xValue",i);return{domain:r.domain,sortMetadata:l}}return{domain:vn(Qo(r.domain))}}const o=this.domainForClippedRange("y",[this.yCumulativeKey(i)],"xValue");if(this.isNormalized()&&n instanceof eo&&!(n instanceof xp)){const a=Number.isFinite(o[1]-o[0])?[Math.min(o[0],0),Math.max(o[1],0)]:[];return{domain:vn(a)}}else return{domain:vn(o)}}getSeriesRange(e,t){return this.domainForVisibleRange("y",[this.yCumulativeKey(this.processedData)],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",[this.yCumulativeKey(this.processedData)],e,t,i)}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||Co(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>IZ(i.scale.type,e,t,this.yCumulativeKey(t),this,s,o),computeFull:o=>DZ(i.scale.type,e,t,this.yCumulativeKey(t),this,o),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&yo.record(`${this.type}:aggregation`,n.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=e.scale,o=t.scale,a=s.dataSources.get(this.id)?.data??[],[r,l]=n.range,c=Math.abs(l-r);this.aggregationManager.ensureLevelForRange(c);const h=this.aggregationManager.getFilterForRange(c),d=this.canIncrementallyUpdateNodes(h!=null);return{xAxis:e,yAxis:t,rawData:a,xValues:i.resolveColumnById(this,"xValue",s),yRawValues:i.resolveColumnById(this,"yValueRaw",s),yCumulativeValues:i.resolveColumnById(this,this.yCumulativeKey(s),s),selectionValues:this.properties.selectedKey?i.resolveColumnById(this,"selectedRaw",s):void 0,xScale:n,yScale:o,xOffset:(n.bandwidth??0)/2,yOffset:(o.bandwidth??0)/2,size:this.properties.marker.enabled?this.properties.marker.size:0,yDomain:this.getSeriesDomain("y").domain,labelsEnabled:this.properties.label.enabled,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:d,dataAggregationFilter:h,range:c,xKey:this.properties.xKey,yKey:this.properties.yKey,xName:this.properties.xName,yName:this.properties.yName,legendItemName:this.properties.legendItemName,connectMissingData:this.properties.connectMissingData,capDefaults:{lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},nodes:d?this.contextNodeData.nodeData:[],spanPoints:[],nodeIndex:0}}handleDatum(e,t,i){if(t.datum=e.rawData[i],t.xDatum=e.xValues[i],t.yDatum=e.yRawValues[i],t.yCumulative=e.yCumulativeValues[i],t.selected=e.selectionValues?.[i],t.x=e.xScale.convert(t.xDatum)+e.xOffset,t.y=e.yScale.convert(t.yCumulative)+e.yOffset,!!Number.isFinite(t.x)){if(t.yDatum!=null){const s=e.labelsEnabled?this.getLabelText(t.yDatum,t.datum,e.yKey,"y",e.yDomain,this.properties.label,{value:t.yDatum,datum:t.datum,xKey:e.xKey,yKey:e.yKey,xName:e.xName,yName:e.yName,legendItemName:e.legendItemName}):void 0;if(e.canIncrementallyUpdate&&e.nodeIndexArray.isArray(s)?Wf(s,this.properties.interpolation):[]);return t.strokeData={itemId:e.yKey,spans:i},t.crossFiltering=this.properties.selectedKey!=null,t.segments=Ob(this.properties.segmentation,e.xAxis,e.yAxis,this.chart.seriesRect,this.ctx.scene,!1),t}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],visible:i,animationEnabled:s}=e,n=ce(this.getHighlightStyle(),this.getStyle()),{strokeWidth:o,stroke:a,strokeOpacity:r,lineDash:l,lineDashOffset:c,opacity:h}=n,d=this.contextNodeData?.segments;t.setProperties({segments:d,fill:void 0,lineJoin:"round",pointerEvents:1,opacity:h,stroke:a,strokeWidth:o,strokeOpacity:r,lineDash:l,lineDashOffset:c}),t.datum=d,s||(t.visible=i),Wb(this,t)}updateDatumSelection(e){let{nodeData:t}=e;const{datumSelection:i}=e,{contextNodeData:s,processedData:n,axes:o,properties:a}=this,{marker:r}=a;return t=s?.crossFiltering===!0||yk(n.input.count,o.x.scale,r)?t:[],r.isDirty()&&(i.clear(),i.cleanup()),Co(this.processedData)?i.update(t,void 0,c=>us(c.xValue)):i.update(t)}updateDatumStyles(e){const{datumSelection:t,isHighlight:i}=e,{marker:s}=this.properties,n=this.ctx.highlightManager.getActiveHighlight();t.each((o,a)=>{if(!t.isGarbage(o)){const r=this.getHighlightState(n,e.isHighlight,a.datumIndex),l=this.getStyle(r),{stroke:c,strokeWidth:h,strokeOpacity:d}=l,u=this.makeItemStylerParams(this.dataModel,this.processedData,a.datumIndex,l.marker);a.style=this.getMarkerStyle(s,a,u,{isHighlight:i,highlightState:r},l.marker,{stroke:c,strokeWidth:h,strokeOpacity:d})}})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,n=this.ctx.animationManager.isSkipped(),o=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),r=this.getDrawingMode(s,e.drawingMode);i.each((l,c)=>{const h=this.getHighlightState(a,s,c.datumIndex),d=c.style??t.styles[h];this.applyMarkerStyle(d,l,c.point,o,{applyTranslation:n,selected:c.selected}),l.drawingMode=this.resolveMarkerDrawingModeForState(r,d)}),s||this.properties.marker.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.makeLabelFormatterParams();e.labelSelection.each((n,o)=>{const a=Wh(this,o,s,this.properties.label,t,i),{enabled:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,color:u}=a;r&&o?.labelText?(n.fontStyle=l,n.fontWeight=c,n.fontSize=h,n.fontFamily=d,n.textAlign="center",n.textBaseline="bottom",n.text=o.labelText,n.x=o.point.x,n.y=o.point.y-10,n.fill=u,n.visible=!0,n.fillOpacity=this.getHighlightStyle(t,o.datumIndex).opacity??1,n.setBoxing(a)):n.visible=!1})}makeStylerParams(e){const{id:t}=this,{marker:i,lineDash:s,lineDashOffset:n,stroke:o,strokeOpacity:a,strokeWidth:r,xKey:l,yKey:c}=this.properties,h=Fu(e??0);return{marker:{fill:i.fill,fillOpacity:i.fillOpacity,size:i.size,shape:i.shape,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset},highlightState:h,lineDash:s,lineDashOffset:n,seriesId:t,stroke:o,strokeOpacity:a,strokeWidth:r,xKey:l,yKey:c}}makeItemStylerParams(e,t,i,s){const{xKey:n,yKey:o}=this.properties,a=e.resolveColumnById(this,"xValue",t)[i],r=e.resolveColumnById(this,"yValueRaw",t)[i],l=e.getDomain(this,"xValue","key",t).domain,c=e.getDomain(this,this.yCumulativeKey(t),"value",t).domain,h=this.filterItemStylerFillParams(s.fill)??s.fill;return{...cI(a,r,n,o,l,c),xValue:a,yValue:r,...s,fill:h}}makeLabelFormatterParams(){const{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}=this.properties;return{xKey:e,xName:t,yKey:i,yName:s,legendItemName:n}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{xKey:a,xName:r,yKey:l,yName:c,tooltip:h,legendItemName:d}=o,u=o.allowNullKeys??!1,p=n.x,f=n.y;if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data?.[e],x=i.resolveColumnById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValueRaw",s)[e];if(x===void 0&&!u)return;const v=this.getStyle(),S=this.makeItemStylerParams(i,s,e,v.marker),M=this.getMarkerStyle(this.properties.marker,{datumIndex:e,datum:y},S,{isHighlight:!1},v.marker);return this.formatTooltipWithContext(h,{heading:this.getAxisValueText(p,"tooltip",x,y,a,d,u),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",b,y,l,d),missing:wh(b)}]},{seriesId:t,datum:y,title:c,xKey:a,xName:r,yKey:l,yName:c,...M,...this.getModuleTooltipParams()})}legendItemSymbol(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,marker:n}=this.getStyle();return{marker:{...this.getMarkerStyle(this.properties.marker,{},void 0,{isHighlight:!1,checkForHighlight:!1},{size:n.size,shape:n.shape,fill:n.fill,fillOpacity:n.fillOpacity,stroke:n.stroke,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset}),enabled:this.properties.marker.enabled},line:{enabled:!0,stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:o,title:a,legendItemName:r,showInLegend:l}=this.properties;return[{legendType:e,id:t,itemId:n,legendItemName:r,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:r??a??o??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}updateLinePaths(e,t){const i=t.strokeData.spans,[s]=e;s.path.clear(),hk(s,i),s.markDirty("LineSeries")}resetDatumAnimation(e){Hb([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,paths:o}=e,{animationManager:a}=this.ctx;this.updateLinePaths(o,n),xk(this,a,...o),qi([t],Zf),mk(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),ei(this,"labels",a,i),ei(this,"annotations",a,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,annotationSelections:n,contextData:o,paths:a,previousContextData:r}=e,[l]=a;if(o.visible===!1&&r?.visible===!1)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(a,o)},h=()=>{t.skipCurrentBatch(),c()};if(o==null||r==null){c(),Yf(this,t,"added",this.getAnimationDrawingModes(),i),Kr(this.id,"path_properties",t,[l],{opacity:0},{opacity:this.getOpacity()},{phase:"add"}),ei(this,"labels",t,s),ei(this,"annotations",t,...n);return}if(o.crossFiltering!==r.crossFiltering){h();return}const d=JY(o,r,this.processedData?.reduced?.diff?.[this.id],this.getOpacity());if(d===void 0){h();return}else if(d.status==="no-op")return;mi(this.id,"path_properties",t,[l],d.stroke.pathProperties),d.status==="added"?this.updateLinePaths(a,o):d.status==="removed"?this.updateLinePaths(a,r):Ub(this.id,"path_update",t,[l],d.stroke.path),d.hasMotion&&(Yf(this,t,void 0,this.getAnimationDrawingModes(),i),ei(this,"labels",t,s),ei(this,"annotations",t,...n)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateLinePaths(a,o)})}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new Ni}getStyle(e){const{styler:t,marker:i,lineDash:s,lineDashOffset:n,stroke:o,strokeOpacity:a,strokeWidth:r}=this.properties,{size:l,shape:c,fill:h="transparent",fillOpacity:d}=i;let u={};if(t){const p=this.makeStylerParams(e),f=this.cachedCallWithContext(t,p)??{};u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],f,{pick:!1})??{}}return u.marker??(u.marker={}),{lineDash:u.lineDash??s,lineDashOffset:u.lineDashOffset??n,stroke:u.stroke??o,strokeOpacity:u.strokeOpacity??a,strokeWidth:u.strokeWidth??r,marker:{fill:u.marker.fill??h,fillOpacity:u.marker.fillOpacity??d,shape:u.marker.shape??c,size:u.marker.size??l,lineDash:u.marker.lineDash??i.lineDash??s,lineDashOffset:u.marker.lineDashOffset??i.lineDashOffset??n,stroke:u.marker.stroke??i.stroke??o,strokeOpacity:u.marker.strokeOpacity??i.strokeOpacity??a,strokeWidth:u.marker.strokeWidth??i.strokeWidth??r}}}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(this.dataModel,this.processedData,e.datumIndex,t.marker);return this.getMarkerStyle(this.properties.marker,e,i,{isHighlight:!0},void 0,t)}computeFocusBounds(e){return Gb(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Jk.className="LineSeries",Jk.type="line";var kZ={series:{stroke:Lr,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"}},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Kd,segmentation:Tl}},av={type:"series",name:"line",chartType:"cartesian",stackable:!0,version:de,dependencies:[hi],options:Nf,predictAxis:Bf,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:kZ,create:e=>new Jk(e)},eA=class extends nv{};eA.className="ScatterSeries",eA.type="scatter";var AZ={series:{shape:"circle",size:7,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:.8,maxRenderedItems:2e3,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$if:[{$eq:[{$path:["/tooltip/range","nearest"]},"area"]},"nearest",{$path:["/tooltip/range","nearest"]}]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Ys}},tA={type:"series",name:"scatter",chartType:"cartesian",version:de,dependencies:[hi],options:i2,predictAxis:JI,defaultAxes:{x:{type:"number",position:"bottom"},y:{type:"number",position:"left"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:AZ,create:e=>new eA(e)},NE=class extends Wt{constructor(){super(...arguments),this.showInLegend=!1}};g([m],NE.prototype,"showInLegend",2);var iA=class extends Qn{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};g([m],iA.prototype,"text",2),g([m],iA.prototype,"spacing",2);var sA=class extends q{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};g([m],sA.prototype,"fill",2),g([m],sA.prototype,"fillOpacity",2);var bp=class extends Qn{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([m],bp.prototype,"offset",2),g([m],bp.prototype,"minAngle",2),g([m],bp.prototype,"minSpacing",2),g([m],bp.prototype,"maxCollisionOffset",2),g([m],bp.prototype,"avoidCollisions",2);var nA=class extends Qn{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([m],nA.prototype,"positionOffset",2),g([m],nA.prototype,"positionRatio",2);var em=class extends q{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([m],em.prototype,"colors",2),g([m],em.prototype,"length",2),g([m],em.prototype,"strokeWidth",2),g([m],em.prototype,"itemStyler",2);var _e=class extends sa{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(xi),this.strokes=Object.values(Yr),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new Bi(iA),this.title=new NE,this.innerCircle=new sA,this.shadow=new Ua,this.calloutLabel=new bp,this.sectorLabel=new nA,this.calloutLine=new em,this.tooltip=Kh()}};g([m],_e.prototype,"angleKey",2),g([m],_e.prototype,"angleName",2),g([m],_e.prototype,"angleFilterKey",2),g([m],_e.prototype,"radiusKey",2),g([m],_e.prototype,"radiusName",2),g([m],_e.prototype,"radiusMin",2),g([m],_e.prototype,"radiusMax",2),g([m],_e.prototype,"calloutLabelKey",2),g([m],_e.prototype,"calloutLabelName",2),g([m],_e.prototype,"sectorLabelKey",2),g([m],_e.prototype,"sectorLabelName",2),g([m],_e.prototype,"legendItemKey",2),g([m],_e.prototype,"defaultColorRange",2),g([m],_e.prototype,"defaultPatternFills",2),g([m],_e.prototype,"fills",2),g([m],_e.prototype,"strokes",2),g([m],_e.prototype,"fillOpacity",2),g([m],_e.prototype,"strokeOpacity",2),g([m],_e.prototype,"lineDash",2),g([m],_e.prototype,"lineDashOffset",2),g([m],_e.prototype,"cornerRadius",2),g([m],_e.prototype,"itemStyler",2),g([m],_e.prototype,"rotation",2),g([m],_e.prototype,"outerRadiusOffset",2),g([m],_e.prototype,"outerRadiusRatio",2),g([m],_e.prototype,"innerRadiusOffset",2),g([m],_e.prototype,"innerRadiusRatio",2),g([m],_e.prototype,"strokeWidth",2),g([m],_e.prototype,"sectorSpacing",2),g([m],_e.prototype,"hideZeroValueSectorsInLegend",2),g([m],_e.prototype,"innerLabels",2),g([m],_e.prototype,"title",2),g([m],_e.prototype,"innerCircle",2),g([m],_e.prototype,"shadow",2),g([m],_e.prototype,"calloutLabel",2),g([m],_e.prototype,"sectorLabel",2),g([m],_e.prototype,"calloutLine",2),g([m],_e.prototype,"tooltip",2);function oA(e,t,i,s){const n=[i.convert(0),i.convert(1)],o=[s.convert(0),s.convert(1)],a=Math.PI/-2+lt(t),r=e?"initial":"update",l=({radius:f})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*f}),c=({radius:f})=>({innerRadius:o[0],outerRadius:o[0]+(o[1]-o[0])*f});return{nodes:{toFn:(f,y,x,{prevLive:b})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D}=y;const{stroke:I,fill:k}=y.sectorFormat;if(x==="removed"&&b?(v=b.datum?.endAngle,S=b.datum?.endAngle):x==="removed"&&!b&&(v=a,S=a),x==="removed"){const w=l(y);M=w.innerRadius,D=w.outerRadius}return{startAngle:v,endAngle:S,outerRadius:D,innerRadius:M,stroke:I,...typeof k=="string"?{fill:k}:{}}},fromFn:(f,y,x,{prevFromProps:b})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D}=f,{fill:I,stroke:k}=y.sectorFormat;if(x==="updated"&&f.previousDatum==null&&(x="added"),x==="unknown"||x==="added"&&!b?(v=a,S=a,M=y.innerRadius,D=y.outerRadius):x==="added"&&b&&(v=b.endAngle??a,S=b.endAngle??a,M=b.innerRadius??y.innerRadius,D=b.outerRadius??y.outerRadius),x==="added"&&!e){const w=c(y);M=w.innerRadius,D=w.outerRadius}return x==="updated"&&(I=f.fill??I,k=(typeof f.stroke=="string"?f.stroke:void 0)??k),{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D,stroke:k,phase:r,...typeof I=="string"?{fill:I}:{}}}},innerCircle:{fromFn:(f,y)=>({size:f.previousDatum?.radius??f.size??0,phase:r}),toFn:(f,y)=>({size:y.radius??0})}}}function wZ(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function CZ(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,n=Math.atan2(i,s),o=e.getItemNodes();for(const a of o)if(a.datum.missing!==!0&&Js(n,a.startAngle,a.endAngle)){const r=Math.hypot(s,i);let l=0;return ra.outerRadius&&(l=r-a.outerRadius),{datum:a.datum,distance:l}}}var LZ=class extends bb{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},rv=class extends Sk{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...XP,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...qP,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:wZ,label:$h}}),this.properties=new _e,this.phantomNodeData=void 0,this.backgroundGroup=new ds({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new jh,this.radiusScale=new jh,this.phantomGroup=this.contentGroup.appendChild(new Le({name:"phantom",zIndex:-1})),this.phantomSelection=yi.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.phantomHighlightGroup=this.highlightGroup.appendChild(new Le({name:"phantom",zIndex:-1})),this.phantomHighlightSelection=yi.select(this.phantomHighlightGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new Le({name:"pieCalloutLabels"})),this.calloutLabelSelection=new yi(this.calloutLabelGroup,Le),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new Le({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new Ni({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new Ni({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new Le({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new Le({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=yi.select(this.innerLabelsGroup,bn),this.innerCircleSelection=yi.select(this.innerCircleGroup,()=>new Ni({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=LZ,this.angleScale=new jh,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2,this.phantomHighlightGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.backgroundGroup.remove()}setZIndex(e){super.setZIndex(e),this.backgroundGroup.zIndex=[0,e]}nodeFactory(){const e=new vs;return e.miterLimit=1e9,e}getSeriesDomain(e){return e==="angle"?{domain:this.angleScale.domain}:{domain:this.radiusScale.domain}}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:o,radiusKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(b,v)=>t&&s.getItemEnabled({seriesId:i,itemId:v})?b:0,d=!this.ctx.animationManager.isSkipped(),u=this.properties.allowNullKeys??!1,p=[],f=[];c?p.push(ql(c,"category",{id:"legendItemKey",allowNullKey:u})):r?p.push(ql(r,"category",{id:"calloutLabelKey",allowNullKey:u})):l&&p.push(ql(l,"category",{id:"sectorLabelKey",allowNullKey:u}));const y=this.radiusScale.type,x=this.angleScale.type;a&&f.push(o$(a,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),Vt(a,y,{id:"radiusRaw",processor:h}),aI("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),r&&f.push(Vt(r,"category",{id:"calloutLabelValue",allowNullKey:u})),l&&f.push(Vt(l,"category",{id:"sectorLabelValue",allowNullKey:u})),c&&f.push(Vt(c,"category",{id:"legendItemValue",allowNullKey:u})),o&&f.push(oI(o,x,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),Vt(o,x,{id:"angleFilterRaw"}),aI("angleFilterValue",[0,1],0,0)),d&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&p.length>0&&f.push(lb(this.id,this.processedData)),f.push(bf()),await this.requestDataModel(e,this.data,{props:[...p,oI(n,x,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),Vt(n,x,{id:"angleRaw"}),aI("angleValue",[0,1],0,0),...f]});for(const b of this.processedData?.defs?.values??[]){const{id:v,missing:S,property:M}=b,D=d1(this,S);v!=="angleRaw"&&D>0&&W.warnOnce(`no value was found for the key '${String(M)}' on ${D} data element${D>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,e.length>0&&yo.record(`${this.type}:nodeData`,e.length),this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey==null?void 0:e.resolveColumnById(this,"angleFilterValue",t),o=this.properties.angleFilterKey==null?void 0:e.resolveColumnById(this,"angleFilterRaw",t),a=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,r=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:o,radiusValues:a,radiusRawValues:r,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:o}=this,{rotation:a,innerRadiusRatio:r}=this.properties;if(!i||t?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:h,angleFilterValues:d,angleFilterRawValues:u,radiusValues:p,radiusRawValues:f,legendItemValues:y}=l,x=u?.some((k,A)=>k>h[A])??!1;let b=0,v=0;const S=[],M=u==null?void 0:[],D=t.dataSources.get(this.id)?.data??[],I=t.invalidData?.get(this.id);for(const[k,A]of D.entries()){if(I?.[k]===!0)continue;const w=x?d[k]:c[k],C=u!=null&&!x?Math.sqrt(u[k]/h[k]):1,T=s.convert(b)+lt(a);b=w,v+=w;const O=s.convert(b)+lt(a),V=Math.abs(O-T),z=T+V/2,R=h[k],G=(p?.[k]??1)*C,F=f?.[k],_=y?.[k],Y=this.getLabels(k,A,z,V,l),Z=this.getItemStyle({datum:A,datumIndex:k},!1),ne={series:this,datum:A,datumIndex:k,angleValue:R,midAngle:z,midCos:Math.cos(z),midSin:Math.sin(z),startAngle:T,endAngle:O,radius:G,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(G),0),sectorFormat:Z,radiusValue:F,legendItemValue:_,enabled:o&&n.getItemEnabled({seriesId:e,itemId:k}),focusable:!0,...Y};S.push(ne),M?.push({...ne,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}return this.zerosumOuterRing.visible=v===0,this.zerosumInnerRing.visible=v===0&&r!=null&&r!==1&&r>0,{itemId:e,nodeData:S,labelData:S,phantomNodeData:M}}getLabelContent(e,t,i){const{id:s,ctx:n,properties:o}=this,{formatManager:a}=n,{calloutLabel:r,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:d}=o,u=o.allowNullKeys??!1,p=i.calloutLabelValues?.[e],f=i.sectorLabelValues?.[e],y=i.legendItemValues?.[e],x={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},b={callout:void 0,sector:void 0,legendItem:void 0};if(c&&(b.callout=this.getLabelText(p,t,c,"calloutLabel",[],r,{...x,value:p},u)),h&&(b.sector=this.getLabelText(f,t,h,"sectorLabel",[],l,{...x,value:f},u)),d!=null&&(y!=null||u)){const v=y??"";b.legendItem=a.format(this.callWithContext.bind(this),{type:"category",value:u?y:v,datum:t,seriesId:s,legendItemName:void 0,key:d,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??v}return b}getLabels(e,t,i,s,n){const{properties:o}=this,{calloutLabel:a,sectorLabel:r,legendItemKey:l}=o,c=this.getLabelContent(e,t,n),h={};return a.enabled&&c.callout&&s>=lt(a.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),r.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=Gg(e),s=-.75*Math.PI,n=i-s,o=Math.floor(n/(Math.PI/2)),a=P0(o,t.length);return t[a]}getFillParams(e,t,i){if(!(!qt(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getItemStyle({datum:e,datumIndex:t},i,s,n){const{fills:o,strokes:a,itemStyler:r}=this.properties,l=a[t],c=o[t],{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:f,lineDash:y,lineDashOffset:x,cornerRadius:b,opacity:v}=ce(this.getHighlightStyle(i,t,s,n),{fill:c,stroke:l},this.properties);let S;return r&&(S=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>{const M=this.makeItemStylerParams(e,t,i,{fill:h,fillOpacity:d,stroke:u,strokeWidth:p,strokeOpacity:f,lineDash:y,lineDashOffset:x,cornerRadius:b});return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,M),{proxyPaths:{fill:["fills",`${t}`],stroke:["strokes",`${t}`]}})})),{fill:S?.fill??h,fillOpacity:S?.fillOpacity??d,stroke:S?.stroke??u,strokeWidth:S?.strokeWidth??p,strokeOpacity:S?.strokeOpacity??f,lineDash:S?.lineDash??y,lineDashOffset:S?.lineDashOffset??x,cornerRadius:S?.cornerRadius??b,opacity:v}}makeItemStylerParams(e,t,i,s){const{angleKey:n,radiusKey:o,calloutLabelKey:a,sectorLabelKey:r,legendItemKey:l}=this.properties,c=this.filterItemStylerFillParams(s.fill)??s.fill;return{datum:e,angleKey:n,radiusKey:o,calloutLabelKey:a,sectorLabelKey:r,legendItemKey:l,...s,fill:c,highlightState:this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),i,t),seriesId:this.id}}getCalloutLineStyle(e,t){const{properties:i}=this;let s={};if(i.calloutLine.itemStyler){const n=this.getHighlightStateString(this.ctx.highlightManager?.getActiveHighlight(),t,e.datumIndex),o={angleKey:i.angleKey,angleName:i.angleName??i.angleKey,calloutLabelKey:i.calloutLabelKey,calloutLabelName:i.calloutLabelName??i.calloutLabelKey,datum:e.datum,highlightState:n,legendItemKey:i.legendItemKey,radiusKey:i.radiusKey,radiusName:i.radiusName??i.radiusKey,sectorLabelKey:i.sectorLabelKey,sectorLabelName:i.sectorLabelName??i.sectorLabelKey,seriesId:this.id};s=this.cachedCallWithContext(i.calloutLine.itemStyler,o)??{}}return{length:s.length??i.calloutLine.length,strokeWidth:s.strokeWidth??i.calloutLine.strokeWidth,color:s.color,colors:i.calloutLine.colors}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return Number.NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Kn(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const n=this.getTitleTranslationY();t.node.y=Number.isFinite(n)?n:0;const o=t.node.getBBox();t.node.visible=t.enabled&&Number.isFinite(n)&&!this.bboxIntersectsSurroundingSeries(o)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&e.node.remove(),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};for(const t of this.nodeData)e(t);if(this.phantomNodeData)for(const t of this.phantomNodeData)e(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:s,calloutLabelSelection:n,labelSelection:o,highlightLabelSelection:a,innerLabelsSelection:r}=this,l=this.nodeData.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),c=this.phantomNodeData?.map(d=>({...d,sectorFormat:{...d.sectorFormat}})),h=(d,u)=>{d.update(u,void 0,p=>this.getDatumId(p.datumIndex)),this.ctx.animationManager.isSkipped()&&d.cleanup()};h(e,this.nodeData),h(t,l),h(i,this.phantomNodeData??[]),h(s,c??[]),n.update(this.calloutNodeData,d=>{const u=new Xn;u.tag=0,u.pointerEvents=1,d.appendChild(u);const p=new bn;p.tag=1,p.pointerEvents=1,d.appendChild(p)}),o.update(this.nodeData),a.update(l),r.update(this.properties.innerLabels,d=>{d.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),o=1;t=Math.ceil(n*2+o)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:o}=this.getProcessedDataValues(s,n),a=this.isSeriesHighlighted(t,o),r=this.ctx.chartService.highlight?.drawingMode??"overlay";this.highlightGroup.visible=i&&a,this.labelGroup.visible=i,this.innerCircleSelection.each((p,{radius:f})=>{p.setProperties({fill:this.properties.innerCircle?.fill,opacity:this.properties.innerCircle?.fillOpacity,size:f})});const l=this.radiusScale.range[0],c=this.radiusScale.range[1],h=this.getShapeFillBBox(),d=this.ctx.animationManager.isSkipped(),u=(p,f,y,x,b)=>{const v=this.getItemStyle(f,x,void 0,o);f.sectorFormat.fill=v.fill,f.sectorFormat.stroke=v.stroke,d&&(p.startAngle=f.startAngle,p.endAngle=f.endAngle,p.innerRadius=f.innerRadius,p.outerRadius=f.outerRadius),(x||d)&&(p.fill=v.fill,p.stroke=v.stroke);const S=this.getFillParams(v.fill,l,c);p.setStyleProperties(v,h,S),p.drawingMode=b,p.cornerRadius=v.cornerRadius,p.fillShadow=this.properties.shadow;const M=Math.max((this.properties.sectorSpacing+(v.stroke==null?0:v.strokeWidth))/2,0);p.inset=M,p.lineJoin=this.properties.sectorSpacing>=0||M>0?"miter":"round"};this.itemSelection.each((p,f,y)=>u(p,f,y,!1,"overlay")),this.phantomSelection.each((p,f,y)=>u(p,f,y,!1,"overlay")),this.highlightSelection.each((p,f,y)=>{u(p,f,y,!0,r),p.visible=f.datumIndex===t?.datumIndex}),this.phantomHighlightSelection.each((p,f,y)=>{u(p,f,y,!0,r),p.visible=f.datumIndex===t?.datumIndex}),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{strokes:e}=this.properties,{offset:t}=this.properties.calloutLabel,i=this.ctx.highlightManager?.getActiveHighlight(),s=this.isSeriesHighlighted(i);for(const n of this.calloutLabelSelection.selectByTag(0)){const o=n.closestDatum(),a=s&&this.isItemHighlighted(i,o.datumIndex)===!0,{length:r,strokeWidth:l,color:c,colors:h}=this.getCalloutLineStyle(o,!1),d=l,u=rD(h)?h:e,{calloutLabel:p,outerRadius:f,datumIndex:y}=o;if(p?.text&&!p.hidden&&f!==0){n.visible=!0,n.strokeWidth=d,n.stroke=c??u[y%u.length],n.strokeOpacity=this.getHighlightStyle(a,o.datumIndex).opacity??1,n.fill=void 0;const x=o.midCos*f,b=o.midSin*f;let v=o.midCos*(f+r),S=o.midSin*(f+r);if((p.collisionTextAlign??p.collisionOffsetY!==0)&&p.box!=null){const D=p.box;let I=v,k=S;vD.x+D.width&&(I=D.x+D.width),SD.y+D.height&&(k=D.y+D.height);const A=I-v,w=k-S,C=Math.sqrt(Math.pow(A,2)+Math.pow(w,2)),T=C-t;T>0&&(v=v+A*T/C,S=S+w*T/C)}n.x1=x,n.y1=b,n.x2=v,n.y2=S}else n.visible=!1}}getLabelOverflow(e,t){const i=-this.centerX,s=i+t.width,n=-this.centerY,o=n+t.height,a=1;let r=e.width;e.x+as&&(r=(s-e.x)/e.width);const l=e.y+ao,c=this.bboxIntersectsSurroundingSeries(e);return{maxWidth:r,hasVerticalOverflow:l,hasSurroundingSeriesOverflow:c}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t}=this.properties,{offset:i,minSpacing:s}=t,n=e.convert(0),o=x=>!x.calloutLabel||x.outerRadius===0,a=this.calloutNodeData,r=a.filter(x=>!o(x));for(const x of r){const b=x.calloutLabel;b!=null&&(b.hidden=!1,b.collisionTextAlign=void 0,b.collisionOffsetY=0)}if(r.length<=1)return;const l=r.filter(x=>x.midCos<0).sort((x,b)=>x.midSin-b.midSin),c=r.filter(x=>x.midCos>=0).sort((x,b)=>x.midSin-b.midSin),h=r.filter(x=>x.midSin<0&&x.calloutLabel?.textAlign==="center").sort((x,b)=>x.midCos-b.midCos),d=r.filter(x=>x.midSin>=0&&x.calloutLabel?.textAlign==="center").sort((x,b)=>x.midCos-b.midCos),u=x=>{const b=x.calloutLabel;if(b==null)return re.zero.clone();const v=this.getLabelStyle(x,t,"calloutLabel"),S=_u(v),M=this.getCalloutLineStyle(x,!1).length,D=x.outerRadius+M+i,I=x.midCos*D,k=x.midSin*D+b.collisionOffsetY,A=b.collisionTextAlign??b.textAlign,w=b.textBaseline;return bn.measureBBox(b.text,I,k,{font:this.properties.calloutLabel,textAlign:A,textBaseline:w}).grow(S)},p=(x,b,v)=>{const S=u(x).grow(s/2),M=u(b).grow(s/2);S.xM.x&&(v==="to-top"?S.yM.y)&&(b.calloutLabel.collisionOffsetY=v==="to-top"?S.y-M.y-M.height:S.y+S.height-M.y)},f=x=>{const b=x.slice().sort((S,M)=>Math.abs(S.midSin)-Math.abs(M.midSin))[0],v=x.indexOf(b);for(let S=v-1;S>=0;S--){const M=x[S+1],D=x[S];p(M,D,"to-top")}for(let S=v+1;S{const b=r.some(k=>k.calloutLabel.collisionOffsetY!==0),v=x.map(k=>u(k)),S=v.map(k=>k.clone().grow(s/2));let M=!1;for(let k=0;k{const{startAngle:A,endAngle:w,outerRadius:C}=k;return{startAngle:A,endAngle:w,innerRadius:n,outerRadius:C}}),I=v.some(k=>D.some(A=>p5(k,A)));if(!(!M&&!b&&!I))for(const k of x){if(k.calloutLabel.textAlign!=="center")continue;const A=k.calloutLabel;k.midCos<0?A.collisionTextAlign="right":k.midCos>0?A.collisionTextAlign="left":A.collisionTextAlign="center"}};f(l),f(c),y(h),y(d)}getLabelStyle(e,t,i,s=!1){const n=this.ctx.highlightManager?.getActiveHighlight();return Wh(this,e,this.properties,t,s,n,["series",`${this.declarationOrder}`,i])}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i}=this.properties,s=new bn,n=this.ctx.highlightManager?.getActiveHighlight(),o=this.isSeriesHighlighted(n);for(const a of this.calloutLabelSelection.selectByTag(1)){const r=a.closestDatum(),l=r.calloutLabel,c=t.convert(r.radius),h=Math.max(0,c);if(!l?.text||h===0||l.hidden){a.visible=!1;continue}const d=o&&this.isItemHighlighted(n,r.datumIndex)===!0,u=this.getLabelStyle(r,i,"calloutLabel",d),p=this.getCalloutLineStyle(r,!1).length,f=h+p+i.offset,y=r.midCos*f,x=r.midSin*f+l.collisionOffsetY,b={textAlign:l.collisionTextAlign??l.textAlign,textBaseline:l.textBaseline};s.text=l.text,s.x=y,s.y=x,s.setFont(u),s.setAlign(b),s.setBoxing(u);const v=s.getBBox();let S=l.text,M=!0;if(i.avoidCollisions){const{maxWidth:D,hasVerticalOverflow:I}=this.getLabelOverflow(v,e);if(v.width>D){const k={font:this.properties.calloutLabel,textWrap:"on-space",overflow:"hide",maxWidth:D};S=du(l.text,k)}M=!I}a.text=S,a.x=y,a.y=x,a.setFont(u),a.setAlign(b),a.setBoxing(u),a.fill=u.color,a.fillOpacity=this.getHighlightStyle(d,r.datumIndex).opacity??1,a.visible=M}}computeLabelsBBox(e,t){const{calloutLabel:i}=this.properties,{offset:s,maxCollisionOffset:n,minSpacing:o}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const a=[],r=new bn;let l;const{title:c}=this.properties;if(c?.text&&c.enabled){const h=this.getTitleTranslationY();Number.isFinite(h)&&(r.text=c.text,r.x=0,r.y=h,r.setFont(c),r.setAlign({textBaseline:"bottom",textAlign:"center"}),l=r.getBBox(),a.push(l))}for(const h of this.calloutNodeData){const d=h.calloutLabel;if(!d||h.outerRadius===0)continue;const u=this.getLabelStyle(h,i,"calloutLabel"),p=this.getCalloutLineStyle(h,!1).length,f=h.outerRadius+p+s,y=h.midCos*f,x=h.midSin*f+d.collisionOffsetY;r.text=d.text,r.x=y,r.y=x,r.setFont(u),r.setAlign({textAlign:d.collisionTextAlign??d.textAlign,textBaseline:d.textBaseline}),r.setBoxing(u);const b=r.getBBox();if(d.box=b,Math.abs(d.collisionOffsetY)>n){d.hidden=!0;continue}if(l){const v=-this.centerY,S=new re(l.x-o,v,l.width+2*o,l.y+l.height+o-v);if(b.collidesBBox(S)){d.hidden=!0;continue}}if(e.hideWhenNecessary){const{maxWidth:v,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(b,t),D=b.width>v;if(S||D||M){d.hidden=!0;continue}}d.hidden=!1,a.push(b)}return a.length===0?null:re.merge(a)}updateSectorLabelNodes(){const{properties:e}=this,{positionOffset:t,positionRatio:i}=this.properties.sectorLabel,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(s),o=this.radiusScale.convert(0),a=o<=0&&this.ctx.legendManager.getData(this.id)?.filter(c=>c.enabled).length===1,r={textAlign:"center",textBaseline:"middle"},l=c=>c.each((h,d)=>{const{outerRadius:u,startAngle:p,endAngle:f}=d,y=n&&this.isItemHighlighted(s,d.datumIndex)===!0;let x=!1;if(d.sectorLabel&&u!==0){const b=this.getLabelStyle(d,e.sectorLabel,"sectorLabel",y),v=o*(1-i)+u*i+t;h.fill=b.color,h.fillOpacity=this.getHighlightStyle(y,d.datumIndex).opacity??1,h.text=d.sectorLabel.text,a?(h.x=0,h.y=0):(h.x=d.midCos*v,h.y=d.midSin*v),h.setFont(b),h.setAlign(r),h.setBoxing(b);const S=h.getBBox(),M=[[S.x,S.y],[S.x+S.width,S.y],[S.x+S.width,S.y+S.height],[S.x,S.y+S.height]],D={startAngle:p,endAngle:f,innerRadius:o,outerRadius:u};M.every(([I,k])=>wk(I,k,D))&&(x=!0)}h.visible=x});l(this.labelSelection),l(this.highlightLabelSelection)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,d)=>{const{fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,color:x}=d;h.fontStyle=u,h.fontWeight=p,h.fontSize=f,h.fontFamily=y,h.text=d.text,h.x=0,h.y=0,h.fill=x,h.textAlign="center",e.push(h.getBBox()),t.push(d.spacing)});const i=h=>h===0?0:t[h],s=h=>h===t.length-1?0:t[h],n=e.reduce((h,d)=>Math.max(h,d.width),0),o=e.reduce((h,d,u)=>h+d.height+i(u)+s(u),0),a=this.getInnerRadius(),l=Math.sqrt(Math.pow(n/2,2)+Math.pow(o/2,2))<=(a>0?a:this.getOuterRadius()),c=[];for(let h=0,d=-o/2;h{h.visible=l,Array.isArray(h.text)?h.y=c[u]-e[u].height:h.y=c[u]})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return CZ(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:o}}=this,{legendItemKey:a,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:f,tooltip:y}=n,x=this.properties.title.node.getPlainText();if(!i||!s)return;const b=s.dataSources.get(this.id)?.data?.[e],v=this.getProcessedDataValues(i,s),{angleRawValues:S}=v,M=S[e],D=this.getLabelContent(e,b,v),I=D.legendItem??D.callout??D.sector??u,k=Md(i.getDomain(this,"angleRaw","value",s)),A=o.format(this.callWithContext.bind(this),{type:"number",value:M,datum:b,seriesId:t,legendItemName:void 0,key:d,source:"tooltip",property:"angle",domain:k,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0,visibleDomain:void 0})??Ao(M,3);return this.formatTooltipWithContext(y,{title:x,symbol:this.legendItemSymbol(e),data:[{label:Oe(I),fallbackLabel:d,value:A}]},{seriesId:t,datum:b,title:u,legendItemKey:a,calloutLabelKey:r,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:d,angleName:u,radiusKey:p,radiusName:f,...this.getItemStyle({datum:b,datumIndex:e},!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.data?.[e],i=this.getItemStyle({datum:t,datumIndex:e},!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}=this.properties;let{fill:l}=i;const{stroke:c}=i;return qt(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:n,ctx:{legendManager:o}}=this;if(!s||!i||e!=="category")return[];const{angleKey:a,calloutLabelKey:r,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!r||r===a)&&(!l||l===a))return[];const d=this.getProcessedDataValues(s,i),{angleRawValues:u}=d,p=this.properties.title?.showInLegend&&this.properties.title.text,f=[],y=this.properties.hideZeroValueSectorsInLegend,x=i.dataSources.get(this.id)?.data,b=i.invalidData?.get(this.id);for(let v=0;vOe(k)).join(" - ")},symbol:this.legendItemSymbol(v),legendItemName:c==null?void 0:S[c],hideInLegend:!h})}return f}setLegendState(e){const{id:t,ctx:{legendManager:i,eventsHub:s}}=this;for(const[n,o]of e.entries())i.toggleItem(o,t,n);i.update(),s.emit("chart:request-update",{type:7})}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=oA(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);mi(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection,this.phantomHighlightSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),mi(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),ei(this,"callout",t,this.calloutLabelSelection),ei(this,"sector",t,this.labelSelection,this.highlightLabelSelection),ei(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:s,processedData:n,radiusScale:o,previousRadiusScale:a}=this,{animationManager:r}=this.ctx,l=n?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const c=(l?.moved.size??0)===0,h=(n?.defs.keys.length??0)>0,d=n?.reduced?.animationValidation?.uniqueKeys??!0;(!c||!h||!d)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(f=>f.enabled),p=oA(!1,this.properties.rotation,o,a);mi(this.id,"nodes",r,[e,t,i,s],p.nodes,(f,y)=>this.getDatumId(y.datumIndex),l),mi(this.id,"innerCircle",r,[this.innerCircleSelection],p.innerCircle),ei(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),ei(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,ei(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,phantomHighlightSelection:s,radiusScale:n,previousRadiusScale:o}=this,{animationManager:a}=this.ctx,r=oA(!1,this.properties.rotation,n,o);mi(this.id,"nodes",a,[e,t,i,s],r.nodes,(l,c)=>this.getDatumId(c.datumIndex)),mi(this.id,"innerCircle",a,[this.innerCircleSelection],r.innerCircle),Pb(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Pb(this,"sector",this.ctx.animationManager,this.labelSelection,this.highlightLabelSelection),Pb(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return`${e}`;const{calloutLabelKey:s,sectorLabelKey:n,legendItemKey:o}=this.properties;if(!i.reduced?.animationValidation?.uniqueKeys)return`${e}`;if(o){const a=t.resolveKeysById(this,"legendItemKey",i);return us(a[e])}else if(s){const a=t.resolveKeysById(this,"calloutLabelKey",i);return us(a[e])}else if(n){const a=t.resolveKeysById(this,"sectorLabelKey",i);return us(a[e])}return`${e}`}hasItemStylers(){return!(this.properties.itemStyler==null&&this.properties.calloutLabel.itemStyler==null&&this.properties.sectorLabel.itemStyler==null&&this.properties.innerLabels.every(e=>e.itemStyler==null))}};rv.className="DonutSeries",rv.type="donut";var aA={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:li.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{...Ye,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Oy],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$cacheMax:{$size:{$path:["./data",{$path:"/data"}]}}},{$palette:"strokes"}]},fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Na,xOffset:3,yOffset:3,blur:5},highlight:zy},legend:{enabled:!0}},NZ={...aA,series:{...aA.series,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},innerLabels:{$apply:{...Ye,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:zy}},TE={type:"series",name:"donut",chartType:"polar",version:de,dependencies:[el],options:o2,themeTemplate:NZ,create:e=>new rv(e)},rA=class extends rv{};rA.className="PieSeries",rA.type="pie";var OE={type:"series",name:"pie",chartType:"polar",version:de,dependencies:[el],options:_a,themeTemplate:aA,create:e=>new rA(e)},lA=class extends ri{constructor(e){super(),this.ctx=e,this.localeText=void 0}};g([Rt(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),m],lA.prototype,"localeText",2),g([Rt(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),m],lA.prototype,"getLocaleText",2);var cA={type:"plugin",name:"locale",version:de,options:{localeText:xr,getLocaleText:Ki(L)},create:e=>new lA(e)},hA={type:"axis",name:"number",chartType:"cartesian",version:de,dependencies:[hi],options:Qu,themeTemplate:{line:{enabled:!1}},create:e=>new eo(e)},PE={type:"axis",name:"log",chartType:"cartesian",version:de,dependencies:[hi],options:Ju,themeTemplate:{base:10,line:{enabled:!1}},create:e=>new xp(e)},dA={type:"axis",name:"time",chartType:"cartesian",version:de,dependencies:[hi],options:ep,themeTemplate:{gridLine:{enabled:!1}},create:e=>new Ka(e)},EE={type:"axis",name:"category",chartType:"cartesian",version:de,dependencies:[hi],options:Xu,themeTemplate:{groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:!1},interval:{placement:"between"}},create:e=>new Ff(e)},RE={type:"axis",name:"grouped-category",chartType:"cartesian",version:de,dependencies:[hi],options:qu,themeTemplate:{tick:{enabled:!0,stroke:{$ref:"separationLinesColor"}},label:{spacing:10,rotation:270,wrapping:"on-space"},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2},create:e=>new _f(e)},sl=class extends eE{constructor(e){super(e,new sc,!1),this.defaultTickMinSpacing=20,this.parentLevel=new up,this.min=void 0,this.max=void 0,this.preferredMin=void 0,this.preferredMax=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&enew sl(e)},VE=[hA,PE,dA,EE,RE,zE],BE=[Gk,tv,Zk,qk,av,tA],TZ=[VE,BE,Fk,cA].flat(),FE=[el,TE,OE,Fk,cA],uA=[TZ,FE,xE].flat(),lv={};$s(lv,{Arc:()=>Ya,BBox:()=>re,Caption:()=>Wt,CategoryScale:()=>Hu,Group:()=>Le,Line:()=>Xn,LinearScale:()=>jh,Marker:()=>Ni,Path:()=>wi,RadialColumnShape:()=>ha,Rect:()=>Ci,Scene:()=>ib,Sector:()=>vs,Shape:()=>fh,TranslatableGroup:()=>ds,getRadialColumnWidth:()=>aE,toRadians:()=>lt});var cv={};$s(cv,{AGGREGATION_INDEX_UNSET:()=>El,AGGREGATION_INDEX_X_MAX:()=>Xs,AGGREGATION_INDEX_X_MIN:()=>Zs,AGGREGATION_INDEX_Y_MAX:()=>Qs,AGGREGATION_INDEX_Y_MIN:()=>qs,AGGREGATION_MAX_POINTS:()=>hN,AGGREGATION_MIN_RANGE:()=>Nr,AGGREGATION_SPAN:()=>jn,AGGREGATION_THRESHOLD:()=>wa,AbstractModuleInstance:()=>ri,ActionOnSet:()=>Ze,AdjacencyListGraph:()=>LM,AgDocument:()=>bM,AsyncAwaitQueue:()=>jg,BASE_FONT_SIZE:()=>Uo,BREAK_TRANSFORM_CHAIN:()=>Ag,BaseProperties:()=>q,Border:()=>Pr,CANVAS_HEIGHT:()=>vN,CANVAS_TO_BUFFER_DEFAULTS:()=>SN,CANVAS_WIDTH:()=>bN,CARTESIAN_AXIS_TYPE:()=>eM,CARTESIAN_POSITION:()=>J0,CallbackCache:()=>xM,ChangeDetectableProperties:()=>dh,ChartAxisDirection:()=>_y,ChartTheme:()=>ra,ChartUpdateType:()=>Gn,CleanupRegistry:()=>ot,Color:()=>Ne,ConfiguredCanvasMixin:()=>MN,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Yd,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>qd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Qd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Jd,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>eu,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Zd,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Xd,DEFAULT_CAPTION_ALIGNMENT:()=>Or,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Ta,DEFAULT_FIBONACCI_STROKES:()=>Ud,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>rs,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Ts,DEFAULT_POLAR_SERIES_STROKE:()=>Bg,DEFAULT_SHADOW_COLOUR:()=>Na,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Fg,DEFAULT_TEXTBOX_COLOR:()=>su,DEFAULT_TEXTBOX_FILL:()=>tu,DEFAULT_TEXTBOX_STROKE:()=>iu,DEFAULT_TEXT_ANNOTATION_COLOR:()=>_g,DEFAULT_TOOLBAR_POSITION:()=>nu,DIRECTION_SWAP_AXES:()=>$d,Debug:()=>ve,DebugMetrics:()=>yo,DeclaredSceneChangeDetection:()=>Ee,DeclaredSceneObjectChangeDetection:()=>Au,Deprecated:()=>AN,DeprecatedAndRenamedTo:()=>wN,EllipsisChar:()=>Wc,ErrorType:()=>w0,EventEmitter:()=>zn,FILL_GRADIENT_BLANK_DEFAULTS:()=>aM,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>lM,FILL_GRADIENT_LINEAR_DEFAULTS:()=>Vi,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>rM,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>Ny,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>Ly,FILL_GRADIENT_RADIAL_DEFAULTS:()=>Rg,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>Yo,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>Oy,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>Ty,FILL_IMAGE_BLANK_DEFAULTS:()=>dM,FILL_IMAGE_DEFAULTS:()=>it,FILL_PATTERN_BLANK_DEFAULTS:()=>cM,FILL_PATTERN_DEFAULTS:()=>tt,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>hM,FILL_PATTERN_KEYED_DEFAULTS:()=>Ey,FILL_PATTERN_SINGLE_DEFAULTS:()=>Py,FONT_SIZE:()=>Q0,FONT_SIZE_RATIO:()=>li,IS_DARK_THEME:()=>zl,InterpolationProperties:()=>Pl,LABEL_BOXING_DEFAULTS:()=>Ye,LEGEND_CONTAINER_THEME:()=>By,LRUCache:()=>og,LineSplitter:()=>gr,Logger:()=>W,MARKER_SERIES_HIGHLIGHT_STYLE:()=>Kd,MULTI_SERIES_HIGHLIGHT_STYLE:()=>Ys,MementoCaretaker:()=>Fy,ModuleRegistry:()=>ye,ModuleType:()=>QS,ObserveChanges:()=>Rt,PALETTE_ALT_DOWN_FILL:()=>qy,PALETTE_ALT_DOWN_STROKE:()=>Zy,PALETTE_ALT_NEUTRAL_FILL:()=>Qy,PALETTE_ALT_NEUTRAL_STROKE:()=>Jy,PALETTE_ALT_UP_FILL:()=>Xy,PALETTE_ALT_UP_STROKE:()=>Yy,PALETTE_DOWN_FILL:()=>$y,PALETTE_DOWN_STROKE:()=>jy,PALETTE_NEUTRAL_FILL:()=>Uy,PALETTE_NEUTRAL_STROKE:()=>Ky,PALETTE_UP_FILL:()=>Wy,PALETTE_UP_STROKE:()=>Gy,PART_WHOLE_HIGHLIGHT_STYLE:()=>zy,POLAR_AXIS_SHAPE:()=>iM,POLAR_AXIS_TYPE:()=>tM,Padding:()=>Vr,ParallelStateMachine:()=>$M,PolarZIndexMap:()=>fM,PropertiesArray:()=>Bi,Property:()=>m,ProxyOnWrite:()=>yN,ProxyProperty:()=>Gt,ProxyPropertyOnWrite:()=>St,SAFE_FILLS_OPERATION:()=>Cy,SAFE_FILL_OPERATION:()=>oM,SAFE_RANGE2_OPERATION:()=>Nl,SAFE_STROKE_FILL_OPERATION:()=>Lr,SEGMENTATION_DEFAULTS:()=>Tl,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>Vy,SKIP_JS_BUILTINS:()=>Iy,ScaleAlignment:()=>JS,SceneArrayChangeDetection:()=>ku,SceneChangeDetection:()=>K,SceneObjectChangeDetection:()=>Hr,SceneRefChangeDetection:()=>rf,SeriesContentZIndexMap:()=>gM,SeriesZIndexMap:()=>pM,SimpleCache:()=>kN,SpanJoin:()=>pD,StateMachine:()=>he,StateMachineProperty:()=>Je,TRIPLE_EQ:()=>ph,TextMeasurer:()=>xx,TickIntervals:()=>Jg,TrimCharsRegex:()=>g0,TrimEdgeGuard:()=>Ld,UNIT_MAX:()=>Ai,UNIT_MIN:()=>yn,UnknownError:()=>gg,ValidationError:()=>Da,Vec2:()=>H,Vec4:()=>Se,Vertex:()=>NM,WeakCache:()=>kM,ZIndexMap:()=>uM,addEscapeEventListener:()=>dx,addFakeTransformToInstanceProperty:()=>m,addMouseCloseListener:()=>EM,addObserverToInstanceProperty:()=>vy,addOverrideFocusVisibleEventListener:()=>zM,addTouchCloseListener:()=>RM,addTransformToInstanceProperty:()=>Ar,aggregationBucketForDatum:()=>dN,aggregationDatumMatchesIndex:()=>uN,aggregationDomain:()=>ci,aggregationIndexForXRatio:()=>zg,aggregationRangeFittingPoints:()=>Ca,aggregationXRatioForDatumIndex:()=>th,aggregationXRatioForXValue:()=>Wn,and:()=>We,angleBetween:()=>Xo,angularPadding:()=>ix,appendEllipsis:()=>iy,applySkiaPatches:()=>IN,arcDistanceSquared:()=>CN,areScalingEqual:()=>ia,array:()=>dn,arrayLength:()=>br,arrayOf:()=>xe,arrayOfDefs:()=>Ft,arraysEqual:()=>Vn,assignIfNotStrictlyEqual:()=>Ay,attachDescription:()=>Ve,attachListener:()=>mt,autoSizedLabelOptionsDefs:()=>kr,barHighlightOptionsDef:()=>vo,bezier2DDistance:()=>hD,bezier2DExtrema:()=>lD,boolean:()=>E,borderOptionsDef:()=>Sr,boxCollides:()=>nx,boxContains:()=>Wg,boxEmpty:()=>DM,boxesEqual:()=>$g,buildDateFormatter:()=>uh,cachedTextMeasurer:()=>et,calcLineHeight:()=>Fn,calculatePlacement:()=>yx,callWithContext:()=>ls,callback:()=>at,callbackDefs:()=>Xe,callbackOf:()=>Ki,ceilTo:()=>O0,checkDatum:()=>oD,circularSliceArray:()=>mo,clamp:()=>se,clampArray:()=>Jc,clipLines:()=>YM,clipSpanX:()=>Rx,collapseSpanToPoint:()=>af,collectAggregationLevels:()=>pN,color:()=>J,colorStopsOrderValidator:()=>gy,colorUnion:()=>Ls,commonChartOptionsDefs:()=>we,commonSeriesOptionsDefs:()=>qe,commonSeriesThemeableOptionsDefs:()=>Ke,compactAggregationIndices:()=>Rl,compareDates:()=>ax,computeExtremesAggregation:()=>Tr,computeExtremesAggregationPartial:()=>Vg,constant:()=>Ce,contextMenuItemsArray:()=>Ig,countFractionDigits:()=>Uc,countLines:()=>I0,createAggregationIndices:()=>La,createButton:()=>Iu,createCanvasContext:()=>IM,createCheckbox:()=>xD,createDeprecationWarning:()=>cx,createElement:()=>ke,createElementId:()=>Rr,createIcon:()=>SD,createId:()=>gi,createIdsGenerator:()=>sf,createNumberFormatter:()=>uy,createSelect:()=>bD,createSvgElement:()=>jt,createTextArea:()=>vD,createTicks:()=>ah,date:()=>ns,dateToNumber:()=>Zi,dateTruncationForDomain:()=>tf,datesSortOrder:()=>lx,debounce:()=>ny,decodeIntervalValue:()=>JM,deepClone:()=>Pe,deepFreeze:()=>Us,defaultEpoch:()=>wx,defined:()=>le,definedZoomState:()=>Lt,diffArrays:()=>AM,distribute:()=>s0,downloadUrl:()=>UM,dropFirstWhile:()=>t0,dropLastWhile:()=>i0,durationDay:()=>jl,durationHour:()=>Gl,durationMinute:()=>Br,durationMonth:()=>Sx,durationSecond:()=>oh,durationWeek:()=>ZM,durationYear:()=>pu,easeIn:()=>oT,easeInOut:()=>aT,easeInOutQuad:()=>cT,easeInQuad:()=>rT,easeOut:()=>Ea,easeOutQuad:()=>lT,encodedToTimestamp:()=>Fr,enterpriseRegistry:()=>zi,entries:()=>rt,errorBarOptionsDefs:()=>jd,errorBarThemeableOptionsDefs:()=>Gd,estimateTickCount:()=>Nx,evaluateBezier:()=>ta,every:()=>Y0,expandLegendPosition:()=>Ol,extent:()=>Qo,extractDecoratedProperties:()=>K0,extractDomain:()=>Md,fillCssOptionsDef:()=>Ns,fillGradientDefaults:()=>xg,fillImageDefaults:()=>vg,fillOptionsDef:()=>ie,fillPatternDefaults:()=>bg,findMaxIndex:()=>ko,findMaxValue:()=>ox,findMinIndex:()=>ih,findMinMax:()=>kt,findMinValue:()=>xN,findRangeExtent:()=>Aa,first:()=>Ks,flush:()=>u0,focusCursorAtEnd:()=>Qm,fontFamilyFull:()=>Sg,fontOptionsDef:()=>$e,fontWeight:()=>_d,formatNumber:()=>CM,formatObjectValidator:()=>j0,formatPercent:()=>wM,formatValue:()=>Ao,fromPairs:()=>Z0,generateUUID:()=>cu,geoJson:()=>Fl,getAngleRatioRadians:()=>SM,getAttribute:()=>Bl,getChartTheme:()=>Nb,getDOMMatrix:()=>Zm,getDocument:()=>kl,getElementBBox:()=>m0,getIconClassNames:()=>fr,getImage:()=>a0,getLastFocus:()=>fx,getMaxInnerRectSize:()=>ex,getMidpointsForIndices:()=>Zo,getMinOuterRectSize:()=>fN,getOffscreenCanvas:()=>rg,getPath:()=>Dy,getPath2D:()=>kd,getPrevNextKeys:()=>lu,getResizeObserver:()=>r0,getSequentialColors:()=>fn,getTickTimeInterval:()=>vu,getWindow:()=>Go,googleFont:()=>my,gradientColorStops:()=>mg,gradientStrict:()=>yg,graphemeSegments:()=>Ma,greaterThan:()=>as,groupBy:()=>Id,guardTextEdges:()=>S0,hasNoModifiers:()=>ru,hasRequiredInPath:()=>Cl,highlightOptionsDef:()=>fy,htmlElement:()=>cy,inRange:()=>N0,initRovingTabIndex:()=>px,insertListItemsSorted:()=>mx,instanceOf:()=>JL,interpolationOptionsDefs:()=>kg,intervalAgo:()=>tD,intervalCeil:()=>XM,intervalEpoch:()=>Wl,intervalExtent:()=>kx,intervalFloor:()=>tn,intervalHierarchy:()=>bu,intervalMilliseconds:()=>Yi,intervalNext:()=>Ix,intervalPrevious:()=>qM,intervalRange:()=>mn,intervalRangeCount:()=>Qg,intervalRangeNumeric:()=>QM,intervalRangeStartIndex:()=>Ax,intervalStep:()=>Jo,intervalUnit:()=>wo,inverseEaseOut:()=>DD,isArray:()=>Ae,isBetweenAngles:()=>Js,isBoolean:()=>x0,isButtonClickEvent:()=>gx,isColor:()=>v0,isContinuous:()=>ch,isDate:()=>Cs,isDecoratedObject:()=>Cg,isDefined:()=>vt,isDenseInterval:()=>$l,isDirectionRtl:()=>$c,isDocumentFragment:()=>l0,isElement:()=>Xm,isEmptyObject:()=>Td,isEnumKey:()=>ZL,isEnumValue:()=>XL,isFiniteNumber:()=>je,isFunction:()=>jo,isGradientFill:()=>qt,isGradientFillArray:()=>YN,isGradientOrPatternFill:()=>ZN,isHTMLElement:()=>Ad,isHtmlElement:()=>ey,isImageFill:()=>ea,isInputPending:()=>y0,isInteger:()=>T0,isKeyOf:()=>Al,isNegative:()=>Kc,isNode:()=>lg,isNumber:()=>gt,isNumberEqual:()=>Be,isNumberObject:()=>nD,isObject:()=>me,isObjectLike:()=>Nd,isObjectWithProperty:()=>X0,isObjectWithStringProperty:()=>q0,isPatternFill:()=>Un,isPlainObject:()=>Ge,isPointLabelDatum:()=>dD,isProperties:()=>Qc,isRegExp:()=>b0,isScaleValid:()=>Kl,isSegmentTruncated:()=>ug,isString:()=>Pt,isStringFillArray:()=>rD,isStringObject:()=>Tx,isSymbol:()=>Od,isTextTruncated:()=>mr,isTimeInterval:()=>iD,isTimeIntervalUnit:()=>sD,isTruncated:()=>D0,isUnitTimeCategoryScaling:()=>_r,isValidDate:()=>Sa,isValidNumberFormat:()=>E0,iterate:()=>Cr,joinFormatted:()=>yr,jsonApply:()=>au,jsonDiff:()=>Kn,jsonPropertyCompare:()=>OM,jsonWalk:()=>Oa,kebabCase:()=>A0,labelBoxOptionsDef:()=>Hn,legendPositionValidator:()=>Hd,lessThan:()=>os,lessThanOrEqual:()=>L0,levenshteinDistance:()=>k0,lineDashOptionsDef:()=>ae,lineDistanceSquared:()=>Er,lineHighlightOptionsDef:()=>vr,lineSegmentOptions:()=>V0,lineSegmentation:()=>B0,linear:()=>MD,linearGaugeSeriesOptionsDef:()=>ka,linearGaugeSeriesThemeableOptionsDef:()=>Pg,linearGaugeTargetOptionsDef:()=>Tg,linearPoints:()=>gD,listDecoratedProperties:()=>wr,lowestGranularityForInterval:()=>Su,lowestGranularityUnitForTicks:()=>ef,lowestGranularityUnitForValue:()=>Mu,makeAccessibleClickListener:()=>RN,mapValues:()=>Zc,markerOptionsDefs:()=>So,markerStyleOptionsDefs:()=>Ir,measureTextSegments:()=>en,memo:()=>nh,merge:()=>Wd,mergeArrayDefaults:()=>My,mergeDefaults:()=>ce,modulus:()=>P0,multiSeriesHighlightOptionsDef:()=>_t,nearestSquared:()=>hu,nearestSquaredInContainer:()=>_M,nextPowerOf2:()=>eh,niceTicksDomain:()=>Lx,normalisedExtentWithMetadata:()=>sh,normalisedTimeExtentWithMetadata:()=>Ug,normalizeAngle180:()=>Gg,normalizeAngle360:()=>Qe,normalizeAngle360FromDegrees:()=>qo,normalizeAngle360Inclusive:()=>ou,number:()=>$,numberFormatValidator:()=>gn,numberMin:()=>dy,numberRange:()=>C0,object:()=>xr,objectsEqual:()=>Ht,objectsEqualWith:()=>Sy,optionsDefs:()=>Et,or:()=>Ie,padding:()=>_n,paddingOptions:()=>F0,parseColor:()=>f0,parseNumberFormat:()=>fg,partialAssign:()=>Ng,pause:()=>sx,pick:()=>Lg,placeLabels:()=>uD,positiveNumber:()=>P,positiveNumberNonZero:()=>un,preserveArabicJoining:()=>sy,previousPowerOf2:()=>Hy,radialGaugeSeriesOptionsDef:()=>Xc,radialGaugeSeriesThemeableOptionsDef:()=>Eg,radialGaugeTargetOptionsDef:()=>Og,range:()=>lh,rangeValidator:()=>Mg,ratio:()=>oe,readIntegratedWrappedValue:()=>Ox,record:()=>d0,required:()=>j,rescaleSpan:()=>hh,rescaleVisibleRange:()=>Zg,resetIds:()=>VN,resolveOperation:()=>EZ,rotatePoint:()=>tx,roundTo:()=>Vd,safeCall:()=>ay,seriesLabelOptionsDefs:()=>ft,seriesTooltipRangeValidator:()=>H0,setAttribute:()=>Fe,setAttributes:()=>Do,setDocument:()=>n0,setElementBBox:()=>dg,setElementStyle:()=>Io,setElementStyles:()=>MM,setPath:()=>ky,setWindow:()=>o0,shadowOptionsDefs:()=>$o,shallowClone:()=>_l,shapeHighlightOptionsDef:()=>It,shapeSegmentOptions:()=>z0,shapeSegmentation:()=>Ia,shapeValidator:()=>Mr,simpleMemorize:()=>Ui,simpleMemorize2:()=>zr,smoothPoints:()=>mD,solveBezier:()=>of,sortAndUniqueDates:()=>rx,sortBasedOnArray:()=>e0,spanRange:()=>cs,splitBezier2D:()=>Du,stepPoints:()=>fD,stopPageScrolling:()=>VM,strictObjectKeys:()=>Ko,strictUnion:()=>zd,string:()=>L,stringLength:()=>hy,stringifyValue:()=>Pd,strokeOptionsDef:()=>X,textOrSegments:()=>pn,themeNames:()=>PZ,themeOperator:()=>Fd,themeSymbols:()=>OZ,themes:()=>UI,throttle:()=>oy,tickFormat:()=>Cx,tickStep:()=>rh,timeInterval:()=>Yc,timeIntervalUnit:()=>Ll,toArray:()=>Dd,toDegrees:()=>vM,toFontString:()=>ty,toIterable:()=>U0,toPlainText:()=>Oe,toRadians:()=>lt,toTextString:()=>Dt,toolbarButtonOptionsDefs:()=>Dr,tooltipOptionsDefs:()=>Ue,tooltipOptionsDefsWithArea:()=>W0,transformIntegratedCategoryValue:()=>nf,truncateLine:()=>Hl,typeUnion:()=>wl,undocumented:()=>Q,unguardTextEdges:()=>M0,union:()=>U,unionSymbol:()=>Ed,unique:()=>ag,validate:()=>ki,withTimeout:()=>mN,without:()=>ee,wrapLines:()=>uu,wrapText:()=>Pa,wrapTextOrSegments:()=>du,wrapTextSegments:()=>vx});var OZ={DEFAULT_ANNOTATION_HANDLE_FILL:Yd,DEFAULT_ANNOTATION_STATISTICS_COLOR:qd,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:Qd,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:Jd,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:eu,DEFAULT_ANNOTATION_STATISTICS_FILL:Zd,DEFAULT_ANNOTATION_STATISTICS_STROKE:Xd,DEFAULT_CAPTION_ALIGNMENT:Or,DEFAULT_CAPTION_LAYOUT_STYLE:Ta,DEFAULT_FIBONACCI_STROKES:Ud,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:rs,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Ts,DEFAULT_POLAR_SERIES_STROKE:Bg,DEFAULT_SHADOW_COLOUR:Na,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:Fg,DEFAULT_TEXTBOX_COLOR:su,DEFAULT_TEXTBOX_FILL:tu,DEFAULT_TEXTBOX_STROKE:iu,DEFAULT_TEXT_ANNOTATION_COLOR:_g,DEFAULT_TOOLBAR_POSITION:nu,IS_DARK_THEME:zl,PALETTE_ALT_DOWN_FILL:qy,PALETTE_ALT_DOWN_STROKE:Zy,PALETTE_ALT_NEUTRAL_FILL:Qy,PALETTE_ALT_NEUTRAL_STROKE:Jy,PALETTE_ALT_UP_FILL:Xy,PALETTE_ALT_UP_STROKE:Yy,PALETTE_DOWN_FILL:$y,PALETTE_DOWN_STROKE:jy,PALETTE_NEUTRAL_FILL:Uy,PALETTE_NEUTRAL_STROKE:Ky,PALETTE_UP_FILL:Wy,PALETTE_UP_STROKE:Gy},PZ=Object.keys(UI);function EZ(e){const t=ra.getDefaultPublicParameters(),i=ra.getDefaultColors();return new sP({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var hv={};$s(hv,{Color:()=>Ne,interpolateColor:()=>s1});var RZ={VERSION:de,_Scene:lv,_Theme:cv,_Util:hv,create:To.create.bind(To),createSparkline:To.__createSparkline.bind(To),setup:()=>{ye.setRegistryMode(ye.RegistryMode.Integrated),ye.registerModules(uA)},isEnterprise:!1},{DataSet:zZ}=N,VZ=class extends zZ{constructor(e,t,i){super(e,t),this.childrenKey=i}commitPendingTransactions(){const e=super.commitPendingTransactions();return e&&this.dataIdKey&&(this.removeNestedDuplicatesFromRoot(),this.idToIndexCache=void 0),e}removeNestedDuplicatesFromRoot(){const e=new Set;for(const i of this.data)this.collectNestedIds(i,e);if(e.size===0)return;let t=0;for(;t0&&W.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}indexItemRecursively(e,t){const i=this.getIdValue(e);i!==void 0&&(this.idToIndexCache.has(i)||this.idToIndexCache.set(i,t));const s=e?.[this.childrenKey];if(Array.isArray(s))for(const n of s)this.indexItemRecursively(n,t)}collectUpdatedOriginalIndicesById(e,t){const i=this.getIdToIndexMap();for(const[s,n]of e){const o=i.get(s);if(o!==void 0&&!t.removedOriginalIndices.has(o)){const a=this.data[o];this.getIdValue(a)===s?(t.updatedOriginalIndices.add(o),t.pendingReplacements??(t.pendingReplacements=new Map),t.pendingReplacements.set(s,n)):this.replaceNestedItem(a,s,n)&&t.updatedOriginalIndices.add(o),e.delete(s)}}}applyRemovalsById(e,t){const i=new Set;for(const s of e){const n=this.getIdValue(s);n===void 0?W.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):i.add(n)}if(i.size!==0&&(this.removeFromGroupsByIdForHierarchy(t.prependsList,i),i.size>0&&this.removeFromGroupsByIdForHierarchy(t.insertionsList,i),t.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,t),i.size>0&&this.removeFromGroupsByIdForHierarchy(t.appendsList,i),i.size>0)){const s=this.getIdToIndexMap();for(const n of i){const o=s.get(n);if(o!==void 0){const a=this.data[o];this.getIdValue(a)===n?(t.removedOriginalIndices.add(o),t.virtualLength--):this.removeNestedItem(a,n)&&t.updatedOriginalIndices.add(o),i.delete(n)}}}}replaceNestedItem(e,t,i){const s=e?.[this.childrenKey];if(!Array.isArray(s))return!1;for(let n=0;n0;){const n=this.getIdValue(i[s]);n!==void 0&&t.has(n)?(t.delete(n),i.splice(s,1)):s++}if(t.size===0)break}}},{Chart:BZ}=N,pA=class extends BZ{getChartType(){return"standalone"}createDataSet(e){for(const t of this.series)if("childrenKey"in t.properties)return new VZ(e,this.dataIdKey,t.properties.childrenKey);return super.createDataSet(e)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,s=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=s,this.animationRect=s;for(const n of[t,i])n.translationX=Math.floor(s.x),n.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const s of this.series)i.push(s.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};pA.className="StandaloneChart",pA.type="standalone";var{standaloneChartOptionsDefs:FZ}=N,vp={type:"chart",name:"standalone",enterprise:!0,version:de,options:FZ,create(e,t){return new pA(e,t)}};function _E(e,t,i){i||(t=_Z(t));const s=new Map;for(const o of e){const a=o.datumIndex.type===0?`link-${o.datumIndex.index}`:`node-${o.datumIndex.index}`;s.set(o.id,{itemId:a,datum:o,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1})}let n=0;for(const[o,a]of s.entries())n=Math.max(n,gA(s,t,a,o,-1,[])+gA(s,t,a,o,1,[])+1);return{links:t,nodeGraph:s,maxPathLength:n}}function HE(e,t,i,s){const n=s.indexOf(t);if(n!==-1){for(let a=n;a!t.has(i))}function gA(e,t,i,s,n,o){if(o.includes(s))return 1/0;let a=n===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(a===-1){a=0;const r=n===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:h}=l,d=n===-1?h.id:c.id,u=n===-1?c.id:h.id,p=s===d?e.get(u):void 0;p!=null&&(r.push({node:p,link:l}),o?.push(s),a=Math.max(a,gA(e,t,p,u,n,o)+1),o?.pop())}n===-1?i.maxPathLengthBefore=a:i.maxPathLengthAfter=a}return a}var{findNodeDatumInArray:HZ,keyProperty:GZ,valueProperty:dv,DataController:jZ,Group:tm,HighlightState:GE,Selection:Yh,Series:WZ,TransformableText:$Z}=N,KZ=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:n}=i,o=s.contextNodeData?.nodeData.find(a=>a.datumIndex.type===n.type&&a.datumIndex.index===n.index);this.size=o?.size,this.label=o?.type===1?o?.label:void 0}},jE=class extends WZ{constructor(){super(...arguments),this.NodeEvent=KZ,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new tm({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new tm({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new tm({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new tm({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new tm({name:"linkGroup"})),this.labelSelection=Yh.select(this.labelGroup,$Z),this.linkSelection=Yh.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Yh.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Yh.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Yh.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Yh.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Yh.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(t==null)return;const{fromKey:s,toKey:n,sizeKey:o,idKey:a,labelKey:r}=this.properties,l=new jZ("standalone",e.suppressFieldDotNotation,this.ctx.eventsHub),c=i==null?null:l.request(this.id,N.DataSet.wrap(i)??N.DataSet.empty(),{props:[GZ(a,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[dv(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),h=e.request(this.id,t,{props:[dv(s,void 0,{id:"fromValue",includeProperty:!1}),dv(n,void 0,{id:"toValue",includeProperty:!1}),...o==null?[]:[dv(o,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c??Promise.resolve(null),h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(d==null){const f=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),y=u.dataModel.resolveColumnById(this,"toValue",u.processedData),x=v=>{const S=p.size,M=v;return{series:this,itemId:`node-${S}`,datum:{},datumIndex:{type:1,index:S},type:1,index:S,linksBefore:[],linksAfter:[],id:v,size:0,label:M,style:this.getNodeStyle({datumIndex:{type:1,index:S},datum:{},size:0,label:M},S,!1)}},b=u.processedData.dataSources.get(this.id)?.data;if(b)for(const[v]of b.entries()){const S=f[v],M=y[v];S==null||M==null||(p.has(S)||p.set(S,x(S)),p.has(M)||p.set(M,x(M)))}}else{const f=d.dataModel.resolveColumnById(this,"idValue",d.processedData),y=r==null?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData),x=this.data?.dataIdKey,b=d.processedData.dataSources.get(this.id)?.data;if(b)for(const[v,S]of b.entries()){const M=f[v],D=y?.[v],I={type:1,index:v},k=x==null?void 0:S[x];p.set(M,{series:this,itemId:k==null?`node-${v}`:String(k),datum:S,datumIndex:I,type:1,index:v,linksBefore:[],linksAfter:[],id:M,size:0,label:D,style:this.getNodeStyle({datumIndex:I,datum:S,size:0,label:D},v,!1)})}}this.processedNodes=p}findNodeDatum(e){return HZ(e,this.contextNodeData?.nodeData,this.data?.dataIdKey)}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:n}=this;if(s==null||n==null){const{links:x,nodeGraph:b,maxPathLength:v}=_E(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:b,links:x,maxPathLength:v}}const{sizeKey:o}=this.properties,a=s.resolveColumnById(this,"fromValue",n),r=s.resolveColumnById(this,"toValue",n),l=o==null?void 0:s.resolveColumnById(this,"sizeValue",n),c=new Map;for(const x of this.processedNodes.values()){const b=e(x);c.set(x.id,b)}const h=[],d=this.data?.dataIdKey,u=n.dataSources.get(this.id)?.data;if(u)for(const[x,b]of u.entries()){const v=a[x],S=r[x],M=l==null?1:l[x],D=c.get(v),I=c.get(S);if(M<=0||D==null||I==null)continue;const k={type:0,index:x},A=d==null?void 0:b[d],w=t({series:this,itemId:A==null?`link-${x}`:String(A),datum:b,datumIndex:k,type:0,index:x,fromNode:D,toNode:I,size:M,style:this.getLinkStyle({datum:b,datumIndex:k},D.datumIndex,!1)});h.push(w)}const{links:p,nodeGraph:f,maxPathLength:y}=_E(c.values(),h,i);for(const x of f.values())x.datum.linksBefore=x.linksBefore.map(b=>b.link),x.datum.linksAfter=x.linksAfter.map(b=>b.link);return this.nodeCount=f.size,this.linkCount=p.length,{nodeGraph:f,links:p,maxPathLength:y}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[],o=this.getHighlightedDatum();this.contentGroup.visible=this.visible;const a=o==null?GE.None:GE.OtherItem;this.contentGroup.opacity=this.properties.highlight.getStyle(a).opacity??1,this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(d=>d.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(d=>d.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,l,c,h;o?.type===1?(r=s.filter(d=>d.type===0&&(d.toNode===o||d.fromNode===o)),l=r.map(d=>d.fromNode===o?d.toNode:d.fromNode),l.push(o),c=[],h=[o]):o?.type===0?(r=[o],l=[o.fromNode,o.toNode],c=[o],h=[]):(r=[],l=[],c=[],h=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:c,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:h,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this&&e.type==null){const{itemId:t}=e,i=this.contextNodeData?.nodeData??[];e=t==null?void 0:i.find(s=>s.type===1&&s.id===t)}else e?.series!==this&&(e=void 0);return e}isLabelHighlighted(e,t){return t==null?!1:t.type===1?t===e:t.type===0?t.fromNode===e||t.toNode===e:!1}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return{domain:[]}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:n}=this.properties,{fill:o=s[t%s.length],fillOpacity:a=1,stroke:r=n[t%n.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:o,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},n)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,n),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a{const a=n.distanceSquared(e,t);ah.datum),c=r.indexOf(s)+t;c>=0&&c0?n=r.at(-1):n=Array.from(this.nodeSelection,d=>d.datum).at(-1)}else if(s?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(s)+t;c>=0&&cd.datum)[0]}if(n==null)return;const o=n.type===1?Array.from(this.nodeSelection).find(r=>r.datum===n):Array.from(this.linkSelection).find(r=>r.datum===n);if(o==null)return;const a=this.computeFocusBounds(o.node);if(a!=null)return{datum:o.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(o.datum)??0,otherIndex:0,bounds:a,clipFocusBox:!0}}getCategoryValue(e){}datumIndexForCategoryValue(e){}},{Path:UZ}=N;function WE({radius:e,startAngle:t,endAngle:i,tension:s}){const n=e*Math.cos(t),o=e*Math.sin(t),a=e*Math.cos(i),r=e*Math.sin(i),l=n*s,c=o*s,h=a*s,d=r*s;return{x:[n,l,h,a],y:[o,c,d,r]}}var nl=class extends UZ{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,s,n,o,a,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(s-t)*h+t,(n-a)*h+a,(o-r)*h+r,a,r)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:n,endAngle1:o,startAngle2:a,endAngle2:r}=this;n>a&&([n,a]=[a,n],[o,r]=[r,o]),e.clear();const l=t+s*Math.cos(n),c=i+s*Math.sin(n);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(r),i+s*Math.sin(r)),e.arc(t,i,s,r,a,!0),this.tensionedCurveTo(t+s*Math.cos(a),i+s*Math.sin(a),t,i,t,i,t+s*Math.cos(o),i+s*Math.sin(o)),e.arc(t,i,s,o,n,!0),e.closePath()}};g([K()],nl.prototype,"centerX",2),g([K()],nl.prototype,"centerY",2),g([K()],nl.prototype,"radius",2),g([K()],nl.prototype,"startAngle1",2),g([K()],nl.prototype,"endAngle1",2),g([K()],nl.prototype,"startAngle2",2),g([K()],nl.prototype,"endAngle2",2),g([K()],nl.prototype,"tension",2);var{FillGradientDefaults:YZ,FillPatternDefaults:ZZ,FillImageDefaults:XZ,makeSeriesTooltip:qZ,SeriesProperties:QZ,Label:JZ}=N,fA=class extends JZ{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};g([m],fA.prototype,"spacing",2),g([m],fA.prototype,"maxWidth",2);var Za=class extends q{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,tension:l}=this,c=this.fill??e[i%e.length],h=this.stroke??t[i%e.length];return{fill:c,fillOpacity:s,stroke:h,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,tension:l}}};g([m],Za.prototype,"fill",2),g([m],Za.prototype,"fillOpacity",2),g([m],Za.prototype,"stroke",2),g([m],Za.prototype,"strokeOpacity",2),g([m],Za.prototype,"strokeWidth",2),g([m],Za.prototype,"lineDash",2),g([m],Za.prototype,"lineDashOffset",2),g([m],Za.prototype,"tension",2),g([m],Za.prototype,"itemStyler",2);var da=class extends q{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this,l=this.fill??e[i%e.length],c=this.stroke??t[i%e.length];return{fill:l,fillOpacity:s,stroke:c,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}}};g([m],da.prototype,"spacing",2),g([m],da.prototype,"width",2),g([m],da.prototype,"fill",2),g([m],da.prototype,"fillOpacity",2),g([m],da.prototype,"stroke",2),g([m],da.prototype,"strokeOpacity",2),g([m],da.prototype,"strokeWidth",2),g([m],da.prototype,"lineDash",2),g([m],da.prototype,"lineDashOffset",2),g([m],da.prototype,"itemStyler",2);var Hi=class extends QZ{constructor(){super(...arguments),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new YZ,this.fillPatternDefaults=new ZZ,this.fillImageDefaults=new XZ,this.fills=[],this.strokes=[],this.label=new fA,this.link=new Za,this.node=new da,this.tooltip=qZ()}};g([m],Hi.prototype,"fromKey",2),g([m],Hi.prototype,"toKey",2),g([m],Hi.prototype,"idKey",2),g([m],Hi.prototype,"idName",2),g([m],Hi.prototype,"labelKey",2),g([m],Hi.prototype,"labelName",2),g([m],Hi.prototype,"sizeKey",2),g([m],Hi.prototype,"sizeName",2),g([m],Hi.prototype,"nodes",2),g([m],Hi.prototype,"fillGradientDefaults",2),g([m],Hi.prototype,"fillPatternDefaults",2),g([m],Hi.prototype,"fillImageDefaults",2),g([m],Hi.prototype,"fills",2),g([m],Hi.prototype,"strokes",2),g([m],Hi.prototype,"label",2),g([m],Hi.prototype,"link",2),g([m],Hi.prototype,"node",2),g([m],Hi.prototype,"tooltip",2);var{SeriesNodePickMode:$E,createDatumId:uv,Sector:eX,getShapeStyle:pv,getLabelStyles:tX,BBox:iX}=N,gv=e=>e.startAngle+Xo(e.startAngle,e.endAngle)/2,mA=class extends jE{constructor(e){super({moduleCtx:e,pickModes:[$E.NEAREST_NODE,$E.EXACT_SHAPE_MATCH]}),this.properties=new Hi}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new nl}nodeFactory(){return new eX}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:s}=this,{fromKey:n,toKey:o,sizeKey:a,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:h},node:{width:d,spacing:u}}=s,p=t/2,f=i/2;let y=[];const{nodeGraph:x,links:b}=this.getNodeGraph(R=>({...R,centerX:p,centerY:f,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),R=>({...R,centerX:p,centerY:f,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let v=0;for(const[R,{datum:B,linksBefore:G,linksAfter:F}]of x.entries()){const _=G.reduce((Y,{link:Z})=>Y+Z.size,0)+F.reduce((Y,{link:Z})=>Y+Z.size,0);if(_===0)x.delete(R);else{const{label:Y}=s;B.size=_,v+=B.size;const Z=Y.enabled?this.getLabelText(B.label,B.datum,r,"label",[],Y,{datum:B.datum,value:B.label,fromKey:n,toKey:o,sizeKey:a,size:B.size}):void 0;B.label=Oe(Z)}}let S=0;if(this.isLabelEnabled()){const R=et(this.properties.label);let B=0;for(const{datum:G}of x.values()){const{id:F,label:_}=G;if(_==null)continue;const Y=Pa(_,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:Z}=R.measureLines(Y);B=Math.max(Z,B),y.push({id:F,text:Y,centerX:p,centerY:f,angle:Number.NaN,radius:Number.NaN,size:G.size,datumIndex:G.datumIndex,nodeDatum:G})}S=B+l}const M=x.size;let D=Math.min(t,i)/2-d-S,I=u/D;if(S!==0&&(M*I>=1.5*Math.PI||D<=0)&&(y=[],D=Math.min(t,i)/2-d,I=u/D),M*I>=2*Math.PI||D<=0){W.warnOnce("There was insufficient space to display the Chord Series.");return}const k=D,A=D+d,w=Math.max((2*Math.PI-M*I)/v,0);let C=0;for(const{datum:R}of x.values()){R.innerRadius=k,R.outerRadius=A,R.startAngle=C,R.endAngle=C+R.size*w,C=R.endAngle+I;const B=(R.innerRadius+R.outerRadius)/2,G=gv(R);R.midPoint={x:R.centerX+B*Math.cos(G),y:R.centerY+B*Math.sin(G)}}const T=[];for(const{datum:R,linksBefore:B,linksAfter:G}of x.values()){const F=gv(R),_=[...B.map(Z=>({link:Z.link,distance:Xo(gv(Z.node.datum),F),after:!1})),...G.map(Z=>({link:Z.link,distance:Xo(gv(Z.node.datum),F),after:!0}))];let Y=R.startAngle;for(const{link:Z,after:ne}of _.toSorted((te,ue)=>te.distance-ue.distance)){const te=Z.size*w;ne?(Z.startAngle1=Y,Z.endAngle1=Y+te):(Z.startAngle2=Y,Z.endAngle2=Y+te),Y+=Z.size*w}T.push(R)}const{tension:O}=this.properties.link;for(const R of b){R.radius=D;const B=WE({radius:D,startAngle:R.startAngle1,endAngle:R.endAngle2,tension:O}),G=WE({radius:D,startAngle:R.startAngle2,endAngle:R.endAngle1,tension:O}),F=ta(...B.x,.5),_=ta(...B.y,.5),Y=ta(...G.x,.5),Z=ta(...G.y,.5);R.midPoint={x:R.centerX+(F+Y)/2,y:R.centerY+(_+Z)/2},T.push(R)}for(const R of y){const B=x.get(R.id)?.datum;B!=null&&(R.radius=A+l,R.angle=Qe(B.startAngle+Xo(B.startAngle,B.endAngle)/2),R.datumIndex=B.datumIndex,R.nodeDatum=B)}y.sort((R,B)=>R.angle-B.angle);let V=1/0,z=-1/0;return y=y.filter(R=>{const B=Fn(h),G=Math.atan2(B/2,R.radius),F=R.angle-G,_=R.angle+G;return Js(V,F,_)||Js(z,F,_)?!1:(V=Math.min(F,V),z=Math.max(_,z),!0)}),{itemId:e,nodeData:T,labelData:y}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.getHighlightedDatum();e.labelSelection.each((s,n)=>{const{size:o,text:a,centerX:r,centerY:l,radius:c,angle:h,datumIndex:d,nodeDatum:u}=n;t.size=o;const p=this.isLabelHighlighted(u,i),f=this.getHighlightStyle(p,d),y=tX(this,void 0,t,this.properties.label,p,i),{fontStyle:x,fontWeight:b,fontSize:v,fontFamily:S,color:M}=y;s.visible=!0,s.translationX=r+c*Math.cos(h),s.translationY=l+c*Math.sin(h),s.text=a,s.fill=M,s.fontStyle=x,s.fontWeight=b,s.fontSize=v,s.fontFamily=S,s.textBaseline="middle",Math.cos(h)>=0?(s.textAlign="left",s.rotation=h):(s.textAlign="right",s.rotation=h-Math.PI);const D=f.opacity??1;s.opacity=D,s.fillOpacity=D,s.setBoxing(y)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>uv(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:n,strokes:o,fillGradientDefaults:a,fillPatternDefaults:r,fillImageDefaults:l}=s,{itemStyler:c}=s.node,h=this.getHighlightStyle(i,e.datumIndex),d=ce(h,s.node.getStyle(n,o,t));let u=pv(d,a,r,l);if(c!=null&&e.datumIndex!=null){const p=this.cachedDatumCallback(uv(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const f=this.makeItemStylerParams(e,i,u);return this.callWithContext(c,f)});p&&(u=pv(ce(p,u),a,r,l))}return u.opacity=1,u}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},n,o){const{id:a}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,n,t),c=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:a,datum:e,highlightState:l,...o,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const{datumIndex:a}=o,r=this.getNodeStyle(o,a.index,i);n.setStyleProperties(r,s),n.centerX=o.centerX,n.centerY=o.centerY,n.innerRadius=o.innerRadius,n.outerRadius=o.outerRadius,n.startAngle=o.startAngle,n.endAngle=o.endAngle,n.inset=n.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>uv(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:n,properties:o}=this,{fills:a,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=o,{itemStyler:d}=o.link,u=this.getHighlightStyle(s,e),p=ce(u,o.link.getStyle(a,r,i.index));let f=pv(p,l,c,h);if(d!=null&&e!=null){const y=this.ctx.highlightManager?.getActiveHighlight(),x=this.cachedDatumCallback(uv(e.index,"link",s?"highlight":"node"),()=>{const b=this.getHighlightStateString(y,s,i);return this.callWithContext(d,{seriesId:n,datum:t,highlightState:b,...f})});x&&(f=pv(ce(x,f),l,c,h))}return f.opacity=1,f}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const a=o.fromNode.datumIndex,r=this.getLinkStyle(o,a,i);n.centerX=o.centerX,n.centerY=o.centerY,n.radius=o.radius,n.startAngle1=o.startAngle1,n.endAngle1=o.endAngle1,n.startAngle2=o.startAngle2,n.endAngle2=o.endAngle2,n.tension=r.tension,n.setStyleProperties(r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),s=(e-i)/2,n=(t-i)/2,o=new iX(s,n,e,t);return{series:o,axis:o}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:n,ctx:{formatManager:o}}=this,{fromKey:a,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=n,d=this.contextNodeData?.nodeData.find(v=>v.datumIndex.type===e.type&&v.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,f=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let x;if(d.type===0){const v=d.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:f},v,!1)}else{const v=d.label;x=this.getNodeStyle({datumIndex:e,datum:f,size:y,label:v},e.index,!1)}const b=[];if(l!=null){const v=o.format(this.callWithContext.bind(this),{type:"number",value:y,datum:f,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});b.push({label:c,fallbackLabel:l,value:v??String(y)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,x),data:b},{seriesId:t,datum:f,title:p,fromKey:a,toKey:r,sizeKey:l,sizeName:c,size:y,...x})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};mA.className="ChordSeries",mA.type="chord";var{chordSeriesThemeableOptionsDef:sX}=N,fv={...sX,...qe,type:j(Ce("chord")),fromKey:j(L),toKey:j(L),sizeKey:L,sizeName:L};fv.fillGradientDefaults=Q(xg),fv.fillPatternDefaults=Q(bg),fv.fillImageDefaults=Q(vg);var KE={type:"series",name:"chord",chartType:"standalone",enterprise:!0,solo:!0,version:de,dependencies:[vp],options:fv,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:Vi,fillPatternDefaults:tt,fillImageDefaults:it,highlight:Vy,label:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}},create:e=>new mA(e)},{BBox:nX,Path:oX}=N,UE=1e-6;function YE([e,t],[i,s]){return Math.abs(e-i)<=UE&&Math.abs(t-s)<=UE}var Xa=class extends oX{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this;return{x:(e+i+n+a)/4,y:(t+s+o+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c}=this;return Math.min(Er(e,t,i,s,n,o,1/0),Er(e,t,n,o,a,r,1/0),Er(e,t,a,r,l,c,1/0),Er(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:n,y2:o,x3:a,y3:r}=this,l=Math.min(e,i,n,a),c=Math.max(e,i,n,a)-l,h=Math.min(t,s,o,r),d=Math.max(t,s,o,r)-h;return new nX(l,h,c,d)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:n,x2:o,y2:a,x3:r,y3:l}=this,c=[[t,i],[s,n],[o,a],[r,l]];e.clear();let h,d;for(const u of c){if(h!=null&&YE(h,u)||d!=null&&YE(d,u))continue;const[p,f]=u;h==null?e.moveTo(p,f):e.lineTo(p,f),h??(h=u),d=u}e.closePath()}};g([K()],Xa.prototype,"x0",2),g([K()],Xa.prototype,"y0",2),g([K()],Xa.prototype,"x1",2),g([K()],Xa.prototype,"y1",2),g([K()],Xa.prototype,"x2",2),g([K()],Xa.prototype,"y2",2),g([K()],Xa.prototype,"x3",2),g([K()],Xa.prototype,"y3",2);var{SeriesProperties:aX,makeSeriesTooltip:rX,Label:ZE,DropShadow:lX}=N,cX=class extends ZE{},yA=class extends ZE{constructor(){super(...arguments),this.spacing=0}};g([m],yA.prototype,"spacing",2),g([m],yA.prototype,"placement",2);var Gi=class extends aX{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new lX().set({enabled:!1}),this.label=new cX,this.stageLabel=new yA,this.tooltip=rX()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,opacity:1}}};g([m],Gi.prototype,"stageKey",2),g([m],Gi.prototype,"valueKey",2),g([m],Gi.prototype,"fills",2),g([m],Gi.prototype,"fillOpacity",2),g([m],Gi.prototype,"strokes",2),g([m],Gi.prototype,"strokeWidth",2),g([m],Gi.prototype,"strokeOpacity",2),g([m],Gi.prototype,"lineDash",2),g([m],Gi.prototype,"lineDashOffset",2),g([m],Gi.prototype,"direction",2),g([m],Gi.prototype,"reverse",2),g([m],Gi.prototype,"spacing",2),g([m],Gi.prototype,"aspectRatio",2),g([m],Gi.prototype,"itemStyler",2),g([m],Gi.prototype,"shadow",2),g([m],Gi.prototype,"label",2),g([m],Gi.prototype,"stageLabel",2),g([m],Gi.prototype,"tooltip",2);function XE(e,{x:t,y:i,top:s,right:n,bottom:o,left:a}){e.x0=t-s/2,e.x1=t+s/2,e.x2=t+o/2,e.x3=t-o/2,e.y0=i-a/2,e.y1=i-n/2,e.y2=i+n/2,e.y3=i+a/2}function hX(e){return{fromFn:(n,o)=>{const{x:a,y:r}=o;let{top:l,right:c,bottom:h,left:d}=o;return e==="vertical"?(l=0,h=0):(d=0,c=0),{x:a,y:r,top:l,right:c,bottom:h,left:d}},toFn:(n,o)=>{const{x:a,y:r,top:l,right:c,bottom:h,left:d}=o;return{x:a,y:r,top:l,right:c,bottom:h,left:d}},applyFn:XE}}var{valueProperty:qE,SeriesNodePickMode:QE,createDatumId:dX,BBox:xA,Group:bA,Selection:im,Text:vA,PointerEvents:JE,fromToMotion:uX,seriesLabelFadeInAnimation:pX,getLabelStyles:gX}=N,SA=class extends N.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[QE.EXACT_SHAPE_MATCH,QE.NEAREST_NODE]}),this.properties=new Gi,this.itemGroup=this.contentGroup.appendChild(new bA({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new bA({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new bA({name:"stageLabelGroup"})),this.datumSelection=im.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=im.select(this.itemLabelGroup,vA),this.stageLabelSelection=im.select(this.stageLabelGroup,vA),this.highlightLabelSelection=im.select(this.highlightLabelGroup,vA),this.highlightDatumSelection=im.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.animationState=new he("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=JE.None,this.stageLabelGroup.pointerEvents=JE.None,this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new Xa}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}async processData(e){if(this.data==null)return;const{id:t,visible:i,ctx:{legendManager:s}}=this,{stageKey:n,valueKey:o}=this.properties,a="category",r="number",l=(d,u,p)=>i&&s.getItemEnabled({seriesId:t,itemId:p}),c=this.visible?{}:{forceValue:0},h=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[qE(n,a,{id:"xValue",allowNullKey:h}),qE(o,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:n,ctx:{legendManager:o}}=this,{stageKey:a,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:u,stageLabel:p}=s;if(t==null||i==null)return;const f=l==="horizontal",y=t.resolveColumnById(this,"xValue",i),x=t.resolveColumnById(this,"yValue",i),b=t.getDomain(this,"xValue","value",i).domain,v=t.getDomain(this,"yValue","value",i).domain,S=this.ctx.domManager.isRtl,M=et(p),D=p.placement==="after"===S;let I,k;f?(I="center",k=p.placement==="before"?"bottom":"top"):(I=D?"right":"left",k="middle");const A=p.enabled?[]:void 0;let w=0,C=0,T=0;const O=i.dataSources.get(this.id)?.data??[];for(const[ge,be]of O.entries()){const fe=y[ge];if(fe===void 0&&!this.properties.allowNullKeys)continue;const He=x[ge],Re=n&&o.getItemEnabled({seriesId:e,itemId:ge});if(T+=He,A==null)continue;const ze=this.getLabelText(fe,be,a,"x",b,this.properties.stageLabel,{datum:be,value:He,stageKey:a,valueKey:r},this.properties.allowNullKeys??!1),{width:Te,height:Me}=Ae(ze)?en(ze,u):M.measureLines(Dt(ze));w=Math.max(w,Te),C=Math.max(C,Me),A.push({x:Number.NaN,y:Number.NaN,text:ze,textAlign:I,textBaseline:k,visible:Re})}const V=this._nodeDataDependencies?.seriesRectWidth??0,z=this._nodeDataDependencies?.seriesRectHeight??0,R=h*(i.input.count-1);let B;if(f){const ge=C+p.spacing;B=new xA(0,p.placement==="before"?ge:0,V,z-ge)}else{const ge=w+p.spacing;B=new xA(D?ge:0,0,V-ge,z)}if(d!=null&&d!==0){const ge=l==="horizontal"?1/d:d,be=Math.min(B.width,B.height*ge),fe=be/ge;B=new xA(B.x+(B.width-be)/2,B.y+(B.height-fe)/2,be,fe)}let G,F;f?F=p.placement==="before"?B.y-p.spacing:B.y+B.height+p.spacing:G=D?B.x-p.spacing:B.x+B.width+p.spacing;const _=B.width-(f?R:0),Y=B.height-(f?0:R);if(_<0||Y<0)return;const Z=[],ne=[];let te=0,ue=0;for(const[ge,be]of O.entries()){const fe=y[ge];if(fe===void 0&&!this.properties.allowNullKeys)continue;const He=x[ge],Re=n&&o.getItemEnabled({seriesId:e,itemId:ge}),ze=te+He,Te=(te+ze)/(2*T),Me=(ze-te)/T,De=f?_*Te+h*ge:_*.5,pe=f?Y*.5:Y*Te+h*ge,dt=B.x+De,yt=B.y+pe;if(A!=null){const pi=A[ue++];pi.x=G??dt,pi.y=F??yt}let ut,bt,pt,ui;if(f){const pi=_*Me;ut=pi,pt=pi;const fo=(De+pi/2)*(Y/B.width),ya=(De-pi/2)*(Y/B.width);bt=c?B.height-fo:fo,ui=c?B.height-ya:ya}else{const pi=Y*Me;bt=pi,ui=pi;const fo=(pe-pi/2)*(_/B.height),ya=(pe+pi/2)*(_/B.height);ut=c?B.width-fo:fo,pt=c?B.width-ya:ya}const ws=this.getLabelText(He,be,r,"y",v,u,{datum:be,value:He,stageKey:a,valueKey:r}),go={x:dt,y:yt,text:ws,textAlign:"center",textBaseline:"middle",visible:Re};ne.push(go),Z.push({series:this,datum:be,datumIndex:ge,index:ge,xValue:fe,yValue:He,x:dt,y:yt,top:ut,right:bt,bottom:pt,left:ui,label:go,enabled:Re,midPoint:{x:dt,y:yt},style:this.getItemStyle({datumIndex:ge,datum:be},!1)}),te=ze}return{itemId:e,nodeData:Z,labelData:ne,stageLabelData:A,bounds:B}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:n,highlightLabelSelection:o}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();a!=null&&(a.series!==this||a.datum==null)&&(a=void 0);const r=this.contextNodeData?.nodeData??[],l=this.contextNodeData?.labelData??[],c=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:l,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:c,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel,checkActiveHighlight:!0});const h=this.getHighlightLabelData(l,a)??[];this.highlightLabelSelection=o.update(h),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,labelProperties:this.properties.label,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:a==null?[]:[a],datumSelection:n}),this.updateDatumStyles({datumSelection:n,isHighlight:!0}),this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{properties:s}=this,{itemStyler:n}=s,o=this.getHighlightStyle(i,e);let r=ce(o,s.getStyle(e));if(n!=null&&e!=null){const l=this.cachedDatumCallback(dX(e,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(t,e,i,r);return this.callWithContext(n,c)});l&&(r=ce(l,r))}return r}makeItemStylerParams(e,t,i,s){const{id:n,properties:o}=this,{stageKey:a,valueKey:r}=o,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,stageKey:a,valueKey:r,highlightState:c,...s,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){const{properties:t}=this,{shadow:i}=t,s=this.contextNodeData?.bounds,n=s?{series:s,axis:s}:void 0;e.each((o,a)=>{o.setStyleProperties(a.style,n),XE(o,a),o.fillShadow=i})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight(),{labelSelection:i,labelProperties:s,isHighlight:n=!1,checkActiveHighlight:o=!1}=e;i.each((a,r,l)=>{const{visible:c,x:h,y:d,text:u,textAlign:p,textBaseline:f}=r,y=n||o&&t?.datumIndex===l,x=this.getHighlightStyle(y,l),b=gX(this,void 0,this.properties,s,y,t),{color:v,fontSize:S,fontStyle:M,fontWeight:D,fontFamily:I}=b;a.visible=c,a.x=h,a.y=d,a.text=u,a.fill=v,a.opacity=(x.opacity??1)*(b.fillOpacity??1),a.fillOpacity=(x.opacity??1)*(b.fillOpacity??1),a.fontStyle=M,a.fontWeight=D,a.fontSize=S,a.fontFamily=I,a.textAlign=p,a.textBaseline=f,a.setBoxing(b)})}getHighlightLabelData(e,t){if(t?.label)return[{...t.label}]}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0){for(const i of this.datumSelection)if(i.datum===t)return i.node}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r}=n;if(!i||!s)return;const l=s.dataSources.get(this.id)?.data[e],c=i.resolveColumnById(this,"xValue",s)[e],h=i.resolveColumnById(this,"yValue",s)[e],d=this.properties.allowNullKeys??!1;if(c===void 0&&!d)return;const u=this.getLabelText(c,l,o,"x",i.getDomain(this,"xValue","value",s).domain,this.properties.stageLabel,{datum:l,value:c,stageKey:o,valueKey:a}),p=this.getItemStyle({datumIndex:e,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:Oe(u),value:Oe(h)}]},{seriesId:t,datum:l,title:void 0,stageKey:o,valueKey:a,...p})}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(e,t);a{const h=r[c],d=this.properties.allowNullKeys??!1;if(!(h==null&&!d))return{legendType:"category",id:s,datum:l,itemId:c,seriesId:s,enabled:o&&n.getItemEnabled({seriesId:s,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),hideInLegend:!a}}).filter(l=>l!=null)}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,s=hX(i.direction);uX(this.id,"nodes",this.ctx.animationManager,[e],s),pX(this,"labels",this.ctx.animationManager,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};SA.className="PyramidSeries",SA.type="pyramid";var{pyramidSeriesThemeableOptionsDef:fX}=N,mX={...fX,...qe,type:j(Ce("pyramid")),stageKey:j(L),valueKey:j(L)},yX={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacing:2,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Vi],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},stageLabel:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:Na,xOffset:3,yOffset:3,blur:5},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.4}}}},eR={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,solo:!0,version:de,dependencies:[vp],options:mX,themeTemplate:yX,create:e=>new SA(e)},{BBox:xX,Path:bX}=N,Zh=class extends bX{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[]}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new xX(e,i,t,s)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.height-2*this.inset,s=i/2;let n=this.x1+t,o=this.y1+t;e.moveTo(n,o);for(const l of this.elbows)this.updatePathSection(n,o,l.x,l.y,i,-s),n=l.x,o=l.y;const a=this.x2-t,r=this.y2+t;this.updatePathSection(n,o,a,r,i,-s),e.lineTo(a,r+i),n=a,o=r;for(const l of this.elbows.toReversed())this.updatePathSection(n,o,l.x,l.y,i,s),n=l.x,o=l.y;this.updatePathSection(n,o,this.x1+t,this.y1+t,i,s),e.closePath()}updatePathSection(e,t,i,s,n,o){const{path:a}=this,r=H.from(e,t+o+n/2),l=H.from(i,s+o+n/2);if(Math.abs(l.y-r.y)<2){a.lineTo(l.x,l.y);return}let c=H.angle(H.sub(l,r));c<0&&(c=2*Math.PI+c);const h=0,d=Math.PI/2,u=Math.PI,p=Math.PI*1.5,f=tR(r,l,0),y=tR(r,l,n);if(f.radius=p?(a.arc(r.x,t-f.radius,f.radius,d,d+y.angle,!0),a.arc(l.x,s+y.radius,y.radius,p+y.angle,p),a.lineTo(l.x,l.y)):c>h&&c<=d?(a.arc(r.x,t+y.radius,y.radius,p,p+y.angle),a.arc(l.x,s-f.radius,f.radius,d+f.angle,d,!0),a.lineTo(l.x,l.y)):c>d&&c<=u?(a.arc(r.x,t+y.radius,y.radius-n,p,p+y.angle,!0),a.arc(l.x,s-f.radius,f.radius+n,d+f.angle,d),a.lineTo(l.x,l.y)):(a.arc(r.x,t-f.radius,f.radius+n,d,d+f.angle),a.arc(l.x,s+y.radius,y.radius-n,p+y.angle,p,!0),a.lineTo(l.x,l.y))}};g([K()],Zh.prototype,"x1",2),g([K()],Zh.prototype,"x2",2),g([K()],Zh.prototype,"y1",2),g([K()],Zh.prototype,"y2",2),g([K()],Zh.prototype,"height",2),g([K()],Zh.prototype,"inset",2);function tR(e,t,i){const s=H.angle(H.sub(t,e)),n=H.distance(e,t),o=H.add(e,H.rotate(H.from(n/2,0),s)),a=-1/H.gradient(e,t),r=H.intercept(o,a),l=vX(.1,.5,Math.PI/2-Math.abs(H.gradient(e,t))),c=H.intersectAtX(a,r,e.x),h=Math.max(i,H.distance(e,c)*l);return{angle:H.angle(H.sub(c,e),H.sub(c,o))/-(1.1-l),radius:h}}function vX(e,t,i){return se(e,(t-e)*i+e,t)}var{FillGradientDefaults:SX,FillPatternDefaults:MX,FillImageDefaults:DX,makeSeriesTooltip:IX,SeriesProperties:kX,Label:AX}=N,mv=class extends AX{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};g([m],mv.prototype,"spacing",2),g([m],mv.prototype,"placement",2),g([m],mv.prototype,"edgePlacement",2);var ol=class extends q{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],ol.prototype,"fill",2),g([m],ol.prototype,"fillOpacity",2),g([m],ol.prototype,"stroke",2),g([m],ol.prototype,"strokeOpacity",2),g([m],ol.prototype,"strokeWidth",2),g([m],ol.prototype,"lineDash",2),g([m],ol.prototype,"lineDashOffset",2),g([m],ol.prototype,"itemStyler",2);var nn=class extends q{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],nn.prototype,"spacing",2),g([m],nn.prototype,"minSpacing",2),g([m],nn.prototype,"width",2),g([m],nn.prototype,"alignment",2),g([m],nn.prototype,"verticalAlignment",2),g([m],nn.prototype,"sort",2),g([m],nn.prototype,"fill",2),g([m],nn.prototype,"fillOpacity",2),g([m],nn.prototype,"stroke",2),g([m],nn.prototype,"strokeOpacity",2),g([m],nn.prototype,"strokeWidth",2),g([m],nn.prototype,"lineDash",2),g([m],nn.prototype,"lineDashOffset",2),g([m],nn.prototype,"itemStyler",2);var Si=class extends kX{constructor(){super(...arguments),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new SX,this.fillPatternDefaults=new MX,this.fillImageDefaults=new DX,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new mv,this.link=new ol,this.node=new nn,this.tooltip=IX()}getStyle(e,t,i,s){const{fillOpacity:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l,fill:c=t[s%t.length],stroke:h=i[s%t.length]}=e?this.link:this.node;return{fill:c,fillOpacity:n,stroke:h,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}};g([m],Si.prototype,"nodes",2),g([m],Si.prototype,"fromKey",2),g([m],Si.prototype,"toKey",2),g([m],Si.prototype,"idKey",2),g([m],Si.prototype,"idName",2),g([m],Si.prototype,"labelKey",2),g([m],Si.prototype,"labelName",2),g([m],Si.prototype,"sizeKey",2),g([m],Si.prototype,"sizeName",2),g([m],Si.prototype,"fillGradientDefaults",2),g([m],Si.prototype,"fillPatternDefaults",2),g([m],Si.prototype,"fillImageDefaults",2),g([m],Si.prototype,"defaultColorRange",2),g([m],Si.prototype,"defaultPatternFills",2),g([m],Si.prototype,"fills",2),g([m],Si.prototype,"strokes",2),g([m],Si.prototype,"label",2),g([m],Si.prototype,"link",2),g([m],Si.prototype,"node",2),g([m],Si.prototype,"tooltip",2);var{Transformable:wX,SeriesNodePickMode:iR,createDatumId:yv,getShapeStyle:sR,getLabelStyles:CX,Rect:nR,BBox:oR}=N,MA=class extends jE{constructor(e){super({moduleCtx:e,pickModes:[iR.NEAREST_NODE,iR.EXACT_SHAPE_MATCH]}),this.properties=new Si}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Zh}nodeFactory(){return new nR}createNodeData(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this.properties.node.width,{nodeGraph:i,links:s,maxPathLength:n}=this.getNodeGraph(this.createNode.bind(this,t),this.createLink,{includeCircularReferences:!1}),o=i;if(o.size===0)return;const a=this.initialiseColumns(n);this.assignNodesToColumns(o,a,n);const r=et(this.properties.label),{columnLabelInsetBefore:l,columnLabelInsetAfter:c}=this.getColumnLabelInsets(a,r,n),h=(e-t-l-c)/(n-1);this.positionNodesInColumnsX(a,h,l),this.createGhostNodesAndColumnDiffs(o,a),this.weightNodes(a);const d=1,{sizeScale:u,nodeSpacing:p}=this.getScaleAndSpacing(a,d);if(u<0){W.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}this.positionNodesInColumnsY(a,d,u,p),this.sortAndPositionLinks(o,u);const f=[],y=[];return this.createNodesNodeData(f,o,a,h,r,y),this.createLinksNodeData(f,s,d,u),{itemId:this.id,nodeData:f,labelData:y}}createNode(e,t){return{...t,x:Number.NaN,y:Number.NaN,width:e,height:Number.NaN}}createLink(e){return{...e,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}}initialiseColumns(e){const t=[];for(let i=0;iy+x.size,0),h.reduce((y,{link:x})=>y+x.size,0));if(c.length===0&&h.length===0||d===0){r.columnIndex=-1;continue}const u=this.getNodeColumn(t,r,i);l.size=d;const{label:p}=this.properties,f=p.enabled?this.getLabelText(l.label,l.datum,a,"label",[],this.properties.label,{datum:l.datum,value:l.label,fromKey:s,toKey:n,sizeKey:o,size:d}):void 0;l.label=Oe(f),u.nodes.push(r),u.size+=d,r.columnIndex=u.index}}getNodeColumn(e,t,i){const{node:{alignment:s}}=this.properties,{linksBefore:n,linksAfter:o,maxPathLengthBefore:a,maxPathLengthAfter:r}=t;let l;switch(s){case"left":l=e[a];break;case"right":l=e[i-1-r];break;case"center":{if(n.length!==0)l=e[a];else if(o.length===0)l=e[0];else{const c=o.reduce((h,d)=>Math.min(h,d.node.maxPathLengthBefore),i)-1;l=e[c]}break}case"justify":{l=o.length===0?e[i-1]:e[a];break}}return l}getColumnLabelInsets(e,t,i){const{label:{spacing:s,placement:n,edgePlacement:o},node:{width:a}}=this.properties,r=this._nodeDataDependencies?.seriesRectWidth??0;let l=0,c=0;if(this.isLabelEnabled()&&(o==="outside"||o==null)){const h=(d,u)=>{const p=u;if(p.datum.label==null||p.datum.label==="")return d;let f=(r-a)/(i-1)-s;n==="center"&&o==null&&(f/=2);const y=Pa(p.datum.label,{maxWidth:f,maxHeight:p.datum.height,font:this.properties.label,textWrap:"never"});let{width:x}=t.measureLines(y);return n==="center"&&o==null&&(x/=2),Math.max(d,x)};(n!=="right"||o==="outside")&&(l=a+e[0].nodes.reduce(h,0)),(n!=="left"||o==="outside")&&(c=a+e.at(-1).nodes.reduce(h,0))}return{columnLabelInsetBefore:l,columnLabelInsetAfter:c}}positionNodesInColumnsX(e,t,i){for(let s=0;se.columnIndex;o--){const a=s.link.size,r={ghost:!0,datum:{...e.datum,size:a,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:o-1,datum:{size:a}}}],linksAfter:[{node:{columnIndex:o+1,datum:{size:a}}}],link:s.link,columnIndex:e.columnIndex,size:e.datum.size,closestColumnDiff:i,fromNode:{y:n.datum.y},toNode:{y:0}};t[o].size+=a,t[o].nodes.push(r)}}}weightNodes(e){const{properties:t}=this;if(t.node.sort==="data")return;if(t.node.sort!=="auto"){for(const n of e)n.nodes.sort((o,a)=>this.sortNodes(o,a));return}const i=e.toSorted((n,o)=>{const a=n.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0);return o.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0)-a}),s={};for(let n=0;no.weight-a.weight)}for(const n of e){for(const o of n.nodes)"ghost"in o&&o.ghost||(o.weight+=o.linksBefore.reduce((a,r)=>{if(r.node.columnIndex!==n.index-1)return a;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*s[r.node.columnIndex];return Math.max(a,l)},0),o.weight+=o.linksAfter.reduce((a,r)=>{if(r.node.columnIndex!==n.index+1)return a;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*s[r.node.columnIndex];return Math.max(a,l)},0));n.nodes.sort((o,a)=>this.sortNodes(o,a))}}getScaleAndSpacing(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0,s=a=>e.reduce((r,{size:l,nodes:c})=>{const h=i-c.length*t,u=(1-(c.length-1)*a/h)/l;return Math.min(r,u)},1/0);let n=this.properties.node.spacing,o=s(n);for(;o<0&&n>this.properties.node.minSpacing;)n-=1,o=s(n);return{nodeSpacing:n,sizeScale:o}}positionNodesInColumnsY(e,t,i,s){const n=this._nodeDataDependencies?.seriesRectHeight??0;for(const o of e){let a=0;for(const c of o.nodes){const h=n*c.datum.size*i;c.datum.height=Math.max(t,h),a+=h}const r=s*(o.nodes.length-1);let l=0;this.properties.node.verticalAlignment==="bottom"?l=n-a-r:this.properties.node.verticalAlignment==="center"&&(l=(n-a-r)/2);for(const c of o.nodes)c.datum.y=l,l+=n*c.datum.size*i+s,"ghost"in c&&c.ghost&&c.link.elbows.push({x:o.x,y:c.datum.y})}}sortAndPositionLinks(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0;for(const{datum:s,linksBefore:n,linksAfter:o}of e.values()){let a=s.y;n.sort((l,c)=>this.sortNodes(l.node,c.node));for(const{link:l}of n)l.y2=a,a+=l.size*i*t;let r=s.y;o.sort((l,c)=>this.sortNodes(l.node,c.node,{invertColumnSort:!0}));for(const{link:l}of o)l.y1=r,r+=l.size*i*t}}createNodesNodeData(e,t,i,s,n,o){for(const[a,r]of i.entries()){const l=a===0,c=a===i.length-1;let h=-1/0;r.nodes.sort((d,u)=>d.datum.y-u.datum.y);for(const d of r.nodes){if("ghost"in d&&d.ghost)continue;const{datum:u}=d;u.midPoint={x:u.x+u.width/2,y:u.y+u.height/2},e.push(u),h=this.createNodeLabelData(t,s,n,o,u,l,c,h)}}}createNodeLabelData(e,t,i,s,n,o,a,r){if(n.label==null)return r;const{label:{spacing:l,edgePlacement:c,fontSize:h}}=this.properties,d=this._nodeDataDependencies?.seriesRectWidth??0,u=n.y+n.height/2;let p;if(!o&&!a){const S=Fn(h),M=u-S,D=u+S;let I=d;for(const{datum:A}of e.values())A.x>n.x&&Math.max(A.y,M)<=Math.min(A.y+A.height,D)&&(I=Math.min(I,A.x-l));const k=I-n.x-2*l;p=Pa(n.label,{maxWidth:k,maxHeight:n.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(p==null||p===""){const S=c==null&&(o||a)?l:l*2;p=Pa(n.label,{maxWidth:t-S,maxHeight:n.height,font:this.properties.label,textWrap:"never"})}if(p==="")return r;const{height:f}=i.measureLines(p),y=u-f/2,x=u+f/2,{x:b,textAlign:v}=this.getNodeLabelPlacement(n,o,a);return y>=r&&(s.push({x:b,y:u,textAlign:v,text:p,size:n.size,nodeDatum:n,datumIndex:n.datumIndex}),r=x),r}getNodeLabelPlacement(e,t,i){const{label:{spacing:s,placement:n,edgePlacement:o}}=this.properties;let a=e.x+e.width+s,r="left",l=n;return t&&o==null&&n==null&&(l="left"),o==="outside"?(t&&(l="left"),i&&(l="right")):o==="inside"&&(t&&(l="right"),i&&(l="left")),l==="left"?(a=e.x-s,r="right"):l==="center"&&(a=e.x+e.width/2,r="center"),{x:a,textAlign:r}}createLinksNodeData(e,t,i,s){const n=this._nodeDataDependencies?.seriesRectHeight??0,o=this.properties.node.width;for(const a of t){const{fromNode:r,toNode:l,size:c}=a;a.height=Math.max(i,n*c*s),a.x1=r.x+o,a.x2=l.x,a.midPoint={x:(a.x1+a.x2)/2,y:(a.y1+a.y2)/2+a.height/2},e.push(a)}}sortNodes(e,t,i){const{properties:s}=this;return s.node.sort==="ascending"?(e.datum.label??"").localeCompare(t.datum.label??""):s.node.sort==="descending"?(t.datum.label??"").localeCompare(e.datum.label??""):s.node.sort==="data"?0:e.columnIndext.columnIndex?i?.invertColumnSort?-1:1:e.weight===t.weight?e.datum.size-t.datum.size:e.closestColumnDifft.closestColumnDiff?-1:e.weight-t.weight}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t=this.getHighlightedDatum();e.labelSelection.each((i,s)=>{const{x:n,y:o,textAlign:a,text:r,datumIndex:l,nodeDatum:c}=s,h={fromKey:this.properties.fromKey,size:s.size,sizeKey:this.properties.sizeKey,toKey:this.properties.toKey},d=this.isLabelHighlighted(c,t),u=this.getHighlightStyle(d,l),p=CX(this,void 0,h,this.properties.label,d,t),{color:f,fontStyle:y,fontWeight:x,fontSize:b,fontFamily:v}=p;i.visible=!0,i.x=n,i.y=o,i.text=r,i.fill=f,i.fontStyle=y,i.fontWeight=x,i.fontSize=b,i.fontFamily=v,i.textAlign=a,i.textBaseline="middle";const S=u.opacity??1;i.opacity=S,i.fillOpacity=S,i.setBoxing(p)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>yv(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:n,strokes:o,defaultColorRange:a,defaultPatternFills:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=s,{itemStyler:d}=s.node,u=a[t%a.length].map(v=>({color:v})),p=r[t%r.length],f=this.getHighlightStyle(i,e.datumIndex),y=ce(f,s.getStyle(!1,n,o,t)),x=s.node.fill!=null;let b=sR(y,x?l:{...l.toJson(),colorStops:u},x?c:{...c.toJson(),fill:p,stroke:p},h);if(d!=null&&e.datumIndex!=null){const v=this.cachedDatumCallback(yv(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const S=this.makeItemStylerParams(e,i,b);return this.callWithContext(d,S)});v&&(b=ce(v,b,{...l.toJson(),colorStops:u},{...c.toJson(),fill:p,stroke:p},h))}return b.opacity=1,b}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},n,o){const{id:a}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,n,t),c=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:a,datum:e,highlightState:l,...o,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const{datumIndex:a}=o,r=this.getNodeStyle(o,a.index,i);n.x=o.x,n.y=o.y,n.width=Math.max(o.width,0),n.height=Math.max(o.height,0),n.setStyleProperties(r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new oR(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>yv(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:n,properties:o}=this,{fills:a,strokes:r,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=o,{itemStyler:p}=o.link,f=l[i.index%l.length].map(M=>({color:M})),y=c[i.index%c.length],x=this.getHighlightStyle(s,e),b=ce(x,o.getStyle(!0,a,r,i.index)),v=o.link.fill!=null;let S=sR(b,v?h:{...h.toJson(),colorStops:f},v?d:{...d.toJson(),fill:y,stroke:y},u);if(p!=null&&e!=null){const M=this.cachedDatumCallback(yv(e.index,"link",s?"highlight":"node"),()=>{const D=this.ctx.highlightManager?.getActiveHighlight(),I=this.getHighlightStateString(D,s,e);return this.callWithContext(p,{seriesId:n,datum:t,highlightState:I,...S})});M&&(S=ce(M,S,{...h.toJson(),colorStops:f},{...d.toJson(),fill:y,stroke:y},u))}return S.opacity=1,S}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((n,o)=>{const a=o.fromNode.datumIndex,r=this.getLinkStyle(o,a,i);n.x1=o.x1,n.y1=o.y1,n.x2=o.x2,n.y2=o.y2,n.height=o.height,n.elbows=o.elbows,n.setStyleProperties(r,s),n.inset=n.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:n,ctx:{formatManager:o}}=this,{fromKey:a,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=n,d=this.contextNodeData?.nodeData.find(v=>v.datumIndex.type===e.type&&v.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,f=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let x;if(d.type===0){const v=d.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:f},v,!1)}else x=this.getNodeStyle({datumIndex:e,datum:f},e.index,!1);const b=[];if(l!=null){const v=o.format(this.callWithContext.bind(this),{type:"number",value:y,datum:f,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});b.push({label:c,fallbackLabel:l,value:v??String(y)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,x),data:b},{seriesId:t,datum:f,title:p,fromKey:a,toKey:r,sizeKey:l,sizeName:c,size:y,...x})}computeFocusBounds(e){if(e instanceof nR){const{x:t,y:i,width:s,height:n}=e,o=new oR(t,i,s,n);return wX.toCanvas(this.contentGroup,o)}return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};MA.className="SankeySeries",MA.type="sankey";var{sankeySeriesThemeableOptionsDef:LX}=N,Sp={...LX,...qe,type:j(Ce("sankey")),fromKey:j(L),toKey:j(L),sizeKey:L,sizeName:L};Sp.fillGradientDefaults=Q(xg),Sp.fillPatternDefaults=Q(bg),Sp.fillImageDefaults=Q(vg),Sp.defaultColorRange=Q(xe(xe(J))),Sp.defaultPatternFills=Q(xe(J));var aR={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,solo:!0,version:de,dependencies:[vp],options:Sp,themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:Vi,fillPatternDefaults:tt,fillImageDefaults:it,defaultColorRange:{$palette:"gradients"},defaultPatternFills:Cy,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.5}},label:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:{$if:[{$greaterThan:[{$path:"./minSpacing"},20]},{$path:"./minSpacing"},20]},minSpacing:0,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}}},legend:{enabled:!1,toggleSeries:!1}},create:e=>new MA(e)};function NX(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:n,minimumFontSize:o=n}=t,a=i-s,r=n-o;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:n}];for(;l>s||c>o;){const d=a>0?(l-s)/a:-1,u=r>0?(c-o)/r:-1;d>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function rR(e,t,i,s,{padding:n},o){const{spacing:a=0}=t,r=2*n,l=2*n+a,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>o(c+l,!1).height-l)return;const h=NX(t,s),d={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let p,f;return ox(0,h.length-1,y=>{const{labelFontSize:x,secondaryLabelFontSize:b}=h[y],v=y===0,S={...d,fontSize:x},M={...u,fontSize:b},D=et(S).lineHeight(),I=et(M).lineHeight(),k=o(D+I+l,v),A=k.width-r,w=k.height-l;if(D+I>w||(p?.fontSize!==x&&(p=cR(t,e,A,w,S,t.wrapping,v?t.overflowStrategy:"hide")),p==null||p.width>A||p.height>w)||(f?.fontSize!==b&&(f=cR(s,i,A,w,M,s.wrapping,v?s.overflowStrategy:"hide")),f==null))return;const C=p.height+f.height;if(!(f.width>A||C>w))return{width:Math.max(p.width,f.width),height:C+a,meta:k.meta,label:p,secondaryLabel:f}})}function sm(e,t,{padding:i},s){const n=2*i,o=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),a={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return ox(o,t.fontSize,r=>{const l={...a,fontSize:r},c=et(l),h=r===o,d=t.lineHeight??c.lineHeight(),u=s(d+n,h),p=u.width-n,f=u.height-n;if(d>f||p<0)return;const y=uu(e,{maxWidth:p,maxHeight:f,font:l,textWrap:t.wrapping,overflow:(h?t.overflowStrategy:null)??"hide"});if(!y.length)return;const{width:x,height:b}=c.measureLines(y),v=y.join(` `);return[{width:x,height:b,text:v,fontSize:r,lineHeight:d},u.meta]})}function lR(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function DA(e,t,i,s,n,o){const a=t.enabled?e:void 0,r=s.enabled?i:void 0;(lR(t)||lR(s))&&W.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;a!=null&&r!=null&&(l=rR(a,t,r,s,n,o));let c;if(l==null&&a!=null&&(c=sm(a,t,n,o)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let h;if(l==null&&a==null&&r!=null&&(h=sm(r,s,n,o)),h!=null){const[d,u]=h;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function cR(e,t,i,s,n,o,a){const r=uu(t,{maxWidth:i,maxHeight:s,font:n,textWrap:o,overflow:a});if(!r.length)return;const l=et(n),c=e.lineHeight??l.lineHeight(),{width:h}=l.measureLines(r);return{width:h,lineHeight:c,text:r.join(` `),height:r.length*c,fontSize:n.fontSize}}var Mp=class extends N.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};g([m],Mp.prototype,"wrapping",2),g([m],Mp.prototype,"overflowStrategy",2),g([m],Mp.prototype,"lineHeight",2),g([m],Mp.prototype,"minimumFontSize",2);var Dp=class extends Mp{constructor(){super(...arguments),this.spacing=0}};g([m],Dp.prototype,"spacing",2);var xv=class extends Mp{},{HierarchySeriesProperties:TX,makeSeriesTooltip:OX,HighlightProperties:PX}=N,mc=class extends q{};g([m],mc.prototype,"fill",2),g([m],mc.prototype,"fillOpacity",2),g([m],mc.prototype,"stroke",2),g([m],mc.prototype,"strokeWidth",2),g([m],mc.prototype,"strokeOpacity",2),g([m],mc.prototype,"opacity",2);var IA=class extends PX{constructor(){super(...arguments),this.highlightedBranch=new mc,this.unhighlightedBranch=new mc}};g([m],IA.prototype,"highlightedBranch",2),g([m],IA.prototype,"unhighlightedBranch",2);var on=class extends TX{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlight=new IA,this.label=new Dp,this.secondaryLabel=new xv,this.tooltip=OX()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:n,strokeOpacity:o,opacity:1}}};g([m],on.prototype,"sizeName",2),g([m],on.prototype,"labelKey",2),g([m],on.prototype,"secondaryLabelKey",2),g([m],on.prototype,"fillOpacity",2),g([m],on.prototype,"strokeWidth",2),g([m],on.prototype,"strokeOpacity",2),g([m],on.prototype,"cornerRadius",2),g([m],on.prototype,"sectorSpacing",2),g([m],on.prototype,"padding",2),g([m],on.prototype,"itemStyler",2),g([m],on.prototype,"highlight",2),g([m],on.prototype,"label",2),g([m],on.prototype,"secondaryLabel",2),g([m],on.prototype,"tooltip",2);var{fromToMotion:EX,createDatumId:RX,PointerEvents:zX,Sector:hR,Group:bv,ScalableGroup:VX,Selection:kA,TransformableText:AA,BBox:dR,getLabelStyles:BX,toHierarchyHighlightString:FX}=N,_X=class extends N.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function uR(e,t=0,i=2*Math.PI/e.sumSize){for(const s of e.children){const n=t+s.sumSize*i;s.startAngle=t,s.endAngle=n,uR(s,t,i),t=n}}var wA=class extends N.HierarchySeries{constructor(e){super(e),this.NodeClass=_X,this.properties=new on,this.scalingGroup=this.contentGroup.appendChild(new VX),this.sectorGroup=this.scalingGroup.appendChild(new bv),this.highlightSectorGroup=this.scalingGroup.appendChild(new bv),this.sectorLabelGroup=this.scalingGroup.appendChild(new bv),this.datumSelection=kA.select(this.sectorGroup,hR),this.labelSelection=kA.select(this.sectorLabelGroup,bv),this.highlightSelection=kA.select(this.highlightSectorGroup,hR),this.sectorLabelGroup.pointerEvents=zX.None}processData(){super.processData(),uR(this.rootNode)}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,o=>this.getDatumId(o)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(t==null||t.seriesRect==null)return;const s=Array.from(this.rootNode),n=o=>{o.append([new AA({tag:0}),new AA({tag:1})])};this.datumSelection.update(s,void 0,o=>this.getDatumId(o)),this.labelSelection.update(s,n,o=>this.getDatumId(o))}getItemStyle(e,t){const{properties:i,colorScale:s}=this,{itemStyler:n}=i,o=e.datumIndex?.[0]??0,a=this.getActiveHighlightNode(),r=this.getHierarchyHighlightState(t,a,e),l=this.getHierarchyHighlightStyles(r,this.properties.highlight),c=ce(l,i.getStyle(o));e.colorValue!=null&&l?.fill==null&&(c.fill=s.convert(e.colorValue));let h=c;if(n!=null&&e!=null){const d=this.cachedDatumCallback(RX(this.getDatumId(e),t?"highlight":"node"),()=>{const u=this.makeItemStylerParams(e,h,FX(r));return this.callWithContext(n,u)});d&&(h=ce(d,h))}return h}makeItemStylerParams(e,t,i){const{id:s}=this,n=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:s,datum:e.datum,depth:e.depth??0,highlightState:i,...t,fill:n}}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(e==null||t==null)return;const{width:s,height:n}=e.seriesRect,{sectorSpacing:o=0,padding:a=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:f}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=n/2;const y=o*.5,x=Math.min(s,n)/2,b=x/(i+1),v=-Math.PI/2,S={series:new dR(-x,-x,2*x,2*x),axis:new dR(-x,-x,2*x,2*x)};this.rootNode?.walk(A=>{const{startAngle:w,endAngle:C}=A;if(A.depth!=null){const T=(w+C)/2+v,O=(A.depth+.5)*b;A.midPoint.x=Math.cos(T)*O,A.midPoint.y=Math.sin(T)*O}}),this.rootNode?.walk(A=>{const{datum:w,depth:C,startAngle:T,endAngle:O,parent:V,sumSize:z}=A;A.label=void 0,A.secondaryLabel=void 0,A.contentHeight=0;let R;if(w!=null&&C!=null&&d!=null){const pt=w[d];R=this.getLabelText(pt,w,d,"label",[],this.properties.label,{depth:C,datum:w,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:f,value:pt})}R===""&&(R=void 0);let B;if(w!=null&&C!=null&&u!=null){const pt=w[u];B=this.getLabelText(pt,w,u,"secondaryLabel",[],this.properties.secondaryLabel,{depth:C,datum:w,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:f,value:pt})}if(B===""&&(B=void 0),C==null)return;const G=C*b+y,F=(C+1)*b-y,_=G>y?y/G:y,Y=F>y?y/F:y,Z=T+_,te=O+_-Z,ue=T+Y,be=O+Y-ue,fe=pt=>{if(C===0&&V?.sumSize===z)return{width:2*Math.sqrt(F**2-(pt*.5)**2),height:pt,meta:0};const ws=pt,go=2*Math.sqrt(F**2-(G+ws)**2),pi=te=Gc?{width:fo,height:ws,meta:1}:{width:Gc,height:pr,meta:2}},He=DA(Oe(R),this.properties.label,Oe(B),this.properties.secondaryLabel,{padding:a},fe);if(He==null)return;const{width:Re,height:ze,meta:Te,label:Me,secondaryLabel:De}=He,pe=v+(T+O)/2,dt=Math.sin(pe)>=0,yt=Math.cos(pe)>=0,ut=(dt?3:12)&(yt?6:9);let bt;switch(Te){case 0:bt=0;break;case 1:{const ui=F-(b-ze)*.58,ws=Math.sqrt((F-a)**2-(Re/2)**2);bt=Math.min(ui,ws);break}case 2:if(C===0){const pt=ze/(2*Math.tan(te*.5))+Re*.5,ui=Math.sqrt(F**2-(ze*.5)**2)-Re*.5;bt=(pt+ui)*.5}else bt=(G+F)*.5;break}if(Me!=null){const{fontStyle:pt="normal",fontFamily:ui,fontWeight:ws="normal",color:go="black"}=this.properties.label;A.label={...Me,fontStyle:pt,fontFamily:ui,fontWeight:ws,color:go,labelPlacement:Te,circleQuarter:ut,radius:bt,theta:pe}}if(De!=null){const{fontStyle:pt="normal",fontFamily:ui,fontWeight:ws="normal",color:go="black"}=this.properties.secondaryLabel;A.secondaryLabel={...De,fontStyle:pt,fontFamily:ui,fontWeight:ws,color:go,labelPlacement:Te,circleQuarter:ut,radius:bt,theta:pe}}A.contentHeight=He.height});const M=(A,w,C)=>{const{depth:T,startAngle:O,endAngle:V}=A;if(T==null){w.visible=!1;return}w.visible=!0;const z=this.getItemStyle(A,C),R=z.fill,B=z.strokeWidth,G=qt(R)&&R.bounds!=="item"?S:void 0;w.setStyleProperties(z,G),w.centerX=0,w.centerY=0,w.innerRadius=T*b,w.outerRadius=(T+1)*b,w.startAngle=O+v,w.endAngle=V+v,w.inset=y+B*.5,w.cornerRadius=r};this.datumSelection.each((A,w)=>{M(w,A,!1)}),this.highlightSelection.each((A,w)=>{M(w,A,!0)});const D=this.getActiveHighlightNode(),I=(A,w,C,T)=>{const{depth:O,contentHeight:V}=A,z=C===0,R=z?A.label:A.secondaryLabel;if(O==null||R==null){w.visible=!1;return}const{labelPlacement:B,circleQuarter:G,radius:F,theta:_}=R,Y=this.getHierarchyHighlightState(T,D,A),{opacity:Z}=this.getHierarchyHighlightStyles(Y,this.properties.highlight)??{},ne={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:A.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},te=z?this.properties.label:this.properties.secondaryLabel,ue=this.ctx.highlightManager?.getActiveHighlight(),ge=BX(this,A,ne,te,T,ue);switch(w.text=R.text,w.fontSize=R.fontSize,w.lineHeight=R.lineHeight,w.fontStyle=R.fontStyle,w.fontFamily=R.fontFamily,w.fontWeight=R.fontWeight,w.fillOpacity=Z??1,w.fill=ge.color,w.setBoxing(ge),B){case 0:w.textAlign="center",w.textBaseline="top",w.translationX=0,w.translationY=(z?0:V-R.height)-V*.5,w.rotation=0;break;case 1:{const be=(G&3)!==0,fe=z===!be?F:F-(V-R.height);w.textAlign="center",w.textBaseline=be?"bottom":"top",w.translationX=Math.cos(_)*fe,w.translationY=Math.sin(_)*fe,w.rotation=be?_-Math.PI*.5:_+Math.PI*.5;break}case 2:{const be=(G&6)!==0,fe=z===!be?(V-R.height)*.5:(R.height-V)*.5;w.textAlign="center",w.textBaseline="middle",w.translationX=Math.cos(_)*F+Math.cos(_+Math.PI/2)*fe,w.translationY=Math.sin(_)*F+Math.sin(_+Math.PI/2)*fe,w.rotation=be?_:_+Math.PI;break}}w.visible=!0},k=this.getActiveHighlightNode();for(const A of this.labelSelection.selectByClass(AA)){const w=A.closestDatum();I(w,A,A.tag,w===k)}}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{labelKey:n,secondaryLabelKey:o,childrenKey:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,tooltip:d}=i,{formatManager:u}=s,p=e.reduce((I,k)=>I?.children[k],this.rootNode);if(p==null)return;const{datum:f,depth:y}=p;if(f==null||y==null)return;const x=[],b=r==null?void 0:f[r];if(b!=null){const I=[0,this.rootNode?.sumSize??0],k=u.format(this.callWithContext.bind(this),{type:"number",value:b,datum:f,seriesId:t,legendItemName:void 0,key:r,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:I,fractionDigits:void 0,visibleDomain:void 0});x.push({label:l,fallbackLabel:r,value:k??Ao(b)})}const v=c==null?void 0:f[c];if(v!=null){const{colorDomain:I}=this,k=u.format(this.callWithContext.bind(this),{type:"number",value:v,datum:f,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:I,fractionDigits:void 0,visibleDomain:void 0});x.push({label:h,fallbackLabel:c,value:k??Ao(v)})}const S=this.getItemStyle({...p,colorValue:v??p.colorValue},!1),D={shape:"square",fill:S.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return qt(D.fill)&&(D.fill={...D.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:n==null?void 0:f[n],symbol:{marker:D},data:x},{seriesId:t,datum:f,title:void 0,depth:y,labelKey:n,secondaryLabelKey:o,childrenKey:a,sizeKey:r,sizeName:l,colorKey:c,colorName:h,...S})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){EX(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};wA.className="SunburstSeries",wA.type="sunburst";var{sunburstSeriesThemeableOptionsDef:HX}=N,GX={...HX,...ee(qe,["highlightStyle","highlight","showInLegend"]),type:j(Ce("sunburst")),labelKey:L,secondaryLabelKey:L,childrenKey:L,sizeKey:L,colorKey:L,sizeName:L,colorName:L},jX={series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Oy],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:li.LARGE},minimumFontSize:{$rem:9/Uo},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...Ye,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:li.SMALLEST},minimumFontSize:{$rem:7/Uo},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},pR={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,solo:!0,version:de,dependencies:[vp],options:GX,themeTemplate:jX,create:e=>new wA(e)},{HierarchySeriesProperties:WX,makeSeriesTooltip:$X,Label:KX}=N,gR=class extends KX{constructor(){super(...arguments),this.spacing=0}};g([m],gR.prototype,"spacing",2);var yc=class extends q{};g([m],yc.prototype,"fill",2),g([m],yc.prototype,"fillOpacity",2),g([m],yc.prototype,"stroke",2),g([m],yc.prototype,"strokeWidth",2),g([m],yc.prototype,"strokeOpacity",2),g([m],yc.prototype,"opacity",2);var CA=class extends q{constructor(){super(...arguments),this.highlightedItem=new yc,this.unhighlightedItem=new yc}};g([m],CA.prototype,"highlightedItem",2),g([m],CA.prototype,"unhighlightedItem",2);var qa=class extends q{};g([m],qa.prototype,"fill",2),g([m],qa.prototype,"fillOpacity",2),g([m],qa.prototype,"stroke",2),g([m],qa.prototype,"strokeWidth",2),g([m],qa.prototype,"strokeOpacity",2),g([m],qa.prototype,"opacity",2);var nm=class extends q{constructor(){super(...arguments),this.highlightedBranch=new qa,this.highlightedItem=new qa,this.unhighlightedItem=new qa,this.unhighlightedBranch=new qa}};g([m],nm.prototype,"highlightedBranch",2),g([m],nm.prototype,"highlightedItem",2),g([m],nm.prototype,"unhighlightedItem",2),g([m],nm.prototype,"unhighlightedBranch",2);var to=class extends q{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new gR,this.highlight=new CA}};g([m],to.prototype,"fill",2),g([m],to.prototype,"fillOpacity",2),g([m],to.prototype,"stroke",2),g([m],to.prototype,"strokeWidth",2),g([m],to.prototype,"strokeOpacity",2),g([m],to.prototype,"cornerRadius",2),g([m],to.prototype,"textAlign",2),g([m],to.prototype,"gap",2),g([m],to.prototype,"padding",2),g([m],to.prototype,"interactive",2),g([m],to.prototype,"label",2),g([m],to.prototype,"highlight",2);var An=class extends q{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new Dp,this.secondaryLabel=new xv,this.highlight=new nm}};g([m],An.prototype,"fill",2),g([m],An.prototype,"fillOpacity",2),g([m],An.prototype,"stroke",2),g([m],An.prototype,"strokeWidth",2),g([m],An.prototype,"strokeOpacity",2),g([m],An.prototype,"cornerRadius",2),g([m],An.prototype,"textAlign",2),g([m],An.prototype,"verticalAlign",2),g([m],An.prototype,"gap",2),g([m],An.prototype,"padding",2),g([m],An.prototype,"label",2),g([m],An.prototype,"secondaryLabel",2),g([m],An.prototype,"highlight",2);var Qa=class extends WX{constructor(){super(...arguments),this.tooltip=$X(),this.group=new to,this.tile=new An,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,s){const{fillOpacity:n,strokeWidth:o,strokeOpacity:a,fill:r=e?t[s%t.length]:t[Math.min(s,t.length)],stroke:l=e?i[s%t.length]:i[Math.min(s,i.length)]}=e?this.tile:this.group;return{fill:r,fillOpacity:n,stroke:l,strokeWidth:o,strokeOpacity:a,opacity:1}}};g([m],Qa.prototype,"sizeName",2),g([m],Qa.prototype,"labelKey",2),g([m],Qa.prototype,"secondaryLabelKey",2),g([m],Qa.prototype,"itemStyler",2),g([m],Qa.prototype,"tooltip",2),g([m],Qa.prototype,"group",2),g([m],Qa.prototype,"tile",2),g([m],Qa.prototype,"undocumentedGroupFills",2),g([m],Qa.prototype,"undocumentedGroupStrokes",2);var{createDatumId:UX,Rect:fR,Group:mR,BBox:Ip,Selection:LA,Text:NA,Transformable:YX,getLabelStyles:ZX,HierarchyHighlightState:ua,toHierarchyHighlightString:om}=N,XX=class extends N.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function xc(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var yR={left:0,center:.5,right:1},qX={top:0,middle:.5,bottom:1},Aoe=class extends N.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},TA=class extends N.HierarchySeries{constructor(){super(...arguments),this.NodeClass=XX,this.properties=new Qa,this.rectGroup=this.contentGroup.appendChild(new mR),this.datumSelection=LA.select(this.rectGroup,fR),this.labelSelection=LA.select(this.labelGroup,mR),this.highlightSelection=LA.select(this.rectGroup,fR)}groupTitleHeight(e,t){const{label:s}=this.properties.group,{labelValue:n}=e,{fontSize:o}=s;if(s.enabled&&n!=null&&o<=t.width/3&&o<=t.height/3){const{height:a}=et(s).measureLines(n);return Math.max(a,o)}}getNodePadding(e,t){if(e.parent==null)return{top:0,right:0,bottom:0,left:0};if(e.children.length===0){const{padding:a}=this.properties.tile;return{top:a,right:a,bottom:a,left:a}}const{padding:i,label:{spacing:s}}=this.properties.group,n=this.groupTitleHeight(e,t),o=n==null?0:n+s;return{top:i+o,right:i,bottom:i,left:i}}sortChildren({children:e}){const t=Array.from(e,(s,n)=>n).filter(s=>xc(e[s])>0).sort((s,n)=>xc(e[n])-xc(e[s]));return{sortedChildrenIndices:t,childAt:s=>{const n=t[s];return e[n]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0){e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN;return}const n=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);e.parent==null?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN):(e.bbox=t,e.padding=n,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:o,childAt:a}=this.sortChildren(e),r=o.every(D=>s[D].children.length===0),l=1,c=t.width-n.left-n.right,h=t.height-n.top-n.bottom;if(c<=0||h<=0)return;const d=o.length;let u=0,p=0,f=1/0,y=o.reduce((D,I)=>D+xc(s[I]),0);const x=new Ip(t.x+n.left,t.y+n.top,c,h),b=x.clone();let v=0;for(;v({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),o=n(e),a=n(t),r=["top","right","bottom","left"];for(const l of r)Be(o[l],a[l])||t.shrink(s,l)}createNodeData(){}getItemStyle(e,t,i){const{properties:s,colorScale:n}=this,{itemStyler:o}=s,a=e.datumIndex?.[0]??0,r=t?s.fills:s.undocumentedGroupFills,l=t?s.strokes:s.undocumentedGroupStrokes,c=t?a:e.depth??-1,h=this.getActiveHighlightNode(),d=this.getHierarchyHighlightState(i,h,e),u=this.getGroupHighlightState(i,h,e),p=t?d:u,f=t?this.getTileHighlightStyle(d,u,h):this.getGroupHighlightStyle(u),y=ce(f,s.getStyle(t,r,l,c));t&&e.colorValue!=null&&f?.fill==null&&(y.fill=n.convert(e.colorValue));let x=y;if(o!=null&&e!=null){const b=this.cachedDatumCallback(UX(this.getDatumId(e),i?"highlight":"node"),()=>{const v=this.makeItemStylerParams(e,x,om(p));return this.callWithContext(o,v)});b&&(x=ce(b,x))}return x}makeItemStylerParams(e,t,i){const{id:s}=this,n=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:s,datum:e.datum,depth:e.depth??-1,highlightState:i,...t,fill:n}}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,n=>this.getDatumId(n)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),s=n=>{n.append([new NA({tag:0}),new NA({tag:1})])};this.datumSelection.update(i,void 0,n=>this.getDatumId(n)),this.labelSelection.update(i,s,n=>this.getDatumId(n))}getActiveHighlightNode(){const e=super.getActiveHighlightNode();if(!(e?.children.length&&!this.properties.group.interactive))return e}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,tile:c,group:h}=this.properties,{seriesRect:d}=this.chart??{};if(!d||!t)return;this.rootNode?.walk(v=>{const{datum:S,depth:M,children:D}=v,I=D.length===0,k=I?c.label:h.label;let A;if(k.enabled&&S!=null&&M!=null&&o!=null){const C=S[o];A=this.getLabelText(C,S,o,"label",[],k,{depth:M,datum:S,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:C})}A===""&&(A=void 0);let w;if(c.secondaryLabel.enabled&&I&&S!=null&&M!=null&&a!=null){const C=S[a];w=this.getLabelText(C,S,a,"secondaryLabel",[],c.secondaryLabel,{depth:M,datum:S,childrenKey:i,colorKey:s,colorName:n,labelKey:o,secondaryLabelKey:a,sizeKey:r,sizeName:l,value:C})}w===""&&(w=void 0),v.labelValue=Oe(A),v.secondaryLabelValue=Oe(w)});const{width:u,height:p}=d;this.squarify(e,new Ip(0,0,u,p)),this.rootNode?.walk(v=>{const{bbox:S,children:M,labelValue:D,secondaryLabelValue:I}=v;if(v.label=void 0,v.secondaryLabel=void 0,S!=null)if(M.length===0){const k={width:S.width,height:S.height,meta:null},A=DA(D,this.properties.tile.label,I,this.properties.tile.secondaryLabel,{padding:c.padding},()=>k);if(A==null)return;const{height:w,label:C,secondaryLabel:T}=A,{textAlign:O,verticalAlign:V,padding:z}=c,R=yR[O]??.5,B=S.x+z+(S.width-2*z)*R,G=qX[V]??.5,F=S.y+z+w*.5+(S.height-2*z-w)*G;if(C!=null){const{fontStyle:_="normal",fontFamily:Y,fontWeight:Z="normal",color:ne="black"}=this.properties.tile.label;v.label={text:C.text,fontSize:C.fontSize,lineHeight:C.lineHeight,fontStyle:_,fontFamily:Y,fontWeight:Z,color:ne,textAlign:O,verticalAlign:"middle",x:B,y:F-(w-C.height)*.5}}if(T!=null){const{fontStyle:_="normal",fontFamily:Y,fontWeight:Z="normal",color:ne="black"}=this.properties.tile.secondaryLabel;v.secondaryLabel={text:T.text,fontSize:T.fontSize,lineHeight:T.fontSize,fontStyle:_,fontFamily:Y,fontWeight:Z,color:ne,textAlign:O,verticalAlign:"middle",x:B,y:F+(w-T.height)*.5}}}else{if(D==null)return;{const{padding:k,textAlign:A}=h,w=this.groupTitleHeight(v,S);if(w==null)return;const C=S.width-2*k,T=Pa(D,{maxWidth:S.width-2*k,font:h.label,textWrap:"never"}),O=yR[A]??.5,{fontStyle:V="normal",fontFamily:z,fontWeight:R="normal",color:B="black"}=this.properties.group.label;v.label={text:T,fontSize:h.label.fontSize,lineHeight:Fn(h.label.fontSize),fontStyle:V,fontFamily:z,fontWeight:R,color:B,textAlign:A,verticalAlign:"middle",x:S.x+k+C*O,y:S.y+k+w*.5}}}});const f={series:new Ip(0,0,u,p),axis:new Ip(0,0,u,p)},y=(v,S,M)=>{const{bbox:D}=v;if(D==null){S.visible=!1;return}const{depth:I=-1}=v,k=v.children.length===0,A=this.getItemStyle(v,k,M);S.crisp=!0,S.setStyleProperties(A,f),S.cornerRadius=k?c.cornerRadius:h.cornerRadius,S.zIndex=[0,I,M?1:0];const w=v.parent?.children.every(O=>O.children.length===0),C=v.parent==null?void 0:v.parent.bbox,T=v.parent==null?void 0:v.parent.padding;w===!0&&C!=null&&T!=null?(S.clipBBox=D,S.x=C.x+T.left,S.y=C.y+T.top,S.width=C.width-(T.left+T.right),S.height=C.height-(T.top+T.bottom)):(S.clipBBox=void 0,S.x=D.x,S.y=D.y,S.width=D.width,S.height=D.height),S.visible=!0};this.datumSelection.each((v,S)=>y(S,v,!1)),this.highlightSelection.each((v,S)=>{y(S,v,!0)});const x=(v,S,M,D)=>{const I=v.children.length===0,k=M===0?v.label:v.secondaryLabel;if(k==null){S.visible=!1;return}let A,w;M===0?(A=I?c.label:h.label,w=["series",`${this.declarationOrder}`,I?"tile":"group","label"]):(A=c.secondaryLabel,w=["series",`${this.declarationOrder}`,"tile","secondaryLabel"]);const{opacity:C}=this.getItemStyle(v,I,D)??{},T={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:v.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},O=this.ctx.highlightManager?.getActiveHighlight(),V=ZX(this,v,T,A,D,O,w);S.text=k.text,S.fontSize=k.fontSize,S.lineHeight=k.lineHeight,S.fontStyle=k.fontStyle,S.fontFamily=k.fontFamily,S.fontWeight=k.fontWeight,S.fillOpacity=C??1,S.fill=V.color,S.setBoxing(V),S.textAlign=k.textAlign,S.textBaseline=k.verticalAlign,S.x=k.x,S.y=k.y,S.visible=!0,S.zIndex=1},b=this.getActiveHighlightNode();for(const v of this.labelSelection.selectByClass(NA)){const S=v.closestDatum();x(S,v,v.tag,S===b)}}getGroupHighlightState(e,t,i){const s=i.datumIndex,n=t?.datumIndex,o=this.isDescendantDatumIndex(s,n);if(i.children?.length===0)return s==null||t==null||t.children?.length===0?ua.None:o?ua.Item:ua.OtherItem;if(t==null||t.children?.length===0)return ua.None;const a=i.depth!=null&&t.depth!=null&&i.depth===t.depth;return o&&!a?ua.None:e?ua.Item:ua.OtherItem}getTileHighlightStyle(e,t,i){if(i?.children&&i.children.length>0){const n=this.getGroupHighlightStyle(t);return n?.fillOpacity==null&&n?.strokeOpacity==null?void 0:{fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity}}return this.getHierarchyHighlightStyles(e,this.properties.tile.highlight)}getGroupHighlightStyle(e){const{highlight:t}=this.properties.group;switch(e){case ua.Item:return t.highlightedItem;case ua.OtherItem:return t.unhighlightedItem;default:return}}getHighlightStateString(e,t,i){if(i==null)return om(ua.None);const s=i.reduce((r,l)=>r?.children[l],this.rootNode),n=this.getActiveHighlightNode();if(s==null)return om(ua.None);if((s.children?.length??0)===0){const r=this.getHierarchyHighlightState(t??!1,n,s);return om(r)}const a=this.getGroupHighlightState(t??!1,n,s);return om(a)}isDescendantDatumIndex(e,t){if(t==null||t.length===0)return!0;if(e==null||e.lengths.datumIndex.length-i.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return t.length!==0?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{formatManager:n}=s,{labelKey:o,secondaryLabelKey:a,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:d,tooltip:u}=i,p=e.reduce((w,C)=>w?.children[C],this.rootNode);if(p==null)return;const{datum:f,depth:y,children:x}=p;if(f==null||y==null)return;const b=x.length===0,v=[],S=l==null?void 0:f[l];if(S!=null){const w=[0,this.rootNode?.sumSize??0],C=n.format(this.callWithContext.bind(this),{type:"number",value:S,datum:f,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:w,fractionDigits:void 0,visibleDomain:void 0});v.push({label:c,fallbackLabel:l,value:C??Ao(S)})}const M=h==null?void 0:f[h];if(M!=null){const{colorDomain:w}=this,C=n.format(this.callWithContext.bind(this),{type:"number",value:M,datum:f,seriesId:t,legendItemName:void 0,key:h,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:w,fractionDigits:void 0,visibleDomain:void 0});v.push({label:d,fallbackLabel:h,value:C??Ao(M)})}const D=this.getItemStyle({...p,colorValue:M??p.colorValue},b,!1),k={shape:"square",fill:D.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};qt(k.fill)&&(k.fill={...k.fill,gradient:"linear",rotation:0,reverse:!1});const A=b?{marker:k}:void 0;return this.formatTooltipWithContext(u,{title:o==null?void 0:f[o],symbol:A,data:v},{seriesId:t,datum:f,title:void 0,depth:y,labelKey:o,secondaryLabelKey:a,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:d,...D})}computeFocusBounds(e){return YX.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};TA.className="TreemapSeries",TA.type="treemap";var{treemapSeriesThemeableOptionsDef:QX}=N,OA={...QX,...ee(qe,["highlightStyle","highlight","showInLegend"]),type:j(Ce("treemap")),labelKey:L,secondaryLabelKey:L,childrenKey:L,sizeKey:L,colorKey:L,sizeName:L,colorName:L};OA.undocumentedGroupFills=Q(xe(J)),OA.undocumentedGroupStrokes=Q(xe(J));var xR={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,solo:!0,version:de,dependencies:[vp],options:OA,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Vi],["pattern",tt],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...Ye,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left",highlight:{unhighlightedItem:{opacity:.2,fillOpacity:.2,strokeOpacity:.2}}},tile:{label:{...Ye,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:li.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...Ye,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:li.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},create:e=>new TA(e)},vv=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.cleanup.register(()=>e.animationManager.skip(!0))}};g([Rt((e,t)=>{e.ctx.animationManager.skip(!t)}),m],vv.prototype,"enabled",2),g([Rt((e,t)=>{t!=null&&(e.ctx.animationManager.defaultDuration=t)}),m],vv.prototype,"duration",2),g([Rt((e,t)=>{e.ctx.animationManager.maxAnimatableItems=t??1/0}),m],vv.prototype,"maxAnimatableItems",2);var am={type:"plugin",name:"animation",enterprise:!0,version:de,options:{enabled:E,duration:P},themeTemplate:{enabled:{$if:[{$path:["../flashOnUpdate/enabled",!1]},!1,!0]}},create:e=>new vv(e)};am.options.maxAnimatableItems=Q(P);var bR=class $m extends ri{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),t==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new N.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,s={layout:(n,o=0)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const a=i.getBounds().width,{isRtl:r}=this.ctx.domManager;i.setBounds({x:r?n.x+n.width-a:n.x,y:n.y,width:a}),n.shrink(a+i.horizontalSpacing+o,r?"right":"left")},addToolbarListener:(n,o)=>i.addToolbarListener(n,a=>{const r=this.getSectionIndex(t,a.button.index);if(r<0)return;const l={...a,button:this.sectionButtons[t][r]};o(l)}),updateButtons:n=>{this.sectionButtons[t]=n;const o=$m.SECTION_ORDER.flatMap(a=>this.sectionButtons[a]);i.updateButtons(o)},updateButtonByIndex:(n,o)=>{i.updateButtonByIndex(this.getIndex(t,n),o)},toggleActiveButtonByIndex:n=>{i.toggleActiveButtonByIndex(this.getIndex(t,n))},toggleButtonEnabledByIndex:(n,o)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,n),o)},setHidden:n=>{n?this.activeSections.delete(t):this.activeSections.add(t);let o=0;for(const a of $m.SECTION_ORDER){if(a!==t){o+=this.sectionButtons[a].length;continue}for(const r of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(o+r,n)}},destroy:()=>{s.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return s.setHidden(!1),s}getIndex(t,i){let s=0;for(const n of $m.SECTION_ORDER){if(n===t)return s+i;s+=this.sectionButtons[n].length}return-1}getSectionIndex(t,i){let s=0;for(const n of $m.SECTION_ORDER){if(n===t)return i>=s+this.sectionButtons[t].length?-1:i-s;s+=this.sectionButtons[n].length}return-1}};bR.SECTION_ORDER=["chartToolbar","annotations"];var vR=bR,JX='
',SR="text-input",MR="canvas-overlay",eq=class{constructor(e){this.ctx=e,this.cleanup=new ot,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(MR,SR),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>e.domManager.removeChild(MR,SR))}setKeyDownHandler(e){this.cleanup.register(mt(this.element,"keydown",e))}show(e){this.element.innerHTML=JX;const t=this.element.firstElementChild;Do(t,{role:"textbox","data-preventdefault":!1}),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight=typeof e.styles?.fontWeight=="number"?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",Qm(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",i=>{i.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:s,getTextInputCoords:n,getTextPosition:o,alignment:a,textAlign:r}=this.layout;e.style.setProperty("width",s?`${s}px`:"unset");const l=t.getBoundingClientRect(),c=n(l.height);let h=c.x;a==="center"?h-=(s??l.width)/2:a==="right"&&(h-=s??l.width);const d=o();let u=c.y;d==="center"?u-=l.height/2:d==="bottom"&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",`${i.width-h}px`),e.style.setProperty("text-align",a),t.style.setProperty("text-align",r)}getBBox(){const{left:e,top:t,width:i,height:s}=this.element.getBoundingClientRect();return new N.BBox(e,t,O0(i,2),s)}destroy(){this.cleanup.flush()}},PA=class extends q{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};g([m],PA.prototype,"enabled",2),g([m],PA.prototype,"axes",2);var EA=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(EA||{}),tq=Object.values(EA);function iq(e){for(const t of tq)if(t===e)return t}var rm=class extends q{};g([m],rm.prototype,"x",2),g([m],rm.prototype,"y",2);var sq=class extends Fs(al(AR(q))){},RA=class extends Fs(al(Ja(BA(Qh(q))))){constructor(){super(...arguments),this.cornerRadius=2}};g([m],RA.prototype,"enabled",2),g([m],RA.prototype,"cornerRadius",2);var nq=class extends Ja(q){},oq=class extends Fs(al(Ja(q))){},Xh=class extends Qh(q){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};g([m],Xh.prototype,"label",2),g([m],Xh.prototype,"position",2),g([m],Xh.prototype,"alignment",2);var aq=class extends Qh(q){},lm=class extends Qh(q){constructor(){super(...arguments),this.label=""}};g([m],lm.prototype,"label",2),g([m],lm.prototype,"position",2),g([m],lm.prototype,"alignment",2);function qh(e){class t extends lq(AR(e)){constructor(){super(...arguments),this.id=cu()}}return t}function zA(e){class t extends e{constructor(){super(...arguments),this.start=new rm,this.end=new rm}}return g([m],t.prototype,"start",2),g([m],t.prototype,"end",2),t}function DR(e){class t extends e{}return g([m],t.prototype,"x",2),g([m],t.prototype,"y",2),t}function IR(e){class t extends e{}return g([m],t.prototype,"value",2),t}function VA(e){class t extends e{constructor(){super(...arguments),this.background=new nq}}return g([m],t.prototype,"background",2),t}function bc(e){class t extends e{constructor(){super(...arguments),this.handle=new oq}}return g([m],t.prototype,"handle",2),t}function kR(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new RA}}return g([m],t.prototype,"axisLabel",2),t}function BA(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return g([m],t.prototype,"padding",2),g([m],t.prototype,"textAlign",2),g([m],t.prototype,"formatter",2),t}function rq(e){class t extends e{}return t}function FA(e){class t extends e{}return g([m],t.prototype,"extendStart",2),g([m],t.prototype,"extendEnd",2),t}function lq(e){class t extends e{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return g([m],t.prototype,"locked",2),g([m],t.prototype,"readOnly",2),t}function _A(e){class t extends e{setLocaleManager(s){this.localeManager??(this.localeManager=s)}}return t}function AR(e){class t extends e{}return g([m],t.prototype,"visible",2),t}function Ja(e){class t extends e{}return g([m],t.prototype,"fill",2),g([m],t.prototype,"fillOpacity",2),t}function Fs(e){class t extends e{}return g([m],t.prototype,"stroke",2),g([m],t.prototype,"strokeOpacity",2),g([m],t.prototype,"strokeWidth",2),t}function al(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return g([m],t.prototype,"lineDash",2),g([m],t.prototype,"lineDashOffset",2),g([m],t.prototype,"lineStyle",2),t}function Qh(e){class t extends e{constructor(){super(...arguments),this.fontSize=12,this.fontFamily="Verdana, sans-serif"}}return g([m],t.prototype,"fontStyle",2),g([m],t.prototype,"fontWeight",2),g([m],t.prototype,"fontSize",2),g([m],t.prototype,"fontFamily",2),g([m],t.prototype,"color",2),t}function wR(e){return gt(e)||Pt(e)||Cs(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Ei(e){return wR(e)?.value}function an(e,t){if(e.start==null||e.end==null)return;const i=ti(e.start,t),s=ti(e.end,t);if(!(i==null||s==null))return{x1:i.x,y1:i.y,x2:s.x,y2:s.y}}function ti(e,t){const i=rl(e.x,t.xAxis),s=rl(e.y,t.yAxis);return{x:i,y:s}}function rl(e,t){if(e==null)return 0;const{value:i,groupPercentage:s}=wR(e),{scale:n,snapToGroup:o}=t,a=n.bandwidth===0?n.step??0:n.bandwidth??0,r=o?a/2:a*s;return n.convert(i)+r}function rn(e,t){const i=Sv(e.x,t.xAxis),s=Sv(e.y,t.yAxis);return{x:i,y:s}}function Sv(e,t){const{scale:i}=t;if(t.continuous&&i.step==null)return t.scaleInvert(e);const s=t.scaleInvertNearest(e),n=i.bandwidth===0?i.step:i.bandwidth??0,o=i.convert(s),a=o+n,r=o===a?0:(e-o)/(a-o);return{value:s,groupPercentage:r}}var HA=class extends qh(zA(bc(q))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},CR=class extends _A(BA(Qh(HA))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return ti(this.end,e)}getTextPosition(){return this.position}};g([m],CR.prototype,"text",2);var cq={top:6,right:12,bottom:9,left:12},pa=class extends Ja(Fs(CR)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return me(e)&&e.type==="callout"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Ne.fromString(this.color??"#888888");return new Ne(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...cq}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding(),n=s.left??0,o=s.bottom??0;return{x:i.x+n,y:i.y-o}}};g([m],pa.prototype,"type",2);var Mv=class extends qh(DR(bc(BA(Qh(q))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return ti(this,e)}getTextPosition(){return this.position}};g([m],Mv.prototype,"text",2);var Dv={top:8,right:14,bottom:8,left:14},er=class extends Ja(Fs(Mv)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return me(e)&&e.type==="comment"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Ne.fromString(this.color??"#888888");return new Ne(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,Dv.top),bottom:Math.max(t*.4,Dv.bottom),left:Math.max(t*.8,Dv.left),right:Math.max(t*.8,Dv.right)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),s=this.getPadding();return{x:i.x+s.left,y:i.y-s.bottom}}};g([m],er.prototype,"type",2);function cm(e,t){return e?"dashed":t??"solid"}function LR(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function kp(e,t,i,s){const n=cm(e,i);return t??e??LR(s??1,n)}function Ap(e,t,i){const s=cm(t,i);return e??s==="dotted"?"round":void 0}function hq(e,t){const[i,s]=H.from(e),n=t.height,o=H.gradient(s,i,n),a=H.intercept(s,o,n),r=[{x:i.x,y:n??0},{x:i.x,y:n==null?t.height:n-t.height}];if(o===1/0)return r;let l=[H.intersectAtY(o,a,0,n),H.intersectAtY(o,a,t.height,n),H.intersectAtX(o,a,0,n),H.intersectAtX(o,a,t.width,n)];return l=l.filter(c=>c.x>=t.x&&c.x<=t.width&&c.y>=t.y&&c.y<=t.height).sort((c,h)=>c.x===h.x?0:c.x{},this.text=new Xh}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return kp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ap(this.lineCap,this.lineDash,this.lineStyle)}};g([m],wp.prototype,"statistics",2),g([m],wp.prototype,"text",2);function WA(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function $A(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var Po=class extends WA(wp){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return me(e)&&e.type==="date-range"}};g([m],Po.prototype,"type",2),g([m],Po.prototype,"extendAbove",2),g([m],Po.prototype,"extendBelow",2);var Eo=class extends $A(wp){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return me(e)&&e.type==="price-range"}};g([m],Eo.prototype,"type",2),g([m],Eo.prototype,"extendLeft",2),g([m],Eo.prototype,"extendRight",2);var ll=class extends WA($A(wp)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return me(e)&&e.type==="date-price-range"}};g([m],ll.prototype,"type",2);var io=class extends WA($A(wp)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new jA,this.down=new jA,this.direction="both"}static is(e){return me(e)&&e.type==="quick-date-price-range"}};g([m],io.prototype,"type",2),g([m],io.prototype,"up",2),g([m],io.prototype,"down",2);var{BBox:uq}=N,Iv=1.38;function kv(e,t,i){return i?Pa(t,{maxWidth:i,font:e,textWrap:"always",avoidOrphans:!1}):t}function pq(e,t){const{lineMetrics:i,width:s}=et(e).measureLines(t),n=i.length*Fn(e.fontSize,Iv);return{width:s,height:n}}function KA(e,t,i,s){let n=s?.width??0,o=s?.height??0;if(!s){const a=e.width==null?t:kv(e,t,e.width);({width:n,height:o}=pq(e,a))}return new uq(i.x,i.y,n,o)}function NR(e,t,i,s,{x:n,y:o},a){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=s,p=Fn(c,Iv);a??(a=s.position=="center"?"middle":s.position);const f=i?s.getPlaceholderColor():s.color;e.setProperties({x:n,y:o,visible:r,text:t,fill:f,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:a})}var gq=10,fq=11,TR=20,mq=22,yq=10,OR=TR+yq,PR=34,xq=class extends Ja(Fs(q)){},wn=class extends Ja(Fs(Mv)){constructor(){super(...arguments),this.type="note",this.background=new xq,this.position="bottom",this.alignment="center",this.width=200}static is(e){return me(e)&&e.type==="note"}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??gq;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:s}=this,n=super.getTextInputCoords(e,t),o=this.getPadding().top,a=KA(this,s,n);a.x=se(i/2,a.x,e.seriesRect.width-i/2);const r=a.y-OR-o*2,l=a.y+fq+o*2,c=Math.max(a.height,t);return r-c-PR<0?(a.y=l,this.position="top"):(a.y=r+o,this.position="bottom"),{x:a.x,y:a.y}}isHoverable(){return!0}};g([m],wn.prototype,"type",2),g([m],wn.prototype,"background",2);var bq=class extends qh(DR(bc(q))){getDefaultColor(e){}getDefaultOpacity(e){}},UA=class dH extends Ja(bq){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof dH}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}},_s=class extends qh(IR(bc(kR(Fs(al(q)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new Xh}static is(e){return me(e)&&e.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return kp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ap(this.lineCap,this.lineDash,this.lineStyle)}};g([m],_s.prototype,"type",2),g([m],_s.prototype,"text",2);var tr=class extends qh(IR(bc(kR(Fs(al(q)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new Xh}static is(e){return me(e)&&e.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return kp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ap(this.lineCap,this.lineDash,this.lineStyle)}};g([m],tr.prototype,"type",2),g([m],tr.prototype,"text",2);var Ro=class extends qh(VA(zA(bc(FA(Fs(al(q))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new lm,this.snapToAngle=45}static is(e){return me(e)&&e.type==="disjoint-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):W.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return kp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ap(this.lineCap,this.lineDash,this.lineStyle)}};g([m],Ro.prototype,"type",2),g([m],Ro.prototype,"startHeight",2),g([m],Ro.prototype,"endHeight",2),g([m],Ro.prototype,"text",2);var Av=class extends _A(rq(FA(Fs(al(HA))))){constructor(){super(...arguments),this.text=new Xh}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return kp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ap(this.lineCap,this.lineDash,this.lineStyle)}};g([m],Av.prototype,"text",2);var cl=class extends Av{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return me(e)&&e.type==="arrow"}};g([m],cl.prototype,"type",2);var hl=class extends Av{constructor(){super(...arguments),this.type="line"}static is(e){return me(e)&&e.type==="line"}};g([m],hl.prototype,"type",2);var dl=class extends Av{constructor(){super(...arguments),this.label=new aq,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};g([m],dl.prototype,"label",2),g([m],dl.prototype,"reverse",2),g([m],dl.prototype,"showFill",2),g([m],dl.prototype,"isMultiColor",2),g([m],dl.prototype,"strokes",2),g([m],dl.prototype,"rangeStroke",2),g([m],dl.prototype,"bands",2);var ir=class extends dl{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new rm}static is(e){return me(e)&&e.type==="fibonacci-retracement-trend-based"}};g([m],ir.prototype,"type",2),g([m],ir.prototype,"endRetracement",2);var ul=class extends dl{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return me(e)&&e.type==="fibonacci-retracement"}};g([m],ul.prototype,"type",2);var zo=class extends qh(VA(zA(bc(FA(Fs(al(q))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new sq,this.text=new lm,this.snapToAngle=45}static is(e){return me(e)&&e.type==="parallel-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.height,e.end.y-=this.height):W.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return kp(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ap(this.lineCap,this.lineDash,this.lineStyle)}};g([m],zo.prototype,"type",2),g([m],zo.prototype,"height",2),g([m],zo.prototype,"middle",2),g([m],zo.prototype,"text",2);var pl=class extends Mv{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return me(e)&&e.type==="text"}};g([m],pl.prototype,"type",2);function vc(e){return io.is(e)}function wv(e){return hl.is(e)||_s.is(e)||tr.is(e)||cl.is(e)||ER(e)}function gl(e){return Ro.is(e)||zo.is(e)}function ER(e){return ul.is(e)||ir.is(e)}function sr(e){return pa.is(e)||er.is(e)||wn.is(e)||pl.is(e)}function hm(e){return Po.is(e)||Eo.is(e)||ll.is(e)||io.is(e)}function YA(e){return sr(e)&&!wn.is(e)}function Sc(e){return wv(e)||gl(e)||hm(e)&&!io.is(e)}function vq(e){return wv(e)||gl(e)||hm(e)||pa.is(e)||wn.is(e)}function Sq(e){return wn.is(e)}function Mq(e){return gl(e)||hm(e)||pa.is(e)||er.is(e)||UA.is(e)}function Dq(e){return sr(e)&&!wn.is(e)}function Cp(e){return(wv(e)||gl(e)||hm(e))&&!vc(e)&&me(e.text)}function Iq(e,t){"fontSize"in e&&(e.fontSize=t),Cp(e)&&(e.text.fontSize=t)}function RR(e,t){const i=t?.strokeWidth??e.strokeWidth??1,s=t?.type??e.lineStyle,n=s??cm(e.lineDash,s),o=LR(i,n);e.strokeWidth=i,e.computedLineDash=o,e.lineStyle=n,e.lineCap=n==="dotted"?"round":void 0}function Cv(e,t,i,s,n,o){switch(t){case"fill-color":{"fill"in e&&(e.fill=s),"fillOpacity"in e&&(e.fillOpacity=n),"background"in e&&(e.background.fill=s,e.background.fillOpacity=n);break}case"line-color":{"axisLabel"in e&&(e.axisLabel.fill=s,e.axisLabel.fillOpacity=n,e.axisLabel.stroke=s,e.axisLabel.strokeOpacity=n),"fill"in e&&"fillOpacity"in e&&Sq(e)?(e.fill=s,e.fillOpacity=n):("strokeOpacity"in e&&(e.strokeOpacity=n),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=o,e.rangeStroke=s):"stroke"in e&&(e.stroke=s));break}case"text-color":{"color"in e&&(e.color=i),Cp(e)&&(e.text.color=s);break}}}var kq=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(EA).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:Pe(this.colors),fontSizes:Pe(this.fontSizes),lineStyles:Pe(this.lineStyles),lineTextAlignments:Pe(this.lineTextAlignments),lineTextPositions:Pe(this.lineTextPositions),fibonacciOptions:Pe(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=Pe(i.colors),this.fontSizes=Pe(i.fontSizes),this.lineStyles=Pe(i.lineStyles),this.lineTextAlignments=Pe(i.lineTextAlignments),this.lineTextPositions=Pe(i.lineTextPositions),this.fibonacciOptions=Pe(i.fibonacciOptions)}setDefaultColor(e,t,i,s,n,o){this.colors.get(e)?.set(t,[i,s,n,o])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if(e!="fibonacci-retracement"&&e!="fibonacci-retracement-trend-based")return;const s=this.fibonacciOptions.get(e);s[t]=i,this.fibonacciOptions.set(e,s)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[s,[n,o,a,r]=[]]of i)n&&o&&a!=null&&r!=null&&Cv(e,s,n,o,a,r);for(const[t,i]of this.fontSizes)e.type!==t||i==null||Iq(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||RR(e,i);for(const[t,i]of this.lineTextPositions)e.type!==t||i==null||(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type!==t||i==null||(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)if(!(e.type!==t||i==null))for(const s of Object.keys(i)){const n=i[s];n!=null&&e.set({[s]:n})}}},Aq='
',zR=e=>{try{const t=Ne.fromString(e),[i,s,n]=t.toHSB();return[i,s,n,t.a]}catch{return}},VR=class extends N.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),s=this.showWithChildren([t],{initialFocus:i,...e});s.classList.add("ag-charts-color-picker"),s.setAttribute("role","dialog")}createColorPicker(e){const{localeManager:t}=this.ctx;let i=e.isMultiColor??!1,[s,n,o,a]=zR(e.color??"#f00")??[0,1,.5,1];a=e.opacity??a;const r=this.ctx.agDocument,l=r.createElement("div","ag-charts-color-picker__content");l.innerHTML=Aq,l.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const c=l.querySelector(".ag-charts-color-picker__palette"),h=l.querySelector(".ag-charts-color-picker__hue-input"),d=l.querySelector(".ag-charts-color-picker__multi-color-button"),u=l.querySelector(".ag-charts-color-picker__alpha-input"),p=l.querySelector(".ag-charts-color-picker__color-input"),f=l.querySelector(".ag-charts-color-picker__color-label"),y=M=>{const D={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[M];c.ariaValueText=t.t(D,{s:n,v:o})};this.i18nUpdater=()=>{c.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),c.ariaLabel=t.t("ariaLabelColorPickerPalette"),h.ariaLabel=t.t("ariaLabelColorPickerHue"),d.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),u.ariaLabel=t.t("ariaLabelColorPickerAlpha"),p.ariaLabel=t.t("ariaLabelColor"),y("s")},this.i18nUpdater(),d.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const x=(M=!0)=>{const I=Ne.fromHSB(s,n,o,a).toHexString();if(l.style.setProperty("--h",`${s}`),l.style.setProperty("--s",`${n}`),l.style.setProperty("--v",`${o}`),l.style.setProperty("--a",`${a}`),l.style.setProperty("--color",I.slice(0,7)),l.style.setProperty("--color-a",I),h.value=`${s}`,u.value=`${a}`,u.classList.toggle("ag-charts-color-picker__alpha-input--opaque",a===1),d.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),f.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==p&&(d.ariaChecked=i.toString(),p.value=i?t.t("ariaLabelColorPickerMultiColor"):I.toUpperCase()),M||e.color==null){const k=Ne.fromHSB(s,n,o,1).toHexString();e.onChange?.(I,k,a,i)}M&&(this.hasChanged=!0)};x(!1);const b=M=>M.preventDefault(),v=M=>M.stopPropagation(),S=M=>{M.preventDefault();const D=M.currentTarget;D.focus();const I=D.getBoundingClientRect(),k=({clientX:w,clientY:C})=>{i=!1,n=Math.min(Math.max((w-I.left)/I.width,0),1),o=1-Math.min(Math.max((C-I.top)/I.height,0),1),x(),y("s")};k(M);const A=r.attachListener("pointermove",k);r.attachListener("pointerup",()=>A(),{once:!0})};return l.addEventListener("mousedown",v),l.addEventListener("touchstart",v),l.addEventListener("touchmove",v),l.addEventListener("keydown",M=>{switch(M.stopPropagation(),M.key){case"Enter":case"Escape":this.hide();break;default:return}M.preventDefault()}),c.addEventListener("pointerdown",S),c.addEventListener("touchstart",b,{passive:!1}),c.addEventListener("touchmove",b,{passive:!1}),c.addEventListener("keydown",M=>{if(M.key==="ArrowLeft")n=se(0,n-.01,1),y("s");else if(M.key==="ArrowRight")n=se(0,n+.01,1),y("s");else if(M.key==="ArrowUp")o=se(0,o+.01,1),y("v");else if(M.key==="ArrowDown")o=se(0,o-.01,1),y("v");else return;M.preventDefault(),x()}),c.addEventListener("focus",()=>{y("s")}),d.addEventListener("click",()=>{i=!i,x()}),h.addEventListener("input",M=>{i=!1,s=M.currentTarget.valueAsNumber??0,x()}),u.addEventListener("input",M=>{i=!1,a=M.currentTarget.valueAsNumber??0,x()}),p.addEventListener("input",M=>{i=!1;const D=zR(M.currentTarget.value);D!=null&&([s,n,o,a]=D,x())}),p.addEventListener("blur",()=>x()),p.addEventListener("keydown",M=>{M.key==="Enter"&&(M.currentTarget.blur(),x())}),{element:l,initialFocus:c}}},nr=class extends q{};g([m],nr.prototype,"icon",2),g([m],nr.prototype,"iconPosition",2),g([m],nr.prototype,"label",2),g([m],nr.prototype,"ariaLabel",2),g([m],nr.prototype,"tooltip",2);function BR(e){return!(e instanceof N.LogScale)&&!(e instanceof N.BandScale)}var wq=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:BR},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:BR}],Cq=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],Lq=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],Nq=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],Tq=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],Oq=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],FR=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],dm=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],_R=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{FloatingToolbar:Pq,Menu:ZA,ToolbarButtonWidget:Eq}=N,Lp=class extends nr{constructor(){super(...arguments),this.checkedOverrides=new nr}};g([m],Lp.prototype,"value",2),g([m],Lp.prototype,"checkedOverrides",2),g([m],Lp.prototype,"color",2),g([m],Lp.prototype,"strokeWidth",2),g([m],Lp.prototype,"isMultiColor",2);var Rq=class extends Eq{update(e){super.update(e),e.value==="line-stroke-width"&&this.updateLineStrokeWidth(e),(e.value==="fill-color"||e.value==="line-color"||e.value==="text-color")&&this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},zq=class extends Pq{createButtonWidget(){return new Rq(this.localeManager)}},XA=class extends q{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new Bi(Lp),this.cleanup=new ot,this.events=new zn,this.visibleButtons=[],this.toolbar=new zq(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new VR(this.ctx),this.textSizeMenu=new ZA(this.ctx,"text-size"),this.lineStyleTypeMenu=new ZA(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new ZA(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":Sc(e),"line-stroke-width":Sc(e),"line-color":vq(e),"text-color":Dq(e),"fill-color":Mq(e),"text-size":YA(e),settings:Cp(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>t[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,s){if(t!=null&&i!=null){const{r:n,g:o,b:a}=Ne.fromString(t);t=Ne.fromArray([n,o,a,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:s})}updateFontSize(e){this.updateButtonByValue("text-size",{label:e==null?void 0:String(e)})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}onButtonPress({event:e,button:t,buttonWidget:i}){const s=this.getActiveDatum();if(s)switch(this.hideOverlays(),t.value){case"line-style-type":{const n=Sc(s)?cm(s.lineDash,s.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:dm,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:n,minWidth:this.lineStyleTypeMenuMinWidth,onPress:o=>this.onLineStyleTypeMenuPress(o,s),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const n=Sc(s)?s.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:FR,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:n,minWidth:this.lineStrokeWidthMenuMinWidth,onPress:o=>this.onLineStrokeWidthMenuPress(o,s),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:s?.getDefaultColor(t.value),opacity:s?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in s,isMultiColor:"isMultiColor"in s&&s?.isMultiColor,onChange:s==null?void 0:this.onColorPickerChange.bind(this,t.value,s),onChangeHide:(n=>{this.events.emit("saved-color",{type:s.type,colorPickerType:t.value,color:s.getDefaultColor(n)})}).bind(this,t.value)});break}case"text-size":{const n=sr(s)?s.fontSize:void 0;this.textSizeMenu.show(i,{items:_R,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:n,minWidth:this.textSizeMenuMinWidth,onPress:o=>this.onTextSizeMenuPress(o,s),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{s.locked=!s.locked,this.refreshButtons(s),this.events.emit("pressed-lock",{locked:s.locked});break}case"settings":{this.toolbar.toggleActiveButtonByIndex(t.index),this.events.emit("pressed-settings",e);break}}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,s={x:i.x,y:i.y+i.height+4},n={y:i.y-4};this.colorPicker.setAnchor(s,n);for(const[o,a]of t.entries()){const r=this.visibleButtons.at(o);if(!r)continue;const l={x:a.x,y:a.y+a.height-1},c={y:a.y};switch(r.value){case"line-stroke-width":{this.lineStrokeWidthMenuMinWidth=a.width+1,this.lineStrokeWidthMenu.setAnchor(l,c);break}case"line-style-type":{this.lineStyleTypeMenuMinWidth=a.width+1,this.lineStyleTypeMenu.setAnchor(l,c);break}case"text-size":{this.textSizeMenuMinWidth=a.width+1,this.textSizeMenu.setAnchor(l,c);break}}}}onColorPickerChange(e,t,i,s,n,o){this.events.emit("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:s,opacity:n,isMultiColor:o}),this.updateColorPickerColor(e,i,n,o)}onTextSizeMenuPress(e,t){if(!YA(t))return;const i=e.value;this.events.emit("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!Sc(t))return;const i=e.value;this.events.emit("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!Sc(t))return;const i=e.value;this.events.emit("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[i,s]of this.visibleButtons.entries())s&&(s.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,t),this.updateButtonByIndex(i,t?s.checkedOverrides.toJson():s.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!t));YA(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!Sc(e))return;const t=e.strokeWidth??1,i=cm(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(dm.find(s=>s.value===i)??dm[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(s=>s.value===e);i!==-1&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};g([m],XA.prototype,"enabled",2),g([m],XA.prototype,"buttons",2);var Mi=class extends he{constructor(e){const t=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:s})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,s)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:i,context:s})=>{this.hasMoved=H.lengthSquared(H.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,s,this.snapping),e.update()},dragEnd:{target:he.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=ve.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};g([Je()],Mi.prototype,"snapping",2),g([Je()],Mi.prototype,"datum",2),g([Je()],Mi.prototype,"node",2);var Mc=class extends UA{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return me(e)&&e.type==="arrow-down"}};g([m],Mc.prototype,"type",2);var Np=class extends N.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}},HR=class uH extends N.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:i,locked:s}=this;return s?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-i.x,y:t.y-i.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=uH.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,i){return this.handle.containsPoint(t,i)}};HR.INACTIVE_STROKE_WIDTH=2;var Dc=HR,qA=class pH extends Dc{constructor(){super(),this.handle=new Np({shape:"circle"}),this.glow=new Np({shape:"circle"}),this.append([this.handle]),this.handle.size=pH.HANDLE_SIZE,this.handle.strokeWidth=Dc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:Dc.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};qA.HANDLE_SIZE=7,qA.GLOW_SIZE=9;var Ic=qA,Lv=class Rn extends Dc{constructor(){super(),this.handle=new N.Rect,this.glow=new N.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=Rn.CORNER_RADIUS,this.handle.width=Rn.HANDLE_SIZE,this.handle.height=Rn.HANDLE_SIZE,this.handle.strokeWidth=Dc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=Rn.CORNER_RADIUS,this.glow.width=Rn.GLOW_SIZE,this.glow.height=Rn.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const i=(Rn.HANDLE_SIZE-Ic.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=Ic.HANDLE_SIZE,this.handle.height=Ic.HANDLE_SIZE,this.glow.width=Ic.GLOW_SIZE,this.glow.height=Ic.GLOW_SIZE}else this.handle.cornerRadius=Rn.CORNER_RADIUS,this.handle.width=Rn.HANDLE_SIZE,this.handle.height=Rn.HANDLE_SIZE,this.glow.width=Rn.GLOW_SIZE,this.glow.height=Rn.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(Rn.HANDLE_SIZE-Ic.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};Lv.HANDLE_SIZE=12,Lv.GLOW_SIZE=16,Lv.CORNER_RADIUS=4;var Tp=Lv,QA=class Km extends Dc{constructor(){super(),this.handle=new Np({shape:"circle"}),this.glow=new Np({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=Km.HANDLE_SIZE,this.handle.strokeWidth=Dc.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=Km.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=Ic.HANDLE_SIZE,this.glow.size=Ic.GLOW_SIZE):(this.handle.size=Km.HANDLE_SIZE,this.glow.size=Km.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(t){this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked&&(delete t.fill,delete t.strokeWidth),this.handle.setProperties(t),this.glow.setProperties({...t,strokeWidth:0,fill:t.stroke})}getCursor(){return"pointer"}};QA.HANDLE_SIZE=11,QA.GLOW_SIZE=17;var ii=QA,es=class extends N.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=12}static isCheck(e,t){return me(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e,t,i){i!==!0&&this.toggleHandles(e||t)}computeBBoxWithoutHandles(){return N.Transformable.toCanvas(this,N.Group.computeChildrenBBox(this.excludeChildren({instance:Dc})))}updateNode(e,t,i){if(!i&&t){t.remove();return}return i&&t==null&&(t=new e,this.appendChild(t)),t}},{ContinuousScale:Vq}=N;function um(e,t,i=!1,s,n=1){if(!i)return rn(e,t);const o=s?ti(s,t):H.origin();return rn(Nv(e,o,n),t)}function Nv(e,t,i){const s=H.sub(e,t),n=lt(i),o=Math.round(H.angle(s)/n)*n;return H.rotate(s,o,t)}function Tv(e,t){const i={};for(const[s,n]of rt(e))i[s]=ti(n,t);return i}function fl(e,t,i,s={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:n,yAxis:o}=i,a=Object.keys(e),r=[],l=[],c=new Set(s.translateVectors??a),h=new Set(s.invertYVectors??[]),d=new Set([...c,...h]),u=H.multiply(t,H.from(1,-1));for(const b of a)d.has(b)&&(e[b]=H.add(e[b],h.has(b)?u:t),s.snap&&(e[b]=Nv(e[b],s.snap.vectors[b],s.snap.angle))),r.push(n.getRangeOverflow(e[b].x)),l.push(o.getRangeOverflow(e[b].y));const p=(b,v)=>Math.abs(b)-Math.abs(v),f=(b,v,S)=>s.overflowContinuous===0||!Vq.is(b)?S.toSorted(p).at(-1)??0:a.length===d.size?S.toSorted(p).at(-s.overflowContinuous-1)??0:S.filter(D=>D!==0).length<=s.overflowContinuous?0:S.filter((D,I)=>D!==0&&Math.abs(D)<=Math.abs(v)&&d.has(a[I])).toSorted(p).at(-1)??0,y=H.from(f(n.scale,t.x,r),f(o.scale,t.y,l));if(!H.equal(y,H.origin()))for(const b of a)d.has(b)&&(e[b]=H.round(H.sub(e[b],y),4));const x={};for(const b of a)x[b]=rn(e[b],i);return x}var GR=class extends es{constructor(){super(...arguments),this.handle=new ii,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=ti(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...Tv({handle:e},i)}}drag(e,t,i){const{dragState:s}=this;if(!e.isWriteable()||!s)return;const{point:n}=fl({point:s.handle},H.sub(t,s.offset),i);e.x=n.x,e.y=n.y}translate(e,t,i){if(!e.isWriteable())return;const{point:s}=fl({point:ti(e,i)},t,i);e.x=s.x,e.y=s.y}toggleHandles(e){this.handle.visible=!!e,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const s=ti(e,i),n=rn({x:s.x-30,y:s.y-30},i);return t.x=n.x,t.y=n.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:s,y:n}=this.getHandleCoords(e,t,i),o=this.getHandleStyles(e);this.handle.update({...o,x:s,y:n}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const s=this.getHandleCoords(e,t);return{x:s.x+i.seriesRect.x,y:s.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},jR=class extends GR{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=ti(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},WR=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function $R(e){N.drawMarkerUnitPolygon(e,WR)}$R.anchor={x:.5,y:0};var Ov=class extends jR{constructor(){super(),this.type="arrow-up",this.shape=new Np({shape:$R}),this.append([this.shape])}static is(e){return es.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=ii.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y-=i,s}},Bq=WR.map(([e,t])=>[e,1-t]);function KR(e){N.drawMarkerUnitPolygon(e,Bq)}KR.anchor={x:.5,y:1};var Pv=class extends jR{constructor(){super(),this.type="arrow-down",this.shape=new Np({shape:KR}),this.append([this.shape])}static is(e){return es.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i);return s.y-=e.size,s}getHandleCoords(e,t){const i=ii.HANDLE_SIZE/2,s=super.getHandleCoords(e,t);return s.y+=i,s}},JA=class extends he{constructor(e){const t=({point:s})=>{const n=this.createDatum();n.set({x:s.x,y:s.y}),e.create(n)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:he.parent,reset:he.parent},"waiting-first-render":{render:{target:he.parent,action:i}}}),this.debug=ve.create(!0,"annotations")}};g([Je()],JA.prototype,"node",2);var Fq=class extends JA{createDatum(){return new Mc}},UR={type:"arrow-down",datum:Mc,scene:Pv,isDatum:Mc.is,translate:(e,t,i,s)=>{Mc.is(t)&&Pv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Mc.is(t)&&Mc.is(i)&&Pv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Mc.is(t)&&Pv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Fq({...e,create:t("arrow-down")}),dragState:e=>new Mi(e)},kc=class extends UA{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return me(e)&&e.type==="arrow-up"}};g([m],kc.prototype,"type",2);var _q=class extends JA{createDatum(){return new kc}},YR={type:"arrow-up",datum:kc,scene:Ov,isDatum:kc.is,translate:(e,t,i,s)=>{kc.is(t)&&Ov.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(kc.is(t)&&kc.is(i)&&Ov.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{kc.is(t)&&Ov.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new _q({...e,create:t("arrow-up")}),dragState:e=>new Mi(e)},ZR=class extends es{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:s},n,o){const a={x1:e,y1:t,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const[r,l]=hq(a,o.yAxis.bounds),c=a.x2=a.y2,d=a.x2===a.x1;return n.extendEnd&&(d?a.y2=h?l.y:r.y:(a.x2=c?r.x:l.x,a.y2=c?r.y:l.y)),n.extendStart&&(d?a.y1=h?r.y:l.y:(a.x1=c?l.x:r.x,a.y1=c?l.y:r.y)),a}dragStart(e,t,i){this.dragState={offset:t,...Tv({start:e.start,end:e.end},i)}}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints(e,s.start,s.end,H.sub(t,s.offset),i)}translate(e,t,i){e.isWriteable()&&this.translatePoints(e,ti(e.start,i),ti(e.end,i),t,i)}copy(e,t,i){const s=an(e,i);if(!s)return;const n=this.computeBBoxWithoutHandles(),o={x:-n.width/2,y:-n.height/2};return this.translatePoints(t,Se.start(s),Se.end(s),o,i),t}translatePoints(e,t,i,s,n){const o=this.getTranslatePointsVectors(t,i),a=fl(o,s,n,{overflowContinuous:this.overflowContinuous});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},ew=class extends ZR{constructor(){super(...arguments),this.start=new ii,this.end=new ii,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=an(e,t);i!=null&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of rt(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=n==="start"?"end":"start",r=s?{vectors:{[n]:ti(e[a],i)},angle:e.snapToAngle}:void 0,{[n]:l}=fl({[n]:o[n]},H.sub(t,o.offset),i,{overflowContinuous:0,snap:r});e[n].x=l.x,e[n].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):!1}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,s){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,s){return i==="start"?Se.start(t):Se.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},Hq=class extends ew{constructor(){super(...arguments),this.label=new N.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=an(e,t);if(i==null)return;const s=this.getTextBBox(e,i);this.updateLabel(e,s,i,t),this.updateHandles(e,i,s),this.updateShape(e,s,i),this.updateAnchor(e,i,t,s)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return KA(e,i,Se.end(t),this.textInputBBox)}updateLabel(e,t,i,s){const{text:n,isPlaceholder:o}=e.getText(),a=this.getLabelCoords(e,t,i);s.isRtl&&(a.x+=t.width),NR(this.label,n,o,e,a)}updateShape(e,t,i){}getLabelCoords(e,t,i){return Se.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:Gq,Path:jq}=N,Ev=class extends Hq{constructor(){super(),this.type="callout",this.shape=new jq,this.append([this.shape,this.label,this.start,this.end])}static is(e){return es.isCheck(e,"callout")}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle==="end"?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const s=e.getPadding(),{bodyBounds:n={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:n.x+s.left,y:n.y-s.bottom}}getHandleStyles(e,t){return t==="start"?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,s){const{bodyBounds:n}=this.getDimensions(e,s,t)??{},o=n??s;this.anchor={x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y-o.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:s}=this;s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeWidth=e.strokeWidth??1,s.strokeOpacity=e.strokeOpacity??1;const{tailPoint:n,bodyBounds:o}=this.getDimensions(e,t,i)??{};!n||!o||this.updatePath(n,o)}updatePath(e,t){const{x:i,y:s}=e,{x:n,y:o,width:a,height:r}=t,l=o-r,c=n+a,h=this.calculateCalloutPlacement({x:i,y:s},t),d=8,u=[{coordinates:{x0:n,x1:n+d,y0:l+d,y1:l,cx:h==="topLeft"?i:n+d,cy:h==="topLeft"?s:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:n+d,x1:c-d,y0:l,y1:l,cx:i,cy:s},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?s:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:o-d,cx:i,cy:s},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:o-d,y1:o,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?s:o-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:n+d,y0:o,y1:o,cx:i,cy:s},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:n+d,x1:n,y0:o,y1:o-d,cx:h==="bottomLeft"?i:n+d,cy:h==="bottomLeft"?s:o-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:n,x1:n,y0:o-d,y1:l+d,cx:i,cy:s},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(n,l+d);for(const{coordinates:f,type:y}of u)this.drawPath(p,f,d,y);p.closePath()}drawPath(e,{x0:t,y0:i,x1:s,y1:n,cx:o,cy:a},r,l){switch(l){case"calloutCorner":{e.lineTo(o,a),e.lineTo(s,n);break}case"corner":{Gq(e,{x0:t,x1:s,y0:i,y1:n,cx:o,cy:a},r,!1);break}case"calloutSide":{if(t===s){const h=i>n?-1:1,d=Math.min(i,n)+Math.abs(i-n)/2;e.lineTo(t,d-6*h),e.lineTo(o,a),e.lineTo(t,d+6*h),e.lineTo(s,n)}else{const h=t>s?-1:1,d=Math.min(t,s)+Math.abs(s-t)/2;e.lineTo(d-6*h,i),e.lineTo(o,a),e.lineTo(d+6*h,i),e.lineTo(s,n)}break}case"side":default:{e.lineTo(s,n);break}}}calculateCalloutPlacement(e,t){const i=t.x+t.width,s=t.y-t.height;let n,o;return e.x>i?n="right":e.xt.y?o="bottom":e.y{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),e.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{e.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),e.deselect()},o=u=>{this.node?.setTextInputBBox(u),e.update()},a=({point:u})=>{const{datum:p,node:f}=this;p?.set({end:u}),f?.toggleActive(!0),f?.toggleHandles({end:!1}),e.update()},r=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:f,opacity:y,isMultiColor:x})=>{const{datum:b}=this;b&&(u==="text-color"&&e.updateTextInputColor(f),Cv(b,u,p,f,y,x),e.update())},c=u=>{const{datum:p,node:f}=this;!p||!f||!sr(p)||(p.fontSize=u,e.updateTextInputFontSize(u),e.update())},h=()=>{e.delete()},d=({textInputValue:u,bbox:p})=>{const{datum:f}=this;if(p!=null&&u!=null&&u.length>0){if(!sr(f))return;const y=kv(f,u,p.width);f?.set({text:y}),e.update(),e.recordAction(`Create ${f?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:he.parent,reset:he.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:a,drag:a,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:he.parent,action:h},cancel:{target:he.parent,action:h}},edit:{onEnter:s,updateTextInputBBox:o,color:l,fontSize:c,textInput:[{guard:tw,target:he.parent,action:h},{guard:iw,target:he.parent,action:d}],click:{target:he.parent,action:d},dragStart:{target:he.parent,action:d},resize:{target:he.parent,action:d},onExit:n,cancel:{target:he.parent,action:h}}}),this.debug=ve.create(!0,"annotations")}};g([Je()],sw.prototype,"datum",2),g([Je()],sw.prototype,"node",2);var Wq=class extends sw{createDatum(){return new pa}},XR={type:"callout",datum:pa,scene:Ev,isDatum:pa.is,translate:(e,t,i,s)=>{if(pa.is(t)&&Ev.is(e))return e.translate(t,i,s)},copy:(e,t,i,s)=>{if(pa.is(t)&&pa.is(i)&&Ev.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{pa.is(t)&&Ev.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Wq({...e,create:t("callout")}),dragState:e=>new Mi(e)},nw=class extends GR{constructor(){super(...arguments),this.label=new N.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=ti(e,t),s=this.getTextBBox(e,i,t);this.updateLabel(e,s,t),this.updateHandle(e,i,s),this.updateShape(e,s),this.anchor=this.updateAnchor(e,s,t)}copy(e,t,i){const s=ti(e,i),n=this.getTextBBox(e,s,i),o=e.getPadding(),a=o.left+o.right,r=o.top+o.bottom,l=(n.width+a)/2,c=n.height+r,h=rn({x:s.x-l,y:s.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:s}=e.getText();return KA(e,s,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t,i){const{text:s,isPlaceholder:n}=e.getText(),o=this.getLabelCoords(e,t);i.isRtl&&(o.x+=t.width),NR(this.label,s,n,e,o,this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:i.isRtl?t.x-t.width+i.seriesRect.x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return e.position=="center"?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:ow}=N,Rv=class extends nw{constructor(){super(),this.type="comment",this.shape=new N.Path,this.append([this.shape,this.label,this.handle])}static is(e){return es.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const s=super.updateAnchor(e,t,i),n=e.getPadding();return s.y-=n.bottom+n.top,s}updatePath(e,t){const i=e.getPadding(),{x:s,y:n}=t;let{width:o,height:a}=t;const{fontSize:r}=e,l=i.left+i.right,c=i.top+i.bottom;o=o+l,a=Math.max(a+c,r+c);const h=n-a,d=s+o,u=(Fn(r,Iv)+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(s,n),p.lineTo(s,h+u),ow(p,{x0:s,x1:s+u,y0:h+u,y1:h,cx:s+u,cy:h+u},u,!1),p.lineTo(d-u,h),ow(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,n-u),ow(p,{x0:d,x1:d-u,y0:n-u,y1:n,cx:d-u,cy:n-u},u,!1),p.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}},pm=class extends he{constructor(e){const t=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),e.create(d)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},s=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},n=()=>{e.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),e.deselect()},o=h=>{this.node?.setTextInputBBox(h),e.update()},a=({colorPickerType:h,colorOpacity:d,color:u,opacity:p,isMultiColor:f})=>{this.datum&&(h==="text-color"&&e.updateTextInputColor(u),Cv(this.datum,h,d,u,p,f),e.update())},r=h=>{const{datum:d,node:u}=this;!d||!u||!sr(d)||(d.fontSize=h,e.updateTextInputFontSize(h),e.update())},l=()=>{e.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!sr(u))return;const p=kv(u,h,d.width);u?.set({text:p}),e.update(),e.recordAction(`Create ${u?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:he.parent,reset:he.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:s,updateTextInputBBox:o,color:a,fontSize:r,textInput:[{guard:tw,target:he.parent,action:l},{guard:iw,target:he.parent,action:c}],click:{target:he.parent,action:c},dragStart:{target:he.parent,action:c},resize:{target:he.parent,action:c},onExit:n,cancel:{target:he.parent,action:l}}}),this.debug=ve.create(!0,"annotations")}};g([Je()],pm.prototype,"datum",2),g([Je()],pm.prototype,"node",2);var $q=class extends pm{createDatum(){return new er}},qR={type:"comment",datum:er,scene:Rv,isDatum:er.is,translate:(e,t,i,s)=>{er.is(t)&&Rv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(er.is(t)&&er.is(i)&&Rv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{er.is(t)&&Rv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new $q({...e,create:t("comment")}),dragState:e=>new Mi(e)},{calculateLabelTranslation:Kq}=N,QR=class extends N.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new N.Text({zIndex:1}),this.rect=new N.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,color:l="white",formatter:c}=t,h=c?c({value:e}):i.formatScaleValue(e,"annotation-label");this.label.setProperties({fontWeight:s,fontSize:n,fontStyle:o,fontFamily:a,textAlign:r,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,stroke:o,strokeOpacity:a}=e;t.fill=s,t.fillOpacity=n??1,t.stroke=o,t.strokeOpacity=a??1,t.cornerRadius=i??0}updatePosition({x:e,y:t,context:i,styles:{padding:s}}){const{label:n,rect:o}=this,a=n.getBBox()?.clone(),r=s??8,l=s??4,{xTranslation:c,yTranslation:h}=Kq({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:a});a.grow(r,"horizontal"),a.grow(l,"vertical");const d=e+c,u=t+h;n.x=d,n.y=u,o.y=u-Math.round(a.height/2),o.x=d-Math.round(a.width/2),o.height=a.height,o.width=a.width}};QR.className="AxisLabel";var Cn=class extends N.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e){return super.setProperties(e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:s,x2:n,y2:o}=this;let a=t+e;a%2===0&&(a+=1);const r=H.from(i,s-Math.floor(a/2)),l=H.from(n,o),c=H.distance(r,l);this.collisionBBox=new N.BBox(r.x,r.y,c,a)}isPointInPath(e,t){const{collisionBBox:i,x1:s,y1:n,x2:o,y2:a}=this;if(!i)return!1;const r=H.from(s,n),l=H.from(o,a),c=H.sub(H.from(e,t),r),h=H.sub(l,r),d=H.rotate(c,H.angle(c,h),r);return i.containsPoint(d.x,d.y)??!1}render(e){const{clipMask:t}=this,{ctx:i}=e;if(t.size===0){super.render(e);return}i.save();try{for(const s of this.clipMask.values()){const{x:n,y:o,radius:a}=s;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(n,o,a,a,0,Math.PI*2,0,!0),i.clip()}super.render(e)}finally{i.restore()}}setClipMask(e,t){const i=this.clipMask.get(e);Kn(i,t)!=null&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}},Jh=class extends N.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),s=this.computeBBoxWithoutTransforms();return s?s.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}};function Op(e,t,i,s,n,o,a){if(!o||!n||!s){t.setClipMask(e);return}const{alignment:r,position:l}=s,c=ez(i,s.fontSize,a),{point:h,textBaseline:d}=tz(c,l,r);iz(n,o,s,h,c.angle,d);const{x:u,y:p,width:f,height:y}=n.getBBox(),x=H.length(H.from(f,y)),b={x:u+f/2,y:p+y/2,radius:x/2+H.length(c.offset)};return l==="center"?t.setClipMask(e,b):t.setClipMask(e),{clipMask:b,numbers:c}}function JR(e,t,i,s,n,o,a){if(!a||!o)return;const{alignment:r,position:l}=s,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let d=c;l==="bottom"?d=h:l==="inside"&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=ez(d,s.fontSize,n),{point:p,textBaseline:f}=tz(u,l==="inside"?"center":l,r,e);iz(o,a,s,p,u.angle,f)}function ez(e,t,i){let[s,n]=H.from(e);s.x>n.x&&([s,n]=[n,s]);const o=H.normalized(H.sub(n,s)),a=H.angle(o),r=H.multiply(o,ii.HANDLE_SIZE/2+(t??14)/2),l=H.multiply(o,(i??2)/2+(t??14)/3);return{left:s,right:n,normal:o,angle:a,inset:r,offset:l}}function tz({left:e,right:t,normal:i,angle:s,inset:n,offset:o},a,r,l){let c;r==="right"?c=H.sub(t,n):r==="center"?c=H.add(e,H.multiply(i,H.distance(e,t)/2)):c=H.add(e,n);let h="bottom";return a==="bottom"?(c=H.rotate(o,s+Math.PI/2,c),h="top"):a==="center"&&!l?h="middle":c=H.rotate(o,s-Math.PI/2,c),{point:c,textBaseline:h}}function iz(e,t,i,s,n,o){e.setProperties({text:t,x:s.x,y:s.y,rotation:n,rotationCenterX:s.x,rotationCenterY:s.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:o})}var Ac=class extends es{constructor(){super(),this.type="cross-line",this.line=new Cn,this.middle=new Tp,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return es.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=_s.is(e);const s=this.isHorizontal?t.yAxis:t.xAxis,n=this.convertCrossLine(e,s);if(n==null){this.visible=!1;return}this.visible=e.visible??!0,this.visible&&(this.updateLine(e,n),this.updateHandle(e,n),this.updateText(e,n),this.updateAxisLabel(e,s,n))}updateLine(e,t){const{line:i}=this,{lineDashOffset:s,stroke:n,strokeWidth:o,strokeOpacity:a}=e,{x1:r,y1:l,x2:c,y2:h}=t;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:n,strokeWidth:o,strokeOpacity:a,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:s,stroke:n,strokeWidth:o,strokeOpacity:a}=e,r={fill:e.handle.fill,stroke:e.handle.stroke??n,strokeOpacity:e.handle.strokeOpacity??a,strokeWidth:e.handle.strokeWidth??o},l=H.sub(Se.center(t),H.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(s??!1)}updateText(e,t){this.text=this.updateNode(Jh,this.text,!!e.text.label),Op(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new QR;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(t));const{axisLabel:s,seriesRect:n}=this,{direction:o,position:a}=t;if(e.axisLabel.enabled){s.visible=this.visible;const r=a==="left"||a==="top"?Se.start(i):Se.end(i),l=o==="x"?r.x:r.y;if(!t.inRange(l)){s.visible=!1;return}const c=Ei(e.value);s.update({...H.add(r,H.required(n)),value:c,styles:e.axisLabel,context:t})}else s.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const s=_s.is(e)?{x:t.x,y:rl(e.value,i.yAxis)}:{x:rl(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:s}}drag(e,t,i){const{activeHandle:s,dragState:n}=this;!e.isWriteable()||!n||(s&&this[s].toggleDragging(!0),this.translatePoint(e,n.middle,H.sub(t,n.offset),i))}translate(e,t,i){if(!e.isWriteable())return;const s=_s.is(e)?H.from(0,rl(e.value,i.yAxis)):H.from(rl(e.value,i.xAxis),0);this.translatePoint(e,s,t,i)}translatePoint(e,t,i,s){const n=_s.is(e);n?i.x=0:i.y=0;const{point:o}=fl({point:t},i,s);e.value=n?o.y:o.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const s=_s.is(e),n=this.isHorizontal?i.yAxis:i.xAxis,o=this.convertCrossLine(e,n);if(!o)return;const a=s?-30:0,r=s?0:-30,l=rn({x:o.x1+r,y:o.y1+a},i);return t.set({value:s?l.y:l.x}),t}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:s,text:n}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):s.isPointInPath(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.line.isPointInPath(e,t))return"line";if(this.middle.containsPoint(e,t))return"handle"}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(e.value==null)return;let i=0,s=0,n,o;const{bounds:a}=t,r=rl(e.value,t);return _s.is(e)?(n=a.width,s=r,o=r):(i=r,n=r,o=a.height),{x1:i,y1:s,x2:n,y2:o}}},aw=class extends he{constructor(e,t){const i=({point:n})=>{const o=e==="horizontal",a=o?new _s:new tr;a.set({value:o?n.y:n.x}),t.create(a),t.recordAction(`Create ${o?"horizontal-line":"vertical-line"} annotation`)},s=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:he.parent,cancel:he.parent},"waiting-first-render":{render:{target:he.parent,action:s}}}),this.debug=ve.create(!0,"annotations")}};g([Je()],aw.prototype,"node",2);var sz={type:"horizontal-line",datum:_s,scene:Ac,isDatum:_s.is,translate:(e,t,i,s)=>{_s.is(t)&&Ac.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(_s.is(t)&&_s.is(i)&&Ac.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{_s.is(t)&&Ac.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new aw("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new Mi(e)},nz={type:"vertical-line",datum:tr,scene:Ac,isDatum:tr.is,translate:(e,t,i,s)=>{tr.is(t)&&Ac.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(tr.is(t)&&tr.is(i)&&Ac.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{tr.is(t)&&Ac.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new aw("vertical",{...e,create:t("vertical-line")}),dragState:e=>new Mi(e)},oz=class{static updateBackground(e,t,i,s){const{background:n}=this,{seriesRect:o}=s;n.path.clear(!0);const a=Se.from(0,0,o.width,o.height),r=this.getBackgroundPoints(e,t,i,a);for(let c=0;ct.x2,o=t.y1>t.y2,a=o?s.y2:s.y1,r=o?s.y1:s.y2,l=H.from(t);return e.extendEnd&&t.y2===r&&l.push(H.from(n?s.x1:s.x2,o?s.y1:s.y2)),e.extendEnd&&i.y2===a&&l.push(H.from(n?s.x1:s.x2,o?s.y2:s.y1)),l.push(...H.from(i).reverse()),e.extendStart&&i.y1===r&&l.push(H.from(n?s.x2:s.x1,o?s.y1:s.y2)),e.extendStart&&t.y1===a&&l.push(H.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},Vv=class extends he{constructor(e){const t=({point:l})=>{const c=new Ro;c.set({start:l,end:l,startHeight:0,endHeight:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:um(l,c,d,h.start,h.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=Ei(c?.end.y),u=Ei(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=(u-d)*2+f,x={x:c?.start.x,y:u-y},b={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(b,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:f}),e.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=Ei(c?.end.y),u=Ei(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=(u-d)*2+f,x={x:c.start.x,y:u-f},b={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(b,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:f}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:he.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:he.parent,action:r},cancel:{target:he.parent,action:r}},height:{hover:o,click:{target:he.parent,action:a},drag:{target:he.parent,action:a},reset:{target:he.parent,action:r},cancel:{target:he.parent,action:r}}}),this.debug=ve.create(!0,"annotations"),this.snapping=!1}};g([Je()],Vv.prototype,"datum",2),g([Je()],Vv.prototype,"node",2),g([Je()],Vv.prototype,"snapping",2);var rz={type:"disjoint-channel",datum:Ro,scene:zv,isDatum:Ro.is,translate:(e,t,i,s)=>{Ro.is(t)&&zv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Ro.is(t)&&Ro.is(i)&&zv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Ro.is(t)&&zv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Vv({...e,create:t("disjoint-channel")}),dragState:e=>new Mi(e)},rw=[0,23.6,38.2,50,61.8,78.6,100],Uq=[161.8,261.8,361.8,423.6],Yq=[...rw,...Uq],Zq={10:Yq,6:rw,4:rw.filter(e=>e!==78.6&&e!==23.6)},lz=10;function Xq(e,t){const{x2:i,y1:s,y2:n}=e,o=s-n;return t==null?{x1:i,x2:i,y1:n-o,y2:n}:{x1:t.x1,x2:t.x2,y1:t.y2-o,y2:t.y2}}function cz({x1:e,y1:t,x2:i,y2:s},n,o,a,r=10){const l=t-s,c=o?-1:1,h=[],{yAxis:d,isRtl:u}=n;let p=a;for(const[f,y]of Zq[r].entries()){const x=a+l*(y/100)*c,b=d.scaleInvert(x);h.push({id:f,x1:e,x2:i,y1:p,y2:x,tag:y==100?0:1,label:{x1:u?Math.max(e,i)+lz:Math.min(e,i)-lz,x2:i,y1:x,y2:x,text:u?`(${b.toFixed(2)}) ${(y/100).toFixed(3)}`:`${(y/100).toFixed(3)} (${b.toFixed(2)})`}}),p=x}return h}var hz=class extends es{constructor(){super(),this.trendLine=new Cn,this.rangeFillsGroup=new N.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=N.Selection.select(this.rangeFillsGroup,N.Range),this.rangeStrokesGroup=new N.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=N.Selection.select(this.rangeStrokesGroup,Cn),this.labelsGroup=new N.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=N.Selection.select(this.labelsGroup,Jh),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=an(e,t);if(i==null){this.visible=!1;return}if(i=Se.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:s}=e,n=this.extendLine(i,e,t),o=s?n.y1:n.y2,a=s?n.y2:n.y1,r=cz(n,t,e.reverse,o,e.bands);this.updateRanges(e,r,t);const l={...n,y1:a,y2:a};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:s},n,o){const a={x1:e,y1:t,x2:i,y2:s};if(!n.extendStart&&!n.extendEnd)return a;const{x:r,width:l}=o.xAxis.bounds;return n.extendEnd&&(a[e>i?"x1":"x2"]=r+l),n.extendStart&&(a[e>i?"x2":"x1"]=r),a}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:s,strokeWidth:n,strokeOpacity:o,stroke:a}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:s,strokeWidth:n,strokeOpacity:o,fillOpacity:0,stroke:a})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,isMultiColor:a}=e;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,f=a?n[u%n.length]:o;r.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:f,strokeOpacity:s,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:d})})}updateRanges(e,t,i){const s=n=>n.id;this.rangeFillsGroupSelection.update(t,void 0,s),this.rangeStrokesGroupSelection.update(t,void 0,s),this.labelsGroupSelection.update(t,void 0,s),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:s,strokes:n,rangeStroke:o,showFill:a,isMultiColor:r}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const f=r?n[p%n.length]:o;if(!a){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,stroke:f,strokeOpacity:s,fill:f,fillOpacity:(s??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t,isRtl:i}){const{rangeStrokesGroupSelection:s}=this,{strokes:n,strokeWidth:o,rangeStroke:a,isMultiColor:r,label:{fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,color:u}}=e,p={fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d},f=this.checkWithinBounds(t,p,i,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((y,x,b)=>{const v=u??(r?n[b%n.length]:a),S=s.at(b);if(!S)return;const{text:M,...D}=x.label;if(f)y.setProperties({...p,text:M,x:D.x1,y:D.y1,textBaseline:"middle",textAlign:i?"left":"end",fill:v}),Op(y.id,S,D);else{const I={...p,label:M,position:"center",alignment:i?"right":"left",color:v};Op(y.id,S,D,I,y,M,o)}})}checkWithinBounds(e,t,i,s){if(!s)return!1;const{text:n,...o}=s.datum.label;s.setProperties({...t,text:n,x:o.x1,y:o.y1,textBaseline:"middle",textAlign:i?"left":"end"});const a=s.getBBox(),r=a.x,l=a.x+a.width,c=e.bounds.x,h=e.bounds.x+e.bounds.width;return r>=c&&l<=h}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:s,strokeWidth:n}=e;this.text=this.updateNode(Jh,this.text,!!s.label),Op(i.id,i,t,s,this.text,s.label,n)}updateAnchor(e,t,i,s){const n=Se.topCenter(t);H.apply(this.anchor,N.Transformable.toCanvasPoint(this.trendLine,n.x,n.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:s,text:n}=this;let o=!1;return s.each(a=>o||(o=a.isPointInPath(e,t))),o||i.isPointInPath(e,t)||!!n?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.trendLine.isPointInPath(e,t))return"line"}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,s){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,s):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},{ContinuousScale:dz}=N;function Bv(e,t,i={overflowContinuous:!1},s){if(t.x==null||t.y==null)return s&&W.warnOnce(`${s}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:n,yAxis:o}=e,a=i.overflowContinuous&&dz.is(n.scale),r=i.overflowContinuous&&dz.is(o.scale),l=a||uz(t.x,n),c=r||uz(t.y,o);if(l&&c)return!0;if(s){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=Ei(t.x),u=Ei(t.y);W.warnOnce(`${s}is outside the ${h}, ignoring. - x: [${d}], y: ${u}]`)}return!1}function uz(e,t){const{domain:i}=t.scale,s=Ei(e);return i&&s!=null&&t.continuous?s>=i[0]&&s<=i.at(-1):!0}var Fv=class extends hz{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new Cn,this.start=new ii,this.end=new ii,this.endRetracement=new ii,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return es.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:s}=this.getCoords(e,t);if(i==null||s==null){this.visible=!1;return}if(i=Se.round(i),s=Se.round(s),this.visible=e.visible??!0,!this.visible)return;(e.endRetracement.x==null||e.endRetracement.y==null)&&(s=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,s,this.endRetracementLine),this.updateHandles(e,i,s),this.updateAnchor(e,s??i,t);const{reverse:n,bands:o}=e,a=Xq(i,s),r=this.extendLine(a,e,t),l=r.y2,c=r.y1,h=s?cz(r,t,n,l,o):[];this.updateRanges(e,h,t);const d={...r,y1:c,y2:c};this.updateText(e,d)}containsPoint(e,t){const{start:i,end:s,endRetracement:n,endRetracementLine:o}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):n.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):o.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...Tv({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,endRetracement:s.endRetracement,translation:H.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(e,t,i):rn(this[n].drag(t).point,i);!a||!Bv(i,a)||(e[n].x=a.x,e[n].y=a.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,n=["start","end","endRetracement"];if(!s)return;const o=(n.indexOf(s)+1)%n.length,a=n[o];this[s].toggleDragging(!0);const r=ti(e[a],i);return rn(Nv(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:s,translation:n,context:o}){const a=fl({start:t,end:i,endRetracement:s},n,o,{overflowContinuous:2});e.start.x=a.start.x,e.end.x=a.end.x,e.endRetracement.x=a.endRetracement.x,e.start.y=a.start.y,e.end.y=a.end.y,e.endRetracement.y=a.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:ti(e.start,i),end:ti(e.end,i),endRetracement:ti(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:s,coords2:n}=this.getCoords(e,i);if(!s||!n)return;const o=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:Se.start(s),end:Se.end(s),endRetracement:Se.end(n),translation:{x:-o.width/2,y:-o.height/2},context:i}),t}getCoords(e,t){return{coords1:an(e,t),coords2:an({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of rt(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?Se.start(t):Se.end(t)}},_v=class extends he{constructor(e){const t=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),e.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},s=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({end:um(c,h,u,d.start,d.snapToAngle)}),e.update())},n=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),e.update())},o=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({endRetracement:um(c,h,u,d.end,d.snapToAngle)}),e.update())},a=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},r=()=>e.delete(),l=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:he.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:"endRetracement",action:n},drag:s,dragEnd:{target:"endRetracement",action:n},reset:{target:he.parent,action:r},cancel:{target:he.parent,action:r},onExit:l},endRetracement:{hover:o,click:{target:he.parent,action:a},drag:{target:he.parent,action:a},reset:{target:he.parent,action:r},cancel:{target:he.parent,action:r}}}),this.debug=ve.create(!0,"annotations"),this.snapping=!1}createDatum(){return new ir}};g([Je()],_v.prototype,"datum",2),g([Je()],_v.prototype,"node",2),g([Je()],_v.prototype,"snapping",2);var pz={type:"fibonacci-retracement-trend-based",datum:ir,scene:Fv,isDatum:ir.is,translate:(e,t,i,s)=>{ir.is(t)&&Fv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ir.is(t)&&ir.is(i)&&Fv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ir.is(t)&&Fv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new _v({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new Mi(e)},Hv=class extends hz{constructor(){super(),this.type="fibonacci-retracement",this.start=new ii,this.end=new ii,this.append([this.start,this.end])}static is(e){return es.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):s.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...Tv({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:s}=this;s&&this.translatePoints({datum:e,start:s.start,end:s.end,translation:H.sub(t,s.offset),context:i})}dragHandle(e,t,i,s){const{activeHandle:n,dragState:o}=this;if(!n||!o)return;this[n].toggleDragging(!0);const a=s?this.snapToAngle(e,t,i):rn(this[n].drag(t).point,i);!a||!Bv(i,a)||(e[n].x=a.x,e[n].y=a.y)}snapToAngle(e,t,i){const{activeHandle:s}=this,o=["start","end"].find(r=>r!==s);if(!s||!o)return;this[s].toggleDragging(!0);const a=ti(e[o],i);return rn(Nv(t,a,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:s,context:n}){const o=fl({start:t,end:i},s,n,{overflowContinuous:1});e.start.x=o.start.x,e.end.x=o.end.x,e.start.y=o.start.y,e.end.y=o.end.y}translate(e,t,i){this.translatePoints({datum:e,start:ti(e.start,i),end:ti(e.end,i),translation:t,context:i})}copy(e,t,i){const s=an(e,i);if(!s)return;const n=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:s.x1,y:s.y1},end:{x:s.x2,y:s.y2},translation:{x:-n.width/2,y:-n.height/2},context:i}),t}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of rt(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,s){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",s)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,s){return i==="start"?Se.start(t):Se.end(t)}},Pp=class extends he{constructor(e){const t=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),e.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},s=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:um(r,l,h,c.start,c.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({end:!0}),e.update()},o=()=>e.delete(),a=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:he.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,click:{target:he.parent,action:n},drag:s,dragEnd:{target:he.parent,action:n},reset:{target:he.parent,action:o},cancel:{target:he.parent,action:o},onExit:a}}),this.debug=ve.create(!0,"annotations"),this.snapping=!1}};g([Je()],Pp.prototype,"datum",2),g([Je()],Pp.prototype,"node",2),g([Je()],Pp.prototype,"snapping",2);var qq=class extends Pp{createDatum(){return new cl}},Qq=class extends Pp{createDatum(){return new hl}},Jq=class extends Pp{createDatum(){return new ul}},gz={type:"fibonacci-retracement",datum:ul,scene:Hv,isDatum:ul.is,translate:(e,t,i,s)=>{ul.is(t)&&Hv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ul.is(t)&&ul.is(i)&&Hv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ul.is(t)&&Hv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Jq({...e,create:t("fibonacci-retracement")}),dragState:e=>new Mi(e)},e6=class extends N.Group{},Gv=class extends e6{constructor(){super(),this.type="arrow",this.path=new N.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:s,angle:n,...o}=e,a=H.from(i,s),r=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=H.rotate(H.from(0,l),n+r,a),h=H.rotate(H.from(l,0),n-r,a);t.setProperties(o),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(a.x,a.y),t.path.lineTo(h.x,h.y)}},{Transformable:t6}=N,wc=class extends ew{constructor(){super(),this.type="line",this.line=new Cn,this.append([this.line,this.start,this.end])}static is(e){return es.isCheck(e,"line")}update(e,t){let i=an(e,t);if(i==null){this.visible=!1;return}i=Se.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))}updateLine(e,t,i){const{line:s}=this,{lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r}=e,l=this.extendLine(t,e,i);s.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:n,stroke:o,strokeWidth:a,strokeOpacity:r,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(Jh,this.text,!!e.text.label),Op(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!e.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:s,strokeOpacity:n}=e,[o,a]=H.from(t),r=H.angle(H.sub(a,o));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.startCap.remove(),this.startCap=void 0),this.startCap==null&&(this.startCap=new Gv,this.append([this.startCap])),this.startCap.update({x:o.x,y:o.y,angle:r-Math.PI,stroke:i,strokeWidth:s,strokeOpacity:n})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.endCap.remove(),this.endCap=void 0),this.endCap==null&&(this.endCap=new Gv,this.append([this.endCap])),this.endCap.update({x:a.x,y:a.y,angle:r,stroke:i,strokeWidth:s,strokeOpacity:n}))}updateAnchor(e,t,i,s){const n=Se.topCenter(t);H.apply(this.anchor,t6.toCanvasPoint(this.line,n.x,n.y))}containsPoint(e,t){const{line:i,text:s}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,s){const{startCap:n,endCap:o}=this;let[a,r]=H.from(t);const l=H.angle(H.sub(r,a));return n&&(a=H.rotate(H.from(0,-ii.HANDLE_SIZE/2),l,a)),o&&(r=H.rotate(H.from(0,ii.HANDLE_SIZE/2),l,r)),i==="start"?a:r}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},fz={type:"line",datum:hl,scene:wc,isDatum:hl.is,translate:(e,t,i,s)=>{hl.is(t)&&wc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(hl.is(t)&&hl.is(i)&&wc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{hl.is(t)&&wc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Qq({...e,create:t("line")}),dragState:e=>new Mi(e)},mz={type:"arrow",datum:cl,scene:wc,isDatum:cl.is,translate:(e,t,i,s)=>{cl.is(t)&&wc.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(cl.is(t)&&cl.is(i)&&wc.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{cl.is(t)&&wc.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new qq({...e,create:t("arrow")}),dragState:e=>new Mi(e)};function yz(e,t=0,i=0){let s=t;for(const n of e)if(Array.isArray(n)){for(const o of n)xz(o,s);s+=N.Group.computeChildrenBBox(n).width+i}else xz(n,s),s+=n.getBBox().width+i}function i6(e,t=0,i=0){let s=t;for(const n of e)if(Array.isArray(n)){for(const o of n)bz(o,s);s+=N.Group.computeChildrenBBox(n).height+i}else bz(n,s),s+=n.getBBox().height+i}function xz(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function bz(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function vz(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function Sz(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var Mz=class extends N.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new N.Rect,this.dateRangeBarsText=new N.Text,this.dateRangeDivider=new N.Line,this.dateRangeValueText=new N.Text,this.priceRangeValueText=new N.Text,this.priceRangeDivider=new N.Line,this.priceRangePercentageText=new N.Text,this.volumeText=new N.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,s,n,o,a){this.verticalDirection=o;const r=this.updateStatistics(e,t,i,a),l=N.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(e,l,c),this.reposition(r,c,n),this.checkVisibility(e,n,s)}checkVisibility(e,t,i){const s=Se.from(t.seriesRect);this.visible=Se.collides(i,s)&&(e.visible??!0)}updateStatistics(e,t,i,s){const{dateRangeBarsText:n,dateRangeDivider:o,dateRangeValueText:a,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,u=6,p=e.statistics.fontSize+3,f=-2,y=this.getTextStyles(e),x={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:p},b=[n,o,a],v=[r,l,c],S=[];return t.priceRange&&(r.setProperties({...y,text:this.formatPriceRangeValue(t.priceRange.value,s)}),l.setProperties(x),c.setProperties({...y,text:this.formatPriceRangePercentage(t.priceRange.percentage,s)}),yz(v,i.x,d),S.push(v)),t.dateRange&&(n.setProperties({...y,text:this.formatDateRangeBars(t.dateRange.bars,s)}),o.setProperties(x),a.setProperties({...y,text:this.formatDateRangeValue(t.dateRange.value)}),yz(b,i.x,d),S.push(b)),t.volume==null?h.visible=!1:(h.setProperties({...y,x:i.x,text:this.formatVolume(t.volume,s),visible:!0}),S.push(h)),i6(S,i.y,u),l.y1+=f,l.y2+=f,o.y1+=f,o.y2+=f,S}updateBackground(e,t,i){const s=this.getBackgroundStyles(e);this.background.setProperties({...s,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:s,height:n}=i.seriesRect,o=Se.from(this.background.getBBox());let a=0;o.x1<0&&(a=-o.x1),o.x2>s&&(a=s-o.x2);const r=Math.min(t,n-o.y2);for(const l of e)if(Array.isArray(l)){const c=N.Group.computeChildrenBBox(l).width;for(const h of l)vz(h,a-c/2),Sz(h,r)}else vz(l,a-l.getBBox().width/2),Sz(l,r);this.background.x+=a,this.background.y+=r}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textAlign:"left",textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const s=1e3*60,n=s*60,o=n*24,a=Math.floor(e/s),r=Math.floor(e/n),l=Math.floor(e/o),c=r%(o/n),h=a%(n/s);return l>=1&&t.push(`${l}d`),r>=1&&(e=s.x-h.x&&(l={x:s.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+H.length(h)})}this.verticalLine.setClipMask(a,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:s}=this,{direction:n}=e,{x1:o,y1:a,x2:r,y2:l}=t,c=H.round(Se.center(t),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(e),p={stroke:h,strokeWidth:d,strokeOpacity:u};if(n!=="vertical"){const f=o<=r?0:Math.PI;let y=r;n==="horizontal"&&(y+=o<=r?-2:2),i.update({...p,x:y,y:c.y,angle:f})}if(n!=="horizontal"){const f=a<=l?Math.PI/2:Math.PI/-2;let y=l;n==="vertical"&&(y+=a<=l?-2:2),s.update({...p,x:c.x,y,angle:f})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:s,horizontalStartLine:n,horizontalEndLine:o}=this,{direction:a}=e,{x1:r,y1:l,x2:c,y2:h}=t,d=this.getLineStyles(e);a==="horizontal"&&(i.setProperties({...d,x1:r,y1:l,x2:r,y2:h}),s.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),a==="vertical"&&(n.setProperties({...d,x1:r,y1:l,x2:c,y2:l}),o.setProperties({...d,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const s=H.add(Se.bottomCenter(t),H.from(0,10)),n={volume:this.getVolume(e)};e.hasPriceRange&&(n.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(n.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,n,s,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,s){const n=Se.topCenter(t);H.apply(this.anchor,N.Transformable.toCanvasPoint(this.horizontalLine,n.x,n.y))}getBackgroundPoints(e,t,i,s){const[n,o]=H.from(t),[a,r]=H.from(i);return[n,o,r,a]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:n}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:s,strokeOpacity:n,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:s,verticalLine:n,horizontalStartLine:o,horizontalEndLine:a,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||n.isPointInPath(e,t)||o.visible&&o.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,s=e.x1<=e.x2?1:-1;return i?Math.round(Se.width(e)/i)*s:0}getDateRangeValue(e){const t=Ei(e.start.x),i=Ei(e.end.x);if(!Cs(t)||!Cs(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Ei(e.end.y),i=Ei(e.start.y);if(!gt(t)||!gt(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Ei(e.end.y),i=Ei(e.start.y);if(!gt(t)||!gt(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},jv=class extends so{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return es.isCheck(e,"quick-measurer")}createStatisticsScene(){return new s6}getDirectionStyles(e){return this.verticalDirection==="down"?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},Ep=class extends he{constructor(e){const t=({point:a})=>{const r=this.createDatum();r.set({start:a,end:a}),e.create(r)},i=({point:a})=>{const{datum:r,node:l}=this;r?.set({end:a}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),e.update()},s=()=>{this.node?.toggleHandles({end:!0})},n=()=>e.delete(),o=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:he.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:he.parent,action:s},dragEnd:{target:he.parent,action:s},reset:{target:he.parent,action:n},cancel:{target:he.parent,action:n},onExit:o}}),this.debug=ve.create(!0,"annotations")}};g([Je()],Ep.prototype,"datum",2),g([Je()],Ep.prototype,"node",2);var n6=class extends Ep{createDatum(){return new Po}},o6=class extends Ep{createDatum(){return new Eo}},a6=class extends Ep{createDatum(){return new ll}},r6=class extends Ep{createDatum(){return new io}},Dz={type:"date-range",datum:Po,scene:so,isDatum:Po.is,translate:(e,t,i,s)=>{Po.is(t)&&so.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Po.is(t)&&Po.is(i)&&so.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Po.is(t)&&so.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new n6({...e,create:t("date-range")}),dragState:e=>new Mi(e)},Iz={type:"price-range",datum:Eo,scene:so,isDatum:Eo.is,translate:(e,t,i,s)=>{Eo.is(t)&&so.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(Eo.is(t)&&Eo.is(i)&&so.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{Eo.is(t)&&so.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new o6({...e,create:t("date-range")}),dragState:e=>new Mi(e)},kz={type:"date-price-range",datum:ll,scene:so,isDatum:ll.is,translate:(e,t,i,s)=>{ll.is(t)&&so.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(ll.is(t)&&ll.is(i)&&so.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{ll.is(t)&&so.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new a6({...e,create:t("date-range")}),dragState:e=>new Mi(e)},Az={type:"quick-date-price-range",datum:io,scene:jv,isDatum:io.is,translate:(e,t,i,s)=>{io.is(t)&&jv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(io.is(t)&&io.is(i)&&jv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{io.is(t)&&jv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new r6({...e,create:t("quick-date-price-range")}),dragState:e=>new Mi(e)},Wv=class extends nw{constructor(){super(),this.type="note",this.shape=new N.Rect,this.iconBackground=new N.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new N.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new N.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return es.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const s=super.getTextBBox(e,t,i);s.x-=e.width/2,s.x=se(0,s.x,i.seriesRect.width-e.width);const n=e.getPadding().top,o=s.y-OR-n*2,a=s.y+ii.HANDLE_SIZE+n*2;return o-s.height-PR<0?(s.y=a,e.position="top"):(s.y=o+n,e.position="bottom"),s}updateLabel(e,t,i){const s=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t,i),i.isRtl&&(this.label.x+=e.width-t.width),this.label.visible=s,this.label.text=Pa(e.text,{maxWidth:200,font:e,textWrap:"always",avoidOrphans:!1})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const s=e.getPadding().top,n=e.position==="top";i.x=t.x-s,i.width=e.width+s*2,i.height=t.height+s*2,i.y=t.y+(n?0:-t.height)-s}updateIcon(e,t){const{active:i,iconBackground:s,iconLines:n}=this,{x:o,y:a}=ti(e,t);s.translationX=o-mq/2,s.translationY=a-TR,n.translationX=s.translationX,n.translationY=s.translationY,s.fill=e.fill,s.fillOpacity=e.fillOpacity??1,s.stroke=e.stroke,s.strokeOpacity=e.strokeOpacity??1,s.strokeWidth=e.strokeWidth??1,n.fill=e.stroke,i?s.fillShadow.color=e.fill??"rgba(0, 0, 0, 0.22)":s.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const s=e.getPadding().top,n=e.position==="top",o=n?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+o*(t.height+s),position:n?"below":"above"}}getLabelCoords(e,t){const i=e.position==="top",s=e.getPadding().top+Fn(e.fontSize,Iv)/2;return{x:t.x,y:t.y+(i?s/2:0)}}getTextBaseline(e){return e.position==="top"?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+ii.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e,t,i){super.toggleHovered(e,t,i);const s=e||t&&!i;this.label.visible=s,this.shape.visible=s,this.zIndex=s?13:12}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return this.shape.visible&&this.shape.containsPoint(e,t)||this.iconBackground.containsPoint(e,t)?!0:super.containsPoint(e,t)}},l6=class extends pm{createDatum(){return new wn}},wz={type:"note",datum:wn,scene:Wv,isDatum:wn.is,translate:(e,t,i,s)=>{wn.is(t)&&Wv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(wn.is(t)&&wn.is(i)&&Wv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{wn.is(t)&&Wv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new l6({...e,create:t("note")}),dragState:e=>new Mi(e)},$v=class extends az{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new ii,topMiddle:new Tp,topRight:new ii,bottomLeft:new ii,bottomMiddle:new Tp,bottomRight:new ii},this.middleLine=new Cn,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return es.isCheck(e,"parallel-channel")}dragHandle(e,t,i,s){const{activeHandle:n,handles:o}=this;if(n==null)return;const{offset:a}=o[n].drag(t);o[n].toggleDragging(!0),(n==="topMiddle"||n==="bottomMiddle")&&(a.x=0);let r=[],l=s;switch(n){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],a.y-=Tp.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],a.y-=Tp.HANDLE_SIZE/2,l=!1;break}const c=an(e,i),h=an(e.bottom,i);if(!c||!h)return;const d={topLeft:Se.start(c),topRight:Se.end(c),bottomLeft:Se.start(h),bottomRight:Se.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:e.snapToAngle},p=fl(d,a,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});e.start.x=p.topLeft.x,e.start.y=p.topLeft.y,e.end.x=p.topRight.x,e.end.y=p.topRight.y,e.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:s}=this.handles,n=i.getBBox().y-s.getBBox().y,o=H.add(e,H.from(0,n)),a=H.add(t,H.from(0,n));return{start:e,end:t,bottomStart:o,bottomEnd:a}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,s,n,o){const{topLine:a,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=e,p=e.getLineDash(),f={lineCap:e.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};a.setProperties({...t,...f}),l.setProperties({...i,...f});const y=this.extendLine({x1:n.x1,y1:o.y1+(n.y1-o.y1)/2,x2:n.x2,y2:o.y2+(n.y2-o.y2)/2},e,s);r.setProperties({...y,lineDash:e.middle.lineDash??p,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??d,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:s,topMiddle:n,topRight:o,bottomLeft:a,bottomMiddle:r,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};s.update({...c,...Se.start(t)}),o.update({...c,...Se.end(t)}),a.update({...c,...Se.start(i)}),l.update({...c,...Se.end(i)}),n.update({...c,...H.sub(Se.center(t),H.from(n.handle.width/2,n.handle.height/2))}),r.update({...c,...H.sub(Se.center(i),H.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Jh,this.text,!!e.text.label),JR(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,s){const n=t.x1>t.x2,o=t.y1>t.y2,a=t.x1!==i.x1&&t.y1!==i.y1,r=t.x2!==i.x2&&t.y2!==i.y2,l=H.from(t);return e.extendEnd&&r&&l.push(H.from(n?s.x1:s.x2,o?s.y1:s.y2)),l.push(...H.from(i).reverse()),e.extendStart&&a&&l.push(H.from(n?s.x2:s.x1,o?s.y2:s.y1)),l}},Kv=class extends he{constructor(e){const t=({point:l})=>{const c=new zo;c.set({start:l,end:l,height:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},s=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:um(l,c,d,h.start,h.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},o=({point:l})=>{const{datum:c,node:h}=this,d=Ei(c?.end.y),u=Ei(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=u-f;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:f}),e.update())},a=({point:l})=>{const{datum:c,node:h}=this,d=Ei(c?.end.y),u=Ei(c?.start.y),{y:p}=l;if(c==null||!gt(u)||!gt(d)||!gt(p))return;const f=d-(p??0),y=u-f;h?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:f}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:he.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:s,drag:s,click:{target:"height",action:n},dragEnd:{target:"height",action:n},reset:{target:he.parent,action:r},cancel:{target:he.parent,action:r}},height:{hover:o,click:{target:he.parent,action:a},drag:{target:he.parent,action:a},reset:{target:he.parent,action:r},cancel:{target:he.parent,action:r}}}),this.debug=ve.create(!0,"annotations"),this.snapping=!1}};g([Je()],Kv.prototype,"datum",2),g([Je()],Kv.prototype,"node",2),g([Je()],Kv.prototype,"snapping",2);var Cz={type:"parallel-channel",datum:zo,scene:$v,isDatum:zo.is,translate:(e,t,i,s)=>{zo.is(t)&&$v.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(zo.is(t)&&zo.is(i)&&$v.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{zo.is(t)&&$v.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Kv({...e,create:t("parallel-channel")}),dragState:e=>new Mi(e)},Uv=class extends nw{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return es.isCheck(e,"text")}getHandleCoords(e,t){const i=ii.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},c6=class extends pm{createDatum(){return new pl}},Lz={type:"text",datum:pl,scene:Uv,isDatum:pl.is,translate:(e,t,i,s)=>{pl.is(t)&&Uv.is(e)&&e.translate(t,i,s)},copy:(e,t,i,s)=>{if(pl.is(t)&&pl.is(i)&&Uv.is(e))return e.copy(t,i,s)},update:(e,t,i)=>{pl.is(t)&&Uv.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new c6({...e,create:t("text")}),dragState:e=>new Mi(e)},no={[fz.type]:fz,[sz.type]:sz,[nz.type]:nz,[Cz.type]:Cz,[rz.type]:rz,[gz.type]:gz,[pz.type]:pz,[XR.type]:XR,[qR.type]:qR,[wz.type]:wz,[Lz.type]:Lz,[mz.type]:mz,[YR.type]:YR,[UR.type]:UR,[Dz.type]:Dz,[Iz.type]:Iz,[kz.type]:kz,[Az.type]:Az};function ed(e){for(const{isDatum:t}of Object.values(no))if(t(e))return e}var Yv=class extends $M{constructor(e){super(new h6(t=>{this.snapping=t}),new d6(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new Cc(e,t=>{this.active=t,this.datum=this.active==null?void 0:e.datum(this.active),this.node=this.active==null?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};g([Je()],Yv.prototype,"snapping",2),g([Je()],Yv.prototype,"datum",2),g([Je()],Yv.prototype,"node",2);var h6=class extends he{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},d6=class extends he{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},Cc=class extends he{constructor(e,t){const i=S=>M=>{e.create(S,M),this.active=e.selectLast()},s=()=>{this.active!=null&&e.delete(this.active),this.active=void 0,e.select()},n={createDatum:i},o={...e,delete:s,showTextInput:()=>{this.active!=null&&e.showTextInput(this.active)},deselect:()=>{const S=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,S)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},a=Object.fromEntries(Object.entries(no).map(([S,M])=>[S,M.createState(o,n)])),r=Object.fromEntries(Object.entries(no).map(([S,M])=>[S,M.dragState(e,n)])),l=({colorPickerType:S,colorOpacity:M,color:D,opacity:I,isMultiColor:k})=>{this.datum&&(S==="text-color"&&e.updateTextInputColor(D),Cv(this.datum,S,M,D,I,k),e.update())},c=S=>{const{datum:M,node:D}=this;!M||!D||(sr(M)?(M.fontSize=S,e.updateTextInputFontSize(S)):Cp(M)&&(M.text.fontSize=S),e.update())},h=S=>{const{datum:M,node:D}=this;!M||!D||!Sc(M)||(RR(M,S),e.update())},d=S=>{const{node:M}=this;!M||!("setTextInputBBox"in M)||(M.setTextInputBBox(S),e.update())},u=({textInputValue:S,bbox:M})=>{const{datum:D}=this;if(M!=null&&S!=null&&S.length>0){if(!sr(D))return;const I=kv(D,S,M.width);D.set({text:I}),e.update(),e.recordAction(`Change ${D.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${D?.type} annotation`)},p=()=>{e.updateTextInputBBox(void 0)},f=()=>this.active!=null,y=()=>this.copied!=null,x=()=>{const{active:S,datum:M}=this;return S==null||!M?!1:Cp(M)&&M.isWriteable()},b=()=>this.active!=null&&!vc(this.datum),v=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:S})=>{this.hovered=e.hoverAtCoords(S,this.active,this.hovered),this.hoverCoords=S},translate:{guard:f,target:"translating",action:({translation:S})=>{e.startInteracting(),e.translate(this.active,S),e.update()}},copy:{guard:b,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:b,action:()=>{this.copied=e.copy(this.active),s()}},paste:{guard:y,action:()=>{e.paste(this.copied)}},selectLast:()=>{const S=this.active;this.active=e.selectLast(),e.select(this.active,S)},click:[{guard:()=>{const{active:S,hovered:M,datum:D}=this;return S==null||M!==S||!D?!1:sr(D)&&D.isWriteable()},target:"text-input"},{action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S)}}],dblclick:{guard:x,action:({offset:S})=>{const M=e.getNodeAtCoords(S,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,M)}},dragStart:[{guard:v,target:"dragging",action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S),e.startInteracting()}},{action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S)}}],color:{guard:f,action:l},fontSize:{guard:f,action:c},lineProps:{guard:f,action:S=>{const M=ed(this.datum);M?.set(S),e.update(),e.recordAction(`Change ${M?.type} ${Object.entries(S).map(([D,I])=>`${D} to ${I}`).join(", ")}`)}},lineStyle:{guard:f,action:h},lineText:{guard:f,action:S=>{const M=ed(this.datum);Cp(M)&&(gl(M)&&S.position==="center"&&(S.position="inside"),M.text.set(S),e.update())}},updateTextInputBBox:{guard:f,action:d},toolbarPressSettings:{guard:x,action:S=>{e.showAnnotationSettings(this.active,S)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!vc(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...a},dragging:{onEnter:(S,M)=>{if(this.active==null)return;const D=e.getAnnotationType(this.active);D&&(this.transitionRoot(D),this.transitionRoot("dragStart",M))},...r},translating:{onEnter:()=>{},translate:{guard:f,target:"translating",action:({translation:S})=>{e.startInteracting(),e.translate(this.active,S),e.update()}},translateEnd:{guard:f,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const S=ed(this.datum);!S||!("getTextInputCoords"in S)||(e.startInteracting(),e.showTextInput(this.active),S.visible=!1,e.update())},updateTextInputBBox:{guard:f,action:d},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:tw,target:"idle",action:p},{guard:iw,target:"idle",action:u}],color:{guard:f,action:l},fontSize:{guard:f,action:c},cancel:{target:"idle",action:p},onExit:()=>{e.stopInteracting(),e.hideTextInput();const S=this.active;if(this.active=this.hovered=void 0,e.select(this.active,S),S==null)return;const M=e.datum(S),D=e.node(S);!M||!D||("setTextInputBBox"in D&&D.setTextInputBBox(),M.visible=!0)}}}),this.setActive=t,this.debug=ve.create(!0,"annotations"),this.snapping=!1}};g([Ze({changeValue(e){this.setActive(e)}}),Je()],Cc.prototype,"active",2),g([Je()],Cc.prototype,"hovered",2),g([Je()],Cc.prototype,"hoverCoords",2),g([Je()],Cc.prototype,"copied",2),g([Je()],Cc.prototype,"snapping",2),g([Je()],Cc.prototype,"datum",2),g([Je()],Cc.prototype,"node",2);var{LayoutElement:u6,Menu:p6}=N,Nz=class extends nr{};g([m],Nz.prototype,"value",2);var Zv=class extends q{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new Bi(Nz),this.events=new zn,this.annotationMenu=new p6(this.ctx,"annotations"),this.cleanup=new ot,this.menuMargin=6,this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(u6.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i,buttonWidget:s}){const n=this.ctx.axisManager.getAxisContext("y")[0].scale;switch(t.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsLineAnnotations",wq.filter(o=>o.visible?o.visible(n):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsFibonacciAnnotations",Cq);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsTextAnnotations",Nq);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsShapeAnnotations",Tq);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,s,t.value,"toolbarAnnotationsMeasurerAnnotations",Oq);break}}onToolbarButtonPressShowMenu(e,t,i,s,n,o){this.events.emit("pressed-show-menu",null);const a=this.buttons.findIndex(l=>l.value===s);this.toolbar.toggleActiveButtonByIndex(a);const r=this.ctx.domManager.isRtl?t.x-this.menuMargin:t.x+t.width+this.menuMargin;this.annotationMenu.setAnchor({x:r,y:t.y}),this.annotationMenu.show(i,{items:o,ariaLabel:this.ctx.localeManager.t(n),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,s)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(s=>s.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.events.emit("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){e.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};g([m,Ze({changeValue(e){this.toolbar?.setHidden(!e)}})],Zv.prototype,"enabled",2),g([m],Zv.prototype,"padding",2),g([m],Zv.prototype,"buttons",2);var{InteractionState:gm}=N,fm="ag-charts-annotations__axis-button",Tz=class extends ri{constructor(e,t,i,s){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=s,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!t.scale.bandwidth,e.domManager.addEventListener("focusin",({target:n})=>{const o=n instanceof HTMLElement?n:void 0;!(o&&e.domManager.contains(o,"series-area"))&&o!==this.button.getElement()&&this.hide()}),this.cleanup.register(e.widgets.seriesWidget.addListener("drag-move",n=>this.onMouseDrag(n)),e.widgets.seriesWidget.addListener("mousemove",n=>this.onMouseMove(n)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter?.events.on("click",n=>this.onClick(n)),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.hide()),e.eventsHub.on("zoom:change-complete",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new qf.ButtonWidget;return e.addClass(fm),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",fm)}onMouseMove(e){this.ctx.interactionManager.isState(gm.Hoverable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(gm.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(gm.Hoverable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(gm.Clickable)&&e.device==="touch"&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:s}=e;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(t.target))){this.hide();return}this.toggleVisibility(!0);const n=this.getButtonCoordinates({x:i,y:s});this.coords={x:n.x+this.button.clientWidth/2,y:n.y+this.button.clientHeight/2},this.updatePosition(n)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(gm.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:s},seriesRect:n,snap:o,axisCtx:a,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,n.height],[u,p]=[0,n.width];if(o&&(e=rl(Sv(e-n.x,a),a)+n.x,t=rl(Sv(t-n.y,a),a)+n.y),i==="x"){const y=c-Math.max(0,r-5);e=e-l/2,t=s==="top"?h-c+y:d-y}else{const y=l-Math.max(0,r-9);e=s==="left"?u-l+y:p-y,t=t-c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(t==null)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${fm}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(``)}};g([m],Tz.prototype,"enabled",2);var{DraggablePopover:g6,NativeWidget:lw}=N,Oz=class OL extends g6{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new VR(this.ctx,{detached:!0}),this.cleanup.register(t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,i){const s=super.showWithChildren(t,i);return s.classList.add("ag-charts-dialog"),s.setAttribute("role","dialog"),s.addEventListener("mousedown",n=>{n.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),s.addEventListener("keydown",this.onKeyDown.bind(this)),this.ctx.agDocument.requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),s}updatePosition(t){super.updatePosition(t);const{anchor:i,fallbackAnchor:s}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,s)}createTabs(t,i,s){const n=ke("div","ag-charts-dialog__tabs"),o=Zc(s,()=>Rr()),a=Zc(s,()=>Rr());for(const[p,f]of rt(s))Do(f.panel,{id:a[p],role:"tabpanel","aria-labelledby":o[p]});const r=p=>{for(const[f,y]of rt(s))y.panel.classList.toggle("ag-charts-dialog__tab-panel--active",f===p),h[f].classList.toggle("ag-charts-dialog__tab-button--active",f===p),Fe(h[f],"aria-selected",f===p),f===p&&y.onShow?.()},l=new lw(ke("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:f}=p;f.target instanceof Element&&f.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new m6;this.setDragHandle(c);const h=Zc(s,(p,f)=>Iu({label:this.ctx.localeManager.t(p.label),onPress:()=>r(f)},{id:o[f],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":a[f]})),d=ke("div","ag-charts-dialog__tab-list");Do(d,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),n.append(l.getElement(),...Object.values(s).map(p=>p.panel)),r(i),px({orientation:"horizontal",buttons:Object.values(h)}),{tabs:n,initialFocus:h[i]}}createTabPanel(){return ke("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return ke("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:s,onChange:n}){const o=this.createInputGroup(t);Do(o,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const a="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,d=this.ctx.localeManager.t(h),u=Iu({icon:c,altText:d,onPress:()=>{for(const p of Array.from(o.children))p.classList.remove(a),p.ariaChecked="false";u.classList.add(a),u.ariaChecked="true",n(l.value)}},{"aria-checked":l.value===s,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===s&&u.classList.add(a),o.appendChild(u),r.push(u)}return px({orientation:"horizontal",buttons:r}),o}createSelect({altText:t,label:i,options:s,value:n,onChange:o}){const a=this.createInputGroup(i),r=this.ctx.localeManager.t(t),l=bD({value:n,options:s,onChange:o},{class:"ag-charts-dialog__select","aria-label":r,title:r});return a.append(l),a}createTextArea({placeholder:t,value:i,onChange:s}){const n=t?this.ctx.localeManager.t(t):void 0;return vD({value:i,onChange:s},{placeholder:n})}createCheckbox({label:t,checked:i,onChange:s}){const n=Rr(),o=this.createInputGroup(t,{for:n}),a=xD({checked:i,onChange:s},{class:"ag-charts-dialog__checkbox",role:"switch",id:n});return o.append(a),o}createColorPicker({color:t,opacity:i,label:s,altText:n,onChange:o,onChangeHide:a,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(s),h=this.ctx.localeManager.t(n),d=Iu({label:h,onPress:u=>{const{anchor:p,fallbackAnchor:f}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:p,fallbackAnchor:f,color:t,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(y,x,b,v)=>{d.style.setProperty("--color",y),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",v),o(y,x,b,v)},onChangeHide:a})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const u=Ne.fromString(t),p=new Ne(u.r,u.g,u.b,i);d.style.setProperty("--color",p.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return Iu({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const s=ke("div","ag-charts-dialog__input-group"),n=ke("label","ag-charts-dialog__input-group-label");return n.innerText=this.ctx.localeManager.t(t),Fe(n,"for",i?.for),s.appendChild(n),s}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||t.key!=="Escape"||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=i.domManager.getBoundingClientRect(),o=H.from(0,t.y),a=H.from(n.width,t.height),r=H.from(s),l=H.from(.5,1);let c;if(t.width>1e3){const h=H.sub(H.add(o,H.multiply(a,l)),H.multiply(r,l));c=H.sub(h,H.from(0,OL.offset))}else{const h=H.sub(H.add(o,a),r);c=H.sub(h,OL.offset)}this.updatePosition(c)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),s=this.ctx.domManager.getBoundingClientRect(),n=H.sub(H.from(i.x,i.y),H.from(s.left,s.top)),o=H.add(n,H.from(0,i.height+5)),a=H.sub(n,H.from(0,5));return{anchor:o,fallbackAnchor:a}}};Oz.offset=60;var f6=Oz,m6=class extends lw{constructor(){super(ke("div","ag-charts-dialog__drag-handle"));const e=new lw(ke("span",fr("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},y6=class extends f6{constructor(e){super(e,"settings"),this.events=new zn,this.hideFns.push(()=>this.events.emit("hidden",null))}show(e,t){const i=this.createLinearLineTab(e,t),s=this.createLinearTextTab(e,t);let n="dialogHeaderLine";gl(e)?n="dialogHeaderChannel":ER(e)?n="dialogHeaderFibonacciRange":e.type==="date-range"?n="dialogHeaderDateRange":e.type==="price-range"?n="dialogHeaderPriceRange":e.type==="date-price-range"&&(n="dialogHeaderDatePriceRange");const{tabs:o,initialFocus:a}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:n,panel:i},text:{label:"dialogHeaderText",panel:s.panel,onShow:s.onShow}});t.initialFocus=a,this.showWithChildren([o],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),s=this.createInputGroupLine(),n=this.createInputGroupLine(),o="isMultiColor"in e,a=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),o?e.isMultiColor:!1,o,t.onChangeLineColor,t.onChangeHideLineColor),r=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(s.append(a),"background"in e){const c=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);s.append(c),n.append(r)}else"showFill"in e?(s.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:c=>t.onChangeLine({showFill:c})})),n.append(r)):s.append(r);return n.append(l),i.append(s,n),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,c=>t.onChangeLine({bands:c}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:gl(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:gl(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:c=>t.onChangeLine({extendEnd:c})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:c=>t.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:c=>t.onChangeLine({extendBelow:c})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:c=>t.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:c=>t.onChangeLine({extendRight:c})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:c=>t.onChangeLine({reverse:c})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),s=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:h=>t.onChangeText({label:h})}),n=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),o=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),a=e.text.position==="inside"?"center":e.text.position,r=this.createPositionRadioGroup(a??"top",h=>t.onChangeText({position:h})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",h=>t.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(n,o,r,l),i.append(s,c),{panel:i,onShow:()=>Qm(s)}}createColorPickerInput(e,t,i,s,n,o,a){const r=e==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=e==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:t,opacity:i,isMultiColor:s,hasMultiColorOption:n,onChange:o,onChangeHide:a})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:FR.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:Lq.map(({label:i,value:s})=>({label:i,value:`${s}`})),value:String(e),onChange:i=>t(Number(i))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:_R.map(({label:i,value:s})=>({label:i,value:String(s)})),value:String(e),onChange:i=>t(Number(i))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){const i=[["iconAltTextAlignLeft","left"],["iconAltTextAlignRight","right"]];this.ctx.domManager.isRtl&&i.reverse();const[[s,n],[o,a]]=i;return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:s,value:n},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:o,value:a}],value:e,onChange:t})}};function cw(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function x6(e,t,i){for(const{update:s}of Object.values(no))s(e,t,i)}var{InteractionState:Ln,keyProperty:b6,valueProperty:v6,Selection:S6,BBox:M6}=N,Rp=class gH extends ri{constructor(t){super(),this.ctx=t,this.toolbar=new Zv(this.ctx),this.optionsToolbar=new XA(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return ed(this.annotationData.at(i))}),this.axesButtons=new PA,this.enabled=!0,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new Bi(gH.createAnnotationDatum),this.defaults=new kq,this.container=new N.Group({name:"static-annotations"}),this.annotations=new S6(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new y6(this.ctx),this.textInput=new eq(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy(),this.textInput.destroy()})}setupStateMachine(){const{ctx:t}=this;return new Yv({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(Ln.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,s,n)=>{let o;return this.annotations.each((a,r,l)=>{if(!r.isHoverable())return;const c=a.containsPoint(i.x,i.y);c&&(o??(o=l)),a.toggleHovered(c,s===l,r.readOnly)}),o!=null?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),(o==null||!this.annotationData.at(o)?.readOnly)&&this.ctx.domManager.updateCursor("annotations",o==null?void 0:this.annotations.at(o)?.getCursor()),o!==n&&this.update(),o},getNodeAtCoords:(i,s)=>this.annotations.at(s)?.getNodeAtCoords(i.x,i.y),translate:(i,s)=>{const n=this.annotations.at(i),o=ed(this.annotationData.at(i));if(!(!n||!o))return this.translateNode(n,o,s)},copy:i=>{const s=this.annotations.at(i),n=ed(this.annotationData.at(i));if(!(!s||!n))return this.createAnnotationDatumCopy(s,n)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,s)=>{const{annotations:n,optionsToolbar:o}=this;this.hideOverlays(),this.textInput.isVisible()||(this.toolbar.clearActiveButton(),this.toolbar.resetButtonIcons());const a=i==null?null:n.at(i),r=s==null?null:n.at(s),l=i==null?null:this.annotationData.at(i);r===a&&a!=null||(r?.toggleActive(!1),o.hide(),a&&!l?.readOnly?(this.pushAnnotationState(Ln.AnnotationsSelected),a.toggleActive(!0),vc(l)||(o.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{o.show(),o.setAnchorScene(a)}))):(this.popAnnotationState(Ln.AnnotationsSelected),this.popAnnotationState(Ln.Annotations)),vc(l)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Ln.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Ln.Annotations)},stopInteracting:()=>{this.popAnnotationState(Ln.Annotations)},create:(i,s)=>{this.createAnnotation(i,s)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(s=>s.readOnly?s:!1);this.annotationData.splice(0,this.annotationData.length,...i)},validatePoint:(i,s)=>{const n=this.getAnnotationContext();return n?Bv(n,i,s):!0},getAnnotationType:i=>iq(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),s=i==null?null:this.annotations.at(i);s!=null&&this.optionsToolbar.setAnchorScene(s)}),this.update()},showTextInput:i=>{const s=ed(this.annotationData.at(i));if(!this.annotations.at(i)||!s||!("getTextInputCoords"in s)||!("getTextPosition"in s))return;const o={color:s.color,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight,placeholderColor:s.getPlaceholderColor()},a=this.getAnnotationContext(),r=c=>H.add(s.getTextInputCoords(a,c),H.required(this.seriesRect)),l=()=>s.getTextPosition();this.textInput.show({styles:o,layout:{getTextInputCoords:r,getTextPosition:l,alignment:s.alignment,textAlign:s.textAlign,width:s.width},text:s.text,placeholderText:s.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const s=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",s)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const s=this.annotations.at(i);!s||vc(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(s))},showAnnotationSettings:(i,s,n="line")=>{const o=this.annotationData.at(i);if(!wv(o)&&!gl(o)&&!hm(o)||vc(o))return;const a=c=>(h,d,u,p)=>{this.setColorAndDefault(o.type,c,h,d,u,p),this.optionsToolbar.updateColorPickerColor(c,d,u,p)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${o.type} ${c} to ${o.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:n,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:s,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(o.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(o.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(o.type,c.position),this.recordActionAfterNextUpdate(`Change ${o.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:a("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:a("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(o.type,c),this.optionsToolbar.updateLineStyleType(dm.find(h=>h.value===c)??dm[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(o.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:a("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(o.type,c)}};this.settingsDialog.show(o,l)}})}setupListeners(){const{ctx:t,optionsToolbar:i,settingsDialog:s,toolbar:n}=this,{seriesWidget:o,seriesDragInterpreter:a,chartWidget:r}=t.widgets;a&&this.cleanup.register(a.events.on("click",this.hoverTouchPreHandler.bind(this)),a.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),a.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),a.events.on("mousemove",this.onHover.bind(this)),a.events.on("click",this.onClick.bind(this)),a.events.on("dblclick",this.onDoubleClick.bind(this)),a.events.on("drag-start",this.onDragStart.bind(this)),a.events.on("drag-move",this.onDrag.bind(this)),a.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(o.addListener("keydown",this.onKeyDown.bind(this)),o.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),t.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.eventsHub.on("zoom:change-complete",()=>this.onResize()),t.eventsHub.on("dom:resize",()=>this.onResize()),n.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),n.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Ln.Annotations),this.state.transition(l),this.update()}),n.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),n.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),n.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",({locked:l})=>{this.recordActionAfterNextUpdate(l?"Locked":"Unlocked"),this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:d,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,d,u,p)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),s.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:i,optionsToolbar:s}=this;this.cleanup.register(t.annotationManager.attachNode(this.container),()=>{t.domManager.removeStyles(fm),i.destroy(),s.destroy()})}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[b6(this.xKey,void 0,{id:"date"}),v6(this.volumeKey,"number",{id:"volume"})],s=N.DataSet.wrap(this.data)??N.DataSet.empty(),{dataModel:n,processedData:o}=await t.request("annotations",s,{props:i});this.dataModel=n,this.processedData=o}createAnnotationScene(t){if(t.type in no)return new no[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(no)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in no)return new no[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(no)}], ignoring.`)}createAnnotation(t,i,s=!0){if(this.annotationData.push(i),s){const n=this.ctx.annotationManager.getAnnotationTypeStyles(t);n&&i.set(n),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,i){const{dataModel:s,processedData:n}=this;let o=Ei(t),a=Ei(i);if(!Sa(o)||!Sa(a)||!s||!n||this.volumeKey==null)return;o>a&&([o,a]=[a,o]);const r=s.resolveKeysById({id:"annotations"},"date",n),l=s.resolveColumnById({id:"annotations"},"volume",n);let c=0;for(let h=0;h=o&&d<=a&&(c+=l[h])}return c}translateNode(t,i,s){const n=this.getAnnotationConfig(i),o=this.getAnnotationContext();o&&n.translate(t,i,s,o)}createAnnotationDatumCopy(t,i){const s=this.getAnnotationConfig(i),n=new s.datum;n.set(i.toJson());const o=this.getAnnotationContext();if(o)return s.copy(t,i,n,o)}getAnnotationConfig(t){if(t.type in no)return no[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(no)}], ignoring.`)}onRestoreAnnotations(t){if(!this.enabled)return;const{annotations:i}=t;if(this.annotationData.length===i.length&&i.every((n,o)=>{const a=this.annotationData.at(o);return a!=null&&a.type===n.type}))for(let n=0;n{this.ctx.annotationManager.fireChangedEvent()}),this.update()}onLayoutComplete(t){if(!this.enabled)return;const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i),this.xAxis=this.getAxis(t.axes.x,i,this.xAxis?.button),this.yAxis=this.getAxis(t.axes.y,i,this.yAxis?.button),this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(n=>n.hasData),s=this.yAxis.context.seriesIds().some(n=>this.ctx.chartService.series.find(a=>a.id===n)?.visible);return t&&s}animateAnnotations({from:t,to:i,phase:s}){const{annotations:n}=this;this.ctx.animationManager?.animate({from:t,to:i,id:"chart-annotations",phase:s,groupId:"opacity",onUpdate(o){n.each(a=>{a.opacity=o,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(o)})},onStop(){n.each(o=>{o.opacity=i,"setAxisLabelOpacity"in o&&o.setAxisLabelOpacity(i)})}})}onPreRender(){this.enabled&&(this.updateAnnotations(),this.state.transition("render"))}getAxis(t,i,s){const n=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:o="bottom",direction:a}=n,r=t.gridPadding+t.seriesAreaPadding,l=new M6(0,0,i.width,i.height).grow(r,o),c=a==="x"?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===a)){s??(s=new Tz(this.ctx,{...n,snapToGroup:d},f=>this.onAxisButtonClick(f,c),i));const p=cw(t);s.update(i,p)}else s?.destroy(),s=void 0;return{layout:t,context:n,bounds:l,button:s}}recordActionAfterNextUpdate(t,i=["annotations"]){const{defaults:s,ctx:{annotationManager:n,historyManager:o}}=this,a=i.map(r=>r==="defaults"?s:n);this.postUpdateFns.push(()=>{o.record(t,...a),n.fireChangedEvent()})}setColorAndDefault(t,i,s,n,o,a){this.state.transition("color",{colorPickerType:i,colorOpacity:s,color:n,opacity:o,isMultiColor:a}),this.defaults.setDefaultColor(t,i,s,n,o,a)}setFontSizeAndDefault(t,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(t,i),this.recordActionAfterNextUpdate(`Change ${t} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(t,i),this.recordActionAfterNextUpdate(`Change ${t} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(t,i),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:i,seriesRect:s,ctx:{annotationManager:n}}=this,o=this.getAnnotationContext();if(!s||!o)return;n.updateData(t.toJson());const a=this.showAnnotations();this.toolbar.refreshButtonsEnabled(a),this.toolbar.toggleClearButtonEnabled(t.length>0&&a),i.update(t??[],void 0,r=>r.id).each((r,l)=>{if(!a){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),x6(r,l,o)});for(const r of this.postUpdateFns)r();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:s,snap:n,ctx:o}=this;if(!(!t||!i||!s))return{seriesRect:t,isRtl:o.domManager.isRtl,xAxis:{...i.context,bounds:i.bounds,labelPadding:cw(i.layout),snapToGroup:n},yAxis:{...s.context,bounds:s.bounds,labelPadding:cw(i.layout),snapToGroup:n}}}onHover(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=t.sourceEvent.shiftKey,o=H.from(t),a=rn(o,s);i.transition("hover",{offset:o,point:a,shiftKey:n,context:s})}onClick(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const n=t.sourceEvent.shiftKey,o=rn(H.from(t),s),a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:o,shiftKey:n,textInputValue:a,bbox:r})}onDoubleClick(t){const{state:i}=this;if(!this.getAnnotationContext())return;const n=H.from(t);i.transition("dblclick",{offset:n})}onAxisButtonClick(t,i){this.cancel(),this.reset();const s=this.getAnnotationContext();if(!this.annotationData||!s)return;const{state:n}=this;this.pushAnnotationState(Ln.Annotations);const o=i==="horizontal";if(n.transition(o?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const a=rn(t,s);Bv(s,a)&&(n.transition("click",{point:a,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:i})}hoverTouchPreHandler(t){t.device==="touch"&&this.onHover(t)}dragMoveTouchPreHandler(t){t.device==="touch"&&this.ctx.interactionManager.isState(Ln.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(Ln.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=H.from(t),n=rn(s,i),o=this.textInput.getValue(),a=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:s,point:n,textInputValue:o,bbox:a})}onDrag(t){if(!this.ctx.interactionManager.isState(Ln.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const s=H.from(t),n=rn(s,i),o=t.sourceEvent.shiftKey,a=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:s,point:n,shiftKey:o,textInputValue:a,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:i}=t??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{key:n,shiftKey:o}=t,a=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:n,shiftKey:o,textInputValue:a,bbox:r,context:s})}onKeyDown(t){const{state:i}=this,s=this.getAnnotationContext();if(!s)return;const{sourceEvent:n}=t,{shiftKey:o,ctrlKey:a,metaKey:r}=n,l=a||r,c=a||o;i.transition("keyDown",{shiftKey:o,context:s});const h={x:0,y:0},d=Math.max(s?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(s?.yAxis.scale.bandwidth??0,c?10:1);switch(n.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),n.stopPropagation(),n.preventDefault()),!!l)switch(n.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(t){const{shiftKey:i}=t.sourceEvent,s=this.getAnnotationContext();s&&(this.state.transition("keyUp",{shiftKey:i,context:s}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let t=!1;for(const[i,s]of this.annotationData.entries())vc(s)&&(this.annotationData.splice(i,1),t=!0);t&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(t){this.ctx.interactionManager.pushState(t),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(t){this.ctx.interactionManager.popState(t),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Ln.Annotations)||this.ctx.interactionManager.isState(Ln.AnnotationsSelected)}update(t=8){this.ctx.eventsHub.emit("chart:request-update",{type:t})}};g([m],Rp.prototype,"toolbar",2),g([m],Rp.prototype,"optionsToolbar",2),g([m],Rp.prototype,"axesButtons",2),g([m,Rt((e,t)=>{const i=t??!0;e.toolbar.enabled=i,e.optionsToolbar.enabled=i,e.axesButtons.enabled=i})],Rp.prototype,"enabled",2),g([m],Rp.prototype,"snap",2);var D6=Rp,Vo={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},Ss={fill:Yd,strokeOpacity:1,strokeWidth:2},td={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:li.LARGE},fontFamily:{$ref:"fontFamily"}},Pz={...td,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Xv={...td,textAlign:"start"},id={...td,position:"top",alignment:"center",color:{$ref:"textColor"}},Ez={...td,position:"top",alignment:"center",color:{$ref:"textColor"}},hw={...td,fontSize:{$ref:"fontSize"},color:qd,fill:Zd,stroke:Xd,strokeWidth:1,divider:{stroke:Qd,strokeWidth:1,strokeOpacity:.5}},dw={...Vo,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ss},text:{...id},statistics:{...hw}},I6={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},k6={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}},A6={enabled:!1,line:{...Vo,handle:{...Ss},text:{...id}},"horizontal-line":{...Vo,handle:{...Ss},axisLabel:{...Pz},text:{...id}},"vertical-line":{...Vo,handle:{...Ss},axisLabel:{...Pz},text:{...id}},"disjoint-channel":{...Vo,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ss},text:{...Ez}},"parallel-channel":{...Vo,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...Ss},text:{...Ez}},"fibonacci-retracement":{...Vo,strokes:Ud,rangeStroke:{$ref:"foregroundColor"},handle:{...Ss},text:{...id,position:"center"},label:{...td,color:void 0,fontSize:{$rem:li.SMALLER}}},"fibonacci-retracement-trend-based":{...Vo,strokes:Ud,rangeStroke:{$ref:"foregroundColor"},handle:{...Ss},text:{...id,position:"center"},label:{...td,color:void 0,fontSize:{$rem:li.SMALLER}}},callout:{...Vo,...Xv,color:{$ref:"textColor"},handle:{...Ss},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Xv,fontWeight:700,handle:{...Ss},fill:{$ref:"foregroundColor"}},note:{...Xv,color:su,fill:Ts,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Ss},background:{fill:tu,stroke:iu,strokeWidth:1}},text:{...Xv,color:{$ref:"textColor"},handle:{...Ss}},arrow:{...Vo,handle:{...Ss},text:{...id}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Ss,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Ss,stroke:{$ref:"foregroundColor"}}},"date-range":{...dw},"price-range":{...dw},"date-price-range":{...dw},"quick-date-price-range":{up:{...Vo,fill:rs,fillOpacity:.2,handle:{...Ss},statistics:{...hw,color:"#fff",fill:rs,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Vo,stroke:eu,fill:Jd,fillOpacity:.2,handle:{...Ss,stroke:eu},statistics:{...hw,color:"#fff",fill:Jd,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:I6,optionsToolbar:k6},uw={type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,version:de,options:N.annotationOptionsDef,themeTemplate:A6,create:e=>new D6(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new vR(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}},{Range:w6,TranslatableGroup:C6,BBox:L6,FillGradientDefaults:N6,FillImageDefaults:T6,FillPatternDefaults:O6,getShapeFill:P6,InteractionState:qv}=N,oo=class extends ri{constructor(e){super(),this.ctx=e,this.id=gi(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new N6,this.fillPatternDefaults=new O6,this.fillImageDefaults=new T6,this.bounds=new L6(0,0,0,0),this.bandHighlightGroup=new C6({name:"bandHighlight",zIndex:1}),this.rangeNode=this.bandHighlightGroup.appendChild(new w6),this.activeAxisHighlight=void 0,this.axisCtx=e.parent,this.hideBand(),e.domManager.addEventListener("focusin",({target:o})=>{const a=o instanceof HTMLElement&&e.domManager.contains(o,"series-area");this.bandHighlightGroup.visible&&!a&&(this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:9}))});const{widgets:{seriesWidget:t,seriesDragInterpreter:i},animationManager:s,eventsHub:n}=e;this.cleanup.register(e.scene.attachNode(this.bandHighlightGroup),t.addListener("mousemove",o=>this.onHoverLikeEvent(o)),t.addListener("mouseleave",()=>this.clearAllHighlight()),s.addListener("animation-start",()=>this.clearAllHighlight()),n.on("layout:complete",o=>this.layout(o)),n.on("series:focus-change",()=>this.onKeyPress()),n.on("zoom:pan-start",()=>this.clearAllHighlight()),n.on("zoom:change-complete",()=>this.clearAllHighlight()),n.on("dom:resize",()=>this.clearAllHighlight()),n.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",o=>this.onHoverLikeEvent(o)),i.events.on("click",o=>this.onClick(o)))}axisChange(){this.onHighlightChange()}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(e){e.device==="touch"&&this.onHoverLikeEvent(e)}clearAllHighlight(){this.ctx.interactionManager.isState(qv.Hoverable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(qv.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?qv.Hoverable:qv.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&this.handleHoverHighlight(e)}handleHoverHighlight(e){if(!e)return;const{currentX:t,currentY:i}=e;this.onHighlightChange(this.axisCtx.pickBand({x:t,y:i}))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;const{position:s="left",axisId:n}=this.axisCtx,o=i[n];if(!o)return;this.axisLayout=o,this.bounds=e.clone().grow(o.gridPadding,s);const{bandHighlightGroup:a,bounds:r}=this;a.translationX=Math.round(r.x),a.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,fill:o,fillOpacity:a,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:h,axisLayout:d}=this;d&&(e.stroke=t,e.strokeWidth=i,e.strokeOpacity=s,e.lineDash=n,e.lineDashOffset=h,e.fill=P6(o,r,l,c),e.fillOpacity=a,e.startLine=!0,e.endLine=!0)}isVertical(){return this.axisCtx.direction==="x"}onHighlightChange(e){this.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:9}))}updateBandPosition(){const{rangeNode:e,bounds:t}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let s=Math.min(...i),n=Math.max(...i);if(n-s<1){const o=(s+n)/2;s=o-.5,n=o+.5}this.isVertical()?(e.y1=0,e.y2=t.height,e.x1=s,e.x2=n,e.horizontal=!0):(e.y1=s,e.y2=n,e.x1=0,e.x2=t.width,e.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};oo.className="BandHighlight",g([m],oo.prototype,"enabled",2),g([m],oo.prototype,"stroke",2),g([m],oo.prototype,"lineDash",2),g([m],oo.prototype,"lineDashOffset",2),g([m],oo.prototype,"strokeWidth",2),g([m],oo.prototype,"strokeOpacity",2),g([m],oo.prototype,"fill",2),g([m],oo.prototype,"fillOpacity",2),g([m],oo.prototype,"fillGradientDefaults",2),g([m],oo.prototype,"fillPatternDefaults",2),g([m],oo.prototype,"fillImageDefaults",2);var pw={type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",axisTypes:["category","ordinal-time","unit-time","grouped-category"],enterprise:!0,version:de,themeTemplate:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}},create:e=>new oo(e)},{LayoutElement:E6,Menu:R6}=N,gw=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],Rz=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menuMargin=6,this.menu=new R6(this.ctx,"chart-toolbar"),this.menuShowing=!1,this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(E6.ToolbarLeft,this.onLayoutStart.bind(this)),e.eventsHub.on("series-area:click",()=>this.hidePopover()),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t,buttonWidget:i}){const s=this.ctx.domManager.isRtl?t.x-this.menuMargin:t.x+t.width+this.menuMargin;this.menu.setAnchor({x:s,y:t.y}),this.menu.show(i,{items:gw,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:n=>{this.setChartType(n.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton(),this.menuShowing=!1}}),this.menuShowing=!0,this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=gw.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.menuShowing&&(this.menuShowing=!1,this.toolbar.clearActiveButton()),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>W.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!gw.some(t=>t.value===e)?"candlestick":e}};g([m,Ze({changeValue(e){this.toolbar?.setHidden(!e)}})],Rz.prototype,"enabled",2);var Qv={type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,version:de,options:{enabled:E},create:e=>new Rz(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new vR(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}};function fw(e,t){return e==="always"?!0:e==="series-area"?t==="series-area"||t==="series-node":e===t}function zz(e,t,i){let s=!0;if(t.type==="separator"){const n=i.at(-1);s=n!==void 0&&n.type!=="separator"}if(s&&(s=fw(t.showOn??"always",e)),s){const n=new B6(t);return i.push(n),n}}function Vz(e,t,i,s){t.isVisible(i)&&zz(e,t.builtins.items[i],s)}function z6(e,t,i,s){const{builtins:n}=t;if(Al(i,n.lists))for(const o of n.lists[i])Vz(e,t,o,s);else Vz(e,t,i,s)}function V6(e,t,i){const s=[],{builtins:n}=i;for(const o of t)if(typeof o=="string"&&Al(o,n.lists))for(const a of n.lists[o])s.push(a);else s.push(o);return s.filter(o=>{if(typeof o=="string"){const a=i.builtins.items[o].showOn??"always";return i.isVisible(o)&&fw(a,e)}else return fw(o.showOn??"always",e)})}function Bz(e,t,i,s){for(const n of i)if(typeof n=="string")z6(e,t,n,s);else{const o=zz(e,n,s);n.items&&o&&n.items.length>0&&Bz(e,t,n.items,o.items)}s.at(-1)?.type==="separator"&&s.pop()}var B6=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)e[t]!==void 0&&this.setField(t,this,e[t])}},ml="ag-charts-context-menu",{getItemId:F6,ContextMenuRegistry:mm}=N,mw="context-menu",_6=["angleKey","calloutLabelKey","colorKey","labelKey","radiusKey","sectorLabelKey","sizeKey","xKey","yKey"],ym=class extends ri{constructor(e){if(super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new qf.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",mw),this.element.classList.add(ml),this.element.style.display="none",this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:t})=>{this.collapsingSubMenus>0||(t==null||t instanceof Node&&!this.element.contains(t))&&this.hide()}),this.cleanup.register(()=>this.element.remove(),()=>this.menuWidget.destroy(),e.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("collapse-widget",()=>this.onCollapse())),this.menuWidget.addClass(`${ml}__menu`),typeof MutationObserver<"u"){const t=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.cleanup.register(()=>t.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&(i=t.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(s=>{W.error("Unable to download chart",s)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",t=>this.onContext(t)))}makeGetItemsParams(e){const{showOn:t}=e,{context:i}=this.ctx.chartService,s=V6(t,this.items,this.ctx.contextMenuRegistry);switch(t){case"always":case"series-area":return{showOn:t,context:i,defaultItems:s};case"series-node":{if(this.pickedNode==null)throw new Error("this.pickedNode is null");const c={showOn:t,context:i,seriesId:this.pickedNode.series.id,itemId:F6(this.pickedNode,this.pickedNode.series.data?.dataIdKey),datum:this.pickedNode.datum,defaultItems:s};for(const h of _6)this.pickedNode[h]!==void 0&&(c[h]=this.pickedNode[h]);return c}case"legend-item":if(this.pickedLegendItem==null)throw new Error("this.pickedLegendItem is null");const{itemId:n,seriesId:o,label:a,enabled:r}=this.pickedLegendItem,l=Oe(a.text);return{showOn:t,context:i,itemId:n,seriesId:o,text:l,visible:r,defaultItems:s};default:return t}}expandItemsOptions(e){const t=[];let i;if(this.getItems){const s=this.makeGetItemsParams(e);i=this.getItems(s)}return i??(i=this.items),Bz(e.showOn,this.ctx.contextMenuRegistry,i,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,mm.check("series-node",e)?this.pickedNode=e.context.pickedNode:mm.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e);t.length!==0&&this.show(e.widgetEvent,t)}show(e,t){const{sourceEvent:i}=e;this.interactionManager.pushState(N.InteractionState.ContextMenu),this.element.style.display="block";const s=i.pointerType==="touch"?!1:void 0;s!==void 0&&this.ctx.chartService.overrideFocusVisible(s),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:s})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(N.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const{isRtl:s}=this.ctx.domManager,n=this.ctx.domManager.getBoundingClientRect(),o=e.getBoundingClientRect(),a=n.right-o.right,r=o.left-n.left,{offsetWidth:l,offsetHeight:c}=t.getElement();let h=i.y;if(n.height>c){const p=n.bottom-o.top;p=l){const p=d==="right"?i.x+i.width:i.x-l;t.setBounds({x:p,y:h})}else{const p=d==="right"?i.x-l:i.x+i.width,f=(d==="right"?r:a)-l;f>=0?t.setBounds({x:p,y:h}):t.setBounds({x:p+(d==="right"?-f:f),y:h})}}onSubMenuCollapse(e,t){e.setFocusOverride(void 0),this.collapsingSubMenus++,t.remove(),this.collapsingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":{e.addSeparator().classList.add(`${ml}__divider`);break}case"action":{if(i.items.length===0){const s=new qf.MenuItemWidget;this.initButtonElement(s,i),e.addChild(s)}else{const{subMenuButton:s,subMenu:n}=e.addSubMenu();n.addClass(`${ml}__menu`),n.addListener("expand-widget",()=>this.onSubMenuExpand(s,n)),n.addListener("collapse-widget",()=>this.onSubMenuCollapse(s,n)),this.initButtonElement(s,i),this.createMenuItems(n,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return mm.checkCallback("legend-item",e,t)?i=>{const s=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:n,itemId:o,label:a}=this.pickedLegendItem,{chartService:r}=this.ctx,c=[r.series.find(d=>d.id===n)?.properties,r],h={type:"contextmenu",seriesId:n,itemId:o,text:Oe(a.text),event:s};ls(c,t,h),this.hide()}else W.error("legend item not found")}:mm.checkCallback("series-area",e,t)?()=>{const i=this.ctx.chartService,s={type:"seriesContextMenuAction",event:this.showEvent};ls(i,t,s),this.hide()}:mm.checkCallback("series-node",e,t)?()=>{const{showEvent:i}=this,{chartService:s}=this.ctx,n=this.pickedNode,o=[n?.series.properties,s],a=n?.series.createNodeContextMenuActionEvent(i,n);a?ls(o,t,a):W.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,s={type:"contextMenuEvent",event:this.showEvent};ls(i,t,s),this.hide()}}initTableCells(e){const t=ke("div"),i=ke("div"),s=ke("div");return t.classList.toggle(`${ml}__icon`,!0),i.classList.toggle(`${ml}__cell`,!0),s.classList.toggle(`${ml}__cell`,!0),t.ariaHidden="true",i.role="presentation",s.ariaHidden="true",e.append(t,i,s),{cellIcon:t,cellLabel:i,cellArrow:s}}initButtonElement(e,t){e.addClass(`${ml}__item`),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),s=`${ml}__cellpadding`,{cellIcon:n,cellLabel:o,cellArrow:a}=this.initTableCells(e.getElement());if(o.textContent=i,o.classList.add(s),t.iconUrl!=null){const c=ke("img");c.src=t.iconUrl,n.append(c),n.classList.add(s)}if(t.items.length>0){const c=ke("span",fr("chevron-right"));a.append(c),a.classList.add(s)}const{showOn:r,action:l}=t;l!=null&&e.addListener("click",this.createButtonOnClick(r,l)),t.items.length===0&&(e.addListener("mouseleave",()=>e.setFocusOverride(!1)),e.addListener("mouseenter",()=>e.setFocusOverride(void 0)))}reposition(){const{isRtl:e}=this.ctx.domManager;let{x:t,y:i}=this;this.element.style.top="unset",this.element.style.bottom="unset";const s=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:n,offsetHeight:o}=this.element;t=se(0,e?t-n:t,s.width-n),i=se(0,i,s.height-o),this.element.style.left=`${t}px`,this.element.style.top=`calc(${i}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(mw),this.ctx.domManager.removeChild("canvas-overlay",mw)}};g([m],ym.prototype,"enabled",2),g([m],ym.prototype,"darkTheme",2),g([m],ym.prototype,"items",2),g([m],ym.prototype,"getItems",2);var xm={type:"plugin",name:"contextMenu",enterprise:!0,version:de,options:{enabled:E,items:Ig,getItems:Ki(Ig,"a menu items array")},themeTemplate:{enabled:!0,darkTheme:zl},create:e=>new ym(e)};xm.options.darkTheme=Q(E);function bm(e){return typeof e?.datum=="object"?e.datum:null}var{FormatManager:H6}=N,G6="ag-charts-crosshair-label",Lc=class extends q{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:o}=this,{domain:a,boundSeries:r}=s;let l;if(n!=null){const c=s.type==="number"?s.fractionDigits:void 0,h=s.type==="date"?s.unit:void 0,d=s.type==="date"?s.step:void 0;l=e(n,{value:i,domain:a,fractionDigits:c,unit:h,step:d,boundSeries:r})}if(o!=null){let c=this._cachedFormatter;(c?.type!==t||c?.format!==o)&&(c={type:t,format:o,formatter:H6.getFormatter(t,o)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};g([m],Lc.prototype,"enabled",2),g([m],Lc.prototype,"xOffset",2),g([m],Lc.prototype,"yOffset",2),g([m],Lc.prototype,"formatter",2),g([m],Lc.prototype,"format",2),g([m],Lc.prototype,"renderer",2);var Fz=class extends Lc{constructor(e,t,i){super(),this.domManager=e,this.id=gi(this),this.elementProxy=e.addDeferredProxyChild("canvas-overlay",`crosshair-label-${this.id}`),this.elementProxy.toggleClass(G6,!0),this.elementProxy.setAttr("aria-hidden","true"),this.elementProxy.setAttr("data-key",t),this.elementProxy.setAttr("data-axis-id",i)}show(e){const t=Math.round(e.x+this.xOffset),i=Math.round(e.y+this.yOffset);this.elementProxy.setProperty("left",`${t}px`),this.elementProxy.setProperty("top",`${i}px`);const s=e.translateX||e.translateY?`${e.translateX??"0"} ${e.translateY??"0"}`:"";this.elementProxy.setProperty("translate",s),this.toggle(!0)}setLabelHtml({html:e,styles:t}){e!==void 0&&this.elementProxy.setInnerHTML(e),t!==void 0&&this.elementProxy.setContentStyles(t)}toggle(e){this.elementProxy.toggleClass("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if(typeof e=="string")return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:s=t.color,backgroundColor:n=t.backgroundColor,opacity:o=t.opacity??1}=e,a={opacity:o,"background-color":n?.toLowerCase(),color:s};return{html:`
${i}
`,styles:a}}};Fz.className="CrosshairLabel";var{Group:j6,TranslatableGroup:W6,Line:$6,BBox:_z,InteractionState:Nc}=N,or=class extends ri{constructor(e){super(),this.ctx=e,this.id=gi(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new Lc,this.seriesRect=new _z(0,0,0,0),this.bounds=new _z(0,0,0,0),this.crosshairGroup=new W6({name:"crosshairs",zIndex:9}),this.lineGroup=this.crosshairGroup.appendChild(new j6({name:`${this.id}-crosshair-lines`,zIndex:9})),this.lineGroupSelection=N.Selection.select(this.lineGroup,$6,!1),this.activeHighlight=void 0,this.activeHighlightInViewport=!1,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:i})=>{if(this.checkInteractionState())return;const s=i instanceof HTMLElement&&e.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!s&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:9}))});const{seriesDragInterpreter:t}=e.widgets;this.cleanup.register(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),e.eventsHub.on("zoom:change-complete",()=>this.onMouseOut()),e.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),e.eventsHub.on("layout:complete",i=>this.layout(i)),()=>{for(const i of Object.values(this.labels))i.destroy()}),t&&this.cleanup.register(t.events.on("drag-move",i=>this.onMouseHoverLike(i)),t.events.on("click",i=>this.onClick(i)))}checkInteractionState(){return this.ctx.interactionManager.isState(Nc.Frozen)}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:s="left",axisId:n}=this.axisCtx,o=i[n];if(!o)return;this.axisLayout=o,this.bounds=e.clone().grow(o.gridPadding+o.seriesAreaPadding,s);const{crosshairGroup:a,bounds:r}=this;a.translationX=Math.round(r.x),a.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),!(!this.snap&&this.activeHighlight)&&(this.updateLines(),this.updateLabels(l),!(this.snap&&!this.activeHighlightInViewport)&&this.refreshPositions())}updateSelections(e){this.lineGroupSelection.update(e,void 0,t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const s of e)this.label.enabled&&(t[s]??(t[s]=new Fz(i.domManager,s,this.axisCtx.axisId))),t[s]&&this.updateLabel(t[s])}updateLabel(e){const{enabled:t,xOffset:i,yOffset:s,format:n,renderer:o}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=s,e.format=n,e.renderer=o}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,axisLayout:r}=this;if(!r)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=s,c.strokeOpacity=n,c.lineDash=o,c.lineDashOffset=a,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction==="x"}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){return Oe(this.axisCtx.formatScaleValue(e,"crosshair",this.label))}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?Nc.Hoverable|Nc.Frozen:Nc.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.eventsHub.emit("chart:request-update",{type:9}))}onMouseOut(){const e=this.snap?Nc.Hoverable:Nc.Hoverable|Nc.Frozen;this.ctx.interactionManager.isState(e)&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:9}))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(Nc.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:s,series:n}=e.currentHighlight??{},o=s&&(n?.axes.x?.id===i.axisId||n?.axes.y?.id===i.axisId);if(this.activeHighlight=o?e.currentHighlight:void 0,this.activeHighlightInViewport=e.highlightInViewport,!this.activeHighlight)this.hideCrosshairs();else if(this.snap)if(e.highlightInViewport){const a=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(a),t.visible=!0}else this.hideCrosshairs();this.ctx.eventsHub.emit("chart:request-update",{type:9})}isInRange(e){return this.axisCtx.inRange(e)}refreshPositions(){this.activeHighlight&&this.updatePositions(this.getActiveHighlightData(this.activeHighlight))}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((s,n)=>{const o=e[n];if(!o){s.visible=!1,this.hideLabel(n);return}s.visible=!0;const{value:a,position:r}=o;let l=0,c=0;this.isVertical()?(l=r,s.x=Math.round(l)):(c=r,s.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,a,n):this.hideLabel(n)})}getData(e){const{axisCtx:t}=this,i="pointer",{xKey:s="",yKey:n=""}=this.activeHighlight??{},{currentX:o,currentY:a}=e,r=bm(this.activeHighlight),l=this.isVertical(),c=l?o:a;let h=r?.[l?s:n]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{series:i,xKey:s="",aggregatedValue:n,cumulativeValue:o,midPoint:a}=e,r=bm(e),l=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=i.axes[t.direction]?.id===t.axisId,d=l.includes("yKey")&&h,u=l.includes("xKey")&&h,p=n??o;if(d&&p!==void 0){const y=t.scale.convert(p)+c;return this.isInRange(y)?{yKey:{value:p,position:y}}:{}}if(u){const y=(this.isVertical()?a?.x:a?.y)??0,x=t.continuous?t.scaleInvert(y):r?.[s];return this.isInRange(y)?{xKey:{value:x,position:y}}:{}}const f={};for(const y of l){const x=i.properties[y],b=r?.[x],v=t.scale.convert(b)+c;this.isInRange(v)&&(f[y]={value:b,position:v})}return f}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,s={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),s):t.toLabelHtml(s)}showLabel(e,t,i,s){if(!this.axisLayout)return;const{bounds:n}=this,o=this.labels[s],a=this.getLabelHtml(i,o);o.setLabelHtml(a);const r=this.axisCtx.position;let l=this.axisLayout.label.spacing+this.axisLayout.tickSize;if(this.axisCtx.direction==="x"){l-=4;const c=r==="bottom";o.show({x:e,y:c?n.y+n.height+l:n.y-l,translateX:"-50%",translateY:c?"0":"-100%"})}else{l-=8;const c=r==="right";o.show({x:c?n.x+n.width+l:n.x-l,y:t,translateX:c?"0":"-100%",translateY:"-50%"})}}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};or.className="Crosshair",g([m],or.prototype,"enabled",2),g([m],or.prototype,"stroke",2),g([m],or.prototype,"lineDash",2),g([m],or.prototype,"lineDashOffset",2),g([m],or.prototype,"strokeWidth",2),g([m],or.prototype,"strokeOpacity",2),g([m],or.prototype,"snap",2),g([m],or.prototype,"label",2);var yw={type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,version:de,themeTemplate:{enabled:{$if:[{$or:[{$eq:[{$path:"../type"},"number"]},{$eq:[{$path:"../type"},"log"]},{$eq:[{$path:"../type"},"time"]},{$eq:[{$path:"../type"},"unit-time"]},{$eq:[{$path:"../type"},"ordinal-time"]}]},!0,!1]},snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}},create:e=>new or(e)},zp=class extends ri{constructor(e){super(),this.enabled=!0,this.getData=()=>Promise.resolve(),this.dataService=e.dataService;let t=!1;this.cleanup.register(e.eventsHub.on("data:load",()=>{t=!0}),e.eventsHub.on("layout:complete",()=>{t&&e.zoomManager.updateZoom({source:"data-update",sourceDetail:"dataSource"})}))}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};g([Ze({newValue(e){this.updateCallback(e,this.getData)}}),m],zp.prototype,"enabled",2),g([Ze({newValue(e){this.updateCallback(this.enabled,e)}}),m],zp.prototype,"getData",2),g([Ze({newValue(e){this.dataService.requestThrottle=e}})],zp.prototype,"requestThrottle",2),g([Ze({newValue(e){this.dataService.dispatchThrottle=e}})],zp.prototype,"updateThrottle",2),g([Ze({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],zp.prototype,"updateDuringInteraction",2);var Jv={type:"plugin",name:"dataSource",enterprise:!0,version:de,options:{getData:at,requestThrottle:Q(P),updateThrottle:Q(P),updateDuringInteraction:Q(E)},create:e=>new zp(e)},{BBox:Tc}=N,K6=class{constructor(e){this.components=e,this.union=Tc.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},U6=class extends N.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new N.Path,this.capsPath=new N.Path,this.bboxes=new K6([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:s}=e,{lengthRatioMultiplier:n,lengthMax:o}=t,a=s??i*n;return Math.min(a,o)}getItemStylerParams(e,t,i,s){const{datum:n}=this;if(n==null||e.itemStyler==null)return;const{xLowerKey:o,xUpperKey:a,yLowerKey:r,yUpperKey:l}=e;return{...t,datum:n.datum,seriesId:n.series.id,xKey:n.xKey,yKey:n.yKey,xLowerKey:o,xUpperKey:a,yLowerKey:r,yUpperKey:l,highlighted:i,highlightState:s}}formatStyles(e,t,i,s,n){let{cap:o,...a}=e;const r=this.getItemStylerParams(t,e,s,n);if(r!=null&&t.itemStyler!=null){const l=i.callWithContext(t.itemStyler,r);a=ce(l,a),o=ce(l?.cap,l,o)}return{whiskerStyle:a,capsStyle:o}}applyStyling(e,t){Ng(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,s,n){if(this.datum===void 0)return;const{whiskerStyle:o,capsStyle:a}=this.formatStyles(e,t,i,s,n),{xBar:r,yBar:l,capDefaults:c}=this.datum,h=this.whiskerPath;this.applyStyling(h,o),h.path.clear(!0),l!==void 0&&(h.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),h.path.lineTo(l.upperPoint.x,l.upperPoint.y)),r!==void 0&&(h.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),h.path.lineTo(r.upperPoint.x,r.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(a??{},c);const d=this.capLength/2,u=this.capsPath;this.applyStyling(u,a),u.path.clear(!0),l!==void 0&&(u.path.moveTo(l.lowerPoint.x-d,l.lowerPoint.y),u.path.lineTo(l.lowerPoint.x+d,l.lowerPoint.y),u.path.moveTo(l.upperPoint.x-d,l.upperPoint.y),u.path.lineTo(l.upperPoint.x+d,l.upperPoint.y)),r!==void 0&&(u.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-d),u.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+d),u.path.moveTo(r.upperPoint.x,r.upperPoint.y-d),u.path.lineTo(r.upperPoint.x,r.upperPoint.y+d)),u.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:s,xBar:n}=this.datum??{},o=e/2,a=[];if(s!==void 0){const r=s.lowerPoint.y-s.upperPoint.y;a.push(new Tc(s.lowerPoint.x,s.upperPoint.y,t.strokeWidth,r),new Tc(s.lowerPoint.x-o,s.lowerPoint.y,e,i.strokeWidth),new Tc(s.upperPoint.x-o,s.upperPoint.y,e,i.strokeWidth))}if(n!==void 0){const r=n.upperPoint.x-n.lowerPoint.x;a.push(new Tc(n.lowerPoint.x,n.upperPoint.y,r,t.strokeWidth),new Tc(n.lowerPoint.x,n.lowerPoint.y-o,i.strokeWidth,e),new Tc(n.upperPoint.x,n.upperPoint.y-o,i.strokeWidth,e))}this.bboxes.components=a,this.bboxes.union=Tc.merge(a)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:s}=this;if(s.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:n}=hu(e,t,s.components);return{nearest:this,distanceSquared:n}}},Y6=class extends N.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:s}=_M(e,t,{children:this.children()});if(i!==void 0&&!Number.isNaN(s))return{datum:i.datum,distanceSquared:s}}},yl=class extends q{};g([m],yl.prototype,"visible",2),g([m],yl.prototype,"stroke",2),g([m],yl.prototype,"strokeWidth",2),g([m],yl.prototype,"strokeOpacity",2),g([m],yl.prototype,"lineDash",2),g([m],yl.prototype,"lineDashOffset",2),g([m],yl.prototype,"length",2),g([m],yl.prototype,"lengthRatio",2);var Ms=class extends q{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new yl}};g([m],Ms.prototype,"yLowerKey",2),g([m],Ms.prototype,"yLowerName",2),g([m],Ms.prototype,"yUpperKey",2),g([m],Ms.prototype,"yUpperName",2),g([m],Ms.prototype,"xLowerKey",2),g([m],Ms.prototype,"xLowerName",2),g([m],Ms.prototype,"xUpperKey",2),g([m],Ms.prototype,"xUpperName",2),g([m],Ms.prototype,"visible",2),g([m],Ms.prototype,"stroke",2),g([m],Ms.prototype,"strokeWidth",2),g([m],Ms.prototype,"strokeOpacity",2),g([m],Ms.prototype,"lineDash",2),g([m],Ms.prototype,"lineDashOffset",2),g([m],Ms.prototype,"itemStyler",2),g([m],Ms.prototype,"cap",2);var{fixNumericExtent:Z6,groupAccumulativeValueProperty:X6,valueProperty:eS}=N,q6=class Um extends ri{constructor(t){super(),this.properties=new Ms;const i=t.series,{annotationGroup:s,annotationSelections:n}=i;this.cartesianSeries=i,this.groupNode=new Y6({name:`${s.id}-errorBars`}),s.appendChild(this.groupNode),this.selection=N.Selection.select(this.groupNode,()=>this.errorBarFactory()),n.add(this.selection),i.addEventListener("seriesVisibilityChange",o=>this.onToggleSeriesItem(o)),this.cleanup.register(i.events.on("data-processed",o=>this.onDataProcessed(o)),i.events.on("data-update",o=>this.onDataUpdate(o)),t.eventsHub.on("highlight:change",o=>this.onHighlightChange(o)),()=>this.groupNode.remove(),()=>n.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:s,yUpperKey:n}=this.properties;return vt(t)&&vt(i)||vt(s)&&vt(n)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:s,xUpperKey:n,yLowerKey:o,yUpperKey:a,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=t;return o!=null&&a!=null&&i.push(eS(o,h,{id:`${l}-lower`}),eS(a,h,{id:`${l}-upper`})),s!=null&&n!=null&&i.push(eS(s,c,{id:`${r}-lower`}),eS(n,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:s}=this,{xLowerKey:n,xUpperKey:o,yLowerKey:a,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=t,u=s.seriesGrouping?.groupIndex??s.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...s.visible?{}:{forceValue:0}},f=(x,b,v,S)=>X6(x,"normal",{id:`${b}-${v}`,groupId:`errorGroup-${u}-${v}`,...p},S),y=(x,b,v,S)=>{i.push(...f(x,v,"lower",S),...f(b,v,"upper",S))};return a!=null&&r!=null&&y(a,r,c,d),n!=null&&o!=null&&y(n,o,l,h),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:s,xErrorsID:n,yLowerKey:o,yUpperKey:a,yErrorsID:r}=this.getMaybeFlippedKeys();if(t==="x"?vt(i)&&vt(s):vt(o)&&vt(a)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const u={x:n,y:r}[t],p=c.getDomain(d,`${u}-lower`,"value",h).domain,f=c.getDomain(d,`${u}-upper`,"value",h).domain,y=[Math.min(...p,...f),Math.max(...p,...f)];return Z6(y)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,vt(t.dataModel)&&vt(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes.x?.scale,s=this.cartesianSeries.axes.y?.scale;if(!(!i||!s||!t))for(let n=0;nthis.updateNode(i,s,n))}updateNode(t,i,s){t.datum=i,t.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1,"none"),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:s}=t,n=this.groupNode.pickNode(i,s);if(n!=null)return{datum:n.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t,i){let s,n=[1/0,1/0];const o=[t.x,t.y];i==="y"&&o.reverse();for(const a of this.groupNode.children()){const r=a.getBBox(),l=[r.x+r.width/2,r.y+r.height/2];i==="y"&&l.reverse();const c=[];for(let h=0;hnew q6(e)},{Group:Q6,Rect:Hz,Selection:J6,TranslatableGroup:e9}=N,Gz=2,jz=1,t9=2,i9=1e-6,Wz={remove:0,update:1,add:2};function s9(e,t,i,s){for(const n of t)!e.has(n)&&!s?.has(n)&&e.set(n,i)}function n9(e,t){const i=new Map;for(const s of e.flatMap(n=>Object.values(n))){const n=t?s.moved:void 0;s9(i,s.updated,"update",n);for(const o of s.removed)i.set(o,"remove");for(const o of s.added)i.set(o,"add")}return i}function o9(e){for(const t of["x","y"])for(const i of e.axisManager.getAxisContext(t))if(N.BandScale.is(i.scale))return i}function a9(e,t){return t>0&&e>0&&t/e{const h=Wz[l.phase]-Wz[c.phase];return h==0?l.bounds[s]-c.bounds[s]:h}),a=[o[0]];let r=a[0];for(let l=1;lnew Hz({name:"flash-on-update-band"})),this.cleanup.register(this.ctx.scene.attachNode(this.flashGroup),this.ctx.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),this.ctx.eventsHub.on("datamodel:diff",t=>this.onDataModelDiff(t)),this.ctx.updateService.addListener("pre-scene-render",t=>this.onPreSceneRender(t)))}destroy(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.cleanup.flush()}onLayoutComplete({chart:e,series:t}){this.enabled&&(this.chartFlashRect.x=0,this.chartFlashRect.y=0,this.chartFlashRect.width=e.width,this.chartFlashRect.height=e.height,this.seriesRect=t.rect.clone(),this.bandGroup.translationX=Math.round(this.seriesRect.x),this.bandGroup.translationY=Math.round(this.seriesRect.y),this.bandGroup.setClipRect(this.seriesRect),this.axisCtx=o9(this.ctx))}resolveDomainValue(e){const t=this.axisCtx?.scale.domain;if(!t?.length||!Array.isArray(t[0]))return e;for(const i of t)if(String(i)===e)return i;return e}onDataModelDiff({diff:e}){this.enabled&&(this.pendingDiffs.push(e),this.item==="category"&&this.cachePreviousBounds(e))}onPreSceneRender({apiUpdate:e}){const t=this.pendingDiffs.length>0;if(!this.enabled||!e){this.pendingDiffs.length=0;return}if(!t)return;const i=this.pendingDiffs.some(a=>Object.values(a).some(r=>r.changed)),s=this.ctx.animationManager.isSkipped(),n=i?n9(this.pendingDiffs,s):void 0;if(this.pendingDiffs.length=0,!i)return;this.stopFlash();const o=n!=null&&n.size>0;this.item==="category"&&o?this.flashCategoryBands(n):this.flashChart()}flashChart(){!this.chartFlashRect.width||!this.chartFlashRect.height||(this.chartFlashRect.fill=this.fill,this.chartFlashRect.fillOpacity=0,this.animate([this.chartFlashRect],"update"))}cacheBounds(e){const t=this.measureBandBounds(e);t&&(this.previousBoundsCache??(this.previousBoundsCache=new Map),this.previousBoundsCache.set(e,t))}cachePreviousBounds(e){let t=!1;for(const i of Object.values(e)){(i.added.size>0||i.removed.size>0)&&(t=!0);for(const s of[...i.removed,...i.updated,...i.moved])this.cacheBounds(s)}if(t)for(const i of this.axisCtx?.scale.domain??[])this.previousBoundsCache?.has(String(i))||this.cacheBounds(String(i))}measureBandBounds(e){if(!this.axisCtx||!this.seriesRect)return;const t=this.axisCtx.measureBand(this.resolveDomainValue(e))?.band;if(!t)return;const[i,s]=t,n=Math.max(s-i,jz);return this.axisCtx.direction==="x"?{x:i,y:0,width:n,height:this.seriesRect.height}:{x:0,y:i,width:this.seriesRect.width,height:n}}flashCategoryBands(e){const t=this.ctx.animationManager.isSkipped();if(t)for(const[s,n]of e)n==="remove"&&e.delete(s);if(!t&&this.hasScaleChange(e)){const s=this.axisCtx?.scale.domain??[];for(const n of s){const o=String(n);e.has(o)||e.set(o,"update")}}const i=this.createBandFlashData(e);i&&(this.updateSelection(i,t),this.animateBands())}hasScaleChange(e){for(const t of e.values())if(t==="add"||t==="remove")return!0;return!1}createBandFlashData(e){if(!this.axisCtx||!this.seriesRect){W.warnOnce("flashOnUpdate item 'category' requires a cartesian category based axis such as 'category', 'ordinal-time', 'unit-time'");return}const{direction:t}=this.axisCtx,i=this.axisCtx.scale,s=t==="x",n=s?this.seriesRect.width:this.seriesRect.height,o=this.measureBandsBatch(i,e,s);if(this.previousBoundsCache=void 0,o.length!==0)return r9(o,s,n)}measureBandsBatch(e,t,i){const s=e.bandwidth??0,o=((e.step??0)-s)/2,[a,r]=e.range,l=Math.min(a,r),c=Math.max(a,r),h=(i?this.seriesRect?.height:this.seriesRect?.width)??0,d=[];for(const[u,p]of t){if(p==="remove"){const M=this.previousBoundsCache?.get(u);M&&d.push({firstKey:u,lastKey:u,bounds:M,phase:p});continue}const f=e.convert(this.resolveDomainValue(u)),y=Math.max(f-o,l),x=Math.min(f+s+o,c),b=Math.max(x-y,jz),v=i?{x:y,y:0,width:b,height:h}:{x:0,y,width:h,height:b},S=this.previousBoundsCache?.get(u);d.push({firstKey:u,lastKey:u,bounds:v,prevBounds:S,phase:p})}return d}updateSelection(e,t){this.bandSelection.update(e),this.bandSelection.each((i,s)=>{const n=t?s.bounds:s.prevBounds??s.bounds;i.fill=this.fill,i.fillOpacity=0,i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height})}animateBands(){const e=Array.from(this.bandSelection.nodes());if(this.ctx.animationManager.isSkipped()){this.animate(e,"update");return}const t=[],i=[],s=[];for(const n of e)n.datum.phase==="remove"?t.push(n):n.datum.phase==="add"?s.push(n):i.push(n);this.animate(t,"remove"),this.animate(i,"update"),this.animate(s,"add")}stopFlash(){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animate(e,t){if(e.length===0)return;const{animationManager:i}=this.ctx,s=this.getCustomTiming(t),n=s?.duration,o=s?.ease;i.animate({id:`${this.id}_${t}`,groupId:this.id,forceAnimation:!0,phase:t,duration:n,ease:o,from:{fillOpacity:this.fillOpacity},to:{fillOpacity:0},onUpdate:({fillOpacity:a},r)=>{if(!r)for(const l of e)l.fillOpacity=a},onStop:()=>{for(const a of e)a.fillOpacity=0}}),t==="update"&&!i.isSkipped()&&i.animate({id:`${this.id}_${t}_position`,groupId:this.id,forceAnimation:!0,phase:t,ease:Ea,from:{t:0},to:{t:1},onUpdate:({t:a},r)=>{if(!r)for(const l of e){const c=l.datum?.prevBounds;if(c){const h=l.datum.bounds;l.x=c.x+(h.x-c.x)*a,l.y=c.y+(h.y-c.y)*a,l.width=c.width+(h.width-c.width)*a,l.height=c.height+(h.height-c.height)*a}}}})}getCustomTiming(e){const{flashDuration:t,fadeOutDuration:i}=this;if(t==null&&i==null)return;const{animationManager:s}=this.ctx,{defaultDuration:n}=s,o=t??0,r=o+(i??0);if(r<=0)return;let l;if(s.isSkipped())l=Math.min(r,Gz*n)/n;else{const h=N.PHASE_METADATA[e].animationDuration;l=Math.min(r/n,Gz)*h}const c=o/r;return{duration:l,ease:c>=1?()=>0:h=>h<=c?0:(h-c)/(1-c)}}};Oc.className="FlashOnUpdate",g([m],Oc.prototype,"enabled",2),g([m],Oc.prototype,"item",2),g([m],Oc.prototype,"fill",2),g([m],Oc.prototype,"fillOpacity",2),g([m],Oc.prototype,"flashDuration",2),g([m],Oc.prototype,"fadeOutDuration",2);var Kz={type:"plugin",name:"flashOnUpdate",enterprise:!0,version:de,options:{enabled:E,item:zd()("chart","category"),fill:J,fillOpacity:oe,flashDuration:P,fadeOutDuration:P},themeTemplate:{enabled:!1,item:"chart",fill:"#cfeeff",fillOpacity:1,flashDuration:100,fadeOutDuration:900},create:e=>new Oc(e)},{TranslatableGroup:l9}=N,bw=class extends l9{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:s}=this,{x:n,y:o,width:a,height:r}=t;e.beginPath(),e.roundRect(n+s,o+s,a-2*s,r-2*s,i),e.clip()}};g([K()],bw.prototype,"inset",2),g([K()],bw.prototype,"cornerRadius",2);var{CategoryAxis:c9,Group:sd,BBox:Uz,stackCartesianSeries:h9}=N,vw=class{constructor(){this.top=0,this.bottom=0}};g([m],vw.prototype,"top",2),g([m],vw.prototype,"bottom",2);var Vp=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new vw,this.root=new sd({name:"root"}),this.seriesRoot=this.root.appendChild(new bw({name:"Series-root",zIndex:7,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new sd({name:"Axes-Grids",zIndex:2})),this.axisGroup=this.root.appendChild(new sd({name:"Axes-Grids",zIndex:2})),this.axisLabelGroup=this.root.appendChild(new sd({name:"Axes-Labels",zIndex:15})),this.axisCrosslineRangeGroup=this.root.appendChild(new sd({name:"Axes-Crosslines-Range",zIndex:6})),this.axisCrosslineLineGroup=this.root.appendChild(new sd({name:"Axes-Crosslines-Line",zIndex:10})),this.axisCrosslineLabelGroup=this.root.appendChild(new sd({name:"Axes-Crosslines-Label",zIndex:15})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=new N.ChartAxes,this.series=[],this.cleanup.register(this.ctx.eventsHub.on("data:update",t=>this.updateData(t)))}destroy(){this._destroyed||(super.destroy(),this.destroySeries(this.series),this.axes.destroy(),this._destroyed=!0)}onSeriesChange(e,t){const i=t?.filter(s=>!e.includes(s))??[];this.destroySeries(i);for(const s of e)t?.includes(s)||(s.attachSeries(this.seriesRoot,this.seriesRoot,void 0),s.chart={},Object.defineProperty(s.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(s.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(s.chart,"flashOnUpdateEnabled",{get:()=>!1}),Object.defineProperty(s.chart,"seriesRect",{get:()=>this.seriesRect}),s.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled"));this.seriesRect=void 0}destroySeries(e){if(e)for(const t of e)t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)}assignAxesToSeries(){const e={};for(const t of this.axes){const i=t.direction;(e[i]??(e[i]=[])).push(t)}for(const t of this.series)for(const i of t.directions){const s=t.getKeyAxis(i)??i,n=this.axes.findById(s);if(!n){W.warnOnce(`no matching axis for direction [${i}] and id [${s}]; check series and axes configuration.`);return}t.axes[i]=n}}updateData(e){for(const t of this.series)t.setChartData(e);this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready";for(const t of this.series)t.resetAnimation("disabled")})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(async t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new Vr;if(!this.enabled)return e;for(const{position:t,thickness:i,line:s,label:n}of this.axes){if(t==null)continue;let o;i?o=i:o=(s.enabled?s.width:0)+(n.enabled?Fn(n.fontSize??0)+n.spacing:0),e[t]=Math.ceil(o)}return e}async layout(e,t){var i;const{padding:s}=this,n=this.seriesRect!=null,o=new Uz(0,0,e,t-(s.top+s.bottom)),a=this.seriesRect?.width!==e||this.seriesRect?.height!==t;this.seriesRect=o,this.seriesRoot.translationY=s.top,this.seriesRoot.setClipRectCanvasSpace(new Uz(0,-s.top,e,t));for(const r of this.axes){const{position:l="left"}=r;switch(l){case"top":case"bottom":r.range=[0,o.width],r.gridLength=o.height;break;case"right":case"left":{const c=r instanceof c9;r.range=c?[0,o.height]:[o.height,0],r.gridLength=o.width;break}}if(r.gridPadding=0,r.translation.x=0,r.translation.y=0,l==="right"?r.translation.x=e:l==="bottom"&&(r.translation.y=t),n||r.resetAnimation("initial"),r.crossLines)for(const c of r.crossLines)c instanceof N.CartesianCrossLine&&(c.position=r.position??"top",(i=c.label).parallel??(i.parallel=r.label?.parallel));r.calculateLayout(),r.update()}a&&h9(this.series),await Promise.all(this.series.map(async r=>r.update({seriesRect:o})))}};g([m],Vp.prototype,"enabled",2),g([Gt(["seriesRoot","inset"])],Vp.prototype,"inset",2),g([Gt(["seriesRoot","cornerRadius"])],Vp.prototype,"cornerRadius",2),g([Ze({changeValue(e,t=new N.ChartAxes){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i)}})],Vp.prototype,"axes",2),g([Ze({changeValue(e,t){this.onSeriesChange(e,t)}})],Vp.prototype,"series",2);var{SliderWidget:Yz}=N,d9=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,s]of["min","pan","max"].entries()){const n=this.sliders[i];n.step=Yz.STEP_HUNDRETH,n.keyboardStep=Yz.STEP_ONE,n.orientation="horizontal",n.setPreventsDefault(!1),n.addListener("focus",()=>this.clearFocusOverride(n)),n.addListener("keydown",()=>this.clearFocusOverride(n)),n.addListener("drag-start",o=>this.onDragStart(i,o,s)),n.addListener("drag-move",o=>this.onDrag(n,o,s)),n.addListener("drag-end",()=>this.updateSliderRatios()),n.addListener("contextmenu",o=>this.onContextMenu(n,o))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;e==null||t==null||this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"navigatorDOM"},{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(e*100)/100,t=Math.round(t*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}clearFocusOverride(e){e.setFocusOverride(void 0)}onDragStart(e,t,i){const s=this.sliders[e],n=this.toolbar.cssLeft(),o=s.cssLeft();this.dragStartX=n+o+t.offsetX,this.moveToFront(e),t.sourceEvent.preventDefault(),s.focus(),s.setFocusOverride(!1),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:s}=t,{x:n,y:o}=this.toolbar.getBounds(),{x:a,y:r}=e.getBounds(),l=i+n+a,c=s+o+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=se(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},{BBox:u9,ExtendedPath2D:p9}=N,Pc=class extends N.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new p9}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,s,n,o,a,r,l){const c=e.align(i+n*a)+l,h=c+e.align(i+n*a,n*(r-a))-2*l,d=e.align(s+o/2);e.setCenter(c,d),t.setCenter(h,d)}computeBBox(){const{centerX:e,centerY:t,width:i,height:s}=this,n=e-i/2,o=t-s/2;return new u9(n,o,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:s,strokeWidth:n,cornerRadius:o,grip:a}=this,r=n/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),s.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(e-c+r,t-h+r,2*(c-r),2*(h-r),o);const d=3;if(a)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)s.arc(e+u*d,t+p*d,1,0,2*Math.PI),s.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};Pc.className="RangeHandle",g([m,K()],Pc.prototype,"width",2),g([m,K()],Pc.prototype,"height",2),g([m,K()],Pc.prototype,"cornerRadius",2),g([m,K()],Pc.prototype,"grip",2);var{Path:g9,BBox:Sw,ExtendedPath2D:f9,clippedRoundRect:m9}=N,Mw=class extends g9{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new f9}layout(e,t,i,s,n,o){n=Number.isNaN(n)?this.min:n,o=Number.isNaN(o)?this.max:o,(e!==this.x||t!==this.y||i!==this.width||this.height!==s||n!==this.min||o!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=s,this.min=n,this.max=o,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:s}=this;return new Sw(e,t,i,s)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:s,min:n,max:o}=this,a=e+i*n,r=e+i*o;return new Sw(a,t,r-a,s)}updatePath(){const{path:e,visiblePath:t,x:i,y:s,width:n,height:o,min:a,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const d=this.align(i)+h,u=this.align(s)+h,p=this.align(i,n)-2*h,f=this.align(s,o)-2*h,y=this.align(i+n*a)+h,x=y+this.align(i+n*a,n*(r-a))-2*h,b={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},v=(S,M,D)=>{if(D-M<1)return;const I=new Sw(M,u,D-M,f);m9(S,d,u,p,f,b,I)};v(e,d,y),v(e,x,p+d),v(t,y,x)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};Mw.className="RangeMask",g([m,K()],Mw.prototype,"cornerRadius",2);var y9=class extends N.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:17}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new N.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,s,n,o){this.x=e,this.y=t,this.width=i,this.height=s,this.lOffset=n,this.rOffset=o,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){e?.remove(),t!=null&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:s,lOffset:n,rOffset:o}=this;return new N.BBox(e-n,t,i+(n+o),s)}},Bp=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new Mw,this.minHandle=new Pc,this.maxHandle=new Pc,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new y9([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",()=>this.updateZoom()),e.layoutManager.registerElement(N.LayoutElement.Navigator,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",t=>this.onZoomChange(t))),this.domProxy=new d9(e,this),this.updateGroupVisibility(),this.miniChart=new Vp(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom({source:"chart-update",sourceDetail:"navigator"},{x:{min:0,max:1}}))}onLayoutStart({layoutBox:e}){if(this.enabled){const t=this.height+this.spacing;e.shrink(t,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:s,height:n}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:o,_max:a}=this.domProxy;this.layoutNodes(t,s,i,n,o,a),this.domProxy.updateBounds({x:t,y:s,width:i,height:n})}this.x=t,this.width=i,this.miniChart?.layout(i,n).catch(o=>W.error(o))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(N.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:s,width:n}=this,{minRange:o}=this.domProxy;let{_min:a,_max:r}=this.domProxy;const l=(t-s)/n;if(e==="min")a=se(0,l,r-o);else if(e==="max")r=se(a+o,l,1);else if(e==="pan"&&i!=null){const c=r-a;a=se(0,l-i,1-c),r=a+c}this.domProxy._min=a,this.domProxy._max=r,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:s,width:n,height:o}=this,{min:a,max:r}=t;this.domProxy.updateMinMax(a,r),this.layoutNodes(i,s,n,o,a,r)}layoutNodes(e,t,i,s,n,o){const{rangeSelector:a,mask:r,minHandle:l,maxHandle:c}=this;r.layout(e,t,i,s,n,o),a.layout(e,t,i,s,l.width/2,c.width/2),Pc.align(l,c,e,t,i,s,n,o,r.strokeWidth/2),n+(o-n)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3);for(const[h,d]of[l,this.maskVisibleRange,c].entries()){const u=d.getBBox(),p={x:u.x-e,y:u.y-t,height:u.height,width:u.width};this.domProxy.updateSliderBounds(h,p)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}async processData(e){return this.miniChart?.processData(e)}};g([Rt((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Bp.prototype,"miniChart",2),g([m,Rt((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],Bp.prototype,"enabled",2),g([m],Bp.prototype,"height",2),g([m,Rt((e,t)=>{e.mask.cornerRadius=t})],Bp.prototype,"cornerRadius",2),g([m],Bp.prototype,"spacing",2);function x9(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function b9(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var{Path:v9,Scalable:S9,ExtendedPath2D:M9,BBox:nd,clippedRoundRect:Zz}=N,ji=class extends S9(v9){constructor(){super(...arguments),this.wickPath=new M9,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:e,center:t,thickness:i,min:s,max:n}=this;return e?new nd(Math.min(s,n),t-i/2,Math.abs(n-s),i):new nd(t-i/2,Math.min(s,n),i,Math.abs(n-s))}computeDefaultGradientFillBBox(){const{horizontal:e,center:t,thickness:i,q1:s,q3:n}=this;return e?new nd(Math.min(s,n),t-i/2,Math.abs(n-s),i):new nd(t-i/2,Math.min(s,n),i,Math.abs(n-s))}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:e,crisp:t}=this;let{center:i,min:s,q1:n,median:o,q3:a,max:r}=this,l=i-e/2,c=i+e/2;if(t&&e>1){s=this.align(s),n=this.align(n),o=this.align(o),a=this.align(a),r=s+this.align(s,r-s);const h=this.align(e/2);i=this.align(i),l=i-h,c=i+h}return{center:i,x0:l,x1:c,min:s,max:r,q1:n,median:o,q3:a}}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,wickStroke:a,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d,cornerRadius:u,capLengthRatio:p,horizontal:f}=this,{center:y,x0:x,x1:b,min:v,max:S,q1:M,median:D,q3:I}=this.alignedCoordinates(),k=this.layerManager?.canvas.pixelRatio??1,A=this.wickStrokeAlignment>0?k/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const C=a!=null&&a!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==o?this.wickPath:e;if(Math.abs(b-x)<=3){Fp(C,f,y,v),_p(C,f,y,S);return}const T=Math.min(v,S),O=Math.max(v,S),V=Math.min(M,I),z=Math.max(M,I),R=y-Math.abs((b-x)*p)/2,B=y+Math.abs((b-x)*p)/2;Fp(C,f,R,T-A),_p(C,f,B,T-A),Fp(C,f,y-A,T-A),_p(C,f,y-A,V+i/2),Fp(C,f,y-A,O+A),_p(C,f,y-A,z-i/2),Fp(C,f,R,O+A),_p(C,f,B,O+A);const G=i/2+d,F=i/2-d,_=z-V-2*F;if(_>0){const Y=x+G,Z=V+F,ne=b-x-2*G,te={topLeft:u,topRight:u,bottomRight:u,bottomLeft:u};Xz(e,f,Y,Z,ne,_,te,new nd(Y,Z,ne,D-Z)),Xz(e,f,Y,Z,ne,_,te,new nd(Y,D,ne,Z+_-D))}else{const Y=(V+z)/2;Fp(e,f,x,Y),_p(e,f,b,Y)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=n,wickLineDash:h=o,wickLineDashOffset:d=a}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};g([K()],ji.prototype,"horizontal",2),g([K()],ji.prototype,"center",2),g([K()],ji.prototype,"thickness",2),g([K()],ji.prototype,"min",2),g([K()],ji.prototype,"q1",2),g([K()],ji.prototype,"median",2),g([K()],ji.prototype,"q3",2),g([K()],ji.prototype,"max",2),g([K()],ji.prototype,"cornerRadius",2),g([K()],ji.prototype,"crisp",2),g([K()],ji.prototype,"strokeAlignment",2),g([K()],ji.prototype,"wickStroke",2),g([K()],ji.prototype,"wickStrokeWidth",2),g([K()],ji.prototype,"wickStrokeOpacity",2),g([ku()],ji.prototype,"wickLineDash",2),g([K()],ji.prototype,"wickLineDashOffset",2),g([K()],ji.prototype,"capLengthRatio",2),g([K()],ji.prototype,"wickStrokeAlignment",2);function Fp(e,t,i,s){t?e.moveTo(s,i):e.moveTo(i,s)}function _p(e,t,i,s){t?e.lineTo(s,i):e.lineTo(i,s)}function Xz(e,t,i,s,n,o,a,r){t?Zz(e,s,i,o,n,a,r==null?void 0:new nd(r.y,r.x,r.height,r.width)):Zz(e,i,s,n,o,a,r)}var{AbstractBarSeriesProperties:D9,makeSeriesTooltip:I9}=N,qz=class extends q{constructor(){super(...arguments),this.lengthRatio=.5}};g([m],qz.prototype,"lengthRatio",2);var Hp=class extends q{};g([m],Hp.prototype,"stroke",2),g([m],Hp.prototype,"strokeWidth",2),g([m],Hp.prototype,"strokeOpacity",2),g([m],Hp.prototype,"lineDash",2),g([m],Hp.prototype,"lineDashOffset",2);var Ct=class extends D9{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new qz,this.whisker=new Hp,this.tooltip=I9()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:n}=this,o=super.toJson();return o.whisker=ce(o.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:n}),o}};g([m],Ct.prototype,"xKey",2),g([m],Ct.prototype,"minKey",2),g([m],Ct.prototype,"q1Key",2),g([m],Ct.prototype,"medianKey",2),g([m],Ct.prototype,"q3Key",2),g([m],Ct.prototype,"maxKey",2),g([m],Ct.prototype,"xName",2),g([m],Ct.prototype,"yName",2),g([m],Ct.prototype,"minName",2),g([m],Ct.prototype,"q1Name",2),g([m],Ct.prototype,"medianName",2),g([m],Ct.prototype,"q3Name",2),g([m],Ct.prototype,"maxName",2),g([m],Ct.prototype,"fill",2),g([m],Ct.prototype,"fillOpacity",2),g([m],Ct.prototype,"stroke",2),g([m],Ct.prototype,"strokeWidth",2),g([m],Ct.prototype,"strokeOpacity",2),g([m],Ct.prototype,"lineDash",2),g([m],Ct.prototype,"lineDashOffset",2),g([m],Ct.prototype,"cornerRadius",2),g([m],Ct.prototype,"styler",2),g([m],Ct.prototype,"itemStyler",2),g([m],Ct.prototype,"cap",2),g([m],Ct.prototype,"whisker",2),g([m],Ct.prototype,"tooltip",2);var{fixNumericExtent:k9,keyProperty:A9,SeriesNodePickMode:Qz,SMALLEST_KEY_INTERVAL:w9,valueProperty:vm,diff:C9,animationValidation:L9,computeBarFocusBounds:N9,createDatumId:Jz,HighlightState:Dw,motion:eV,getItemStyles:T9,calculateSegments:O9,toHighlightString:P9,processedDataIsAnimatable:E9,upsertNodeDatum:R9}=N,z9=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},Iw=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Qz.NEAREST_NODE,Qz.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new Ct,this.NodeEvent=z9}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:n,q3Key:o,maxKey:a}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];this.needsDataModelDiff()&&this.processedData&&p.push(C9(this.id,this.processedData)),r&&p.push(L9());const f=this.properties.allowNullKeys??!1,{processedData:y}=await this.requestDataModel(e,this.data,{props:[A9(t,d,{id:"xValue",allowNullKey:f}),vm(i,u,{id:"minValue"}),vm(s,u,{id:"q1Value"}),vm(n,u,{id:"medianValue"}),vm(o,u,{id:"q3Value"}),vm(a,u,{id:"maxValue"}),...h?[w9]:[],...p]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{index:n,def:o}=i.resolveProcessedDataDefById(this,"xValue"),a=t.domain.keys[n];if(o.type==="key"&&o.valueType==="category"){const r=i.getKeySortMetadata(this,"xValue",t);return{domain:a,sortMetadata:r}}return{domain:this.padBandExtent(a)}}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return{domain:k9(s)}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["maxValue","minValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:n}=this;if(!i||!s)return;const o=n?.nodeData!=null&&s.changeDescription!=null,a=!this.ctx.animationManager.isSkipped(),{groupOffset:r,barOffset:l,barWidth:c}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:s.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",s),minValues:i.resolveColumnById(this,"minValue",s),q1Values:i.resolveColumnById(this,"q1Value",s),medianValues:i.resolveColumnById(this,"medianValue",s),q3Values:i.resolveColumnById(this,"q3Value",s),maxValues:i.resolveColumnById(this,"maxValue",s),xScale:e.scale,yScale:t.scale,groupOffset:r,barOffset:l,barWidth:c,isVertical:this.isVertical(),xKey:this.properties.xKey,animationEnabled:a,canIncrementallyUpdate:o,nodes:o?n.nodeData:[],nodeIndex:0}}validateBoxPlotValues(e,t,i,s,n){return[e,t,i,s,n].every(o=>typeof o=="number")&&e<=t&&t<=i&&i<=s&&s<=n}computeScaledValues(e,t,i){const s=e.xScale.convert(e.xValues[i]);return Number.isFinite(s)?(t.xValue=s+e.groupOffset+e.barOffset+e.barWidth/2,t.minValue=e.yScale.convert(e.minValues[i]),t.q1Value=e.yScale.convert(e.q1Values[i]),t.medianValue=e.yScale.convert(e.medianValues[i]),t.q3Value=e.yScale.convert(e.q3Values[i]),t.maxValue=e.yScale.convert(e.maxValues[i]),!0):!1}createSkeletonNodeDatum(e,t){return{series:this,datum:t.datum,datumIndex:t.datumIndex,xKey:e.xKey,bandwidth:e.barWidth,scaledValues:{xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},midPoint:{x:0,y:0},focusRect:{x:0,y:0,width:0,height:0}}}updateNodeDatum(e,t,i){const{isVertical:s,barWidth:n}=e,o=i.scaledValues,a=t;a.datum=i.datum,a.datumIndex=i.datumIndex,a.bandwidth=n;const r=a.scaledValues;r.xValue=o.xValue,r.minValue=o.minValue,r.q1Value=o.q1Value,r.medianValue=o.medianValue,r.q3Value=o.q3Value,r.maxValue=o.maxValue;const l=Math.abs(o.q3Value-o.q1Value),c=o.xValue,h=Math.min(o.q3Value,o.q1Value)+l/2,d=s?c:h,u=s?h:c;a.midPoint?(a.midPoint.x=d,a.midPoint.y=u):a.midPoint={x:d,y:u};const p=a.focusRect;s?(p.x=d-n/2,p.y=o.minValue,p.width=n,p.height=o.maxValue-o.minValue):(p.x=o.minValue,p.y=u-n/2,p.width=o.maxValue-o.minValue,p.height=n)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}initializeResult(e){return{itemId:this.properties.xKey,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),visible:this.visible,groupScale:void 0,styles:void 0,segments:void 0}}populateNodeData(e){const t={xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},i={datumIndex:0,datum:void 0,scaledValues:t};for(let s=0;sthis.createNodeDatum(d,u),(d,u,p)=>this.updateNodeDatum(d,u,p)))}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndexJz(i.datumIndex)):e.datumSelection.update(t)}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,cap:{lengthRatio:s},fill:n,fillOpacity:o,lineDash:a,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,maxKey:d,maxName:u,medianKey:p,medianName:f,minKey:y,minName:x,q1Key:b,q1Name:v,q3Key:S,q3Name:M,whisker:{lineDash:D,lineDashOffset:I,stroke:k,strokeOpacity:A,strokeWidth:w},xKey:C,xName:T,yName:O}=this.properties,V=P9(e??Dw.None);return{cap:{lengthRatio:s},cornerRadius:i,fill:n,fillOpacity:o,highlightState:V,lineDash:a,lineDashOffset:r,maxKey:d,maxName:u??d,medianKey:p,medianName:f??p,minKey:y,minName:x??y,q1Key:b,q1Name:v??b,q3Key:S,q3Name:M??S,seriesId:t,stroke:l,strokeOpacity:c,strokeWidth:h,whisker:{lineDash:D??a,lineDashOffset:I??r,stroke:k??l,strokeOpacity:A??c,strokeWidth:w??h},xKey:C,xName:T??C,yName:O}}getStyle(e,t){const{cap:i,cornerRadius:s,fill:n,fillOpacity:o,lineDash:a,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,styler:d,whisker:u}=this.properties;let p={};if(!e&&d){const f=this.makeStylerParams(t);p=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(d,f)??{},{pick:!1})??{}}return{cornerRadius:p.cornerRadius??s,fill:p.fill??n,fillOpacity:p.fillOpacity??o,lineDash:p.lineDash??a,lineDashOffset:p.lineDashOffset??r,opacity:1,stroke:p.stroke??l,strokeOpacity:p.strokeOpacity??c,strokeWidth:p.strokeWidth??h,cap:{lengthRatio:p.cap?.lengthRatio??i.lengthRatio},whisker:{lineDash:p.whisker?.lineDash??u.lineDash,lineDashOffset:p.whisker?.lineDashOffset??u.lineDashOffset,stroke:p.whisker?.stroke??u.stroke,strokeOpacity:p.whisker?.strokeOpacity??u.strokeOpacity,strokeWidth:p.whisker?.strokeWidth??u.strokeWidth}}}getItemStyle(e,t,i){const{properties:s}=this,{itemStyler:n}=s,o=this.getHighlightStyle(t,e,i);let a=ce(o,this.getStyle(e===void 0,i));if(n!=null&&e!=null){const u=this.cachedDatumCallback(Jz(e,t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,t,a);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(n,p))});u&&(a=ce(u,a))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=a;return a.whisker=ce(a.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}),a}makeItemStylerParams(e,t,i){const{id:s}=this,{xKey:n,minKey:o,q1Key:a,medianKey:r,q3Key:l,maxKey:c}=this.properties,h=this.processedData?.dataSources.get(s)?.data[e],d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,t,e),p=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:h,xKey:n,minKey:o,q1Key:a,medianKey:r,q3Key:l,maxKey:c,highlightState:u,...i,fill:p}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,n)=>{const o=this.getHighlightState(i,t,n.datumIndex);n.style=this.getItemStyle(n.datumIndex,t,o)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const n=this.isVertical(),o=this.ctx.highlightManager.getActiveHighlight(),a=this.getShapeFillBBox(),r=this.getStyle(!1,Dw.None).strokeWidth/2,l=s.whisker.strokeWidth??s.strokeWidth;e.each((c,h)=>{const d=h.style??i.styles[this.getHighlightState(o,t,h.datumIndex)];c.setFillProperties(d.fill,a);const u=d.opacity??1,p=d.whisker?.strokeOpacity??d.strokeOpacity;c.fill=d.fill,c.fillOpacity=d.fillOpacity*u,c.stroke=d.stroke,c.strokeWidth=d.strokeWidth,c.strokeOpacity=d.strokeOpacity*u,c.lineDash=d.lineDash,c.lineDashOffset=d.lineDashOffset,c.wickStroke=d.whisker.stroke,c.wickStrokeWidth=d.whisker.strokeWidth,c.wickStrokeOpacity=p*u,c.wickLineDash=d.whisker.lineDash,c.wickLineDashOffset=d.whisker.lineDashOffset,c.cornerRadius=d.cornerRadius,c.crisp=!0,c.horizontal=!n,c.center=h.scaledValues.xValue,c.thickness=h.bandwidth,c.min=h.scaledValues.minValue,c.q1=h.scaledValues.q1Value,c.median=h.scaledValues.medianValue,c.q3=h.scaledValues.q3Value,c.max=h.scaledValues.maxValue,c.capLengthRatio=d.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new ji}computeFocusBounds({datumIndex:e}){return N9(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};Iw.className="BoxPlotSeries",Iw.type="box-plot";var{boxPlotSeriesThemeableOptionsDef:V9}=N,B9={...qe,...V9,type:j(Ce("box-plot")),xKey:j(L),minKey:j(L),q1Key:j(L),medianKey:j(L),q3Key:j(L),maxKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,minName:L,q1Name:L,medianName:L,q3Name:L,maxName:L,grouped:E,legendItemName:L,segmentation:Ia,width:un,widthRatio:oe},F9={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[oM,{$ref:"chartBackgroundColor"},.7]}]},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.5},unhighlightedSeries:{opacity:.1}},segmentation:Tl},axes:{number:{crosshair:{snap:!1}},category:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{predictCartesianNonPrimitiveAxis:_9}=N,kw={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,groupable:!0,version:de,dependencies:[hi],options:B9,matchingKeys:["xKey","lowKey","q1Key","medianKey","q3Key","highKey","outlierKey","normalizedTo"],predictAxis:_9,defaultAxes:$d,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:F9,create:e=>new Iw(e)};function H9(e,t,i,s,n,o,a,r){const[l,c]=ci(e,n);return Tr([l,c],t,i,s,{smallestKeyInterval:o,xNeedsValueOf:a,yNeedsValueOf:r})}var G9=zr(H9);function j9(e,t,i,s,n){const o=t.resolveKeysById(s,"xValue",i),a=t.resolveColumnById(s,"highValue",i),r=t.resolveColumnById(s,"lowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i);if(n){const[d,u]=ci(e,l);return Tr([d,u],o,a,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:n})}return G9(e,o,a,r,l,i.reduced?.smallestKeyInterval,c,h)}function W9(e,t,i,s,n,o){const a=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"highValue",i),l=t.resolveColumnById(s,"lowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"highValue",i)??t.resolveColumnNeedsValueOf(s,"lowValue",i),[u,p]=ci(e,c);return Vg([u,p],a,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:n,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:o})}var{Path:$9,BBox:K9}=N,xl=class extends $9{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}setStaticProperties(e,t,i,s,n,o,a){this.__centerX=e,this.__width=t,this.__y=i,this.__height=s,this.__yOpen=n,this.__yClose=o,this.__crisp=a,this.dirtyPath=!0,this.markDirty()}computeBBox(){const{__centerX:e,__y:t,__width:i,__height:s}=this;return new K9(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.__centerX,y:this.__y+this.__height/2}}alignedCoordinates(){const{__y:e,__width:t,__height:i,__crisp:s}=this;let{__centerX:n,__yOpen:o,__yClose:a}=this,r=n-t/2,l=n+t/2,c=e,h=e+i;if(s&&t>1){if(n=this.align(n),o<=a){const u=this.align(o,a-o);o=this.align(o),a=o+u}else{const u=this.align(a,o-a);a=this.align(a),o=a+u}const d=this.align(t/2);r=n-d,l=n+d,c=this.align(e),h=c+this.align(c,i)}return{centerX:n,x0:r,x1:l,y0:c,y1:h,yOpen:o,yClose:a}}executeStroke(e,t){const{__width:i,strokeWidth:s}=this;i0?l/this.__strokeAlignment/2%1:0;e.clear(),e.moveTo(t-c,n),e.lineTo(t-c,o),Math.abs(s-i)>1&&(e.moveTo(i,a-c),e.lineTo(t-c,a-c),e.moveTo(t-c,r-c),e.lineTo(s,r-c))}};g([Ee()],tV.prototype,"strokeAlignment",2);var U9=Zs,Y9=Qs,Z9=qs,iV=Xs,sV=jn,{AggregationManager:X9,fixNumericExtent:q9,keyProperty:Q9,createDatumId:Aw,SeriesNodePickMode:nV,SMALLEST_KEY_INTERVAL:J9,valueProperty:tS,diff:e8,animationValidation:t8,computeBarFocusBounds:i8,visibleRangeIndices:oV,BandScale:s8,processedDataIsAnimatable:ww,getItemStylesPerItemId:n8}=N,o8=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}};function a8(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const n of i){const o=n.datum;o!=null&&n.setStaticProperties(o.centerX,o.width,o.y,o.height,o.yOpen,o.yClose,o.crisp)}t.cleanup()})}}var aV=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[nV.AXIS_ALIGNED,nV.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=o8,this.aggregationManager=new X9}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:n,lowKey:o}=this.properties,a=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];this.needsDataModelDiff()&&this.processedData&&u.push(e8(this.id,this.processedData)),a&&u.push(t8()),i&&u.push(tS(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const p=this.properties.allowNullKeys??!1,{dataModel:f,processedData:y}=await this.requestDataModel(e,this.data,{props:[Q9(t,h,{id:"xValue",allowNullKey:p}),tS(s,d,{id:"closeValue"}),tS(n,d,{id:"highValue"}),tS(o,d,{id:"lowValue"}),...c?[J9]:[],...u]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.aggregateData(f,y),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||ww(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>W9(i.scale.type,e,t,this,s,o),computeFull:o=>j9(i.scale.type,e,t,this,o),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&yo.record(`${this.type}:aggregation`,n.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(!e)return-1;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{def:n}=i.resolveProcessedDataDefById(this,"xValue"),o=i.getDomain(this,"xValue","key",t);return n.type==="key"&&n.valueType==="category"?o:{domain:this.padBandExtent(o.domain)}}const s=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return{domain:q9(s)}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["highValue","lowValue"],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}buildDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources.get(this.id)?.data??[];if(n.length===0)return;const o=e.scale,a=t.scale,r=s8.is(o),[l,c]=o.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const d=this.aggregationManager.getFilterForRange(h),u=d==null,p=this.contextNodeData?.nodeData!=null&&(s.changeDescription!=null||!ww(s)||d!=null),{groupOffset:f,barOffset:y,barWidth:x}=this.getBarDimensions();return{rawData:n,xValues:i.resolveKeysById(this,"xValue",s),openValues:i.resolveColumnById(this,"openValue",s),closeValues:i.resolveColumnById(this,"closeValue",s),highValues:i.resolveColumnById(this,"highValue",s),lowValues:i.resolveColumnById(this,"lowValue",s),xScale:o,yScale:a,xAxis:e,yAxis:t,groupOffset:f,barOffset:y,barWidth:x,applyWidthOffset:r,crisp:u,xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey,dataAggregationFilter:d,range:h,nodeDatumStateScratch:{datum:void 0,xValue:void 0,openValue:0,closeValue:0,highValue:0,lowValue:0,isRising:!0,itemType:"up"},canIncrementallyUpdate:p,nodeIndex:0,nodeData:p?this.contextNodeData.nodeData:[]}}prepareOhlcNodeDatumState(e,t){const i=e.xValues[t];if(i===void 0&&!this.properties.allowNullKeys)return;const s=e.openValues[t],n=e.closeValues[t],o=e.highValues[t],a=e.lowValues[t],r=a!=null&&a<=s&&a<=n,l=o!=null&&o>=s&&o>=n;if(!r){W.warnOnce(`invalid low value for key [${e.lowKey}] in data element, low value cannot be higher than datum open or close values`);return}if(!l){W.warnOnce(`invalid high value for key [${e.highKey}] in data element, high value cannot be lower than datum open or close values.`);return}const c=e.rawData[t],h=n>s,d=h?"up":"down",u=e.nodeDatumStateScratch;return u.datum=c,u.xValue=i,u.openValue=s,u.closeValue=n,u.highValue=o,u.lowValue=a,u.isRising=h,u.itemType=d,u}createSkeletonNodeDatum(e,t,i,s,n,o){const a=e.applyWidthOffset?n/2:0,r=s+a,l=e.yScale.convert(t.openValue),c=e.yScale.convert(t.closeValue),h=e.yScale.convert(t.highValue),d=e.yScale.convert(t.lowValue),u=Math.min(h,d),p=Math.max(h,d)-u;return{series:this,itemType:t.itemType,datum:t.datum,datumIndex:i,xKey:e.xKey,xValue:t.xValue,openValue:t.openValue,closeValue:t.closeValue,highValue:t.highValue,lowValue:t.lowValue,midPoint:{x:r,y:u+p/2},aggregatedValue:t.closeValue,isRising:t.isRising,centerX:r,width:n,y:u,height:p,yOpen:l,yClose:c,crisp:o}}updateNodeDatum(e,t,i,s,n,o,a){const r=t,l=e.applyWidthOffset?o/2:0,c=n+l,h=e.yScale.convert(i.openValue),d=e.yScale.convert(i.closeValue),u=e.yScale.convert(i.highValue),p=e.yScale.convert(i.lowValue),f=Math.min(u,p),y=Math.max(u,p)-f;r.datum=i.datum,r.datumIndex=s,r.itemType=i.itemType,r.xValue=i.xValue,r.openValue=i.openValue,r.closeValue=i.closeValue,r.highValue=i.highValue,r.lowValue=i.lowValue,r.aggregatedValue=i.closeValue,r.isRising=i.isRising,r.centerX=c,r.width=o,r.y=f,r.height=y,r.yOpen=h,r.yClose=d,r.crisp=a;const x=r.midPoint;x.x=c,x.y=f+y/2}upsertNodeDatum(e,t,i,s,n){const o=this.prepareOhlcNodeDatumState(e,t);if(!o)return;if(e.canIncrementallyUpdate&&e.nodeIndex{const r=s.xScale.convert(s.xValues[a]);return Number.isFinite(r)?r+s.groupOffset+(s.applyWidthOffset?s.barOffset:0):Number.NaN};if(s.dataAggregationFilter==null){const a=this.processedData.invalidData?.get(this.id);let[r,l]=oV(1,s.rawData.length,s.xAxis.range,c=>{const h=s.applyWidthOffset?0:-s.barWidth/2,d=o(c)+h;return[d,d+s.barWidth]});this.processedData.input.count<1e3&&(r=0,l=this.processedData.input.count);for(let c=r;c{const u=d*sV,p=r[u+iV],f=l[d];if(f===-1)return;const y=s.applyWidthOffset?0:-s.barWidth/2;return[o(f)+y,o(p)+y+s.barWidth]});for(let d=c;dv.openValue,v.itemType=v.isRising?"up":"down";const S=o(b),M=Math.abs(o(f)-o(p))+s.barWidth;if(s.canIncrementallyUpdate&&s.nodeIndexAw(i.xValue)):e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemStyle(e,t,i,s="up"){const{properties:n,dataModel:o,processedData:a}=this,{itemStyler:r}=n,l=this.getHighlightStyle(t,e,i);let h=ce(l,n.getStyle(s));if(r&&o!=null&&a!=null&&e!=null){const d=o.resolveKeysById(this,"xValue",a)[e],u=this.cachedDatumCallback(Aw(Aw(d),t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(s,e,t,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",s],this.callWithContext(r,p))});u&&(h=ce(u,h))}return h}makeItemStylerParams(e,t,i,s){const{id:n,properties:o,processedData:a}=this,{xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:d}=o,u=a.dataSources.get(n)?.data[t],p=this.ctx.highlightManager?.getActiveHighlight(),f=this.getHighlightStateString(p,i,t),y={seriesId:n,datum:u,itemType:e,xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:d,highlightState:f,...s};return"fill"in y&&"fill"in s&&(y.fill=this.filterItemStylerFillParams(s.fill)??s.fill),y}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:f,closeName:y,legendItemName:x,tooltip:b}=n,v=this.getCategoryAxis(),S=this.getValueAxis();if(!i||!s||!v||!S)return;const M=s.dataSources.get(this.id)?.data[e],D=i.resolveKeysById(this,"xValue",s)[e],I=i.resolveColumnById(this,"openValue",s)[e],k=i.resolveColumnById(this,"highValue",s)[e],A=i.resolveColumnById(this,"lowValue",s)[e],w=i.resolveColumnById(this,"closeValue",s)[e],C=this.properties.allowNullKeys??!1;if(D===void 0&&!C)return;const T=w>=I?"up":"down",O=this.properties.item[T],V=this.getItemStyle(e,!1),z={fill:O.fill??O.stroke,fillOpacity:O.fillOpacity??O.strokeOpacity??1,stroke:O.stroke,strokeWidth:O.strokeWidth??1,strokeOpacity:O.strokeOpacity??1,lineDash:O.lineDash??[0],lineDashOffset:O.lineDashOffset??0};return this.formatTooltipWithContext(b,{heading:this.getAxisValueText(v,"tooltip",D,M,o,x),title:x,symbol:{marker:z},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",I,M,l,x),missing:N.isTooltipValueMissing(I)},{label:d,fallbackLabel:h,value:this.getAxisValueText(S,"tooltip",k,M,h,x),missing:N.isTooltipValueMissing(k)},{label:p,fallbackLabel:u,value:this.getAxisValueText(S,"tooltip",A,M,u,x),missing:N.isTooltipValueMissing(A)},{label:y,fallbackLabel:f,value:this.getAxisValueText(S,"tooltip",w,M,f,x),missing:N.isTooltipValueMissing(w)}]},{seriesId:t,datum:M,title:r,itemType:T,xKey:o,xName:a,yName:r,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:f,closeName:y,...V})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:n,height:o}=t,a={x:i-n/2,y:s,width:n,height:o};return i8(this,a)}},{ExtendedPath2D:r8,BBox:l8}=N,od=class extends xl{constructor(){super(...arguments),this.wickPath=new r8,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}setWickProperties(e,t,i,s,n){this.__wickStroke=e,this.__wickStrokeWidth=t,this.__wickStrokeOpacity=i,this.wickLineDash=s,this.__wickLineDashOffset=n,this.dirtyPath=!0,this.markDirty()}computeDefaultGradientFillBBox(){const{__width:e,__centerX:t,__yOpen:i,__yClose:s}=this,n=Math.min(i,s),a=Math.max(i,s)-n,r=t-e/2,l=t+e/2;return new l8(r,n,l-r,a)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,__wickStroke:a,__wickStrokeWidth:r,__wickStrokeOpacity:l,wickLineDash:c,__wickLineDashOffset:h}=this,{centerX:d,x0:u,x1:p,y0:f,y1:y,yOpen:x,yClose:b}=this.alignedCoordinates(),v=this.layerManager?.canvas.pixelRatio??1,S=this.__wickStrokeAlignment>0?v/this.__wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const D=a!=null&&a!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==n||h!=null&&h!==o?this.wickPath:e;if(Math.abs(p-u)<=3){D.moveTo(d-S,f),D.lineTo(d-S,y);return}const I=Math.min(x,b),k=Math.max(x,b),A=i/2;D.moveTo(d-S,f),D.lineTo(d-S,I+A),D.moveTo(d-S,y),D.lineTo(d-S,k-A);const w=k-I-2*A;if(w>0)e.rect(u+A,I+A,p-u-2*A,w);else{const C=(I+k)/2;e.moveTo(u,C),e.lineTo(p,C)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,__wickStroke:r=i,__wickStrokeWidth:l=s,__wickStrokeOpacity:c=n,wickLineDash:h=o,__wickLineDashOffset:d=a}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};g([Ee()],od.prototype,"wickStroke",2),g([Ee()],od.prototype,"wickStrokeWidth",2),g([Ee()],od.prototype,"wickStrokeOpacity",2),g([ku()],od.prototype,"wickLineDash",2),g([Ee()],od.prototype,"wickLineDashOffset",2),g([Ee()],od.prototype,"wickStrokeAlignment",2);var{AbstractBarSeriesProperties:c8,makeSeriesTooltip:h8}=N,ad=class extends q{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],ad.prototype,"stroke",2),g([m],ad.prototype,"strokeWidth",2),g([m],ad.prototype,"strokeOpacity",2),g([m],ad.prototype,"lineDash",2),g([m],ad.prototype,"lineDashOffset",2);var Cw=class extends q{constructor(){super(...arguments),this.up=new ad,this.down=new ad}};g([m],Cw.prototype,"up",2),g([m],Cw.prototype,"down",2);var ao=class extends c8{};g([m],ao.prototype,"xKey",2),g([m],ao.prototype,"openKey",2),g([m],ao.prototype,"closeKey",2),g([m],ao.prototype,"highKey",2),g([m],ao.prototype,"lowKey",2),g([m],ao.prototype,"xName",2),g([m],ao.prototype,"yName",2),g([m],ao.prototype,"openName",2),g([m],ao.prototype,"closeName",2),g([m],ao.prototype,"highName",2),g([m],ao.prototype,"lowName",2);var iS=class extends ao{constructor(){super(...arguments),this.tooltip=h8(),this.item=new Cw}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:s,lineDash:n,lineDashOffset:o}=this.item[e];return{stroke:s,strokeWidth:t,strokeOpacity:i,lineDash:n,lineDashOffset:o,opacity:1}}};g([m],iS.prototype,"tooltip",2),g([m],iS.prototype,"item",2),g([m],iS.prototype,"itemStyler",2);var{makeSeriesTooltip:d8}=N,Gp=class extends q{};g([m],Gp.prototype,"stroke",2),g([m],Gp.prototype,"strokeWidth",2),g([m],Gp.prototype,"strokeOpacity",2),g([m],Gp.prototype,"lineDash",2),g([m],Gp.prototype,"lineDashOffset",2);var ga=class extends q{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Gp}};g([m],ga.prototype,"fill",2),g([m],ga.prototype,"fillOpacity",2),g([m],ga.prototype,"stroke",2),g([m],ga.prototype,"strokeWidth",2),g([m],ga.prototype,"strokeOpacity",2),g([m],ga.prototype,"lineDash",2),g([m],ga.prototype,"lineDashOffset",2),g([m],ga.prototype,"cornerRadius",2),g([m],ga.prototype,"wick",2);var Lw=class extends q{constructor(){super(...arguments),this.up=new ga,this.down=new ga}};g([m],Lw.prototype,"up",2),g([m],Lw.prototype,"down",2);var sS=class extends ao{constructor(){super(...arguments),this.item=new Lw,this.tooltip=d8()}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:s,strokeOpacity:n,stroke:o,lineDash:a,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[e];return{fill:t,fillOpacity:i,stroke:o,strokeWidth:s,strokeOpacity:n,lineDash:a,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};g([m],sS.prototype,"item",2),g([m],sS.prototype,"tooltip",2),g([m],sS.prototype,"itemStyler",2);var Nw=class extends aV{constructor(){super(...arguments),this.properties=new sS}nodeFactory(){const e=new od;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight(),{up:o,down:a}=s.item,r=this.getShapeFillBBox(),l=this;e.each(function(h,d){const{centerX:u,width:p,y:f,height:y,yOpen:x,yClose:b,crisp:v}=d,S=d.isRising?o:a,M=l.getHighlightState(n,t,d.datumIndex),D=d.style??i.styles[d.itemType][M];h.setStaticProperties(u,p,f,y,x,b,v),h.setStyleProperties(D,r);const I=D?.wick;h.setWickProperties(I?.stroke,I?.strokeWidth,I?.strokeOpacity,I?.lineDash,I?.lineDashOffset),h.wickStrokeAlignment=S.wick.strokeWidth??S.strokeWidth})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=qt(e.fill)?e.fill.colorStops.map(a=>typeof a=="string"?a:{color:a.color,stop:a.stop==null?void 0:a.stop*.5}):[{color:Un(e.fill)||ea(e.fill)?e.stroke:e.fill,stop:0},{color:Un(e.fill)||ea(e.fill)?e.stroke:e.fill,stop:.5}],s=qt(t.fill)?t.fill.colorStops.map(a=>typeof a=="string"?a:{color:a.color,stop:a.stop==null?void 0:a.stop*.5}):[{color:Un(t.fill)||ea(t.fill)?t.stroke:t.fill,stop:.5}],n={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...s],reverse:!1},o={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:n,fillOpacity:e.fillOpacity,stroke:o,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:n}}=this,{xKey:o,yName:a,showInLegend:r,legendItemName:l}=this.properties;return!i?.data.length||!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&n.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??a??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};Nw.className="CandleStickSeries",Nw.type="candlestick";var{candlestickSeriesThemeableOptionsDef:u8}=N,Tw={...qe,...u8,type:j(Ce("candlestick")),xKey:j(L),openKey:j(L),highKey:j(L),lowKey:j(L),closeKey:j(L),xName:L,yName:L,openName:L,highName:L,lowName:L,closeName:L,xKeyAxis:L,yKeyAxis:L};Tw.pickOutsideVisibleMinorAxis=Q(E),Tw.focusPriority=Q($);function rV(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",Ny(e)],["image",it],["pattern",Ey(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}var p8={series:{item:{up:rV("up"),down:rV("down")},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Ys},animation:{enabled:!1},axes:{number:{crosshair:{snap:!1}},"ordinal-time":{groupPaddingInner:0,crosshair:{enabled:!0}}}},{predictCartesianFinancialAxis:g8}=N,nS={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,groupable:!1,version:de,dependencies:[hi],options:Tw,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:g8,defaultAxes:{y:{type:"number",position:"left"},x:{type:"ordinal-time",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:p8,create:e=>new Nw(e)},{CartesianSeriesProperties:f8,makeSeriesTooltip:m8}=N,ts=class extends f8{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new Dp,this.tooltip=m8()}};g([m],ts.prototype,"title",2),g([m],ts.prototype,"xKey",2),g([m],ts.prototype,"yKey",2),g([m],ts.prototype,"colorKey",2),g([m],ts.prototype,"xName",2),g([m],ts.prototype,"yName",2),g([m],ts.prototype,"colorName",2),g([m],ts.prototype,"colorRange",2),g([m],ts.prototype,"stroke",2),g([m],ts.prototype,"strokeOpacity",2),g([m],ts.prototype,"strokeWidth",2),g([m],ts.prototype,"textAlign",2),g([m],ts.prototype,"verticalAlign",2),g([m],ts.prototype,"itemPadding",2),g([m],ts.prototype,"itemStyler",2),g([m],ts.prototype,"label",2),g([m],ts.prototype,"tooltip",2);var{SeriesNodePickMode:lV,computeBarFocusBounds:y8,getMissCount:x8,valueProperty:Ow,DEFAULT_CARTESIAN_DIRECTION_KEYS:b8,DEFAULT_CARTESIAN_DIRECTION_NAMES:v8,createDatumId:S8,ColorScale:M8,Rect:D8,PointerEvents:I8,addHitTestersToQuadtree:k8,findQuadtreeMatch:cV,updateLabelNode:A8,upsertNodeDatum:w8}=N,C8=class extends N.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},L8={left:-.5,center:0,right:-.5},N8={top:-.5,middle:0,bottom:-.5},Pw=class extends N.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...b8,color:["colorKey"]},propertyNames:{...v8,color:["colorName"]},categoryKey:void 0,pickModes:[lV.NEAREST_NODE,lV.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new ts,this.NodeEvent=C8,this.colorScale=new M8}async processData(e){const t=this.axes.x,i=this.axes.y;if(!t||!i)return;const{xKey:s,yKey:n,colorRange:o,colorKey:a}=this.properties,r=this.axes.x?.scale,l=this.axes.y?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,u=this.properties.allowNullKeys??!1,{dataModel:p,processedData:f}=await this.requestDataModel(e,this.data,{props:[Ow(s,c,{id:"xValue",allowNullKey:u}),Ow(n,h,{id:"yValue",allowNullKey:u}),...a?[Ow(a,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const y=p.resolveProcessedDataIndexById(this,"colorValue"),x=f.domain.values[y].filter(v=>v!=null),b=Qo(x);if(this.colorScale.domain=b??[],b?.length&&b[0]===b[1]){const v=Math.floor(o.length/2);this.colorScale.range=[o[v],o[v]]}else this.colorScale.range=o;this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=x8(this,i.defs.values[s].missing),a=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[a].filter(c=>c!=null).length;return!(n===0||n===o||r===0)}xCoordinateRange(e,t){const i=this.axes.x.scale,s=t*(i.bandwidth??0)/2,n=i.convert(e)+s,o=t*(i.bandwidth??10);return[n,n+o]}yCoordinateRange(e,t){const i=this.axes.y.scale,s=t*(i.bandwidth??0)/2,n=i.convert(e[0])+s,o=t*(i.bandwidth??10);return[n,n+o]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?{domain:[]}:e==="x"?{domain:t.getDomain(this,"xValue","value",i).domain}:{domain:t.getDomain(this,"yValue","value",i).domain}}getSeriesRange(){return[Number.NaN,Number.NaN]}validateCreateNodeDataPreconditions(){const e=super.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e;if(t.type!=="category"||i.type!=="category"){W.warnOnce(`Heatmap series expected axes to have "category" type, but received "${t.type}" and "${i.type}" instead.`);return}return e}populateNodeData(e){for(const[t,i]of e.rawData.entries()){const s=w8(e,{datumIndex:t,datum:i},(n,o)=>this.createNodeDatum(n,o.datumIndex,o.datum),(n,o,a)=>this.updateNodeDatum(n,o,a.datumIndex,a.datum));if(s){const n=this.createLabelDatum(e,t,i,s);n&&e.labels.push(n)}}}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible}}createNodeDatumContext(e,t){const{dataModel:i,processedData:s,contextNodeData:n}=this;if(!i||!s)return;const{xKey:o,xName:a,yKey:r,yName:l,colorKey:c,colorName:h,textAlign:d,verticalAlign:u,itemPadding:p}=this.properties,f=e.scale,y=t.scale,x=i.resolveColumnById(this,"xValue",s),b=i.resolveColumnById(this,"yValue",s),v=c?i.resolveColumnById(this,"colorValue",s):void 0,S=c?i.getDomain(this,"colorValue","value",s).domain:[],M=f.bandwidth??10,D=y.bandwidth??10,I=s.dataSources.get(this.id)?.data??[],k=n?.nodeData!=null&&s.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:f,yScale:y,rawData:I,xValues:x,xKey:o,yKey:r,xName:a,yName:l,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:k,nodes:k?n.nodeData:[],nodeIndex:0,xOffset:(f.bandwidth??0)/2,yOffset:(y.bandwidth??0)/2,width:M,height:D,textAlignFactor:(M-2*p)*L8[d],verticalAlignFactor:(D-2*p)*N8[u],yValues:b,colorKey:c,colorName:h,colorValues:v,colorDomain:S,itemPadding:p,labels:[],labelIndex:0}}createSkeletonNodeDatum(e,t,i){const{xKey:s,yKey:n,width:o,height:a,colorValues:r}=e,l=e.xValues[t],c=e.yValues[t],h=r?.[t];return{series:this,datumIndex:t,yKey:n,xKey:s,xValue:l,yValue:c,colorValue:h,datum:i,point:{x:0,y:0,size:0},width:o,height:a,midPoint:{x:0,y:0},missing:r!=null&&h==null,style:{}}}updateNodeDatum(e,t,i,s){const{xScale:n,yScale:o,xOffset:a,yOffset:r,width:l,height:c,xKey:h,yKey:d,colorValues:u}=e,p=t,f=e.xValues[i],y=e.yValues[i],x=n.convert(f)+a,b=o.convert(y)+r;if(!Number.isFinite(x)||!Number.isFinite(b))return;const v=u?.[i];p.datumIndex=i,p.datum=s,p.yKey=d,p.xKey=h,p.xValue=f,p.yValue=y,p.colorValue=v,p.width=l,p.height=c,p.missing=u!=null&&v==null;const S=p.point;S.x=x,S.y=b,S.size=0,p.midPoint.x=x,p.midPoint.y=b,p.style=this.getItemStyle({datumIndex:i,datum:s,colorValue:v},!1)}createNodeDatum(e,t,i){const{xScale:s,yScale:n,xOffset:o,yOffset:a}=e,r=e.xValues[t],l=e.yValues[t],c=s.convert(r)+o,h=n.convert(l)+a;if(!Number.isFinite(c)||!Number.isFinite(h))return;const d=this.createSkeletonNodeDatum(e,t,i);return this.updateNodeDatum(e,d,t,i),d}createLabelDatum(e,t,i,s){const{label:n}=this.properties,{width:o,height:a,textAlignFactor:r,verticalAlignFactor:l,itemPadding:c,colorKey:h,colorName:d,colorDomain:u,xKey:p,yKey:f,xName:y,yName:x}=e,b=e.colorValues?.[t],v=n.enabled&&b!=null?this.getLabelText(b,i,h,"color",u,n,{value:b,datum:i,colorKey:h,colorName:d,xKey:p,yKey:f,xName:y,yName:x}):void 0,S=()=>({width:o,height:a,meta:null}),M=DA(Oe(v),this.properties.label,void 0,this.properties.label,{padding:c},S);if(M?.label==null)return;const{text:D,fontSize:I,lineHeight:k,height:A}=M.label,{fontStyle:w,fontFamily:C,fontWeight:T,color:O}=this.properties.label,{textAlign:V,verticalAlign:z}=this.properties,R=s.point.x+r*(o-2*c),B=s.point.y+l*(a-2*c)-(M.height-A)*.5;return{series:this,datum:i,datumIndex:t,text:D,fontSize:I,lineHeight:k,fontStyle:w,fontFamily:C,fontWeight:T,color:O,textAlign:V,textBaseline:z,x:R,y:B,style:s.style}}nodeFactory(){return new D8}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle({datumIndex:e,datum:t,colorValue:i},s,n){const{properties:o}=this,{itemStyler:a,stroke:r,strokeWidth:l,strokeOpacity:c}=o,h=this.getHighlightStyle(s,e,n),d=ce(h,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:r,strokeWidth:l,strokeOpacity:c,opacity:1});let u;return a!=null&&e!=null&&(u=this.cachedDatumCallback(S8(e,s?"highlight":"node"),()=>{const p=this.makeItemStylerParams(t,e,s,d);return this.callWithContext(a,p)})),u?ce(u,d):d}makeItemStylerParams(e,t,i,s){const{id:n,properties:o}=this,{xKey:a,yKey:r}=o,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,xKey:a,yKey:r,highlightState:c,...s,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager?.getActiveHighlight();e.each((s,n)=>{const o=this.getHighlightState(i,t,n.datumIndex);n.style=this.getItemStyle(n,t,o)})}updateDatumNodes({datumSelection:e}){const t=this.axes.x,[i,s]=t?.visibleRange??[],o=!(i!==0||s!==1);e.each((a,r)=>{const{point:l,width:c,height:h,style:d}=r;a.setStyleProperties(d),a.crisp=o,a.x=l.x-c/2,a.y=l.y-h/2,a.width=c,a.height=h})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,n=s?t:[];return i.update(n)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,n)=>{s.pointerEvents=I8.None,s.text=n.text,s.fillOpacity=this.getHighlightStyle(t,n.datumIndex)?.opacity??1,A8(this,s,this.properties,this.properties.label,n,t,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o,colorScale:a,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:f,colorRange:y,title:x,legendItemName:b,tooltip:v}=o,S=n.x,M=n.y;if(!i||!s||!S||!M)return;const D=s.dataSources.get(this.id)?.data[e],I=i.resolveColumnById(this,"xValue",s)[e],k=i.resolveColumnById(this,"yValue",s)[e],A=p!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[e]:void 0,w=this.properties.allowNullKeys??!1;if(I===void 0&&!w)return;const C=[];let T;if(A==null)T=y[0];else{T=a.convert(A);const z=i.getDomain(this,"colorValue","value",s).domain,R=l.format(this.callWithContext.bind(this),{type:"number",value:A,datum:D,seriesId:t,legendItemName:b,key:p,source:"tooltip",property:"color",domain:z,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});C.push({label:f,fallbackLabel:p,value:R??Ao(A)})}C.push({label:h,fallbackLabel:c,value:this.getAxisValueText(S,"tooltip",I,D,c,b)},{label:u,fallbackLabel:d,value:this.getAxisValueText(M,"tooltip",k,D,d,b)});const O=this.getItemStyle({datumIndex:e,datum:D,colorValue:A},!1);O.fill!=null&&(T=O.fill);const V=T==null?void 0:{marker:{shape:"square",fill:T,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(v,{title:x??b,symbol:V,data:C},{seriesId:t,datum:D,title:x,xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:f,...O})}getLegendData(e){return e!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:s,midPoint:n}=t,o={x:n.x-i/2,y:n.y-s/2,width:i,height:s};return y8(this,o)}initQuadTree(e){k8(e,this.datumNodesIter())}pickNodesExactShape(e){const t=cV(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return cV(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null||this.isColorScaleValid()}};Pw.className="HeatmapSeries",Pw.type="heatmap";var{heatmapSeriesThemeableOptionsDef:T8}=N,O8={...ee(T8,["showInLegend"]),...ee(qe,["showInLegend"]),type:j(Ce("heatmap")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,colorKey:L,xName:L,yName:L,colorName:L,colorRange:xe(J)},hV={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},label:{...Ye,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.6}}},gradientLegend:{enabled:!0}};hV.series.colorRange={$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},Nl]};var Ew={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,version:de,dependencies:[hi],options:O8,defaultAxes:{y:{type:"category",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:hV,create:e=>new Pw(e)},Rw=class extends aV{constructor(){super(...arguments),this.properties=new iS}nodeFactory(){const e=new tV;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const n=this.ctx.highlightManager.getActiveHighlight(),{up:o,down:a}=s.item,r=this;e.each(function(c,h){const{centerX:d,width:u,y:p,height:f,yOpen:y,yClose:x,crisp:b}=h,v=h.isRising?o:a;c.setStaticProperties(d,u,p,f,y,x,b);const S=h.style??i.styles[h.itemType][r.getHighlightState(n,t,h.datumIndex)];c.setStyleProperties(S),c.strokeAlignment=v.strokeWidth})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:s},visible:n}=this,{xKey:o,yName:a,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.data.length||!o||e!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:n&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??a??t},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};Rw.className="ohlc",Rw.type="ohlc";var{ohlcSeriesThemeableOptionsDef:P8}=N,zw={...qe,...P8,type:j(Ce("ohlc")),xKey:j(L),openKey:j(L),highKey:j(L),lowKey:j(L),closeKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,openName:L,highName:L,lowName:L,closeName:L};zw.pickOutsideVisibleMinorAxis=Q(E),zw.focusPriority=Q($);var{predictCartesianFinancialAxis:E8}=N,R8={animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Ys},axes:{number:{crosshair:{snap:!1}},"ordinal-time":{groupPaddingInner:0,crosshair:{enabled:!0}}}},oS={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,version:de,dependencies:[hi],options:zw,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:E8,defaultAxes:{y:{type:"number",position:"left"},x:{type:"ordinal-time",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:R8,create:e=>new Rw(e)};function z8(e,t,i,s,n,o,a,r){const[l,c]=ci(e,n);return Tr([l,c],t,i,s,{smallestKeyInterval:o,xNeedsValueOf:a,yNeedsValueOf:r})}var V8=zr(z8);function B8(e,t,i,s,n){const o=t.resolveKeysById(s,"xValue",i),a=t.resolveColumnById(s,"yHighValue",i),r=t.resolveColumnById(s,"yLowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i);if(n){const[d,u]=ci(e,l);return Tr([d,u],o,a,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:n})}return V8(e,o,a,r,l,i.reduced?.smallestKeyInterval,c,h)}function F8(e,t,i,s,n,o){const a=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i),l=t.resolveColumnById(s,"yLowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),[u,p]=ci(e,c);return Vg([u,p],a,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:n,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:o})}function dV({span:e},t){switch(e.type){case"linear":case"step":case"multi-line":{const i=(t-e.x0)/(e.x1-e.x0);return e.y0+i*(e.y1-e.y0)}case"cubic":{const{cp0x:i,cp0y:s,cp1x:n,cp1y:o,cp2x:a,cp2y:r,cp3x:l,cp3y:c}=e;let h=.5;const d=1e-6;for(let p=0;p<10;p++){const f=1-h,x=f*f*f*i+3*f*f*h*n+3*f*h*h*a+h*h*h*l-t;if(Math.abs(x)=o.x&&t<=a.x)return{span:n,index:s};if(tl;return{intersection:s===c?null:{x:i,y:r},spanIndex:o.index,isInverted:c}}function H8(e,t,i,s,n=!1){if(e.length===0||t.length===0)return[];const o=[];let a=n,r=0;for(let l=i;l<=s;l+=.5){const c=_8(e,t,l,a,r);c.intersection&&o.push(c.intersection.x),r=c.spanIndex,a=c.isInverted}return o}function G8(e,t,i,s,n={}){const o=Math.max(t.x,i.width-(t.x+t.width)),a=Math.max(t.y,i.height-(t.y+t.height)),r=[],l=(h,d)=>({x0:h,y0:-a,x1:d,y1:t.height+a});s&&r.push({clipRect:l(-o,e[0]??t.width+o),...n});const c=s?1:0;for(let h=c;h{jp(l,c,t.removed),jp(l,c,i.removed)},o=(l,c)=>{jp(l,c,t.moved),jp(l,c,i.moved)},a=(l,c)=>{jp(l,c,t.added),jp(l,c,i.added)},r=Z8(e,s);return{status:e,path:{addPhaseFn:a,updatePhaseFn:o,removePhaseFn:n},pathProperties:r}}function q8(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!Kl(e.scales.x)||!Kl(t.scales.x))return;let o="updated";t.visible&&!e.visible?o="removed":!t.visible&&e.visible&&(o="added");const a=lS({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},rS.Split);if(a==null)return;const r=lS({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},rS.Split);if(r==null)return;const l=lS({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},rS.Split);if(l==null)return;const c=lS({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},rS.Split);if(c==null)return;const h="fade",d=Y8(o,a,r,h),u=X8(o,l,c,h),p=(i?.changed??!0)||!ia(e.scales.x,t.scales.x)||!ia(e.scales.y,t.scales.y)||o!=="updated";return{status:o,fill:d,stroke:u,hasMotion:p}}var Q8=Qs,J8=qs,eQ=jn,{valueProperty:pV,keyProperty:tQ,updateLabelNode:iQ,fixNumericExtent:gV,buildResetPathFn:sQ,resetLabelFn:nQ,resetMarkerFn:oQ,resetMarkerPositionFn:fV,pathSwipeInAnimation:aQ,resetMotion:rQ,markerSwipeScaleInAnimation:lQ,seriesLabelFadeInAnimation:Fw,animationValidation:cQ,diff:hQ,updateClipPath:_w,computeMarkerFocusBounds:mV,plotAreaPathFill:dQ,plotLinePathStroke:yV,interpolatePoints:xV,pathFadeInAnimation:Hw,markerFadeInAnimation:bV,fromToMotion:Gw,pathMotion:jw,PointerEvents:cS,Marker:uQ,BBox:pQ,processedDataIsAnimatable:Ww,markerEnabled:gQ,getMarkerStyles:fQ,calculateSegments:mQ,toHighlightString:yQ,HighlightState:xQ,AggregationManager:bQ,resetMarkerSelectionsDirect:vQ,createDatumId:SQ,visibleRangeIndices:vV}=N,MQ=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},$w=class extends N.CartesianSeries{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[N.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:sQ({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:nQ,datum:(t,i)=>({...oQ(t),...fV(t,i)})},clipFocusBox:!1}),this.properties=new Kt,this.NodeEvent=MQ,this.aggregationManager=new bQ}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,n=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:a,yScaleType:r}=this.getScaleInformation({xScale:n,yScale:o}),l=[],c=!this.ctx.animationManager.isSkipped();this.needsDataModelDiff()&&this.processedData&&l.push(hQ(this.id,this.processedData)),c&&l.push(cQ());const h=this.properties.allowNullKeys??!1,{dataModel:d,processedData:u}=await this.requestDataModel(e,this.data,{props:[tQ(t,a,{id:"xValue",allowNullKey:h}),pV(i,r,{id:"yLowValue"}),pV(s,r,{id:"yHighValue"}),...l]});this.aggregateData(d,u),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||Ww(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>F8(i.scale.type,e,t,this,s,o),computeFull:o=>B8(i.scale.type,e,t,this,o),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&yo.record(`${this.type}:aggregation`,n.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources.get(this.id)?.data??[],o=e.scale,a=t.scale,r=e.range,[l,c]=o.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const d=this.aggregationManager.getFilterForRange(h),u=this.contextNodeData?.nodeData,p=!this.ctx.animationManager.isSkipped(),f=u!=null&&(s.changeDescription!=null||!Ww(s)||d!=null);return{xAxis:e,yAxis:t,rawData:n,xValues:i.resolveKeysById(this,"xValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s),xScale:o,yScale:a,xAxisRange:r,xOffset:(o.bandwidth??0)/2,dataAggregationFilter:d,range:h,labelsEnabled:this.properties.label.enabled,animationEnabled:p,canIncrementallyUpdate:f,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,item:this.properties.item,yDomain:this.getSeriesDomain("y").domain,connectMissingData:this.properties.connectMissingData,interpolation:this.properties.interpolation,nodes:f?u:[],labelData:[],spanPoints:[],nodeIndex:0}}xCoordinateRange(e){const t=this.axes.x.scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes.y.scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};const{domain:{keys:[s]}}=t;if(e==="x"){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n.def.valueType==="category"){const o=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:o}}return{domain:gV(Qo(s))}}else{const n=this.domainForClippedRange("y",["yHighValue","yLowValue"],"xValue"),o=kt(n);return{domain:gV(o)}}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yHighValue","yLowValue"],"xValue",t)}handleDatumPoint(e,t,i,s,n){if(t.xValue=e.xValues[i],t.xValue===void 0&&!this.properties.allowNullKeys)return;t.datum=e.rawData[i],t.yHighValue=s??e.yHighValues[i],t.yLowValue=n??e.yLowValues[i];const o=e.spanPoints.at(-1);if(Number.isFinite(t.yHighValue)&&Number.isFinite(t.yLowValue)){if(t.inverted=t.yLowValue>t.yHighValue,t.x=e.xScale.convert(t.xValue)+e.xOffset,!Number.isFinite(t.x))return;t.yHighCoordinate=e.yScale.convert(t.yHighValue),t.yLowCoordinate=e.yScale.convert(t.yLowValue),this.upsertMarkerDatum(e,t,i,"high",t.yHighValue,t.yHighCoordinate),this.upsertMarkerDatum(e,t,i,"low",t.yLowValue,t.yLowCoordinate);const a={high:{point:{x:t.x,y:t.yHighCoordinate},xDatum:t.xValue,yDatum:t.yHighValue},low:{point:{x:t.x,y:t.yLowCoordinate},xDatum:t.xValue,yDatum:t.yLowValue}};Array.isArray(o)?o.push(a):o==null?e.spanPoints.push([a]):(o.skip+=1,e.spanPoints.push([a]))}else e.connectMissingData||(Array.isArray(o)||o==null?e.spanPoints.push({skip:0}):o.skip+=1)}upsertMarkerDatum(e,t,i,s,n,o){const{size:a}=e.item[s].marker;if(e.canIncrementallyUpdate&&e.nodeIndexe.xScale.convert(e.xValues[n])+e.xOffset;if(t.input.count<1e3||e.dataAggregationFilter==null){let[n,o]=vV(1,e.xValues.length,e.xAxisRange,a=>{const r=s(a);return[r,r]});t.input.count<1e3&&(n=0,o=t.input.count),n=Math.max(n-1,0),o=Math.min(o+1,e.xValues.length);for(let a=n;a{const h=a[c];if(h!==El)return[s(h),s(h)]});for(let c=r;c{if(!Array.isArray(l))return[];const c=l.map(h=>h.high);return xV(c,e.interpolation)}),o=e.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(h=>h.low);return xV(c,e.interpolation)}),a=mQ(this.properties.segmentation,i,s,this.chart.seriesRect,this.ctx.scene,!1);let r;if(this.properties.invertedStyle.enabled){const l=e.yHighValues[0]{const i=this.properties.item[t].strokeWidth??0,s=this.properties.highlight.highlightedSeries.item?.[t]?.strokeWidth??i,n=this.properties.highlight.highlightedItem.item?.[t]?.strokeWidth??i;return i>n||s>n};return e("low")||e("high")}updatePathNodes(e){const{visible:t}=e,[i,s,n]=e.paths,o=this.contextNodeData?.segments,a=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightState(a,!1),l=this.getHighlightStyle(),{item:c,fill:h,fillOpacity:d,opacity:u}=ce(l,this.getStyle(r));s.setProperties({datum:o,segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:cS.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:u,visible:t}),n.setProperties({segments:o,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:cS.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:u,visible:t});const p=this.getShapeFillBBox();i.setFillProperties(h,p),i.setStyleProperties({stroke:void 0,fill:h,fillOpacity:d,opacity:u},p);const f=this.contextNodeData?.intersectionSegments??o;i.setProperties({segments:f,pointerEvents:cS.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:u,visible:t}),i.datum=f,_w(this,i),_w(this,s),_w(this,n)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),dQ(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,s]=e;i.path.clear(),s.path.clear(),yV(i,t.lowStrokeData.spans),yV(s,t.highStrokeData.spans),i.markDirty("RangeArea"),s.markDirty("RangeArea")}resetDatumAnimation(e){vQ([e.datumSelection])}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{processedData:s,axes:n,properties:o}=this,a=o.styler?this.getStylerMarkerOptions().item:o.item,{low:r,high:l}=a,c=gQ(s.input.count,n.x.scale,{enabled:r.marker.enabled||l.marker.enabled});(o.item.low.marker.isDirty()||o.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let h;if(c)if(r.marker.enabled&&l.marker.enabled)h=t;else{h=[];for(const d of t)a[d.itemType].marker.enabled&&h.push(d)}else h=[];return Ww(this.processedData)?i.update(h,void 0,d=>SQ(d.xValue,d.itemType)):i.update(h)}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,n)=>{const o=this.getHighlightState(i,t,n.datumIndex),a=this.getStyle(o),{fill:r,fillOpacity:l,item:c}=a,{stroke:h,strokeWidth:d,strokeOpacity:u}=c[n.itemType],{marker:p}=this.properties.item[n.itemType],f=this.makeItemStylerParams(n.itemType);n.style=this.getMarkerStyle(p,n,f,{isHighlight:t,highlightState:o,resolveMarkerSubPath:["item",n.itemType,"marker"]},a.item[n.itemType].marker,{fill:r,fillOpacity:l,stroke:h,strokeWidth:d,strokeOpacity:u})})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,n=this.getShapeFillBBox(),o=this.ctx.highlightManager.getActiveHighlight(),a=this.getDrawingMode(s,e.drawingMode);i.each((r,l)=>{const{itemType:c}=l,h=l.style??t.styles[c][this.getHighlightState(o,s,l.datumIndex)];this.applyMarkerStyle(h,r,l.point,n),r.drawingMode=a}),s||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=cS.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:s=!1,labelSelection:n}=e;n.each((o,a)=>{o.fillOpacity=this.getHighlightStyle(s,a.datumIndex).opacity??1,iQ(this,o,t,this.properties.label,a,s,i)})}getHighlightLabelData(e,t){return e?.length?e.filter(i=>i.datum===t.datum):[]}getHighlightData(e,t){const i=e.filter(s=>s.datum===t.datum).map(s=>({...s}));return i.length>0?i:void 0}getStyle(e){return this.getStylerCouple(e)[0]}getStylerMarkerOptions(){return this.getStylerCouple()[1]}getStylerCouple(e){const{fill:t,fillOpacity:i,item:s,styler:n}=this.properties;let o={};if(n){const c=this.makeStylerParams(e);o=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(n,c)??{},{pick:!1})??{}}const a={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},r=c=>{const h=o.item?.[c],{lineDash:d,lineDashOffset:u,marker:p,stroke:f,strokeOpacity:y,strokeWidth:x}=s[c];return a.item[c].marker.enabled=h?.marker?.enabled??p.enabled,{marker:{fill:h?.marker?.fill??p.fill??t,fillOpacity:h?.marker?.fillOpacity??p.fillOpacity,shape:h?.marker?.shape??p.shape,size:h?.marker?.size??p.size,lineDash:h?.marker?.lineDash??p.lineDash,lineDashOffset:h?.marker?.lineDashOffset??p.lineDashOffset,stroke:h?.marker?.stroke??p.stroke??f,strokeOpacity:h?.marker?.strokeOpacity??p.strokeOpacity,strokeWidth:h?.marker?.strokeWidth??p.strokeWidth},lineDash:h?.lineDash??d,lineDashOffset:h?.lineDashOffset??u,stroke:h?.stroke??f,strokeOpacity:h?.strokeOpacity??y,strokeWidth:h?.strokeWidth??x}};return[{fill:o.fill??t,fillOpacity:o.fillOpacity??i,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:r("low"),high:r("high")}},a]}makeStylerParams(e){const{id:t}=this,{fill:i,fillOpacity:s,item:n,xKey:o,yHighKey:a,yLowKey:r}=this.properties,l=yQ(e??xQ.None),c=h=>{const{lineDash:d,lineDashOffset:u,marker:p,stroke:f,strokeOpacity:y,strokeWidth:x}=n[h];return{marker:{fill:p.fill??i,fillOpacity:p.fillOpacity,size:p.size,shape:p.shape,stroke:p.stroke??f,strokeOpacity:p.strokeOpacity,strokeWidth:p.strokeWidth,lineDash:p.lineDash,lineDashOffset:p.lineDashOffset},lineDash:d,lineDashOffset:u,stroke:f,strokeOpacity:y,strokeWidth:x}};return{item:{low:c("low"),high:c("high")},fill:i,fillOpacity:s,highlightState:l,seriesId:t,xKey:o,yLowKey:r,yHighKey:a}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties;return{xKey:t,yLowKey:i,yHighKey:s,itemType:e}}getTooltipContent(e,t){const i=t?.itemType??"high",{id:s,dataModel:n,processedData:o,axes:a,properties:r}=this,{xName:l,yName:c,yLowKey:h,yLowName:d,xKey:u,yHighKey:p,yHighName:f,tooltip:y,legendItemName:x}=r,b=a.x,v=a.y;if(!n||!o||!b||!v)return;const S=o.dataSources.get(this.id)?.data[e],M=n.resolveKeysById(this,"xValue",o)[e],D=n.resolveColumnById(this,"yHighValue",o)[e],I=n.resolveColumnById(this,"yLowValue",o)[e],k=this.properties.allowNullKeys??!1;if(M===void 0&&!k)return;const A=this.getStyle(),w=this.makeItemStylerParams(i),C=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:S},w,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},A.item[i].marker),T=`${this.getAxisValueText(v,"tooltip",I,S,h,x)} - ${this.getAxisValueText(v,"tooltip",D,S,p,x)}`;return this.formatTooltipWithContext(y,{heading:this.getAxisValueText(b,"tooltip",M,S,u,x),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${d??h} - ${f??p}`,value:T,missing:N.isTooltipValueMissing(D)&&N.isTooltipValueMissing(I)}]},{seriesId:s,datum:S,title:c,itemType:i,xName:l,yName:c,yLowKey:h,yLowName:d,xKey:u,yHighKey:p,yHighName:f,legendItemName:x,...C})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(),{stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,marker:a}=t;return{marker:{shape:a.shape,fill:a.fill??e,stroke:a.stroke??i,fillOpacity:a.fillOpacity,strokeOpacity:a.strokeOpacity,strokeWidth:a.strokeWidth,lineDash:a.lineDash,lineDashOffset:a.lineDashOffset},line:{enabled:!0,stroke:i,strokeOpacity:n,strokeWidth:s,lineDash:o}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yLowKey:s,yHighKey:n,yName:o,yLowName:a,yHighName:r,legendItemName:l,showInLegend:c}=this.properties,h=l??o??`${a??s} - ${r??n}`,d=`${s}-${n}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new uQ}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:o}=this.ctx;this.updateAreaPaths(n,s),aQ(this,o,...n),rQ([t],fV),lQ(this,o,{...this.getAnimationDrawingModes(),phase:"initial"},t),Fw(this,"labels",o,i,this.highlightLabelSelection)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:n,paths:o,previousContextData:a}=e,[r,l,c]=o;if(r==null&&l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateAreaPaths(o,n)},d=()=>{t.skipCurrentBatch(),h()};if(n==null||a==null){h(),bV(this,t,"added",this.getAnimationDrawingModes(),i),Hw(this,"fill_path_properties",t,"add",r),Hw(this,"low_stroke_path_properties",t,"add",l),Hw(this,"high_stroke_path_properties",t,"add",c),Fw(this,"labels",t,s,this.highlightLabelSelection);return}const u=q8(n,a,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){d();return}else if(u.status==="no-op")return;Gw(this.id,"fill_path_properties",t,[r],u.fill.pathProperties),Gw(this.id,"low_stroke_path_properties",t,[l],u.stroke.pathProperties),Gw(this.id,"high_stroke_path_properties",t,[c],u.stroke.pathProperties),u.status==="added"?this.updateAreaPaths(o,n):u.status==="removed"?this.updateAreaPaths(o,a):(jw(this.id,"fill_path_update",t,[r],u.fill.path),jw(this.id,"low_stroke_path_update",t,[l],u.stroke.path),jw(this.id,"high_stroke_path_update",t,[c],u.stroke.path)),u.hasMotion&&(bV(this,t,void 0,this.getAnimationDrawingModes(),i),Fw(this,"labels",t,s,this.highlightLabelSelection)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(o,n)})}getFormattedMarkerStyle(e){const t=this.getStyle(),i=this.makeItemStylerParams(e.itemType);return this.getMarkerStyle(this.properties.item[e.itemType].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemType,"marker"]},void 0,t)}getMarkerStyle(e,t,i,s,n,o){return e.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(e,t,i,s,n,o)}computeFocusBounds(e){const t=mV(this,e),i=mV(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return pQ.merge([t,i])}isDatumEnabled(e,t){return t%2===0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};$w.className="RangeAreaSeries",$w.type="range-area";var{rangeAreaSeriesThemeableOptionsDef:DQ}=N,Kw={...qe,...DQ,type:j(Ce("range-area")),xKey:j(L),yLowKey:j(L),yHighKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,yLowName:L,yHighName:L,legendItemName:L,segmentation:Ia,invertedStyle:{enabled:E,...ie}};Kw.pickOutsideVisibleMinorAxis=Q(E),Kw.focusPriority=Q($);var SV={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",Yo],["image",it],["pattern",tt]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},IQ={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["pattern",tt]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:SV,high:SV},label:{...Ye,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Kd,segmentation:Tl,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{number:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:kQ}=N,hS={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,version:de,dependencies:[hi],options:Kw,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:kQ,defaultAxes:{y:{type:"number",position:"left"},x:{type:"category",position:"bottom"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:IQ,create:e=>new $w(e)};function AQ(e,t,i,s,n,o,a,r){const[l,c]=ci(e,n);return Tr([l,c],t,i,s,{smallestKeyInterval:o,xNeedsValueOf:a,yNeedsValueOf:r})}var wQ=zr(AQ);function CQ(e,t,i,s,n){const o=t.resolveKeysById(s,"xValue",i),a=t.resolveColumnById(s,"yHighValue",i),r=t.resolveColumnById(s,"yLowValue",i),l=t.getDomain(s,"xValue","key",i),c=t.resolveColumnNeedsValueOf(s,"xValue",i),h=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i);if(n){const[d,u]=ci(e,l);return Tr([d,u],o,a,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:n})}return wQ(e,o,a,r,l,i.reduced?.smallestKeyInterval,c,h)}function LQ(e,t,i,s,n,o){const a=t.resolveKeysById(s,"xValue",i),r=t.resolveColumnById(s,"yHighValue",i),l=t.resolveColumnById(s,"yLowValue",i),c=t.getDomain(s,"xValue","key",i),h=t.resolveColumnNeedsValueOf(s,"xValue",i),d=t.resolveColumnNeedsValueOf(s,"yHighValue",i)??t.resolveColumnNeedsValueOf(s,"yLowValue",i),[u,p]=ci(e,c);return Vg([u,p],a,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:n,xNeedsValueOf:h,yNeedsValueOf:d,existingFilters:o})}var{AbstractBarSeriesProperties:NQ,makeSeriesTooltip:TQ,DropShadow:OQ,Label:PQ}=N,Uw=class extends PQ{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};g([m],Uw.prototype,"placement",2),g([m],Uw.prototype,"spacing",2);var Di=class extends NQ{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new OQ().set({enabled:!1}),this.label=new Uw,this.tooltip=TQ()}};g([m],Di.prototype,"xKey",2),g([m],Di.prototype,"yLowKey",2),g([m],Di.prototype,"yHighKey",2),g([m],Di.prototype,"xName",2),g([m],Di.prototype,"yName",2),g([m],Di.prototype,"yLowName",2),g([m],Di.prototype,"yHighName",2),g([m],Di.prototype,"fill",2),g([m],Di.prototype,"fillOpacity",2),g([m],Di.prototype,"stroke",2),g([m],Di.prototype,"strokeWidth",2),g([m],Di.prototype,"strokeOpacity",2),g([m],Di.prototype,"lineDash",2),g([m],Di.prototype,"lineDashOffset",2),g([m],Di.prototype,"cornerRadius",2),g([m],Di.prototype,"styler",2),g([m],Di.prototype,"itemStyler",2),g([m],Di.prototype,"shadow",2),g([m],Di.prototype,"label",2),g([m],Di.prototype,"tooltip",2);var{SeriesNodePickMode:MV,valueProperty:DV,keyProperty:EQ,checkCrisp:RQ,updateLabelNode:zQ,SMALLEST_KEY_INTERVAL:VQ,LARGEST_KEY_INTERVAL:BQ,diff:FQ,prepareBarAnimationFunctions:IV,midpointStartingBarPosition:kV,resetBarSelectionsFn:_Q,resetBarSelectionsDirect:HQ,fixNumericExtent:GQ,seriesLabelFadeInAnimation:AV,resetLabelFn:jQ,animationValidation:WQ,computeBarFocusBounds:$Q,visibleRangeIndices:KQ,createDatumId:UQ,Rect:YQ,PointerEvents:ZQ,motion:wV,processedDataIsAnimatable:Yw,getItemStyles:XQ,calculateSegments:qQ,toHighlightString:QQ,HighlightState:CV,AggregationManager:JQ,upsertNodeDatum:Zw}=N,e7=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Xw=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[MV.AXIS_ALIGNED,MV.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:_Q,label:jQ}}),this.properties=new Di,this.aggregationManager=new JQ,this.NodeEvent=e7}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,n=this.getCategoryAxis()?.scale,o=this.getValueAxis()?.scale,{isContinuousX:a,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:n,yScale:o}),c=[];this.needsDataModelDiff()&&this.processedData&&c.push(FQ(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||c.push(WQ());const h=this.visible?{}:{forceValue:Number.NaN},d=this.properties.allowNullKeys??!1,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[EQ(t,r,{id:"xValue",allowNullKey:d}),DV(i,l,{id:"yLowValue",invalidValue:null,...h}),DV(s,l,{id:"yHighValue",invalidValue:null,...h}),...a?[VQ,BQ]:[],...c],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.aggregateData(u,p),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||Yw(t))return;const i=this.axes.x;if(i==null)return;const s=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:o=>LQ(i.scale.type,e,t,this,s,o),computeFull:o=>CQ(i.scale.type,e,t,this,o),targetRange:s});const n=this.aggregationManager.filters;n&&n.length>0&&yo.record(`${this.type}:aggregation`,n.map(o=>o.maxRange))}estimateTargetRange(){const e=this.axes.x;if(e?.scale==null)return 0;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n?.def.valueType==="category"){const o=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:o}}return{domain:this.padBandExtent(s)}}else{const n=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),o=kt(n);return{domain:GQ(o)}}}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yHighValue","yLowValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:s}=this;if(!i||!s)return;const n=s.dataSources?.get(this.id)?.data;if(n==null)return;const o=e.scale,a=t.scale,r=this.getBarDirection()==="x",l=RQ(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval),[c,h]=o.range,d=Math.abs(h-c);this.aggregationManager.ensureLevelForRange(d);const u=this.aggregationManager.getFilterForRange(d),p=!this.ctx.animationManager.isSkipped(),f=this.contextNodeData?.nodeData!=null&&(s.changeDescription!=null||!Yw(s)||u!=null),{groupOffset:y,barOffset:x,barWidth:b}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:n,xValues:i.resolveKeysById(this,"xValue",s),yLowValues:i.resolveColumnById(this,"yLowValue",s),yHighValues:i.resolveColumnById(this,"yHighValue",s),xScale:o,yScale:a,groupOffset:y,barOffset:x,barWidth:b,barAlongX:r,crisp:l,dataAggregationFilter:u,animationEnabled:p,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,labelEnabled:this.properties.label.enabled,labelPlacement:this.properties.label.placement,labelPadding:(this.properties.label.spacing+(typeof this.properties.label.padding=="number"?this.properties.label.padding:0))*(this.properties.label.placement==="outside"?1:-1),canIncrementallyUpdate:f,nodes:f?this.contextNodeData.nodeData:[],nodeIndex:0}}prepareNodeDatumState(e,t,i){const s=e.rawData[i],n=e.xValues[i];if(n===void 0&&!this.properties.allowNullKeys)return;const o=e.yLowValues[i],a=e.yHighValues[i];if(!Number.isFinite(o?.valueOf())||!Number.isFinite(a?.valueOf()))return;const[r,l]=o{const u=d*jn,p=r[u+Xs],f=l[d];if(f!==-1)return[t(f),t(p)+e.barWidth]});for(let d=c;dthis.createNodeDatum(S,M,s,n),(S,M,D)=>this.updateNodeDatum(S,M,D,n)))}}createNodeDataSimple(e,t,i,s,n,o){const a=o.invalidData?.get(this.id);let[r,l]=this.visibleRangeIndices("xValue",e.xAxis.range);o.input.count<1e3&&(r=0,l=o.input.count);for(let c=r;cthis.createNodeDatum(h,d,s,n),(h,d,u)=>this.updateNodeDatum(h,d,u,n)))}createNodeDataGrouped(e,t,i,s,n){const o=this.processedData;for(const{datumIndex:a,groupIndex:r}of this.dataModel.forEachGroupDatum(this,o))i.datumIndex=a,i.groupedDataIndex=r,i.x=t(a),i.width=e.barWidth,i.yLow=e.yLowValues[a],i.yHigh=e.yHighValues[a],i.crisp=e.crisp,Zw(e,i,(l,c)=>this.createNodeDatum(l,c,s,n),(l,c,h)=>this.updateNodeDatum(l,c,h,n))}populateNodeData(e){const{processedData:t}=this;if(!t)return;const{yLowKey:i,yHighKey:s,strokeWidth:n}=this.properties,o=`${i}-${s}`,a=l=>{const c=e.xScale.convert(e.xValues[l]);return Number.isFinite(c)?Math.round(c)+e.groupOffset+e.barOffset:Number.NaN},r={nodeDatumScratch:{datum:void 0,xValue:void 0,yLowValue:0,yHighValue:0,rawLowValue:void 0,rawHighValue:void 0},labelParamsScratch:{labels:[],datumIndex:0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,yLowValue:0,yHighValue:0,datum:void 0},datumIndex:0,groupedDataIndex:0,x:0,width:0,yLow:0,yHigh:0,crisp:!1};e.dataAggregationFilter!=null?this.createNodeDataWithAggregation(e,a,r,o,n,e.dataAggregationFilter):t.type==="ungrouped"?this.createNodeDataSimple(e,a,r,o,n,t):this.createNodeDataGrouped(e,a,r,o,n)}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex0&&(i.length=0);return}const{xKey:s,yLowKey:n,yHighKey:o,xName:a,yLowName:r,yHighName:l,yName:c,legendItemName:h,label:d}=this.properties,u=e.barAlongX,p=e.labelPlacement,f=e.labelPadding,y=t.rectX,x=t.rectY,b=t.rectWidth,v=t.rectHeight,S=y+(u?-f:b/2),M=x+(u?v/2:v+f);let D;p==="outside"?D=u?"right":"center":D=u?"left":"center";let I;p==="outside"?I=u?"middle":"top":I=u?"middle":"bottom";const k=y+(u?b+f:b/2),A=x+(u?v/2:-f);let w;p==="outside"?w=u?"left":"center":w=u?"right":"center";let C;p==="outside"?C=u?"middle":"bottom":C=u?"middle":"top";const T=t.datum,O=t.yLowValue,V=t.yHighValue,z=t.datumIndex,R={datum:T,xKey:s,yLowKey:n,yHighKey:o,xName:a,yLowName:r,yHighName:l,yName:c,legendItemName:h},B=this.getSeriesDomain("y").domain,G=this.getLabelText(O,T,n,"y",B,d,{itemType:"low",value:O,...R}),F=this.getLabelText(V,T,o,"y",B,d,{itemType:"high",value:V,...R});if(i.length>0&&i[0].itemType==="low"){const _=i[0];_.datumIndex=z,_.x=S,_.y=M,_.textAlign=D,_.textBaseline=I,_.text=G,_.datum=T}else i[0]={datumIndex:z,x:S,y:M,textAlign:D,textBaseline:I,text:G,itemType:"low",datum:T,series:this};if(i.length>1&&i[1].itemType==="high"){const _=i[1];_.datumIndex=z,_.x=k,_.y=A,_.textAlign=w,_.textBaseline=C,_.text=F,_.datum=T}else i[1]={datumIndex:z,x:k,y:A,textAlign:w,textBaseline:C,text:F,itemType:"high",datum:T,series:this};i.length=2}nodeFactory(){return new YQ}getStyle(e,t){const{cornerRadius:i,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,stroke:r,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let d={};if(!e&&h){const u=this.makeStylerParams(t);d=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,u)??{},{pick:!1})??{}}return{cornerRadius:d.cornerRadius??i,fill:d.fill??s,fillOpacity:d.fillOpacity??n,lineDash:d.lineDash??o,lineDashOffset:d.lineDashOffset??a,opacity:1,stroke:d.stroke??r,strokeOpacity:d.strokeOpacity??l,strokeWidth:d.strokeWidth??c}}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,fill:s,fillOpacity:n,lineDash:o,lineDashOffset:a,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:d,yHighKey:u}=this.properties,p=QQ(e??CV.None);return{cornerRadius:i,fill:s,fillOpacity:n,highlightState:p,lineDash:o,lineDashOffset:a,seriesId:t,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:d,yHighKey:u}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return Yw(this.processedData)?i.update(s,void 0,n=>this.getDatumId(n)):i.update(s)}getItemStyle(e,t,i){const{properties:s,dataModel:n,processedData:o}=this,{itemStyler:a}=s,r=this.getHighlightStyle(t,e,i);let l=ce(r,this.getStyle(e===void 0,i));if(a&&n!=null&&o!=null&&e!=null){const c=n.resolveKeysById(this,"xValue",o)[e],h=this.cachedDatumCallback(UQ(this.getDatumId({xValue:c}),t?"highlight":"node"),()=>{const d=this.makeItemStylerParams(e,t,l);return this.callWithContext(a,d)});h&&(l=ce(h,l))}return l}makeItemStylerParams(e,t,i){const{id:s,properties:n,processedData:o}=this,{xKey:a,yHighKey:r,yLowKey:l}=n,c=o.dataSources.get(s)?.data[e],h=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(h,t,e),u=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:c,xKey:a,yHighKey:r,yLowKey:l,highlightState:d,...i,fill:u}}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight();e.datumSelection.each((i,s)=>{if(!e.datumSelection.isGarbage(i)){const n=this.getHighlightState(t,e.isHighlight,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,e.isHighlight,n)}})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),n=this.getCategoryDirection()==="x",o=this.getShapeFillBBox(),a=this;e.each(function(l,c){const h=c.style??i.styles[a.getHighlightState(s,t,c.datumIndex)];l.setStyleProperties(h,o),l.setStaticProperties("overlay",h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,n?c.width>0:c.height>0,c.crisp,void 0)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=ZQ.None})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},s=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((n,o)=>{n.fillOpacity=this.getHighlightStyle(t,o?.datumIndex).opacity??1,zQ(this,n,i,this.properties.label,o,t,s)})}getHighlightLabelData(e,t){return t.labels?.length?t.labels:super.getHighlightLabelData(e,t)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u,legendItemName:p}=n,f=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!s||!f||!y)return;const x=s.dataSources.get(this.id)?.data[e],b=i.resolveKeysById(this,"xValue",s)[e],v=i.resolveColumnById(this,"yHighValue",s)[e],S=i.resolveColumnById(this,"yLowValue",s)[e],M=this.properties.allowNullKeys??!1;if(b===void 0&&!M)return;const D=this.getItemStyle(e,!1),I=`${this.getAxisValueText(y,"tooltip",S,x,l,p)} - ${this.getAxisValueText(y,"tooltip",v,x,c,p)}`;return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(f,"tooltip",b,x,o,p),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${d??c}`,value:I,missing:N.isTooltipValueMissing(v)&&N.isTooltipValueMissing(S)}]},{seriesId:t,datum:x,title:r,xKey:o,xName:a,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,legendItemName:p,...D})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this.getStyle(!1,CV.None);return{marker:{fill:e,stroke:t,fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:o,lineDashOffset:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yName:s,yLowName:n,yHighName:o,yLowKey:a,yHighKey:r,legendItemName:l,showInLegend:c}=this.properties,h=l??s??`${n??a} - ${o??r}`,d=`${a}-${r}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}resetDatumAnimation(e){HQ([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=IV(kV(this.isVertical(),"normal"),"unknown");wV.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),AV(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,previousContextData:n}=e,o=N.calculateDataDiff(this.id,t,this.getDatumId.bind(this),s,n,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const a=n==null?"fade":"normal",r=IV(kV(this.isVertical(),a),"added");wV.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),o),(o?.changed||!ia(s.groupScale,n?.groupScale))&&AV(this,"labels",this.ctx.animationManager,i,this.highlightLabelSelection)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return $Q(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Xw.className="RangeBarSeries",Xw.type="range-bar";var{rangeBarSeriesThemeableOptionsDef:t7}=N,qw={...qe,...t7,type:j(Ce("range-bar")),xKey:j(L),yLowKey:j(L),yHighKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,yLowName:L,yHighName:L,legendItemName:L,segmentation:Ia,width:un,widthRatio:oe};qw.pickOutsideVisibleMinorAxis=Q(E),qw.focusPriority=Q($);var i7={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:Ys,segmentation:Tl},axes:{number:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:s7}=N,dS={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,groupable:!0,version:de,dependencies:[hi],options:qw,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:s7,defaultAxes:$d,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:i7,create:e=>new Xw(e)},{AbstractBarSeriesProperties:n7,makeSeriesTooltip:o7,DropShadow:a7,Label:r7}=N,uS=class extends q{};g([m],uS.prototype,"totalType",2),g([m],uS.prototype,"index",2),g([m],uS.prototype,"axisLabel",2);var LV=class extends q{};g([m],LV.prototype,"renderer",2);var Qw=class extends r7{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};g([m],Qw.prototype,"placement",2),g([m],Qw.prototype,"spacing",2);var Hs=class extends q{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new a7().set({enabled:!1}),this.label=new Qw,this.tooltip=new LV}};g([m],Hs.prototype,"name",2),g([m],Hs.prototype,"fill",2),g([m],Hs.prototype,"stroke",2),g([m],Hs.prototype,"fillOpacity",2),g([m],Hs.prototype,"strokeOpacity",2),g([m],Hs.prototype,"lineDash",2),g([m],Hs.prototype,"lineDashOffset",2),g([m],Hs.prototype,"strokeWidth",2),g([m],Hs.prototype,"cornerRadius",2),g([m],Hs.prototype,"itemStyler",2),g([m],Hs.prototype,"shadow",2),g([m],Hs.prototype,"label",2),g([m],Hs.prototype,"tooltip",2);var rd=class extends q{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};g([m],rd.prototype,"enabled",2),g([m],rd.prototype,"stroke",2),g([m],rd.prototype,"strokeOpacity",2),g([m],rd.prototype,"lineDash",2),g([m],rd.prototype,"lineDashOffset",2),g([m],rd.prototype,"strokeWidth",2);var pS=class extends q{constructor(){super(...arguments),this.positive=new Hs,this.negative=new Hs,this.total=new Hs}};g([m],pS.prototype,"positive",2),g([m],pS.prototype,"negative",2),g([m],pS.prototype,"total",2);var bl=class extends n7{constructor(){super(...arguments),this.item=new pS,this.totals=new Bi(uS),this.line=new rd,this.tooltip=o7()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:s,fill:n,stroke:o,lineDash:a,lineDashOffset:r,cornerRadius:l}=this.item[e==="subtotal"?"total":e];return{fill:n,fillOpacity:t,stroke:o,strokeWidth:i,strokeOpacity:s,lineDash:a,lineDashOffset:r,cornerRadius:l,opacity:1}}};g([m],bl.prototype,"xKey",2),g([m],bl.prototype,"yKey",2),g([m],bl.prototype,"xName",2),g([m],bl.prototype,"yName",2),g([m],bl.prototype,"item",2),g([m],bl.prototype,"totals",2),g([m],bl.prototype,"line",2),g([m],bl.prototype,"tooltip",2);var{adjustLabelPlacement:l7,SeriesNodePickMode:NV,fixNumericExtent:c7,valueProperty:TV,keyProperty:h7,accumulativeValueProperty:gS,trailingAccumulatedValueProperty:d7,createDatumId:Jw,checkCrisp:u7,updateLabelNode:p7,prepareBarAnimationFunctions:g7,collapsedStartingBarPosition:f7,resetBarSelectionsDirect:m7,resetBarSelectionsFn:y7,seriesLabelFadeInAnimation:x7,resetLabelFn:b7,animationValidation:v7,DEFAULT_CARTESIAN_DIRECTION_KEYS:S7,DEFAULT_CARTESIAN_DIRECTION_NAMES:M7,computeBarFocusBounds:D7,Rect:I7,motion:k7,getItemStylesPerItemId:A7,DataSet:w7,processedDataIsAnimatable:C7,upsertNodeDatum:L7}=N,eC=class extends N.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:S7,propertyNames:M7,categoryKey:void 0,pickModes:[NV.NEAREST_NODE,NV.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:y7,label:b7}}),this.properties=new bl,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:s}=this.properties,{data:n}=this;if(!this.visible)return;const o=S=>ch(S)&&Number(S)>=0,a=S=>ch(S)&&Number(S)>=0,r=S=>S==="total"||S==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=s.reduce((S,M)=>{const D=S.get(M.index);return D?D.push(M):S.set(M.index,[M]),S},new Map);for(const[S,M]of n?.data.entries()??[]){c.push(M);const D=h.get(S);if(D)for(const I of D)c.push({...I.toJson(),[t]:I.axisLabel})}const d=[];this.ctx.animationManager.isSkipped()||d.push(v7());const u=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:f,xScaleType:y,yScaleType:x}=this.getScaleInformation({xScale:u,yScale:p}),b=this.properties.allowNullKeys??!1,{processedData:v}=await this.requestDataModel(e,w7.wrap(c),{props:[h7(t,y,{id:"xValue",allowNullKey:b}),gS(i,x,{...l,id:"yCurrent"}),gS(i,x,{...l,missingValue:0,id:"yCurrentTotal"}),gS(i,x,{...l,id:"yCurrentPositive",validation:o}),gS(i,x,{...l,id:"yCurrentNegative",validation:a}),d7(i,x,{...l,id:"yPrevious"}),TV(i,x,{id:"yRaw"}),TV("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...f?[N.SMALLEST_KEY_INTERVAL,N.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=v.reduced?.smallestKeyInterval,this.largestDataInterval=v.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[s],values:n}=t.domain;if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");if(o?.def.type==="key"&&o?.def.valueType==="category"){const l=i.getKeySortMetadata(this,"xValue",t);return{domain:s,sortMetadata:l}}const a=e==="y",r=this.getCategoryAxis().isReversed();return{domain:this.padBandExtent(s,r!==a)}}else{const o=i.resolveProcessedDataIndexById(this,"yCurrent"),a=n[o],r=[Math.min(0,a[0]),Math.max(0,a[1])];return{domain:c7(r)}}}getSeriesRange(){return[Number.NaN,Number.NaN]}populateNodeData(e){let t=0;const i={datumIndex:0,datum:void 0,xDatum:void 0,value:void 0,cumulativeValue:void 0,trailingValue:void 0,datumType:void 0};for(const[s,n]of e.rawData.entries()){const o=e.totalTypeValues[s],a=this.isSubtotal(o),r=this.isTotal(o),l=r||a,c=e.xValues[s];if(c===void 0&&!this.properties.allowNullKeys)continue;const h=e.yRawValues[s],{cumulativeValue:d,trailingValue:u}=this.computeWaterfallValues(e,s,r,a,t);l&&(t=d??0);const p=this.computeDisplayValue(r,a,h,d,u);i.datumIndex=s,i.datum=n,i.xDatum=c,i.value=p,i.cumulativeValue=d,i.trailingValue=u,i.datumType=o;const f=L7(e,i,(y,x)=>this.createNodeDatum(y,x),(y,x,b)=>this.updateNodeDatum(y,x,b));if(f){const y=this.createPointDatum(e,f,d,u,l);e.pointData.push(y)}}}finalizeNodeData(e){e.nodeIndex=0,u=this.getSeriesItemType(d,h);return{index:o,series:this,itemType:u,datum:a,datumIndex:o,cumulativeValue:c??0,xValue:r,yValue:l,yKey:s,xKey:i,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:n,label:{text:"",x:0,y:0,textAlign:"center",textBaseline:"middle"}}}updateNodeDatum(e,t,i){const{xScale:s,yScale:n,barAlongX:o,barWidth:a,valueAxisReversed:r,xKey:l,yKey:c,xName:h,yName:d,yDomain:u,crisp:p}=e,{datumIndex:f,datum:y,xDatum:x,value:b,cumulativeValue:v,trailingValue:S,datumType:M}=i,D=t,I=Math.round(s.convert(x));if(!Number.isFinite(I))return;const k=(b??0)>=0,A=this.getSeriesItemType(k,M),{strokeWidth:w,label:C}=this.getItemConfig(A),T=Math.round(n.convert(v)),O=Math.round(n.convert(S)),V=k?T:O,z=k?O:T,R=Math.max(w,Math.abs(z-V)),B=o?Math.min(V,z):I,G=o?I:Math.min(V,z),F=o?R:a,_=o?a:R;if(D.index=f,D.itemType=A,D.datum=y,D.datumIndex=f,D.cumulativeValue=v??0,D.xValue=x,D.yValue=b,D.x=B,D.y=G,D.width=F,D.height=_,D.crisp=p,D.midPoint?(D.midPoint.x=B+F/2,D.midPoint.y=G+_/2):D.midPoint={x:B+F/2,y:G+_/2},C.enabled){const Y=A==="subtotal"?"total":A,Z=this.getLabelText(b,y,c,"y",u,C,{itemType:Y,value:b,datum:y,xKey:l,yKey:c,xName:h,yName:d}),ne=C.spacing+(typeof C.padding=="number"?C.padding:0),te=l7({isUpward:(b??-1)>=0!==r,isVertical:!o,placement:C.placement,spacing:ne,rect:{x:B,y:G,width:F,height:_}});D.label.text=Z,D.label.x=te.x,D.label.y=te.y,D.label.textAlign=te.textAlign,D.label.textBaseline=te.textBaseline}else D.label.text=""}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}createPointDatum(e,t,i,s,n){const{yScale:o,barAlongX:a,categoryAxisReversed:r,lineStrokeWidth:l}=e,c=Math.round(o.convert(i)),h=Math.round(o.convert(s)),d=n?c:h,u=Math.floor(l)%2/2,p=r?c:d,f=r?d:c,y={x:t.x,y:t.y,width:t.width,height:t.height};let x,b;return a?(x={x:p+u,y:y.y},b={x:f+u,y:y.y+y.height}):(x={x:y.x,y:p+u},b={x:y.x+y.width,y:f+u}),{x:r?b.x:x.x,y:r?b.y:x.y,x2:r?x.x:b.x,y2:r?x.y:b.y,size:0}}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const s=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),n=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),o=e.resolveProcessedDataIndexById(this,"totalTypeValue"),a=i.domain.values[s]??[],r=i.domain.values[n]??[];a.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[o];if(l)for(const c of l)(c==="total"||c==="subtotal")&&t.add("total")}isSubtotal(e){return e==="subtotal"}isTotal(e){return e==="total"}nodeFactory(){return new I7}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return C7(this.processedData)?i.update(s,void 0,n=>Jw(n.datumIndex)):i.update(s)}getItemStyle(e,t,i,s="total"){const{properties:n}=this,{datumIndex:o=0,datum:a}=e??{},r=s==="subtotal"?"total":s,l=n.item[r],c=this.getHighlightStyle(t,o,i),h=ce(c,n.getStyle(s)),{itemStyler:d}=l;let u=h;if(d!=null&&e!=null){const p=this.cachedDatumCallback(Jw(o,t?"highlight":"node"),()=>{const f=this.makeItemStylerParams(s,o,a,t,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(d,f))});p&&(u=ce(p,u))}return u}makeItemStylerParams(e,t,i,s,n){const{id:o,properties:a}=this,{xKey:r,yKey:l}=a,c=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(c,s,t),d=this.filterItemStylerFillParams(n.fill)??n.fill;return{seriesId:o,itemType:e,datum:i,xKey:r,yKey:l,highlightState:h,...n,fill:d}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t,void 0,s.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),n=this.getCategoryDirection()==="x",o=this.getShapeFillBBox();e.each((a,r)=>{const l=r.style??i.styles[r.itemType][this.getHighlightState(s,t,r.datumIndex)];a.setStyleProperties(l,o),a.cornerRadius=l.cornerRadius??0,a.visible=n?r.width>0:r.height>0,a.crisp=r.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(t.length===0)return i.update([]);const s=t.filter(n=>{const{label:o}=this.getItemConfig(n.itemType);return o.enabled});return i.update(s)}updateLabelNodes({labelSelection:e,isHighlight:t}){const i={itemType:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},s=this.ctx.highlightManager?.getActiveHighlight();e.each((n,o)=>{i.itemType=o.itemType;const a=this.getHighlightStyle(t,o.datumIndex)?.opacity??1;n.visible=!0,n.fillOpacity=a;const r=this.getItemConfig(o.itemType).label;p7(this,n,i,r,o.label,t,s)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:o,xName:a,yKey:r,yName:l,tooltip:c,legendItemName:h}=n,d=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!s||!d||!u)return;const p=s.dataSources.get(this.id)?.data[e],f=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yRaw",s)[e],x=i.resolveColumnById(this,"yCurrentTotal",s),b=i.resolveColumnById(this,"totalTypeValue",s),v=this.properties.allowNullKeys??!1;if(f===void 0&&!v)return;const S=b[e],M=(y??0)>=0,D=this.getSeriesItemType(M,S);let I;if(this.isTotal(S))I=x[e];else if(this.isSubtotal(S)){I=x[e];for(let w=e-1;w>=0;w-=1)if(this.isSubtotal(b[w])){I=I-x[w];break}}else I=y;const k=this.contextNodeData?.nodeData?.[e],A=this.getItemStyle(k,!1,void 0,k?.itemType);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",f,p,o,h),symbol:this.legendItemSymbol(D),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(u,"tooltip",I,p,r,h),missing:N.isTooltipValueMissing(I)}]},{seriesId:t,datum:p,title:l,itemType:D,xKey:o,xName:a,yKey:r,yName:l,...A})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}=this.getItemConfig(e);return{marker:{fill:t,stroke:i,fillOpacity:s,strokeOpacity:n,strokeWidth:o,lineDash:a,lineDashOffset:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,seriesItemTypes:i}=this,s=[],n=a=>a.charAt(0).toUpperCase()+a.substring(1),{showInLegend:o}=this.properties;for(const a of i){const{name:r}=this.getItemConfig(a);s.push({legendType:"category",id:t,itemId:Jw(a),seriesId:t,enabled:!0,label:{text:r??n(a)},symbol:this.legendItemSymbol(a),hideInLegend:!o,isFixed:!0})}return s}toggleSeriesItem(){}resetDatumAnimation(e){m7([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s}=e,n=g7(f7(this.isVertical(),this.axes,"normal"),"unknown");k7.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n),x7(this,"labels",this.ctx.animationManager,i);const{pointData:o}=s;o&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>hh>d,r=n?.scale.convert(0),l=t.reduce((h,d)=>(a(d.x,h)&&(h=d.x),h),o?1/0:0),c=(h,d,u,p,f)=>(h-d)/(u-d)*(f-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Ea,collapsable:!1,onUpdate(h){s.clear(!0);for(const[d,u]of t.entries()){const p=c(h,r,l,r,u.x),f=c(h,r,l,r,u.x2);d!==0&&s.lineTo(p,u.y),s.moveTo(f,u.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const n=this.getValueAxis(),o=n?.isReversed(),a=o?(h,d)=>h>d:(h,d)=>h(a(d.y,h)&&(h=d.y),h),o?0:1/0),c=(h,d,u,p,f)=>(h-d)/(u-d)*(f-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Ea,collapsable:!1,onUpdate(h){s.clear(!0);for(const[d,u]of t.entries()){const p=c(h,r,l,r,u.y),f=c(h,r,l,r,u.y2);d!==0&&s.lineTo(u.x,p),s.moveTo(u.x2,f)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(t.length===0)return;const[i]=t;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:n}=e;if(n){for(const[o,a]of n.entries())o!==0&&s.lineTo(a.x,a.y),s.moveTo(a.x2,a.y2);i.checkPathDirty()}}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,lineJoin:"round",pointerEvents:N.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}computeFocusBounds({datumIndex:e}){return D7(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return e.itemStyler!=null||e.label.itemStyler!=null||t.itemStyler!=null||t.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};eC.className="WaterfallSeries",eC.type="waterfall";var{waterfallSeriesThemeableOptionsDef:N7}=N,T7={...N7,...qe,type:j(Ce("waterfall")),xKey:j(L),yKey:j(L),xKeyAxis:L,yKeyAxis:L,xName:L,yName:L,totals:Ft({totalType:j(U("total","subtotal")),index:j(P),axisLabel:j(L)},"a total definition options array"),width:un};function tC(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",Ny(e)],["image",it],["pattern",Ey(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...Ye,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var O7={series:{item:{positive:tC("altUp",0),negative:tC("altDown",1),total:tC("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:Vy},legend:{enabled:!0,toggleSeries:!1}},iC={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,solo:!0,version:de,dependencies:[hi],options:T7,defaultAxes:$d,axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},axisKeysFlipped:{x:"yKeyAxis",y:"xKeyAxis"},themeTemplate:O7,create:e=>new eC(e)},OV={width:P,height:P,grip:E,fill:J,stroke:J,strokeWidth:P,cornerRadius:P},Nn=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],PV=[...Nn,"errorBar","label","legendItemName"],EV=[...Nn,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],RV=[...Nn,"title","label","labelKey","labelName","sizeName"],zV=[...Nn,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],VV=[...Nn,"label"],BV=[...Nn,"errorBar","title","label"],FV=[...Nn,"label","yLowName","yHighName"],_V=[...Nn,"direction","label","yLowName","yHighName"],HV=[...Nn,"errorBar","title","label","labelKey","labelName"],GV=[...Nn,"direction"],P7={enabled:E,height:P,spacing:P,cornerRadius:$,mask:{fill:J,fillOpacity:oe,stroke:J,strokeWidth:P},minHandle:OV,maxHandle:OV,miniChart:{enabled:E,padding:{top:P,bottom:P},label:{enabled:E,avoidCollisions:E,spacing:P,format:gn,formatter:Ki(pn),interval:{minSpacing:P,maxSpacing:P,values:dn,step:$},...$e},series:Ft(wl({area:ee(Gk.options,[...Nn,"type"]),bar:ee(tv.options,[...PV,"type"]),"box-plot":ee(kw.options,[...EV,"type"]),bubble:ee(Zk.options,[...RV,"type"]),candlestick:ee(nS.options,[...Nn,"type"]),heatmap:ee(Ew.options,[...zV,"type"]),histogram:ee(qk.options,[...VV,"type"]),line:ee(av.options,[...BV,"type"]),ohlc:ee(oS.options,[...Nn,"type"]),"range-area":ee(hS.options,[...FV,"type"]),"range-bar":ee(dS.options,[..._V,"type"]),scatter:ee(tA.options,[...HV,"type"]),waterfall:ee(iC.options,[...GV,"type"])},"miniChart series options"))}},E7=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],R7=["itemStyler","simpleItemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function jV(e,t){return{$merge:[{$switch:[t,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[t,Nn,["bar",PV],["box-plot",EV],["bubble",RV],["heatmap",zV],["histogram",VV],["line",[...BV,...R7]],["range-area",FV],["range-bar",_V],["scatter",HV],["waterfall",GV]]},e]}]}}var z7={enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:li.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[jV({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:E7.map(e=>({$eq:[{$path:"/series/0/type"},e]}))},{$map:[jV({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},sC={type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,version:de,options:P7,themeTemplate:z7,create:e=>new Bp(e)},nC=class extends nr{};g([m],nC.prototype,"enabled",2),g([m],nC.prototype,"value",2);var ar=class extends q{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.textColor="black"}};g([m],ar.prototype,"fill",2),g([m],ar.prototype,"fillOpacity",2),g([m],ar.prototype,"stroke",2),g([m],ar.prototype,"textColor",2);var ln=class extends q{constructor(){super(...arguments),this.active=new ar,this.disabled=new ar,this.hover=new ar,this.cornerRadius=0,this.fill="black",this.fillOpacity=1,this.fontSize=12,this.fontFamily="sans-serif",this.fontWeight="normal",this.stroke="black",this.strokeWidth=1,this.textColor="black",this.padding=0}};g([m],ln.prototype,"active",2),g([m],ln.prototype,"disabled",2),g([m],ln.prototype,"hover",2),g([m],ln.prototype,"cornerRadius",2),g([m],ln.prototype,"fill",2),g([m],ln.prototype,"fillOpacity",2),g([m],ln.prototype,"fontSize",2),g([m],ln.prototype,"fontFamily",2),g([m],ln.prototype,"fontWeight",2),g([m],ln.prototype,"stroke",2),g([m],ln.prototype,"strokeWidth",2),g([m],ln.prototype,"textColor",2),g([m],ln.prototype,"padding",2);var WV=class extends ln{constructor(){super(...arguments),this.visible="auto"}};g([m],WV.prototype,"visible",2);var{userInteraction:V7,LayoutElement:B7,Toolbar:$V}=N,oC="toolbarRangeSelectRange",si=class extends q{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new Bi(nC),this.button=new ln,this.dropdown=new WV,this.active=new ar,this.disabled=new ar,this.hover=new ar,this.enableOutOfRange=!1,this.gap=0,this.cornerRadius=0,this.fill="black",this.fillOpacity=1,this.fontSize=12,this.fontFamily="sans-serif",this.fontWeight="normal",this.stroke="black",this.strokeWidth=1,this.textColor="black",this.padding=0,this.position="top-right",this.spacing=0,this.minSize=0,this.cleanup=new ot,this.dropdownLabel=oC,this.cleanup.register(e.layoutManager.registerElement(B7.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),e.widgets.chartWidget.addListener("click",this.onChartWidgetClick.bind(this)),e.eventsHub.on("zoom:change-complete",this.onZoomChanged.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}setup(){this.container==null&&(this.container=this.ctx.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.buttonsToolbar=new $V(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.buttonsToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--buttons"),this.container.append(this.buttonsToolbar.getElement()),this.dropdownToolbar=new $V(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.dropdownToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--dropdown"),this.container.append(this.dropdownToolbar.getElement()),this.dropdownMenu=new N.Menu(this.ctx,"ranges-dropdown"),this.cleanup.register(this.buttonsToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.dropdownToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this))))}teardown(){this.buttonsToolbar?.getElement().remove(),this.buttonsToolbar?.destroy(),this.dropdownToolbar?.getElement().remove(),this.dropdownToolbar?.destroy()}onLayoutStart({layoutBox:e}){const{dropdown:t,enabled:i,position:s,spacing:n}=this;if(!i){this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!0);return}this.setup();const{buttonsToolbar:o,dropdownToolbar:a}=this;if(!o||!a)return;o.updateButtons(this.buttons),a.updateButtons([this.getDropdownButtonOptions(this.dropdownLabel)]),this.updateCSSVariables(),t.visible==="always"?this.swapDropdownIn():this.swapDropdownOut();const{height:r}=this.isDropdown?a.getBounds():o.getBounds(),l={x:e.x,y:e.y};s==="top"||s==="top-left"||s==="top-right"?e.shrink({top:r+n}):(l.y=e.y+e.height-r,e.shrink({bottom:r+n})),o.setBounds(l),a.setBounds(l)}onLayoutComplete({series:{rect:e},layoutBox:t}){const{buttons:i,buttonsToolbar:s,ctx:n,dropdown:o,dropdownMenu:a,dropdownToolbar:r,enabled:l}=this;if(!l||!s||!r||!a)return;let c;if(o.visible==="auto"&&(c=s.getBounds(),c.width>e.width?this.swapDropdownIn():this.swapDropdownOut()),this.isDropdown)c=r.getBounds(),this.dropdownMinWidth??(this.dropdownMinWidth=c.width),c.width=Math.max(c.width,this.dropdownMinWidth),c=this.updateToolbarBounds(r,e,t,c);else{c=this.updateToolbarBounds(s,e,t,c);let u=0;for(const p of i)s.toggleButtonEnabledByIndex(u,this.getButtonEnabled(p)),u++}const h={x:n.domManager.isRtl?c.x+c.width:c.x,y:c.y+c.height+1},d={x:c.x+c.width,y:c.y-1};a.setAnchor(h,d)}onChartWidgetClick(){this.dropdownMenu?.hide()}updateToolbarBounds(e,t,i,s){const{position:n}=this,o=s??e.getBounds();return n==="top-right"||n==="bottom-right"?o.x=i.x+i.width-o.width:(n==="top"||n==="bottom")&&(o.x=i.x+i.width/2-o.width/2),o.x=se(t.x,o.x,t.x+t.width-o.width),e.setBounds({x:o.x,y:o.y,width:o.width}),o}updateCSSVariables(){this.gap>0?this.buttonsToolbar?.addClass("ag-charts-range-buttons--gapped"):this.buttonsToolbar?.removeClass("ag-charts-range-buttons--gapped");const e=["paddingTop","paddingRight","paddingBottom","paddingLeft","strokeWidth"];this.ctx.domManager.setModuleCSSVariables("ranges",void 0,void 0,{gap:this.gap,minSize:this.minSize},["gap","minSize"]),this.ctx.domManager.setModuleCSSVariables("ranges","button",void 0,this.getComponentVariables(this.button),e),this.ctx.domManager.setModuleCSSVariables("ranges","button","active",this.getComponentStateVariables(this.button,"active"),e),this.ctx.domManager.setModuleCSSVariables("ranges","button","disabled",this.getComponentStateVariables(this.button,"disabled"),e),this.ctx.domManager.setModuleCSSVariables("ranges","button","hover",this.getComponentStateVariables(this.button,"hover"),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown",void 0,this.getComponentVariables(this.dropdown),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","active",this.getComponentStateVariables(this.dropdown,"active"),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","disabled",this.getComponentStateVariables(this.dropdown,"disabled"),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","hover",this.getComponentStateVariables(this.dropdown,"hover"),e)}getComponentVariables(e){return{cornerRadius:e.cornerRadius,fill:this.getComponentFill(e.fill,e.fillOpacity),fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,stroke:e.stroke,strokeWidth:e.strokeWidth,textColor:e.textColor,paddingTop:typeof e.padding=="number"?e.padding:e.padding.top??0,paddingRight:typeof e.padding=="number"?e.padding:e.padding.right??0,paddingBottom:typeof e.padding=="number"?e.padding:e.padding.bottom??0,paddingLeft:typeof e.padding=="number"?e.padding:e.padding.left??0}}getComponentStateVariables(e,t){return{fill:this.getComponentFill(e[t].fill,e[t].fillOpacity),fillOpacity:e[t].fillOpacity,stroke:e[t].stroke,textColor:e[t].textColor}}getComponentFill(e,t){if(t>=1)return e;const i=Ne.fromString(e);return new Ne(i.r,i.g,i.b,t).toString()}onZoomChanged(){this.buttonsToolbar?.clearActiveButton(),this.isDropdown&&this.resetDropdownButton()}onButtonPress({button:{index:e}}){this.isDropdown?this.showDropdownMenu():this.updateZoomWithButtonIndex(e)}swapDropdownIn(){this.isDropdown||(this.isDropdown=!0,this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!1))}swapDropdownOut(){this.isDropdown!==!1&&(this.isDropdown=!1,this.buttonsToolbar?.setHidden(!1),this.dropdownToolbar?.setHidden(!0),this.buttonsToolbar?.clearActiveButton(),this.dropdownMenu?.hide())}resetDropdownButton(){this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(oC))}getDropdownButtonOptions(e){return this.dropdownLabel=e,{label:e,value:1/0,icon:"chevron-filled-down",iconPosition:"after"}}showDropdownMenu(){const e=this.dropdownToolbar?.getButtonWidget(0);if(!this.dropdownToolbar||!this.dropdownMenu||!e)return;this.dropdownToolbar.toggleActiveButtonByIndex(0);const t=this.buttons.map((i,s)=>({ariaLabel:i.ariaLabel,enabled:this.getButtonEnabled(i),label:i.label??`${s}`,value:`${s}`,icon:i.icon}));this.dropdownMenu.show(e,{class:"ag-charts-range-buttons-menu",items:t,minWidth:this.dropdownMinWidth,onPress:i=>{const s=Number(i.value);this.updateZoomWithButtonIndex(s),this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(i.label??oC))},onHide:()=>{this.dropdownToolbar?.clearActiveButton()}})}updateZoomWithButtonIndex(e){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:s}=i,n=V7(`zoom-range-button-${e}`),o=this.getUpdateWithFn(s);o.valid===!1||o.fn==null?t.resetZoom(n):t.updateWith(n,"x",o.fn),this.buttonsToolbar?.toggleActiveButtonByIndex(e)}getUpdateWithFn(e){if(e==null)return{valid:!0};if(typeof e=="number")return{fn:(t,i)=>[Number(i)-e,void 0],valid:!0};if(Array.isArray(e))return{fn:()=>e,valid:!0};if(typeof e=="function")return{fn:e,valid:!0};if(iD(e)||sD(e)){const[,t]=this.ctx.axisManager.getAxisContext("x").at(0)?.scale.getDomainMinMax()??[];if(Sa(t)){const i=tD(e,t);return{fn:s=>[i??s,void 0],valid:!0}}return{valid:!1}}return{valid:!0}}getButtonEnabled(e){const{enableOutOfRange:t,ctx:{zoomManager:i}}=this;let s=e.enabled??t;if(e.enabled==null&&t===!1){const n=this.getUpdateWithFn(e.value);if(n.valid===!1)return!1;s=n.fn==null?!0:i.isValidUpdateWith("x",n.fn,"range-check")}return s}};g([Ze({newValue(e){e||(this.isDropdown=void 0)}}),m],si.prototype,"enabled",2),g([m],si.prototype,"buttons",2),g([m],si.prototype,"button",2),g([m],si.prototype,"dropdown",2),g([m],si.prototype,"active",2),g([m],si.prototype,"disabled",2),g([m],si.prototype,"hover",2),g([m],si.prototype,"enableOutOfRange",2),g([m],si.prototype,"gap",2),g([m],si.prototype,"cornerRadius",2),g([m],si.prototype,"fill",2),g([m],si.prototype,"fillOpacity",2),g([m],si.prototype,"fontSize",2),g([m],si.prototype,"fontFamily",2),g([m],si.prototype,"fontWeight",2),g([m],si.prototype,"stroke",2),g([m],si.prototype,"strokeWidth",2),g([m],si.prototype,"textColor",2),g([m],si.prototype,"padding",2),g([m],si.prototype,"position",2),g([m],si.prototype,"spacing",2),g([m],si.prototype,"minSize",2);var aC={...Ns,stroke:X.stroke,textColor:J},rC={...Ns,...X,...$e,textColor:J,cornerRadius:P,padding:_n,active:aC,disabled:aC,hover:aC},F7={...rC,visible:U("auto","always","never")},_7={...rC},KV={enabled:E,enableOutOfRange:E,position:U("top-left","top","top-right","bottom-left","bottom","bottom-right"),button:_7,dropdown:F7,gap:P,spacing:P,...rC,buttons:Ft({...Dr,enabled:E,value:Ie($,We(xe(Ie($,ns)),br(2,2)),Yc,Ll,at)},"range button options array")};KV.minSize=Q(P);var UV=1e3*60*60*24,lC=UV*30,H7=UV*365,G7={cornerRadius:{$ref:"borderRadius"},fill:{$ref:"chromeBackgroundColor"},fillOpacity:1,fontSize:{$rem:[li.SMALL,"chromeFontSize"]},fontFamily:{$ref:"chromeFontFamily"},fontWeight:{$ref:"chromeFontWeight"},padding:{$shallow:{top:6,right:9,bottom:6,left:9}},stroke:{$ref:"borderColor"},strokeWidth:{$if:[{$ref:"buttonBorder"},1,0]},textColor:{$ref:"chromeTextColor"}},fS={fill:{$path:"../fill"},fillOpacity:{$path:"../fillOpacity"},stroke:{$path:"../stroke"},textColor:{$path:"../textColor"}},YV={...fS,cornerRadius:{$path:"../cornerRadius"},fill:{$path:"../fill"},fillOpacity:{$path:"../fillOpacity"},fontSize:{$path:"../fontSize"},fontFamily:{$path:"../fontFamily"},fontWeight:{$path:"../fontWeight"},padding:{$path:"../padding"},stroke:{$path:"../stroke"},strokeWidth:{$path:"../strokeWidth"},textColor:{$path:"../textColor"}},Wp=e=>({fill:{$path:`../../${e}/fill`},fillOpacity:{$path:`../../${e}/fillOpacity`},stroke:{$path:`../../${e}/stroke`},strokeWidth:{$path:`../../${e}/strokeWidth`},textColor:{$path:`../../${e}/textColor`}}),j7={enabled:!1,enableOutOfRange:!1,position:"top-right",gap:0,spacing:10,minSize:0,...G7,active:{...fS,fill:{$ref:"focusColor"},stroke:{$ref:"accentColor"},textColor:{$ref:"accentColor"}},disabled:{...fS,fill:{$mix:[{$ref:"chromeBackgroundColor"},{$ref:"foregroundColor"},.06]},textColor:{$mix:[{$ref:"chromeBackgroundColor"},{$ref:"chromeTextColor"},.5]}},hover:{...fS,fill:{$ref:"focusColor"}},button:{active:{...Wp("active")},disabled:{...Wp("disabled")},hover:{...Wp("hover")},...YV},dropdown:{visible:"auto",active:{...Wp("active")},disabled:{...Wp("disabled")},hover:{...Wp("hover")},...YV},buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:lC},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*lC},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*lC},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:H7},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:()=>[void 0,void 0]}]}},cC={type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,version:de,options:KV,themeTemplate:j7,create:e=>new si(e)},W7=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=new Map,this.enableDoubleClick=new Map,this.enableDragging=new Map,this.enableScrolling=new Map,this.axes=[],this.overlappingAxisIds=new Set,e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",t=>this.onSeriesAreaDoubleClick(t)),e.widgets.seriesDragInterpreter.events.on("drag-start",t=>this.onSeriesAreaDragStart(t)),e.widgets.seriesDragInterpreter.events.on("drag-move",t=>this.onSeriesAreaDragMove(t)),e.widgets.seriesDragInterpreter.events.on("drag-end",t=>this.onSeriesAreaDragEnd(t))),this.cleanup.register(e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("axis-dom-proxy:update",t=>this.onUpdate(t)),e.eventsHub.on("series-area:hover",t=>this.onSeriesAreaHover(t)),e.eventsHub.on("series-area:click",t=>this.onSeriesAreaClick(t)),()=>this.teardown())}teardown(){for(const e of this.axes)e.div.destroy()}onLayoutComplete(e){this.seriesRect=e.series.rect}onUpdate(e){const{enabled:t,enableDoubleClick:i,enableDragging:s,enableScrolling:n,source:o}=e;this.enabled.set(o,t),this.enableDoubleClick.set(o,i),this.enableDragging.set(o,s),this.enableScrolling.set(o,n);const a=this.isEnabled()&&(this.isEnabledDoubleClick()||this.isEnabledDragging()||this.isEnabledScrolling());for(const r of this.axes)r.div.setHidden(!a);a&&(this.processAxisDiff(),this.updateOverlappingAxisPointerEvents())}processAxisDiff(){const{ctx:{axisManager:e}}=this,t=[...e.getAxisContext("x"),...e.getAxisContext("y")],{removed:i,added:s}=this.diffAxisIds(t);i.length>0&&(this.axes=this.axes.filter(n=>i.includes(n.axisId)?(n.div.destroy(),this.overlappingAxisIds.delete(n.axisId),this.hoveredAxisId===n.axisId&&(this.hoveredAxisId=void 0),this.draggingAxisId===n.axisId&&(this.draggingAxisId=void 0),!1):!0));for(const n of s){const{axisId:o,direction:a}=n,r=this.createAxisDOMProxy(o,a);this.axes.push(r)}for(const n of this.axes){const a=t.find(r=>r.axisId===n.axisId).getCanvasBounds();n.div.setHidden(DM(a)),a==null?n.bounds=void 0:(n.div.setBounds(a),n.bounds=new N.BBox(a.x,a.y,a.width,a.height))}}onSeriesAreaHover(e){if(e.consumed){this.hoveredAxisId&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:e}));return}if(!this.hasOverlappingAxes())return;const t=this.pickAxisAtPoint(e);t?(this.hoveredAxisId=t.axisId,this.ctx.eventsHub.emit("axis-dom-proxy:mouseenter",{axisId:t.axisId,direction:t.direction,event:e})):(this.hoveredAxisId&&this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:e}),this.hoveredAxisId=void 0)}onSeriesAreaClick(e){if(e.sourceEvent.type!=="dblclick"||e.consumed||!this.hasOverlappingAxes())return;const t=this.getAxis(this.hoveredAxisId);t&&this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{event:e,axisId:t.axisId,direction:t.direction})}onSeriesAreaDoubleClick(e){if(!this.isEnabled()||!this.isEnabledDoubleClick()||!this.hasOverlappingAxes())return;const t=this.getAxis(this.hoveredAxisId);t&&this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{event:e,axisId:t.axisId,direction:t.direction})}onSeriesAreaDragStart(e){if(!this.isEnabled()||!this.isEnabledDragging())return;const t=this.getAxis(this.hoveredAxisId);t&&this.overlappingAxisIds.has(t.axisId)&&(this.draggingAxisId=t.axisId,this.ctx.eventsHub.emit("axis-dom-proxy:drag-start",{axisId:t.axisId,direction:t.direction,event:e}),e.device==="touch"&&e.sourceEvent.preventDefault())}onSeriesAreaDragMove(e){if(!this.isEnabled()||!this.isEnabledDragging()||!this.draggingAxisId||!this.overlappingAxisIds.has(this.draggingAxisId))return;const t=this.getAxis(this.draggingAxisId);t&&this.ctx.eventsHub.emit("axis-dom-proxy:drag-move",{axisId:t.axisId,direction:t.direction,event:e})}onSeriesAreaDragEnd(e){if(!this.draggingAxisId||!this.overlappingAxisIds.has(this.draggingAxisId))return;const t=this.getAxis(this.draggingAxisId);t&&(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:drag-end",{axisId:t.axisId,direction:t.direction,event:e}))}pickAxisAtPoint(e){for(const t of this.axes)if(this.overlappingAxisIds.has(t.axisId)&&t.bounds?.containsPoint(e.canvasX,e.canvasY))return{axisId:t.axisId,direction:t.direction}}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getAxis(e){if(!e)return;const t=this.axes.find(i=>i.axisId===e);return t?{axisId:t.axisId,direction:t.direction}:void 0}updateOverlappingAxisPointerEvents(){this.overlappingAxisIds.clear();const e=(this.isEnabledDragging()||this.isEnabledScrolling())&&this.seriesRect;for(const t of this.axes){if(!e){t.div.setPointerEvents(void 0);continue}!!t.bounds?.clone().shrink(1).collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(t.axisId),t.div.setPointerEvents("none")):t.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.draggingAxisId&&!this.overlappingAxisIds.has(this.draggingAxisId)&&(this.draggingAxisId=void 0)}createAxisDOMProxy(e,t){const{ctx:{proxyInteractionService:i}}=this,s="afterend",n=i.createProxyElement({type:"region",domManagerId:e,where:s});return n.addListener("drag-start",o=>{!this.isEnabled()||!this.isEnabledDragging()||(o.device==="touch"&&o.sourceEvent.preventDefault(),this.draggingAxisId=e,this.ctx.eventsHub.emit("axis-dom-proxy:drag-start",{axisId:e,direction:t,event:o}))}),n.addListener("drag-move",o=>{!this.isEnabled()||!this.isEnabledDragging()||this.ctx.eventsHub.emit("axis-dom-proxy:drag-move",{axisId:e,direction:t,event:o})}),n.addListener("drag-end",o=>{!this.isEnabled()||!this.isEnabledDragging()||(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:drag-end",{axisId:e,direction:t,event:o}))}),n.addListener("dblclick",o=>{!this.isEnabled()||!this.isEnabledDoubleClick()||this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{axisId:e,direction:t,event:o})}),n.addListener("mouseenter",o=>{this.isEnabled()&&(this.hoveredAxisId=e,this.ctx.eventsHub.emit("axis-dom-proxy:mouseenter",{axisId:e,direction:t,event:o}))}),n.addListener("mouseleave",o=>{this.isEnabled()&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:o}))}),n.addListener("wheel",o=>{!this.isEnabled()||!this.isEnabledScrolling()||this.ctx.eventsHub.emit("axis-dom-proxy:wheel",{axisId:e,direction:t,event:o})}),{axisId:e,div:n,direction:t}}diffAxisIds(e){const t=this.axes.map(o=>o.axisId),i=e.map(o=>o.axisId),s=t.filter(o=>!i.includes(o)),n=e.filter(o=>!t.includes(o.axisId));return{removed:s,added:n}}isEnabled(){return this.isBooleanMap(this.enabled)}isEnabledDoubleClick(){return this.isBooleanMap(this.enableDoubleClick)}isEnabledDragging(){return this.isBooleanMap(this.enableDragging)}isEnabledScrolling(){return this.isBooleanMap(this.enableScrolling)}isBooleanMap(e){for(const t of e.values())if(t)return!0;return!1}},$7={type:"plugin",name:"axis-dom-proxy",version:de,create:e=>new W7(e)},K7=class{constructor(){this.isFirstWheelEvent=!0,this.debouncedWheelReset=ny(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100)}onWheel(e,t){if(e.sourceEvent.cancelable===!1)return;const i=t();if(i==="abort")return;const s=i==="capped";this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==e.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=s,this.firstWheelEventDirection=e.deltaY<0,s||e.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}},ZV=["zoom","scrollbar"],U7=class extends ri{constructor(e){super(),this.ctx=e,this.wheelSequencer=new K7,this.cleanup.register(e.eventsHub.on("axis-dom-proxy:mouseenter",t=>this.onAxisMouseEnter(t)),e.eventsHub.on("axis-dom-proxy:mouseleave",t=>this.onAxisMouseLeave(t)),e.eventsHub.on("axis-dom-proxy:drag-start",t=>this.onAxisDragStart(t)),e.eventsHub.on("axis-dom-proxy:drag-move",t=>this.onAxisDragMove(t)),e.eventsHub.on("axis-dom-proxy:drag-end",t=>this.onAxisDragEnd(t)),e.eventsHub.on("axis-dom-proxy:dblclick",t=>this.onAxisDoubleClick(t)),e.eventsHub.on("axis-dom-proxy:wheel",t=>this.onAxisWheel(t)),e.eventsHub.on("scrollbar:wheel",t=>this.onScrollbarWheel(t)),e.widgets.seriesWidget.addListener("wheel",t=>this.onSeriesAreaWheel(t)))}onAxisMouseEnter(e){this.processEvent("axis-mouseenter",e)}onAxisMouseLeave(e){this.processEvent("axis-mouseleave",e)}onAxisDragStart(e){this.processEvent("axis-drag-start",e)}onAxisDragMove(e){this.processEvent("axis-drag-move",e)}onAxisDragEnd(e){this.processEvent("axis-drag-end",e)}onAxisDoubleClick(e){this.processEvent("axis-dblclick",e)}onSeriesAreaWheel(e){this.wheelSequencer.onWheel(e,()=>this.handleWheelSequencer("wheel",{event:e}))}onAxisWheel({event:e,direction:t}){this.wheelSequencer.onWheel(e,()=>this.handleWheelSequencer("axis-wheel",{event:e,direction:t}))}onScrollbarWheel({event:e,orientation:t}){this.wheelSequencer.onWheel(e,()=>this.handleWheelSequencer("scrollbar-wheel",{event:e,direction:t==="horizontal"?"x":"y"}))}handleWheelSequencer(e,t){let i=!1,s="abort";for(const n of ZV){const o={...t,abort(){s="abort"},capped(){s="capped"},uncapped(){s="uncapped"},stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${n}:${e}`,o),i)return s}return"abort"}processEvent(e,t){let i=!1;for(const s of ZV){const n={...t,stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${s}:${e}`,n),i)return}}},XV={type:"plugin",name:"zoom-base",version:de,dependencies:[$7],create:e=>new U7(e)},ld=Ai-yn,qV="end",QV="middle",Y7=300,mS=(e,t=yn,i=Ai)=>se(t,e,i);function Wi(e){return e.x.max-e.x.min}function Tn(e){return e.y.max-e.y.min}function JV(e,t){return Be(e.min,t.min)&&Be(e.max,t.max)}function eB(e,t){return JV(e.x,t.x)&&JV(e.y,t.y)}function $p(e){return eB(e,Lt())}function vl(e,t,i){if(!e)return{x:0,y:0};const s=mS(t-e.x,0,e.x+e.width),n=mS(i-e.y,0,e.y+e.height),o=1/e.width*s,a=1-1/e.height*n;return{x:mS(o),y:mS(a)}}function cd(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function yS(e,t,i){return{x:{min:e.x.min,max:e.x.min+Wi(e)*t},y:{min:e.y.min,max:e.y.min+Tn(e)*i}}}function tB(e,t,i){const s=Wi(e),n=Tn(e),o=e.x.min+s/2,a=e.y.min+n/2;return{x:{min:o-s*t/2,max:o+s*t/2},y:{min:a-n*i/2,max:a+n*i/2}}}function ro(e,t,i,s){const{min:n,max:o}=t,a=n+(o-n)/2,r=e.max-e.min;switch(i){case"start":return{min:n,max:t.min+r};case"end":return{min:t.max-r,max:o};case"middle":return{min:a-r/2,max:a+r/2};case"pointer":return Z7(e,t,s??a);default:return{min:n,max:o}}}function Z7(e,t,i){const s=e.max-e.min,n=t.max-t.min,o=i*(1-(n-s)),a=i-o,r=e.min+a,l=e.max+a;return{min:r,max:l}}function X7(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function Fo(e){return{x:Sm(e.x),y:Sm(e.y)}}function Sm(e){const t=e.max-e.min;let i=e.max>Ai?Ai-t:e.min,s=e.min{this.timer=void 0,this.run(q7)},e))}clearTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=void 0)}isActive(){return this.timer!=null}},J7=class{constructor(){this.min=0,this.span=1,this.thumbSpan=1}update(e,t,i=this.thumbSpan){const s=se(0,t-e,1);this.span=s,this.thumbSpan=se(0,i,1),this.min=this.clampMin(e,s)}clampMin(e,t=this.span){return se(0,e,1-t)}getThumbBounds(e=this.min,t=this.thumbSpan){const i=this.clampMin(e,t);return{start:i,end:i+t}}isWithinThumb(e){const{start:t,end:i}=this.getThumbBounds();return e>=t&&e<=i}getJumpRange(e){if(!this.canScroll())return;let t=this.clampMin(e-this.thumbSpan/2,this.thumbSpan);return t=this.clampMin(t),{min:t,max:t+this.span}}getStepRange(e){if(!this.canScroll())return;const t=se(0,e,1),{start:i,end:s}=this.getThumbBounds();if(t>=i&&t<=s)return;const n=t0&&this.span<1}},eJ=class{constructor(e,t,i,s){this.ctx=e,this.orientation=t,this.onChange=i,this.onHoverChange=s,this.dragStartRatio=0,this.interactionMode="none",this.state=new J7,this.repeater=new Q7(a=>this.applyStepToward(a)),this.container=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`scrollbar-${t}`,classList:["ag-charts-proxy-scrollbar",`ag-charts-proxy-scrollbar-${t}`],ariaLabel:void 0,role:"presentation"});const n=t==="horizontal"?"ariaLabelScrollbarHorizontal":"ariaLabelScrollbarVertical";this.slider=e.proxyInteractionService.createProxyElement({type:"slider",domIndex:0,tabIndex:0,ariaLabel:{id:n},role:"slider",parent:this.container,classList:["ag-charts-proxy-scrollbar-slider"]});const o=this.slider.getElement();o.ariaValueMin="0",o.ariaValueMax="100",this.slider.step=oB.STEP_HUNDRETH,this.slider.keyboardStep=oB.STEP_ONE,this.slider.orientation=t,this.slider.setPreventsDefault(!1),this.slider.addListener("change",()=>this.onSliderChange()),this.slider.addListener("keydown",a=>this.onSliderKeyDown(a)),this.slider.addListener("drag-start",a=>this.onDragStart(a)),this.slider.addListener("drag-move",a=>this.onDragMove(a)),this.slider.addListener("drag-end",a=>this.onDragEnd(a)),this.slider.addListener("mouseenter",a=>this.handleHoverEvent(a)),this.slider.addListener("mousemove",a=>this.handleHoverEvent(a)),this.slider.addListener("mouseleave",()=>this.onMouseLeave()),this.slider.addListener("wheel",a=>e.eventsHub.emit("scrollbar:wheel",{event:a,orientation:t})),this.thumbFocus=e.proxyInteractionService.createProxyElement({type:"region",parent:this.container,classList:["ag-charts-proxy-scrollbar-thumb-focus"],role:"presentation"}),this.thumbFocus.setAriaHidden(!0),this.thumbFocus.setPointerEvents("none")}destroy(){this.interactionBounds=void 0,this.repeater.stop(),this.container.destroy()}updateBounds(e){this.interactionBounds=void 0,this.container.setBounds(e),this.slider.setBounds({x:0,y:0,width:e.width,height:e.height})}updateVisibility(e){this.container.setHidden(!e)}updateMinMax(e,t,i=this.state.thumbSpan,s){this.state.update(e,t,i);const n=this.ctx.localeManager.t("ariaValuePanRange",{min:Math.round(e*100)/100,max:Math.round(t*100)/100}),o=this.slider.getElement();o.ariaValueText=n,(!s?.skipSliderUpdate||Math.abs(this.slider.getValueRatio()-e)>1e-9)&&this.slider.setValueRatio(e,{ariaValueText:n})}updateThumbBounds(e,t,i){const s=Math.max(0,i??0);this.thumbFocus.getElement().style.borderRadius=`${s}px`,this.thumbFocus.setBounds({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height})}update(e,t,i){this.onChange(e,t),this.updateMinMax(e,t,void 0,i)}onSliderChange(){const e=this.state.clampMin(this.slider.getValueRatio()),t=e+this.state.span;this.update(e,t,{skipSliderUpdate:!0})}onSliderKeyDown(e){const{code:t}=e.sourceEvent,i=this.orientation==="vertical",s=i&&t==="ArrowUp"||!i&&t==="ArrowLeft",n=i&&t==="ArrowDown"||!i&&t==="ArrowRight";if(!s&&!n)return;e.sourceEvent.preventDefault();const o=this.slider.getElement();o.step=this.slider.keyboardStep?.attributeValue??"1",s?o.stepDown():n&&o.stepUp(),this.onSliderChange()}onDragMove(e){if(e.sourceEvent.preventDefault(),this.interactionMode==="drag"){const{isHorizontal:n,size:o,start:a}=this.getInteractionBounds()??{};if(a==null||o==null)return;const r=(n?e.originDeltaX:e.originDeltaY)/o,l=this.state.clampMin(this.dragStartRatio+r),c=l+this.state.span;this.update(l,c);return}if(this.interactionMode!=="step")return;const t=this.getPointerInfo(e);if(t==null||!Number.isFinite(t.ratio))return;const{ratio:i,inCrossBounds:s}=t;if(!s){this.repeater.stop();return}this.repeater.updateTarget(i)}onDragEnd(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0,this.setInteraction("none"),this.onHoverChange(!1)}onDragStart(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0;const t=this.getClickInfo(e);if(t?.inBounds){if(t.inThumb){this.dragStartRatio=this.slider.getValueRatio(),this.setInteraction("drag");return}if(e.sourceEvent.shiftKey){this.jumpTo(t.ratio),this.setInteraction("none");return}this.beginStepRepeat(t.ratio)}}onMouseLeave(){this.onHoverChange(!1)}getClickInfo(e){const t=this.getPointerRatio(e);return t==null?void 0:t>=0&&t<=1?{ratio:t,inBounds:!0,inThumb:this.isWithinThumb(t)}:{ratio:0,inBounds:!1,inThumb:!1}}getPointerRatio(e){return this.getPointerInfo(e)?.ratio}getPointerInfo(e){if(e.device==="keyboard")return;const{isHorizontal:t,size:i,start:s,crossStart:n,crossSize:o}=this.getInteractionBounds(),a=t?e.clientX:e.clientY,r=t?e.clientY:e.clientX,l=(a-s)/i,c=r>=n&&r<=n+o;return{ratio:l,inCrossBounds:c}}jumpTo(e){const t=this.state.getJumpRange(e);t&&this.update(t.min,t.max)}applyStepToward(e){const t=this.state.getStepRange(e);return t?(this.update(t.min,t.max),!1):!0}beginStepRepeat(e){this.setInteraction("step"),this.repeater.start(e)}setInteraction(e){this.interactionMode=e,e!=="step"&&this.repeater.stop()}getInteractionBounds(){if(this.interactionBounds)return this.interactionBounds;const{width:e,height:t,left:i,top:s}=this.container.getBoundingClientRect(),n=this.orientation==="horizontal",o=n?e:t,a=n?i:s,r=n?s:i,l=n?t:e;return this.interactionBounds={isHorizontal:n,size:o,start:a,crossStart:r,crossSize:l},this.interactionBounds}isWithinThumb(e){return this.state.isWithinThumb(e)}handleHoverEvent(e){if(this.interactionMode==="drag")return;const t=this.getPointerInfo(e);if(!t){this.onHoverChange(!1);return}const i=this.isWithinThumb(t.ratio);this.onHoverChange(i)}},lo=class extends dh{constructor(){super(...arguments),this.enabled=!1,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.opacity=1}};g([m,K()],lo.prototype,"enabled",2),g([m,K()],lo.prototype,"fill",2),g([m,K()],lo.prototype,"fillOpacity",2),g([m,K()],lo.prototype,"stroke",2),g([m,K()],lo.prototype,"strokeWidth",2),g([m,K()],lo.prototype,"strokeOpacity",2),g([m],lo.prototype,"lineDash",2),g([m],lo.prototype,"lineDashOffset",2),g([m],lo.prototype,"cornerRadius",2),g([m],lo.prototype,"opacity",2);var hC=class extends dh{};g([m,K()],hC.prototype,"fill",2),g([m,K()],hC.prototype,"stroke",2);var xS=class extends lo{constructor(){super(...arguments),this.minSize=20,this.hoverStyle=new hC}};g([m,K()],xS.prototype,"minSize",2),g([m],xS.prototype,"hoverStyle",2);var rr=class extends dh{constructor(){super(...arguments),this.enabled=!1,this.thickness=12,this.spacing=4,this.tickSpacing=0,this.placement="outer",this.visible="auto",this.track=new lo,this.thumb=new xS}};g([m,K()],rr.prototype,"enabled",2),g([m,K()],rr.prototype,"thickness",2),g([m,K()],rr.prototype,"spacing",2),g([m,K()],rr.prototype,"tickSpacing",2),g([m,K()],rr.prototype,"placement",2),g([m,K()],rr.prototype,"visible",2),g([m],rr.prototype,"track",2),g([m],rr.prototype,"thumb",2);var rB=class extends rr{};g([m,K()],rB.prototype,"position",2);var lB=class extends rr{};g([m,K()],lB.prototype,"position",2);var{BBox:Kp,Group:tJ,Rect:cB,LayoutElement:iJ,InteractionState:sJ}=N,nJ=.1,oJ="pan",co=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisScrolling=!1,this.enableSeriesAreaScrolling=!1,this.track=new lo,this.thumb=new xS,this.horizontal=new rB,this.vertical=new lB,this.scrollPanner=new nB,this.state={horizontal:this.createOrientationState("horizontal"),vertical:this.createOrientationState("vertical")},this.cleanup.register(e.scene.attachNode(this.state.horizontal.group),e.scene.attachNode(this.state.vertical.group),e.layoutManager.registerElement(iJ.Scrollbar,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",()=>this.updateThumbs()),e.eventsHub.on("zoom-interaction:scrollbar:wheel",t=>this.onWheel(t)),e.eventsHub.on("zoom-interaction:scrollbar:axis-wheel",t=>this.onAxisWheel(t)),e.eventsHub.on("zoom-interaction:scrollbar:scrollbar-wheel",t=>this.onScrollbarWheel(t)))}createOrientationState(e){const t=new tJ({name:`scrollbar-${e}`,zIndex:17}),i=new cB,s=new cB;t.append(i),t.append(s);const n=new eJ(this.ctx,e,(a,r)=>this.handleUserChange(e,a,r),a=>this.handleHoverChange(e,a)),o=this.resolveProperties(e);return{orientation:e,group:t,track:i,thumb:s,dom:n,properties:o,position:this.getDefaultPosition(e),positionHasAxis:!1,hovered:!1}}resolveProperties(e){return e==="horizontal"?this.horizontal:this.vertical}getDefaultPosition(e){return e==="horizontal"?"bottom":"left"}resolveAxis(e,t){const i=e==="horizontal"?"x":"y",s=this.ctx.axisManager.getAxisContext(i);if(s.length===0)return{position:this.getDefaultPosition(e),positionHasAxis:!1};if(t==null){const o=s[0];return{axis:o,position:o.position??this.getDefaultPosition(e),positionHasAxis:!0}}const n=s.find(o=>o.position===t);return n?{axis:n,position:t,positionHasAxis:!0}:{axis:s[0],position:t,positionHasAxis:!1}}onLayoutStart({scrollbars:e,layoutBox:t}){for(const i of["horizontal","vertical"]){const s=this.state[i],n=this.resolveProperties(i),{min:o,max:a}=this.getZoomRange(s.orientation),r=se(0,a-o,1),{axis:{axisId:l}={},position:c,positionHasAxis:h}=this.resolveAxis(i,n.position);s.properties=n,s.axisId=l,s.position=c,s.positionHasAxis=h;const d=this.updateVisibility(s,r);if(!d||l==null)continue;const{thickness:u,spacing:p,placement:f,tickSpacing:y}=n;h?e[l]={enabled:d,thickness:u,spacing:p,tickSpacing:y,placement:f}:t.shrink(p+u,c),this.updateStyles(s)}}onLayoutComplete(e){this.ctx.eventsHub.emit("axis-dom-proxy:update",{source:"scrollbar",enabled:this.enabled,enableDoubleClick:!1,enableDragging:!1,enableScrolling:this.enableAxisScrolling}),this.seriesRect=e.series.rect;for(const t of["horizontal","vertical"]){const i=this.state[t],{properties:{enabled:s,visible:n}}=i;if(!s||n==="never")continue;const o=this.getLayoutRect(i,t,e);i.layoutRect=o,o&&(this.updateTrack(i,o),this.updateThumb(i,o))}}getLayoutRect(e,t,i){const{properties:{thickness:s,spacing:n},position:o,positionHasAxis:a}=e,r=e.axisId?i.axes[e.axisId]:void 0;if(!r)return;const{x:l,y:c,width:h,height:d}=i.series.rect,u=t==="horizontal";if(!a)if(u){const x=o==="bottom"?c+d+n:c-n-s;return new Kp(l,x,h,s)}else{const x=o==="right"?l+h+n:l-n-s;return new Kp(x,c,s,d)}const{scrollbar:p,translation:f}=r;if(!p?.enabled)return;const y=u?f.y+p.offset:f.x+p.offset;return u?new Kp(l,y,h,s):new Kp(y,c,s,d)}updateStyles({track:e,thumb:t,properties:i,hovered:s}){e.setStyleProperties(i.track),e.cornerRadius=i.track.cornerRadius??0,e.opacity=i.track.opacity??1,t.setStyleProperties(i.thumb),t.cornerRadius=i.thumb.cornerRadius??0,t.opacity=i.thumb.opacity??1;const n=i.thumb.hoverStyle;t.fill=s?n?.fill??i.thumb.fill:i.thumb.fill,t.stroke=s?n?.stroke??i.thumb.stroke:i.thumb.stroke}updateTrack(e,t){e.track.x=t.x,e.track.y=t.y,e.track.width=t.width,e.track.height=t.height,e.dom.updateBounds(t)}updateThumb(e,t){const{min:i,max:s}=this.getZoomRange(e.orientation),n=se(0,s-i,1);if(!this.updateVisibility(e,n)||t.width<=0||t.height<=0)return;const a=e.properties.thumb.minSize??0;let r;if(e.orientation==="horizontal"){const l=Math.min(Math.max(a,t.width*n),t.width),c=se(t.x,t.x+t.width*i,t.x+t.width-l);e.thumb.x=c,e.thumb.y=t.y,e.thumb.width=l,e.thumb.height=t.height,r=se(0,l/t.width,1)}else{const l=Math.min(Math.max(a,t.height*n),t.height),c=se(t.y,t.y+t.height*i,t.y+t.height-l);e.thumb.x=t.x,e.thumb.y=c,e.thumb.width=t.width,e.thumb.height=l,r=se(0,l/t.height,1)}e.dom.updateThumbBounds(e.thumb,t,e.properties.thumb.cornerRadius),e.dom.updateMinMax(i,s,r)}updateThumbs(){if(this.seriesRect)for(const e of["horizontal","vertical"]){const t=this.state[e],i=t.layoutRect;if(!i||!t.properties.enabled||t.properties.visible==="never")continue;const s=e==="horizontal"?new Kp(this.seriesRect.x,i.y,this.seriesRect.width,t.properties.thickness):new Kp(i.x,this.seriesRect.y,t.properties.thickness,this.seriesRect.height);this.updateThumb(t,s)}}updateVisibility(e,t){const i=e.properties.enabled&&e.axisId!=null&&e.properties.visible!=="never"&&(e.properties.visible==="always"||t<1);return e.group.visible=i,e.track.visible=i,e.thumb.visible=i,e.dom.updateVisibility(i),i}getZoomRange(e){const t=this.ctx.zoomManager.getZoom(),i=e==="horizontal",s=i?t?.x:t?.y;return!i&&s!=null?{min:1-(s.max??1),max:1-(s.min??0)}:{min:s?.min??0,max:s?.max??1}}handleUserChange(e,t,i){if(!this.ctx.interactionManager.isState(sJ.ZoomDraggable))return;const s=e==="horizontal";s||([t,i]=[1-i,1-t]);const n=s?{x:{min:t,max:i}}:{y:{min:t,max:i}};this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},n)}handleHoverChange(e,t){const i=this.state[e],s=t&&i.group.visible;i.hovered!==s&&(i.hovered=s,this.updateStyles(i),this.ctx.eventsHub.emit("chart:request-update",{type:9}))}onWheel(e){if(this.enableSeriesAreaScrolling)return this.handleWheel(e)}onAxisWheel(e){if(this.enableAxisScrolling)return this.handleWheel(e)}onScrollbarWheel(e){return this.handleWheel(e)}handleWheel(e){const{seriesRect:t,ctx:{zoomManager:i}}=this,{event:s}=e,n=Math.abs(s.deltaX)>Math.abs(s.deltaY);if(n&&!this.horizontal.enabled||!n&&!this.vertical.enabled)return;e.stopProcessing();const o=n?"x":"y",a=this.ctx.zoomManager.getPrimaryAxisId(o);if(!t||!a){e.abort();return}const r=this.scrollPanner.update(s,nJ,oJ,t,i.getAxisZooms()),l={[o]:{min:r[a].min,max:r[a].max}};i.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},l);const c=this.getZoom();s.deltaY>0&&c.y.min===yn||s.deltaY<0&&c.y.max===Ai?e.capped():e.uncapped()}getZoom(){return Lt(this.ctx.zoomManager.getZoom())}destroy(){super.destroy(),this.state.horizontal.dom.destroy(),this.state.vertical.dom.destroy()}};g([m],co.prototype,"enabled",2),g([m],co.prototype,"enableAxisScrolling",2),g([m],co.prototype,"enableSeriesAreaScrolling",2),g([m],co.prototype,"thickness",2),g([m],co.prototype,"spacing",2),g([m],co.prototype,"tickSpacing",2),g([m],co.prototype,"placement",2),g([m],co.prototype,"visible",2),g([m],co.prototype,"track",2),g([m],co.prototype,"thumb",2),g([m],co.prototype,"horizontal",2),g([m],co.prototype,"vertical",2);var dC={...ie,...X,...ae,cornerRadius:P,opacity:oe},hB={...dC,minSize:P,hoverStyle:{fill:ie.fill,stroke:X.stroke}},dB={enabled:E,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:dC,thumb:hB},aJ={...dB,position:U("top","bottom")},rJ={...dB,position:U("left","right")},lJ={enabled:E,enableAxisScrolling:E,enableSeriesAreaScrolling:E,thickness:P,spacing:P,tickSpacing:P,visible:U("auto","always","never"),placement:U("outer","inner"),track:dC,thumb:hB,horizontal:aJ,vertical:rJ},uB={enabled:{$path:"../enabled"},thickness:{$path:"../thickness"},spacing:{$path:"../spacing"},tickSpacing:{$path:"../tickSpacing"},placement:{$path:"../placement"},visible:{$path:"../visible"},track:{fill:{$path:"../../track/fill"},stroke:{$path:"../../track/stroke"},fillOpacity:{$path:"../../track/fillOpacity"},strokeWidth:{$path:"../../track/strokeWidth"},lineDash:{$path:"../../track/lineDash"},lineDashOffset:{$path:"../../track/lineDashOffset"},opacity:{$path:"../../track/opacity"},cornerRadius:{$path:"../../track/cornerRadius"}},thumb:{fill:{$path:"../../thumb/fill"},stroke:{$path:"../../thumb/stroke"},fillOpacity:{$path:"../../thumb/fillOpacity"},strokeWidth:{$path:"../../thumb/strokeWidth"},lineDash:{$path:"../../thumb/lineDash"},lineDashOffset:{$path:"../../thumb/lineDashOffset"},opacity:{$path:"../../thumb/opacity"},cornerRadius:{$path:"../../thumb/cornerRadius"},minSize:{$path:"../../thumb/minSize"},hoverStyle:{fill:{$path:"../../../thumb/hoverStyle/fill"},stroke:{$path:"../../../thumb/hoverStyle/stroke"}}}},cJ={enabled:!1,enableAxisScrolling:!1,enableSeriesAreaScrolling:!1,thickness:12,spacing:16,tickSpacing:0,placement:"outer",visible:"auto",track:{fill:{$foregroundBackgroundMix:.03},stroke:{$foregroundBackgroundMix:.177},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6},thumb:{fill:{$foregroundBackgroundMix:.125},stroke:{$foregroundBackgroundMix:.364},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6,minSize:20,hoverStyle:{fill:{$mix:[{$path:"../fill"},{$ref:"foregroundColor"},.075]},stroke:{$mix:[{$path:"../stroke"},{$ref:"foregroundColor"},.075]}}},vertical:uB,horizontal:uB},pB={type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,version:de,dependencies:[XV],options:lJ,themeTemplate:cJ,create:e=>new co(e)},{LayoutElement:hJ,Group:dJ,Label:Mm,Rect:uJ,Text:is}=N,gB={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},pJ={up:"positive",down:"negative"},gJ={hlc:"altNeutral"},uC=class extends q{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};g([m],uC.prototype,"fill",2),g([m],uC.prototype,"fillOpacity",2);var On=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Mm,this.positive=new Mm,this.negative=new Mm,this.neutral=new Mm,this.altNeutral=new Mm,this.background=new uC,this.layoutStyle="block",this.id="status-bar",this.layer=new dJ({name:"StatusBar",zIndex:14}),this.labelGroup=this.layer.appendChild(new N.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new uJ),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new is),value:this.labelGroup.appendChild(new is),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(e.scene.attachNode(this.layer),e.layoutManager.registerElement(hJ.Overlay,t=>this.startPerformLayout(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("highlight:change",()=>this.updateHighlight()),e.eventsHub.on("data:update",t=>{this.chartData=t}))}updateDomainsFromSeries(){if(!this.enabled)return;const e=this.ctx.chartService.series;if(e.length===0)return;let t,i;for(const s of e){const o=s.getDomain("y")?.domain;!Array.isArray(o)||o.length<2||(s.type==="bar"?i=[o[0],o.at(-1)]:t=[o[0],o.at(-1)])}for(const s of this.labels){if(this[s.key]==null){s.domain=void 0;continue}s.domain=s.key==="volumeKey"?i:t}}startPerformLayout({layoutBox:e}){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled){this.labelGroup.visible=!1;return}this.updateDomainsFromSeries();const t=4,i=12,s=0,n=8;this.labelGroup.translationY=e.y+s;const o=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),a=Fn(o),r=gB[this.getChartType()]??0;let l=0,c,h="alphabetic";if(this.layoutStyle==="block")e.shrink(s+a+n,"top"),c=o+(a-o)/2;else{const{title:d}=this.ctx.chartService;if(h="top",c=s+d.padding,d.enabled){const u=d.node.getBBox();l=u.x+u.width+i}else l=d.padding}for(const{label:d,configuration:u,title:p,value:f,domain:y,formatter:x}of this.labels){if(y==null||!(r&u)){p.visible=!1,f.visible=!1;continue}const b=et(this.positive),v=et(this.negative),S=Math.max(b.textWidth(x.format(y[0])),b.textWidth(x.format(y[1])),v.textWidth(x.format(y[0])),v.textWidth(x.format(y[1])));p.visible=!0,f.visible=!0;const M=et(this.title).measureLines(d);p.setFont(this.title),p.fill=this.title.color,p.text=d,p.textAlign="left",p.textBaseline=h,p.y=c,p.x=l,l+=M.width+t,f.textAlign="left",f.textBaseline=h,f.y=c,f.x=l,l+=S+i}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=l-i,this.backgroundNode.height=a+s+n,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.chartData?.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let s=i==null?void 0:pJ[i];s==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]new On(e)},{CartesianAxis:gC,ContinuousScale:fB,TimeScale:fJ,UnitTimeScale:mJ,TooltipManager:yJ}=N,lr=ve.create("sync");function mB(e,t,i){const s=e.getKeys(t),n=e.getKeys(i);return e.shouldFlipXY?.()?[n,s]:[s,n]}function fC(e="x"){switch(e){case"x":return["x"];case"y":return["y"];case"xy":return["x","y"]}}function xJ(e,t,i){return fJ.is(e)||mJ.is(e)?!Vn(t.map(s=>s?.valueOf()),i.map(s=>s?.valueOf())):!Vn(t,i)}var Rc=class extends q{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="id",this.domainSync=new jg}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))lr("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=3){lr("ChartSync.updateChart()",e.id,Gn[t],e),t===3?e.ctx.eventsHub.emit("chart:request-update",{type:t,opts:{forceNodeDataRefresh:!0}}):e.ctx.eventsHub.emit("chart:request-update",{type:t})}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change-complete",t=>this.onZoom(t))}onZoom(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(this.groupId)){if(!i.modulesManager.getModule("sync")?.zoom)continue;const n=i.modulesManager.getModule("zoom");if(!n)continue;const o=this.prepareZoomUpdate();e.source!=="sync"&&(lr("ChartsSyncManager.enabledZoomSync()",i.id,o),n.updateSyncZoom(o))}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.();const e=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this)),t=this.moduleContext.eventsHub.on("active:load-memento",this.onActiveLoadMemento.bind(this));this.disableNodeInteractionSync=()=>{e(),t()}}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;lr("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[s]=fC(this.axes),n=s==="x"?"y":"x",[o,a]=i?mB(i,s,n):[],r=bm(e.currentHighlight);let l=o?.[0]?r?.[o[0]]:void 0,c=!1;if(Cs(l)&&(c=!0,l=l.getTime()),!e.currentHighlight?.datum){for(const d of t.getGroupSiblings(this.groupId))d.modulesManager.getModule("sync")?.nodeInteraction&&(d.ctx.highlightManager.updateHighlight(`${d.id}-sync`,void 0,!0),d.ctx.tooltipManager.removeTooltip(`${d.id}-sync`,void 0,!0));return}const h=t.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(s,n,h?a:[],c,l,e)}onActiveLoadMemento(e){const{activeItem:t,chartId:i}=e;if(t===void 0){this.moduleContext.highlightManager.updateHighlight(`${i}-sync`,void 0,!1),this.moduleContext.tooltipManager.removeTooltip(`${i}-sync`,void 0,!1);for(const s of this.moduleContext.syncManager.getGroupSiblings(this.groupId))s.onSyncActiveClear()}}findMatchingHighlightNodes(e,t,i,s,n,o){const{syncManager:a}=this.moduleContext;lr("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const r of a.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let c=!1;for(const h of r.axes){if(!gC.is(h)||h.direction!==e)continue;const d=r.series.filter(u=>{if(!u.visible)return!1;if(i.length>0){const[,p]=mB(u,e,t);return i.every(f=>p.includes(f))}return!0}).map(this.findMatchingNodes(h,e,s,n)).filter(vt);if(d.length===1&&d[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,d[0].nodeDatum),c=!0;break}}c||(lr("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,o),this.dispatchHighlightUpdate(r))}}findMatchingNodes(e,t,i,s){return n=>{if(n.getKeyAxis(e.direction)!==e.id)return;const a=n.contextNodeData?.nodeData??[];if(!a?.length)return;const r=a[0],l=`${t}Key`;if(!q0(r,l))return;const c=r[l],h=a.find(d=>{const u=d.datum[c];return i?u.getTime()===s:u===s});return h?{series:n,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){lr("ChartSync.dispatchHighlightUpdate()",e.id,t);const i=t==null;e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t,i);const s=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&s){const n=e.seriesAreaBoundingBox,o=n.x+(t.midPoint?.x??t.point?.x??0),a=n.y+(t.midPoint?.y??t.point?.y??0),r=yJ.makeTooltipMeta({type:"pointermove",canvasX:o,canvasY:a},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,r,e.getTooltipContent(t.series,t.datumIndex,t,"tooltip"))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`,void 0,!0);this.updateChart(e,7)}async getSyncedDomain(e){if(!gC.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,idDomains:s,positionDomains:n}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(e,n):this.domainMode==="direction"?this.calculateDerivedDomain(e,i):this.calculateDerivedDomain(e,s)}updateDomainState(e){var t,i,s,n,o;const{syncManager:a}=this.moduleContext,r=a.getChart().id,l=e.id,c=a.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),d=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0}),u=(i=d.sources)[r]??(i[r]={});u[l]=e.dataDomain.domain,d.dirty=!0;const p=c.domainsById??(c.domainsById={}),f=p[l]??(p[l]={derived:[],sources:{},dirty:!0}),y=(s=f.sources)[r]??(s[r]={});y[l]=e.dataDomain.domain,f.dirty=!0;const x=c.domainsByPosition??(c.domainsByPosition={}),b=x[n=e.position]??(x[n]={derived:[],sources:{},dirty:!0}),v=(o=b.sources)[r]??(o[r]={});return v[l]=e.dataDomain.domain,b.dirty=!0,{groupState:c,directionDomains:d,idDomains:f,positionDomains:b}}validateAxis(e,t){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";fC(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:s,nice:n,reverse:o}=e,a=new Set(e.boundSeries.flatMap(r=>r.getKeys(e.direction)));for(const r of t.members){const{axes:l,modulesManager:c}=r,h=c.getModule("sync"),d=fC(h?.axes),u=l.filter(f=>d.includes(f.direction)).filter(f=>f.boundSeries.some(y=>y.getKeys(f.direction).some(x=>a.has(x))));if(u.length===0)continue;const[p]=u;if(p.min!==i||p.max!==s||p.nice!==n||p.reverse!==o){W.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(e,t){const i=t.members,[{axes:s}]=i,{direction:n,min:o,max:a,nice:r,reverse:l}=e;for(const c of s)if(n===c.direction&&(r!==c.nice||l!==c.reverse||o!==c.min&&(je(o)||je(c.min))||a!==c.max&&(je(a)||je(c.max)))){W.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;let i=t.derived;const s=Object.values(t.sources).map(o=>Object.values(o));let n;return fB.is(e.scale)?n=s.flat(2):n=s.flat().toSorted((o,a)=>o.length>a.length?-1:1).flat(),t.derived=ag(n),fB.is(e.scale)&&(i=kt(i),t.derived=kt(t.derived)),t.dirty=!1,xJ(e.scale,i,t.derived)&&(lr(e.id,"updated",{before:i,after:t.derived}),this.updateSiblings()),t.derived}removeAxis(e){if(!gC.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),s=t.getChart().id,n=e.id;delete i?.domains?.[e.direction]?.sources?.[s]?.[n],delete i?.domainsByPosition?.[e.position]?.sources?.[s]?.[n],delete i?.domainsById?.[n]?.sources?.[s]?.[n]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)lr("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.waitForCompletion(),t++;t>0&&lr("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:e}=this.moduleContext,t=e.getZoom();return this.axes==="x"?delete t?.y:this.axes==="y"&&delete t?.x,Lt(t)}onEnabledChange(){const{syncManager:e,highlightManager:t}=this.moduleContext;this.enabled?(e.subscribe(this.groupId),t.unhighlightDelay=0):(e.unsubscribe(this.groupId),t.unhighlightDelay=100),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Rc.className="Sync",g([m,Rt(e=>e.onEnabledChange())],Rc.prototype,"enabled",2),g([m,Rt((e,t,i)=>e.onGroupIdChange(t,i))],Rc.prototype,"groupId",2),g([m,Rt(e=>e.onAxesChange())],Rc.prototype,"axes",2),g([m,Rt(e=>e.onNodeInteractionChange())],Rc.prototype,"nodeInteraction",2),g([m,Rt(e=>e.onZoomChange())],Rc.prototype,"zoom",2),g([m,Rt(e=>e.onAxesChange())],Rc.prototype,"domainMode",2);var mC={type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,version:de,options:{enabled:E,groupId:L,axes:U("x","y","xy"),nodeInteraction:E,zoom:E},themeTemplate:{enabled:!1},create:e=>new Rc(e)},yB="#2196f3",bJ="#8a8a8a",xB=class extends N.Rect{constructor(){super(),this.fill=yB,this.fillOpacity=.2,this.zIndex=5}updateValid(){this.fill=yB}updateInvalid(){this.fill=bJ}};xB.className="ZoomRect";var yC=class extends q{constructor(){super(),this.enabled=!1,this.padding=0}};g([m],yC.prototype,"enabled",2),g([m],yC.prototype,"padding",2);var vJ=class{constructor(e,t,i,s,n){this.properties=e,this.zoomManager=t,this.deps=i,this.manuallyAdjusted=!1,n.register(s.on("zoom:save-memento",o=>this.onSaveMemento(o)),s.on("zoom:load-memento",o=>this.onLoadMemento(o)),s.on("zoom:change-request",o=>this.onChangeRequest(o)))}get enabled(){return this.deps.enabled&&this.properties.enabled&&!this.manuallyAdjusted}onManualAdjustment(e){e==="y"&&(this.manuallyAdjusted=!0)}onChangeRequest(e){const t=this.hasYAxisChange(e);if(e.sourceDetail==="scrollbar"&&t&&(this.manuallyAdjusted=!0),e.isReset&&t&&(this.manuallyAdjusted=!1),this.enabled){const i=this.autoScaleYZoom(e.state);i&&e.constrainChanges(i)}}hasYAxisChange(e){for(const t of e.changedAxes)if(e.state[t]?.direction==="y")return!0;return!1}onSaveMemento(e){e.memento.autoScaledAxes=this.enabled?["y"]:void 0}onLoadMemento(e){const{zoom:t,memento:i,navigatorModule:s,zoomModule:n}=e;if(!s||n){let o=i?.autoScaledAxes?.includes("y");if(i?.rangeY)o??(o=!1),t.y=this.zoomManager.rangeToRatioDirection("y",i.rangeY)??{min:0,max:1};else if(i?.ratioY)o??(o=!1),t.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{o??(o=!0);const a=o?this.getAutoScaleYZoom(t.x):void 0;t.y=a??{min:0,max:1}}o!=null&&(this.manuallyAdjusted=!o)}}getAutoScaleYZoom(e){if(!this.enabled)return;const{padding:t}=this.properties;let i;return this.deps.enableIndependentAxes?i=this.primaryAxisZoom("y",e,{padding:t}):i=this.combinedAxisZoom("y",e,{padding:t}),e.min===0&&e.max===1?i==null?void 0:{min:0,max:1}:i}autoScaleYZoom(e){const t=this.zoomManager.getZoom();if(t&&e){const s=this.zoomManager.getAxisZooms();for(const n of["x","y"])for(const o of Ko(e))if(s[o]?.direction===n){t[n]=e[o];break}}if(t?.x==null)return;const i=this.getAutoScaleYZoom(t.x);if(!(i==null||Ht(t.y,i)))return this.zoomManager.toCoreZoomState({x:t.x,y:i})}zoomBounds(e,t,i,s){const n=e.scale,o=n.range;n.range=[0,1];const a=t.scale,r=a.range;a.range=[0,1];let l=1,c=!1,h=0,d=!1;for(const f of t.boundSeries){if(!f.visible)continue;const{connectsToYAxis:y}=f,x=f.getRange("y",[i.min,i.max]);for(const b of x){const v=a.convert(b);Number.isFinite(v)&&(vh&&(h=v,d=!y||b>0))}}if(je(t.min)&&(l=0),je(t.max)&&(h=1),n.range=o,a.range=r,l>=h)return;const u=(c?s:0)+(d?s:0),p=Math.min((h-l)*(1+u),1);if(!(p<=0)){if(c&&d){const f=(h+l)/2;l=f-p/2,h=f+p/2}else!c&&d?h=l+p:c&&!d&&(l=h-p);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=this.zoomManager.getPrimaryAxis(s),o=this.zoomManager.getPrimaryAxis(e);if(!(n==null||o==null))return this.zoomBounds(n,o,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=this.zoomManager.getAxes(),n=e==="x"?"y":"x",o=new Map;for(const c of s)if(c.direction===n)for(const h of c.boundSeries)o.set(h,c);let a=1,r=0;for(const c of s)if(c.direction===e)for(const h of c.boundSeries){const d=o.get(h);if(d==null)continue;const u=this.zoomBounds(d,c,t,i);if(u==null)return;a=Math.min(a,u.min),r=Math.max(r,u.max)}const l=1e-6;if(a1-l&&(r=1),!(a>r))return{min:a,max:r}}},SJ=class{update(e,t,i,s,n,o){return this.oldZoom??(this.oldZoom=Lt(t==="x"?{...n,x:o}:{...n,y:o})),this.updateCoords(e.offsetX,e.offsetY),this.updateZoom(t,i,s)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:s,oldZoom:n}=this;let o=Lt(n);if(!s||!n)return e==="x"?o.x:o.y;const a=vl(i,s.x1,s.y1),r=vl(i,s.x2,s.y2);if(e==="x"){const c=(r.x-a.x)*Wi(n);return o.x.max+=c,o.x=ro(o.x,n.x,t,a.x),o=Fo(o),o.x}const l=(r.y-a.y)*Tn(n);return o.y.max-=l,o.y=ro(o.y,n.y,t,a.y),o=Fo(o),o.y}},{userInteraction:xC}=N,MJ=class{constructor(e,t,i,s,n,o,a){this.eventsHub=e,this.contextMenuRegistry=t,this.zoomManager=i,this.getModuleProperties=s,this.getRect=n,this.updateZoom=o,this.isZoomValid=a}registerActions(e){const{contextMenuRegistry:t}=this,i=e?"show":"hide";if(t.toggle("zoom-to-cursor",i),t.toggle("pan-to-cursor",i),t.toggle("reset-zoom",i),!e)return;t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),t.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const s=a=>{const r=this.getRect();if(!r)return!0;const l=vl(r,a.x,a.y);return this.iterateFindNextZoomAtPoint(l)!=null},n=()=>!$p(Lt(this.zoomManager.getZoom())),o=this.eventsHub.on("context-menu:setup",a=>{t.builtins.items["zoom-to-cursor"].enabled=s(a),t.builtins.items["pan-to-cursor"].enabled=n(),t.builtins.items["reset-zoom"].enabled=iB(this.zoomManager)});return()=>{o(),t.toggle("zoom-to-cursor","hide"),t.toggle("pan-to-cursor","hide"),t.toggle("reset-zoom","hide")}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const s={x:0,y:0,width:t.width,height:t.height};return vl(s,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(xC("contextmenu-zoom-to-cursor"),i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=Lt(this.zoomManager.getZoom()),s=Wi(i),n=Tn(i),o=t.x*s,a=t.y*n,r=ld/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};l=tB(l,s,n),l=cd(l,i.x.min-t.x+o,i.y.min-t.y+a),this.updateZoom(xC("contextmenu-pan-to-cursor"),Fo(l))}onResetZoom(e){this.zoomManager.resetZoom(xC("contextmenu-reset"))}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const s=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(s))return s}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:s}=this.getModuleProperties(),n=Lt(this.zoomManager.getZoom()),o=e.x*Wi(n),a=e.y*Tn(n),r=ld/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};return l=tB(l,i?Wi(n)*t:ld,s?Tn(n)*t:ld),l=cd(l,n.x.min-e.x+o,n.y.min-e.y+a),Fo(l)}},{userInteraction:DJ}=N;function IJ(e){return e.x.min===0&&e.x.max===1&&e.y.min===0&&e.y.max===1}function kJ(e,t){return e.stickToEnd&&t.x.max===1}function bB(e,t,i){const{domainMin:s,domainMax:n}=t,o=n-s;return{axisId:e,visibleMin:s+o*i.min,visibleMax:s+o*i.max}}function vB(e,t){const{domainMin:i,domainMax:s}=e,{visibleMin:n,visibleMax:o}=t,a=s-i;return{direction:"x",min:se(0,(n-i)/a,1),max:se(0,(o-i)/a,1)}}var bC=class extends q{constructor(){super(...arguments),this.strategy="preserveDomain",this.stickToEnd=!1}};g([m],bC.prototype,"strategy",2),g([m],bC.prototype,"stickToEnd",2);var AJ=class{constructor(e,t,i,s){this.onConstrainChangesCallback=e,this.properties=t,this.ctx=i;const n=()=>{i.eventsHub.off("layout:complete",n),s.register(i.eventsHub.on("data:load",o=>this.onDataLoad(o)),i.eventsHub.on("data:update",o=>this.onDataUpdate(o)))};s.register(i.eventsHub.on("layout:complete",n),i.eventsHub.on("zoom:change-request",o=>this.onZoomChangeRequest(o)))}destroy(){}onDataLoad(e){this.performUpdateStrategy()}onDataUpdate(e){this.performUpdateStrategy()}onZoomChangeRequest(e){e.sourceDetail==="internal-requiredWidth"&&(this.desiredChanges=void 0);const t=this.popDesiredChanges();t&&(e.constrainChanges(t),this.onConstrainChangesCallback(e))}computeDomainMinMax(e){const t=this.ctx.axisManager.getAxisIdContext(e);if(!t?.continuous||t.scale.domain.length===0)return;const[i,s]=t.scale.getDomainMinMax();if(typeof i=="number"&&typeof s=="number")return{domainMin:i,domainMax:s};if(i instanceof Date&&s instanceof Date)return{domainMin:i.getTime(),domainMax:s.getTime()};W.error(`Unexpected range types: start (${typeof i}), end (${typeof s})`)}popDesiredChanges(){const{desiredChanges:e}=this;if(e)switch(this.desiredChanges=void 0,e.type){case"domain":{const i={};for(const s of e.domains){const n=this.computeDomainMinMax(s.axisId);n&&(i[s.axisId]=vB(n,s))}return i}case"stickToEnd":{const{axisId:i,difference:s}=e,n=this.computeDomainMinMax(i);if(n){const o={axisId:i,visibleMin:n.domainMax-s,visibleMax:n.domainMax};return{[i]:vB(n,o)}}break}default:return(i=>i)(e)}}performUpdateStrategy(){const e=Lt(this.ctx.zoomManager.getZoom());if(!IJ(e)){if(kJ(this.properties,e))return this.performStickToEnd();switch(this.properties.strategy){case"reset":return this.ctx.zoomManager.resetZoom(DJ("onDataChange-reset"));case"preserveRatios":return;case"preserveDomain":return this.performPreserveDomain();default:return(i=>i)(this.properties.strategy)}}}performPreserveDomain(){this.desiredChanges={type:"domain",domains:[]};const e=this.ctx.zoomManager.getAxes().filter(t=>t.direction==="x");for(const{id:t}of e){const i=this.computeDomainMinMax(t);if(i){const s=this.ctx.zoomManager.getAxisZoom(t),n=bB(t,i,s);this.desiredChanges.domains.push(n)}}}performStickToEnd(){const e=this.ctx.zoomManager.getPrimaryAxisId("x");if(!e)return;const t=this.computeDomainMinMax(e);if(!t)return;const i=this.ctx.zoomManager.getAxisZoom(e);if(!i)return;const{visibleMin:s,visibleMax:n}=bB(e,t,i),o=n-s;this.desiredChanges={type:"stickToEnd",axisId:e,difference:o}}},SB=16,wJ={off:1,short:.01,long:.002},CJ=class{constructor(e){this.ctx=e,this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:wJ[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(this.ctx.agDocument.cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:s=0,y2:n=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?t-s:0,deltaY:this.isPanningY()?i-n:0})}start(e){this.direction=e,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,s=0;if(e.length>0){const n=this.zoomCoordsHistoryIndex%SB;let o=n-1;o<0&&(o=e.length-1);let a=n;a>=e.length&&(a=0);const r=e[o],l=e[a];t=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,s=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,s>0&&this.decelerationValue<1){const n=t/s,o=i/s,a=Math.hypot(n,o),r=Math.atan2(o,n),l=performance.now();this.inertiaHandle=this.ctx.agDocument.requestAnimationFrame(c=>{this.animateInertia(c,c,l,a,r)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:s,y2:n}=e,o=Date.now();t[i%SB]={x:s,y:n,t:o},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,s,n){const o=1-this.decelerationValue,a=-s/Math.log(o),r=s*(o**(t-i)-1)/Math.log(o),l=s*(o**(e-i)-1)/Math.log(o);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(n)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(n)*(l-r):0}),!(l>=a-1)&&(this.inertiaHandle=this.ctx.agDocument.requestAnimationFrame(c=>{this.animateInertia(c,e,i,s,n)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}isPanningX(){return this.direction==null||this.direction==="x"}isPanningY(){return this.direction==null||this.direction==="y"}translateZooms(e,t,i,s){const n=vl(e,e.x+Math.abs(i),e.y+e.height-Math.abs(s)),o=Math.sign(i)*n.x,a=-Math.sign(s)*n.y,r={};for(const[l,c]of rt(t)){if(c==null||c.min===yn&&c.max===Ai)continue;const{direction:h}=c;let d=Lt({[h]:c});d=Fo(cd(d,o*Wi(d),a*Tn(d)));const{min:u,max:p}=d[h];r[l]={direction:h,min:u,max:p}}return r}},LJ=class{updateAxes(e,t,i,s){const n=e.sourceEvent,o={},{anchorPointX:a,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=t,d=vl(i,n.offsetX??n.clientX,n.offsetY??n.clientY);for(const[u,p]of rt(s)){if(p==null)continue;const{direction:f,min:y,max:x}=p;let b={min:y,max:x};const v=h*e.deltaY*(x-y);if(f==="x"&&l)b.max+=v,b=ro(b,p,a,d.x);else if(f==="y"&&c)b.max+=v,b=ro(b,p,r,d.y);else continue;if(b.max0&&this.rect.height>0}updateCoords(e,t,i,s){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:n}=this;if(n.x2=e,n.y2=t,!s)return;const{isScalingX:o,isScalingY:a,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&o&&a){const c=s.width/s.height;n.y2r&&nyn;break;case"pan-end":s=e.x.maxyn;break;case"pan-right":s=e.x.maxi.find(v=>v.identifier===r[b].identifier)),c=r[0].normalX,h=r[1].normalX,d=l[0].clientX,u=l[1].clientX,p=r[0].normalY,f=r[1].normalY,y=n+a-l[0].clientY,x=n+a-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,f,y,x,s,n,o,a)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,s,n,o,a,r,l,c,h,d){const{initialZoom:u,previous:p}=this,f=IB(e,t,i,s,p,"a1","a2",l,h,u.x),y=IB(n,o,a,r,p,"b1","b2",c,d,u.y);return{x:f,y}}};function IB(e,t,i,s,n,o,a,r,l,c){if(e==t){const h=bS(c,i,r,l),d=bS(c,s,r,l),u=(h+d)/2,p=(e-u)/hd;return{min:c.min+p,max:c.max+p}}else{const h=n[o],d=n[a];return Math.abs(i-h)+Math.abs(s-d)<=1?(i=h,s=d):(n[o]=i,n[a]=s),PJ(e,t,i,s,r,l)}}var{userInteraction:zc,InteractionState:Dm}=N,vS=e=>Vd(e,10),Vc="zoom-cursor",Im="zoom-tooltip",ni=class extends ri{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingMode="zoom",this.scrollingStep=ld/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=qV,this.anchorPointY=QV,this.autoScaling=new yC,this.axisDraggingMode="zoom",this.buttons=new Up(this.ctx,this.getModuleProperties.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.onDataChange=new bC,this.axisDragger=new SJ,this.panner=new CJ(this.ctx),this.scroller=new LJ,this.scrollPanner=new nB,this.twoFingers=new EJ,this.deceleration="short",this.dragState=0,this.isState=s=>this.ctx.interactionManager.isState(s),this.destroyContextMenuActions=void 0,this.previousZoomValid=!0,this.previousAxisZoomValid={x:!0,y:!0};const t=new xB;this.selector=new NJ(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new MJ(e.eventsHub,e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this));const i=s=>{if(this.minVisibleItems>0){const n=s.stateAsDefinedZoom();s.constrainZoom(this.constrainZoom(n))}};this.dataChangeHandler=new AJ(i,this.onDataChange,this.ctx,this.cleanup),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",s=>this.onSeriesAreaDoubleClick(s)),e.widgets.seriesDragInterpreter.events.on("drag-start",s=>this.onSeriesAreaDragStart(s)),e.widgets.seriesDragInterpreter.events.on("drag-move",s=>this.onSeriesAreaDragMove(s)),e.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(e.scene.attachNode(t),e.eventsHub.on("series:keynav-zoom",s=>this.onNavZoom(s)),e.eventsHub.on("series:keynav-panx",s=>this.onNavPanX(s)),e.eventsHub.on("zoom-interaction:zoom:wheel",s=>this.onWheel(s)),e.eventsHub.on("zoom-interaction:zoom:axis-mouseenter",s=>this.onAxisMouseEnter(s)),e.eventsHub.on("zoom-interaction:zoom:axis-mouseleave",()=>this.onAxisMouseLeave()),e.eventsHub.on("zoom-interaction:zoom:axis-drag-start",s=>this.onAxisDragStart(s.direction)),e.eventsHub.on("zoom-interaction:zoom:axis-drag-move",s=>this.onAxisDragMove(s.axisId,s.direction,s.event)),e.eventsHub.on("zoom-interaction:zoom:axis-drag-end",()=>this.onAxisDragEnd()),e.eventsHub.on("zoom-interaction:zoom:axis-dblclick",s=>this.onAxisDoubleClick(s.axisId)),e.eventsHub.on("zoom-interaction:zoom:axis-wheel",s=>this.onAxisWheel(s)),e.widgets.seriesWidget.addListener("touchstart",(s,n)=>this.onTouchStart(s,n)),e.widgets.seriesWidget.addListener("touchmove",(s,n)=>this.onTouchMove(s,n)),e.widgets.seriesWidget.addListener("touchend",s=>this.onTouchEnd(s)),e.widgets.seriesWidget.addListener("touchcancel",s=>this.onTouchEnd(s)),e.updateService.addListener("process-data",s=>this.onProcessData(s)),e.eventsHub.on("layout:complete",s=>this.onLayoutComplete(s)),e.eventsHub.on("zoom:change-request",s=>this.onZoomChangeRequested(s)),e.eventsHub.on("zoom:pan-start",s=>this.onZoomPanStart(s)),this.panner.addListener("update",s=>this.onPanUpdate(s)),()=>this.teardown()),this.autoScaler=new vJ(this.autoScaling,e.zoomManager,this,e.eventsHub,this.cleanup)}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.dataChangeHandler.destroy()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){return e?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?$p(this.getZoom()):!0}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this;!t||!i||e?.preventZoomDblClick||!this.isState(Dm.ZoomClickable)||this.resetZoom("zoom-seriesarea-dblclick")}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:s,ctx:{domManager:n,zoomManager:o}}=this;if(!t||!this.isState(Dm.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)||(this.panner.stopInteractions(),this.hoveredAxisId))return;let a=0;const r=this.isPanningKeyPressed(e.sourceEvent);i&&(!s||r)?(n.updateCursor(Vc,"grabbing"),a=2,this.panner.start()):s&&!r&&(a=3),(this.dragState=a)!==0&&o.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(e){const{dragState:t,enabled:i,paddedRect:s,panner:n,selector:o,ctx:{interactionManager:a,tooltipManager:r,eventsHub:l}}=this;if(!this.hoveredAxisId&&!(!i||!s||!this.isState(Dm.ZoomDraggable)||this.isIgnoredTouch(e))){switch(a.pushState(N.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault(),t){case 2:n.update(e);break;case 3:o.update(e,this.getModuleProperties(),s);break;case 0:return}a.isState(N.InteractionState.Frozen)||r.updateTooltip(Im),l.emit("chart:request-update",{type:5,opts:{skipAnimations:!0}})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:e}}=this;this.hoveredAxisId||(e.popState(N.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState()))}handleRegularDragEnd(){const{panner:e,selector:t}=this;switch(this.dragState){case 2:e.stop();break;case 3:if(t.didUpdate()){const i=t.stop(this.seriesRect,this.paddedRect,this.getZoom());i?this.updateZoom(zc("zoom-seriesarea-selector"),i):this.ctx.eventsHub.emit("chart:request-update",{type:9})}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(Vc),this.ctx.tooltipManager.removeTooltip(Im)}onAxisMouseEnter(e){const{anchorPointX:t,anchorPointY:i,axisDraggingMode:s,enabled:n,enableAxisDragging:o}=this;if(this.hoveredAxisId=e.axisId,!n||!o){this.ctx.domManager.updateCursor(Vc);return}const a=this.getZoom();let r,l=!1;if(e.direction==="x"){if(r="ew-resize",l=!Be(Wi(a),ld),!l){const c=yS(a,.999,1);c.x=ro(c.x,a.x,t),l=this.isZoomValid(c,{includeYVisibleRange:!0})}}else if(r="ns-resize",l=!Be(Tn(a),ld),!l){const c=yS(a,1,.999);c.y=ro(c.y,a.y,i),l=this.isZoomValid(c,{includeYVisibleRange:!0})}s==="pan"&&(r="grab"),l?(e.stopProcessing(),this.ctx.domManager.updateCursor(Vc,r)):this.ctx.domManager.updateCursor(Vc)}onAxisMouseLeave(){this.hoveredAxisId=void 0,this.ctx.domManager.updateCursor(Vc),!this.enabled||this.enableAxisDragging}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,ctx:{zoomManager:s}}=this;!t||!i||!this.isState(Dm.ZoomClickable)||(this.previousAxisZoomValid={x:!0,y:!0},s.resetAxisZoom({source:"user-interaction",sourceDetail:"zoom-axis-dblclick"},e))}onAxisDragStart(e){const{axisDraggingMode:t,enabled:i,enableAxisDragging:s,panner:n,ctx:{zoomManager:o}}=this;!i||!s||(n.stopInteractions(),t==="pan"?(this.ctx.domManager.updateCursor(Vc,"grabbing"),this.dragState=2,this.panner.start(e),o.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(e,t,i){const{anchorPointX:s,anchorPointY:n,axisDragger:o,dragState:a,enabled:r,enableAxisDragging:l,seriesRect:c,shouldFlipXY:h,ctx:{interactionManager:d,tooltipManager:u,eventsHub:p,zoomManager:f}}=this;if(!r||!l||!c)return;d.pushState(N.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const y=this.getZoom();if(a===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let x=t==="x"?s:n;h&&(x=t==="x"?n:s);const b=f.getAxisZoom(e),v=o.update(i,t,x,c,y,b);this.autoScaler.onManualAdjustment(t),this.updateAxisZoom(zc("zoom-axis-drag"),e,t,v,{directional:!0})}u.updateTooltip(Im),p.emit("chart:request-update",{type:5,opts:{skipAnimations:!0}})}onAxisDragEnd(){const{axisDraggingMode:e,axisDragger:t,dragState:i,enabled:s,enableAxisDragging:n,ctx:{domManager:o,interactionManager:a,tooltipManager:r}}=this;a.popState(N.InteractionState.ZoomDrag),!(!s||!n||i===0)&&(this.dragState=0,e==="pan"&&this.panner.stop(),t.stop(),o.updateCursor(Vc),r.removeTooltip(Im))}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:s}=this;!this.ctx.interactionManager.isState(N.InteractionState.Focusable)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(zc(`keyboard(${e.delta})`),s.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onNavPanX(e){const{enabled:t}=this;if(!this.ctx.interactionManager.isState(N.InteractionState.Focusable)||!t)return;e.widgetEvent.sourceEvent.preventDefault();const s=e.reverse?{[-1]:1,1:-1,home:"end",end:"home"}[e.delta]:e.delta,n=this.getZoom(),o=Wi(n);if(s==="home")n.x.min=0,n.x.max=o;else if(s==="end")n.x.min=1-o,n.x.max=1;else{const a=s*o;n.x.min+=a,n.x.max+=a,n.x=Sm(n.x)}this.updateZoom(zc(`keyboard-page(${e.delta})`),n)}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:s,paddedRect:n,scrollingMode:o}=this;if(!t||!s||!n||!this.isState(Dm.ZoomWheelable))return;e.stopProcessing();const{deltaX:a,deltaY:r}=e.event,l=a!=null&&r!=null&&Math.abs(a)>Math.abs(r);i&&(o==="pan"||l)?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:s,scrollingMode:n,ctx:{zoomManager:o}}=this;if(!s){e.abort();return}const{event:a}=e,r=this.getZoom(),l=a.deltaY>0&&r.y.min===yn||a.deltaY<0&&r.y.max===Ai,c=i.update(a,t,n,s,o.getAxisZooms());this.updateChanges(zc("zoom-seriesarea-wheel"),c),l?e.capped():e.uncapped()}onWheelScrolling(e){const t=this.getZoom(),i=e.event.deltaY>0&&$p(t);this.handleWheelScrolling(e,i)}onAxisWheel(e){if(!this.enabled||!this.enableAxisScrolling)return;e.stopProcessing();const{event:t,direction:i}=e;if(i!=="x"&&i!=="y")return;const s=i==="x",n=!s,o=this.getModuleProperties({isScalingX:s,isScalingY:n}),a=this.getZoom(),r=t.deltaY>0&&a[i].min===yn&&a[i].max===Ai;this.autoScaler.onManualAdjustment(i),this.handleWheelScrolling(e,r,o)}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{enableIndependentAxes:s,scroller:n,seriesRect:o,ctx:{zoomManager:a}}=this;if(!o){e.abort();return}const{event:r}=e;let l=!0;const c=zc("zoom-axis-wheel");if(s===!0){const h=n.updateAxes(r,i,o,a.getAxisZooms());for(const[d,{direction:u,min:p,max:f}]of rt(h)){const y=u==="x"?this.constrainZoom({x:{min:p,max:f},y:{min:Ai,max:Ai}}).x:{min:p,max:f};l&&(l=this.updateAxisZoom(c,d,u,y))}}else{const h=n.update(r,i,o,this.getZoom());if(h==null)return"abort";l=this.updateUnifiedZoom(c,h,{directional:!0})}t||r.deltaY<0&&!l?e.capped():e.uncapped()}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(zc("zoom-seriesarea-twofingers"),Fo(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.ctx.eventsHub.emit("axis-dom-proxy:update",{source:"zoom",enabled:this.enabled,enableDoubleClick:this.enableDoubleClickToReset,enableDragging:this.enableAxisDragging,enableScrolling:this.enableAxisScrolling}),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect)}onZoomChangeRequested(e){e.sourceDetail!=="zoom-seriesarea-panner"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed($p(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:s,zoomManager:n,interactionManager:o}}=this;if(!i)return;const a=t.translateZooms(i,n.getAxisZooms(),e.deltaX,e.deltaY);this.updateChanges(zc("zoom-seriesarea-panner"),a),o.isState(N.InteractionState.Frozen)||s.updateTooltip(Im)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}constrainZoom(e){return this.ctx.zoomManager.constrainZoomToItemCount(e,this.minVisibleItems,this.autoScaler.enabled)}isZoomValid(e,t){const{minVisibleItems:i,ctx:{zoomManager:s}}=this;if(i===0)return this.previousZoomValid=!0,!0;const n=this.getZoom(),o=vS(Wi(e))=r)return this.previousAxisZoomValid[e]=!0,!0;if(!this.previousAxisZoomValid[e]&&i?.directional)return!1;const c={includeYVisibleRange:!1,autoScaleYAxis:this.autoScaler.enabled},h=n.isVisibleItemsCountAtLeast(l,s,c);return this.previousAxisZoomValid[e]=i?.directional?h:!0,h}resetZoom(e){this.previousZoomValid=!0,this.previousAxisZoomValid={x:!0,y:!0},this.ctx.zoomManager.resetZoom({source:"user-interaction",sourceDetail:e})}updateSyncZoom(e){this.updateZoom({source:"sync",sourceDetail:"internal-updateSyncZoom"},e)}updateChanges(e,t){const i=this.ctx.zoomManager.toZoomState(t)??{},s=Lt(this.ctx.zoomManager.getZoom());this.updateZoom(e,{x:i.x??s.x,y:i.y??s.y})}updateZoom(e,t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e,t):this.updateUnifiedZoom(e,t)}updateUnifiedZoom(e,t,i){return t=this.constrainZoom(t),this.isZoomValid(t,i)?(this.ctx.zoomManager.updateZoom(e,t),!0):(this.ctx.eventsHub.emit("chart:request-update",{type:9,opts:{skipAnimations:!0}}),!1)}updatePrimaryAxisZooms(e,t){this.updatePrimaryAxisZoom(e,t,"x"),this.updatePrimaryAxisZoom(e,t,"y")}updatePrimaryAxisZoom(e,t,i){const s=this.ctx.zoomManager.getPrimaryAxisId(i);s!=null&&this.updateAxisZoom(e,s,i,t[i])}updateAxisZoom(e,t,i,s,n){const{enableIndependentAxes:o,ctx:{zoomManager:a}}=this;if(!s)return!1;const r=this.getZoom();if(o!==!0)return r[i]=s,this.updateUnifiedZoom(e,r,n);if(!this.isAxisZoomValid(i,s,n))return!1;const{source:l,sourceDetail:c}=e;return a.updateChanges({source:l,sourceDetail:c,changes:{[t]:s},isReset:!1}),!0}getZoom(){return Lt(this.ctx.zoomManager.getZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};g([Ze({newValue(e){this.onEnabledChange(e)}}),m],ni.prototype,"enabled",2),g([m],ni.prototype,"enableAxisDragging",2),g([m],ni.prototype,"enableAxisScrolling",2),g([m],ni.prototype,"enableDoubleClickToReset",2),g([Ze({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),m],ni.prototype,"enableIndependentAxes",2),g([m],ni.prototype,"enablePanning",2),g([m],ni.prototype,"enableScrolling",2),g([m],ni.prototype,"enableSelecting",2),g([m],ni.prototype,"enableTwoFingerZoom",2),g([m],ni.prototype,"panKey",2),g([m],ni.prototype,"axes",2),g([m],ni.prototype,"scrollingMode",2),g([m],ni.prototype,"scrollingStep",2),g([m],ni.prototype,"keepAspectRatio",2),g([m],ni.prototype,"minVisibleItems",2),g([m],ni.prototype,"anchorPointX",2),g([m],ni.prototype,"anchorPointY",2),g([m],ni.prototype,"autoScaling",2),g([m],ni.prototype,"axisDraggingMode",2),g([m],ni.prototype,"buttons",2),g([m],ni.prototype,"onDataChange",2),g([Gt("panner.deceleration"),m],ni.prototype,"deceleration",2);var SS=U("pointer","start","middle","end"),Yp={type:"plugin",name:"zoom",enterprise:!0,version:de,dependencies:[XV],options:{enabled:E,enableAxisDragging:E,enableAxisScrolling:E,enableDoubleClickToReset:E,enablePanning:E,enableScrolling:E,enableSelecting:E,enableTwoFingerZoom:E,keepAspectRatio:E,anchorPointX:SS,anchorPointY:SS,axisDraggingMode:U("pan","zoom"),axes:U("x","y","xy"),deceleration:Ie(U("off","short","long"),oe),minVisibleItems:P,panKey:U("alt","ctrl","meta","shift"),scrollingMode:U("pan","zoom"),scrollingStep:oe,autoScaling:{enabled:E,padding:oe},onDataChange:{strategy:zd()("reset","preserveDomain","preserveRatios"),stickToEnd:E},buttons:{enabled:E,buttons:Ft({...Dr,value:U("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:L},"zoom button options array"),visible:U("always","zoomed","hover")}},themeTemplate:{enabled:!1,enableAxisDragging:!0,enableAxisScrolling:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$and:[{$eq:[{$path:"../axes"},"x"]},{$not:{$eq:[{$path:"/series/0/direction"},"horizontal"]}}]},padding:.05},onDataChange:{strategy:"preserveDomain",stickToEnd:!1},anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:{$path:"../enabled"},visible:"hover",buttons:{$shallowSimple:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]}}},create:e=>new ni(e)};Yp.options.enableIndependentAxes=Q(E),Yp.options.buttons.anchorPointX=Q(SS),Yp.options.buttons.anchorPointY=Q(SS);function km(e,t,i){return ls(e.chartService,t,i)}var{AxisInterval:RJ,AxisLabel:zJ,LinearScale:VJ,BBox:BJ,TranslatableGroup:FJ,Selection:_J,Text:HJ}=N,MS=class PL{constructor(t,i){this.ctx=t,this.dataProvider=i,this.id=gi(this),this.axisGroup=new FJ({name:`${this.id}-AxisTicks`,zIndex:3}),this.labelSelection=_J.select(this.axisGroup,HJ),this.interval=new RJ,this.label=new zJ,this.scale=new VJ,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const{placement:t,translationX:i,translationY:s,horizontal:n,label:o}=this;function a(u){}let r,l;switch(t){case"top":case"top-right":case"top-left":r="bottom",l="center",o.mirrored=!1,o.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":r="top",l="center",o.mirrored=!1,o.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":r="middle",l="left",o.mirrored=!0,o.parallel=!1;break;default:}const c=[],h=this.generateTicks(),{ticks:d}=h;return this.labelSelection.update(d,void 0,u=>u.tickId),this.axisGroup.setProperties({translationX:i,translationY:s}),this.labelSelection.each((u,p)=>{u.fontFamily=o.fontFamily,u.fontSize=o.fontSize,u.fontStyle=o.fontStyle,u.fontWeight=o.fontWeight,u.fill=o.color,u.textBaseline=r,u.textAlign=l,u.text=p.tickLabel,u.x=n?p.translation:0,u.y=n?0:p.translation,c.push(u.getBBox())}),c.length>0?BJ.merge(c).translate(i,s):void 0}tickFormatter(t,i,s,n){const{ctx:o}=this,{formatManager:a}=o,r=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:t,boundSeries:r,fractionDigits:n,visibleDomain:void 0};return this.label.formatValue((d,u)=>km(o,d,u),h,c)??a.format((d,u)=>km(o,d,u),h)??a.defaultFormat(h)}}inRange(t,i=.001){const[s,n]=kt(this.scale.range);return t>=s-i&&t<=n+i}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:o}=Nx(Aa(this.scale.range),1,t,i,PL.DefaultTickCount,PL.DefaultMinSpacing),a=this.getTicksData({nice:[!0,!0],interval:this.interval.step,tickCount:o,minTickCount:n,maxTickCount:s});if(this.placement==="bottom"||this.placement==="top"){const r=et(this.label),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;a.ticks=a.ticks.filter(u=>{if(Math.sign(u.translation-d)!==h)return!1;const{width:p}=Ae(u.tickLabel)?en(u.tickLabel,this.label):r.measureLines(Dt(u.tickLabel));return d=u.translation+p*h,!0})}return a}getTicksData(t){const i=[],s=t.nice?this.scale.niceDomain(t):this.scale.domain,n=this.scale.ticks(t,s)?.ticks??[],o=n.reduce((l,c)=>Math.max(l,Uc(c)),0),a=sf(),r=this.tickFormatter(s,n,!1,o);for(let l=0;lthis.onChartHoverChange()),e.layoutManager.registerElement(jJ.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){const{placement:e}=Ol(this.position);return e.startsWith("right")||e.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout({layoutBox:e}){const[t]=this.data;if(!this.enabled||!t?.enabled||t.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t),{strokeWidth:s,padding:n}=this.getContainerStyles(),o=this.updateGradientRect(e,i),a=this.updateAxis(t,o)??new SC(0,0,0,0),r=SC.merge([o,a]);r.grow(n).grow(s);const{left:l,top:c}=this.getMeasurements(e,r);this.updateContainer(r),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[s,n]=t,o=i.length;return t=i.map((a,r)=>r===0?s:r===o-1?n:s+(n-s)*r/(o-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i,gradient:s}=this,{preferredLength:n,thickness:o}=s,a=new SC(0,0,0,0),r=Math.max(t.length-1,1);let l;return this.isVertical()?(l=0,a.width=o,a.height=Math.min(e.height,n)):(l=90,a.width=Math.min(e.width,n),a.height=o),i.x=a.x,i.y=a.y,i.width=a.width,i.height=a.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((c,h)=>({stop:h/r,color:c})),rotation:l},a}updateAxis(e,t){const{axisTicks:i,gradient:s,scale:n}=this,{placement:o}=Ol(this.position),a=this.isVertical(),r=this.reverseOrder!==a;i.placement=o;const l=s.thickness+(n.padding??0);return i.translationX=a?l:t.x,i.translationY=a?t.y:l,i.scale.domain=r?e.colorDomain.slice().reverse():e.colorDomain,i.scale.range=a?[t.x,t.height]:[t.y,t.width],i.calculateLayout()}updateContainer(e){const t=this.getContainerStyles();this.containerNode.setStyleProperties(t),this.containerNode.cornerRadius=t.cornerRadius,this.containerNode.x=e.x,this.containerNode.y=e.y,this.containerNode.width=e.width,this.containerNode.height=e.height}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null||e.series?.isHighlightEnabled()===!1){t.visible=!1;return}const{scale:i,label:s}=this.axisTicks,n=s.fontSize??0,o=i.convert(e.colorValue);let{x:a,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(a-=n/2,r+=o,l/=2):(a+=o,r-=n/2),t.visible=!0,t.fill=s.color,t.rotation=l,t.size=n,t.translationX=a,t.translationY=r}getMeasurements(e,t){const i=u=>{};let{x:s,y:n}=e;const{width:o,height:a}=t,{placement:r,floating:l,xOffset:c,yOffset:h}=Ol(this.position),d=this.getContainerStyles();switch(s+=d.strokeWidth+d.padding.left,n+=d.strokeWidth+d.padding.top,r){case"left":n+=e.height/2-a/2;break;case"right":s+=e.width-o,n+=e.height/2-a/2;break;case"top":s+=e.width/2-o/2;break;case"bottom":s+=e.width/2-o/2,n+=e.height-a;break;case"right-top":case"top-right":s+=e.width-o;break;case"right-bottom":case"bottom-right":s+=e.width-o,n+=e.height-a;break;case"left-bottom":case"bottom-left":n+=e.height-a;break;case"left-top":case"top-left":break;default:i(r)}if(!l)switch(r){case"left":case"left-top":case"left-bottom":e.shrink(o+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":e.shrink(o+this.spacing,"right");break;case"top":case"top-left":case"top-right":e.shrink(a+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":e.shrink(a+this.spacing,"bottom");break;default:i(r)}return s+=c,n+=h,{top:n,left:s}}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:s,fill:n,fillOpacity:o,padding:a}=this,r=typeof a=="number";return{cornerRadius:s,fill:n,fillOpacity:o,padding:{top:r?a:a.top??0,right:r?a:a.right??0,bottom:r?a:a.bottom??0,left:r?a:a.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0}}onChartHoverChange(){this.enabled&&this.updateArrow()}};ho.className="GradientLegend",g([m],ho.prototype,"enabled",2),g([m],ho.prototype,"position",2),g([m],ho.prototype,"reverseOrder",2),g([m],ho.prototype,"gradient",2),g([m],ho.prototype,"spacing",2),g([m],ho.prototype,"border",2),g([m],ho.prototype,"cornerRadius",2),g([m],ho.prototype,"fill",2),g([m],ho.prototype,"fillOpacity",2),g([m],ho.prototype,"padding",2),g([m],ho.prototype,"scale",2);var IS={type:"plugin",name:"gradientLegend",enterprise:!0,version:de,options:{enabled:E,position:Hd,spacing:P,reverseOrder:E,border:Sr,cornerRadius:$,padding:_n,fill:Ls,fillOpacity:oe,gradient:{preferredLength:P,thickness:P},scale:{label:{...$e,minSpacing:P,format:gn,formatter:at},padding:P,interval:{step:$,values:dn,minSpacing:We(P,os("maxSpacing")),maxSpacing:We(P,as("minSpacing"))}}},themeTemplate:{...By,enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1,fill:{$applySwitch:[{$path:"type"},{$ref:"chartBackgroundColour"},["gradient",aM],["pattern",cM],["image",dM]]}},create:e=>{const t=new ho(e);return t.attachLegend(e.scene),t}},{OrdinalTimeScale:UJ,ApproximateOrdinalTimeScale:YJ,APPROXIMATE_THRESHOLD:ZJ,TimeAxisParentLevel:XJ,minimumTimeAxisDatumGranularity:qJ}=N,kS=class extends N.DiscreteTimeAxis{constructor(e){const t=new UJ;super(e,t),this.parentLevel=new XJ,this.accurateScale=t,this.approximateScale=new YJ,this.approximateScale.setSourceScale(t),Object.defineProperty(this,"scale",{get:()=>this.getActiveScale(),configurable:!0})}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}getActiveScale(){const e=this.accurateScale.bandCount(this.visibleRange);return(this.accurateScale.getUniformityCache(this.visibleRange)?.isUniform??!1)&&e>=ZJ?this.approximateScale:this.accurateScale}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=qJ(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=ef(t));const n=tf(e),o=wo(s),a=Jo(s),r=Wl(s);return{type:"date",unit:o,step:a,epoch:r,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:x}=this,b=Mu(e);x!=null&&Yi(x)new kS(e)},AB=[VE,DC].flat(),Zp={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},wB={$clone:{$omit:[["placement","spacing"],{$path:"/series/0/stageLabel"}]}},CB={y:{type:{$if:[Zp,"number","category"]},position:{$if:[Zp,"left",{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},"right","left"]}]},label:{$if:[Zp,void 0,wB]}},x:{type:{$if:[Zp,"category","number"]},position:{$if:[Zp,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},"top","bottom"]},"bottom"]},label:{$if:[Zp,wB,void 0]}}},QJ={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Ly],["pattern",Py],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:Na,xOffset:3,yOffset:3,blur:5},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.6}}},axes:{number:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},category:{line:{enabled:!1}}}},{NODE_UPDATE_STATE_TO_PHASE_MAPPING:JJ}=N;function LB(e,t,i,s){const{x0:n,y0:o,x1:a,y1:r,x2:l,y2:c,x3:h,y3:d,opacity:u}=e;return i?{x0:(n+h)/2,y0:(o+d)/2,x1:(a+l)/2,y1:(r+c)/2,x2:(a+l)/2,y2:(r+c)/2,x3:(n+h)/2,y3:(o+d)/2,opacity:u}:{x0:(n+a)/2,y0:(o+r)/2,x1:(n+a)/2,y1:(o+r)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function eee(e,t){const i=o=>o==null;return{fromFn:(o,a,r)=>{r==="updated"&&i(a)?r="removed":r==="updated"&&i(o.previousDatum)&&(r="added");let l;r==="added"&&o.previousDatum==null&&t==="fade"?l={...Am(o,a),opacity:0}:r==="unknown"||r==="added"?l=LB(a,o.previousDatum,e,t):l={x0:o.x0,y0:o.y0,x1:o.x1,y1:o.y1,x2:o.x2,y2:o.y2,x3:o.x3,y3:o.y3,opacity:o.opacity};const c=JJ[r];return{...l,phase:c}},toFn:(o,a,r)=>{let l;return r==="removed"&&o.datum==null&&t==="fade"?l={...Am(o,a),opacity:0}:r==="removed"||i(a)?l=LB(a,o.previousDatum,e,t):l=Am(o,a),l}}}function Am(e,t){const{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:s,x1:n,y1:o,x2:a,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:NB,valueProperty:tee,keyProperty:iee,updateLabelNode:see,SMALLEST_KEY_INTERVAL:nee,LARGEST_KEY_INTERVAL:oee,diff:aee,fixNumericExtent:ree,seriesLabelFadeInAnimation:TB,resetMotion:lee,resetLabelFn:cee,animationValidation:hee,computeBarFocusBounds:dee,Group:uee,Selection:pee,PointerEvents:OB,motion:gee,checkCrisp:fee,createDatumId:mee}=N,yee=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},PB=class extends N.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[NB.AXIS_ALIGNED,NB.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:cee}}),this.NodeEvent=yee,this.connectorNodeGroup=this.contentGroup.appendChild(new uee({name:`${this.id}-series-connectorNodes`,zIndex:0})),this.connectorSelection=pee.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=OB.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[0,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new Xa}getKeyAxis(e){if(e==="x")return this.properties.xKeyAxis;if(e==="y")return this.properties.yKeyAxis}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:n}=this,o=(y,x,b)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:n,itemId:b}),a=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:a,yScale:r}),d=[];this.needsDataModelDiff()&&this.processedData&&d.push(aee(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||d.push(hee());const u=this.visible?{}:{forceValue:0},p=this.properties.allowNullKeys??!1,{processedData:f}=await this.requestDataModel(e,this.data,{props:[iee(t,c,{id:"xValue",allowNullKey:p}),tee(i,h,{id:"yValue",...u,validation:o,invalidValue:0}),...l?[nee,oee]:[],...d],groupByKeys:!1});this.smallestDataInterval=f.reduced?.smallestKeyInterval,this.largestDataInterval=f.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:n}}=this;if(!t||!i)return{domain:[]};const{keys:[o]}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category"){if(!this.hasData)return{domain:[]};const r=o.filter((c,h)=>n.getItemEnabled({seriesId:s,itemId:h})),l=i.getKeySortMetadata(this,"xValue",t);return{domain:r,sortMetadata:l}}return{domain:this.padBandExtent(o)}}else{const a=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...a),l=[-r,r];return{domain:ree(l)}}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,processedData:s,id:n,ctx:{legendManager:o}}=this,a=this.getCategoryAxis(),r=this.getValueAxis();if(!(e&&t&&a&&r&&i&&s?.type==="ungrouped"))return;const l=a.scale,c=r.scale,h=this.getBarDirection()==="x",{stageKey:d,valueKey:u}=this.properties,p=`${u}`,f={itemId:p,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible},y=this.visible;if(!y)return f;const x=i.resolveKeysById(this,"xValue",s),b=i.resolveColumnById(this,"yValue",s),{groupOffset:v,barOffset:S,barWidth:M}=this.getBarDimensions(),D=fee(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let I;const k=s.dataSources.get(this.id)?.data??[];for(const[A,w]of k.entries()){const C=y&&o.getItemEnabled({seriesId:n,itemId:A}),T=x[A];if(T===void 0&&!this.properties.allowNullKeys)continue;const O=l.convert(T);if(!Number.isFinite(O))continue;const V=Math.round(O)+v+S,z=b[A],R=Math.round(c.convert(-z)),B=Math.round(c.convert(z)),G=this.getItemStyle({datum:w,datumIndex:A},!1),F=Math.max(G.strokeWidth??0,Math.abs(B-R)),_={x:h?Math.min(B,R):V,y:h?V:Math.min(B,R),width:h?F:M,height:h?M:F},Y={x:_.x+_.width/2,y:_.y+_.height/2},Z=this.createLabelData({datumIndex:A,rect:_,barAlongX:h,yDatum:z,datum:w,visible:C}),ne={index:A,series:this,datum:w,datumIndex:A,xValue:T,yValue:z,xKey:d,yKey:u,x:_.x,y:_.y,width:_.width,height:_.height,midPoint:Y,crisp:D,label:Z,visible:C};if(f.nodeData.push(ne),Z!=null&&f.labelData.push(Z),I!=null){const te=I.rect,ue=I.nodeDatum,ge=I.datumIndex;h?f.connectorData.push({datum:ue,datumIndex:ge,x0:te.x,y0:te.y+te.height,x1:te.x+te.width,y1:te.y+te.height,x2:_.x+_.width,y2:_.y,x3:_.x,y3:_.y,opacity:1}):f.connectorData.push({datum:ue,datumIndex:ge,x0:te.x+te.width,y0:te.y,x1:_.x,y1:_.y,x2:_.x,y2:_.y+_.height,x3:te.x+te.width,y3:te.y+te.height,opacity:1})}C&&(I={itemId:p,rect:_,nodeDatum:ne,datumIndex:A})}return f}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:s}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,n=>this.getDatumId(n))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const t=this.getShapeFillBBox();e.connectorSelection.each((i,s)=>{const{fill:n,fillOpacity:o,stroke:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.connectorStyle(s.datumIndex);i.setProperties(Am(i,s)),i.setStyleProperties({fill:n,stroke:a,fillOpacity:o,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h},t)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=OB.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:s=!1,labelSelection:n}=e;n.each((o,a)=>{const r=this.getHighlightStyle(s,a.datumIndex);o.visible=a.visible||s,o.fillOpacity=r.opacity??1,o.opacity=r.opacity??1,see(this,o,t,this.properties.label,a,s,i)})}getHighlightLabelData(e,t){if(t.label)return[{...t.label}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{stageKey:o,valueKey:a,tooltip:r,legendItemName:l}=n,c=this.getCategoryAxis(),h=this.getValueAxis();if(!i||!s||!c||!h)return;const d=s.dataSources.get(this.id)?.data[e],u=i.resolveKeysById(this,"xValue",s)[e],p=i.resolveColumnById(this,"yValue",s)[e],f=this.properties.allowNullKeys??!1;if(!(u===void 0&&!f))return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",u,d,o,l),value:this.getAxisValueText(h,"tooltip",p,d,a,l)}]},{seriesId:t,datum:d,title:o,stageKey:o,valueKey:a,...this.tooltipStyle(d,e)})}resetAllAnimation(e){super.resetAllAnimation(e),lee([this.connectorSelection],Am)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),n=eee(i,"normal");gee.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],n),TB(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),TB(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return mee(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return dee(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:n,lineDashOffset:o,fill:a,stroke:r}=this.properties.getStyle(e);return{marker:{fill:a,fillOpacity:i,stroke:r,strokeWidth:t,strokeOpacity:s,lineDash:n,lineDashOffset:o}}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:n},visible:o}=this;if(!s||!i||e!=="category")return[];const{showInLegend:a}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=r[c],d=this.properties.allowNullKeys??!1;if(!(h==null&&!d))return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:o&&n.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!a}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}},{Label:xee,AbstractBarSeriesProperties:bee,makeSeriesTooltip:vee,AxisLabel:See}=N,IC=class extends xee{constructor(){super(...arguments),this.spacing=0}};g([m],IC.prototype,"placement",2),g([m],IC.prototype,"spacing",2);var EB=class extends See{};g([m],EB.prototype,"placement",2);var uo=class extends bee{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new IC,this.stageLabel=new EB,this.tooltip=vee()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,opacity:1}}};g([m],uo.prototype,"stageKey",2),g([m],uo.prototype,"valueKey",2),g([m],uo.prototype,"fills",2),g([m],uo.prototype,"fillOpacity",2),g([m],uo.prototype,"strokes",2),g([m],uo.prototype,"strokeWidth",2),g([m],uo.prototype,"strokeOpacity",2),g([m],uo.prototype,"lineDash",2),g([m],uo.prototype,"lineDashOffset",2),g([m],uo.prototype,"label",2),g([m],uo.prototype,"stageLabel",2),g([m],uo.prototype,"tooltip",2);function RB(e,{x:t,y:i,width:s,height:n,opacity:o}){return{x1:t,y1:i,x2:t+s,y2:i+n,opacity:o??1}}var{Line:Mee}=N,kC=class extends PB{constructor(e){super({moduleCtx:e,animationResetFns:{datum:RB}}),this.properties=new uo}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.data.reduce((s,n,o)=>s+(t.getItemEnabled({seriesId:e,itemId:o})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:e},t){return this.properties.getStyle(e)}connectorStyle(e){return this.properties.getStyle(e)}nodeFactory(){return new Mee}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:n,visible:o}){const{stageKey:a,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;if(!l.enabled)return;let d,u,p,f;if(i)switch(d=t.x+t.width/2,p="center",h){case"before":u=t.y-c,f="bottom";break;case"after":u=t.y+t.height+c,f="top";break;default:u=t.y+t.height/2,f="middle"}else switch(u=t.y+t.height/2,f="middle",h){case"before":d=t.x-c,p="right";break;case"after":d=t.x+t.width+c,p="left";break;default:d=t.x+t.width/2,p="center"}const y=this.getSeriesDomain("y").domain,x=this.getLabelText(s,n,r,"y",y,l,{itemId:r,value:s,datum:n,stageKey:a,valueKey:r});return{x:d,y:u,textAlign:p,textBaseline:f,text:x,itemId:r,datum:n,datumIndex:e,series:this,visible:o}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each((i,s)=>{i.setProperties(RB(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0,i.opacity=t?.opacity??1})}tooltipStyle(e,t){const{fill:i,stroke:s,fillOpacity:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=this.properties.getStyle(t);return{fill:i,fillOpacity:n,stroke:s,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};kC.className="ConeFunnelSeries",kC.type="cone-funnel";var{coneFunnelSeriesThemeableOptionsDef:Dee}=N,Iee={...ee(qe,["showInLegend"]),...Dee,type:j(Ce("cone-funnel")),stageKey:j(L),valueKey:j(L)},kee={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},Cy]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Ly],["pattern",Py],["image",it]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...Ye,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:{enabled:{$path:["/highlight/enabled",!0]},highlightedItem:{stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},seriesArea:{padding:{top:20,bottom:20}},axes:{number:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},category:{line:{enabled:!1}}}},zB={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:de,dependencies:[hi],options:Iee,defaultAxes:CB,themeTemplate:kee,create:e=>new kC(e)},{Label:Aee,DropShadow:wee,AbstractBarSeriesProperties:Cee,makeSeriesTooltip:Lee,AxisLabel:Nee}=N,Tee=class extends Aee{},VB=class extends Nee{};g([m],VB.prototype,"placement",2);var Sl=class extends q{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:e,stroke:t,fillOpacity:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this;return{fill:e,fillOpacity:i,stroke:t,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,opacity:1}}};g([m],Sl.prototype,"enabled",2),g([m],Sl.prototype,"fill",2),g([m],Sl.prototype,"fillOpacity",2),g([m],Sl.prototype,"stroke",2),g([m],Sl.prototype,"strokeWidth",2),g([m],Sl.prototype,"strokeOpacity",2),g([m],Sl.prototype,"lineDash",2),g([m],Sl.prototype,"lineDashOffset",2);var Ds=class extends Cee{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Sl,this.shadow=new wee().set({enabled:!1}),this.label=new Tee,this.stageLabel=new VB,this.tooltip=Lee()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,opacity:1}}};g([m],Ds.prototype,"stageKey",2),g([m],Ds.prototype,"valueKey",2),g([m],Ds.prototype,"fills",2),g([m],Ds.prototype,"fillOpacity",2),g([m],Ds.prototype,"strokes",2),g([m],Ds.prototype,"strokeWidth",2),g([m],Ds.prototype,"strokeOpacity",2),g([m],Ds.prototype,"lineDash",2),g([m],Ds.prototype,"lineDashOffset",2),g([m],Ds.prototype,"spacingRatio",2),g([m],Ds.prototype,"itemStyler",2),g([m],Ds.prototype,"dropOff",2),g([m],Ds.prototype,"shadow",2),g([m],Ds.prototype,"label",2),g([m],Ds.prototype,"stageLabel",2),g([m],Ds.prototype,"tooltip",2);var{resetBarSelectionsFn:Oee,prepareBarAnimationFunctions:BB,midpointStartingBarPosition:FB,createDatumId:Pee,Rect:Eee,motion:_B}=N,AC=class extends PB{constructor(e){super({moduleCtx:e,animationResetFns:{datum:Oee}}),this.properties=new Ds}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(e){return ce(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new Eee}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:n}){const{valueKey:o,stageKey:a,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain("y").domain,c=this.getLabelText(i,s,o,"y",l,r,{itemId:o,value:i,datum:s,stageKey:a,valueKey:o});return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:a,datum:s,datumIndex:e,series:this,visible:n}}getItemStyle({datum:e,datumIndex:t},i){const{id:s,properties:n}=this,{stageKey:o,valueKey:a,itemStyler:r}=n,l=this.getHighlightStyle(i,t);let h=ce(l,n.getStyle(t));if(r!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),u=this.cachedDatumCallback(Pee(t,i?"highlight":"node"),()=>{const p=this.getHighlightStateString(d,i,t);return this.callWithContext(r,{seriesId:s,datum:e,highlightState:p,stageKey:o,valueKey:a,...h})});u&&(h=ce(u,h))}return h}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:s}=this.properties,n=this.getCategoryDirection()==="x",o=this.getShapeFillBBox();e.each((a,r)=>{const l=this.getItemStyle(r,t);a.setStyleProperties(l,o),a.visible=n?r.width>0:r.height>0,a.crisp=r.crisp,a.fillShadow=s})}tooltipStyle(e,t){return this.getItemStyle({datum:e,datumIndex:t},!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),n=BB(FB(i,"normal"),"unknown");_B.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],n=BB(FB(this.isVertical(),"fade"),"added");_B.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],n,(o,a)=>a.xValue,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};AC.className="FunnelSeries",AC.type="funnel";var{funnelSeriesThemeableOptionsDef:Ree}=N,zee={...Ree,...ee(qe,["showInLegend"]),type:j(Ce("funnel")),stageKey:j(L),valueKey:j(L)},HB={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:de,dependencies:[hi],options:zee,defaultAxes:CB,themeTemplate:QJ,create:e=>new AC(e)},GB=[BE,kw,nS,zB,HB,Ew,oS,hS,dS,iC].flat(),jB=[AB,GB,am,uw,pw,Qv,xm,yw,Jv,xw,Kz,IS,sC,cC,pB,pC,mC,Yp].flat(),{DEFAULT_ANNOTATION_HANDLE_FILL:Vee,DEFAULT_ANNOTATION_STATISTICS_COLOR:Bee,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:Fee,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:WB,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:$B,DEFAULT_ANNOTATION_STATISTICS_FILL:_ee,DEFAULT_ANNOTATION_STATISTICS_STROKE:Hee,DEFAULT_FIBONACCI_STROKES:KB,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:Xp,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Ml,DEFAULT_TEXTBOX_COLOR:Gee,DEFAULT_TEXTBOX_FILL:jee,DEFAULT_TEXTBOX_STROKE:Wee,DEFAULT_TEXT_ANNOTATION_COLOR:$ee}=VL,_o={stroke:Ml},Is={fill:Vee},UB={color:"white",fill:Ml},Dl={color:Ml},dd={color:$ee,fontSize:{$rem:li.LARGE},fontFamily:{$ref:"fontFamily"}},wC={...dd,fontSize:{$ref:"fontSize"},color:Bee,fill:_ee,stroke:Hee,strokeWidth:1,divider:{stroke:Fee,strokeWidth:1,strokeOpacity:.5}},CC={..._o,background:{fill:Xp,fillOpacity:.2},handle:{...Is},text:{...Dl},statistics:{...wC}},Kee={line:{..._o,handle:{...Is},text:{...Dl}},"horizontal-line":{..._o,handle:{...Is},axisLabel:{...UB},text:{...Dl}},"vertical-line":{..._o,handle:{...Is},axisLabel:{...UB},text:{...Dl}},"disjoint-channel":{..._o,background:{fill:Xp,fillOpacity:.2},handle:{...Is},text:{...Dl}},"parallel-channel":{..._o,background:{fill:Xp,fillOpacity:.2},handle:{...Is},text:{...Dl}},"fibonacci-retracement":{..._o,strokes:KB,rangeStroke:Ml,handle:{...Is},text:{...Dl,position:"center"},label:{...dd,color:void 0,fontSize:{$rem:li.SMALLER}}},"fibonacci-retracement-trend-based":{..._o,strokes:KB,rangeStroke:Ml,handle:{...Is},text:{...Dl,position:"center"},label:{...dd,color:void 0,fontSize:{$rem:li.SMALLER}}},callout:{..._o,...dd,color:{$ref:"textColor"},handle:{...Is},fill:Xp,fillOpacity:.2},comment:{...dd,color:"white",fontWeight:700,handle:{...Is},fill:Ml},note:{...dd,color:Gee,fill:Ml,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Is},background:{fill:jee,stroke:Wee,strokeWidth:1}},text:{...dd,handle:{...Is}},arrow:{..._o,handle:{...Is},text:{...Dl}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Is,stroke:Ml}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Is,stroke:Ml}},"date-range":{...CC},"price-range":{...CC},"date-price-range":{...CC},"quick-date-price-range":{up:{..._o,fill:Xp,fillOpacity:.2,handle:{...Is},statistics:{...wC,color:"#fff",fill:Xp,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{..._o,stroke:$B,fill:WB,fillOpacity:.2,handle:{...Is,stroke:$B},statistics:{...wC,color:"#fff",fill:WB,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},Uee=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Yee=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function Zee(e,t,i){const{dateKey:s="date",highKey:n="high",openKey:o="open",lowKey:a="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:d=!0,rangeButtons:u=!0,statusBar:p=!0,toolbar:f=!0,zoom:y=!0,sync:x=!1,theme:b,data:v,formatter:S,...M}=e,D=qee(c,s,n,a,o,r),I=Xee(i,s,o,r,d,l),A={navigator:{enabled:h,...d?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:Lr,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},w={annotations:{enabled:f,optionsToolbar:{enabled:f},snap:!0,toolbar:{enabled:f,buttons:Yee,padding:0},data:v,xKey:s,volumeKey:d?l:void 0}},C=p?{statusBar:{enabled:!0,highKey:n,openKey:o,lowKey:a,closeKey:r,volumeKey:d?l:void 0}}:null,T={zoom:{enabled:y,autoScaling:{enabled:!0},onDataChange:{stickToEnd:!0},enableIndependentAxes:!0}},O={ranges:{enabled:u&&y}},V=x?{sync:{enabled:x,nodeInteraction:!0,zoom:!0}}:null,z=d?{yVolume:{type:"number",position:"left",label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}}:{};return{theme:{baseTheme:typeof b=="string"?b:"ag-financial",...ce(typeof b=="object"?b:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:f},annotations:{...Kee},ranges:{enableOutOfRange:!0,position:"bottom-left",fontSize:{$rem:[li.MEDIUM,"chromeFontSize"]},minSize:34},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}},category:{gridLine:{enabled:!0}},time:{gridLine:{enabled:!0}},"unit-time":{gridLine:{enabled:!0}},"ordinal-time":{gridLine:{enabled:!0}}}},bar:{series:{fillOpacity:.5,highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},line:{series:{marker:{enabled:!1},highlight:{unhighlightedSeries:{opacity:1}},...AS(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...AS(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},ohlc:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},"range-area":{series:{fillOpacity:.3,strokeWidth:2,highlight:{bringToFront:!1,unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...AS(c,{hlc:{fill:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.fill"},{$palette:"down.fill"}]},stroke:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.stroke"},{$palette:"down.stroke"}]}}})}},"range-bar":{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...AS(c,{"high-low":{fill:{$palette:"neutral.fill"},stroke:{$palette:"neutral.stroke"}}})}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...I,...D],axes:{y:{type:"number",position:"right",crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...z,x:{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}},tooltip:{enabled:!1},data:v,formatter:S,...w,...A,...C,...T,...O,...V,...M}}function Xee(e,t,i,s,n,o){return n?[{type:"bar",xKey:t,yKey:o,yKeyAxis:"yVolume",tooltip:{enabled:!1},simpleItemStyler(a){const{up:r,down:l}=e().palette;return{fill:a[i]!0,listeners:le,locale:le,width:le,height:le,minWidth:le,minHeight:le,title:le,subtitle:le,footnote:le,padding:le,tooltip:{...Ue,...we.tooltip}};ite.overrideDevicePixelRatio=Q(P),LC.overrideDevicePixelRatio=Q(P),LC.foreground=Q(le);var ste={type:"preset",name:"price-volume",enterprise:!0,dependencies:[Qv,pC],version:de,options:LC,create:Zee},XB=[ste,tv,av,nS,oS,dS,hS,am,uw,pw,Qv,xm,yw,Jv,xw,IS,sC,cC,mC,Yp,DC,dA,hA];function qB(e){const{enabled:t,mode:i,showArrow:s,range:n,position:o,pagination:a,delay:r,wrapping:l,interaction:c,renderer:h,...d}=e,u={enabled:t,showArrow:s,range:n,position:o,interaction:c,renderer:h,...d};return{chartTooltipOptions:{mode:i,pagination:a,delay:r,wrapping:l,...d},seriesTooltipOptions:u}}function nte(e){const{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:x,title:b,width:v,type:S,cursor:M,nodeClickRange:D,tooltip:I,value:k,scale:A={},startAngle:w,endAngle:C,highlight:T,segmentation:O,bar:V,needle:z,targets:R,outerRadius:B,innerRadius:G,outerRadiusRatio:F,innerRadiusRatio:_,cornerRadius:Y,cornerMode:Z,label:ne,secondaryLabel:te,spacing:ue,withinStudio:ge,...be}=e,fe=I!=null,He=I??{},{chartTooltipOptions:Re,seriesTooltipOptions:ze}=qB(He),Te={...be,type:S,cursor:M,context:o,nodeClickRange:D,value:k,scale:A,startAngle:w,endAngle:C,highlight:T,segmentation:O,bar:V,targets:R,outerRadius:B,innerRadius:G,outerRadiusRatio:F,innerRadiusRatio:_,cornerRadius:Y,cornerMode:Z,label:ne,secondaryLabel:te,spacing:ue};return fe&&(Te.tooltip=ze),z!=null&&(Te.needle={enabled:!0,...z}),{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:x,title:b,width:v,...fe?{tooltip:Re}:{},series:[Te]}}function ote(e){const{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:x,title:b,width:v,type:S,cursor:M,nodeClickRange:D,tooltip:I,value:k,scale:A={},direction:w="vertical",thickness:C,highlight:T,segmentation:O,bar:V,targets:z,cornerRadius:R,cornerMode:B,label:G,withinStudio:F,..._}=e,Y=I!=null,Z=I??{},{chartTooltipOptions:ne,seriesTooltipOptions:te}=qB(Z),ue={..._,type:S,cursor:M,nodeClickRange:D,value:k,scale:A,direction:w,thickness:C,highlight:T,segmentation:O,bar:V,targets:z,cornerRadius:R,cornerMode:B,label:G};return Y&&(ue.tooltip=te),{animation:t,background:i,container:s,contextMenu:n,context:o,footnote:a,foreground:r,height:l,listeners:c,locale:h,minHeight:d,minWidth:u,overrideDevicePixelRatio:p,padding:f,subtitle:y,theme:x,title:b,width:v,...Y?{tooltip:ne}:{},series:[ue]}}function QB(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=ce(e,s),e.targets!=null&&i!=null&&(e.type,e.targets=My(e.targets,i)),e}function ate(e,t){switch(e.type){case"radial-gauge":return nte(QB(e,t));case"linear-gauge":return ote(QB(e,t));default:return{series:[]}}}var wm={theme:le,container:le,animation:le,background:le,contextMenu:le,context:()=>!0,listeners:le,locale:le,width:le,height:le,minWidth:le,minHeight:le,title:le,subtitle:le,footnote:le,padding:le,tooltip:{...Ue,...we.tooltip}};wm.overrideDevicePixelRatio=Q(P),wm.foreground=Q(le),wm.withinStudio=Q(E);var JB={type:"preset",name:"gauge-preset",enterprise:!0,version:de,dependencies:[vp],options:wl({"linear-gauge":{...ee(ka,["type"]),...wm},"radial-gauge":{...ee(Xc,["type"]),...wm}},"gauge options"),create:ate},eF=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const n=e.nodes();if(n.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const o=n[0],a=n.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??n.at(-1);this.node.datum=this.datum=o.datum,s(this.node,o,a)}}},tF={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function iF(e,t){if(e==null)return"";const{min:i,max:s}=t,n=i===0?0:Math.ceil(Math.log10(Math.abs(i))),o=s===0?0:Math.ceil(Math.log10(Math.abs(s))),a=Math.max(2-Math.max(n,o),0);return e.toFixed(a)}function Cm(e,t,i,s){if(i.text!=null)return i.text;const n=s??i.value;let o;return i?.formatter!=null&&(o=km(t,i.formatter,{seriesId:e,datum:void 0,value:n})),o==null||Ae(o)?o:String(o)}function sF({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}function nF(e,t){const i=Cr(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function oF(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),s=se(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:n,selection:o}=i[s];if(n==null||n.length===0)return;const a=se(0,t.datumIndex,n.length-1),r=n[a];for(const l of o)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:a,otherIndex:s}}function aF(e,t){const i=e.data?.dataIdKey;return N.findNodeDatumInArray(t,e.contextNodeData?.nodeData,i)??N.findNodeDatumInArray(t,e.contextNodeData?.targetData,i)}var wS=class extends q{getSegments(e,t){const{values:i,step:s,count:n}=this,o=Math.min(...e.domain),a=Math.max(...e.domain);let r;if(i!=null){const l=i.filter(c=>c>o&&cc-h);r=[o,...l,a]}else if(s!=null){const l=[];for(let c=o;cc>o&&ch/l*(a-o)+o)}return r!=null&&r.length>t&&(W.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[o,a]),r}};g([m],wS.prototype,"values",2),g([m],wS.prototype,"step",2),g([m],wS.prototype,"count",2);var Lm=class extends q{constructor(){super(...arguments),this.enabled=!1,this.interval=new wS,this.spacing=0}};g([m],Lm.prototype,"enabled",2),g([m],Lm.prototype,"interval",2),g([m],Lm.prototype,"spacing",2);var{makeSeriesTooltip:rte,SeriesProperties:lte,Label:cte,AxisLabel:hte,getColorStops:dte}=N,rF=class extends cte{};g([m],rF.prototype,"spacing",2);var ks=class extends q{constructor(){super(...arguments),this.value=0,this.label=new rF}getStyle(e){const{fill:t=e.fill??"black",fillOpacity:i=e.fillOpacity??1,stroke:s=e.stroke??"black",strokeWidth:n=e.strokeWidth??0,strokeOpacity:o=e.strokeOpacity??1,lineDash:a=e.lineDash??[0],lineDashOffset:r=e.lineDashOffset??0}=this;return{fill:t,fillOpacity:i,stroke:s,strokeWidth:n,strokeOpacity:o,lineDash:a,lineDashOffset:r}}};g([m],ks.prototype,"text",2),g([m],ks.prototype,"value",2),g([m],ks.prototype,"shape",2),g([m],ks.prototype,"placement",2),g([m],ks.prototype,"spacing",2),g([m],ks.prototype,"size",2),g([m],ks.prototype,"rotation",2),g([m],ks.prototype,"fill",2),g([m],ks.prototype,"fillOpacity",2),g([m],ks.prototype,"stroke",2),g([m],ks.prototype,"strokeWidth",2),g([m],ks.prototype,"strokeOpacity",2),g([m],ks.prototype,"lineDash",2),g([m],ks.prototype,"lineDashOffset",2),g([m],ks.prototype,"label",2);var po=class extends q{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fill:s,fills:n,fillMode:o,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:s??cF(n,o,e,i,t),fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};g([m],po.prototype,"enabled",2),g([m],po.prototype,"thickness",2),g([m],po.prototype,"thicknessRatio",2),g([m],po.prototype,"fills",2),g([m],po.prototype,"fillMode",2),g([m],po.prototype,"fill",2),g([m],po.prototype,"fillOpacity",2),g([m],po.prototype,"stroke",2),g([m],po.prototype,"strokeWidth",2),g([m],po.prototype,"strokeOpacity",2),g([m],po.prototype,"lineDash",2),g([m],po.prototype,"lineDashOffset",2);var Nm=class extends q{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};g([m],Nm.prototype,"values",2),g([m],Nm.prototype,"step",2),g([m],Nm.prototype,"minSpacing",2),g([m],Nm.prototype,"maxSpacing",2);var lF=class extends hte{constructor(){super(...arguments),this.placement=void 0}};g([m],lF.prototype,"placement",2);var Gs=class extends q{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new Nm,this.label=new lF}getStyle(e,t,i,s){const{fill:n,fills:o,defaultFill:a,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}=this;return{fill:n??(e&&o.length===0?a:void 0)??cF(o,r,t,s,i),fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}}};g([m],Gs.prototype,"min",2),g([m],Gs.prototype,"max",2),g([m],Gs.prototype,"fills",2),g([m],Gs.prototype,"fillMode",2),g([m],Gs.prototype,"fill",2),g([m],Gs.prototype,"fillOpacity",2),g([m],Gs.prototype,"stroke",2),g([m],Gs.prototype,"strokeWidth",2),g([m],Gs.prototype,"strokeOpacity",2),g([m],Gs.prototype,"lineDash",2),g([m],Gs.prototype,"lineDashOffset",2),g([m],Gs.prototype,"defaultFill",2),g([m],Gs.prototype,"interval",2),g([m],Gs.prototype,"label",2);var CS=class extends Dp{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};g([m],CS.prototype,"text",2),g([m],CS.prototype,"placement",2),g([m],CS.prototype,"avoidCollisions",2);var js=class extends lte{constructor(){super(...arguments),this.value=0,this.segmentation=new Lm,this.defaultColorRange=[],this.targets=new Bi(ks),this.defaultTarget=new ks,this.defaultScale=new Gs,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Gs,this.bar=new po,this.label=new CS,this.tooltip=rte()}};g([m],js.prototype,"value",2),g([m],js.prototype,"segmentation",2),g([m],js.prototype,"defaultColorRange",2),g([m],js.prototype,"targets",2),g([m],js.prototype,"defaultTarget",2),g([m],js.prototype,"defaultScale",2),g([m],js.prototype,"direction",2),g([m],js.prototype,"thickness",2),g([m],js.prototype,"cornerRadius",2),g([m],js.prototype,"cornerMode",2),g([m],js.prototype,"margin",2),g([m],js.prototype,"scale",2),g([m],js.prototype,"bar",2),g([m],js.prototype,"label",2),g([m],js.prototype,"tooltip",2);function cF(e,t,i,s,n){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:dte(e,i,s.domain,t),rotation:n?90:0,bounds:"series"}}var{BBox:ute}=N;function NC(e){const{x0:t,y0:i,x1:s,y1:n,horizontalInset:o,verticalInset:a}=e,r=Math.min(t,s)+o,l=Math.min(i,n)+a,c=Math.max(Math.abs(s-t)-2*o,0),h=Math.max(Math.abs(n-i)-2*a,0);return{x:r,y:l,width:c,height:h}}function pte(e,t){if(t==null)return!0;const i=NC(e),s=1e-6,n=i.x+s,o=i.y+s,a=i.x+i.width-s,r=i.y+i.height-s,l=t.x,c=t.x+t.width,h=t.y,d=t.y+t.height;return Math.max(n,l)<=Math.min(a,c)&&Math.max(o,h)<=Math.min(r,d)}function TC(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:n}=e;return t!=null&&i!=null||s!=null&&n!=null}function gte(e){if(!TC(e))return;const{x0:t,y0:i,x1:s,y1:n}=e,{x:o,y:a,width:r,height:l}=NC(e);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=e;(c==null||h==null)&&(c=t,h=s),(d==null||u==null)&&(d=i,u=n);const p=Math.min(c,h),f=Math.min(d,u),y=Math.abs(h-c),x=Math.abs(u-d);return c=Math.max(o,p),d=Math.max(a,f),h=Math.min(o+r,p+y),u=Math.min(a+l,f+x),new ute(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}function hF(e,t){const i=e?"initial":"update";return{node:{fromFn(n,o){const a=n.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:f}=a??o;const{horizontalInset:y,verticalInset:x}=o,b=a!=null&&TC(a),v=TC(o);return b&&v||(!b&&v?({x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:f}=o,e&&(t?p=o.clipX0:f=o.clipY0)):b&&!v?({x0:r,y0:l,x1:c,y1:h}=o,d=void 0,u=void 0,p=void 0,f=void 0):e&&(t?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:f,horizontalInset:y,verticalInset:x,phase:i}},toFn(n,o){const{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:f,verticalInset:y}=o;return{x0:a,y0:r,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:f,verticalInset:y}},applyFn(n,o){n.setProperties(Tm(n,o))}}}}function Tm(e,t){const{x:i,y:s,width:n,height:o}=NC(t),a=gte(t),r=pte(t,a);return{x:i,y:s,width:n,height:o,clipBBox:a,visible:r}}var fte={Before:"right",Center:"center",After:"left"},mte={Before:"top",Center:"middle",After:"bottom"},yte={Before:-1,Center:-.5,After:0},xte={Before:0,Center:-.5,After:-1};function bte(e,t,i,s,n,o){const{seriesRect:a,gaugeRect:r,barRect:l}=n,{padding:c,horizontal:h}=s;i.each((d,u)=>{const p=Cm(e.id,t,u,o?.label);let f,y;u.placement==="outside-start"?h?(f=r.x,y=a.height):(f=a.width,y=a.height-(r.y+r.height)):u.placement==="outside-end"?h?(f=a.width-(r.x+r.width),y=a.height):(f=a.width,y=r.y):u.avoidCollisions&&(f=r.width,y=r.height);let x;if(p==null)return;if(f!=null&&y!=null){const R=()=>({width:f,height:y,meta:null});x=sm(Oe(p),u,{padding:c},R)?.[0]}else{const R=et(u),{width:B,height:G}=Ae(p)?en(p,u):R.measureLines(Dt(p));x={text:p,fontSize:u.fontSize,lineHeight:u.lineHeight??R.lineHeight(),width:B,height:G}}if(x==null){d.visible=!1;return}const b=h?r.x:r.y+r.height,v=h?r.x+r.width:r.y,S=h?l.x:l.y+l.height,M=h?l.x+l.width:l.y,D=u.spacing*(h?1:-1);let I,k,A,w;switch(u.placement){case"outside-start":I=-1/0,k=1/0,A=b-D,w="Before";break;case"outside-end":I=-1/0,k=1/0,A=v+D,w="After";break;case"inside-start":I=b,k=M,A=b+D,w="After";break;case"inside-end":I=M,k=v,A=v-D,w="Before";break;case"inside-center":I=b,k=v,A=(b+v)/2,w="Center";break;case"bar-inside":I=S,k=M,A=(S+M)/2,w="Center";break;case"bar-inside-end":I=S,k=M,A=M-D,w="Before";break;case"bar-outside-end":I=M,k=v,A=M+D,w="After";break;case"bar-end":I=-1/0,k=1/0,A=M,w="Center";break}const C=h?A:r.x+r.width/2,T=h?r.y+r.height/2:A;let O,V;h?(O=C+yte[w]*x.width,V=O+x.width):(O=T+xte[w]*x.height,V=O+x.height);const z=Math.min(O,V)>=Math.min(I,k)&&Math.max(O,V)<=Math.max(I,k);if(u.avoidCollisions&&!z){d.visible=!1;return}d.visible=!0,d.text=x.text,d.fontSize=x.fontSize,d.lineHeight=x.lineHeight,d.textAlign=h?fte[w]:"center",d.textBaseline=h?"middle":mte[w],d.x=C,d.y=T})}var{fromToMotion:OC,resetMotion:vte,SeriesNodePickMode:dF,createDatumId:uF,BBox:cr,Group:ud,PointerEvents:pF,Selection:pd,Rect:Ste,Text:gF,TransformableText:Mte,Marker:Dte,LinearScale:Ite,generateTicks:kte,NiceMode:fF}=N,Ate={before:180,middle:0,after:0},wte={before:90,middle:0,after:-90},PC=class extends N.Series{constructor(e){super({moduleCtx:e,pickModes:[dF.EXACT_SHAPE_MATCH,dF.NEAREST_NODE]}),this.properties=new js,this.seriesRect=cr.NaN,this.gaugeRect=cr.NaN,this.scale=new Ite,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new ud({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new ud({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new ud({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new ud({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new ud({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new ud({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new ud({name:"tickGroup"})),this.scaleSelection=pd.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=pd.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=pd.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=pd.select(this.itemTargetLabelGroup,gF),this.labelSelection=pd.select(this.itemLabelGroup,gF),this.highlightTargetSelection=pd.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=pd.select(this.tickGroup,Mte),this.datumUnion=new eF,this.animationState=new he("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=pF.None,this.tickGroup.pointerEvents=pF.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const e=new Ste;return e.crisp=!0,e}markerFactory(){return new Dte}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return iF(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:n}=this,{thickness:o}=e,a=Aa(n.range),r=new cr(t,i,s?a:o,s?o:a);return{axis:r,series:r}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:n=t.value??0,shape:o=t.shape??"triangle",rotation:a=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:d=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:p=t.label.fontWeight??"normal",fontSize:f=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:x=t.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:r,spacing:l,size:c,rotation:a,label:{enabled:h,color:d,fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,spacing:x},style:i.getStyle(t)}})}getTargetPoint(e){const{properties:t,originX:i,originY:s,horizontal:n,scale:o,gaugeRect:a}=this,{thickness:r}=t,{value:l,placement:c,spacing:h,size:d}=e,u=o.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=r+h+d/2;break;default:p=r/2;break}return{x:i+a.x+(n?u:p),y:s+a.y+(n?p:u)}}getTargetLabel(e){const{size:t,placement:i,label:s}=e,{spacing:n,color:o,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c}=s,h=void 0,d=t/2+n;let u,p,f=0,y=0;return this.horizontal?(u="center",i==="after"?(p="top",y=d):(p="bottom",y=-d)):(p="middle",i==="before"?(u="right",f=-d):(u="left",f=d)),{offsetX:f,offsetY:y,fill:o,textAlign:u,textBaseline:p,fontStyle:a,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(e,t){const{placement:i,avoidCollisions:s,spacing:n,text:o,color:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:f,formatter:y=x=>this.formatLabel(x.value)}=e;return{series:this,datum:void 0,datumIndex:{type:0},placement:i,avoidCollisions:s,spacing:n,text:o,value:t,fill:a,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:f,formatter:y}}verticalLabelInset(){const{label:e}=this.properties,t=et(e),i=e.text?.split(` `),s=(e.lineHeight??t.lineHeight())*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,n=s.text?.split(` `),o=et(s),a=i.interval.values??e.ticks({nice:[!1,!1],interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(n??a?.map(c=>Cm(this.id,this.ctx,this.labelDatum(s,c))??"")).reduce((c,h)=>{const{width:d}=Ae(h)?en(h,s):o.measureLines(Dt(h));return Math.max(c,d)},0);return s.spacing+l}tickFormatter(e,t){const{format:i,formatter:s}=this.properties.scale.label;let n;return i!=null&&(n=Cx(t,typeof i=="string"?i:void 0)),(o,a)=>{let r;return s&&(r??(r=km(this.ctx,s,{value:o,index:a,domain:e,boundSeries:void 0}))),r??(r=n?.(o)),r??this.formatLabel(o)}}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:n}=this,{value:o,segmentation:a,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u,defaultColorRange:p,defaultScale:f}=t;s.domain=[d.min,d.max],s.range=i?[0,n.width]:[n.height,0];let y,x;i?(x=1,y=Math.PI/-2):d.label.placement==="before"?(x=1,y=0):(x=-1,y=0);let b,v,S,M;i?(b=0,v=n.width,S=(n.height-r)/2,M=S+r,u.placement==="outside-start"?b+=this.horizontalLabelInset():u.placement==="outside-end"&&(v-=this.horizontalLabelInset())):(b=(n.width-r)/2,v=b+r,M=0,S=n.height,u.placement==="outside-start"?S-=this.verticalLabelInset():u.placement==="outside-end"&&(M+=this.verticalLabelInset())),this.gaugeRect=new cr(Math.min(b,v),Math.min(S,M),Math.abs(v-b),Math.abs(M-S));const D=0,I=0;s.domain=[d.min,d.max],s.range=i?[b,v]:[S,M];const k=ce({parallel:i},d.label,f.label),{tickData:{ticks:A}}=kte({scale:s,label:k,interval:d.interval,tickFormatter:(De,pe)=>this.tickFormatter(De,pe),domain:s.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:[fF.Off,fF.Off],labelOffset:0,axisRotation:y,sideFlag:x}),w=!1,C=this.getTargets(),T=[],O=[],V=[],z=[],[R,B]=s.range,G=Math.abs(B-R),F=i?s.convert(o):v,_=i?M:s.convert(o),Y=a.enabled?a.spacing/2:0,Z=i?Y:0,ne=i?0:Y,te=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),ue=-(r-te)/2,ge=i?0:ue,be=i?ue:0,fe=c==="item",He=Math.ceil(G);let Re=a.enabled?a.interval.getSegments(s,He):void 0;const ze=h.getStyle(p,i,s),Te=d.getStyle(h.enabled,p,i,s);if(Re==null&&fe){const De=Math.min(...s.domain),pe=Math.max(...s.domain),dt={value:o,segmentStart:De,segmentEnd:pe};if(h.enabled){const ws=Math.min(l,te/2,G/2)*(w?-1:1),go=i?ws:0,pi=i?0:ws;T.push({series:this,itemId:"value",datum:dt,datumIndex:{type:0},type:0,x0:D+b-go-ge,y0:I+S-pi-be,x1:D+F+go+ge,y1:I+_+pi+be,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:Z,verticalInset:ne,style:ze})}const ut=Math.min(l,r/2,G/2)*(w?-1:1),bt=i?ut:0,pt=i?0:ut;z.push({series:this,itemId:"scale",datum:dt,datumIndex:{type:0},type:0,x0:D+b-bt,y0:I+S-pt,x1:D+v+bt,y1:I+M+pt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:Z,verticalInset:ne,style:Te})}else{Re??(Re=s.domain);const De=D+b-ge,pe=I+S-be,dt=D+F+ge,yt=I+_+be;for(let ut=0;utuF(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i}=this,s=i.animationManager.isSkipped(),n=this.getShapeFillBBox();t.each((a,r)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=r;a.setStyleProperties(r.style,n),a.topLeftCornerRadius=l,a.topRightCornerRadius=c,a.bottomRightCornerRadius=h,a.bottomLeftCornerRadius=d,a.pointerEvents=this.properties.bar.enabled?N.PointerEvents.All:N.PointerEvents.None,(s||a.previousDatum==null)&&a.setProperties(Tm(a,r))});const{horizontal:o}=this;this.datumUnion.update(t,this.itemGroup,N.Rect,(a,r,l)=>{const c=Math.min(r.x,l.x),h=Math.max(r.x+r.width,l.x+l.width),d=Math.min(r.y,l.y),u=Math.max(r.y+r.height,l.y+l.height),p=h-c,f=u-d;a.pointerEvents=N.PointerEvents.None,a.x=c,a.y=d,a.width=p,a.height=f,a.topLeftCornerRadius=o?r.topLeftCornerRadius:l.topLeftCornerRadius,a.topRightCornerRadius=l.topRightCornerRadius,a.bottomRightCornerRadius=o?l.bottomRightCornerRadius:r.bottomRightCornerRadius,a.bottomLeftCornerRadius=r.bottomLeftCornerRadius;const y=r.clipBBox,x=l.clipBBox??y;y&&x?a.clipBBox=cr.merge([y,x]).intersection(o?new cr(c,-1/0,p,1/0):new cr(-1/0,d,1/0,f)):a.clipBBox=void 0})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>uF(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,i=this.getShapeFillBBox();t.each((s,n)=>{const{topLeftCornerRadius:o,topRightCornerRadius:a,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=n;s.setStyleProperties(n.style,i),s.setProperties(Tm(s,n)),s.topLeftCornerRadius=o,s.topRightCornerRadius=a,s.bottomRightCornerRadius=r,s.bottomLeftCornerRadius=l,s.setProperties(Tm(s,n))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((s,n)=>{const{x:o,y:a,shape:r,size:l,rotation:c}=n,h=this.getTargetStyle(i,n);s.setStyleProperties(h),s.size=l,s.shape=r==="line"?sF:r,s.translationX=o,s.translationY=a,s.rotation=c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return ce(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{x:n,y:o,text:a}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:f,textBaseline:y}=s.label;i.visible=!0,i.x=n+r,i.y=o+l,i.text=a,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textAlign=f,i.textBaseline=y})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:n,color:o=s.label.color,fontFamily:a=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=lt(i.scale.label.rotation??0);let p,f,y,x;this.horizontal?(d??(d="after"),p="center",f=d==="before"?"bottom":"top",x=this.originY+t.y+(d==="before"?-h:t.height+h)):(d??(d="before"),p=d==="before"?"end":"start",f="middle",y=this.originX+t.x+(d==="before"?-h:t.width+h)),e.tickSelection.each((b,v)=>{if(!n){b.visible=!1;return}const S=y??v.translation,M=x??v.translation;b.visible=!0,b.text=v.tickLabel,b.fill=o,b.fontFamily=a,b.fontSize=r,b.fontStyle=l,b.fontWeight=c,b.textBaseline=f,b.textAlign=p,b.x=S,b.y=M,b.rotationCenterX=S,b.rotationCenterY=M,b.rotation=u})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:n,gaugeRect:o}=this,{x:a,y:r,width:l,height:c}=o,h=e?.label??this.properties.value;let d;if(i){const f=s.convert(h);d=new cr(a,r,f-a,c)}else{const f=s.convert(h);d=new cr(a,f,l,c-f)}const u={seriesRect:n,gaugeRect:o,barRect:d},{margin:p}=this.properties;bte(this,this.ctx,t,{padding:p,horizontal:i},u,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),vte([this.datumSelection],Tm),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each((n,o)=>{n.opacity=1,i=n.previousDatum?.value??e.from??o.value,s=o.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const n=`${this.id}_labels`;t.animate({id:n,groupId:"label",from:{label:i},to:{label:s},phase:e.phase??"update",ease:Ea,onUpdate:o=>this.formatLabelText(o),onStop:()=>this.formatLabelText({label:s})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=hF(!0,this.horizontal);OC(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),OC(this.id,"label",e,[this.labelSelection],tF,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=hF(!1,this.horizontal);OC(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return{domain:[0,1]}}dataCount(){return Number.NaN}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;if(e==null)return;let n,o,a;if(e.type===0?(n=i.value,o=i.label.text,a=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:n,text:o}=i.targets[e.index],a=this.ctx.localeManager.t("ariaLabelGaugeTarget")),n!=null)return this.formatTooltipWithContext(s,{data:[{label:o,fallbackLabel:a,value:this.formatLabel(n)}]},{seriesId:t,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(e){return nF(this,e)}pickFocus(e){return oF(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};PC.className="LinearGaugeSeries",PC.type="linear-gauge";var Cte={minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},Nl]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",Lr,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...Ye,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:12,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}},mF={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,dependencies:[JB],version:de,options:ka,themeTemplate:Cte,create:e=>new PC(e)},{LinearScale:EC}=N,yF=class EL extends EC{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,n]=i;let o=EC.getTickStep(s,n,t);const a=Number.isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(n-s)/o;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>a&&(l/=2,o*=2),{count:l,step:o}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(h=>!Number.isFinite(h))||s<=0)return{ticks:[],count:0};const{nice:n,interval:o}=t,[a,r]=i;if(o){const h=Math.abs(o),d=this.getPixelRange();if(!$l((r-a)/h,d)){const u=lh(a,r,h);return{ticks:u.ticks,count:u.count}}}let l;if(n&&this.hasNiceRange()){const h=super.niceDomain(t,i);l=EL.getNiceStepAndTickCount(t,h).step}else l=EC.getTickStep(a,r,t);const c=lh(a,r,l);return{ticks:c.ticks,count:c.count}}hasNiceRange(){const t=this.range.slice().sort((s,n)=>s-n);return[Math.PI,2*Math.PI].some(s=>Be(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const n=s[0]>s[1],o=n?s[1]:s[0],{step:a,count:r}=EL.getNiceStepAndTickCount(t,s),l=1/a,c=a>=1?Math.ceil(o/a+r)*a:Math.ceil((o+r*a)*l)/l;return n?[c,o]:[o,c]}getPixelRange(){return this.arcLength}},{SvgPath:Lte,Rotatable:Nte,Translatable:Tte,Scalable:Ote}=N,RC=class extends Nte(Ote(Tte(Lte))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};RC.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var{getColorStops:Pte}=N,{makeSeriesTooltip:Ete,SeriesProperties:Rte,AxisLabel:zte,Label:Vte}=N,xF=class extends Vte{};g([m],xF.prototype,"spacing",2);var As=class extends q{constructor(){super(...arguments),this.label=new xF}getStyle(){const{fill:e="black",fillOpacity:t=1,stroke:i="black",strokeWidth:s=0,strokeOpacity:n=1,lineDash:o=[0],lineDashOffset:a=0}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}}};g([m],As.prototype,"text",2),g([m],As.prototype,"value",2),g([m],As.prototype,"shape",2),g([m],As.prototype,"placement",2),g([m],As.prototype,"spacing",2),g([m],As.prototype,"size",2),g([m],As.prototype,"rotation",2),g([m],As.prototype,"fill",2),g([m],As.prototype,"fillOpacity",2),g([m],As.prototype,"stroke",2),g([m],As.prototype,"strokeWidth",2),g([m],As.prototype,"strokeOpacity",2),g([m],As.prototype,"lineDash",2),g([m],As.prototype,"lineDashOffset",2),g([m],As.prototype,"label",2);var fa=class extends q{constructor(){super(...arguments),this.enabled=!0,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t){const{enabled:i,fill:s,fills:n,fillMode:o,fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:i?s??SF(n,o,e,t):"none",fillOpacity:a,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};g([m],fa.prototype,"enabled",2),g([m],fa.prototype,"fills",2),g([m],fa.prototype,"fillMode",2),g([m],fa.prototype,"fill",2),g([m],fa.prototype,"fillOpacity",2),g([m],fa.prototype,"stroke",2),g([m],fa.prototype,"strokeWidth",2),g([m],fa.prototype,"strokeOpacity",2),g([m],fa.prototype,"lineDash",2),g([m],fa.prototype,"lineDashOffset",2);var Om=class extends q{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};g([m],Om.prototype,"values",2),g([m],Om.prototype,"step",2),g([m],Om.prototype,"minSpacing",2),g([m],Om.prototype,"maxSpacing",2);var Bte=class extends zte{},cn=class extends q{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Bi(N.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new Om,this.label=new Bte}getStyle(e,t,i){const{fill:s,fills:n,defaultFill:o,fillMode:a,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=this;return{fill:s??(e&&n.length===0?o:void 0)??SF(n,a,t,i),fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}}};g([m],cn.prototype,"min",2),g([m],cn.prototype,"max",2),g([m],cn.prototype,"fills",2),g([m],cn.prototype,"fillMode",2),g([m],cn.prototype,"fill",2),g([m],cn.prototype,"fillOpacity",2),g([m],cn.prototype,"stroke",2),g([m],cn.prototype,"strokeWidth",2),g([m],cn.prototype,"strokeOpacity",2),g([m],cn.prototype,"lineDash",2),g([m],cn.prototype,"lineDashOffset",2),g([m],cn.prototype,"defaultFill",2),g([m],cn.prototype,"interval",2),g([m],cn.prototype,"label",2);var ma=class extends q{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};g([m],ma.prototype,"enabled",2),g([m],ma.prototype,"radiusRatio",2),g([m],ma.prototype,"spacing",2),g([m],ma.prototype,"fill",2),g([m],ma.prototype,"fillOpacity",2),g([m],ma.prototype,"stroke",2),g([m],ma.prototype,"strokeWidth",2),g([m],ma.prototype,"strokeOpacity",2),g([m],ma.prototype,"lineDash",2),g([m],ma.prototype,"lineDashOffset",2);var bF=class extends Dp{};g([m],bF.prototype,"text",2);var vF=class extends xv{};g([m],vF.prototype,"text",2);var Ii=class extends Rte{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new Lm,this.defaultColorRange=[],this.targets=new Bi(As),this.defaultTarget=new As,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new cn,this.bar=new fa,this.needle=new ma,this.label=new bF,this.secondaryLabel=new vF,this.tooltip=Ete()}};g([m],Ii.prototype,"value",2),g([m],Ii.prototype,"startAngle",2),g([m],Ii.prototype,"endAngle",2),g([m],Ii.prototype,"segmentation",2),g([m],Ii.prototype,"defaultColorRange",2),g([m],Ii.prototype,"targets",2),g([m],Ii.prototype,"defaultTarget",2),g([m],Ii.prototype,"outerRadiusRatio",2),g([m],Ii.prototype,"innerRadiusRatio",2),g([m],Ii.prototype,"outerRadius",2),g([m],Ii.prototype,"innerRadius",2),g([m],Ii.prototype,"cornerRadius",2),g([m],Ii.prototype,"cornerMode",2),g([m],Ii.prototype,"spacing",2),g([m],Ii.prototype,"scale",2),g([m],Ii.prototype,"bar",2),g([m],Ii.prototype,"needle",2),g([m],Ii.prototype,"label",2),g([m],Ii.prototype,"secondaryLabel",2),g([m],Ii.prototype,"tooltip",2);function SF(e,t,i,s){const{domain:n,range:o}=s,[a,r]=o,l=Qe((a+r)/2+Math.PI),c=ou(r-a);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:Pte(e,i,n,t).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(a+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),bounds:"series",rotation:vM(l)+90}}var{SectorBox:zC}=N;function Fte(e){const{startAngle:t,endAngle:i,clipStartAngle:s,clipEndAngle:n,innerRadius:o,outerRadius:a}=e;if(!(s==null||n==null))return new zC(Math.max(s,t),Math.min(n,i),o,a)}function MF(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function VC(e){return e.clipStartAngle!=null&&e.clipEndAngle!=null}function BC(e,t){const{clipStartAngle:i,clipEndAngle:s,innerRadius:n,outerRadius:o}=e;return new zC(i,t?i:s,n,o)}function DF(e,t){const i=e?"initial":"update";return{node:{fromFn(o,a){const r=o.previousDatum;let{startAngle:l,endAngle:c}=r??a;const h=r!=null&&VC(r)?BC(r,e):void 0,d=VC(a)?BC(a,e):void 0;let u;return h!=null&&d!=null?u=h:h==null&&d!=null?(u=d,l=a.startAngle,c=a.endAngle):h!=null&&d==null?(u=void 0,l=a.startAngle,c=a.endAngle):e&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(o,a){const{startAngle:r,endAngle:l}=a;let c;return VC(a)&&(c=BC(a,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(o,a){const{startAngle:r,endAngle:l}=a;let{clipSector:c}=a;c!=null&&(c=new zC(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||MF(r,l,c);o.startAngle=r,o.endAngle=l,o.clipSector=c,o.visible=h}},needle:{fromFn(o){let{angle:a}=o.previousDatum??o.datum;return e&&(a=t),{rotation:a,phase:i}},toFn(o,a){const{angle:r}=a;return{rotation:r}}}}}function FC(e,t){const{startAngle:i,endAngle:s}=t,n=Fte(t),o=n==null||MF(i,s,n);return{startAngle:i,endAngle:s,clipSector:n,visible:o}}function IF(e,t){const{angle:i}=t;return{rotation:i}}var _te={top:0,middle:.5,bottom:1};function Hte(e,t,i,s,n,o){const{padding:a,textAlign:r,verticalAlign:l}=s;let c,h;if(i.each((D,I)=>{I.label==="primary"?c=I:I.label==="secondary"&&(h=I)}),c==null)return;const d=Cm(e.id,t,c,o?.label);if(d==null)return;const u=h==null?void 0:Cm(e.id,t,h,o?.secondaryLabel),p={padding:a},f=r==="center"?2:1,y=l==="middle"?2:1,x=D=>({width:Math.sqrt(Math.max(n**2-(D/y)**2,0))*f,height:Math.min(D,y*n),meta:null});let b,v,S;if(h!=null&&u!=null){const D=rR(Oe(d),c,Oe(u),h,p,x);b=D?.label,v=D?.secondaryLabel,S=D?.height??0}else{const D=sm(Oe(d),c,p,x);b=D?.[0],v=void 0,S=D?.[0].height??0}const M=S*_te[l];i.each((D,I)=>{let k;if(I.label==="primary"?k=b:I.label==="secondary"&&(k=v),k==null){D.visible=!1;return}D.visible=!0,D.text=k.text,D.fontSize=k.fontSize,D.lineHeight=k.lineHeight,D.textAlign=r,D.textBaseline="middle";const A=I.label==="primary"?k.height/2:S-k.height/2;D.y=I.centerY+A-M,D.x=I.centerX})}var{fromToMotion:Pm,resetMotion:kF,SeriesNodePickMode:AF,createDatumId:_C,sectorBox:Gte,BBox:jte,Group:Bc,PointerEvents:LS,Selection:Fc,Sector:Wte,SectorBox:$te,Transformable:Kte,TransformableText:Ute,Text:wF,Marker:Yte}=N,Zte={inside:90,middle:0,outside:-90},Xte=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],qte=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],HC=class extends N.Series{constructor(e){super({moduleCtx:e,pickModes:[AF.EXACT_SHAPE_MATCH,AF.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new Ii,this.scale=new yF,this.scaleGroup=this.contentGroup.appendChild(new Bc({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Bc({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Bc({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Bc({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Bc({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Bc({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Bc({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Bc({name:"tickGroup"})),this.scaleSelection=Fc.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Fc.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Fc.select(this.itemNeedleGroup,RC),this.targetSelection=Fc.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Fc.select(this.itemTargetLabelGroup,wF),this.labelSelection=Fc.select(this.itemLabelGroup,wF),this.highlightTargetSelection=Fc.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Fc.select(this.tickGroup,N.TransformableText),this.datumUnion=new eF,this.animationState=new he("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=LS.None,this.tickGroup.pointerEvents=LS.None,this.itemNeedleGroup.pointerEvents=LS.None,this.itemLabelGroup.pointerEvents=LS.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new Wte}markerFactory(){const e=new Yte;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return iF(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:n,outerRadius:o}=this.properties,{min:a,max:r,label:l,interval:c}=n,h=lt(t.startAngle-90),d=lt(t.endAngle-90),p=ou(d-h)>Math.PI,f=p||Js(1.5*Math.PI,h,d),y=p||Js(0*Math.PI,h,d),x=p||Js(.5*Math.PI,h,d),b=p||Js(1*Math.PI,h,d);let v;b&&!y?v="right":!b&&y?v="left":v="center";let S;f&&!x?S="bottom":!f&&x?S="top":S="middle";const M=Gte({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),D=-(M.x+M.width/2)*2,I=-(M.y+M.height/2)*2,k=Math.min(i/M.width,s/M.height);e.domain=[a,r],e.range=[h,d],e.arcLength=k/2;const{maxSpacing:A,minSpacing:w}=c,{arcLength:C}=e,T=A?Math.floor(C/A):1,O=w?Math.floor(C/w):1/0,V=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),z=Math.max(T,Math.min(O,V)),R=c.values??e.ticks({nice:[!1,!1],interval:c.step,minTickCount:T,maxTickCount:O,tickCount:z})?.ticks??[],B=Cx(R,typeof l.format=="string"?l.format:void 0),G=[];for(const[ne,te]of R.entries()){let ue;l.formatter&&(ue=km(this.ctx,l.formatter,{value:te,index:ne,domain:e.domain,boundSeries:void 0})),ue??(ue=B?.(te)),ue!=null&&G.push({index:ne,value:te,text:ue})}const F=.5*k,_=l.enabled&&o==null&&G.length>0?this.getTickLabelInset({tickData:G,radius:F,centerXOffset:D,centerYOffset:I,seriesRectWidth:i,seriesRectHeight:s,spacing:l.spacing,rotation:lt(l.rotation??0)}):0,Y=Math.max(F-_,0),Z=o??Y;return this.centerX=i/2+D*Z,this.centerY=s/2+I*Z,this.radius=Z,this.textAlign=v,this.verticalAlign=S,G}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this,s=new jte(e-i,t-i,2*i,2*i);return{series:s,axis:s}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return e.targets.map(i=>{const{text:s=t.text,value:n=t.value??0,shape:o=t.shape??"triangle",rotation:a=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:d=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:p=t.label.fontWeight??"normal",fontSize:f=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:x=t.label.spacing??0}=i.label;return{text:s,value:n,shape:o,placement:r,spacing:l,size:c,rotation:a,label:{enabled:h,color:d,fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,spacing:x},style:i.getStyle()}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:n}=i,{placement:o,spacing:a,size:r}=e,l=t*n,c=t*s;switch(o){case"inside":return Math.max(c-a-r/2,0);case"outside":return l+a+r/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:n,label:o}=e,{spacing:a,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=o,u=t.convert(i),p=Math.trunc(Qe(u)/(Math.PI/2)),f=s/2+a;let y,x,b,v;switch(n){case"outside":({textAlign:y,textBaseline:x}=Xte[p]),b=f*Math.cos(u),v=f*Math.sin(u);break;case"inside":({textAlign:y,textBaseline:x}=qte[p]),b=-f*Math.cos(u),v=-f*Math.sin(u);break;default:y="center",x="bottom",b=0,v=-f;break}return{offsetX:b,offsetY:v,fill:r,textAlign:y,textBaseline:x,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:n,centerX:o,centerY:a}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:f,scale:y,label:x,secondaryLabel:b}=s,{outerRadius:v=n*c,innerRadius:S=n*l,defaultColorRange:M}=s,D=this.getTargets(),I=[],k=[],A=[],w=[],C=[],T=u==="item",O=i.convert(i.domain[0]),V=i.convert(r),z=Math.ceil(ou(V-O)*n);let R=h.enabled?h.interval.getSegments(i,z):void 0;const B=f.getStyle(M,i),G=y.getStyle(f.enabled,M,i);if(R==null&&T){const F=Math.min(...i.domain),_=Math.max(...i.domain),Y={value:r,segmentStart:F,segmentEnd:_},ne=Math.min(d,(v-S)/2)/((S+v)/2);I.push({series:this,itemId:"value",datum:Y,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:v,innerRadius:S,startAngle:O-ne,endAngle:V+ne,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:B}),C.push({series:this,itemId:"scale",datum:Y,datumIndex:{type:0},type:0,centerX:o,centerY:a,outerRadius:v,innerRadius:S,startAngle:i.range[0]-ne,endAngle:i.range[1]+ne,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:G})}else{R??(R=i.domain);for(let F=0;Fthis.formatLabel(fe.value)}=x;w.push({label:"primary",centerX:o,centerY:a,text:F,value:r,fill:_,fontSize:Y,minimumFontSize:Z,fontStyle:ne,fontWeight:te,fontFamily:ue,lineHeight:ge,formatter:be})}if(!p.enabled&&b.enabled){const{text:F,color:_,fontSize:Y,minimumFontSize:Z,fontStyle:ne,fontWeight:te,fontFamily:ue,lineHeight:ge,formatter:be}=b;w.push({label:"secondary",centerX:o,centerY:a,text:F,value:r,fill:_,fontSize:Y,minimumFontSize:Z,fontStyle:ne,fontWeight:te,fontFamily:ue,lineHeight:ge,formatter:be})}if(p.enabled){let F=p.radiusRatio==null?S:n*p.radiusRatio;F=Math.max(F-p.spacing,0);const _=i.convert(r);A.push({centerX:o,centerY:a,radius:F,angle:_,series:this})}for(let F=0;FMath.max(...i.domain))continue;const ge=this.getTargetRadius(_),be=i.convert(Y),fe=lt(_.rotation+Zte[_.placement]);k.push({series:this,itemId:`target-${F}`,midPoint:{x:ge*Math.cos(be)+o,y:ge*Math.sin(be)+a},datum:{value:Y},datumIndex:{type:1,index:F},type:1,value:Y,text:Z,centerX:o,centerY:a,shape:te,radius:ge,angle:be,rotation:fe,size:ne,label:this.getTargetLabel(_),style:ue})}return{itemId:t,nodeData:I,needleData:A,targetData:k,labelData:w,scaleData:C,tickData:e}}findNodeDatum(e){return aF(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:s,targetSelection:n,targetLabelSelection:o,scaleSelection:a,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],f=this.contextNodeData?.scaleData??[],y=this.contextNodeData?.tickData??[],x=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:f,scaleSelection:a}),this.updateScaleNodes({scaleSelection:a}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:n}),this.updateTargetStyles({targetSelection:n,isHighlight:!1}),this.updateTargetNodes({targetSelection:n}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:o}),this.updateTargetLabelNodes({targetLabelSelection:o}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:x==null?[]:[x],targetSelection:r}),this.updateTargetStyles({targetSelection:r,isHighlight:!0}),this.updateTargetNodes({targetSelection:r}),this.tickSelection=this.updateTickSelection({tickData:y,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>_C(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{segmentation:n}=s,o=n.spacing??0,a=i.animationManager.isSkipped(),r=this.getShapeFillBBox();t.each((l,c)=>{const{centerX:h,centerY:d,innerRadius:u,outerRadius:p,startCornerRadius:f,endCornerRadius:y}=c;l.centerX=h,l.centerY=d,l.innerRadius=u,l.outerRadius=p,l.pointerEvents=this.properties.bar.enabled?N.PointerEvents.All:N.PointerEvents.None,l.setStyleProperties(c.style,r),l.startOuterCornerRadius=f,l.startInnerCornerRadius=f,l.endOuterCornerRadius=y,l.endInnerCornerRadius=y,l.radialEdgeInset=(o+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,c.midPoint=l.getBBox().computeCenter(),(a||l.previousDatum==null)&&l.setProperties(FC(l,c))}),this.datumUnion.update(t,this.itemGroup,N.Sector,(l,c,h)=>{l.clipSector??(l.clipSector=new $te(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),l.centerX=c.centerX,l.centerY=c.centerY,l.outerRadius=l.clipSector.outerRadius=c.outerRadius,l.innerRadius=l.clipSector.innerRadius=c.innerRadius,l.startAngle=l.clipSector.startAngle=c.startAngle,l.startInnerCornerRadius=c.startInnerCornerRadius,l.startOuterCornerRadius=c.startOuterCornerRadius,l.endAngle=h.endAngle,l.clipSector.endAngle=h.clipSector?.endAngle??h.endAngle,l.endInnerCornerRadius=h.endInnerCornerRadius,l.endOuterCornerRadius=h.endOuterCornerRadius,l.pointerEvents=N.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>_C(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{segmentation:i}=this.properties,s=i.spacing??0,n=this.getShapeFillBBox();t.each((o,a)=>{const{centerX:r,centerY:l,innerRadius:c,outerRadius:h,startCornerRadius:d,endCornerRadius:u}=a;o.centerX=r,o.centerY=l,o.innerRadius=c,o.outerRadius=h,o.setStyleProperties(a.style,n),o.startOuterCornerRadius=d,o.startInnerCornerRadius=d,o.endOuterCornerRadius=u,o.endInnerCornerRadius=u,o.radialEdgeInset=(s+o.strokeWidth)/2,o.concentricEdgeInset=o.strokeWidth/2,o.setProperties(FC(o,a))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>_C(0))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((h,d)=>{const{centerX:u,centerY:p,radius:f}=d,y=f*2;h.d=RC.defaultPathData,h.setStyleProperties({fill:i,fillOpacity:s,stroke:n,strokeOpacity:o,strokeWidth:a/y,lineDash:r.map(x=>x/y),lineDashOffset:l/y}),h.translationX=u,h.translationY=p,h.scalingX=y,h.scalingY=y,c&&h.setProperties(IF(h,d))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetStyles({targetSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getTargetStyle(t,s)})}updateTargetNodes({targetSelection:e}){e.each((t,i)=>{const{centerX:s,centerY:n,angle:o,radius:a,shape:r,size:l,rotation:c}=i;t.setStyleProperties(i.style),t.size=l,t.shape=r==="line"?sF:r,t.translationX=s+a*Math.cos(o),t.translationY=n+a*Math.sin(o),t.rotation=o+c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return ce(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{centerX:n,centerY:o,radius:a,angle:r,text:l}=s,{offsetX:c,offsetY:h,fill:d,fontStyle:u,fontWeight:p,fontSize:f,fontFamily:y,textAlign:x,textBaseline:b}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=n+a*Math.cos(r)+c,i.y=o+a*Math.sin(r)+h,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=p,i.fontSize=f,i.fontFamily=y,i.textAlign=x,i.textBaseline=b})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>t.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,n)=>{s.fill=n.fill,s.fontStyle=n.fontStyle,s.fontWeight=n.fontWeight,s.fontFamily=n.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:n,properties:o}=this,{enabled:a,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=o.scale.label,p=lt(o.scale.label.rotation??0);e.tickSelection.each((f,y)=>{if(!a){f.visible=!1;return}f.visible=!0,f.text=y.text,f.fill=r,f.fontFamily=l,f.fontSize=c,f.fontStyle=h,f.fontWeight=d;const x=t.convert(y.value),{textAlign:b,textBaseline:v}=this.getTickLabelAlign(x),S=s+(i+u)*Math.cos(x),M=n+(i+u)*Math.sin(x);f.textAlign=b,f.textBaseline=v,f.x=S,f.y=M,f.rotationCenterX=S,f.rotationCenterY=M,f.rotation=p})}getTickLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,n;const o=Be(t,0),a=Be(i,0),r=t>0&&!o,l=i>0&&!a;return s="right",o?s="center":r&&(s="left"),n="bottom",a?n="middle":l&&(n="top"),{textAlign:s,textBaseline:n}}getTickLabelInset(e){const{tickData:t,radius:i,centerXOffset:s,centerYOffset:n,seriesRectWidth:o,seriesRectHeight:a,spacing:r,rotation:l}=e,{label:c}=this.properties.scale,h=o/2+s*i,d=a/2+n*i,u=new Ute;u.fontFamily=c.fontFamily,u.fontSize=c.fontSize,u.fontStyle=c.fontStyle,u.fontWeight=c.fontWeight,u.rotation=l;const p=1e-6;let f=0;for(const y of t){const x=this.scale.convert(y.value),b=Math.cos(x),v=Math.sin(x),S=h+(i+r)*b,M=d+(i+r)*v,{textAlign:D,textBaseline:I}=this.getTickLabelAlign(x);u.text=y.text,u.x=S,u.y=M,u.textAlign=D,u.textBaseline=I,u.rotationCenterX=S,u.rotationCenterY=M;const k=l?Kte.toCanvas(u):u.getBBox();if(k==null)continue;const A=k.x,w=k.x+k.width,C=k.y,T=k.y+k.height,O=Math.max(0,-A),V=Math.max(0,w-o),z=Math.max(0,-C),R=Math.max(0,T-a),B=s+b;Math.abs(B)>p&&(V>0&&B>0?f=Math.max(f,V/B):O>0&&B<0&&(f=Math.max(f,O/-B)));const G=n+v;Math.abs(G)>p&&(R>0&&G>0?f=Math.max(f,R/G):z>0&&G<0&&(f=Math.max(f,z/-G)))}return f}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:n}=this,{spacing:o,innerRadiusRatio:a}=this.properties;Hte(this,this.ctx,t,{padding:o,textAlign:s,verticalAlign:n},i*a,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),kF([this.datumSelection],FC),kF([this.needleSelection],IF),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,s,n,o;if(this.labelSelection.each((a,r)=>{a.opacity=1,r.label==="primary"?(i=a.previousDatum?.value??e.from??r.value,s=r.value):r.label==="secondary"&&(n=a.previousDatum?.value??e.from??r.value,o=r.value)}),!this.labelsHaveExplicitText())if(s==null||o==null)this.formatLabelText();else if(i===s&&n===o)this.formatLabelText({label:s,secondaryLabel:o});else{const a=`${this.id}_labels`;t.animate({id:a,groupId:"label",from:{label:i,secondaryLabel:n},to:{label:s,secondaryLabel:o},phase:e.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:s,secondaryLabel:o})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=DF(!0,this.scale.range[0]);Pm(this.id,"node",e,[this.datumSelection],t,(s,n)=>n.itemId),Pm(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),Pm(this.id,"label",e,[this.labelSelection],tF,(s,n)=>n.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=DF(!1,this.scale.range[0]);Pm(this.id,"node",e,[this.datumSelection],t,(s,n)=>n.itemId),Pm(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let n,o,a;if(e.type===0?(n=i.value,o=i.label.text,a=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:n,text:o}=i.targets[e.index],a=this.ctx.localeManager.t("ariaLabelGaugeTarget")),n!=null)return this.formatTooltipWithContext(s,{data:[{label:o,fallbackLabel:a,value:this.formatLabel(n)}]},{seriesId:t,title:void 0,datum:void 0,value:n})}pickNodeClosestDatum(e){return nF(this,e)}pickFocus(e){return oF(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((i,s)=>{const n=Cm(this.id,this.ctx,s);n!=null&&t.push(Oe(n))}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};HC.className="RadialGaugeSeries",HC.type="radial-gauge";var CF={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,dependencies:[JB],version:de,options:Xc,themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},Nl]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",Lr,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...Ye,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...Ye,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:li.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}},create:e=>new HC(e)},LF=[mF,CF];function GC(e,t,i){const s=Math.floor(e.length/2);return NF(e,t,s,t,i)||NF(e,e.length-t,s,-t,i)}function NF(e,t,i,s,n){let o=e[0];for(let a=t;s>0?a<=i:a>i;a+=s){const r=e[a];if(n(o,r))return!0;o=r}return!1}var{AxisInterval:Qte}=N,jC=class extends Qte{};g([m],jC.prototype,"minSpacing",2);var{Group:WC,LabelStyle:Jte}=N,qp=class extends Jte{constructor(){super(...arguments),this.padding=5}};g([m],qp.prototype,"enabled",2),g([m],qp.prototype,"padding",2),g([m],qp.prototype,"text",2),g([m],qp.prototype,"parallel",2);var Ws=class extends q{constructor(){super(...arguments),this.id=gi(this),this.defaultColorRange=[],this.shape="polygon",this.label=new qp,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="angle",this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new WC({name:this.id}),this.rangeGroup=new WC({name:this.id}),this.labelGroup=new WC({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,n){const{label:o}=this;e.x=t,e.y=i,e.text=o.text,e.textAlign="center",e.textBaseline=s,e.rotation=n,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=o.color,e.setFont(o),e.setBoxing(o),e.visible=!0}};Ws.className="PolarCrossLine",g([m],Ws.prototype,"enabled",2),g([m],Ws.prototype,"type",2),g([m],Ws.prototype,"range",2),g([m],Ws.prototype,"value",2),g([m],Ws.prototype,"defaultColorRange",2),g([m],Ws.prototype,"fill",2),g([m],Ws.prototype,"fillOpacity",2),g([m],Ws.prototype,"stroke",2),g([m],Ws.prototype,"strokeWidth",2),g([m],Ws.prototype,"strokeOpacity",2),g([m],Ws.prototype,"lineDash",2),g([m],Ws.prototype,"shape",2),g([m],Ws.prototype,"label",2);var{getCrossLineValue:eie,validateCrossLineValue:tie,Group:iie,Path:TF,Sector:sie,RotatableText:nie,ContinuousScale:oie}=N,$C=class extends Ws{constructor(){super(),this.direction="angle",this.polygonNode=new TF,this.sectorNode=new sie,this.lineNode=new TF,this.crossLineRange=new iie,this.labelNode=new nie,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!oie.is(this.scale))return!0;const[e,t]=this.scale.domain,i=eie(this);if(this.type==="range"){const[s,n]=i;return s>=e&&s<=t&&n>=s&&n<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!tie(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:n}=this;if(!e||i!=="line"||!t){n.visible=!1;return}const o=t.convert(s);if(Number.isNaN(o)){n.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this;n.visible=!0,n.stroke=this.stroke,n.strokeOpacity=this.strokeOpacity??1,n.strokeWidth=this.strokeWidth??1,n.fill=void 0,n.lineDash=this.lineDash;const l=r*Math.cos(o),c=r*Math.sin(o),h=a*Math.cos(o),d=a*Math.sin(o);n.path.clear(!0),n.path.moveTo(h,d),n.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:n,type:o,ticks:a}=this;if(!e||o!=="range"||n!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=a.indexOf(i[0]),h=a.indexOf(i[1]),u=(c<=h?a.slice(c,h+1):a.slice(c).concat(a.slice(0,h+1))).map(f=>s.convert(f));t.visible=!0,this.setSectorNodeProps(t);const{path:p}=t;p.clear(!0);for(const[f,y]of u.entries()){const x=l*Math.cos(y),b=l*Math.sin(y);f===0?p.moveTo(x,b):p.lineTo(x,b)}if(r===0)p.lineTo(0,0);else{const f=u.slice().reverse();for(const y of f){const x=r*Math.cos(y),b=r*Math.sin(y);p.lineTo(x,b)}}t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:n,type:o}=this;if(!e||o!=="range"||n!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:a,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,h=s instanceof N.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=a,t.outerRadius=r,t.startAngle=l[0]-h,t.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:n,type:o,ticks:a}=this;if(!e||t.enabled===!1||!t.text||!n||o==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,d,u;if(o==="line"){const p=Qe(n.convert(this.value)),f=1.5*Math.PI,y=Be(p,f)||p>f||pQe(n.convert(v)));let y=(p+f)/2;p>f&&(y-=Math.PI),y=Qe(y);const x=(Be(y,0)||y>0)&&yl.value),r=a.reduce((l,c)=>Math.max(typeof c=="number"?Uc(c):0,l),0);return{niceDomain:n,tickDomain:n,ticks:a,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Qe(-Math.PI/2+lt(this.startAngle)),t=this.endAngle==null?2*Math.PI:ou(lt(this.endAngle)-lt(this.startAngle)),i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();for(const{x:n,y:o,moveTo:a,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0}of i)r?t.arc(n,o,l,c,h):a?t.moveTo(n,o):t.lineTo(n,o);s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,n]=this.range,o=Be(n-s,2*Math.PI),a=[];if(t==="circle")o?a.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):a.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:Qe(s),endAngle:Qe(n),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));if(r&&r.length>2)for(const[l,c]of r.entries()){const h=i*Math.cos(c),d=i*Math.sin(c),u=l===0;a.push({x:h,y:d,moveTo:u})}}return{points:a,closePath:o}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:n}=this;if(!(i&&t>0))return;const o=t*n,a=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:d,lineDash:u}=i[c%a],p=e.convert(h);r.x1=o*Math.cos(p),r.y1=o*Math.sin(p),r.x2=t*Math.cos(p),r.y2=t*Math.sin(p),r.stroke=d,r.strokeWidth=s,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,n)=>{const o=this.labelData[n];if(!o||o.hidden){i.visible=!1;return}i.text=o.text,i.setFont(e),i.fill=e.color,i.x=o.x,i.y=o.y,i.setAlign(o),i.setBoxing(e),i.visible=!0,o.rotation?(i.rotation=o.rotation,i.rotationCenterX=o.x,i.rotationCenterY=o.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((n,o)=>{const{value:a}=o,r=e.convert(a),l=Math.cos(r),c=Math.sin(r);n.x1=t*l,n.y1=t*c,n.x2=(t+i.size)*l,n.y2=(t+i.size)*c,n.stroke=i.stroke,n.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:n,scale:o,tick:a}=this;if(!s.enabled)return[];const r=new rie,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,h),u=e.map((p,f)=>{const{value:y}=p,x=n+s.spacing+a.size,b=o.convert(y),v=Math.cos(b),S=Math.sin(b),M=x*v,D=x*S,{textAlign:I,textBaseline:k}=this.getLabelAlign(b),A=f===e.length-1&&y!==e[0]&&Be(Qe(b),Qe(o.convert(e[0]))),w=this.getLabelRotation(b);let C=d(y,f);r.text=C,r.x=M,r.y=D,r.setFont(s),r.textAlign=I,r.textBaseline=k,r.rotation=w,w&&(r.rotationCenterX=M,r.rotationCenterY=D);let T=w?lie.toCanvas(r):r.getBBox();if(T&&t.hideWhenNecessary&&!w){const O=l-T.x,V=T.x+T.width-c,z=1;if(O>z||V>z){const B={maxWidth:T.width-Math.max(O,V),font:s,textWrap:"never"};C=du(C,B),r.text=C,T=r.getBBox()}}return{text:C,x:M,y:D,textAlign:I,textBaseline:k,hidden:C===""||(p.hidden??A),rotation:w,box:T}});return s.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:cie.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof KC?e.orientation:"fixed"}getLabelRotation(e){let t=lt(this.label.rotation??0);e=Qe(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,n;const o=this.getLabelOrientation(),a=Be(t,0),r=Be(i,0),l=Be(t,1),c=Be(i,-1),h=t>0&&!a,d=i>0&&!r;return o==="parallel"?(s="center",n=l&&r||d?"top":"bottom"):o==="perpendicular"?(s=c||h?"left":"right",n="middle"):(s="right",a?s="center":h&&(s="left"),n="bottom",r?n="middle":d&&(n="top")),{textAlign:s,textBaseline:n}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;for(const s of this.crossLines)s instanceof $C&&(s.ticks=this.tickData.map(n=>n.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i);super.updateCrossLines()}};Em.CrossLineConstructor=$C,g([m],Em.prototype,"startAngle",2),g([m],Em.prototype,"endAngle",2);var{CategoryScale:hie}=N,gd=class extends Em{constructor(e){super(e,new hie),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new jC}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:s,minSpacing:n}=this.interval,o={nice:[this.nice,this.nice],interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},a=s??t.ticks(o,e)?.ticks??[];if(a.length<2||n==null)return a.map(d=>({value:d,visible:!0}));const r=a[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let d=1;dMath.PI)break;const f=i*Math.cos(p),y=i*Math.sin(p);if(Math.hypot(f-c,y-h)>n){const b=new Set([r]);return GC(a,d,(v,S)=>{b.add(S)}),a.map(v=>{const S=b.has(v);return{value:v,visible:S}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return h.collidesBBox(d)},s=e[0],n=e.at(-1),o=new Set([s]),a=Be(s.x,n.x)&&Be(s.y,n.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=a?e.slice(0,-1):e;if(!GC(c,l,i)){GC(c,l,(d,u)=>{o.add(u)});break}}for(const l of e)o.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}}};gd.className="AngleCategoryAxis",gd.type="angle-category",g([m],gd.prototype,"groupPaddingInner",2),g([m],gd.prototype,"paddingInner",2),g([m],gd.prototype,"interval",2);var EF={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,version:de,options:N.angleCategoryAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},create:e=>new gd(e)},_c=class extends Em{constructor(e){super(e,new yF),this.shape="circle",this.interval=new jC}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&ed>=c&&d<=h).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(o,a)=>{if(o.hidden||a.hidden)return!1;if(t==null)return o.box.collidesBBox(a.box);const r=o.box.clone().grow(t/2),l=a.box.clone().grow(t/2);return r.collidesBBox(l)},s=e[0],n=e.at(-1);s!==n&&Be(s.x,n.x)&&Be(s.y,n.y)&&(n.hidden=!0);for(let o=1;o0&&(l.hidden=!0,l.box=void 0);return}}for(const[o,a]of e.entries())o>0&&(a.hidden=!0,a.box=void 0)}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i,visibleDomain:void 0}}};_c.className="AngleNumberAxis",_c.type="angle-number",g([m],_c.prototype,"min",2),g([m],_c.prototype,"max",2),g([m],_c.prototype,"preferredMin",2),g([m],_c.prototype,"preferredMax",2),g([m],_c.prototype,"interval",2);var RF={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,version:de,options:N.angleNumberAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1}},create:e=>new _c(e)},{validateCrossLineValue:die,Group:uie,Path:pie,Sector:gie,RotatableText:fie}=N,zF=class extends qp{constructor(){super(...arguments),this.positionAngle=void 0}};g([m],zF.prototype,"positionAngle",2);var UC=class extends Ws{constructor(){super(),this.direction="radius",this.label=new zF,this.polygonNode=new pie,this.sectorNode=new gie,this.crossLineRange=new uie,this.labelNode=new fie,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!die(this,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:s}=this;e&&(e=i>=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:n}=this;if(!t)return{innerRadius:0,outerRadius:0};const o=l=>n+s-l;let a,r;if(i==="line")a=o(t.convert(this.value)),r=a;else{const l=Math.abs(t?.bandwidth??0),c=e.map(h=>t.convert(h));a=o(Math.max(...c)),r=o(Math.min(...c))+l}this.outerRadius=a,this.innerRadius=r}drawPolygon(e,t,i){for(const[s,n]of t.entries()){const o=e*Math.cos(n),a=e*Math.sin(n);s===0?i.path.moveTo(o,a):i.path.lineTo(o,a)}i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:n,type:o,innerRadius:a,outerRadius:r}=this;if(!e||n!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),h=o==="line"?r-l:a+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:n,shape:o,innerRadius:a,outerRadius:r}=this;if(!e||o!=="circle"||!s){n.visible=!1;return}n.visible=!0,n.startAngle=0,n.endAngle=2*Math.PI;const l=this.getPadding(),c=se(t,a+l,i),h=se(t,r-l,i);n.innerRadius=Math.min(c,h),n.outerRadius=Math.max(c,h),this.setSectorNodeProps(n)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:n,shape:o,type:a}=this;if(!e||i.enabled===!1||!i.text||!n){s.visible=!1;return}const r=qo((i.positionAngle??0)-90),l=(Be(r,0)||r>0)&&rthis.tickFormatter(...v),domain:e,range:a,reverse:r,niceMode:t,visibleRange:s,defaultTickMinSpacing:l,labelOffset:o,sideFlag:n,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:h}=c,{ticks:d,rawTicks:u,rawTickCount:p,tickDomain:f,fractionDigits:y,niceDomain:x=e}=h,b=d.map(v=>this.getTickLabelProps(v,c));return this.generatedTicks={ticks:d,labels:b},{ticks:u,tickDomain:f,niceDomain:x,rawTickCount:p,fractionDigits:y,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=N.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const n=e.length,o=(u,p)=>{const{stroke:f,lineDash:y}=e[p%n];u.stroke=f,u.strokeWidth=t,u.lineDash=y,u.fill=void 0},[a,r]=this.gridRange??[0,2*Math.PI],l=Be(r-a,2*Math.PI),d=i==="circle"?(u,p)=>{const{path:f}=u;f.clear(!0);const y=this.getTickRadius(p);l?(f.moveTo(y,0),f.arc(0,0,y,0,2*Math.PI)):(f.moveTo(y*Math.cos(a),y*Math.sin(a)),f.arc(0,0,y,Qe(a),Qe(r))),l&&f.closePath()}:(u,p)=>{const{path:f}=u,y=this.gridAngles;if(f.clear(!0),!y||y.length<3)return;const x=this.getTickRadius(p);for(const[b,v]of y.entries()){const S=x*Math.cos(v),M=x*Math.sin(v);b===0?f.moveTo(S,M):f.lineTo(S,M);for(const[D,I]of y.entries()){const k=x*Math.cos(I),A=x*Math.sin(I);D===0?f.moveTo(k,A):f.lineTo(k,A)}f.closePath()}f.closePath()};this.gridPathSelection.each((u,p,f)=>{o(u,f),d(u,p)})}updateTitle(){const e=a=>a.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping,t.caption.truncate=t.truncate,t.caption.maxWidth=t.maxWidth,t.caption.maxHeight=t.maxHeight;let n=!1;const o=t.caption.node;if(t.enabled){const a=Math.abs(i[1]-i[0]);n=!0,o.rotation=Math.PI/2,o.x=Math.floor((i[0]+i[1])/2),o.y=-t.spacing,o.textAlign="center",o.textBaseline="bottom",o.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain)),t.caption.text=o.text,t.caption.computeTextWrap(a,1/0)}o.visible=n}updateCrossLines(){for(const e of this.crossLines)if(e instanceof UC){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:n}=this,o=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=o,e.axisInnerRadius=o*n}super.updateCrossLines()}createLabel(){return new YC}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:n,textAlign:o}=t,a=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!=="";return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:s,text:r,textAlign:o,textBaseline:n,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:a}}};NS.CrossLineConstructor=UC,g([m],NS.prototype,"positionAngle",2);var{CategoryScale:_F}=N,fd=class extends NS{constructor(e){super(e,new _F),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],n=s*i;if(_F.is(t)){const o=t.domain,a=o.length-1-o.indexOf(e.tick);return a===0?n:t.inset+t.step*(a-.5)+t.bandwidth/2}else{const o=(s-n)/t.domain.length;return s-e.translation+n-o/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:n,key:o,source:a,property:r,domain:l,boundSeries:c}}};fd.className="RadiusCategoryAxis",fd.type="radius-category",g([m],fd.prototype,"groupPaddingInner",2),g([St("scale","paddingInner"),m],fd.prototype,"paddingInner",2),g([St("scale","paddingOuter"),m],fd.prototype,"paddingOuter",2);var HF={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,version:de,options:N.radiusCategoryAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},label:{minSpacing:5}},create:e=>new fd(e)},{LinearScale:vie}=N,md=class extends NS{constructor(e){super(e,new vie),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&es!==i).sort((s,n)=>n.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translation+s}normaliseDataDomain(e){const{min:t,max:i,preferredMin:s,preferredMax:n}=this,{extent:o,clipped:a}=sh(e.domain,t,i,s,n,void 0,e.sortMetadata?.sortOrder);return{domain:o,clipped:a}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:o,key:a,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i,visibleDomain:void 0}}};md.className="RadiusNumberAxis",md.type="radius-number",g([m],md.prototype,"min",2),g([m],md.prototype,"max",2),g([m],md.prototype,"preferredMin",2),g([m],md.prototype,"preferredMax",2);var GF={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,version:de,options:N.radiusNumberAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0},label:{minSpacing:5}},create:e=>new md(e)},{createDatumId:Sie,toHighlightString:Mie}=N;function Die(e,t){const{id:i}=e,{angleKey:s,cornerRadius:n,fill:o,fillOpacity:a,lineDash:r,lineDashOffset:l,radiusKey:c,stackGroup:h,stroke:d,strokeOpacity:u,strokeWidth:p}=e.properties,f=Mie(t??N.HighlightState.None);return{angleKey:s,cornerRadius:n,fill:o,fillOpacity:a,highlightState:f,lineDash:r,lineDashOffset:l,radiusKey:c,seriesId:i,stackGroup:h,stroke:d,strokeOpacity:u,strokeWidth:p}}function ZC(e,t,i){const{styler:s}=e.properties;let n={};if(!t&&s){const o=Die(e,i);n=e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.cachedCallWithContext(s,o)??{},{pick:!1})??{}}return{cornerRadius:n.cornerRadius??e.properties.cornerRadius,fill:n.fill??e.properties.fill,fillOpacity:n.fillOpacity??e.properties.fillOpacity,lineDash:n.lineDash??e.properties.lineDash,lineDashOffset:n.lineDashOffset??e.properties.lineDashOffset,stroke:n.stroke??e.properties.stroke,strokeOpacity:n.strokeOpacity??e.properties.strokeOpacity,strokeWidth:n.strokeWidth??e.properties.strokeWidth,opacity:1}}function Iie(e,t,i,s){const{id:n,properties:o}=e,{angleKey:a,radiusKey:r}=o,l=e.ctx.highlightManager?.getActiveHighlight(),c=e.getHighlightStateString(l,i,t.datumIndex),h=e.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:t.datum,highlightState:c,angleKey:a,radiusKey:r,...s,fill:h}}function Qp(e,t,i,s){const{properties:n}=e,{itemStyler:o}=n,a=e.getHighlightStyle(i,t?.datumIndex,s);let l=ce(a,ZC(e,t===void 0,s));if(o!=null&&t!=null){const c=e.cachedDatumCallback(Sie(e.getDatumId(t),i?"highlight":"node"),()=>{const h=Iie(e,t,i,l);return e.callWithContext(o,h)});c&&(l=ce(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS:kie,DEFAULT_POLAR_DIRECTION_NAMES:Aie,PolarAxis:wie,diff:Cie,fixNumericExtent:Lie,groupAccumulativeValueProperty:jF,keyProperty:Nie,normaliseGroupTo:Tie,resetLabelFn:Oie,seriesLabelFadeInAnimation:Pie,seriesLabelFadeOutAnimation:Eie,valueProperty:Rie,animationValidation:zie,createDatumId:Vie,SeriesNodePickMode:WF,CategoryScale:Bie,motion:$F,updateLabelNode:KF,getItemStyles:Fie}=N,_ie=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},UF=class extends N.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:kie,propertyNames:Aie,canHaveAxes:!0,pickModes:[WF.NEAREST_NODE,WF.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:Oie}}),this.NodeEvent=_ie,this.groupScale=new Bie,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e==="angle")return t.getDomain(this,"angleValue","key",i);{const s=t.getDomain(this,"radiusValue-end","value",i).domain,n=Number.isFinite(s[1]-s[0])?[Math.min(s[0],0),Math.max(s[1],0)]:[];return{domain:Lie(n)}}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,r=[];vt(s)&&r.push(Tie([o,a],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&r.push(Cie(this.id,this.processedData)),n&&r.push(zie());const l=this.visible?{}:{forceValue:0},c=this.axes.radius?.scale.type,h=this.axes.angle?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[Nie(t,h,{id:"angleValue",allowNullKey:d}),Rie(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...jF(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},c),...jF(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e!==s.r||t!==s.cx||i!==s.cy?(this.circleCache={r:e,cx:t,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes.radius?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes.radius;return e instanceof wie?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||e?.type!=="grouped")return;const s=this.axes.angle,n=this.axes.radius,o=s?.scale,a=n?.scale;if(!o||!a)return;const r=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),h=t.resolveColumnById(this,"radiusValue-raw",e);let d=0,u=0;s instanceof gd&&(d=s.groupPaddingInner,u=s.paddingInner);const f=(o.bandwidth??0)*(1-u),{index:y,visibleGroupCount:x}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:x}).map((F,_)=>String(_)),i.range=[-f/2,f/2],i.paddingInner=x>1?d:0;const b=this.isRadiusAxisReversed(),v=this.getAxisInnerRadius(),S=this.radius,M=S+v,{angleKey:D,radiusKey:I,angleName:k,radiusName:A,legendItemName:w,label:C}=this.properties,T=this.getSeriesDomain("radius").domain,O=(F,_,Y,Z)=>{const ne=this.getLabelText(_,F,I,"radius",T,C,{value:_,datum:F,angleKey:D,radiusKey:I,angleName:k,radiusName:A,legendItemName:w});if(ne)return{x:Y,y:Z,text:ne,textAlign:"center",textBaseline:"middle"}},V=[],z=Fie((F,_,Y)=>Qp(this,F,_,Y)),R={itemId:I,nodeData:V,labelData:V,styles:z};if(!this.visible)return R;const{dataSources:B}=e,G=B.get(this.id)?.data??[];for(const{datumIndex:F}of t.forEachGroupDatum(this,e)){const _=G[F],Y=r[F];if(Y===void 0&&!this.properties.allowNullKeys)return;const Z=h[F],ne=Z>=0&&!Object.is(Z,-0),te=l[F],ue=c[F],ge=ne===b;if(te===void 0||ue===void 0)return;let be,fe,He;if(G.length===1)be=-.5*Math.PI,fe=1.5*Math.PI,He=be;else{const yt=o.convert(Y);be=Qe(yt+i.convert(String(y))),fe=Qe(be+i.bandwidth),He=be+i.bandwidth/2}const Re=M-a.convert(te),ze=M-a.convert(ue),Te=(Re+ze)/2,Me=Math.cos(He)*Te,De=Math.sin(He)*Te,pe=this.properties.label.enabled?O(_,Z,Me,De):void 0,dt=this.getColumnWidth(be,fe);V.push({series:this,datum:_,datumIndex:F,point:{x:Me,y:De,size:0},midPoint:{x:Me,y:De},label:pe,angleValue:Y,radiusValue:Z,negative:ge,innerRadius:Re,outerRadius:ze,stackInnerRadius:Re,stackOuterRadius:ze,startAngle:be,endAngle:fe,midAngle:He,axisInnerRadius:v,axisOuterRadius:S,columnWidth:dt,index:F})}return{itemId:I,nodeData:V,labelData:V,styles:z}}getColumnWidth(e,t){return Number.NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight();let n=[];const o=this.ctx.highlightManager?.getActiveHighlight();t?o?.datum&&o.series===this&&n.push(o):n=this.nodeData;const a=this.isRadiusAxisReversed(),r=a?this.radius:this.getAxisInnerRadius(),l=a?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),h=this.hasItemStylers();e.update(n,void 0,d=>this.getDatumId(d)).each((d,u)=>{const{midPoint:p}=u;if(h){const v=this.getHighlightState(o,t,u.datumIndex);u.style=Qp(this,u,t,v)}const f=u.style??i.styles[this.getHighlightState(s,t,u.datumIndex)],y=f.fill,b=qt(y)&&y.bounds==="item"?{centerX:p?.x??0,centerY:p?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:l};this.updateItemPath(d,u,t),d.setStyleProperties(f,c,b),d.cornerRadius=f.cornerRadius??0,d.lineJoin="round"})}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=e?.series===this&&e?.datum?e:void 0,i=t?[t]:[];this.labelSelection.update(this.nodeData).each((s,n)=>{KF(this,s,this.properties,this.properties.label,n.label,!1,e),s.fillOpacity=this.getHighlightStyle(!1,n.datumIndex).opacity??1}),this.highlightLabelSelection.update(i,void 0,s=>this.getDatumId(s)).each((s,n)=>{KF(this,s,this.properties,this.properties.label,n.label,!0,e),s.fillOpacity=this.getHighlightStyle(!0,n.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();$F.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),Pie(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();$F.fromToMotion(this.id,"datums",t,[e],i),Eie(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=o,u=n.angle,p=n.radius,f=this.nodeData?.[e];if(!i||!s||!u||!p||!f)return;const y=s.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"angleValue",s)[e],b=i.resolveColumnById(this,"radiusValue-raw",s)[e];if(x===void 0&&!this.properties.allowNullKeys)return;const v=Qp(this,f,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(u,"tooltip",x,y,a,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(p,"tooltip",b,y,l,void 0),missing:N.isTooltipValueMissing(b)}]},{seriesId:t,datum:y,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...v})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=ZC(this,!1,N.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a};return qt(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{radiusKey:s,radiusName:n,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:o??n??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}getDatumId(e){return Vie(e.angleValue)}computeLabelsBBox(){return null}},{SeriesProperties:Hie,makeSeriesTooltip:Gie,Label:jie}=N,Ut=class extends Hie{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new jie,this.tooltip=Gie()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};g([m],Ut.prototype,"angleKey",2),g([m],Ut.prototype,"angleName",2),g([m],Ut.prototype,"radiusKey",2),g([m],Ut.prototype,"radiusName",2),g([m],Ut.prototype,"angleKeyAxis",2),g([m],Ut.prototype,"radiusKeyAxis",2),g([m],Ut.prototype,"legendItemName",2),g([m],Ut.prototype,"fill",2),g([m],Ut.prototype,"fillOpacity",2),g([m],Ut.prototype,"stroke",2),g([m],Ut.prototype,"strokeWidth",2),g([m],Ut.prototype,"strokeOpacity",2),g([m],Ut.prototype,"lineDash",2),g([m],Ut.prototype,"lineDashOffset",2),g([m],Ut.prototype,"cornerRadius",2),g([m],Ut.prototype,"styler",2),g([m],Ut.prototype,"itemStyler",2),g([m],Ut.prototype,"rotation",2),g([m],Ut.prototype,"stackGroup",2),g([m],Ut.prototype,"normalizedTo",2),g([m],Ut.prototype,"label",2),g([m],Ut.prototype,"tooltip",2);var{motion:Wie}=N;function YF(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(a,r,l)=>{for(const c of t){const h=e[c];let d=(l==="removed"||l==="updated"?a:r)[c],u=(l==="removed"?a:r)[c];Number.isNaN(u)&&(u=a.previousDatum?.[c]??Number.NaN);const p=d-u;Math.abs(p)>Math.PI&&(d-=Math.sign(p)*2*Math.PI),h.set(r,{from:d,to:u})}},s=(a,r)=>({startAngle:e.startAngle.get(a)[r],endAngle:e.endAngle.get(a)[r]});return{calculate:i,from:a=>s(a,"from"),to:a=>s(a,"to")}}function ZF(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.startAngle)||Number.isNaN(e.previousDatum.endAngle))return"added";if(Number.isNaN(t.startAngle)||Number.isNaN(t.endAngle))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function $ie(e){const t=YF();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=t.to(o);let c,h,d,u,p;return a==="removed"?(c=n.innerRadius,h=n.innerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=Number.isNaN(o.innerRadius)?e:o.innerRadius,h=Number.isNaN(o.outerRadius)?e:o.outerRadius,d=Number.isNaN(o.columnWidth)?n.columnWidth:o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l}},fromFn:(n,o,a)=>{a=ZF(n,o,a),t.calculate(n,o,a);const{startAngle:r,endAngle:l}=t.from(o);let c,h,d,u,p;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.columnWidth,u=n.axisInnerRadius,p=n.axisOuterRadius):(c=e,h=e,d=o.columnWidth,u=o.axisInnerRadius,p=o.axisOuterRadius);const f=Wie.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:r,endAngle:l,phase:f}}}}function Kie(e,{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:n,axisOuterRadius:o,startAngle:a,endAngle:r}}var{SectorBox:TS,motion:Uie}=N;function XC(e){const{negative:t,innerRadius:i,outerRadius:s,stackInnerRadius:n,stackOuterRadius:o}=e;return{innerRadius:t?o:n,outerRadius:t?n:o,clipInnerRadius:t?s:i,clipOuterRadius:t?i:s}}function Yie(e){const t=YF();return{toFn:(n,o,a)=>{const{startAngle:r,endAngle:l}=t.to(o);let c,h,d;if(a==="removed")c=e,h=e,d=new TS(r,l,c,h);else{let u,p;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:p}=XC(o)),Number.isNaN(c)&&(c=e),Number.isNaN(h)&&(h=e),Number.isNaN(u)&&(u=e),Number.isNaN(p)&&(p=e),d=new TS(r,l,u,p)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d}},fromFn:(n,o,a)=>{a=ZF(n,o,a),t.calculate(n,o,a);const{startAngle:r,endAngle:l}=t.from(o);let c,h,d;a==="removed"||a==="updated"?(c=n.innerRadius,h=n.outerRadius,d=n.clipSector):(c=e,h=e),d??(d=new TS(r,l,c,h));const u=Uie.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:d,phase:u}}}}function Zie(e,t){const{startAngle:i,endAngle:s}=t,{innerRadius:n,outerRadius:o,clipInnerRadius:a,clipOuterRadius:r}=XC(t),l=new TS(i,s,a,r);return{innerRadius:n,outerRadius:o,startAngle:i,endAngle:s,clipSector:l}}var{Sector:Xie,SectorBox:qie}=N,qC=class extends UF{constructor(e){super(e,{animationResetFns:{item:Zie}}),this.properties=new Ut}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,1,e],this.highlightGroup.zIndex=[0,2,e],this.labelGroup.zIndex=[0,3,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Xie}updateItemPath(e,t,i){const{negative:s}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=s?0:this.properties.cornerRadius,e.endOuterCornerRadius=s?0:this.properties.cornerRadius,e.startInnerCornerRadius=s?this.properties.cornerRadius:0,e.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:n,endAngle:o}=t,{innerRadius:a,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=XC(t);e.innerRadius=a,e.outerRadius=r,e.startAngle=n,e.endAngle=o,e.clipSector=new qie(n,o,l,c)}}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return Yie(e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};qC.className="NightingaleSeries",qC.type="nightingale";var{nightingaleSeriesThemeableOptionsDef:Qie}=N,QC={...qe,...Qie,type:j(Ce("nightingale")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L,grouped:E,stacked:E,stackGroup:L,normalizedTo:$};QC.angleKeyAxis=Q(L),QC.radiusKeyAxis=Q(L);var Jie={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ty],["image",it],["pattern",tt]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:{...Ys,bringToFront:!1}},axes:{"angle-category":{shape:{$findFirstSiblingNotOperation:"circle"},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},"radius-number":{shape:{$findFirstSiblingNotOperation:"circle"}}}},XF={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,stackedByDefault:!0,version:de,dependencies:[el],options:QC,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{x:"xKeyAxis",y:"yKeyAxis"},themeTemplate:Jie,create:e=>new qC(e)},qF={series:{stroke:{$palette:"stroke"},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:Kd,tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{"angle-category":{label:{spacing:10}}}},ese=ce({series:{stroke:Lr,strokeWidth:2}},qF),tse=ce({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Vi],["image",it],["pattern",tt]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},qF),{Label:ise,SeriesMarker:sse,SeriesProperties:nse,makeSeriesTooltip:ose}=N,Ri=class extends nse{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new sse,this.label=new ise,this.tooltip=ose(),this.connectMissingData=!1}};g([m],Ri.prototype,"angleKey",2),g([m],Ri.prototype,"radiusKey",2),g([m],Ri.prototype,"angleName",2),g([m],Ri.prototype,"radiusName",2),g([m],Ri.prototype,"angleKeyAxis",2),g([m],Ri.prototype,"radiusKeyAxis",2),g([m],Ri.prototype,"legendItemName",2),g([m],Ri.prototype,"stroke",2),g([m],Ri.prototype,"strokeWidth",2),g([m],Ri.prototype,"strokeOpacity",2),g([m],Ri.prototype,"lineDash",2),g([m],Ri.prototype,"lineDashOffset",2),g([m],Ri.prototype,"rotation",2),g([m],Ri.prototype,"styler",2),g([m],Ri.prototype,"marker",2),g([m],Ri.prototype,"label",2),g([m],Ri.prototype,"tooltip",2),g([m],Ri.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:ase,DEFAULT_POLAR_DIRECTION_NAMES:rse,PolarAxis:lse,SeriesNodePickMode:QF,keyProperty:cse,valueProperty:hse,fixNumericExtent:dse,seriesLabelFadeInAnimation:use,markerFadeInAnimation:pse,resetMarkerFn:gse,resetLabelFn:fse,animationValidation:mse,computeMarkerFocusBounds:yse,BBox:xse,Group:bse,Path:vse,Selection:JC,Text:Sse,Marker:Mse,updateLabelNode:JF,getMarkerStyles:Dse}=N,Ise=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},eL=class extends N.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:ase,propertyNames:rse,pickModes:[QF.NEAREST_NODE,QF.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:gse,label:fse},clipFocusBox:!1}),this.NodeEvent=Ise,this.lineGroup=this.contentGroup.appendChild(new bse({name:"radar-line"})),this.lineSelection=JC.select(this.lineGroup,vse),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}renderToOffscreenCanvas(){return(this.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}nodeFactory(){return new Mse}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e==="angle"){const s=t.getDomain(this,"angleValue","key",i).domain,n=t.getKeySortMetadata(this,"angleValue",i);return{domain:s,sortMetadata:n}}else{const s=t.getDomain(this,"radiusValue","value",i).domain,n=Qo(s.length===0?s:[0].concat(s));return{domain:dse(n)}}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(mse());const n=this.axes.radius?.scale.type,o=this.axes.angle?.scale.type,a=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[cse(t,o,{id:"angleValue",allowNullKey:a}),hse(i,n,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes.radius;return e instanceof lse?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:n,radiusName:o,legendItemName:a,marker:r,label:l}=this.properties,c=this.axes.angle?.scale,h=this.axes.radius?.scale;if(!c||!h)return;const d=t.resolveKeysById(this,"angleValue",e),u=t.resolveColumnById(this,"radiusValue",e),p=this.getAxisInnerRadius(),f=this.getSeriesDomain("radius").domain,y=e.dataSources.get(this.id)?.data??[],x=this.properties.allowNullKeys??!1,b=[];for(let v=0;v0&&(z="left");let R="bottom";Be(w,0)?R="middle":w>0&&(R="top"),O={x:C+A*r.size,y:T+w*r.size,text:V,textAlign:z,textBaseline:R}}}b.push({series:this,datum:S,datumIndex:v,index:v,point:{x:C,y:T,size:r.size},midPoint:{x:C,y:T},label:O,angleValue:M,radiusValue:D,missing:!je(I)||!je(k)})}return{itemId:s,nodeData:b,labelData:b,styles:Dse(this,this.properties,r)}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0));const n=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateMarkers(this.itemSelection,!1,"overlay"),this.updateMarkers(this.highlightSelection,!0,n),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=JC.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,s=this.visible&&e.shape&&i?this.nodeData:[];this.itemSelection.update(s)}updateHighlightSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=JC.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.visible&&e.shape&&i&&s?.datum?[{...s}]:[];this.highlightSelection.update(n)}getMarkerFill(e){return e?.fill??this.getStyle().marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:s,radiusKey:n}=i;return{seriesId:t,datum:e,angleKey:s,radiusKey:n}}updateDatumStyles(e,t){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,n)=>{const o=this.getHighlightState(i,t,n.datumIndex),a=this.getStyle(o),{stroke:r,strokeWidth:l,strokeOpacity:c}=a;n.style=this.getMarkerStyle(this.properties.marker,n,this.getDatumStylerProperties(n.datum),{isHighlight:t,highlightState:o},a.marker,{stroke:r,strokeWidth:l,strokeOpacity:c})})}updateMarkers(e,t,i){const s=this.getShapeFillBBox(),{contextNodeData:n}=this;if(!n)return;const o=this.ctx.highlightManager.getActiveHighlight();i=this.getDrawingMode(t,i),e.each((a,r)=>{const l=r.style??n.styles[this.getHighlightState(o,t,r.datumIndex)];this.applyMarkerStyle(l,a,r.point,s),a.drawingMode=i})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?[{...t}]:[];this.labelSelection.update(this.nodeData).each((s,n)=>{n.label&&(s.fillOpacity=this.getHighlightStyle(!1,n.datumIndex).opacity??1,JF(this,s,e,e.label,n.label,!1,t))}),this.highlightLabelSelection.update(i).each((s,n)=>{n.label&&(s.fillOpacity=this.getHighlightStyle(!0,n.datumIndex).opacity??1,JF(this,s,e,e.label,n.label,!0,t))})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d,marker:u}=o,p=n.angle,f=n.radius;if(!i||!s||!p||!f)return;const y=s.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"angleValue",s)[e],b=i.resolveColumnById(this,"radiusValue",s)[e],v=this.properties.allowNullKeys??!1;if(x===void 0&&!v)return;const S=this.getMarkerStyle(u,{datum:y,datumIndex:e},this.getDatumStylerProperties(y),{isHighlight:!1});return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",x,y,a,void 0,v),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(f,"tooltip",b,y,l,void 0),missing:N.isTooltipValueMissing(b)}]},{seriesId:t,datum:y,title:r,angleKey:a,radiusKey:l,angleName:r,radiusName:c,legendItemName:h,...S})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,marker:n}=this.getStyle();return{marker:{shape:n.shape,enabled:n.enabled||t<=0,fill:this.getMarkerFill()??n.stroke??e??"rgba(0, 0, 0, 0)",stroke:n.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{radiusKey:n,radiusName:o,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??o??n},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:s}=this,{x:n,y:o}=e,a=this.radius;if(Math.hypot(n-i,o-s)>a+this.maxChartMarkerSize)return;let l=1/0,c;for(const h of t){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(u))continue;const p=Math.hypot(e.x-d-i,e.y-u-s);pthis.animatePaths(s),onStop:()=>this.animatePaths(1)}),pse(this,i,"added",this.getAnimationDrawingModes(),e),use(this,"labels",i,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints(),s=this.getStyle();e.fill=void 0,e.stroke=s.stroke,e.strokeWidth=s.strokeWidth,e.strokeOpacity=s.strokeOpacity,e.lineDash=s.lineDash,e.lineDashOffset=s.lineDashOffset,t.clear(!0);for(const{x:n,y:o,moveTo:a}of i)a?t.moveTo(n,o):t.lineTo(n,o);return e.checkPathDirty(),s}}getStylerResult(e,t){const{styler:i}=this.properties;if(i){const s=this.makeStylerParams(t),n=this.cachedCallWithContext(i,s)??{},o=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],n,{pick:!1});o&&(e=o)}return e}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{angleKey:t,radiusKey:i},{isHighlight:!0})}computeFocusBounds(e){return yse(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};eL.className="RadarSeries";var tL=class extends Ri{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};g([m],tL.prototype,"fill",2),g([m],tL.prototype,"fillOpacity",2);var{Group:kse,HighlightState:Ase,Path:wse,PointerEvents:e_,Selection:Cse,toHighlightString:Lse}=N,iL=class extends eL{constructor(e){super(e),this.properties=new tL,this.areaGroup=this.contentGroup.appendChild(new kse({name:"radar-area"})),this.areaSelection=Cse.select(this.areaGroup,wse),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){if(e?.fill!=null)return e.fill;const t=this.getStyle();return t.marker.fill??t.fill}updatePathNodes(){const e=this.getPathNodesStyle(),{fill:t,fillOpacity:i,strokeWidth:s,stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,opacity:l}=e,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:e_.None,opacity:l,stroke:n,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:r});const h=this.getAreaNode();h&&(h.setStyleProperties({fill:t,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),h.setProperties({lineJoin:"round",pointerEvents:e_.None,opacity:l}))}animatePaths(e){super.animatePaths(e);const t=this.getAreaNode();t&&this.animateSinglePath(t,this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=a=>{const r=this.axes[a];return r instanceof N.PolarAxis?r:void 0},i=t("radius"),s=t("angle");if(!i?.isReversed())return e;const o=s?.getAxisLinePoints()?.points??[];return e.concat(...o)}resetPaths(){const e=super.resetPaths(),t=this.getAreaNode();if(t){const{path:i}=t,s=this.getAreaPoints(),n=e??this.getStyle(),o=this.getShapeFillBBox();t.setStyleProperties({fill:n.fill,stroke:void 0,fillOpacity:n.fillOpacity,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},o),t.lineJoin=t.lineCap="round",i.clear(!0);for(const{x:a,y:r,moveTo:l,arc:c,radius:h=0,startAngle:d=0,endAngle:u=0}of s)c?i.arc(a,r,h,d,u):l?i.moveTo(a,r):i.lineTo(a,r);return i.closePath(),t.checkPathDirty(),n}}makeStylerParams(e){const{properties:t}=this,i=Lse(e??Ase.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,fill:t.fill,fillOpacity:t.fillOpacity,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,fill:i,fillOpacity:s,lineDash:n,lineDashOffset:o,stroke:a,strokeOpacity:r,strokeWidth:l}=this.properties,{size:c,shape:h,fill:d="transparent",fillOpacity:u}=t,p=this.getStylerResult({},e);return p.marker??(p.marker={}),{fill:p.fill??i,fillOpacity:p.fillOpacity??s,lineDash:p.lineDash??n,lineDashOffset:p.lineDashOffset??o,stroke:p.stroke??a,strokeOpacity:p.strokeOpacity??r,strokeWidth:p.strokeWidth??l,marker:{enabled:p.marker.enabled??t.enabled,fill:p.marker.fill??d,fillOpacity:p.marker.fillOpacity??u,shape:p.marker.shape??h,size:p.marker.size??c,lineDash:p.marker.lineDash??t.lineDash??n,lineDashOffset:p.marker.lineDashOffset??t.lineDashOffset??o,stroke:p.marker.stroke??t.stroke??a,strokeOpacity:p.marker.strokeOpacity??t.strokeOpacity??r,strokeWidth:p.marker.strokeWidth??t.strokeWidth??l}}}};iL.className="RadarAreaSeries",iL.type="radar-area";var{radarAreaSeriesThemeableOptionsDef:Nse}=N,sL={...qe,...Nse,type:j(Ce("radar-area")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L};sL.angleKeyAxis=Q(L),sL.radiusKeyAxis=Q(L);var t_={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,version:de,dependencies:[el],options:sL,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:tse,create:e=>new iL(e)},{HighlightState:Tse,PointerEvents:Ose,toHighlightString:Pse}=N,nL=class extends eL{constructor(){super(...arguments),this.properties=new Ri}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const e=this.getLineNode();if(!e)return;const t=this.getPathNodesStyle(),{strokeWidth:i,stroke:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,opacity:r}=t;e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:Ose.None,opacity:r,stroke:s,strokeWidth:i,strokeOpacity:n,lineDash:o,lineDashOffset:a})}makeStylerParams(e){const{properties:t}=this,i=Pse(e??Tse.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,lineDash:i,lineDashOffset:s,stroke:n,strokeOpacity:o,strokeWidth:a}=this.properties,{size:r,shape:l,fill:c="transparent",fillOpacity:h}=t,d=this.getStylerResult({},e);return d.marker??(d.marker={}),{lineDash:d.lineDash??i,lineDashOffset:d.lineDashOffset??s,stroke:d.stroke??n,strokeOpacity:d.strokeOpacity??o,strokeWidth:d.strokeWidth??a,marker:{enabled:d.marker.enabled??t.enabled,fill:d.marker.fill??c,fillOpacity:d.marker.fillOpacity??h,shape:d.marker.shape??l,size:d.marker.size??r,lineDash:d.marker.lineDash??t.lineDash??i,lineDashOffset:d.marker.lineDashOffset??t.lineDashOffset??s,stroke:d.marker.stroke??t.stroke??n,strokeOpacity:d.marker.strokeOpacity??t.strokeOpacity??o,strokeWidth:d.marker.strokeWidth??t.strokeWidth??a}}}};nL.className="RadarLineSeries",nL.type="radar-line";var{radarLineSeriesThemeableOptionsDef:Ese}=N,oL={...qe,...Ese,type:j(Ce("radar-line")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L};oL.angleKeyAxis=Q(L),oL.radiusKeyAxis=Q(L);var i_={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,version:de,dependencies:[el],options:oL,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:ese,create:e=>new nL(e)},{SeriesProperties:Rse,makeSeriesTooltip:zse,Label:Vse}=N,oi=class extends Rse{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Vse,this.tooltip=zse()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,cornerRadius:r,opacity:1}}};g([m],oi.prototype,"angleKey",2),g([m],oi.prototype,"radiusKey",2),g([m],oi.prototype,"angleName",2),g([m],oi.prototype,"radiusName",2),g([m],oi.prototype,"angleKeyAxis",2),g([m],oi.prototype,"radiusKeyAxis",2),g([m],oi.prototype,"legendItemName",2),g([m],oi.prototype,"fill",2),g([m],oi.prototype,"fillOpacity",2),g([m],oi.prototype,"stroke",2),g([m],oi.prototype,"strokeWidth",2),g([m],oi.prototype,"strokeOpacity",2),g([m],oi.prototype,"lineDash",2),g([m],oi.prototype,"lineDashOffset",2),g([m],oi.prototype,"cornerRadius",2),g([m],oi.prototype,"styler",2),g([m],oi.prototype,"itemStyler",2),g([m],oi.prototype,"rotation",2),g([m],oi.prototype,"stackGroup",2),g([m],oi.prototype,"normalizedTo",2),g([m],oi.prototype,"label",2),g([m],oi.prototype,"tooltip",2);var{SectorBox:s_,motion:Bse}=N;function Fse(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.innerRadius)||Number.isNaN(e.previousDatum.outerRadius))return"added";if(Number.isNaN(t.innerRadius)||Number.isNaN(t.outerRadius))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function n_(e){return{toFn:(s,n,o)=>{let a,r,l,c,h;return o==="removed"?(a=e,r=e,l=n.innerRadius,c=n.outerRadius,h=new s_(a,r,l,c)):(a=n.startAngle,r=n.endAngle,l=Number.isNaN(n.innerRadius)?s.innerRadius:n.innerRadius,c=Number.isNaN(n.outerRadius)?s.outerRadius:n.outerRadius,h=n.clipSector),{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(s,n,o)=>{o=Fse(s,n,o);let a,r,l,c,h;o==="removed"||o==="updated"?(a=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,h=s.clipSector):(a=e,r=e,l=n.innerRadius,c=n.outerRadius),h??(h=new s_(a,r,l,c));const d=Bse.NODE_UPDATE_STATE_TO_PHASE_MAPPING[o];return{startAngle:a,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function _se(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:Hse,DEFAULT_POLAR_DIRECTION_NAMES:Gse,PolarAxis:jse,diff:Wse,groupAccumulativeValueProperty:o_,keyProperty:$se,normaliseGroupTo:Kse,valueProperty:Use,fixNumericExtent:Yse,resetLabelFn:Zse,seriesLabelFadeInAnimation:Xse,seriesLabelFadeOutAnimation:qse,animationValidation:Qse,createDatumId:Jse,CategoryScale:ene,Sector:tne,SectorBox:ine,motion:a_,updateLabelNode:r_,getItemStyles:sne}=N,nne=class extends N.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},aL=class extends N.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:Hse,propertyNames:Gse,canHaveAxes:!0,animationResetFns:{item:_se,label:Zse}}),this.properties=new oi,this.NodeEvent=nne,this.groupScale=new ene,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new tne}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e==="angle"){const s=t.getDomain(this,"angleValue-end","value",i).domain,n=[Math.min(s[0],0),Math.max(s[1],0)];return{domain:Yse(n)}}else return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,n=!this.ctx.animationManager.isSkipped(),o=this.getStackId(),a=`${o}-trailing`,r=[];vt(s)&&r.push(Kse([o,a],Math.abs(s))),this.needsDataModelDiff()&&this.processedData&&r.push(Wse(this.id,this.processedData)),n&&r.push(Qse());const l=this.visible?{}:{forceValue:0},c=this.axes.radius?.scale.type,h=this.axes.angle?.scale.type,d=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[$se(i,c,{id:"radiusValue",allowNullKey:d}),Use(t,h,{id:"angleValue-raw",invalidValue:null,...l}),...o_(t,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:o,separateNegative:!0,...l},h),...o_(t,"trailing",{id:"angleValue-start",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes.radius;return e instanceof jse?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||e?.type!=="grouped")return;const i=this.axes.angle,s=this.axes.radius,n=i?.scale,o=s?.scale;if(!n||!o)return;const a=t.resolveKeysById(this,"radiusValue",e),r=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof fd&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:f}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:f}).map((F,_)=>String(_)),u.range=[0,Math.abs(o.bandwidth??0)],u.paddingInner=f>1?d:0;const y=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,x=i.isReversed(),b=s.isReversed(),v=b?this.radius:this.getAxisInnerRadius(),M=(b?this.getAxisInnerRadius():this.radius)+v,D=this.getSeriesDomain("angle").domain,{angleKey:I,radiusKey:k,angleName:A,radiusName:w,legendItemName:C,label:T}=this.properties,O=(F,_,Y,Z)=>{const ne=this.getLabelText(_,F,I,"angle",D,T,{value:_,datum:F,angleKey:I,radiusKey:k,angleName:A,radiusName:w,legendItemName:C});if(ne)return{x:Y,y:Z,text:ne,textAlign:"center",textBaseline:"middle"}},V=[],z=sne((F,_,Y)=>Qp(this,F,_,Y)),R={itemId:k,nodeData:V,labelData:V,styles:z};if(!this.visible)return R;const{dataSources:B}=e,G=B.get(this.id)?.data??[];for(const{datumIndex:F,group:_}of t.forEachGroupDatum(this,e)){const Y=G[F],Z=a[F];if(Z===void 0&&!this.properties.allowNullKeys)return;const ne=c[F],te=r[F],ue=l[F],ge=ne>=0&&!Object.is(ne,-0),be=_.aggregation[h][ge?1:0],fe=ge===x;let He=n.convert(te,{clamp:!0}),Re=n.convert(ue,{clamp:!0}),ze=n.convert(0,{clamp:!0}),Te=n.convert(be,{clamp:!0});fe&&([ze,Te]=[Te,ze],[He,Re]=[Re,He]);const De=M-o.convert(Z)+u.convert(String(p)),pe=De+y,dt=(De+pe)/2,yt=He+Xo(He,Re)/2,ut=Math.cos(yt)*dt,bt=Math.sin(yt)*dt,pt=this.properties.label.enabled?O(Y,ne,ut,bt):void 0,ui=new ine(He,Re,De,pe);V.push({series:this,datum:Y,datumIndex:F,point:{x:ut,y:bt,size:0},midPoint:{x:ut,y:bt},label:pt,angleValue:ne,radiusValue:Z,innerRadius:De,outerRadius:pe,startAngle:ze,endAngle:Te,clipSector:ui,reversed:fe,index:F})}return R}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){let i=[];const s=this.ctx.highlightManager?.getActiveHighlight();t?s?.datum&&s.series===this&&i.push(s):i=this.nodeData;const{contextNodeData:n}=this;if(!n)return;const o=this.ctx.highlightManager.getActiveHighlight(),a=this.getShapeFillBBox(),r=this.hasItemStylers();e.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const h=bm(c);if(h==null)return;if(r){const y=this.getHighlightState(s,t,c.datumIndex);c.style=Qp(this,c,t,y)}const d=c.style??n.styles[this.getHighlightState(o,t,c.datumIndex)],u=d.cornerRadius,p=d.fill,f=qt(p)&&p.bounds!=="item"?{centerX:0,centerY:0}:void 0;l.setStyleProperties(d,a,f),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=h.reversed?u:0,l.startOuterCornerRadius=h.reversed?u:0,l.endInnerCornerRadius=h.reversed?0:u,l.endOuterCornerRadius=h.reversed?0:u,t&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.clipSector=c.clipSector,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius)})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?t:void 0,s=i?[i]:[];this.labelSelection.update(this.nodeData).each((n,o)=>{r_(this,n,e,e.label,o.label,!1,t),n.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1}),this.highlightLabelSelection.update(s,void 0,n=>this.getDatumId(n)).each((n,o)=>{r_(this,n,e,e.label,o.label,!0,t),n.fillOpacity=this.getHighlightStyle(!0,o.datumIndex).opacity??1})}getBarTransitionFunctions(){const e=this.axes.angle?.scale;let t=0;if(!e)return n_(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),n_(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();a_.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),Xse(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();a_.fromToMotion(this.id,"datums",t,[e],i),qse(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:o}=this,{angleKey:a,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=o,u=n.angle,p=n.radius,f=this.nodeData?.[e];if(!i||!s||!u||!p||!f)return;const y=s.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"radiusValue",s)[e],b=i.resolveColumnById(this,"angleValue-raw",s)[e];if(x===void 0&&!this.properties.allowNullKeys)return;const v=Qp(this,f,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",x,y,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:a,value:this.getAxisValueText(u,"tooltip",b,y,a,void 0),missing:N.isTooltipValueMissing(b)}]},{seriesId:t,datum:y,title:r,angleKey:a,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...v})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a}=ZC(this,!1,N.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:o,lineDashOffset:a};return qt(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{angleKey:s,angleName:n,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:o??n??s},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}getDatumId(e){return Jse(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};aL.className="RadialBarSeries",aL.type="radial-bar";var{radialBarSeriesThemeableOptionsDef:one}=N,rL={...qe,...one,type:j(Ce("radial-bar")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L,grouped:E,stacked:E,stackGroup:L,normalizedTo:$};rL.angleKeyAxis=Q(L),rL.radiusKeyAxis=Q(L);var ane={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",lM],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:Ys},axes:{"radius-category":{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},l_={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:de,dependencies:[el],options:rL,defaultAxes:{angle:{type:"angle-number"},radius:{type:"radius-category"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:ane,create:e=>new aL(e)},lL=class extends Ut{};g([m],lL.prototype,"columnWidthRatio",2),g([m],lL.prototype,"maxColumnWidthRatio",2);var{PolarAxis:rne,RadialColumnShape:lne,getRadialColumnWidth:cne}=N,cL=class extends UF{constructor(e){super(e,{animationResetFns:{item:Kie}}),this.properties=new lL}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new lne}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return $ie(e)}isRadiusAxisCircle(){const e=this.axes.radius;return e instanceof rne?e.shape==="circle":!1}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return cne(e,t,this.radius,i,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};cL.className="RadialColumnSeries",cL.type="radial-column";var{radialColumnSeriesThemeableOptionsDef:hne}=N,hL={...qe,...hne,type:j(Ce("radial-column")),angleKey:j(L),radiusKey:j(L),angleName:L,radiusName:L,legendItemName:L,grouped:E,stacked:E,stackGroup:L,normalizedTo:$};hL.angleKeyAxis=Q(L),hL.radiusKeyAxis=Q(L);var dne={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Ty],["image",it],["pattern",tt]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Ys},axes:{"angle-category":{shape:{$findFirstSiblingNotOperation:"circle"},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},"radius-number":{shape:{$findFirstSiblingNotOperation:"circle"},innerRadiusRatio:.5}}},c_={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:de,dependencies:[el],options:hL,defaultAxes:{angle:{type:"angle-category"},radius:{type:"radius-number"}},axisKeys:{angle:"angleKeyAxis",radius:"radiusKeyAxis"},themeTemplate:dne,create:e=>new cL(e)},h_=[FE,RF,EF,GF,HF,XF,t_,i_,l_,c_,am,xm,Jv,IS].flat(),{Chart:une,MercatorScale:d_}=N;function pne(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var OS=class extends une{constructor(e,t){super(e,t),this.xAxis={id:gi(N.Axis),direction:"x"},this.yAxis={id:gi(N.Axis),direction:"y"},this.ctx.zoomManager.setAxes([this.xAxis,this.yAxis]),this.ctx.zoomManager.panToBBoxScalingMode=N.PanToBBoxScalingModeEnum.WhenViewportTooSmallScaleXYProportionally}getChartType(){return"topology"}updateData(){super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const i of this.series)pne(i)&&i.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,s=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=s,this.animationRect=s;const n=this.series,o=n.reduce((l,c)=>{if(!c.visible)return l;const h=c.topologyBounds;return h==null?l:l==null?h:l.merge(h)},void 0);let a;if(o!=null){const{lon0:l,lat0:c,lon1:h,lat1:d}=o,u=[[l,c],[h,d]],p=d_.bounds(u),{width:f,height:y}=s,x=Math.min(f/p.width,y/p.height),b=p.width*x,v=p.height*x,S=(f-b)/2,M=(y-v)/2,D=S,I=M,k=S+b,A=M+v,w=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),C=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),T=(k-D)/(w.max-w.min),O=D-T*w.min,V=(A-I)/(1-C.min-(1-C.max)),z=I-V*(1-C.max);a=new d_(u,[[O,z],[O+T,z+V]])}for(const l of n)l.scale=a;const r=this.series.some(l=>l.visible);t.visible=r;for(const l of[t,i])l.translationX=Math.floor(s.x),l.translationY=Math.floor(s.y),l.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:r,rect:s,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}hasPgUpPgDownSupport(){return!1}};OS.className="TopologyChart",OS.type="topology",g([m],OS.prototype,"topology",2);var{topologyChartOptionsDefs:gne}=N,Rm={type:"chart",name:"topology",enterprise:!0,version:de,options:gne,create(e,t){return new OS(e,t)}},zm={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1}};function hr(e){const t=Pe(e);return Oa(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}var fne=1e-9;function u_(e,t,i,s){const[n,o]=e,[a,r]=t,l=a-n,c=r-o,h=l*l+c*c;let d,u;if(Math.abs(h)t){const h=(t-n)/l,d=[i+(a-i)*h,s+(r-s)*h],u=Math.atan2(r-s,a-i);return{point:d,angle:u}}n=c,i=a,s=r}}var Vm=class fH{constructor(t,i,s,n){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=n}extend(t,i,s,n){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,s),this.lat1=Math.max(this.lat1,n),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,s,n,o){return t?t.extend(i,s,n,o):new fH(i,s,n,o)}};function Jp(e,t){for(const i of e){const[s,n]=i;t=Vm.extend(t,s,n,s,n)}return t}function mne(e){if(e.length===0)return;let t=0,i=0,s=0,[n,o]=e.at(-1);for(const[a,r]of e){const l=n*r-a*o;s+=l,t+=(n+a)*l,i+=(o+r)*l,n=a,o=r}return s*=3,[t/s,i/s]}function ES(e,t,i){let s=!1,n=1/0;for(const o of e){let a=o.at(-1),[r,l]=a;for(const c of o){const[h,d]=c;d>i!=l>i&&t<(r-h)*(i-d)/(l-d)+h&&(s=!s),n=Math.min(n,u_(a,c,t,i)),a=c,r=h,l=d}}return(s?-1:1)*Math.sqrt(n)}var{Path:yne,ExtendedPath2D:xne,BBox:bne}=N,eg=class extends yne{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new xne}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=e==null?void 0:this.drawGeometry(e,void 0)}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(e,t)?!1:this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,e,t);return s>0?s*s:0}geometryDistance(e,t,i){const{renderMode:s,strokeWidth:n}=this,o=(s&1)!==0,a=(s&2)!==0,r=Math.max(n/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,t,i)),1/0);case"MultiPolygon":return o?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(ES(c,t,i),0)),1/0):1/0;case"Polygon":return o?Math.max(ES(e.coordinates,t,i),0):1/0;case"MultiLineString":return a?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(p_(c,t,i)-r,0)),1/0):1/0;case"LineString":return a?Math.max(p_(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}shouldDrawPolygons(){return(this.renderMode&1)!==0}shouldDrawLines(){return(this.renderMode&2)!==0}drawGeometryCollection(e,t){for(const i of e)t=this.drawGeometry(i,t);return t}drawMultiPolygon(e,t){if(!this.shouldDrawPolygons())return t;for(const i of e)t=this.drawPolygon(this.path,i,t);return t}drawSinglePolygon(e,t){return this.shouldDrawPolygons()?this.drawPolygon(this.path,e,t):t}drawMultiLineString(e,t){if(!this.shouldDrawLines())return t;for(const i of e)t=this.drawLineString(this.strokePath,i,t,!1);return t}drawSingleLineString(e,t){return this.shouldDrawLines()?this.drawLineString(this.strokePath,e,t,!1):t}drawGeometry(e,t){switch(e.type){case"GeometryCollection":return this.drawGeometryCollection(e.geometries,t);case"MultiPolygon":return this.drawMultiPolygon(e.coordinates,t);case"Polygon":return this.drawSinglePolygon(e.coordinates,t);case"MultiLineString":return this.drawMultiLineString(e.coordinates,t);case"LineString":return this.drawSingleLineString(e.coordinates,t);case"Point":case"MultiPoint":return t}}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let s=1;si)&&(i=o,s=n)}return s}function tg(e,t){if(e.bbox!=null){const[i,s,n,o]=e.bbox;return t=Vm.extend(t,i,s,n,o),t}switch(e.type){case"GeometryCollection":for(const i of e.geometries)t=tg(i,t);break;case"MultiPolygon":for(const i of e.coordinates)i.length>0&&(t=Jp(i[0],t));break;case"Polygon":e.coordinates.length>0&&(t=Jp(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=Jp(i,t);break;case"LineString":t=Jp(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[s,n]=i;t=Vm.extend(t,s,n,s,n)}break;case"Point":{const[i,s]=e.coordinates;t=Vm.extend(t,i,s,i,s);break}}return t}function zS(e){switch(e.type){case"Polygon":return e.coordinates;case"MultiPolygon":return RS(e.coordinates,g_);case"GeometryCollection":{const t=e.geometries.map(zS).filter(i=>i!=null);return RS(t,g_)}case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function VS(e){switch(e.type){case"LineString":return e.coordinates;case"MultiLineString":return RS(e.coordinates,dL);case"GeometryCollection":{const t=e.geometries.map(VS).filter(i=>i!=null);return RS(t,dL)}case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function uL(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>uL(i,t));case"MultiPolygon":case"Polygon":return(t&1)!==0;case"MultiLineString":case"LineString":return(t&2)!==0;case"MultiPoint":case"Point":return(t&4)!==0}}function yd(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>yd(i,t))};case"Polygon":return{type:"Polygon",coordinates:pL(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:vne(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:pL(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:gL(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:gL(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function vne(e,t){return e.map(i=>pL(i,t))}function pL(e,t){return e.map(i=>gL(i,t))}function gL(e,t){return e.map(i=>t.convert(i))}var woe=class extends N.SeriesProperties{},Bm=class extends N.DataModelSeries{constructor(e){super(e),this.cleanup.register(this.ctx.eventsHub.on("data:update",()=>{}),this.ctx.eventsHub.on("legend:item-click",t=>{this.onLegendItemClick(t)}),this.ctx.eventsHub.on("legend:item-double-click",t=>{this.onLegendItemDoubleClick(t)}))}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:t}=this.properties,i=t!=null&&e?.datum==null&&t===e?.legendItemName;return e!=null&&(e.series!==this&&!i||e.datum==null)&&(e=void 0),e}isSeriesHighlighted(e){if(!this.properties.highlight.enabled)return!1;const{series:t,legendItemName:i}=e??{},{legendItemName:s}=this.properties;return t===this||s!=null&&s===i}},{SeriesProperties:Sne,makeSeriesTooltip:Mne}=N,Hc=class extends Sne{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=Mne()}};g([m],Hc.prototype,"topology",2),g([m],Hc.prototype,"stroke",2),g([m],Hc.prototype,"strokeOpacity",2),g([m],Hc.prototype,"strokeWidth",2),g([m],Hc.prototype,"lineDash",2),g([m],Hc.prototype,"lineDashOffset",2),g([m],Hc.prototype,"tooltip",2);var{createDatumId:Dne,Group:Ine,Selection:kne,PointerEvents:f_}=N,fL=class extends Bm{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new Hc,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Ine({name:"itemGroup"})),this.datumSelection=kne.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=f_.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new eg;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=f_.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:tg(s,t)},void 0),e==null&&W.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,strokeWidth:l}=s,c=[],h=[];for(const[d,u]of t.features.entries()){const{geometry:p}=u,f=p!=null&&i!=null?yd(p,i):void 0;f!=null&&c.push({series:this,datum:u,datumIndex:0,index:d,projectedGeometry:f,style:{stroke:n,strokeOpacity:o,lineDash:a,lineDashOffset:r,strokeWidth:l}})}return{itemId:e,nodeData:c,labelData:h}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Dne(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:n}=s;if(n==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=n,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};fL.className="MapLineBackgroundSeries",fL.type="map-line-background";var{mapLineBackgroundSeriesThemeableOptionsDef:Ane}=N,wne={...Ane,type:j(Ce("map-line-background")),topology:Fl},m_={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,version:de,dependencies:[Rm],options:wne,themeTemplate:{...zm,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}},create:e=>new fL(e)};function Cne(){return{fromFn:(i,s,n)=>n==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,n)=>n==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function y_(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(i!==void 0){for(const s of e.datumSelection.nodes())if(s.datum===i)return s}}var{SeriesProperties:Lne,makeSeriesTooltip:Nne,Label:Tne}=N,Yt=class extends Lne{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new Tne,this.tooltip=Nne()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:n,opacity:1}}};g([m],Yt.prototype,"topology",2),g([m],Yt.prototype,"title",2),g([m],Yt.prototype,"legendItemName",2),g([m],Yt.prototype,"idKey",2),g([m],Yt.prototype,"topologyIdKey",2),g([m],Yt.prototype,"idName",2),g([m],Yt.prototype,"labelKey",2),g([m],Yt.prototype,"labelName",2),g([m],Yt.prototype,"sizeKey",2),g([m],Yt.prototype,"sizeName",2),g([m],Yt.prototype,"colorKey",2),g([m],Yt.prototype,"colorName",2),g([m],Yt.prototype,"sizeDomain",2),g([m],Yt.prototype,"colorRange",2),g([m],Yt.prototype,"maxStrokeWidth",2),g([m],Yt.prototype,"stroke",2),g([m],Yt.prototype,"strokeOpacity",2),g([m],Yt.prototype,"strokeWidth",2),g([m],Yt.prototype,"lineDash",2),g([m],Yt.prototype,"lineDashOffset",2),g([m],Yt.prototype,"itemStyler",2),g([m],Yt.prototype,"label",2),g([m],Yt.prototype,"tooltip",2);var{getMissCount:One,getLabelStyles:Pne,createDatumId:x_,SeriesNodePickMode:b_,valueProperty:Fm,ColorScale:Ene,LinearScale:Rne,Selection:BS,Text:v_,Transformable:zne}=N,mL=class extends Bm{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[b_.EXACT_SHAPE_MATCH,b_.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new Yt,this._chartTopology=void 0,this.colorScale=new Ene,this.sizeScale=new Rne,this.datumSelection=BS.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=BS.select(this.labelGroup,v_),this.highlightDatumSelection=BS.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=BS.select(this.highlightLabelGroup,v_),this.placedLabelData=[],this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new eg;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:n}=this,{topologyIdKey:o,idKey:a,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,u=new Map;for(const S of i?.features.values()??[]){const M=S.properties?.[o];M==null||!uL(S.geometry,2)||u.set(M,S)}const p=this.sizeScale.type,f=this.colorScale.type,y=this.scale?.type,{dataModel:x,processedData:b}=await this.requestDataModel(e,t,{props:[Fm(a,y,{id:"idValue",includeProperty:!1}),Fm(a,y,{id:"featureValue",includeProperty:!1,processor:()=>S=>u.get(S)}),...c==null?[]:[Fm(c,"category",{id:"labelValue"})],...r==null?[]:[Fm(r,p,{id:"sizeValue"})],...l==null?[]:[Fm(l,f,{id:"colorValue"})]]}),v=x.resolveColumnById(this,"featureValue",b);if(this.topologyBounds=v.reduce((S,M)=>{const D=M?.geometry;return D==null?S:tg(D,S)},void 0),r!=null){const S=x.resolveProcessedDataIndexById(this,"sizeValue"),M=b.domain.values[S]??[];s.domain=h??M}if(d!=null&&this.isColorScaleValid()){const S=x.resolveProcessedDataIndexById(this,"colorValue");n.domain=b.domain.values[S],n.range=d,n.update()}i==null&&W.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=One(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(e,t,i,s,n,o){if(s==null||n==null||i==null)return;const a=VS(n);if(a==null)return;const{idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f,label:y}=this.properties;if(p==null||!y.enabled)return;const x=this.getLabelText(s,e,p,"label",[],y,{value:s,datum:e,idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f});if(x==null)return;const b=o.measureLines(String(x)),v=PS(a);if(v==null)return;const[S,M]=v.point,{width:D,height:I}=b;return{point:{x:S,y:M,size:0},label:{width:D,height:I,text:x},anchor:void 0,placement:void 0,datumIndex:t,idValue:i}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveLineDataColumns(e){const{sizeKey:t,colorKey:i,labelKey:s}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e),labelValues:this.resolveColumn(s,"labelValue",e),sizeValues:this.resolveColumn(t,"sizeValue",e),colorValues:this.resolveColumn(i,"colorValue",e)}}prepareProjectedLineGeometries(e,t,i){const s=new Map;for(const[n]of i.dataSources.get(this.id)?.data.entries()??[]){const o=e[n],a=t[n]?.geometry,r=a!=null&&this.scale!=null?yd(a,this.scale):void 0;o!=null&&r!=null&&s.set(o,r)}return s}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}W.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n}=this,{label:o,legendItemName:a,colorKey:r}=n;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const l=this.resolveLineDataColumns(i),c=n.maxStrokeWidth??n.strokeWidth;s.range=[Math.min(n.strokeWidth,c),c];const h=et(o),d=this.prepareProjectedLineGeometries(l.idValues,l.featureValues,i),u=[],p=[],f=[],y=i.dataSources.get(this.id)?.data??[];for(const[x,b]of y.entries()){const v={idValue:l.idValues[x],colorValue:l.colorValues?.[x],sizeValue:l.sizeValues?.[x],labelValue:l.labelValues?.[x]},S=d.get(v.idValue);if(S==null&&f.push(v.idValue),r!=null&&v.colorValue==null)continue;const M=this.getLabelDatum(b,x,v.idValue,v.labelValue,S,h);M!=null&&p.push(M),u.push({series:this,datum:b,datumIndex:x,...v,projectedGeometry:S,legendItemName:a,style:this.getItemStyle({datumIndex:x,datum:b,colorValue:v.colorValue,sizeValue:v.sizeValue},!1)})}return this.warnMissingGeometries(f),{itemId:e,nodeData:u,labelData:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const i=this.ctx.chartService.highlight?.drawingMode??"overlay",s=this.getHighlightedDatum(),n=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1,drawingMode:"overlay"}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s==null?[]:[s],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0,drawingMode:i}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(s)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>x_(t.idValue))}getItemStyle({datumIndex:e=0,datum:t,colorValue:i,sizeValue:s},n){const{properties:o,colorScale:a,sizeScale:r}=this,{colorRange:l,itemStyler:c}=o,h=o.getStyle();i!=null&&(h.stroke=this.isColorScaleValid()?a.convert(i):l?.[0]??o.stroke);const d=this.getHighlightStyle(n,e),u=ce(d,h);s!=null&&(u.strokeWidth=r.convert(s,{clamp:!0}));let p;return c!=null&&(p=this.cachedDatumCallback(x_(e,n?"highlight":"node"),()=>{const f=this.makeItemStylerParams(t,e,n,u);return this.callWithContext(c,f)})),p?ce(u,p):u}makeItemStylerParams(e,t,i,s){const{id:n}=this,o=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(o,i,t);return{seriesId:n,datum:e,highlightState:a,...s}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){e.each((i,s)=>{const{projectedGeometry:n,style:o}=s;if(n==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=n,i.setProperties(o),i.drawingMode=t})}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=N.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.getHighlightedDatum();t.each((n,o)=>{const{x:a,y:r,width:l,height:c,text:h,datum:d}=o,u=Pne(this,void 0,i,i.label,e,s),{color:p,fontStyle:f,fontWeight:y,fontSize:x,fontFamily:b}=u;n.visible=!0,n.x=a+l/2,n.y=r+c/2,n.text=h,n.fill=p,n.fontStyle=f,n.fontWeight=y,n.fontSize=x,n.fontFamily=b,n.textAlign="center",n.textBaseline="middle";const v=d?.datumIndex;n.fillOpacity=this.getHighlightStyle(e,v).opacity??1,n.setBoxing(u)})}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=e?.idValue,i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(s=>s.datum.idValue===t);this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0&&this.highlightLabelSelection.cleanup(),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(e,t);anew mL(e)};function D_(e,t,i){const s=Jp(e[0],void 0);if(s==null)return;const n=(s.lon0+s.lon1)/2,o=(s.lat0+s.lat1)/2,a=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=mne(e[0]),[c,h]=l,d=-ES(e,c,h);let u;const p=(D,I)=>{const A=Math.max(I-d,0);return D-.5*A},f=(D,I,k)=>{const{distance:A,maxDistance:w}=i(e,D,I,k),C=Math.hypot(c-D,h-I),T=Math.min(Math.max(c,D-k/2),D+k/2),O=Math.min(Math.max(h,I-k/2),I+k/2),V=Math.hypot(c-T,h-O),z=p(A,C),R=p(w,V);return{distance:A,maxDistance:w,value:z,maxValue:R,x:D,y:I,stride:k}},y=(D,I,k,A)=>{const w=f(I,k,A);w.maxDistance>=0&&D.push(w)},x=Math.min(a,r)/2;let b={value:f(n,o,x),next:null};for(;b!=null;){const D=b.value,{distance:I,value:k,maxValue:A,x:w,y:C,stride:T}=D;if(b=b.next,I>0&&(u==null||k>u.value)&&(u=D),u!=null&&A-u.value<=t)continue;const O=T/2,V=[];y(V,w-O,C-O,O),y(V,w+O,C-O,O),y(V,w-O,C+O,O),y(V,w+O,C+O,O),V.sort(I_),b=mx(b,V,I_)}if(u==null)return;const{distance:v,x:S,y:M}=u;return{x:S,y:M,distance:v}}var I_=(e,t)=>t.maxValue-e.maxValue;function yL(e,t){const i=D_(e,t,(o,a,r,l)=>{const c=-ES(o,a,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:s,y:n}=i;return[s,n]}function k_(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(s=>k_(s,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const s=zS(e);i=s==null?void 0:yL(s,t);break}case"Polygon":{const s=e.coordinates;i=s==null?void 0:yL(s,t);break}case"MultiLineString":{const s=VS(e);i=s==null?void 0:PS(s)?.point;break}case"LineString":{const s=e.coordinates;i=PS(s)?.point;break}}return i==null?[]:[i]}var{BBox:Bne}=N;function A_(e){if(!e)return;const{range:t}=e,i=t[0][0],s=t[0][1],n=t[1][0]-i,o=t[1][1]-s,a=new Bne(i,s,n,o);return{series:a,axis:a}}var{SeriesProperties:Fne,makeSeriesTooltip:_ne,Label:Hne}=N,w_=class extends Hne{constructor(){super(...arguments),this.placement="bottom"}};g([m],w_.prototype,"placement",2);var ht=class extends Fne{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new w_,this.tooltip=_ne()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,opacity:1,stroke:n,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:l}}};g([m],ht.prototype,"topology",2),g([m],ht.prototype,"title",2),g([m],ht.prototype,"legendItemName",2),g([m],ht.prototype,"idKey",2),g([m],ht.prototype,"topologyIdKey",2),g([m],ht.prototype,"idName",2),g([m],ht.prototype,"latitudeKey",2),g([m],ht.prototype,"latitudeName",2),g([m],ht.prototype,"longitudeKey",2),g([m],ht.prototype,"longitudeName",2),g([m],ht.prototype,"labelKey",2),g([m],ht.prototype,"labelName",2),g([m],ht.prototype,"sizeKey",2),g([m],ht.prototype,"sizeName",2),g([m],ht.prototype,"colorKey",2),g([m],ht.prototype,"colorName",2),g([m],ht.prototype,"colorRange",2),g([m],ht.prototype,"shape",2),g([m],ht.prototype,"size",2),g([m],ht.prototype,"maxSize",2),g([m],ht.prototype,"sizeDomain",2),g([m],ht.prototype,"fill",2),g([m],ht.prototype,"fillOpacity",2),g([m],ht.prototype,"stroke",2),g([m],ht.prototype,"strokeWidth",2),g([m],ht.prototype,"strokeOpacity",2),g([m],ht.prototype,"lineDash",2),g([m],ht.prototype,"lineDashOffset",2),g([m],ht.prototype,"itemStyler",2),g([m],ht.prototype,"label",2),g([m],ht.prototype,"tooltip",2);var{fromToMotion:Gne,getMissCount:jne,createDatumId:FS,SeriesNodePickMode:C_,valueProperty:xd,computeMarkerFocusBounds:Wne,ColorScale:$ne,LinearScale:Kne,Group:Une,Selection:_S,Text:L_,Marker:xL,getLabelStyles:Yne}=N,bL=class extends Bm{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[C_.EXACT_SHAPE_MATCH,C_.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new ht,this._chartTopology=void 0,this.colorScale=new $ne,this.sizeScale=new Kne,this.markerGroup=this.contentGroup.appendChild(new Une({name:"markerGroup"})),this.labelSelection=_S.select(this.labelGroup,L_,!1),this.highlightLabelSelection=_S.select(this.highlightLabelGroup,L_,!1),this.markerSelection=_S.select(this.markerGroup,xL,!1),this.highlightMarkerSelection=_S.select(this.highlightNodeGroup,xL),this.placedLabelData=[],this.animationState=new he("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[2,e],this.highlightGroup.zIndex=[3,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,sizeScale:i,colorScale:s}=this,{topologyIdKey:n,idKey:o,latitudeKey:a,longitudeKey:r,sizeKey:l,colorKey:c,labelKey:h,sizeDomain:d,colorRange:u}=this.properties,p=this.buildFeatureMap(n),f=this.sizeScale.type,y=this.colorScale.type,x=this.scale?.type,b=a!=null&&r!=null,{dataModel:v,processedData:S}=await this.requestDataModel(e,t,{props:[...o==null?[]:[xd(o,x,{id:"idValue",includeProperty:!1}),xd(o,x,{id:"featureValue",includeProperty:!1,processor:()=>k=>p.get(k)})],...b?[xd(a,x,{id:"latValue"}),xd(r,x,{id:"lonValue"})]:[],...h?[xd(h,"category",{id:"labelValue"})]:[],...l?[xd(l,f,{id:"sizeValue"})]:[],...c?[xd(c,y,{id:"colorValue"})]:[]]}),M=o==null?void 0:v.resolveColumnById(this,"featureValue",S),D=b?v.resolveColumnById(this,"latValue",S):void 0,I=b?v.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.data.reduce((k,A,w)=>{const T=M?.[w]?.geometry;if(T!=null&&(k=tg(T,k)),D!=null&&I!=null){const O=I[w],V=D[w];k=Vm.extend(k,O,V,O,V)}return k},void 0),l!=null){const k=v.resolveProcessedDataIndexById(this,"sizeValue"),A=S.domain.values[k]??[];i.domain=d??A}if(u!=null&&this.isColorScaleValid()){const k=v.resolveProcessedDataIndexById(this,"colorValue");s.domain=S.domain.values[k],s.range=u,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=jne(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelDatum(e,t,i){if(t==null)return;const{idKey:s,idName:n,latitudeKey:o,latitudeName:a,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f,label:y,shape:x}=this.properties;if(p==null||!y.enabled)return;const{datum:b,datumIndex:v,index:S,idValue:M,lonValue:D,latValue:I,point:k}=e,{placement:A}=y,w=this.getLabelText(t,b,p,"label",[],y,{value:t,datum:b,idKey:s,idName:n,latitudeKey:o,latitudeName:a,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:d,colorName:u,labelKey:p,labelName:f});if(w==null)return;const{width:C,height:T}=i.measureLines(String(w)),O=xL.anchor(x);return{point:{x:k.x,y:k.y,size:k.size},label:{width:C,height:T,text:w},anchor:O,placement:A,datumIndex:v,datumId:FS(S,M,D,I)}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveDataColumns(e){const{idKey:t,latitudeKey:i,longitudeKey:s,sizeKey:n,colorKey:o,labelKey:a}=this.properties,r=i!=null&&s!=null;return{idValues:this.resolveColumn(t,"idValue",e),featureValues:this.resolveColumn(t,"featureValue",e),latValues:r?this.resolveColumn(i,"latValue",e):void 0,lonValues:r?this.resolveColumn(s,"lonValue",e):void 0,labelValues:this.resolveColumn(a,"labelValue",e),sizeValues:this.resolveColumn(n,"sizeValue",e),colorValues:this.resolveColumn(o,"colorValue",e)}}prepareProjectedGeometries(e,t,i){if(e==null||t==null||this.scale==null)return;const s=new Map;for(const[n]of i.dataSources.get(this.id)?.data.entries()??[]){const o=e[n],a=t[n]?.geometry,r=a==null?void 0:yd(a,this.scale);o!=null&&r!=null&&s.set(o,r)}return s}calculateMarkerSize(e){return e==null?this.properties.size:this.sizeScale.convert(e,{clamp:!0})}buildNodeDatum(e,t,i,s,n){return{series:this,datum:e,datumIndex:t,index:i,...n,point:s,midPoint:{x:s.x,y:s.y},legendItemName:this.properties.legendItemName,style:this.getMarkerItemStyle({datumIndex:t,datum:e,colorValue:n.colorValue,sizeValue:n.sizeValue},!1)}}createNodeFromLatLon(e,t,i,s,n,o,a){if(this.scale==null)throw new Error("Scale is required for createNodeFromLatLon");const[r,l]=this.scale.convert([i,s]),c={x:r,y:l,size:o},h=this.buildNodeDatum(e,t,-1,c,n),d=this.getLabelDatum(h,n.labelValue,a)??void 0;return{node:h,label:d}}createNodesFromGeometry(e,t,i,s,n,o){const a=[],r=[];for(const[l,[c,h]]of k_(i,1).entries()){const d={x:c,y:h,size:n},u=this.buildNodeDatum(e,t,l,d,s);a.push(u);const p=this.getLabelDatum(u,s.labelValue,o);p&&r.push(p)}return{nodes:a,labels:r}}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}W.warnOnce("some data items do not have matches in the provided topology",e)}buildFeatureMap(e){const t=new Map;for(const i of this.topology?.features.values()??[]){const s=i.properties?.[e];s!=null&&t.set(s,i)}return t}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:n,scale:o}=this,{label:a}=n;if(t==null||i==null||o==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const r=this.resolveDataColumns(i),l=n.maxSize??n.size;s.range=[Math.min(n.size,l),l];const c=et(a),h=this.prepareProjectedGeometries(r.idValues,r.featureValues,i),d=[],u=[],p=[],f=i.dataSources.get(this.id)?.data??[];for(const[y,x]of f.entries()){const b={idValue:r.idValues?.[y],lonValue:r.lonValues?.[y],latValue:r.latValues?.[y],colorValue:r.colorValues?.[y],sizeValue:r.sizeValues?.[y],labelValue:r.labelValues?.[y]},v=this.calculateMarkerSize(b.sizeValue),S=b.idValue==null?void 0:h?.get(b.idValue);if(b.idValue!=null&&h!=null&&S==null&&p.push(b.idValue),b.lonValue!=null&&b.latValue!=null){const M=this.createNodeFromLatLon(x,y,b.lonValue,b.latValue,b,v,c);d.push(M.node),M.label&&u.push(M.label)}else if(S!=null){const M=this.createNodesFromGeometry(x,y,S,b,v,c);d.push(...M.nodes),u.push(...M.labels)}}return this.warnMissingGeometries(p),{itemId:e,nodeData:d,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:n}=this,o=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const a=this.getHighlightedDatum(),r=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:r,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:a,drawingMode:"overlay"}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:a==null?[]:[a],markerSelection:n}),this.updateMarkerNodes({markerSelection:n,isHighlight:!0,highlightedDatum:a,drawingMode:o}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(a),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=N.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.ctx.highlightManager?.getActiveHighlight();t.each((n,o)=>{const{x:a,y:r,width:l,height:c,text:h,datum:d}=o,u=Yne(this,void 0,i,i.label,e,s),{color:p,fontStyle:f,fontWeight:y,fontSize:x,fontFamily:b}=u;n.visible=!0,n.x=a+l/2,n.y=r+c/2,n.text=h,n.fill=p,n.fontStyle=f,n.fontWeight=y,n.fontSize=x,n.fontFamily=b,n.textAlign="center",n.textBaseline="middle";const v=d?.datumIndex;n.fillOpacity=this.getHighlightStyle(e,v).opacity??1,n.setBoxing(u)})}getHighlightedLabelId(e=this.getHighlightedDatum()){if(e!=null)return FS(e.index,e.idValue,e.lonValue,e.latValue)}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=this.getHighlightedLabelId(e),i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(s=>s.datum.datumId===t);if(this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0){this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1;return}this.highlightLabelGroup.visible=!0,this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,s=>FS(s.index,s.idValue,s.lonValue,s.latValue))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:s},n){const{properties:o,colorScale:a,sizeScale:r}=this,{colorRange:l,itemStyler:c}=o,h=this.getHighlightStyle(n,e),d=ce(h,o.getStyle());!n&&i!=null&&(d.fill=this.isColorScaleValid()?a.convert(i):l?.[0]??d.fill),s!=null&&(d.size=r.convert(s,{clamp:!0}));let u=d;if(c!=null&&e!=null){const p=this.cachedDatumCallback(FS(e,n?"highlight":"node"),()=>{const f=this.makeItemStylerParams(t,e,n,u);return this.callWithContext(c,f)});p&&(u=ce(p,d))}return u}makeItemStylerParams(e,t,i,s){const{id:n}=this,o=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(o,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,highlightState:a,...s,fill:r}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:s,drawingMode:n}=e,o=A_(this.scale);t.each((a,r)=>{const{datum:l,point:c}=r,h=this.getMarkerItemStyle(r,i);a.shape=h.shape,a.size=h.size,a.setStyleProperties(h,o),a.x=c.x,a.y=c.y,a.scalingCenterX=c.x,a.scalingCenterY=c.y,a.zIndex=!i&&s!=null&&l===s.datum?1:0,a.drawingMode=n})}isProcessedDataAnimatable(){return!0}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup(),this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1,this.placedLabelData=[]}animateMarkers(){const{animationManager:e}=this.ctx,t=Cne();Gne(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let s=1/0,n;for(const o of this.contextNodeData?.nodeData??[]){const{x:a,y:r,size:l}=o.point,c=Math.max(Math.abs(a-t)-l,0),h=Math.max(Math.abs(r-i)-l,0),d=c*c+h*h;d=0?"N":"S"}, ${Math.abs(O).toFixed(4)}\xB0 ${O>=0?"W":"E"}`}const C=this.getMarkerItemStyle({datumIndex:e,datum:D,colorValue:k,sizeValue:I},!1);return this.formatTooltipWithContext(M,{heading:w,title:v??S,symbol:this.legendItemSymbol(e),data:A},{seriesId:t,datum:D,title:v,idKey:a,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:u,colorName:p,sizeKey:f,sizeName:y,labelKey:x,labelName:b,...C})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return Wne(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};bL.className="MapMarkerSeries",bL.type="map-marker";var{mapMarkerSeriesThemeableOptionsDef:Zne}=N,Xne={...ee(qe,["highlightStyle","highlight"]),...Zne,type:j(Ce("map-marker")),idKey:L,latitudeKey:L,longitudeKey:L,sizeKey:L,colorKey:L,labelKey:L,idName:L,latitudeName:L,longitudeName:L,sizeName:L,colorName:L,labelName:L,topology:Fl,topologyIdKey:L,legendItemName:L,title:L},N_={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,version:de,dependencies:[Rm],options:Xne,themeTemplate:{...zm,series:{shape:"circle",maxSize:30,fill:hr({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",Yo],["image",it],["pattern",tt]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},hr(Nl)]},fillOpacity:.5,label:{...Ye,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:hr(Ys)},tooltip:{range:"exact"}},create:e=>new bL(e),validate(e,t,i){const s=ki(e,t,i),{cleared:n,invalid:o}=s;if(n?.idKey==null&&(n?.latitudeKey==null||n?.longitudeKey==null)){const a=l=>i?`${i}.${l}`:l,r=`Either \`${a("idKey")}\` or both \`${a("latitudeKey")}\` and \`${a("longitudeKey")}\` are required.`;o.push(new Da("required",r,null,i))}return s}},{SeriesProperties:qne,makeSeriesTooltip:Qne}=N,dr=class extends qne{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=Qne()}};g([m],dr.prototype,"topology",2),g([m],dr.prototype,"fill",2),g([m],dr.prototype,"fillOpacity",2),g([m],dr.prototype,"stroke",2),g([m],dr.prototype,"strokeOpacity",2),g([m],dr.prototype,"strokeWidth",2),g([m],dr.prototype,"lineDash",2),g([m],dr.prototype,"lineDashOffset",2),g([m],dr.prototype,"tooltip",2);var{createDatumId:Jne,Selection:eoe,Group:toe,PointerEvents:T_}=N,vL=class extends Bm{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new dr,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new toe({name:"itemGroup"})),this.datumSelection=eoe.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=T_.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new eg;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=T_.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:tg(s,t)},void 0),e==null&&W.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{fill:n,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=s,d=[],u=[];for(const[p,f]of t.features.entries()){const{geometry:y}=f,x=y!=null&&i!=null?yd(y,i):void 0;x!=null&&d.push({series:this,datum:f,datumIndex:0,index:p,projectedGeometry:x,style:{fill:n,fillOpacity:o,stroke:a,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}})}return{itemId:e,nodeData:d,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Jne(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:n}=s;if(n==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=n,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};vL.className="MapShapeBackgroundSeries",vL.type="map-shape-background";var{mapShapeBackgroundSeriesThemeableOptionsDef:ioe}=N,soe={...ioe,...qe,type:j(Ce("map-shape-background")),topology:Fl},O_={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,version:de,dependencies:[Rm],options:soe,themeTemplate:{...zm,series:{fill:hr({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",rM],["image",it],["pattern",hM]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1}},create:e=>new vL(e)};function noe(e,{aspectRatio:t,precision:i}){const s=D_(e,i,(l,c,h,d)=>{const u=aoe(l,c,h,t),p=u+2*d*t,f=u*Math.SQRT2,y=p*Math.SQRT2;return{distance:f,maxDistance:y}});if(s==null)return;const{x:n,y:o,distance:a}=s,r=a/Math.SQRT2;return{x:n,y:o,maxWidth:r}}function ooe(e,t,i,s,n){const[o,a]=e,[r,l]=t,c=1/n,h=r-o,d=l-a,[u,p]=a<=l?e:t,[f,y]=o<=r?e:t,[x,b]=a<=l?t:e,[v,S]=o<=r?t:e;let M=1/0;if(h===0)for(let C=0;C<=1;C+=1){const O=(C===0?c:-c)*(o-i)+s;if(O>=p&&O<=b){const z=Math.abs(s-O)*2*n;M=Math.min(M,z)}}else{const C=d/h;for(let T=0;T<=1;T+=1){const O=T===0?c:-c,V=(C*o-a-O*i+s)/(C-O);if(V>=f&&V<=v){const z=Math.abs(i-V)*2;M=Math.min(M,z)}}}const D=n,I=Math.abs((u-i)/(p-s)),k=Math.abs((x-i)/(b-s));if(bs&&Ii&&Ai!=c>i&&t<(l-d)*(i-u)/(c-u)+d&&(n=!n);const p=ooe(r,h,t,i,s);o=Math.min(o,p),r=h,l=d,c=u}}return(n?1:-1)*o}function HS(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function roe(e,t,i,s,n,o){const a=n-o/2,r=n+o/2,[l,c]=t,[h,d]=i,u=h-l,p=d-c,[f,y]=l<=h?t:i,[x,b]=l<=h?i:t;if(u!==0){const v=p/u;for(let S=0;S<=1;S+=1){const D=((S===0?a:r)-c)/v+l;D>=f&&D<=x&&HS(e,s,D)}}else Math.max(a,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&HS(e,s,l);return x=a&&b<=r?HS(e,s,x):f>s&&y>=a&&y<=r&&HS(e,s,f),e}function loe(e,t,i,s){const n={minX:-1/0,maxX:1/0};for(const r of e){let l=r.at(-1);for(const c of r)roe(n,l,c,t,i,s),l=c}const{minX:o,maxX:a}=n;return Number.isFinite(o)&&Number.isFinite(a)?{x:t+(o+a)/2,width:a-o}:{x:t,width:0}}var{SeriesProperties:coe,makeSeriesTooltip:hoe}=N,ai=class extends coe{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new xv,this.tooltip=hoe()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:o,lineDashOffset:a,opacity:1}}};g([m],ai.prototype,"topology",2),g([m],ai.prototype,"title",2),g([m],ai.prototype,"legendItemName",2),g([m],ai.prototype,"idKey",2),g([m],ai.prototype,"idName",2),g([m],ai.prototype,"topologyIdKey",2),g([m],ai.prototype,"labelKey",2),g([m],ai.prototype,"labelName",2),g([m],ai.prototype,"colorKey",2),g([m],ai.prototype,"colorName",2),g([m],ai.prototype,"colorRange",2),g([m],ai.prototype,"fill",2),g([m],ai.prototype,"fillOpacity",2),g([m],ai.prototype,"stroke",2),g([m],ai.prototype,"strokeOpacity",2),g([m],ai.prototype,"strokeWidth",2),g([m],ai.prototype,"lineDash",2),g([m],ai.prototype,"lineDashOffset",2),g([m],ai.prototype,"padding",2),g([m],ai.prototype,"itemStyler",2),g([m],ai.prototype,"label",2),g([m],ai.prototype,"tooltip",2);var{getMissCount:doe,createDatumId:GS,SeriesNodePickMode:P_,valueProperty:jS,ColorScale:uoe,Group:E_,Selection:WS,Text:R_,PointerEvents:poe,getLabelStyles:goe}=N,z_=N.MercatorScale.fixedScale(),SL=class extends Bm{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[P_.EXACT_SHAPE_MATCH,P_.NEAREST_NODE]}),this.properties=new ai,this._chartTopology=void 0,this.colorScale=new uoe,this.itemGroup=this.contentGroup.appendChild(new E_({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new E_({name:"itemLabelGroup"})),this.datumSelection=WS.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=WS.select(this.itemLabelGroup,R_),this.highlightDatumSelection=WS.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=WS.select(this.highlightLabelGroup,R_),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=poe.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new eg;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,colorScale:s}=this,{topologyIdKey:n,idKey:o,colorKey:a,labelKey:r,colorRange:l}=this.properties,c=new Map;for(const y of i?.features.values()??[]){const x=y.properties?.[n];x==null||!uL(y.geometry,1)||c.set(x,y)}const h=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:p}=await this.requestDataModel(e,t,{props:[jS(o,d,{id:"idValue",includeProperty:!1}),jS(o,d,{id:"featureValue",includeProperty:!1,processor:()=>y=>c.get(y)}),...r?[jS(r,"category",{id:"labelValue"})]:[],...a?[jS(a,h,{id:"colorValue"})]:[]]}),f=u.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=f.reduce((y,x)=>{const b=x?.geometry;return b==null?y:tg(b,y)},void 0),l!=null&&this.isColorScaleValid()){const y=u.resolveProcessedDataIndexById(this,"colorValue");s.domain=p.domain.values[y],s.range=l,s.update()}i==null&&W.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),n=i.input.count,o=doe(this,i.defs.values[s].missing);return!(n===0||n===o)}getLabelLayout(e,t,i,s,n){if(t==null||s==null)return;const{idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties;if(c==null||!u.enabled)return;const p=this.getLabelText(t,e,c,"label",[],u,{value:t,datum:e,idKey:o,idName:a,colorKey:r,colorName:l,labelKey:c,labelName:h});if(p==null)return;const f=Ae(p)?en(p,u):i.measureLines(String(p)),y=(f.width+2*d)/(f.height+2*d);if(n?.geometry===s&&n?.labelText===p&&n?.aspectRatio===y)return n;const x=yd(s,z_),b=zS(x);if(b==null)return;const v=noe(b,{aspectRatio:y,precision:.001});if(v==null)return;const{x:S,y:M,maxWidth:D}=v;return{geometry:s,labelText:p,aspectRatio:y,x:S,y:M,maxWidth:D,fixedPolygon:b}}getLabelDatum(e,t,i,s){const{scale:n}=this;if(n==null)return;const{padding:o,label:a}=this.properties,{labelText:r,aspectRatio:l,x:c,y:h,maxWidth:d,fixedPolygon:u}=e,p={width:Math.ceil(d*t),height:Math.ceil(d*t/l),meta:c},f=sm(Oe(r),a,{padding:o},(I,k)=>{if(!k)return p;const A=loe(u,c,h,I/t);return{width:A.width*t,height:I,meta:A.x}});if(f==null)return;const[{text:y,fontSize:x,lineHeight:b,width:v},S]=f,M=vt){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}W.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,scale:n,previousLabelLayouts:o}=this,{label:a,legendItemName:r,colorKey:l}=s;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const c=n==null?Number.NaN:(n.range[1][0]-n.range[0][0])/n.bounds.width,h=this.resolveShapeDataColumns(i),d=et(a),u=new Map;this.previousLabelLayouts=u;const p=[],f=[],y=[],x=i.dataSources.get(this.id)?.data??[];for(const[b,v]of x.entries()){const S={idValue:h.idValues[b],colorValue:h.colorValues?.[b],labelValue:h.labelValues?.[b]},M=h.featureValues[b]?.geometry??void 0;if(M==null&&y.push(S.idValue),l!=null&&S.colorValue==null)continue;const D=this.getLabelLayout(v,S.labelValue,d,M,o?.get(S.idValue));D!=null&&u.set(S.idValue,D);const I=D!=null&&n!=null?this.getLabelDatum(D,c,b,S.idValue):void 0;I!=null&&f.push(I);const k=M!=null&&n!=null?yd(M,n):void 0;p.push({series:this,datum:v,datumIndex:b,...S,projectedGeometry:k,legendItemName:r,style:this.getItemStyle({datum:v,datumIndex:b,colorValue:S.colorValue},!1)})}return this.warnMissingGeometries(y),{itemId:e,nodeData:p,labelData:f}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const s=this.ctx.chartService.highlight?.drawingMode??"overlay",n=this.getHighlightedDatum(),o=this.contextNodeData?.nodeData??[],a=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,drawingMode:"overlay"}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:t});const r=this.getHighlightLabelData(a,n);this.highlightLabelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.highlightLabelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:n==null?[]:[n],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i,drawingMode:s})}getHighlightLabelData(e,t){if(e.length===0)return[];const i=GS(t?.idValue);return e.filter(s=>s.datumId===i&&s.datumIndex===t?.datumIndex)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>GS(t.idValue))}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{properties:n,colorScale:o}=this,{colorRange:a,itemStyler:r}=n,l=n.getStyle();if(i!=null){const d=this.isColorScaleValid()?o.convert(i):a?.[0];d!=null&&(l.fill=d)}const c=this.getHighlightStyle(s,e);let h=ce(c,l);if(r!=null&&e!=null){const d=this.cachedDatumCallback(GS(e,s?"highlight":"node"),()=>{const u=this.makeItemStylerParams(t,e,s,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,u))});d&&(h=ce(d,h))}return h}makeItemStylerParams(e,t,i,s){const{id:n}=this,o=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(o,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:n,datum:e,highlightState:a,...s,fill:r}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){const i=A_(this.scale);e.each((s,n)=>{const{projectedGeometry:o}=n;if(o==null){s.visible=!1,s.projectedGeometry=void 0;return}s.visible=!0,s.projectedGeometry=o,s.setStyleProperties(n.style,i),s.drawingMode=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,s=this.ctx.highlightManager?.getActiveHighlight();t.each((n,o)=>{const{x:a,y:r,text:l,fontSize:c,lineHeight:h,datumIndex:d}=o,u=goe(this,void 0,i,i.label,e,s),{color:p,fontStyle:f,fontWeight:y,fontFamily:x}=u;n.visible=!0,n.x=a,n.y=r,n.text=l,n.fill=p,n.fontStyle=f,n.fontWeight=y,n.fontSize=c,n.lineHeight=h,n.fontFamily=x,n.textAlign="center",n.textBaseline="middle",n.fillOpacity=this.getHighlightStyle(e,d).opacity??1,n.setBoxing(u)})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((n,o)=>{const a=n.distanceSquared(e,t);anew SL(e)},B_=[M_,m_,N_,V_,O_],ML=[uA,jB,h_,B_,LF,XB,KE,eR,aR,pR,xR].flat(),ur=class extends q{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=ke("img"),this.imageElement.onload=this.onImageLoad,this.node=new N.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},s=yx(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...s}:{visible:!1}),s}};g([m],ur.prototype,"top",2),g([m],ur.prototype,"right",2),g([m],ur.prototype,"bottom",2),g([m],ur.prototype,"left",2),g([m],ur.prototype,"width",2),g([m],ur.prototype,"height",2),g([m],ur.prototype,"opacity",2),g([Gt("imageElement.src"),Rt(e=>e.loadedSynchronously=e.complete)],ur.prototype,"url",2);var DL=class extends N.Background{constructor(){super(...arguments),this.image=new ur}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:9})}};g([m,Ze({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],DL.prototype,"image",2);var _m=class extends N.Background{constructor(){super(...arguments),this.image=new ur,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new N.Group({name:"foreground",zIndex:18})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart,s=this.image.performLayout(t,i);this.text&&this.updateTextNode(s)}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:9})}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const{width:i}=t.getBBox(),s=10;t.x=e.x+e.width/2-i/2,t.y=e.y+e.height+s}};g([m,Ze({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],_m.prototype,"image",2),g([m,St("rectNode","fill")],_m.prototype,"fill",2),g([m,St("rectNode","fillOpacity")],_m.prototype,"fillOpacity",2);var yoe=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],s=e[1],n=e[2],o=e[3];i=this.ff(i,s,n,o,t[0],7,-680876936),o=this.ff(o,i,s,n,t[1],12,-389564586),n=this.ff(n,o,i,s,t[2],17,606105819),s=this.ff(s,n,o,i,t[3],22,-1044525330),i=this.ff(i,s,n,o,t[4],7,-176418897),o=this.ff(o,i,s,n,t[5],12,1200080426),n=this.ff(n,o,i,s,t[6],17,-1473231341),s=this.ff(s,n,o,i,t[7],22,-45705983),i=this.ff(i,s,n,o,t[8],7,1770035416),o=this.ff(o,i,s,n,t[9],12,-1958414417),n=this.ff(n,o,i,s,t[10],17,-42063),s=this.ff(s,n,o,i,t[11],22,-1990404162),i=this.ff(i,s,n,o,t[12],7,1804603682),o=this.ff(o,i,s,n,t[13],12,-40341101),n=this.ff(n,o,i,s,t[14],17,-1502002290),s=this.ff(s,n,o,i,t[15],22,1236535329),i=this.gg(i,s,n,o,t[1],5,-165796510),o=this.gg(o,i,s,n,t[6],9,-1069501632),n=this.gg(n,o,i,s,t[11],14,643717713),s=this.gg(s,n,o,i,t[0],20,-373897302),i=this.gg(i,s,n,o,t[5],5,-701558691),o=this.gg(o,i,s,n,t[10],9,38016083),n=this.gg(n,o,i,s,t[15],14,-660478335),s=this.gg(s,n,o,i,t[4],20,-405537848),i=this.gg(i,s,n,o,t[9],5,568446438),o=this.gg(o,i,s,n,t[14],9,-1019803690),n=this.gg(n,o,i,s,t[3],14,-187363961),s=this.gg(s,n,o,i,t[8],20,1163531501),i=this.gg(i,s,n,o,t[13],5,-1444681467),o=this.gg(o,i,s,n,t[2],9,-51403784),n=this.gg(n,o,i,s,t[7],14,1735328473),s=this.gg(s,n,o,i,t[12],20,-1926607734),i=this.hh(i,s,n,o,t[5],4,-378558),o=this.hh(o,i,s,n,t[8],11,-2022574463),n=this.hh(n,o,i,s,t[11],16,1839030562),s=this.hh(s,n,o,i,t[14],23,-35309556),i=this.hh(i,s,n,o,t[1],4,-1530992060),o=this.hh(o,i,s,n,t[4],11,1272893353),n=this.hh(n,o,i,s,t[7],16,-155497632),s=this.hh(s,n,o,i,t[10],23,-1094730640),i=this.hh(i,s,n,o,t[13],4,681279174),o=this.hh(o,i,s,n,t[0],11,-358537222),n=this.hh(n,o,i,s,t[3],16,-722521979),s=this.hh(s,n,o,i,t[6],23,76029189),i=this.hh(i,s,n,o,t[9],4,-640364487),o=this.hh(o,i,s,n,t[12],11,-421815835),n=this.hh(n,o,i,s,t[15],16,530742520),s=this.hh(s,n,o,i,t[2],23,-995338651),i=this.ii(i,s,n,o,t[0],6,-198630844),o=this.ii(o,i,s,n,t[7],10,1126891415),n=this.ii(n,o,i,s,t[14],15,-1416354905),s=this.ii(s,n,o,i,t[5],21,-57434055),i=this.ii(i,s,n,o,t[12],6,1700485571),o=this.ii(o,i,s,n,t[3],10,-1894986606),n=this.ii(n,o,i,s,t[10],15,-1051523),s=this.ii(s,n,o,i,t[1],21,-2054922799),i=this.ii(i,s,n,o,t[8],6,1873313359),o=this.ii(o,i,s,n,t[15],10,-30611744),n=this.ii(n,o,i,s,t[6],15,-1560198380),s=this.ii(s,n,o,i,t[13],21,1309151649),i=this.ii(i,s,n,o,t[4],6,-145523070),o=this.ii(o,i,s,n,t[11],10,-1120210379),n=this.ii(n,o,i,s,t[2],15,718787259),s=this.ii(s,n,o,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(s,e[1]),e[2]=this.add32(n,e[2]),e[3]=this.add32(o,e[3])}cmn(e,t,i,s,n,o){return t=this.add32(this.add32(t,e),this.add32(s,o)),this.add32(t<>>32-n,i)}ff(e,t,i,s,n,o,a){return this.cmn(t&i|~t&s,e,t,n,o,a)}gg(e,t,i,s,n,o,a){return this.cmn(t&s|i&~s,e,t,n,o,a)}hh(e,t,i,s,n,o,a){return this.cmn(t^i^s,e,t,n,o,a)}ii(e,t,i,s,n,o,a){return this.cmn(i^(t|~s),e,t,n,o,a)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let s;for(s=64;s<=e.length;s+=64)this.md5cycle(i,this.md5blk(e.substring(s-64,s)));e=e.substring(s-64);const n=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(s=0;s>2]|=e.charCodeAt(s)<<(s%4<<3);if(n[s>>2]|=128<<(s%4<<3),s>55)for(this.md5cycle(i,n),s=0;s<16;s++)n[s]=0;return n[14]=t*8,this.md5cycle(i,n),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",s=0;for(;s<4;s++)i+=t[e>>s*8+4&15]+t[e>>s*8&15];return i}hex(e){for(let t=0;t>16)+(t>>16)+(i>>16)<<16|i&65535}};function IL(e){return e==null||e.length===0}var xoe="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",$S={"01":"GRID","02":"CHARTS","0102":"BOTH"},F_="https://www.ag-grid.com/charts/licensing/",KS=class Zt{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new yoe,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(Zt.licenseKey,Zt.gridContext),i=`AG ${t.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let s="";if(t.suppliedLicenseType==="BOTH"?s="AG Grid and AG Charts Enterprise":t.suppliedLicenseType==="GRID"?s="AG Grid Enterprise":t.suppliedLicenseType!==void 0&&(s="AG Charts Enterprise"),t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const n=Zt.getChartsReleaseDate(),o=Zt.formatDate(n);this.outputExpiredKey(t.expiry,o,s)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,s):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,s);Zt.licenseOutputLogged=!0}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(Number.parseInt(Zt.decode(i),10))}static extractLicenseComponents(t){let i=t.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const s=i.length-32,n=i.substring(s),o=i.substring(0,s),[a,r,l]=Zt.extractBracketedInformation(i);return{md5:n,license:o,version:a,isTrial:r,type:l}}getLicenseDetails(t,i=!1){const s="CHARTS";if(IL(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:s};const n=Zt.getChartsReleaseDate(),{md5:o,license:a,version:r,isTrial:l,type:c}=Zt.extractLicenseComponents(t);let h=o===this.md5.md5(a)&&!t.includes("For_Trialing_ag-Grid_Only"),d,u,p=null,f=!1,y;function x(){d=pp,r){case"legacy":case"2":{h=!1;break}case"3":IL(c)?h=!1:(y=c,c!==$S["02"]&&c!==$S["0102"]?(h=!1,f=!0):l&&x())}return h?{licenseKey:t,valid:h,expiry:Zt.formatDate(p),expired:u,version:r,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?y!=="BOTH":void 0,incorrectLicenseType:f,currentLicenseType:s,suppliedLicenseType:y}:{licenseKey:t,valid:h,incorrectLicenseType:f,currentLicenseType:s,suppliedLicenseType:y}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!IL(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getWatermarkForegroundConfig(){const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}getWatermarkForegroundConfigForBrowser(){if(!this.isDisplayWatermark())return;const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}buildWatermarkConfig(t){return{text:t,image:{url:xoe,width:170,height:25,right:25,bottom:50,opacity:.7}}}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??globalThis;if(!t)return"localhost";try{return(t.location?.hostname??"")||"localhost"}catch{return"localhost"}}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!t)return!1;const i=t.location?.pathname;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null||/^((?:[\w-]+\.)?bryntum\.com)$/.exec(t)!==null}isLocalhost(){const t=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(t)!==null}isE2ETest(){const t=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(t)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],s=t.getDate(),n=t.getMonth(),o=t.getFullYear();return s+" "+i[n]+" "+o}static getChartsReleaseDate(){return new Date(Number.parseInt(Zt.decode(Zt.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let s="",n,o,a,r,l,c,h,d=0;const u=t.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;d>4,o=(l&15)<<4|c>>2,a=(c&3)<<6|h,s=s+String.fromCodePoint(n),c!=64&&(s=s+String.fromCodePoint(o)),h!=64&&(s=s+String.fromCodePoint(a));return s=Zt.utf8_decode(s),s}static utf8_decode(t){t=t.replaceAll("rn","n");let i="";for(let s=0;s127&&n<2048?(i+=String.fromCodePoint(n>>6|192),i+=String.fromCodePoint(n&63|128)):(i+=String.fromCodePoint(n>>12|224),i+=String.fromCodePoint(n>>6&63|128),i+=String.fromCodePoint(n&63|128))}return i}static setGridContext(t=!1){Zt.gridContext=t}static setLicenseKey(t){this.licenseKey&&this.licenseKey!==t&&console.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),this.licenseKey!==t&&(Zt.licenseOutputLogged=!1),Zt.licenseKey=t}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const s=i.filter(r=>r==="TRIAL").length===1,n=i.find(r=>r.startsWith("v")),o=n?n.replace("v",""):"legacy",a=$S[i.find(r=>$S[r])];return[o,s,a]}centerPadAndOutput(t){if(Zt.licenseOutputLogged)return;const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",s=""){Zt.licenseOutputLogged||console.error(t.padEnd(this.totalMessageLength-s.length,i)+s)}outputInvalidLicenseKey(t,i,s){Zt.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${s} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${F_}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${F_}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,s){Zt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${s} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){Zt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,s){Zt.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${s} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${s} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};KS.RELEASE_INFORMATION="MTc3NTU0ODM5NDIwNA==",KS.gridContext=!1,KS.licenseOutputLogged=!1;var bd=KS;function __(e,t){const i=e.addChild("canvas-overlay","watermark"),s=ke("span");s.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(s)}var H_=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-inline-start:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-inline-start:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-inline-end:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-inline-end:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-start-start-radius:var(--ag-charts-input-border-radius);border-end-start-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-start-end-radius:var(--ag-charts-input-border-radius);border-end-end-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;direction:ltr;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0;margin-inline-start:7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-inline-end:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-menu-border-width);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:start;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-inline-end:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-wrapper[dir=rtl] .ag-charts-context-menu__item .ag-charts-icon-chevron-right{transform:scaleX(-1)}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons{--toolbar-size: var(--ag-charts-ranges-min-size);--toolbar-border-radius: var(--ag-charts-ranges__button-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__button-fill);--toolbar-button-border-color: var(--ag-charts-ranges__button-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__button-stroke-width);--toolbar-button-gap: var(--ag-charts-ranges-gap);--toolbar-button-text-color: var(--ag-charts-ranges__button-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__button-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__button-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__button-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__button-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__button-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__button-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__button-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__button-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__button-text-color--hover)}.ag-charts-range-buttons--dropdown{--toolbar-border-radius: var(--ag-charts-ranges__dropdown-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__dropdown-fill);--toolbar-button-border-color: var(--ag-charts-ranges__dropdown-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__dropdown-stroke-width);--toolbar-button-text-color: var(--ag-charts-ranges__dropdown-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__dropdown-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__dropdown-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__dropdown-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__dropdown-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__dropdown-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__dropdown-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__dropdown-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__dropdown-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__dropdown-text-color--hover)}.ag-charts-range-buttons .ag-charts-toolbar__button{font-size:var(--ag-charts-ranges__button-font-size);font-family:var(--ag-charts-ranges__button-font-family);font-weight:var(--ag-charts-ranges__button-font-weight);padding-top:var(--ag-charts-ranges__button-padding-top);padding-right:var(--ag-charts-ranges__button-padding-right);padding-bottom:var(--ag-charts-ranges__button-padding-bottom);padding-left:var(--ag-charts-ranges__button-padding-left)}.ag-charts-range-buttons--dropdown .ag-charts-toolbar__button{flex:1;justify-content:space-between;font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left);.ag-charts-toolbar__icon{margin-top:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);margin-bottom:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);height:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px);width:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px)}}.ag-charts-range-buttons--gapped{.ag-charts-toolbar__button{border-radius:var(--toolbar-border-radius);border-width:var(--toolbar-button-border-width)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color)}}}.ag-charts-range-buttons-menu{background:var(--ag-charts-ranges__dropdown-fill);border-color:var(--ag-charts-ranges__dropdown-stroke);border-radius:var(--ag-charts-ranges__dropdown-corner-radius);border-width:var(--ag-charts-ranges__dropdown-stroke-width);color:var(--ag-charts-ranges__dropdown-text-color);.ag-charts-menu__row{font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left)}.ag-charts-menu__row:focus{background:var(--ag-charts-ranges__dropdown-fill--hover)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-ranges__dropdown-fill--disabled);color:var(--ag-charts-ranges__dropdown-text-color--disabled)}}.ag-charts-zoom-buttons{direction:ltr;align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-end-end-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-inline-start:var(--ag-charts-spacing);padding-inline-end:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-inline-start:0}.ag-charts-toolbar__button--group-first{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{--toolbar-button-gap: calc(var(--ag-charts-spacing) * 2);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--ag-charts-border-color)}} `;function boe(){ye.registerModules(ML),zi.styles=H_,zi.licenseManager=e=>new bd(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),zi.injectWatermark=__,zi.createBackground=e=>new DL(e),zi.createForeground=e=>new _m(e)}var voe={setLicenseKey(e){bd.setLicenseKey(e)}},Soe={VERSION:de,_Scene:lv,_Theme:cv,_Util:hv,create:To.create.bind(To),createSparkline:To.__createSparkline.bind(To),setup:()=>{ye.setRegistryMode(ye.RegistryMode.Integrated),boe()},setGridContext:bd.setGridContext.bind(bd),setLicenseKey:bd.setLicenseKey.bind(bd),isEnterprise:!0};if(ye.setRegistryMode(ye.RegistryMode.Enterprise),zi.styles=H_,zi.licenseManager=e=>new bd(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),zi.injectWatermark=__,zi.createBackground=e=>new DL(e),zi.createForeground=e=>new _m(e),ye.setRegistryMode(ye.RegistryMode.UMD),ye.registerModules(ML),typeof xa.exports=="object"&&typeof ng=="object"){var Moe=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,n)&&n!==i&&Object.defineProperty(e,n,{get:()=>t[n],enumerable:!(s=Object.getOwnPropertyDescriptor(t,n))||s.enumerable});return e};xa.exports=Moe(xa.exports,ng)}return xa.exports});