13 lines
170 KiB
JavaScript
Executable File
13 lines
170 KiB
JavaScript
Executable File
"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(e,t)=>{for(var n in t)__defProp(e,n,{get:t[n],enumerable:!0})},__copyProps=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of __getOwnPropNames(t))!__hasOwnProp.call(e,i)&&i!==n&&__defProp(e,i,{get:()=>t[i],enumerable:!(r=__getOwnPropDesc(t,i))||r.enumerable});return e},__toCommonJS=e=>__copyProps(__defProp({},"__esModule",{value:!0}),e),__decorateClass=(e,t,n,r)=>{for(var i=r>1?void 0:r?__getOwnPropDesc(t,n):t,o=e.length-1,s;o>=0;o--)(s=e[o])&&(i=(r?s(t,n,i):s(i))||i);return r&&i&&__defProp(t,n,i),i},main_exports={};__export(main_exports,{AGGREGATION_INDEX_UNSET:()=>AGGREGATION_INDEX_UNSET,AGGREGATION_INDEX_X_MAX:()=>AGGREGATION_INDEX_X_MAX,AGGREGATION_INDEX_X_MIN:()=>AGGREGATION_INDEX_X_MIN,AGGREGATION_INDEX_Y_MAX:()=>AGGREGATION_INDEX_Y_MAX,AGGREGATION_INDEX_Y_MIN:()=>AGGREGATION_INDEX_Y_MIN,AGGREGATION_MAX_POINTS:()=>AGGREGATION_MAX_POINTS,AGGREGATION_MIN_RANGE:()=>AGGREGATION_MIN_RANGE,AGGREGATION_SPAN:()=>AGGREGATION_SPAN,AGGREGATION_THRESHOLD:()=>AGGREGATION_THRESHOLD,AbstractModuleInstance:()=>AbstractModuleInstance,ActionOnSet:()=>ActionOnSet,AdjacencyListGraph:()=>AdjacencyListGraph,AsyncAwaitQueue:()=>AsyncAwaitQueue,BASE_FONT_SIZE:()=>BASE_FONT_SIZE,BREAK_TRANSFORM_CHAIN:()=>BREAK_TRANSFORM_CHAIN,BaseProperties:()=>BaseProperties,Border:()=>Border,CANVAS_HEIGHT:()=>CANVAS_HEIGHT,CANVAS_TO_BUFFER_DEFAULTS:()=>CANVAS_TO_BUFFER_DEFAULTS,CANVAS_WIDTH:()=>CANVAS_WIDTH,CARTESIAN_AXIS_TYPE:()=>CARTESIAN_AXIS_TYPE,CARTESIAN_POSITION:()=>CARTESIAN_POSITION,CallbackCache:()=>CallbackCache,ChangeDetectableProperties:()=>ChangeDetectableProperties,ChartAxisDirection:()=>ChartAxisDirection,ChartUpdateType:()=>ChartUpdateType,CleanupRegistry:()=>CleanupRegistry,Color:()=>Color,ConfiguredCanvasMixin:()=>ConfiguredCanvasMixin,DEFAULT_ANNOTATION_HANDLE_FILL:()=>DEFAULT_ANNOTATION_HANDLE_FILL,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>DEFAULT_ANNOTATION_STATISTICS_COLOR,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>DEFAULT_ANNOTATION_STATISTICS_FILL,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>DEFAULT_ANNOTATION_STATISTICS_STROKE,DEFAULT_CAPTION_ALIGNMENT:()=>DEFAULT_CAPTION_ALIGNMENT,DEFAULT_CAPTION_LAYOUT_STYLE:()=>DEFAULT_CAPTION_LAYOUT_STYLE,DEFAULT_FIBONACCI_STROKES:()=>DEFAULT_FIBONACCI_STROKES,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,DEFAULT_POLAR_SERIES_STROKE:()=>DEFAULT_POLAR_SERIES_STROKE,DEFAULT_SHADOW_COLOUR:()=>DEFAULT_SHADOW_COLOUR,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>DEFAULT_SPARKLINE_CROSSHAIR_STROKE,DEFAULT_TEXTBOX_COLOR:()=>DEFAULT_TEXTBOX_COLOR,DEFAULT_TEXTBOX_FILL:()=>DEFAULT_TEXTBOX_FILL,DEFAULT_TEXTBOX_STROKE:()=>DEFAULT_TEXTBOX_STROKE,DEFAULT_TEXT_ANNOTATION_COLOR:()=>DEFAULT_TEXT_ANNOTATION_COLOR,DEFAULT_TOOLBAR_POSITION:()=>DEFAULT_TOOLBAR_POSITION,DIRECTION_SWAP_AXES:()=>DIRECTION_SWAP_AXES,Debug:()=>debugLogger_exports,DebugMetrics:()=>debugMetrics_exports,DeclaredSceneChangeDetection:()=>DeclaredSceneChangeDetection,DeclaredSceneObjectChangeDetection:()=>DeclaredSceneObjectChangeDetection,Deprecated:()=>Deprecated,DeprecatedAndRenamedTo:()=>DeprecatedAndRenamedTo,EllipsisChar:()=>EllipsisChar,ErrorType:()=>ErrorType,EventEmitter:()=>EventEmitter,FILL_GRADIENT_BLANK_DEFAULTS:()=>FILL_GRADIENT_BLANK_DEFAULTS,FILL_GRADIENT_CONIC_SERIES_DEFAULTS:()=>FILL_GRADIENT_CONIC_SERIES_DEFAULTS,FILL_GRADIENT_LINEAR_DEFAULTS:()=>FILL_GRADIENT_LINEAR_DEFAULTS,FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS:()=>FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:()=>FILL_GRADIENT_LINEAR_KEYED_DEFAULTS,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS:()=>FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS,FILL_GRADIENT_RADIAL_DEFAULTS:()=>FILL_GRADIENT_RADIAL_DEFAULTS,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS:()=>FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS:()=>FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS,FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:()=>FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,FILL_IMAGE_BLANK_DEFAULTS:()=>FILL_IMAGE_BLANK_DEFAULTS,FILL_IMAGE_DEFAULTS:()=>FILL_IMAGE_DEFAULTS,FILL_PATTERN_BLANK_DEFAULTS:()=>FILL_PATTERN_BLANK_DEFAULTS,FILL_PATTERN_DEFAULTS:()=>FILL_PATTERN_DEFAULTS,FILL_PATTERN_HIERARCHY_DEFAULTS:()=>FILL_PATTERN_HIERARCHY_DEFAULTS,FILL_PATTERN_KEYED_DEFAULTS:()=>FILL_PATTERN_KEYED_DEFAULTS,FILL_PATTERN_SINGLE_DEFAULTS:()=>FILL_PATTERN_SINGLE_DEFAULTS,FONT_SIZE:()=>FONT_SIZE,FONT_SIZE_RATIO:()=>FONT_SIZE_RATIO,IS_DARK_THEME:()=>IS_DARK_THEME,InterpolationProperties:()=>InterpolationProperties,LABEL_BOXING_DEFAULTS:()=>LABEL_BOXING_DEFAULTS,LEGEND_CONTAINER_THEME:()=>LEGEND_CONTAINER_THEME,LRUCache:()=>LRUCache,LineSplitter:()=>LineSplitter,Logger:()=>logger_exports,MARKER_SERIES_HIGHLIGHT_STYLE:()=>MARKER_SERIES_HIGHLIGHT_STYLE,MULTI_SERIES_HIGHLIGHT_STYLE:()=>MULTI_SERIES_HIGHLIGHT_STYLE,MementoCaretaker:()=>MementoCaretaker,ModuleRegistry:()=>moduleRegistry_exports,ModuleType:()=>ModuleType,ObserveChanges:()=>ObserveChanges,PALETTE_ALT_DOWN_FILL:()=>PALETTE_ALT_DOWN_FILL,PALETTE_ALT_DOWN_STROKE:()=>PALETTE_ALT_DOWN_STROKE,PALETTE_ALT_NEUTRAL_FILL:()=>PALETTE_ALT_NEUTRAL_FILL,PALETTE_ALT_NEUTRAL_STROKE:()=>PALETTE_ALT_NEUTRAL_STROKE,PALETTE_ALT_UP_FILL:()=>PALETTE_ALT_UP_FILL,PALETTE_ALT_UP_STROKE:()=>PALETTE_ALT_UP_STROKE,PALETTE_DOWN_FILL:()=>PALETTE_DOWN_FILL,PALETTE_DOWN_STROKE:()=>PALETTE_DOWN_STROKE,PALETTE_NEUTRAL_FILL:()=>PALETTE_NEUTRAL_FILL,PALETTE_NEUTRAL_STROKE:()=>PALETTE_NEUTRAL_STROKE,PALETTE_UP_FILL:()=>PALETTE_UP_FILL,PALETTE_UP_STROKE:()=>PALETTE_UP_STROKE,PART_WHOLE_HIGHLIGHT_STYLE:()=>PART_WHOLE_HIGHLIGHT_STYLE,POLAR_AXIS_SHAPE:()=>POLAR_AXIS_SHAPE,POLAR_AXIS_TYPE:()=>POLAR_AXIS_TYPE,PREV_NEXT_KEYS:()=>PREV_NEXT_KEYS,Padding:()=>Padding,ParallelStateMachine:()=>ParallelStateMachine,PolarZIndexMap:()=>PolarZIndexMap,PropertiesArray:()=>PropertiesArray,Property:()=>addFakeTransformToInstanceProperty,ProxyOnWrite:()=>ProxyOnWrite,ProxyProperty:()=>ProxyProperty,ProxyPropertyOnWrite:()=>ProxyPropertyOnWrite,SAFE_FILLS_OPERATION:()=>SAFE_FILLS_OPERATION,SAFE_FILL_OPERATION:()=>SAFE_FILL_OPERATION,SAFE_RANGE2_OPERATION:()=>SAFE_RANGE2_OPERATION,SAFE_STROKE_FILL_OPERATION:()=>SAFE_STROKE_FILL_OPERATION,SEGMENTATION_DEFAULTS:()=>SEGMENTATION_DEFAULTS,SINGLE_SERIES_HIGHLIGHT_STYLE:()=>SINGLE_SERIES_HIGHLIGHT_STYLE,SKIP_JS_BUILTINS:()=>SKIP_JS_BUILTINS,ScaleAlignment:()=>ScaleAlignment,SceneArrayChangeDetection:()=>SceneArrayChangeDetection,SceneChangeDetection:()=>SceneChangeDetection,SceneObjectChangeDetection:()=>SceneObjectChangeDetection,SceneRefChangeDetection:()=>SceneRefChangeDetection,SeriesContentZIndexMap:()=>SeriesContentZIndexMap,SeriesZIndexMap:()=>SeriesZIndexMap,SimpleCache:()=>SimpleCache,SpanJoin:()=>SpanJoin,StateMachine:()=>StateMachine,StateMachineProperty:()=>StateMachineProperty,TRIPLE_EQ:()=>TRIPLE_EQ,TextMeasurer:()=>TextMeasurer,TickIntervals:()=>TickIntervals,TrimCharsRegex:()=>TrimCharsRegex,TrimEdgeGuard:()=>TrimEdgeGuard,UNIT_MAX:()=>UNIT_MAX,UNIT_MIN:()=>UNIT_MIN,UnknownError:()=>UnknownError,ValidationError:()=>ValidationError,Vec2:()=>vector_exports,Vec4:()=>vector4_exports,Vertex:()=>Vertex,WeakCache:()=>WeakCache,ZIndexMap:()=>ZIndexMap,addEscapeEventListener:()=>addEscapeEventListener,addFakeTransformToInstanceProperty:()=>addFakeTransformToInstanceProperty,addMouseCloseListener:()=>addMouseCloseListener,addObserverToInstanceProperty:()=>addObserverToInstanceProperty,addOverrideFocusVisibleEventListener:()=>addOverrideFocusVisibleEventListener,addTouchCloseListener:()=>addTouchCloseListener,addTransformToInstanceProperty:()=>addTransformToInstanceProperty,aggregationBucketForDatum:()=>aggregationBucketForDatum,aggregationDatumMatchesIndex:()=>aggregationDatumMatchesIndex,aggregationDomain:()=>aggregationDomain,aggregationIndexForXRatio:()=>aggregationIndexForXRatio,aggregationRangeFittingPoints:()=>aggregationRangeFittingPoints,aggregationXRatioForDatumIndex:()=>aggregationXRatioForDatumIndex,aggregationXRatioForXValue:()=>aggregationXRatioForXValue,and:()=>and,angleBetween:()=>angleBetween,angularPadding:()=>angularPadding,appendEllipsis:()=>appendEllipsis,applySkiaPatches:()=>applySkiaPatches,arcDistanceSquared:()=>arcDistanceSquared,areScalingEqual:()=>areScalingEqual,array:()=>array,arrayLength:()=>arrayLength,arrayOf:()=>arrayOf,arrayOfDefs:()=>arrayOfDefs,arraysEqual:()=>arraysEqual,assignIfNotStrictlyEqual:()=>assignIfNotStrictlyEqual,attachDescription:()=>attachDescription,attachListener:()=>attachListener,autoSizedLabelOptionsDefs:()=>autoSizedLabelOptionsDefs,barHighlightOptionsDef:()=>barHighlightOptionsDef,bezier2DDistance:()=>bezier2DDistance,bezier2DExtrema:()=>bezier2DExtrema,boolean:()=>boolean,borderOptionsDef:()=>borderOptionsDef,boxCollides:()=>boxCollides,boxContains:()=>boxContains,boxEmpty:()=>boxEmpty,boxesEqual:()=>boxesEqual,buildDateFormatter:()=>buildDateFormatter,cachedTextMeasurer:()=>cachedTextMeasurer,calcLineHeight:()=>calcLineHeight,calculatePlacement:()=>calculatePlacement,callWithContext:()=>callWithContext,callback:()=>callback,callbackDefs:()=>callbackDefs,callbackOf:()=>callbackOf,ceilTo:()=>ceilTo,checkDatum:()=>checkDatum,circularSliceArray:()=>circularSliceArray,clamp:()=>clamp,clampArray:()=>clampArray,clipLines:()=>clipLines,clipSpanX:()=>clipSpanX,collapseSpanToPoint:()=>collapseSpanToPoint,collectAggregationLevels:()=>collectAggregationLevels,color:()=>color,colorStopsOrderValidator:()=>colorStopsOrderValidator,colorUnion:()=>colorUnion,commonChartOptionsDefs:()=>commonChartOptionsDefs,commonSeriesOptionsDefs:()=>commonSeriesOptionsDefs,commonSeriesThemeableOptionsDefs:()=>commonSeriesThemeableOptionsDefs,compactAggregationIndices:()=>compactAggregationIndices,compareDates:()=>compareDates,computeExtremesAggregation:()=>computeExtremesAggregation,computeExtremesAggregationPartial:()=>computeExtremesAggregationPartial,constant:()=>constant,contextMenuItemsArray:()=>contextMenuItemsArray,countFractionDigits:()=>countFractionDigits,countLines:()=>countLines,createAggregationIndices:()=>createAggregationIndices,createButton:()=>createButton,createCanvasContext:()=>createCanvasContext,createCheckbox:()=>createCheckbox,createDeprecationWarning:()=>createDeprecationWarning,createElement:()=>createElement,createElementId:()=>createElementId,createIcon:()=>createIcon,createId:()=>createId,createIdsGenerator:()=>createIdsGenerator,createNumberFormatter:()=>createNumberFormatter,createSelect:()=>createSelect,createSvgElement:()=>createSvgElement,createTextArea:()=>createTextArea,createTicks:()=>createTicks,date:()=>date,dateToNumber:()=>dateToNumber,dateTruncationForDomain:()=>dateTruncationForDomain,datesSortOrder:()=>datesSortOrder,debounce:()=>debounce,decodeIntervalValue:()=>decodeIntervalValue,deepClone:()=>deepClone,deepFreeze:()=>deepFreeze,defaultEpoch:()=>defaultEpoch,defined:()=>defined,definedZoomState:()=>definedZoomState,diffArrays:()=>diffArrays,distribute:()=>distribute,downloadUrl:()=>downloadUrl,dropFirstWhile:()=>dropFirstWhile,dropLastWhile:()=>dropLastWhile,durationDay:()=>durationDay,durationHour:()=>durationHour,durationMinute:()=>durationMinute,durationMonth:()=>durationMonth,durationSecond:()=>durationSecond,durationWeek:()=>durationWeek,durationYear:()=>durationYear,easeIn:()=>easeIn,easeInOut:()=>easeInOut,easeInOutQuad:()=>easeInOutQuad,easeInQuad:()=>easeInQuad,easeOut:()=>easeOut,easeOutQuad:()=>easeOutQuad,encodedToTimestamp:()=>encodedToTimestamp,enterpriseRegistry:()=>enterpriseRegistry,entries:()=>entries,errorBarOptionsDefs:()=>errorBarOptionsDefs,errorBarThemeableOptionsDefs:()=>errorBarThemeableOptionsDefs,estimateTickCount:()=>estimateTickCount,evaluateBezier:()=>evaluateBezier,every:()=>every,expandLegendPosition:()=>expandLegendPosition,extent:()=>extent,extractDecoratedProperties:()=>extractDecoratedProperties,extractDomain:()=>extractDomain,fillGradientDefaults:()=>fillGradientDefaults,fillImageDefaults:()=>fillImageDefaults,fillOptionsDef:()=>fillOptionsDef,fillPatternDefaults:()=>fillPatternDefaults,findMaxIndex:()=>findMaxIndex,findMaxValue:()=>findMaxValue,findMinIndex:()=>findMinIndex,findMinMax:()=>findMinMax,findMinValue:()=>findMinValue,findRangeExtent:()=>findRangeExtent,first:()=>first,flush:()=>flush,focusCursorAtEnd:()=>focusCursorAtEnd,fontFamilyFull:()=>fontFamilyFull,fontOptionsDef:()=>fontOptionsDef,fontWeight:()=>fontWeight,formatNumber:()=>formatNumber,formatObjectValidator:()=>formatObjectValidator,formatPercent:()=>formatPercent,formatValue:()=>formatValue,fromPairs:()=>fromPairs,generateUUID:()=>generateUUID,geoJson:()=>geoJson,getAngleRatioRadians:()=>getAngleRatioRadians,getAttribute:()=>getAttribute,getDOMMatrix:()=>getDOMMatrix,getDocument:()=>getDocument,getElementBBox:()=>getElementBBox,getIconClassNames:()=>getIconClassNames,getImage:()=>getImage,getLastFocus:()=>getLastFocus,getMaxInnerRectSize:()=>getMaxInnerRectSize,getMidpointsForIndices:()=>getMidpointsForIndices,getMinOuterRectSize:()=>getMinOuterRectSize,getOffscreenCanvas:()=>getOffscreenCanvas,getPath:()=>getPath,getPath2D:()=>getPath2D,getResizeObserver:()=>getResizeObserver,getSequentialColors:()=>getSequentialColors,getTickTimeInterval:()=>getTickTimeInterval,getWindow:()=>getWindow,googleFont:()=>googleFont,gradientColorStops:()=>gradientColorStops,gradientStrict:()=>gradientStrict,greaterThan:()=>greaterThan,groupBy:()=>groupBy,guardTextEdges:()=>guardTextEdges,hasNoModifiers:()=>hasNoModifiers,hasRequiredInPath:()=>hasRequiredInPath,highlightOptionsDef:()=>highlightOptionsDef,htmlElement:()=>htmlElement,inRange:()=>inRange,initRovingTabIndex:()=>initRovingTabIndex,insertListItemsSorted:()=>insertListItemsSorted,instanceOf:()=>instanceOf,interpolationOptionsDefs:()=>interpolationOptionsDefs,intervalCeil:()=>intervalCeil,intervalEpoch:()=>intervalEpoch,intervalExtent:()=>intervalExtent,intervalFloor:()=>intervalFloor,intervalHierarchy:()=>intervalHierarchy,intervalMilliseconds:()=>intervalMilliseconds,intervalNext:()=>intervalNext,intervalPrevious:()=>intervalPrevious,intervalRange:()=>intervalRange,intervalRangeCount:()=>intervalRangeCount,intervalRangeNumeric:()=>intervalRangeNumeric,intervalRangeStartIndex:()=>intervalRangeStartIndex,intervalStep:()=>intervalStep,intervalUnit:()=>intervalUnit,inverseEaseOut:()=>inverseEaseOut,isArray:()=>isArray,isBetweenAngles:()=>isBetweenAngles,isBoolean:()=>isBoolean,isButtonClickEvent:()=>isButtonClickEvent,isColor:()=>isColor,isContinuous:()=>isContinuous,isDate:()=>isDate,isDecoratedObject:()=>isDecoratedObject,isDefined:()=>isDefined,isDenseInterval:()=>isDenseInterval,isDocumentFragment:()=>isDocumentFragment,isElement:()=>isElement,isEmptyObject:()=>isEmptyObject,isEnumKey:()=>isEnumKey,isEnumValue:()=>isEnumValue,isFiniteNumber:()=>isFiniteNumber,isFunction:()=>isFunction,isGradientFill:()=>isGradientFill,isGradientFillArray:()=>isGradientFillArray,isGradientOrPatternFill:()=>isGradientOrPatternFill,isHTMLElement:()=>isHTMLElement,isHtmlElement:()=>isHtmlElement,isImageFill:()=>isImageFill,isInputPending:()=>isInputPending,isInteger:()=>isInteger,isKeyOf:()=>isKeyOf,isNegative:()=>isNegative,isNode:()=>isNode,isNumber:()=>isNumber,isNumberEqual:()=>isNumberEqual,isNumberObject:()=>isNumberObject,isObject:()=>isObject,isObjectLike:()=>isObjectLike,isObjectWithProperty:()=>isObjectWithProperty,isObjectWithStringProperty:()=>isObjectWithStringProperty,isPatternFill:()=>isPatternFill,isPlainObject:()=>isPlainObject,isPointLabelDatum:()=>isPointLabelDatum,isProperties:()=>isProperties,isRegExp:()=>isRegExp,isScaleValid:()=>isScaleValid,isSegmentTruncated:()=>isSegmentTruncated,isString:()=>isString,isStringFillArray:()=>isStringFillArray,isStringObject:()=>isStringObject,isSymbol:()=>isSymbol,isTextTruncated:()=>isTextTruncated,isTruncated:()=>isTruncated,isUnitTimeCategoryScaling:()=>isUnitTimeCategoryScaling,isValidDate:()=>isValidDate,isValidNumberFormat:()=>isValidNumberFormat,iterate:()=>iterate,joinFormatted:()=>joinFormatted,jsonApply:()=>jsonApply,jsonDiff:()=>jsonDiff,jsonPropertyCompare:()=>jsonPropertyCompare,jsonWalk:()=>jsonWalk,kebabCase:()=>kebabCase,labelBoxOptionsDef:()=>labelBoxOptionsDef,legendPositionValidator:()=>legendPositionValidator,lessThan:()=>lessThan,lessThanOrEqual:()=>lessThanOrEqual,levenshteinDistance:()=>levenshteinDistance,lineDashOptionsDef:()=>lineDashOptionsDef,lineDistanceSquared:()=>lineDistanceSquared,lineHighlightOptionsDef:()=>lineHighlightOptionsDef,lineSegmentOptions:()=>lineSegmentOptions,lineSegmentation:()=>lineSegmentation,linear:()=>linear,linearGaugeSeriesOptionsDef:()=>linearGaugeSeriesOptionsDef,linearGaugeSeriesThemeableOptionsDef:()=>linearGaugeSeriesThemeableOptionsDef,linearGaugeTargetOptionsDef:()=>linearGaugeTargetOptionsDef,linearPoints:()=>linearPoints,listDecoratedProperties:()=>listDecoratedProperties,lowestGranularityForInterval:()=>lowestGranularityForInterval,lowestGranularityUnitForTicks:()=>lowestGranularityUnitForTicks,lowestGranularityUnitForValue:()=>lowestGranularityUnitForValue,makeAccessibleClickListener:()=>makeAccessibleClickListener,mapValues:()=>mapValues,markerOptionsDefs:()=>markerOptionsDefs,markerStyleOptionsDefs:()=>markerStyleOptionsDefs,measureTextSegments:()=>measureTextSegments,memo:()=>memo,merge:()=>merge,mergeArrayDefaults:()=>mergeArrayDefaults,mergeDefaults:()=>mergeDefaults,modulus:()=>modulus,multiSeriesHighlightOptionsDef:()=>multiSeriesHighlightOptionsDef,nearestSquared:()=>nearestSquared,nearestSquaredInContainer:()=>nearestSquaredInContainer,nextPowerOf2:()=>nextPowerOf2,niceTicksDomain:()=>niceTicksDomain,normalisedExtentWithMetadata:()=>normalisedExtentWithMetadata,normalisedTimeExtentWithMetadata:()=>normalisedTimeExtentWithMetadata,normalizeAngle180:()=>normalizeAngle180,normalizeAngle360:()=>normalizeAngle360,normalizeAngle360FromDegrees:()=>normalizeAngle360FromDegrees,normalizeAngle360Inclusive:()=>normalizeAngle360Inclusive,number:()=>number,numberFormatValidator:()=>numberFormatValidator,numberMin:()=>numberMin,numberRange:()=>numberRange,object:()=>object,objectsEqual:()=>objectsEqual,objectsEqualWith:()=>objectsEqualWith,optionsDefs:()=>optionsDefs,or:()=>or,padding:()=>padding,paddingOptions:()=>paddingOptions,parseNumberFormat:()=>parseNumberFormat,partialAssign:()=>partialAssign,pause:()=>pause,pick:()=>pick,placeLabels:()=>placeLabels,positiveNumber:()=>positiveNumber,positiveNumberNonZero:()=>positiveNumberNonZero,previousPowerOf2:()=>previousPowerOf2,radialGaugeSeriesOptionsDef:()=>radialGaugeSeriesOptionsDef,radialGaugeSeriesThemeableOptionsDef:()=>radialGaugeSeriesThemeableOptionsDef,radialGaugeTargetOptionsDef:()=>radialGaugeTargetOptionsDef,range:()=>range,rangeValidator:()=>rangeValidator,ratio:()=>ratio,readIntegratedWrappedValue:()=>readIntegratedWrappedValue,record:()=>record,required:()=>required,rescaleSpan:()=>rescaleSpan,rescaleVisibleRange:()=>rescaleVisibleRange,resetIds:()=>resetIds,rotatePoint:()=>rotatePoint,roundTo:()=>roundTo,safeCall:()=>safeCall,seriesLabelOptionsDefs:()=>seriesLabelOptionsDefs,seriesTooltipRangeValidator:()=>seriesTooltipRangeValidator,setAttribute:()=>setAttribute,setAttributes:()=>setAttributes,setDocument:()=>setDocument,setElementBBox:()=>setElementBBox,setElementStyle:()=>setElementStyle,setElementStyles:()=>setElementStyles,setPath:()=>setPath,setWindow:()=>setWindow,shadowOptionsDefs:()=>shadowOptionsDefs,shallowClone:()=>shallowClone,shapeHighlightOptionsDef:()=>shapeHighlightOptionsDef,shapeSegmentOptions:()=>shapeSegmentOptions,shapeSegmentation:()=>shapeSegmentation,shapeValidator:()=>shapeValidator,simpleMemorize:()=>simpleMemorize,simpleMemorize2:()=>simpleMemorize2,smoothPoints:()=>smoothPoints,solveBezier:()=>solveBezier,sortAndUniqueDates:()=>sortAndUniqueDates,sortBasedOnArray:()=>sortBasedOnArray,spanRange:()=>spanRange,splitBezier2D:()=>splitBezier2D,stepPoints:()=>stepPoints,stopPageScrolling:()=>stopPageScrolling,strictObjectKeys:()=>strictObjectKeys,strictUnion:()=>strictUnion,string:()=>string,stringLength:()=>stringLength,stringifyValue:()=>stringifyValue,strokeOptionsDef:()=>strokeOptionsDef,textOrSegments:()=>textOrSegments,themeOperator:()=>themeOperator,throttle:()=>throttle,tickFormat:()=>tickFormat,tickStep:()=>tickStep,toArray:()=>toArray,toDegrees:()=>toDegrees,toFontString:()=>toFontString,toIterable:()=>toIterable,toPlainText:()=>toPlainText,toRadians:()=>toRadians,toTextString:()=>toTextString,toolbarButtonOptionsDefs:()=>toolbarButtonOptionsDefs,tooltipOptionsDefs:()=>tooltipOptionsDefs,tooltipOptionsDefsWithArea:()=>tooltipOptionsDefsWithArea,transformIntegratedCategoryValue:()=>transformIntegratedCategoryValue,truncateLine:()=>truncateLine,typeUnion:()=>typeUnion,undocumented:()=>undocumented,unguardTextEdges:()=>unguardTextEdges,union:()=>union,unionSymbol:()=>unionSymbol,unique:()=>unique,validate:()=>validate,withTimeout:()=>withTimeout,without:()=>without,wrapLines:()=>wrapLines,wrapText:()=>wrapText,wrapTextOrSegments:()=>wrapTextOrSegments,wrapTextSegments:()=>wrapTextSegments}),module.exports=__toCommonJS(main_exports);var ModuleType=(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))(ModuleType||{});function extractDomain(e){return e.domain}var ScaleAlignment=(e=>(e[e.Leading=0]="Leading",e[e.Trailing=1]="Trailing",e[e.Interpolate=2]="Interpolate",e))(ScaleAlignment||{}),EventEmitter=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 n=this.events.get(e);n&&(n.delete(t),n.size===0&&this.events.delete(e))}emit(e,t){const n=this.events.get(e);if(n)for(const r of n)r(t)}clear(e){e?this.events.delete(e):this.events.clear()}},LRUCache=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()}},debugLogger_exports={};__export(debugLogger_exports,{Time:()=>Time,check:()=>check,create:()=>create,inDevelopmentMode:()=>inDevelopmentMode});function toArray(e){return e===void 0?[]:Array.isArray(e)?e:[e]}function unique(e){return Array.from(new Set(e))}function groupBy(e,t){return e.reduce((n,r)=>{const i=t(r);return n[i]??(n[i]=[]),n[i].push(r),n},{})}function arraysEqual(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(Array.isArray(e[n])&&Array.isArray(t[n])){if(!arraysEqual(e[n],t[n]))return!1}else if(e[n]!==t[n])return!1;return!0}function circularSliceArray(e,t,n=0){if(e.length===0)return[];const r=[];for(let i=0;i<t;i++)r.push(e.at((i+n)%e.length));return r}function sortBasedOnArray(e,t){const n=new Map;for(const[r,i]of t.entries())n.set(i,r);return e.sort((r,i)=>{const o=n.get(r)??1/0,s=n.get(i)??1/0;return o-s})}function dropFirstWhile(e,t){let n=0;for(;n<e.length&&t(e[n]);)n+=1;const r=n;r!==0&&e.splice(0,r)}function dropLastWhile(e,t){let n=e.length-1;for(;n>=0&&t(e[n]);)n-=1;const r=e.length-1-n;r!==0&&e.splice(e.length-r,r)}function distribute(e,t,n){const r=[e],i=Math.round((t-e)/(n-1));if(i>0)for(let o=e+i;o<t&&!(r.push(o)>=n-1);o+=i);return r.push(t),r}var verifiedGlobals={};typeof globalThis.window<"u"&&(verifiedGlobals.window=globalThis.window),typeof document<"u"?verifiedGlobals.document=document:typeof globalThis.global<"u"&&(verifiedGlobals.document=globalThis.document);function getDocument(e){return e?verifiedGlobals.document?.[e]:verifiedGlobals.document}function getWindow(e){return e?verifiedGlobals.window?.[e]:verifiedGlobals.window}function setDocument(e){verifiedGlobals.document=e}function setWindow(e){verifiedGlobals.window=e}function getOffscreenCanvas(){return verifiedGlobals.window?.OffscreenCanvas??globalThis.OffscreenCanvas}function getPath2D(){return verifiedGlobals.window?.Path2D??globalThis.Path2D}function getDOMMatrix(){return verifiedGlobals.window?.DOMMatrix??globalThis.DOMMatrix}function getImage(){return verifiedGlobals.window?.Image??globalThis.Image}function getResizeObserver(){return verifiedGlobals.window?.ResizeObserver??globalThis.ResizeObserver}var ELEMENT_NODE=1,DOCUMENT_FRAGMENT_NODE=11;function isNode(e){return e!=null&&typeof e.nodeType=="number"}function isElement(e){return e!=null&&e.nodeType===ELEMENT_NODE}function isDocumentFragment(e){return e!=null&&e.nodeType===DOCUMENT_FRAGMENT_NODE}function isHTMLElement(e){return e!=null&&e.nodeType===ELEMENT_NODE&&"style"in e}var logger_exports={};__export(logger_exports,{error:()=>error,errorOnce:()=>errorOnce,log:()=>log,logGroup:()=>logGroup,reset:()=>reset,table:()=>table,warn:()=>warn,warnOnce:()=>warnOnce});var doOnceCache=new Set;function log(...e){console.log(...e)}function warn(e,...t){console.warn(`AG Charts - ${e}`,...t)}function error(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function table(...e){console.table(...e)}function guardOnce(e,t,n){let r;e instanceof Error?r=e.message:typeof e=="string"?r=e:typeof e=="object"?r=JSON.stringify(e):r=String(e);const i=`${t}: ${r}`;doOnceCache.has(i)||(n(e),doOnceCache.add(i))}function warnOnce(e,...t){guardOnce(e,"Logger.warn",n=>warn(n,...t))}function errorOnce(e,...t){guardOnce(e,"Logger.error",n=>error(n,...t))}function reset(){doOnceCache.clear()}function logGroup(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var LongTimePeriodThreshold=2e3,timeOfLastLog=Date.now();function logTimeGap(){const e=Date.now()-timeOfLastLog;if(e>LongTimePeriodThreshold){const t=(Math.floor(e/100)/10).toFixed(1);log(`**** ${t}s since last log message ****`)}timeOfLastLog=Date.now()}function create(...e){return Object.assign((...n)=>{check(...e)&&(typeof n[0]=="function"&&(n=toArray(n[0]())),logTimeGap(),log(...n))},{check:()=>check(...e),group:(n,r)=>check(...e)?logGroup(n,r):r()})}function check(...e){return e.length===0&&e.push(!0),toArray(getWindow("agChartsDebug")).some(n=>e.includes(n))}function inDevelopmentMode(e){if(check("dev"))return e()}function Time(e,t={}){const{logResult:n=!0,logStack:r=!1,logArgs:i=!1,logData:o}=t;return function(s,a,l){const c=l.value;l.value=function(...u){const f=performance.now(),h=c.apply(this,u),g={duration:performance.now()-f};return n&&(g.result=h),i&&(g.args=u),r&&(g.stack=new Error("Stack trace for timing debug").stack),o&&(g.logData=o(this)),log(e,g),h}}}var debugMetrics_exports={};__export(debugMetrics_exports,{flush:()=>flush,record:()=>record});var metrics=new Map;function record(e,t){check("scene:stats:verbose")&&metrics.set(e,t)}function flush(){const e=Object.fromEntries(metrics);return metrics.clear(),e}var enterpriseRegistry={},moduleRegistry_exports={};__export(moduleRegistry_exports,{RegistryMode:()=>RegistryMode,getAxisModule:()=>getAxisModule,getChartModule:()=>getChartModule,getPresetModule:()=>getPresetModule,getSeriesModule:()=>getSeriesModule,hasModule:()=>hasModule,isEnterprise:()=>isEnterprise,isIntegrated:()=>isIntegrated,isModuleType:()=>isModuleType,isUmd:()=>isUmd,listModules:()=>listModules,listModulesByType:()=>listModulesByType,register:()=>register,registerModules:()=>registerModules,reset:()=>reset2,setRegistryMode:()=>setRegistryMode});var RegistryMode=(e=>(e.Enterprise="enterprise",e.Integrated="integrated",e.UMD="umd",e))(RegistryMode||{}),registeredModes=new Set,registeredModules=new Map;function registerModuleDefinition(e){if(registeredModules.set(e.name,e),e.dependencies)for(const t of e.dependencies)register(t)}function register(e){const t=registeredModules.get(e.name);if(!t){registerModuleDefinition(e);return}if(t.version===e.version){!t.enterprise&&e.enterprise&®isterModuleDefinition(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 registerModules(e){for(const t of e.flat())register(t)}function reset2(){registeredModes.clear(),registeredModules.clear()}function hasModule(e){return registeredModules.has(e)}function*listModules(){for(const e of registeredModules.values())yield e}function*listModulesByType(e){for(const t of registeredModules.values())isModuleType(e,t)&&(yield t)}function getAxisModule(e){const t=registeredModules.get(e);if(isModuleType("axis",t))return t}function getChartModule(e){const t=registeredModules.get(e);if(isModuleType("chart",t))return t;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function getPresetModule(e){const t=registeredModules.get(e);if(isModuleType("preset",t))return t}function getSeriesModule(e){const t=registeredModules.get(e);if(isModuleType("series",t))return t}function setRegistryMode(e){registeredModes.add(e)}function isEnterprise(){return registeredModes.has("enterprise")}function isIntegrated(){return registeredModes.has("integrated")}function isUmd(){return registeredModes.has("umd")}function isModuleType(e,t){return t?.type===e}var CleanupRegistry=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)}},AbstractModuleInstance=class{constructor(){this.cleanup=new CleanupRegistry}destroy(){this.cleanup.flush()}},__MINI_CHART_SERIES_OPTIONS=void 0,__VERIFY_MINI_CHART_SERIES_OPTIONS=void 0;__VERIFY_MINI_CHART_SERIES_OPTIONS=__MINI_CHART_SERIES_OPTIONS;var __THEME_OVERRIDES=void 0,__VERIFY_THEME_OVERRIDES=void 0;__VERIFY_THEME_OVERRIDES=__THEME_OVERRIDES;var __THEMEABLE_OPTIONS=void 0,__VERIFY_THEMEABLE_OPTIONS=void 0;__VERIFY_THEMEABLE_OPTIONS=__THEMEABLE_OPTIONS;var __AXIS_LABEL_OPTIONS=void 0,__VERIFY_AXIS_LABEL_OPTIONS=void 0;__VERIFY_AXIS_LABEL_OPTIONS=__AXIS_LABEL_OPTIONS;var EllipsisChar="\u2026",LineSplitter=/\r?\n/g,TrimEdgeGuard="\u200B",TrimCharsRegex=/[\s.,;:-]{1,5}$/,style;function parseColor(e){if(style==null){const n=getWindow("Option");style=new n().style}style.color=e;const t=style.color||null;return style.color="",t}function isDefined(e){return e!=null}function isArray(e){return Array.isArray(e)}function isBoolean(e){return typeof e=="boolean"}function isDate(e){return e instanceof Date}function isValidDate(e){return isDate(e)&&!Number.isNaN(Number(e))}function isRegExp(e){return e instanceof RegExp}function isFunction(e){return typeof e=="function"}function isObject(e){return typeof e=="object"&&e!==null&&!isArray(e)}function isObjectLike(e){return isArray(e)||isPlainObject(e)}function isPlainObject(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function isEmptyObject(e){if(typeof e!="object"||e===null)return!1;for(const t in e)return!1;return!0}function isString(e){return typeof e=="string"}function isNumber(e){return typeof e=="number"}function isFiniteNumber(e){return Number.isFinite(e)}function isHtmlElement(e){return e!=null&&e.nodeType===1&&"style"in e}function isEnumKey(e,t){return isString(t)&&Object.keys(e).includes(t)}function isEnumValue(e,t){return Object.values(e).includes(t)}function isSymbol(e){return typeof e=="symbol"}function isColor(e){return isString(e)&&(e==="none"||parseColor(e)!=null)}function isKeyOf(e,t){return e in t}function toFontString({fontSize:e,fontStyle:t,fontWeight:n,fontFamily:r}){let i="";return t&&t!=="normal"&&(i+=`${t} `),n&&n!=="normal"&&n!==400&&(i+=`${n} `),i+=`${e}px`,i+=` ${r}`,i}function calcLineHeight(e,t=1.15){return Math.round(e*t)}function toTextString(e){return String(e??"")}function appendEllipsis(e){return e.replace(TrimCharsRegex,"")+EllipsisChar}function guardTextEdges(e){return TrimEdgeGuard+e+TrimEdgeGuard}function unguardTextEdges(e){return e.replaceAll(TrimEdgeGuard,"")}function isTruncated(e){return isArray(e)?isSegmentTruncated(e.at(-1)):isTextTruncated(toTextString(e))}function isTextTruncated(e){return e.endsWith(EllipsisChar)}function isSegmentTruncated(e){return toTextString(e?.text).endsWith(EllipsisChar)}function joinFormatted(e,t="and",n=String,r=1/0){if(e.length===0)return"";if(e.length===1)return n(e[0]);e=e.map(n);const i=e.pop();if(e.length>=r){const o=e.length-(r-1);return`${e.slice(0,r-1).join(", ")}, and ${o} more ${t} ${i}`}return`${e.join(", ")} ${t} ${i}`}function stringifyValue(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 n=JSON.stringify(e)??typeof e;return n.length>t?`${n.slice(0,t)}... (+${n.length-t} characters)`:n}function countLines(e){let t=1;for(let n=0;n<e.length;n++)e.codePointAt(n)===10&&t++;return t}function levenshteinDistance(e,t){if(e===t)return 0;const[n,r]=e.length<t.length?[e,t]:[t,e],i=n.length,o=r.length;let s=new Array(i+1).fill(0).map((l,c)=>c),a=new Array(i+1);for(let l=1;l<=o;l++){a[0]=l;for(let c=1;c<=i;c++){const u=r[l-1]===n[c-1]?0:1;a[c]=Math.min(s[c]+1,a[c-1]+1,s[c-1]+u)}[s,a]=[a,s]}return s[i]}function kebabCase(e){return e.replaceAll(KEBAB_CASE_REGEX,(t,n)=>(n>0?"-":"")+t.toLowerCase())}var KEBAB_CASE_REGEX=/[A-Z]+(?![a-z])|[A-Z]/g;function toPlainText(e,t=""){return e==null?t:isArray(e)?e.map(n=>toTextString(n.text)).join(""):isString(e)?e:String(e)}function debounce(e,t=0,n){const{leading:r=!1,trailing:i=!0,maxWait:o=1/0}=n??{};let s,a;if(o<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(r&&!a){a=Date.now(),s=setTimeout(()=>a=null,t),e(...c);return}let u=t;if(o!==1/0&&a){const f=Date.now()-a;t>o-f&&(u=o-f)}clearTimeout(s),a??(a=Date.now()),s=setTimeout(()=>{a=null,i&&e(...c)},u)}return Object.assign(l,{cancel(){clearTimeout(s),a=null}})}function throttle(e,t,n){const{leading:r=!0,trailing:i=!0}=n??{};let o,s,a=!1;function l(){i&&s?(o=setTimeout(l,t),e(...s)):a=!1,s=null}function c(...u){a?s=u:(a=!0,o=setTimeout(l,t),r?e(...u):s=u)}return Object.assign(c,{cancel(){clearTimeout(o),a=!1,s=null}})}function safeCall(e,t,n=""){try{return e(...t)}catch(r){const i=n?` \`${n}\``:"";warnOnce(`Uncaught exception in user callback${i}`,r)}}var descriptionSymbol=Symbol("description"),requiredSymbol=Symbol("required"),markedSymbol=Symbol("marked"),undocumentedSymbol=Symbol("undocumented"),unionSymbol=Symbol("union"),similarOptionsMap=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["src","url"],["width","thickness"]].reduce((e,t)=>{for(const n of t)e.set(n.toLowerCase(),new Set(t.filter(r=>r!==n)));return e},new Map),ErrorType=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(ErrorType||{});function extendPath(e,t){return isFiniteNumber(t)?`${e}[${t}]`:e?`${e}.${t}`:t}var ValidationError=class{constructor(e,t,n,r,i){this.type=e,this.description=t,this.value=n,this.path=r,this.key=i}setUnionType(e,t){if(this.path.startsWith(t)){const n=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${n}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?extendPath(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:n}=this;return t==="required"&&n==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${stringifyValue(n,50)}\`; expecting ${e}, ignoring.`}},UnknownError=class extends ValidationError{constructor(e,t,n,r){super("unknown",void 0,t,n,r),this.suggestions=e,this.key=r}getPrefix(){return`Unknown option \`${extendPath(this.altPath??this.path,this.key)}\``}getPostfix(){const e=joinFormatted(findSuggestions(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}};function validate(e,t,n=""){if(!isObject(e))return{cleared:null,invalid:[new ValidationError("required","an object",e,n)]};const r={},i=[],o=new Set(Object.keys(e)),s=[];if(unionSymbol in t){const a=Object.keys(t),l=t[unionSymbol];if(e.type!=null&&a.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...u}=e,f=validate(u,t[c],n);Object.assign(r,{type:c},f.cleared);for(const h of f.invalid)h.setUnionType(c,n);i.push(...f.invalid)}else{const c=joinFormatted(a,"or",u=>`'${u}'`);i.push(new ValidationError("required",`a keyword such as ${c}`,e.type,n,"type"))}return{cleared:r,invalid:i}}for(const a of Object.keys(t)){const l=t[a],c=l[requiredSymbol],u=e[a];if(o.delete(a),u===void 0&&(l[undocumentedSymbol]||s.push(a),!c))continue;const f=extendPath(n,a);if(isFunction(l)){const d=l(u,{options:e,path:f});if(typeof d=="object"){if(i.push(...d.invalid),d.valid){r[a]=d.cleared;continue}else if(hasRequiredInPath(d.invalid,f))continue}else if(d){r[a]=u;continue}i.push(new ValidationError(c?"required":"invalid",l[descriptionSymbol],u,n,a))}else{const h=validate(u,l,f);h.cleared!=null&&(r[a]=h.cleared),i.push(...h.invalid)}}for(const a of o){const l=e[a];l!==void 0&&i.push(new UnknownError(s,l,n,a))}return{cleared:r,invalid:i}}function findSuggestions(e,t,n=2){const r=e.toLowerCase(),i=similarOptionsMap.get(r);return t.filter(o=>{const s=o.toLowerCase();return i?.has(o)===!0||s.includes(r)||levenshteinDistance(r,s)<=n})}function attachDescription(e,t){if(isFunction(e)){let r=function(i,o){return e(i,o)};var n=r;return r[descriptionSymbol]=t,r}else return{...e,[descriptionSymbol]:t}}function required(e){return Object.assign(isFunction(e)?(t,n)=>e(t,n):optionsDefs(e),{[requiredSymbol]:!0,[descriptionSymbol]:e[descriptionSymbol]})}function undocumented(e){return Object.assign(isFunction(e)?(t,n)=>e(t,n):optionsDefs(e),{[undocumentedSymbol]:!0,[descriptionSymbol]:e[descriptionSymbol]})}var optionsDefs=(e,t="an object",n=!1)=>attachDescription((r,i)=>{const o=validate(r,e,i.path),s=!hasRequiredInPath(o.invalid,i.path);return{valid:s,cleared:s||!n?o.cleared:null,invalid:o.invalid}},t),typeUnion=(e,t,n)=>({...e,[descriptionSymbol]:t,[unionSymbol]:n}),and=(...e)=>attachDescription((t,n)=>{const r=[];for(const i of e){const o=i(t,n);if(typeof o=="object"){if(r.push(...o.invalid),!o.valid)return{valid:!1,cleared:t,invalid:r};t=o.cleared}else if(!o)return!1}return{valid:!0,cleared:t,invalid:r}},joinFormatted(e.filter(t=>!t[undocumentedSymbol]).map(t=>t[descriptionSymbol]).filter(isDefined),"and")),or=(...e)=>attachDescription((t,n)=>{for(const r of e){const i=r(t,n);if(typeof i=="object"?i.valid:i)return i}return!1},joinFormatted(e.filter(t=>!t[undocumentedSymbol]).map(t=>t[descriptionSymbol]).filter(isDefined),"or")),isComparable=e=>isFiniteNumber(e)||isValidDate(e),isValidDateValue=e=>isDate(e)||(isFiniteNumber(e)||isString(e))&&isValidDate(new Date(e)),array=attachDescription(isArray,"an array"),boolean=attachDescription(isBoolean,"a boolean"),callback=attachDescription(isFunction,"a function"),color=attachDescription(isColor,"a color string"),date=attachDescription(isValidDateValue,"a date"),defined=attachDescription(isDefined,"a defined value"),number=attachDescription(isFiniteNumber,"a number"),object=attachDescription(isObject,"an object"),string=attachDescription(isString,"a string"),htmlElement=attachDescription(isHtmlElement,"an html element"),arrayLength=(e,t=1/0)=>{let n;return t===1/0?n=`an array of at least ${e} items`:e===t?n=`an array of exactly ${e} items`:e===0?n=`an array of no more than ${t} items`:n=`an array of at least ${e} and no more than ${t} items`,attachDescription(r=>isArray(r)&&r.length>=e&&r.length<=t,n)},stringLength=(e,t=1/0)=>{let n;return t===1/0?n=`a string of at least ${e} characters`:e===t?n=`an string of exactly ${e} characters`:e===0?n=`an string of no more than ${t} characters`:n=`an string of at least ${e} and no more than ${t} characters`,attachDescription(r=>isString(r)&&r.length>=e&&r.length<=t,n)},numberMin=(e,t=!0)=>attachDescription(n=>isFiniteNumber(n)&&(n>e||t&&n===e),`a number greater than ${t?"or equal to ":""}${e}`),numberRange=(e,t)=>attachDescription(n=>isFiniteNumber(n)&&n>=e&&n<=t,`a number between ${e} and ${t} inclusive`),positiveNumber=numberMin(0),positiveNumberNonZero=numberMin(0,!1),ratio=numberRange(0,1),lessThan=e=>attachDescription((t,{options:n})=>!isComparable(t)||!isComparable(n[e])||t<n[e],`the value to be less than \`${e}\``),lessThanOrEqual=e=>attachDescription((t,{options:n})=>!isComparable(t)||!isComparable(n[e])||t<=n[e],`the value to be less than or equal to \`${e}\``),greaterThan=e=>attachDescription((t,{options:n})=>!isComparable(t)||!isComparable(n[e])||t>n[e],`the value to be greater than \`${e}\``);function union(...e){isObject(e[0])&&(e=Object.values(e[0]));const t=joinFormatted(e,"or",n=>`'${n}'`);return attachDescription(n=>e.includes(n),`a keyword such as ${t}`)}function strictUnion(){return union}var constant=e=>attachDescription(t=>e===t,`the value ${JSON.stringify(e)}`),instanceOf=(e,t)=>attachDescription(n=>n instanceof e,t??`an instance of ${e.name}`),arrayOf=(e,t,n=!0)=>attachDescription((r,i)=>{if(!isArray(r))return!1;let o=n;const s=[],a=[],l=c=>{o=n?o&&c:o||c};if(r.length===0)return{valid:!0,cleared:s,invalid:a};for(let c=0;c<r.length;c++){const u=r[c],f=e(u,{options:u,path:`${i.path}[${c}]`});typeof f=="object"?(l(f.valid),a.push(...f.invalid),f.cleared!=null&&s.push(f.cleared)):(l(f),f&&s.push(u))}return{valid:o,cleared:o||!n?s:null,invalid:a}},t??`${e[descriptionSymbol]} array`),arrayOfDefs=(e,t="an object array")=>attachDescription((n,r)=>{if(!isArray(n))return!1;const i=[],o=[];for(let s=0;s<n.length;s++){const a=`${r.path}[${s}]`,l=validate(n[s],e,a);hasRequiredInPath(l.invalid,a)||i.push(l.cleared),o.push(...l.invalid)}return{valid:!0,cleared:i,invalid:o}},t),callbackOf=(e,t)=>attachDescription((n,r)=>{if(!isFunction(n))return!1;if(markedSymbol in n)return!0;const i=t??e[descriptionSymbol];return{valid:!0,cleared:Object.assign((...s)=>{const a=safeCall(n,s);if(a==null)return;const l=e(a,{options:a,path:""});if(typeof l=="object"){if(warnCallbackErrors(l,r,i,a),l.valid)return l.cleared}else{if(l)return a;warnOnce(`Callback \`${r.path}\` returned an invalid value \`${stringifyValue(a,50)}\`; expecting ${i}, ignoring.`)}},{[markedSymbol]:!0}),invalid:[]}},"a function"),callbackDefs=(e,t="an object")=>attachDescription((n,r)=>{if(!isFunction(n))return!1;if(markedSymbol in n)return!0;const i=t;return{valid:!0,cleared:Object.assign((...s)=>{const a=safeCall(n,s,r.path);if(a==null)return;const l=validate(a,e);return warnCallbackErrors(l,r,i,a),l.cleared},{[markedSymbol]:!0}),invalid:[]}},"a function");function hasRequiredInPath(e,t){return e.some(n=>n.type==="required"&&n.path===t)}function warnCallbackErrors(e,t,n,r){if(e.invalid.length!==0){if(isArray(r)){const i=n??e.invalid[0]?.description??"a valid value";return warnOnce(`Callback \`${t.path}\` returned an invalid value \`${stringifyValue(r,50)}\`; expecting ${i}, ignoring.`)}for(const i of e.invalid){if(i instanceof UnknownError)return warnOnce(`Callback \`${t.path}\` returned an unknown property \`${extendPath(i.path,i.key)}\`${i.getPostfix()}`);const o=stringifyValue(i.value,50);warnOnce(i.key?`Callback \`${t.path}\` returned an invalid property \`${extendPath(i.path,i.key)}\`: \`${o}\`; expecting ${i.description}, ignoring.`:`Callback \`${t.path}\` returned an invalid value \`${o}\`; expecting ${n??i.description}, ignoring.`)}}}function clamp(e,t,n){return Math.min(n,Math.max(e,t))}function inRange(e,t,n=1e-10){return e>=t[0]-n&&e<=t[1]+n}function isNumberEqual(e,t,n=1e-10){return e===t||Math.abs(e-t)<n}function isNegative(e){return Math.sign(e)===-1||Object.is(e,-0)}function isInteger(e){return e%1===0}function roundTo(e,t=2){const n=10**t;return Math.round(e*n)/n}function ceilTo(e,t=2){const n=10**t;return Math.ceil(e*n)/n}function modulus(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function countFractionDigits(e){if(Math.floor(e)===e)return 0;let t=String(e),n=0;if(e<1e-6||e>=1e21){let i;[t,i]=t.split("e"),i!=null&&(n=Number(i))}const r=t.split(".")[1]?.length??0;return Math.max(r-n,0)}var formatRegEx=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,surroundedRegEx=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/;function isValidNumberFormat(e){if(!isString(e))return!1;const t=surroundedRegEx.exec(e);return formatRegEx.test(t?t[2]:e)}function parseNumberFormat(e){let t,n;const r=surroundedRegEx.exec(e);r&&([,t,e,n]=r);const i=formatRegEx.exec(e);if(!i){warnOnce(`The number formatter is invalid: ${e}`);return}const[,o,s,a,l,c,u,f,h,d,g]=i;return{fill:o,align:s,sign:a,symbol:l,zero:c,width:Number.parseInt(u),comma:f,precision:Number.parseInt(h),trim:!!d,type:g,prefix:t,suffix:n}}function createNumberFormatter(e){const t=typeof e=="string"?parseNumberFormat(e):e;if(t==null)return;const{fill:n,align:r,sign:i="-",symbol:o,zero:s,width:a,comma:l,type:c,prefix:u="",suffix:f="",precision:h}=t;let{trim:d}=t;const g=h==null||Number.isNaN(h);let p;if(!c)p=decimalTypes.g,d=!0;else if(c in decimalTypes&&c in integerTypes)p=g?integerTypes[c]:decimalTypes[c];else if(c in decimalTypes)p=decimalTypes[c];else if(c in integerTypes)p=integerTypes[c];else throw new Error(`The number formatter type is invalid: ${c}`);const y=c?6:12;let m;g||(m=h);let b=r,E=n;return s&&(E??(E="0"),b??(b="=")),(v,_)=>{let O;m!=null?O=m:c==="f"||c==="%"?O=_??y:c?O=y:O=_??y;let T=p(v,O);d&&(T=removeTrailingZeros(T)),l&&(T=insertSeparator(T,l));const x=getSymbolPrefix(o,c),N=x?.length??0;x&&(T=`${x}${T}`),c==="s"&&(T=`${T}${getSIPrefix(v)}`),(c==="%"||c==="p")&&(T=`${T}%`);const{value:C,prefixLength:R}=addSign(v,T,i),k=R+N;let w=C;return a!=null&&!Number.isNaN(a)&&(w=addPadding(w,a,E??" ",b,k)),w=`${u}${w}${f}`,w}}var integerTypes={b:e=>absFloor(e).toString(2),c:e=>String.fromCodePoint(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>absFloor(e).toString(8),x:e=>absFloor(e).toString(16),X:e=>integerTypes.x(e).toUpperCase(),n:e=>integerTypes.d(e),"%":e=>`${absFloor(e*100).toFixed(0)}`},decimalTypes={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>decimalTypes.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>decimalTypes.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),r=Math.floor(Math.log10(n));return r>=-4&&r<t?n.toFixed(t-1-r):n.toExponential(t-1)},G:(e,t)=>decimalTypes.g(e,t).toUpperCase(),n:(e,t)=>decimalTypes.g(e,t),p:(e,t)=>decimalTypes.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const n=Math.abs(e),i=Math.floor(Math.log10(n))-(t-1);if(i<=0)return n.toFixed(-i);const o=10**i;return(Math.round(n/o)*o).toFixed()},s:(e,t)=>{const n=getSIPrefixPower(e);return decimalTypes.r(e/10**n,t)},"%":(e,t)=>decimalTypes.f(e*100,t)},minSIPrefix=-24,maxSIPrefix=24,siPrefixes={[minSIPrefix]:"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",[maxSIPrefix]:"Y"},minusSign="\u2212";function absFloor(e){return Math.floor(Math.abs(e))}function removeTrailingZeros(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 insertSeparator(e,t){let n=e.indexOf(".");n<0&&(n=e.length);const r=e.substring(0,n).split(""),i=e.substring(n);for(let o=r.length-3;o>0;o-=3)r.splice(o,0,t);return`${r.join("")}${i}`}function getSIPrefix(e){return siPrefixes[getSIPrefixPower(e)]}function getSIPrefixPower(e){return clamp(minSIPrefix,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,maxSIPrefix)}function addSign(e,t,n=""){if(n==="(")return e>=0?{value:t,prefixLength:0}:{value:`(${t})`,prefixLength:1};let r="";return e<0?r=minusSign:n==="+"?r="+":n===" "&&(r=" "),{value:`${r}${t}`,prefixLength:r.length}}function addPadding(e,t,n=" ",r=">",i=0){const o=t-e.length;if(o<=0)return e;const s=n.repeat(o);if(r==="="){const a=Math.min(Math.max(i,0),e.length),l=e.slice(0,a),c=e.slice(a);return`${l}${s}${c}`}if(r===">"||!r)return s+e;if(r==="<")return`${e}${s}`;if(r==="^"){const a=Math.ceil(o/2),l=Math.floor(o/2);return`${n.repeat(a)}${e}${n.repeat(l)}`}return s+e}function getSymbolPrefix(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 themeOperator=e=>{if(!isObject(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},colorStop=optionsDefs({color,stop:ratio},""),colorStopsOrderValidator=attachDescription(e=>{let t=-1/0;for(const n of e)if(n?.stop!=null){if(n.stop<t)return!1;t=n.stop}return!0},"colour stops to be defined in ascending order"),gradientColorStops=and(arrayLength(2),arrayOf(colorStop),colorStopsOrderValidator),gradientBounds=union("axis","item","series"),gradientStrictDefs={type:required(constant("gradient")),colorStops:required(gradientColorStops),rotation:number,gradient:undocumented(union("linear","radial","conic")),bounds:undocumented(gradientBounds),reverse:undocumented(boolean),colorSpace:undocumented(union("rgb","oklch"))},gradientStrict=optionsDefs(gradientStrictDefs,"a gradient object with colour stops"),strokeOptionsDef={stroke:color,strokeWidth:positiveNumber,strokeOpacity:ratio},fillGradientDefaults=optionsDefs({type:required(constant("gradient")),gradient:required(union("linear","radial","conic")),bounds:required(gradientBounds),colorStops:required(or(gradientColorStops,and(arrayLength(2),arrayOf(color)))),rotation:required(number),reverse:required(boolean),colorSpace:required(union("rgb","oklch"))}),fillPatternDefaults=optionsDefs({type:required(constant("pattern")),pattern:required(union("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:stringLength(2),width:required(positiveNumber),height:required(positiveNumber),fill:required(color),fillOpacity:required(ratio),backgroundFill:required(color),backgroundFillOpacity:required(ratio),padding:required(positiveNumber),rotation:required(number),scale:required(positiveNumber),stroke:required(color),strokeWidth:required(positiveNumber),strokeOpacity:required(ratio)}),fillImageDefaults=optionsDefs({type:required(constant("image")),url:string,width:positiveNumber,height:positiveNumber,rotation:required(number),backgroundFill:required(color),backgroundFillOpacity:ratio,fit:required(union("stretch","contain","cover")),repeat:required(union("repeat","repeat-x","repeat-y","no-repeat"))}),colorObjectDefs={gradient:{colorStops:gradientColorStops,rotation:number,gradient:undocumented(union("linear","radial","conic")),bounds:undocumented(gradientBounds),reverse:undocumented(boolean),colorSpace:undocumented(union("rgb","oklch"))},pattern:{pattern:union("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:stringLength(2),width:positiveNumber,height:positiveNumber,rotation:number,scale:positiveNumber,fill:color,fillOpacity:ratio,backgroundFill:color,backgroundFillOpacity:ratio,...strokeOptionsDef,padding:undocumented(positiveNumber)},image:{url:required(string),backgroundFill:color,backgroundFillOpacity:ratio,width:positiveNumber,height:positiveNumber,fit:union("stretch","contain","cover","none"),repeat:union("repeat","repeat-x","repeat-y","no-repeat"),rotation:number}},colorObject=typeUnion(colorObjectDefs,"a color object"),colorUnion=or(color,optionsDefs(colorObject,"a color object")),fillOptionsDef={fill:colorUnion,fillOpacity:ratio};fillOptionsDef.fillGradientDefaults=undocumented(fillGradientDefaults),fillOptionsDef.fillPatternDefaults=undocumented(fillPatternDefaults),fillOptionsDef.fillImageDefaults=undocumented(fillImageDefaults);var lineDashOptionsDef={lineDash:arrayOf(positiveNumber),lineDashOffset:number},barHighlightOptionsDef={...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef,opacity:ratio,cornerRadius:positiveNumber},lineHighlightOptionsDef={...strokeOptionsDef,...lineDashOptionsDef,opacity:ratio},shapeHighlightOptionsDef={...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef,opacity:ratio};function highlightOptionsDef(e){return{enabled:boolean,range:union("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function multiSeriesHighlightOptionsDef(e,t){return{enabled:boolean,range:union("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t,bringToFront:boolean}}var shapeSegmentOptions={start:defined,stop:defined,...strokeOptionsDef,...fillOptionsDef,...lineDashOptionsDef},lineSegmentOptions={start:defined,stop:defined,...strokeOptionsDef,...lineDashOptionsDef},shapeSegmentation=optionsDefs({enabled:boolean,key:required(union("x","y")),segments:arrayOfDefs(shapeSegmentOptions,"path segments array")},"a segmentation object",!0),lineSegmentation=optionsDefs({enabled:boolean,key:required(union("x","y")),segments:arrayOfDefs(lineSegmentOptions,"path segments array")},"a segmentation object",!0),googleFont=optionsDefs({googleFont:string},"google font"),fontFamilyFull=or(string,themeOperator,googleFont,arrayOf(or(string,googleFont))),fontWeight=or(positiveNumber,union("normal","bold","bolder","lighter")),fontOptionsDef={color,fontFamily:fontFamilyFull,fontSize:positiveNumber,fontStyle:union("normal","italic","oblique"),fontWeight},paddingOptions=optionsDefs({top:number,right:number,bottom:number,left:number},"padding object"),padding=or(number,paddingOptions),borderOptionsDef={enabled:boolean,stroke:color,strokeWidth:positiveNumber,strokeOpacity:ratio},labelBoxOptionsDef={border:borderOptionsDef,cornerRadius:number,padding,...fillOptionsDef},legendPlacementLiterals=["top","top-right","top-left","bottom","bottom-right","bottom-left","right","right-top","right-bottom","left","left-top","left-bottom"],legendPositionOptionsDef={floating:boolean,placement:union(...legendPlacementLiterals),xOffset:number,yOffset:number},legendPositionValidator=attachDescription((e,t)=>{let n;if(typeof e=="string")legendPlacementLiterals.includes(e)?n=!0:(n={valid:!1,invalid:[],cleared:null},n.invalid.push(new ValidationError("invalid",`a legend placement string: ["${legendPlacementLiterals.join('", "')}"]`,e,t.path)));else{const{cleared:r,invalid:i}=validate(e,legendPositionOptionsDef);n={valid:i.length===0,cleared:r,invalid:i}}return n},"a legend position object or placement string"),shapeValidator=or(union("circle","cross","diamond","heart","plus","pin","square","star","triangle"),callback),textWrapValidator=union("never","always","hyphenate","on-space"),tooltipPlacementValidator=union("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),rangeValidator=or(positiveNumber,union("exact","nearest","area")),seriesTooltipRangeValidator=or(positiveNumber,union("exact","nearest")),textOrSegments=or(string,number,date,arrayOfDefs({text:required(string),...fontOptionsDef},"text segments array")),chartCaptionOptionsDefs={enabled:boolean,text:textOrSegments,textAlign:union("left","center","right"),wrapping:union("never","always","hyphenate","on-space"),spacing:positiveNumber,maxWidth:positiveNumber,maxHeight:positiveNumber,...fontOptionsDef};chartCaptionOptionsDefs.padding=undocumented(positiveNumber);var chartOverlayOptionsDefs={enabled:boolean,text:textOrSegments,renderer:callbackOf(or(string,htmlElement))},contextMenuItemLiterals=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],contextMenuItemObjectDef={type:union("action","separator"),showOn:union("always","series-area","series-node","legend-item"),label:required(string),enabled:boolean,action:callback,items:(e,t)=>contextMenuItemsArray(e,t)};contextMenuItemObjectDef.iconUrl=undocumented(string);var contextMenuItemObjectValidator=optionsDefs(contextMenuItemObjectDef),contextMenuItemValidator=attachDescription((e,t)=>{let n;return typeof e=="string"?contextMenuItemLiterals.includes(e)?n=!0:(n={valid:!1,invalid:[],cleared:null},n.invalid.push(new ValidationError("invalid",`a context menu item string alias: ["${contextMenuItemLiterals.join('", "')}"]`,e,t.path))):n=contextMenuItemObjectValidator(e,t),n},`a context menu item object or string alias: [${contextMenuItemLiterals.join(", ")}]`),contextMenuItemsArray=arrayOf(contextMenuItemValidator,"a menu items array",!1),toolbarButtonOptionsDefs={label:string,ariaLabel:string,tooltip:string,icon:union("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","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")},formatter=or(string,callbackOf(textOrSegments)),formatObjectValidator=optionsDefs({x:formatter,y:formatter,angle:formatter,radius:formatter,size:formatter,color:formatter,label:formatter,secondaryLabel:formatter,sectorLabel:formatter,calloutLabel:formatter,legendItem:formatter}),numberFormatValidator=attachDescription(isValidNumberFormat,"a valid number format string"),commonChartOptionsDefs={width:positiveNumber,height:positiveNumber,minWidth:positiveNumber,minHeight:positiveNumber,suppressFieldDotNotation:boolean,title:chartCaptionOptionsDefs,subtitle:chartCaptionOptionsDefs,footnote:chartCaptionOptionsDefs,padding:{top:positiveNumber,right:positiveNumber,bottom:positiveNumber,left:positiveNumber},seriesArea:{border:borderOptionsDef,clip:boolean,cornerRadius:number,padding},legend:{enabled:boolean,position:legendPositionValidator,orientation:union("horizontal","vertical"),maxWidth:positiveNumber,maxHeight:positiveNumber,spacing:positiveNumber,border:borderOptionsDef,cornerRadius:number,padding,fill:colorUnion,fillOpacity:ratio,preventHidingAll:boolean,reverseOrder:boolean,toggleSeries:boolean,item:{marker:{size:positiveNumber,shape:shapeValidator,padding:positiveNumber,strokeWidth:positiveNumber},line:{length:positiveNumber,strokeWidth:positiveNumber},label:{maxLength:positiveNumber,formatter:callback,...fontOptionsDef},maxWidth:positiveNumber,paddingX:positiveNumber,paddingY:positiveNumber,showSeriesStroke:boolean},pagination:{marker:{size:positiveNumber,shape:shapeValidator,padding:positiveNumber},activeStyle:{...fillOptionsDef,...strokeOptionsDef},inactiveStyle:{...fillOptionsDef,...strokeOptionsDef},highlightStyle:{...fillOptionsDef,...strokeOptionsDef},label:fontOptionsDef},listeners:{legendItemClick:callback,legendItemDoubleClick:callback}},gradientLegend:{enabled:boolean,position:legendPositionValidator,spacing:positiveNumber,reverseOrder:boolean,border:borderOptionsDef,cornerRadius:number,padding,fill:colorUnion,fillOpacity:ratio,gradient:{preferredLength:positiveNumber,thickness:positiveNumber},scale:{label:{...fontOptionsDef,minSpacing:positiveNumber,format:numberFormatValidator,formatter:callback},padding:positiveNumber,interval:{step:number,values:array,minSpacing:and(positiveNumber,lessThan("maxSpacing")),maxSpacing:and(positiveNumber,greaterThan("minSpacing"))}}},listeners:{seriesNodeClick:callback,seriesNodeDoubleClick:callback,seriesVisibilityChange:callback,activeChange:callback,click:callback,doubleClick:callback,annotations:callback,zoom:callback},loadGoogleFonts:boolean,highlight:{drawingMode:union("overlay","cutout"),range:union("tooltip","node")},overlays:{loading:chartOverlayOptionsDefs,noData:chartOverlayOptionsDefs,noVisibleSeries:chartOverlayOptionsDefs,unsupportedBrowser:chartOverlayOptionsDefs},tooltip:{enabled:boolean,showArrow:boolean,pagination:boolean,delay:positiveNumber,range:rangeValidator,wrapping:textWrapValidator,mode:union("single","shared","compact"),position:{anchorTo:union("pointer","node","chart"),placement:or(tooltipPlacementValidator,arrayOf(tooltipPlacementValidator)),xOffset:number,yOffset:number}},animation:defined,contextMenu:defined,context:()=>!0,dataSource:{getData:callback},keyboard:{enabled:boolean,tabIndex:number},touch:{dragAction:union("none","drag","hover")},ranges:{enabled:boolean,buttons:arrayOfDefs({...toolbarButtonOptionsDefs,value:or(number,and(arrayOf(or(number,date)),arrayLength(2,2)),callback)},"range button options array")},locale:{localeText:object,getLocaleText:callbackOf(string)},background:{visible:boolean,fill:color,image:{url:required(string),top:number,right:number,bottom:number,left:number,width:positiveNumber,height:positiveNumber,opacity:ratio}},styleNonce:string,sync:defined,zoom:defined,scrollbar:defined,formatter:or(callbackOf(textOrSegments),formatObjectValidator)};commonChartOptionsDefs.flashOnUpdate=undocumented(defined),commonChartOptionsDefs.dataSource.requestThrottle=undocumented(positiveNumber),commonChartOptionsDefs.dataSource.updateThrottle=undocumented(positiveNumber),commonChartOptionsDefs.dataSource.updateDuringInteraction=undocumented(boolean),commonChartOptionsDefs.statusBar=undocumented(defined),commonChartOptionsDefs.foreground=undocumented({visible:boolean,text:string,image:{url:string,top:number,right:number,bottom:number,left:number,width:positiveNumber,height:positiveNumber,opacity:ratio},...fillOptionsDef}),commonChartOptionsDefs.overrideDevicePixelRatio=undocumented(number),commonChartOptionsDefs.sync.domainMode=undocumented(union("direction","position","key")),commonChartOptionsDefs.displayNullData=undocumented(boolean);var commonSeriesThemeableOptionsDefs={cursor:string,context:()=>!0,showInLegend:boolean,nodeClickRange:rangeValidator,listeners:{seriesNodeClick:callback,seriesNodeDoubleClick:callback},highlight:highlightOptionsDef(shapeHighlightOptionsDef)};commonSeriesThemeableOptionsDefs.allowNullKeys=undocumented(boolean);var commonSeriesOptionsDefs={...commonSeriesThemeableOptionsDefs,id:string,visible:boolean,context:()=>!0,data:array};commonSeriesOptionsDefs.seriesGrouping=undocumented(defined);var markerStyleOptionsDefs={shape:shapeValidator,size:positiveNumber,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},markerOptionsDefs={enabled:boolean,itemStyler:callbackDefs({...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef,shape:shapeValidator,size:positiveNumber}),...markerStyleOptionsDefs},seriesLabelOptionsDefs={enabled:boolean,formatter:callbackOf(textOrSegments),format:numberFormatValidator,itemStyler:callbackDefs({enabled:boolean,...labelBoxOptionsDef,...fontOptionsDef}),...labelBoxOptionsDef,...fontOptionsDef},autoSizedLabelOptionsDefs={...seriesLabelOptionsDefs,lineHeight:positiveNumber,minimumFontSize:positiveNumber,wrapping:textWrapValidator,overflowStrategy:union("ellipsis","hide")},errorBarThemeableOptionsDefs={visible:boolean,cap:{visible:boolean,length:positiveNumber,lengthRatio:ratio,...strokeOptionsDef,...lineDashOptionsDef},...strokeOptionsDef,...lineDashOptionsDef},errorBarOptionsDefs={...errorBarThemeableOptionsDefs,xLowerKey:string,xUpperKey:string,yLowerKey:string,yUpperKey:string,xLowerName:string,xUpperName:string,yLowerName:string,yUpperName:string,itemStyler:callbackDefs({visible:boolean,...strokeOptionsDef,...lineDashOptionsDef,cap:{visible:boolean,length:positiveNumber,lengthRatio:ratio,...strokeOptionsDef,...lineDashOptionsDef}})},tooltipOptionsDefs={enabled:boolean,showArrow:boolean,range:seriesTooltipRangeValidator,renderer:callbackOf(or(string,number,date,optionsDefs({heading:string,title:string,symbol:{marker:{enabled:boolean,shape:shapeValidator,...fillOptionsDef,stroke:color,strokeOpacity:ratio,strokeWidth:positiveNumber,...lineDashOptionsDef},line:{enabled:boolean,stroke:color,strokeWidth:positiveNumber,strokeOpacity:ratio,...lineDashOptionsDef}},data:arrayOfDefs({label:required(string),value:required(or(string,number,date))})},"tooltip renderer result object"))),position:{anchorTo:union("node","pointer","chart"),placement:or(tooltipPlacementValidator,arrayOf(tooltipPlacementValidator)),xOffset:number,yOffset:number},interaction:{enabled:boolean}},tooltipOptionsDefsWithArea={...tooltipOptionsDefs,range:rangeValidator},shadowOptionsDefs={enabled:boolean,xOffset:number,yOffset:number,blur:positiveNumber,color},interpolationOptionsDefs=typeUnion({linear:{},smooth:{tension:ratio},step:{position:union("start","middle","end")}},"interpolation line options"),BREAK_TRANSFORM_CHAIN=Symbol("BREAK"),CONFIG_KEY="__decorator_config",ACCESSORS_KEY="__decorator_accessors";function addFakeTransformToInstanceProperty(e,t){initialiseConfig(e,t).optional=!0}function initialiseConfig(e,t){if(Object.getOwnPropertyDescriptor(e,CONFIG_KEY)==null&&Object.defineProperty(e,CONFIG_KEY,{value:{}}),Object.getOwnPropertyDescriptor(e,ACCESSORS_KEY)==null){const u=Object.getPrototypeOf(e)?.[ACCESSORS_KEY]?.slice()??[];Object.defineProperty(e,ACCESSORS_KEY,{value:u})}const n=e[CONFIG_KEY],r=t.toString();if(n[r]!=null)return n[r];n[r]={setters:[],getters:[],observers:[]};const i=Object.getOwnPropertyDescriptor(e,t);let o=i?.get,s=i?.set;if(o==null||s==null){const c=e[ACCESSORS_KEY];let u=c.indexOf(t);u===-1&&(u=c.push(t)-1),o??(o=function(){let f=this.__accessors;return f==null&&(f=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:f})),f[u]}),s??(s=function(f){let h=this.__accessors;h==null&&(h=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:h})),h[u]=f})}return Object.defineProperty(e,t,{set:function(c){const{setters:u,observers:f}=n[r];let h;u.some(d=>d.length>2)&&(h=o.call(this));for(const d of u)if(c=d(this,t,c,h),c===BREAK_TRANSFORM_CHAIN)return;s.call(this,c);for(const d of f)d(this,c,h)},get:function(){let c=o.call(this);for(const u of n[r].getters)if(c=u(this,t,c),c===BREAK_TRANSFORM_CHAIN)return;return c},enumerable:!0,configurable:!1}),n[r]}function addTransformToInstanceProperty(e,t,n){return(r,i)=>{const o=initialiseConfig(r,i);o.setters.push(e),t&&o.getters.unshift(t),n&&Object.assign(o,n)}}function addObserverToInstanceProperty(e){return(t,n)=>{initialiseConfig(t,n).observers.push(e)}}function isDecoratedObject(e){return e!==void 0&&CONFIG_KEY in e}function listDecoratedProperties(e){const t=new Set;for(;isDecoratedObject(e);)t.add(e?.[CONFIG_KEY]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(n=>Object.keys(n))}function extractDecoratedProperties(e){return listDecoratedProperties(e).reduce((t,n)=>(t[String(n)]=e[n]??null,t),{})}function*iterate(...e){for(const t of e)t!=null&&(t[Symbol.iterator]?yield*t:yield t)}function toIterable(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function first(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*entries(e){const t=[void 0,void 0];for(const n of Object.keys(e))t[0]=n,t[1]=e[n],yield t}function strictObjectKeys(e){return Object.keys(e)}function objectsEqual(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((n,r)=>objectsEqual(n,t[r])):isPlainObject(e)?isPlainObject(t)?objectsEqualWith(e,t,objectsEqual):!1:e===t}function objectsEqualWith(e,t,n){if(Object.is(e,t))return!0;for(const r of Object.keys(t))if(!(r in e))return!1;for(const r of Object.keys(e))if(!(r in t)||!n(e[r],t[r]))return!1;return!0}function mergeDefaults(...e){const t={};for(const n of e){if(!isObject(n))continue;const r=isDecoratedObject(n)?listDecoratedProperties(n):Object.keys(n);for(const i of r)isPlainObject(t[i])&&isPlainObject(n[i])?t[i]=mergeDefaults(t[i],n[i]):t[i]??(t[i]=n[i])}return t}function merge(...e){const t={};for(const n of e){if(!isObject(n))continue;const r=isDecoratedObject(n)?listDecoratedProperties(n):Object.keys(n);for(const i of r)isPlainObject(t[i])&&isPlainObject(n[i])?t[i]=merge(t[i],n[i]):i in t||(t[i]??(t[i]=n[i]))}return t}function mergeArrayDefaults(e,...t){return t&&isArray(e)?e.map(n=>mergeDefaults(n,...t)):e}function mapValues(e,t){const n={};for(const[r,i]of entries(e))n[r]=t(i,r,e);return n}function without(e,t){const n={...e};for(const r of t)delete n[r];return n}function pick(e,t){if(e==null)return;const n={};for(const r of t)Object.hasOwn(e,r)&&(n[r]=e[r]);return n}function every(e,t){if(e==null)return!0;for(const[n,r]of entries(e))if(!t(n,r))return!1;return!0}function fromPairs(e){const t={};if(e==null)return t;for(const[n,r]of e)t[n]=r;return t}function getPath(e,t){return(isArray(t)?t:t.split(".")).reduce((r,i)=>r[i],e)}var SKIP_JS_BUILTINS=new Set(["__proto__","constructor","prototype"]);function setPath(e,t,n){const r=isArray(t)?t.slice():t.split("."),i=r.pop();if(r.some(s=>SKIP_JS_BUILTINS.has(s)))return;const o=r.reduce((s,a)=>s[a],e);return o[i]=n,o[i]}function partialAssign(e,t,n){if(n===void 0)return t;for(const r of e){const i=n[r];i!==void 0&&(t[r]=i)}return t}function assignIfNotStrictlyEqual(e,t,n){const r=n??Object.keys(t);for(let i=0,o=r.length;i<o;i++){const s=r[i],a=t[s];e[s]!==a&&(e[s]=a)}return e}function deepFreeze(e){if(e==null||typeof e!="object"||!isPlainObject(e))return e;Object.freeze(e);for(const t of Object.getOwnPropertyNames(e)){const n=e[t];n!==null&&(typeof n=="object"||typeof n=="function")&&!Object.isFrozen(n)&&deepFreeze(n)}return e}function isObjectWithProperty(e,t){return isPlainObject(e)&&t in e}function isObjectWithStringProperty(e,t){return isObjectWithProperty(e,t)&&typeof e[t]=="string"}var fillsOptionsDef={fills:and(arrayLength(2),arrayOf(optionsDefs({color,stop:number},"")),colorStopsOrderValidator),fillMode:union("continuous","discrete")},linearGaugeTargetOptionsDef={value:required(number),text:string,shape:or(union("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),callback),placement:union("before","after","middle"),spacing:positiveNumber,size:positiveNumber,rotation:number,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},radialGaugeTargetOptionsDef={value:required(number),text:string,shape:or(union("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),callback),placement:union("inside","outside","middle"),spacing:positiveNumber,size:positiveNumber,rotation:number,label:{...seriesLabelOptionsDefs,spacing:positiveNumber},...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},linearGaugeSeriesThemeableOptionsDef={...without(commonSeriesThemeableOptionsDefs,["listeners"]),direction:union("horizontal","vertical"),cornerMode:union("container","item"),cornerRadius:positiveNumber,thickness:positiveNumber,segmentation:{enabled:boolean,spacing:positiveNumber,interval:{values:arrayOf(number),step:number,count:number}},bar:{enabled:boolean,thickness:positiveNumber,thicknessRatio:ratio,...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},label:{...autoSizedLabelOptionsDefs,text:string,spacing:positiveNumber,avoidCollisions:boolean,placement:union("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:tooltipOptionsDefs},linearGaugeSeriesOptionsDef={...without(commonSeriesOptionsDefs,["listeners"]),...linearGaugeSeriesThemeableOptionsDef,type:required(constant("linear-gauge")),value:required(number),scale:{min:and(number,lessThan("max")),max:and(number,greaterThan("min")),label:{enabled:boolean,formatter:callback,rotation:number,spacing:positiveNumber,minSpacing:positiveNumber,placement:union("before","after"),avoidCollisions:boolean,format:numberFormatValidator,...fontOptionsDef},interval:{values:arrayOf(number),step:number},...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},targets:arrayOfDefs(linearGaugeTargetOptionsDef,"target options array")};linearGaugeSeriesOptionsDef.margin=undocumented(number),linearGaugeSeriesOptionsDef.defaultColorRange=undocumented(arrayOf(color)),linearGaugeSeriesOptionsDef.defaultTarget=undocumented({...linearGaugeTargetOptionsDef,value:number,label:{...seriesLabelOptionsDefs,spacing:number}}),linearGaugeSeriesOptionsDef.defaultScale=undocumented(linearGaugeSeriesOptionsDef.scale),linearGaugeSeriesOptionsDef.scale.defaultFill=undocumented(color);var radialGaugeSeriesThemeableOptionsDef={...without(commonSeriesThemeableOptionsDefs,["listeners"]),outerRadius:positiveNumber,innerRadius:positiveNumber,outerRadiusRatio:ratio,innerRadiusRatio:ratio,startAngle:number,endAngle:number,spacing:positiveNumber,cornerMode:union("container","item"),cornerRadius:positiveNumber,scale:{min:and(number,lessThan("max")),max:and(number,greaterThan("min")),label:{enabled:boolean,formatter:callback,rotation:number,spacing:positiveNumber,minSpacing:positiveNumber,avoidCollisions:boolean,format:numberFormatValidator,...fontOptionsDef},interval:{values:arrayOf(number),step:number},...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},segmentation:{enabled:boolean,spacing:positiveNumber,interval:{values:arrayOf(number),step:number,count:number}},bar:{enabled:boolean,...fillsOptionsDef,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},needle:{enabled:boolean,spacing:positiveNumber,radiusRatio:ratio,...fillOptionsDef,...strokeOptionsDef,...lineDashOptionsDef},label:{text:string,spacing:positiveNumber,...autoSizedLabelOptionsDefs},secondaryLabel:{text:string,...autoSizedLabelOptionsDefs},tooltip:tooltipOptionsDefs},radialGaugeSeriesOptionsDef={...without(commonSeriesOptionsDefs,["listeners"]),...radialGaugeSeriesThemeableOptionsDef,type:required(constant("radial-gauge")),value:required(number),targets:arrayOfDefs(radialGaugeTargetOptionsDef,"target options array")};radialGaugeSeriesOptionsDef.defaultColorRange=undocumented(arrayOf(color)),radialGaugeSeriesOptionsDef.defaultTarget=undocumented({...radialGaugeTargetOptionsDef,value:number,label:{...seriesLabelOptionsDefs,spacing:number}}),radialGaugeSeriesOptionsDef.scale.defaultFill=undocumented(color);var FONT_SIZE=(e=>(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))(FONT_SIZE||{}),BASE_FONT_SIZE=12,FONT_SIZE_RATIO={SMALLEST:8/BASE_FONT_SIZE,SMALLER:10/BASE_FONT_SIZE,SMALL:12/BASE_FONT_SIZE,MEDIUM:13/BASE_FONT_SIZE,LARGE:14/BASE_FONT_SIZE,LARGEST:17/BASE_FONT_SIZE},CARTESIAN_POSITION=(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))(CARTESIAN_POSITION||{}),CARTESIAN_AXIS_TYPE=(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))(CARTESIAN_AXIS_TYPE||{}),POLAR_AXIS_TYPE=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(POLAR_AXIS_TYPE||{}),POLAR_AXIS_SHAPE=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(POLAR_AXIS_SHAPE||{}),lerp=(e,t,n)=>e*(1-n)+t*n,srgbToLinear=e=>{const t=e<0?-1:1,n=Math.abs(e);return n<=.04045?e/12.92:t*((n+.055)/1.055)**2.4},srgbFromLinear=e=>{const t=e<0?-1:1,n=Math.abs(e);return n>.0031308?t*(1.055*n**(1/2.4)-.055):12.92*e},_Color=class A{constructor(t,n,r,i=1){this.r=clamp(0,t||0,1),this.g=clamp(0,n||0,1),this.b=clamp(0,r||0,1),this.a=clamp(0,i||0,1)}static validColorString(t){return t.includes("#")?!!A.parseHex(t):t.includes("rgb")?!!A.stringToRgba(t):A.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.includes("#"))return A.fromHexString(t);const n=A.nameToHex.get(t.toLowerCase());if(n)return A.fromHexString(n);if(t.includes("rgb"))return A.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replaceAll(" ","").slice(1);let n;switch(t.length){case 6:case 8:n=[];for(let r=0;r<t.length;r+=2)n.push(Number.parseInt(`${t[r]}${t[r+1]}`,16));break;case 3:case 4:n=t.split("").map(r=>Number.parseInt(r,16)).map(r=>r+r*16);break}if(n?.length>=3&&n.every(r=>r>=0))return n.length===3&&n.push(255),n}static fromHexString(t){const n=A.parseHex(t);if(n){const[r,i,o,s]=n;return new A(r/255,i/255,o/255,s/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let n=-1,r=-1;for(let a=0;a<t.length;a++){const l=t[a];if(n===-1&&l==="(")n=a;else if(l===")"){r=a;break}}if(n===-1||r===-1)return;const o=t.substring(n+1,r).split(","),s=[];for(let a=0;a<o.length;a++){const l=o[a];let c=Number.parseFloat(l);if(!Number.isFinite(c))return;l.includes("%")?(c=clamp(0,c,100),c/=100):a===3?c=clamp(0,c,1):(c=clamp(0,c,255),c/=255),s.push(c)}return s}static fromRgbaString(t){const n=A.stringToRgba(t);if(n){if(n.length===3)return new A(n[0],n[1],n[2]);if(n.length===4)return new A(n[0],n[1],n[2],n[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new A(t[0],t[1],t[2],t[3]);if(t.length===3)return new A(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,n,r,i=1){const o=A.HSBtoRGB(t,n,r);return new A(o[0],o[1],o[2],i)}static fromHSL(t,n,r,i=1){const o=A.HSLtoRGB(t,n,r);return new A(o[0],o[1],o[2],i)}static fromOKLCH(t,n,r,i=1){const o=A.OKLCHtoRGB(t,n,r);return new A(o[0],o[1],o[2],i)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+A.padHex(Math.round(this.r*255).toString(16))+A.padHex(Math.round(this.g*255).toString(16))+A.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=A.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const n=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],r=Math.pow(10,t);return this.a!==1?(n.push(Math.round(this.a*r)/r),`rgba(${n.join(", ")})`):`rgb(${n.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return A.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,n,r){const i=srgbToLinear(t),o=srgbToLinear(n),s=srgbToLinear(r),a=Math.cbrt(.4122214708*i+.5363325363*o+.0514459929*s),l=Math.cbrt(.2119034982*i+.6806995451*o+.1073969566*s),c=Math.cbrt(.0883024619*i+.2817188376*o+.6299787005*s),u=.2104542553*a+.793617785*l-.0040720468*c,f=1.9779984951*a-2.428592205*l+.4505937099*c,h=.0259040371*a+.7827717662*l-.808675766*c,d=Math.atan2(h,f)*180/Math.PI,g=u,p=Math.hypot(f,h),y=d>=0?d:d+360;return[g,p,y]}static OKLCHtoRGB(t,n,r){const i=t,o=n*Math.cos(r*Math.PI/180),s=n*Math.sin(r*Math.PI/180),a=(i+.3963377774*o+.2158037573*s)**3,l=(i-.1055613458*o-.0638541728*s)**3,c=(i-.0894841775*o-1.291485548*s)**3,u=4.0767416621*a-3.3077115913*l+.2309699292*c,f=-1.2684380046*a+2.6097574011*l-.3413193965*c,h=-.0041960863*a-.7034186147*l+1.707614701*c,d=srgbFromLinear(u),g=srgbFromLinear(f),p=srgbFromLinear(h);return[d,g,p]}static RGBtoHSL(t,n,r){const i=Math.min(t,n,r),o=Math.max(t,n,r),s=(o+i)/2;let a,l;if(o===i)a=0,l=0;else{const c=o-i;l=s>.5?c/(2-o-i):c/(o+i),o===t?a=(n-r)/c+(n<r?6:0):o===n?a=(r-t)/c+2:a=(t-n)/c+4,a*=360/6}return[a,l,s]}static HSLtoRGB(t,n,r){if(t=(t%360+360)%360,n===0)return[r,r,r];const i=r<.5?r*(1+n):r+n-r*n,o=2*r-i;function s(u){return u<0&&(u+=1),u>1&&(u-=1),u<1/6?o+(i-o)*6*u:u<1/2?i:u<2/3?o+(i-o)*(2/3-u)*6:o}const a=s(t/360+1/3),l=s(t/360),c=s(t/360-1/3);return[a,l,c]}static RGBtoHSB(t,n,r){const i=Math.min(t,n,r),o=Math.max(t,n,r),s=o===0?0:(o-i)/o;let a=0;if(i!==o){const l=o-i,c=(o-t)/l,u=(o-n)/l,f=(o-r)/l;t===o?a=f-u:n===o?a=2+c-f:a=4+u-c,a/=6,a<0&&(a=a+1)}return[a*360,s,o]}static HSBtoRGB(t,n,r){t=(t%360+360)%360/360;let i=0,o=0,s=0;if(n===0)i=o=s=r;else{const a=(t-Math.floor(t))*6,l=a-Math.floor(a),c=r*(1-n),u=r*(1-n*l),f=r*(1-n*(1-l));switch(Math.trunc(a)){case 0:i=r,o=f,s=c;break;case 1:i=u,o=r,s=c;break;case 2:i=c,o=r,s=f;break;case 3:i=c,o=u,s=r;break;case 4:i=f,o=c,s=r;break;case 5:i=r,o=c,s=u;break}}return[i,o,s]}static mix(t,n,r){return new A(lerp(t.r,n.r,r),lerp(t.g,n.g,r),lerp(t.b,n.b,r),lerp(t.a,n.a,r))}static lighten(t,n){const r=A.RGBtoOKLCH(t.r,t.g,t.b);return A.fromOKLCH(clamp(0,r[0]+n,1),r[1],r[2])}static darken(t,n){const r=A.RGBtoOKLCH(t.r,t.g,t.b);return A.fromOKLCH(clamp(0,r[0]-n,1),r[1],r[2])}static interpolate(t,n){const r=1/(t.length-1),i=t.map(o=>A.RGBtoOKLCH(o.r,o.g,o.b));return Array.from({length:n},(o,s)=>{const a=s/(n-1),l=t.length<=2?0:Math.min(Math.floor(a*(t.length-1)),t.length-2),c=(a-l*r)/r,u=i[l],f=i[l+1];return A.fromOKLCH(lerp(u[0],f[0],c),lerp(u[1],f[1],c),lerp(u[2],f[2],c))})}};_Color.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 Color=_Color,DIRECTION_SWAP_AXES={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"]}}},SAFE_FILL_OPERATION={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},SAFE_FILLS_OPERATION={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},SAFE_STROKE_FILL_OPERATION={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},SAFE_RANGE2_OPERATION={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},FILL_GRADIENT_BLANK_DEFAULTS={type:"gradient",gradient:"linear",bounds:"item",colorStops:[{color:"black"}],rotation:0,reverse:!1,colorSpace:"rgb"},FILL_GRADIENT_LINEAR_DEFAULTS={type:"gradient",gradient:"linear",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS={...FILL_GRADIENT_LINEAR_DEFAULTS,colorStops:{$shallow:[{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"black",.15]}},{color:{$mix:[{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},"white",.15]}}]}},FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS={...FILL_GRADIENT_LINEAR_DEFAULTS,colorStops:{$map:[{color:{$value:"$1"}},{$path:["/0",void 0,{$palette:"gradients"}]}]}},FILL_GRADIENT_LINEAR_KEYED_DEFAULTS=e=>({...FILL_GRADIENT_LINEAR_DEFAULTS,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]}}]]}}}),FILL_GRADIENT_RADIAL_DEFAULTS={type:"gradient",gradient:"radial",bounds:"item",colorStops:{$shallow:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]}},rotation:0,reverse:!1,colorSpace:"rgb"},FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS={...FILL_GRADIENT_RADIAL_DEFAULTS,reverse:!0},FILL_GRADIENT_RADIAL_SERIES_DEFAULTS={...FILL_GRADIENT_RADIAL_DEFAULTS,bounds:"series"},FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS={...FILL_GRADIENT_RADIAL_DEFAULTS,bounds:"series",reverse:!0},FILL_GRADIENT_CONIC_SERIES_DEFAULTS={type:"gradient",gradient:"conic",bounds:"series",colorStops:{$map:[{color:{$value:"$1"}},{$palette:"gradient"}]},rotation:0,reverse:!1,colorSpace:"rgb"},FILL_PATTERN_DEFAULTS={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:SAFE_STROKE_FILL_OPERATION,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},FILL_PATTERN_SINGLE_DEFAULTS={...FILL_PATTERN_DEFAULTS,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"}]}]}]}},FILL_PATTERN_BLANK_DEFAULTS={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},FILL_PATTERN_HIERARCHY_DEFAULTS={...FILL_PATTERN_DEFAULTS,fill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]}},FILL_PATTERN_KEYED_DEFAULTS=e=>({...FILL_PATTERN_DEFAULTS,stroke:{$if:[{$isGradient:{$palette:`${e}.fill`}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:`${e}.fill`}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:`${e}.fill`}]},{$palette:`${e}.fill`}]}]}}),FILL_IMAGE_DEFAULTS={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0},FILL_IMAGE_BLANK_DEFAULTS={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8};function getSequentialColors(e){return mapValues(e,t=>{const n=Color.fromString(t);return[Color.darken(n,.15).toString(),t,Color.lighten(n,.15).toString()]})}var LABEL_BOXING_DEFAULTS={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}}},MULTI_SERIES_HIGHLIGHT_STYLE={enabled:!0,unhighlightedItem:{opacity:.6},unhighlightedSeries:{opacity:.2}},MARKER_SERIES_HIGHLIGHT_STYLE={enabled:!0,unhighlightedSeries:{opacity:.2}},PART_WHOLE_HIGHLIGHT_STYLE={enabled:!0,unhighlightedItem:{opacity:.2},unhighlightedSeries:{opacity:.2}},SINGLE_SERIES_HIGHLIGHT_STYLE={enabled:!0,unhighlightedItem:{opacity:.2}},LEGEND_CONTAINER_THEME={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]}]}},SEGMENTATION_DEFAULTS={enabled:!1,key:"x",segments:{$apply:{fill:{$applySwitch:[{$path:"type"},{$path:"../../../fill"},["gradient",FILL_GRADIENT_LINEAR_DEFAULTS],["image",FILL_IMAGE_DEFAULTS],["pattern",FILL_PATTERN_DEFAULTS]]},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"}}}},MementoCaretaker=class Z{constructor(t){this.version=t.split("-")[0]}save(...t){const n={version:this.version};for(const r of Object.values(t))n[r.mementoOriginatorKey]=this.encode(r,r.createMemento());return n}restore(t,...n){if(typeof t!="object"){warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const r of n){const i=this.decode(r,t[r.mementoOriginatorKey]),o=[];if(!r.guardMemento(i,o)){const s=o.length>0?`
|
|
|
|
${o.join(`
|
|
|
|
`)}
|
|
|
|
`:"";warnOnce(`Could not restore [${r.mementoOriginatorKey}] data, value was invalid, ignoring.${s}`,i);return}r.restoreMemento(this.version,t.version,i)}}encode(t,n){try{return JSON.parse(JSON.stringify(n,Z.encodeTypes))}catch(r){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${r}].`,{cause:r})}}decode(t,n){if(n==null)return n;try{return JSON.parse(JSON.stringify(n),Z.decodeTypes)}catch(r){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${r}].`,{cause:r})}}static encodeTypes(t,n){return isDate(this[t])?{__type:"date",value:this[t].toISOString()}:n}static decodeTypes(t,n){return isObject(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):n}},ChartAxisDirection=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(ChartAxisDirection||{}),ChartUpdateType=(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))(ChartUpdateType||{}),ZIndexMap=(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))(ZIndexMap||{}),SeriesZIndexMap=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(SeriesZIndexMap||{}),SeriesContentZIndexMap=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(SeriesContentZIndexMap||{}),PolarZIndexMap=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(PolarZIndexMap||{});function expandLegendPosition(e){const{placement:t="bottom",floating:n=!1,xOffset:r=0,yOffset:i=0}=typeof e=="string"?{placement:e,floating:!1}:e;return{placement:t,floating:n,xOffset:r,yOffset:i}}var BaseProperties=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 warn(`unable to set ${t} - expecting a properties object`),this;const n=new Set(Object.keys(e));for(const r of listDecoratedProperties(this))if(n.has(r)){const i=e[r],o=this;if(isProperties(o[r]))if(o[r]instanceof PropertiesArray){const s=o[r].reset(i);s==null?warn(`unable to set [${String(r)}] - expecting a properties array`):o[r]=s}else o[r].set(i);else isPlainObject(i)?o[r]=merge(i,o[r]??{}):o[r]=i;n.delete(r)}this.handleUnknownProperties(n,e);for(const r of n)warn(`unable to set [${String(r)}] in ${t} - property is unknown`);return this}clear(){for(const e of listDecoratedProperties(this)){const t=this[e];isProperties(t)?t.clear():this[e]=void 0}return this}toJson(){return listDecoratedProperties(this).reduce((e,t)=>{const n=this[t];return e[String(t)]=isProperties(n)?n.toJson():n,e},{})}},PropertiesArray=class ne extends Array{constructor(t,...n){super(n.length);const i=(o=>!!o?.prototype?.constructor?.name)(t)?o=>new t().set(o):t;Object.defineProperty(this,"itemFactory",{value:i,enumerable:!1,configurable:!1}),this.set(n)}set(t){if(isArray(t)){this.length=t.length;for(let n=0;n<t.length;n++)this[n]=this.itemFactory(t[n])}return this}reset(t){if(Array.isArray(t))return new ne(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function isProperties(e){return e instanceof BaseProperties||e instanceof PropertiesArray}var InterpolationProperties=class extends BaseProperties{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};__decorateClass([addFakeTransformToInstanceProperty],InterpolationProperties.prototype,"type",2),__decorateClass([addFakeTransformToInstanceProperty],InterpolationProperties.prototype,"tension",2),__decorateClass([addFakeTransformToInstanceProperty],InterpolationProperties.prototype,"position",2);function clampArray(e,t){const[n,r]=findMinMax(t);return clamp(n,e,r)}function findMinMax(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const n of e)n<t[0]&&(t[0]=n),n>t[1]&&(t[1]=n);return t}function findRangeExtent(e){const[t,n]=findMinMax(e);return n-t}function nextPowerOf2(e){return e=Math.trunc(e),e<=0?1:e===1?2:1<<32-Math.clz32(e-1)}function previousPowerOf2(e){return e=Math.trunc(e),e<=0?0:e===1?1:1<<31-Math.clz32(e)}var AGGREGATION_INDEX_X_MIN=0,AGGREGATION_INDEX_X_MAX=1,AGGREGATION_INDEX_Y_MIN=2,AGGREGATION_INDEX_Y_MAX=3,AGGREGATION_SPAN=4,AGGREGATION_THRESHOLD=1e3,AGGREGATION_MAX_POINTS=10,AGGREGATION_MIN_RANGE=64,AGGREGATION_INDEX_UNSET=4294967295,SMALLEST_INTERVAL_MIN_RECURSE=3,SMALLEST_INTERVAL_RECURSE_LIMIT=20,SMALLEST_INTERVAL_MAX_INDEX_ADJUSTMENTS=100;function estimateSmallestPixelIntervalIter(e,t,n,r,i,o,s,a){let l=0;for(;l<SMALLEST_INTERVAL_MAX_INDEX_ADJUSTMENTS&&e[r]==null&&r<i;)r+=1,l+=1;for(;l<SMALLEST_INTERVAL_MAX_INDEX_ADJUSTMENTS&&e[i]==null&&i>r;)i-=1,l+=1;if(l>=SMALLEST_INTERVAL_MAX_INDEX_ADJUSTMENTS||r>=i)return o;const c=Number.isFinite(t)?aggregationXRatioForXValue(e[i],t,n,a)-aggregationXRatioForXValue(e[r],t,n,a):aggregationXRatioForDatumIndex(i,e.length)-aggregationXRatioForDatumIndex(r,e.length);if(c===0||!Number.isFinite(c))return o;const u=Math.abs(c)/(i-r);let f;if(s<SMALLEST_INTERVAL_MIN_RECURSE?f=!0:s>SMALLEST_INTERVAL_RECURSE_LIMIT?f=!1:f=u<=o,o=Math.min(o,u),!f)return o;const h=Math.floor((r+i)/2),d=estimateSmallestPixelIntervalIter(e,t,n,r,h,o,s+1,a),g=estimateSmallestPixelIntervalIter(e,t,n,h+1,i,o,s+1,a);return Math.min(d,g,o)}function estimateSmallestPixelInterval(e,t,n,r){return estimateSmallestPixelIntervalIter(e,t,n,0,e.length-1,1/(e.length-1),0,r)}function aggregationRangeFittingPoints(e,t,n,r){if(Number.isFinite(t)){const i=r?.smallestKeyInterval,o=r?.xNeedsValueOf??!0,s=i==null?estimateSmallestPixelInterval(e,t,n,o):i/(n-t);return nextPowerOf2(Math.trunc(1/s))>>3}else{let i=Math.ceil(Math.log2(e.length))-1;return i=Math.min(Math.max(i,0),24),Math.trunc(2**i)}}function aggregationDomain(e,t){const{domain:n,sortMetadata:r}=t;switch(e){case"category":return[Number.NaN,Number.NaN];case"number":case"time":case"ordinal-time":case"unit-time":{if(n.length===0)return[1/0,-1/0];if(r?.sortOrder===1)return[Number(n[0]),Number(n.at(-1))];if(r?.sortOrder===-1)return[Number(n.at(-1)),Number(n[0])];let i=1/0,o=-1/0;for(const s of n){const a=Number(s);i=Math.min(i,a),o=Math.max(o,a)}return[i,o]}case"color":case"log":case"mercator":return[0,0]}}function aggregationXRatioForDatumIndex(e,t){return e/t}function aggregationXRatioForXValue(e,t,n,r){return r?(e.valueOf()-t)/(n-t):(e-t)/(n-t)}function aggregationIndexForXRatio(e,t){return Math.trunc(Math.min(Math.floor(e*t),t-1)*AGGREGATION_SPAN)}function aggregationBucketForDatum(e,t,n,r,i,{xNeedsValueOf:o=!0,xValuesLength:s}={}){const a=e[i];if(a==null)return-1;const l=s??e.length,c=Number.isFinite(t)?aggregationXRatioForXValue(a,t,n,o):aggregationXRatioForDatumIndex(i,l);return aggregationIndexForXRatio(c,r)}function aggregationDatumMatchesIndex(e,t,n,r){for(const i of r)if(n===e[t+i])return!0;return!1}function createAggregationIndices(e,t,n,r,i,o,{positive:s,split:a=!1,xNeedsValueOf:l=!0,yNeedsValueOf:c=!0,reuseIndexData:u,reuseValueData:f,reuseNegativeIndexData:h,reuseNegativeValueData:d}={}){const g=Number.NaN,p=o*AGGREGATION_SPAN,y=u?.length===p?u:new Uint32Array(p),m=f?.length===p?f:new Float64Array(p);let b,E;a&&(h?.length===p?b=h:b=new Uint32Array(p),d?.length===p?E=d:E=new Float64Array(p));const v=Number.isFinite(r)&&Number.isFinite(i),_=e.length;v&&(m.fill(g),y.fill(AGGREGATION_INDEX_UNSET),a&&(E.fill(g),b.fill(AGGREGATION_INDEX_UNSET)));const O=v?o/(i-r):o*(1/_);let T=-1,x=-1,N=g,C=-1,R=g,k=-1,w=g,j=-1,$=g,D=-1,P=-1,G=g,W=-1,U=g,V=-1,B=g,K=-1,H=g;const re=e.length,ie=t===n;for(let S=0;S<re;S++){const J=e[S];if(J==null)continue;const X=t[S],Q=ie?X:n[S];let F,M;c?(F=X==null?g:X.valueOf(),M=Q==null?g:Q.valueOf()):(F=X??g,M=Q??g);let ee=!0;if(a)ee=F>=0;else if(s!=null&&F>=0!==s)continue;let L;v?l?L=(J.valueOf()-r)*O:L=(J-r)*O:L=S*O;const te=Math.floor(L),Y=(te<o?te:o-1)<<2;if(ee){Y!==T&&(T!==-1&&(y[T]=x,y[T+1]=C,y[T+2]=k,y[T+3]=j,m[T]=N,m[T+1]=R,m[T+2]=w,m[T+3]=$),T=Y,x=-1,N=g,C=-1,R=g,k=-1,w=g,j=-1,$=g);const z=M===M,q=F===F;x===-1?(x=S,N=L,C=S,R=L,z&&(k=S,w=M),q&&(j=S,$=F)):(L<N&&(x=S,N=L),L>R&&(C=S,R=L),z&&M<w&&(k=S,w=M),q&&F>$&&(j=S,$=F))}else{Y!==D&&(D!==-1&&(b[D]=P,b[D+1]=W,b[D+2]=V,b[D+3]=K,E[D]=G,E[D+1]=U,E[D+2]=B,E[D+3]=H),D=Y,P=-1,G=g,W=-1,U=g,V=-1,B=g,K=-1,H=g);const z=M===M,q=F===F;P===-1?(P=S,G=L,W=S,U=L,z&&(V=S,B=M),q&&(K=S,H=F)):(L<G&&(P=S,G=L),L>U&&(W=S,U=L),z&&M<B&&(V=S,B=M),q&&F>H&&(K=S,H=F))}}return T!==-1&&(y[T]=x,y[T+1]=C,y[T+2]=k,y[T+3]=j,m[T]=N,m[T+1]=R,m[T+2]=w,m[T+3]=$),a&&D!==-1&&(b[D]=P,b[D+1]=W,b[D+2]=V,b[D+3]=K,E[D]=G,E[D+1]=U,E[D+2]=B,E[D+3]=H),{indexData:y,valueData:m,negativeIndexData:b,negativeValueData:E}}function compactAggregationIndices(e,t,n,{inPlace:r=!1,midpointData:i,reuseIndexData:o,reuseValueData:s}={}){const a=Math.trunc(n/2),l=a*AGGREGATION_SPAN;let c;r?c=e:o?.length===l?c=o:c=new Uint32Array(l);let u;r?u=t:s?.length===l?u=s:u=new Float64Array(l);const f=i??new Uint32Array(a);for(let h=0;h<a;h+=1){const d=Math.trunc(h*AGGREGATION_SPAN),g=Math.trunc(d*2),p=Math.trunc(g+AGGREGATION_SPAN),y=e[p+AGGREGATION_INDEX_X_MIN]===AGGREGATION_INDEX_UNSET,m=y||t[g+AGGREGATION_INDEX_X_MIN]<t[p+AGGREGATION_INDEX_X_MIN]?g:p,b=e[m+AGGREGATION_INDEX_X_MIN];c[d+AGGREGATION_INDEX_X_MIN]=b,u[d+AGGREGATION_INDEX_X_MIN]=t[m+AGGREGATION_INDEX_X_MIN];const E=y||t[g+AGGREGATION_INDEX_X_MAX]>t[p+AGGREGATION_INDEX_X_MAX]?g:p,v=e[E+AGGREGATION_INDEX_X_MAX];c[d+AGGREGATION_INDEX_X_MAX]=v,u[d+AGGREGATION_INDEX_X_MAX]=t[E+AGGREGATION_INDEX_X_MAX],f[h]=b+v>>1;const _=y||t[g+AGGREGATION_INDEX_Y_MIN]<t[p+AGGREGATION_INDEX_Y_MIN]?g:p;c[d+AGGREGATION_INDEX_Y_MIN]=e[_+AGGREGATION_INDEX_Y_MIN],u[d+AGGREGATION_INDEX_Y_MIN]=t[_+AGGREGATION_INDEX_Y_MIN];const O=y||t[g+AGGREGATION_INDEX_Y_MAX]>t[p+AGGREGATION_INDEX_Y_MAX]?g:p;c[d+AGGREGATION_INDEX_Y_MAX]=e[O+AGGREGATION_INDEX_Y_MAX],u[d+AGGREGATION_INDEX_Y_MAX]=t[O+AGGREGATION_INDEX_Y_MAX]}return{maxRange:a,indexData:c,valueData:u,midpointData:f}}function getMidpointsForIndices(e,t,n,r=AGGREGATION_INDEX_X_MIN,i=AGGREGATION_INDEX_X_MAX,o=-1){const s=n?.length===e?n:new Uint32Array(e);for(let a=0,l=0;a<e;a+=1,l+=AGGREGATION_SPAN){const c=t[l+r],u=t[l+i];s[a]=c===o?o:c+u>>1}return s}function collectAggregationLevels(e,{collectLevel:t,shouldContinue:n,minRange:r=AGGREGATION_MIN_RANGE,compactInPlace:i=!1}){let o=e,s=t(o);const a=[s];for(;o.maxRange>r&&n(s,o);){const l=compactAggregationIndices(o.indexData,o.valueData,o.maxRange,{inPlace:i});o={maxRange:l.maxRange,indexData:l.indexData,valueData:l.valueData,midpointData:l.midpointData},s=t(o),a.push(s)}return a.reverse(),a}function computeExtremesAggregation(e,t,n,r,i){if(t.length<AGGREGATION_THRESHOLD)return;const[o,s]=e,{smallestKeyInterval:a,xNeedsValueOf:l,yNeedsValueOf:c,existingFilters:u}=i;let f=aggregationRangeFittingPoints(t,o,s,{smallestKeyInterval:a,xNeedsValueOf:l});const h=u?.find(m=>m.maxRange===f);let{indexData:d,valueData:g}=createAggregationIndices(t,n,r,o,s,f,{xNeedsValueOf:l,yNeedsValueOf:c,reuseIndexData:h?.indexData,reuseValueData:h?.valueData}),p=getMidpointsForIndices(f,d,h?.midpointIndices);const y=[{maxRange:f,indexData:d,valueData:g,midpointIndices:p}];for(;f>AGGREGATION_MIN_RANGE;){const m=f,b=Math.trunc(m/2),E=u?.find(_=>_.maxRange===b),v=compactAggregationIndices(d,g,m,{reuseIndexData:E?.indexData,reuseValueData:E?.valueData});f=v.maxRange,d=v.indexData,g=v.valueData,p=v.midpointData??getMidpointsForIndices(f,d,E?.midpointIndices),y.push({maxRange:f,indexData:d,valueData:g,midpointIndices:p})}return y.reverse(),y}function computeExtremesAggregationPartial(e,t,n,r,i){if(t.length<AGGREGATION_THRESHOLD)return;const[o,s]=e,{smallestKeyInterval:a,targetRange:l,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:f}=i,h=aggregationRangeFittingPoints(t,o,s,{smallestKeyInterval:a,xNeedsValueOf:c}),d=Math.min(h,nextPowerOf2(Math.max(l,AGGREGATION_MIN_RANGE))),g=f?.find(v=>v.maxRange===d),{indexData:p,valueData:y}=createAggregationIndices(t,n,r,o,s,d,{xNeedsValueOf:c,yNeedsValueOf:u,reuseIndexData:g?.indexData,reuseValueData:g?.valueData}),m=getMidpointsForIndices(d,p,g?.midpointIndices),b={maxRange:d,indexData:p,valueData:y,midpointIndices:m};function E(){return computeExtremesAggregation([o,s],t,n,r,{smallestKeyInterval:a,xNeedsValueOf:c,yNeedsValueOf:u,existingFilters:f})?.filter(_=>_.maxRange!==d)??[]}return{immediate:[b],computeRemaining:E}}var IS_DARK_THEME=Symbol("is-dark-theme"),DEFAULT_SHADOW_COLOUR=Symbol("default-shadow-colour"),DEFAULT_CAPTION_LAYOUT_STYLE=Symbol("default-caption-layout-style"),DEFAULT_CAPTION_ALIGNMENT=Symbol("default-caption-alignment"),PALETTE_UP_STROKE=Symbol("palette-up-stroke"),PALETTE_DOWN_STROKE=Symbol("palette-down-stroke"),PALETTE_UP_FILL=Symbol("palette-up-fill"),PALETTE_DOWN_FILL=Symbol("palette-down-fill"),PALETTE_NEUTRAL_STROKE=Symbol("palette-neutral-stroke"),PALETTE_NEUTRAL_FILL=Symbol("palette-neutral-fill"),PALETTE_ALT_UP_STROKE=Symbol("palette-alt-up-stroke"),PALETTE_ALT_DOWN_STROKE=Symbol("palette-alt-down-stroke"),PALETTE_ALT_UP_FILL=Symbol("palette-alt-up-fill"),PALETTE_ALT_DOWN_FILL=Symbol("palette-alt-down-fill"),PALETTE_ALT_NEUTRAL_FILL=Symbol("palette-gray-fill"),PALETTE_ALT_NEUTRAL_STROKE=Symbol("palette-gray-stroke"),DEFAULT_POLAR_SERIES_STROKE=Symbol("default-polar-series-stroke"),DEFAULT_SPARKLINE_CROSSHAIR_STROKE=Symbol("default-sparkline-crosshair-stroke"),DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR=Symbol("default-financial-charts-annotation-stroke"),DEFAULT_FIBONACCI_STROKES=Symbol("default-hierarchy-strokes"),DEFAULT_TEXT_ANNOTATION_COLOR=Symbol("default-text-annotation-color"),DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL=Symbol("default-financial-charts-annotation-background-fill"),DEFAULT_ANNOTATION_HANDLE_FILL=Symbol("default-annotation-handle-fill"),DEFAULT_ANNOTATION_STATISTICS_FILL=Symbol("default-annotation-statistics-fill"),DEFAULT_ANNOTATION_STATISTICS_STROKE=Symbol("default-annotation-statistics-stroke"),DEFAULT_ANNOTATION_STATISTICS_COLOR=Symbol("default-annotation-statistics-color"),DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE=Symbol("default-annotation-statistics-divider-stroke"),DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL=Symbol("default-annotation-statistics-fill"),DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE=Symbol("default-annotation-statistics-stroke"),DEFAULT_TEXTBOX_FILL=Symbol("default-textbox-fill"),DEFAULT_TEXTBOX_STROKE=Symbol("default-textbox-stroke"),DEFAULT_TEXTBOX_COLOR=Symbol("default-textbox-color"),DEFAULT_TOOLBAR_POSITION=Symbol("default-toolbar-position");function needsContext(e,t){return"context"in e}function maybeSetContext(e,t){return e!=null&&needsContext(e,t)&&t!=null&&typeof t=="object"&&t.context===void 0?(t.context=e.context,!0):!1}function callWithContext(e,t,n){if(Array.isArray(e)){for(const r of e)if(maybeSetContext(r,n))break}else maybeSetContext(e,n);return t(n)}var CallbackCache=class{constructor(){this.cache=new WeakMap}call(e,t,n){let r,i=this.cache.get(t);try{r=JSON.stringify(n)}catch{return this.invoke(e,t,i,void 0,n)}return i==null&&(i=new Map,this.cache.set(t,i)),i.has(r)?i.get(r):this.invoke(e,t,i,r,n)}invoke(e,t,n,r,i){try{const o=callWithContext(e,t,i);return n&&r!=null&&n.set(r,o),o}catch(o){warnOnce("User callback errored, ignoring",o);return}}invalidateCache(){this.cache=new WeakMap}};function setElementBBox(e,t){if(!e)return;const{x:n,y:r,width:i,height:o}=normalizeBounds(t);setPixelValue(e.style,"width",i),setPixelValue(e.style,"height",o),setPixelValue(e.style,"left",n),setPixelValue(e.style,"top",r)}function getElementBBox(e){const t=Number.parseFloat(e.style.width),n=Number.parseFloat(e.style.height),r=Number.parseFloat(e.style.left),i=Number.parseFloat(e.style.top),o=Number.isFinite(t)?t:e.offsetWidth,s=Number.isFinite(n)?n:e.offsetHeight,a=Number.isFinite(r)?r:e.offsetLeft,l=Number.isFinite(i)?i:e.offsetTop;return{x:a,y:l,width:o,height:s}}function focusCursorAtEnd(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=getDocument().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const n=getWindow().getSelection();n?.removeAllRanges(),n?.addRange(t)}function isInputPending(){const e=getWindow("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function getIconClassNames(e){return`ag-charts-icon ag-charts-icon-${e}`}function normalizeBounds(e){let{x:t,y:n,width:r,height:i}=e;return(r==null||r>0)&&(i==null||i>0)?e:(t!=null&&r!=null&&r<0&&(r=-r,t=t-r),n!=null&&i!=null&&i<0&&(i=-i,n=n-i),{x:t,y:n,width:r,height:i})}function setPixelValue(e,t,n){n==null?e.removeProperty(t):e.setProperty(t,`${n}px`)}function getMaxInnerRectSize(e,t,n=1/0){const r=t,i=n,o=e%180*(Math.PI/180),s=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o));if(s===0)return{width:r,height:i};if(a===0)return{width:i,height:r};if(!Number.isFinite(i)){const c=a/s,u=r/(a+c*s);return{width:u,height:c*u}}const l=a*a-s*s;if(l===0){const c=Math.min(r,i)/Math.SQRT2;return{width:c,height:c}}return{width:Math.abs((r*a-i*s)/l),height:Math.abs((i*a-r*s)/l)}}function getMinOuterRectSize(e,t,n=1/0){const r=t,i=n,o=e%180*(Math.PI/180),s=Math.abs(Math.sin(o)),a=Math.abs(Math.cos(o));return s===0?{width:r,height:i}:a===0?{width:i,height:r}:{width:r*a+i*s,height:r*s+i*a}}function rotatePoint(e,t,n,r=0,i=0){const o=Math.cos(n),s=Math.sin(n),a=e-r,l=t-i;return{x:r+a*o-l*s,y:i+a*s+l*o}}var twoPi=Math.PI*2,halfPi=Math.PI/2;function normalizeAngle360(e){return e%=twoPi,e+=twoPi,e%=twoPi,e}function normalizeAngle360Inclusive(e){return e%=twoPi,e+=twoPi,e!==twoPi&&(e%=twoPi),e}function normalizeAngle180(e){return e%=twoPi,e<-Math.PI?e+=twoPi:e>=Math.PI&&(e-=twoPi),e}function isBetweenAngles(e,t,n){const r=normalizeAngle360(e),i=normalizeAngle360(t),o=normalizeAngle360(n);return i<o?i<=r&&r<=o:i>o?i<=r||r<=o:t!==n}function toRadians(e){return e/180*Math.PI}function toDegrees(e){return e/Math.PI*180}function angleBetween(e,t){return e=normalizeAngle360(e),t=normalizeAngle360(t),t-e+(e>t?twoPi:0)}function getAngleRatioRadians(e){const t=normalizeAngle360(e);return t<=halfPi?t/halfPi:t<=Math.PI?(Math.PI-t)/halfPi:t<=1.5*Math.PI?(t-Math.PI)/halfPi:(twoPi-t)/halfPi}function angularPadding(e,t,n){const r=getAngleRatioRadians(n);return e*r+t*Math.abs(1-r)}function normalizeAngle360FromDegrees(e){return e?normalizeAngle360(toRadians(e)):0}var AsyncAwaitQueue=class{constructor(){this.queue=[]}waitForCompletion(e=50){const t=this.queue;function n(r){function i(){clearTimeout(s),r(!0)}function o(){const a=t.indexOf(i);a<0||(t.splice(a,1),r(!1))}const s=setTimeout(o,e);t.push(i)}return new Promise(n)}notify(){for(const e of this.queue.splice(0))e()}};function pause(e=0){function t(n){setTimeout(n,e)}return new Promise(t)}async function withTimeout(e,t,n=`Timeout after ${t}ms`){let r;const i=new Promise((o,s)=>{r=setTimeout(()=>s(new Error(n)),t)});try{return await Promise.race([e,i])}finally{clearTimeout(r)}}function booleanParser(e){return e==="true"}function numberParser(e){return Number(e)}function stringParser(e){return e}var AttributeTypeParsers={role:stringParser,"aria-checked":booleanParser,"aria-controls":stringParser,"aria-describedby":stringParser,"aria-disabled":booleanParser,"aria-expanded":booleanParser,"aria-haspopup":stringParser,"aria-hidden":booleanParser,"aria-label":stringParser,"aria-labelledby":stringParser,"aria-live":stringParser,"aria-orientation":stringParser,"aria-selected":booleanParser,"data-focus-override":booleanParser,"data-focus-visible-override":booleanParser,"data-preventdefault":booleanParser,class:stringParser,for:stringParser,id:stringParser,tabindex:numberParser,title:stringParser,placeholder:stringParser};function setAttribute(e,t,n){n==null||n===""||n===""?e?.removeAttribute(t):e?.setAttribute(t,n.toString())}function setAttributes(e,t){if(t!=null)for(const[n,r]of entries(t))n!=="class"&&setAttribute(e,n,r)}function getAttribute(e,t,n){if(!isHTMLElement(e))return;const r=e.getAttribute(t);return r===null?n:AttributeTypeParsers[t]?.(r)??void 0}function setElementStyle(e,t,n){e!=null&&(n==null?e.style.removeProperty(t):e.style.setProperty(t,n.toString()))}function setElementStyles(e,t){for(const[n,r]of entries(t))setElementStyle(e,n,r)}function ProxyProperty(e,t){const n=Array.isArray(e)?e:e.split(".");if(n.length===1){const[r]=n;return addTransformToInstanceProperty((i,o,s)=>i[r]=s,i=>i[r],t)}return addTransformToInstanceProperty((r,i,o)=>setPath(r,n,o),r=>getPath(r,n),t)}function ProxyOnWrite(e){return addTransformToInstanceProperty((t,n,r)=>t[e]=r)}function ProxyPropertyOnWrite(e,t){return addTransformToInstanceProperty((n,r,i)=>n[e][t??r]=i)}function ActionOnSet(e){const{newValue:t,oldValue:n,changeValue:r}=e;return addTransformToInstanceProperty((i,o,s,a)=>(s!==a&&(a!==void 0&&n?.call(i,a),s!==void 0&&t?.call(i,s),r?.call(i,s,a)),s))}function ObserveChanges(e){return addObserverToInstanceProperty(e)}var Border=class extends BaseProperties{constructor(e){super(),this.node=e,this.enabled=!1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=1}};__decorateClass([ActionOnSet({changeValue(e){e?this.node.strokeWidth=this.strokeWidth:this.node.strokeWidth=0}}),addFakeTransformToInstanceProperty],Border.prototype,"enabled",2),__decorateClass([ProxyPropertyOnWrite("node","stroke"),addFakeTransformToInstanceProperty],Border.prototype,"stroke",2),__decorateClass([ProxyPropertyOnWrite("node","strokeOpacity"),addFakeTransformToInstanceProperty],Border.prototype,"strokeOpacity",2),__decorateClass([ActionOnSet({changeValue(e){this.enabled?this.node.strokeWidth=e:this.node.strokeWidth=0}}),addFakeTransformToInstanceProperty],Border.prototype,"strokeWidth",2);function boxCollides(e,t,n,r,i){return t<e.x+e.width&&t+r>e.x&&n<e.y+e.height&&n+i>e.y}function boxContains(e,t,n,r=0,i=0){return t>=e.x&&t+r<=e.x+e.width&&n>=e.y&&n+i<=e.y+e.height}function boxEmpty(e){return e==null||e.height===0||e.width===0||Number.isNaN(e.height)||Number.isNaN(e.width)}function boxesEqual(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 findMaxIndex(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2);n(i)?(r=i,e=i+1):t=i-1}return r}function findMinIndex(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2);n(i)?(r=i,t=i-1):e=i+1}return r}function findMaxValue(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2),o=n(i);o==null?t=i-1:(r=o,e=i+1)}return r}function findMinValue(e,t,n){if(e>t)return;let r;for(;t>=e;){const i=Math.floor((t+e)/2),o=n(i);o==null?e=i+1:(r=o,t=i-1)}return r}function createCanvasContext(e=0,t=0){const n=getOffscreenCanvas();return new n(e,t).getContext("2d")}var CANVAS_WIDTH=800,CANVAS_HEIGHT=600,CANVAS_TO_BUFFER_DEFAULTS={quality:1};function ConfiguredCanvasMixin(e){const t=class extends e{constructor(...r){super(...r),this.gpu=!1}toBuffer(r,i){return super.toBuffer(r,{...i,msaa:!1})}transferToImageBitmap(){const{width:r,height:i}=this,o=new t(Math.max(1,r),Math.max(1,i));return r>0&&i>0&&o.getContext("2d").drawCanvas(this,0,0,r,i),Object.defineProperty(o,"close",{value:()=>{}}),o}};return t}var patchesApplied=!1;function applySkiaPatches(e,t){if(patchesApplied)return;patchesApplied=!0;const n=e.prototype.createConicGradient;Object.defineProperty(e.prototype,"createConicGradient",{value:function(r,i,o){return n.call(this,r+Math.PI/2,i,o)},writable:!0,configurable:!0}),Object.defineProperty(e.prototype,"fillText",{value:function(r,i,o){let s=this.outlineText(r);s=s.transform(new t([1,0,0,1,i,o])),this.fill(s)},writable:!0,configurable:!0})}var SimpleCache=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},WeakCache=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 compareDates(e,t){return e.valueOf()-t.valueOf()}function deduplicateSortedArray(e){let t=Number.NaN;const n=[];for(const r of e){const i=r.valueOf();t!==i&&n.push(r),t=i}return n}function sortAndUniqueDates(e){const t=e.slice().sort(compareDates);return datesSortOrder(t)==null?deduplicateSortedArray(t):t}function datesSortOrder(e){if(e.length===0)return 1;const t=Number(e.at(-1))>Number(e[0])?1:-1;let n=-1/0*t;for(const r of e){const i=r.valueOf();if(Math.sign(i-n)!==t)return;n=i}return t}function createDeprecationWarning(){return(e,t)=>{const n=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");warnOnce(n)}}function Deprecated(e,t){const n=createDeprecationWarning(),r=t?.default;return addTransformToInstanceProperty((i,o,s)=>(s!==r&&n(o.toString(),e),s))}function DeprecatedAndRenamedTo(e,t){const n=createDeprecationWarning();return addTransformToInstanceProperty((r,i,o)=>(o!==r[e]&&(n(i.toString(),`Use [${e}] instead.`),setPath(r,e,t?t(o):o)),BREAK_TRANSFORM_CHAIN),(r,i)=>(n(i.toString(),`Use [${e}] instead.`),getPath(r,e)))}function diffArrays(e,t){const n=Math.max(e.length,t.length),r=new Set,i=new Set;for(let o=0;o<n;o++){const s=e[o],a=t[o];s!==a&&(i.has(a)?i.delete(a):a&&r.add(a),r.has(s)?r.delete(s):s&&i.add(s))}return{changed:r.size>0||i.size>0,added:r,removed:i}}function pointsDistanceSquared(e,t,n,r){const i=e-n,o=t-r;return i*i+o*o}function lineDistanceSquared(e,t,n,r,i,o,s){if(n===i&&r===o)return Math.min(s,pointsDistanceSquared(e,t,n,r));const a=i-n,l=o-r,c=Math.max(0,Math.min(1,((e-n)*a+(t-r)*l)/(a*a+l*l))),u=n+c*a,f=r+c*l;return Math.min(s,pointsDistanceSquared(e,t,u,f))}function arcDistanceSquared(e,t,n,r,i,o,s,a,l){a&&([s,o]=[o,s]);const c=Math.atan2(t-r,e-n);if(!isBetweenAngles(c,o,s)){const f=n+Math.cos(o)*i,h=r+Math.sin(o)*i,d=n+Math.cos(o)*i,g=r+Math.sin(o)*i;return Math.min(l,pointsDistanceSquared(e,t,f,h),pointsDistanceSquared(e,t,d,g))}const u=i-Math.sqrt(pointsDistanceSquared(e,t,n,r));return Math.min(l,u*u)}function extent(e,t){if(e.length===0)return null;if(t!==void 0){const o=e.at(0),s=e.at(-1),a=o instanceof Date?o.getTime():o,l=s instanceof Date?s.getTime():s;if(typeof a=="number"&&typeof l=="number")return t===1?[a,l]:[l,a]}let n=1/0,r=-1/0;for(const o of e){const s=o instanceof Date?o.getTime():o;typeof s=="number"&&(s<n&&(n=s),s>r&&(r=s))}const i=[n,r];return i.every(Number.isFinite)?i:null}function normalisedExtentWithMetadata(e,t,n,r,i,o,s){let a=!1;const l=extent(e,s),c=l&&o?[o(l[0]),o(l[1])]:l;if(c==null){let h;return t!=null&&n!=null&&t<=n?h=[t,n]:r!=null&&i!=null&&r<=i&&(h=[r,i]),{extent:h??[],clipped:!1}}let[u,f]=c;return t!=null?(a||(a=t>u),u=t):r!=null&&r<u&&(u=r),n!=null?(a||(a=n<f),f=n):i!=null&&i>f&&(f=i),u>f?{extent:[],clipped:!1}:{extent:[u,f],clipped:a}}function normalisedTimeExtentWithMetadata(e,t,n,r,i){const{extent:o,clipped:s}=normalisedExtentWithMetadata(e.domain,isNumber(t)?new Date(t):t,isNumber(n)?new Date(n):n,isNumber(r)?new Date(r):r,isNumber(i)?new Date(i):i,a=>new Date(a),e.sortMetadata?.sortOrder);return{extent:o.map(a=>new Date(a)),clipped:s}}var percentFormatter=new Intl.NumberFormat("en-US",{style:"percent"});function formatValue(e,t=2){return typeof e=="number"?formatNumber(e,t):typeof e=="string"?e:String(e??"")}function formatPercent(e){return percentFormatter.format(e)}var numberFormatters=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function formatNumber(e,t){let n=numberFormatters.get(t);return n||(n=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),numberFormatters.set(t,n)),n.format(e)}function isValidCoordinate(e){return Array.isArray(e)&&e.length>=2&&e.every(isFiniteNumber)}function isValidCoordinates(e){return Array.isArray(e)&&e.length>=2&&e.every(isValidCoordinate)}function hasSameStartEndPoint(e){const t=e[0],n=e.at(-1);return n===void 0?!1:isNumberEqual(t[0],n[0],.001)&&isNumberEqual(t[1],n[1],.001)}function isValidPolygon(e){return Array.isArray(e)&&e.every(isValidCoordinates)&&e.every(hasSameStartEndPoint)}function isValidGeometry(e){if(e===null)return!0;if(!isObject(e)||e.type==null)return!1;const{type:t,coordinates:n}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(isValidGeometry);case"MultiPolygon":return Array.isArray(n)&&n.every(isValidPolygon);case"Polygon":return isValidPolygon(n);case"MultiLineString":return Array.isArray(n)&&n.every(isValidCoordinates);case"LineString":return isValidCoordinates(n);case"MultiPoint":return isValidCoordinates(n);case"Point":return isValidCoordinate(n);default:return!1}}function isValidFeature(e){return isObject(e)&&e.type==="Feature"&&isValidGeometry(e.geometry)}function isValidFeatureCollection(e){return isObject(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(isValidFeature)}var geoJson=attachDescription(isValidFeatureCollection,"a GeoJSON object"),AdjacencyListGraph=class{constructor(e,t,n){this._vertexCount=0,this._edgeCount=0,this.pendingProcessingEdgesFrom=[],this.pendingProcessingEdgesTo=[],this.cachedNeighboursEdge=e,this.processedEdge=t,this.singleValueEdges=n}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 Vertex(e);return this._vertexCount++,t}addEdge(e,t,n){n===this.cachedNeighboursEdge?e.updateCachedNeighbours().set(t.value,t):n===this.processedEdge&&(this.pendingProcessingEdgesFrom.push(e),this.pendingProcessingEdgesTo.push(t));const{edges:r}=e,i=r.get(n);i?i.includes(t)||(this.singleValueEdges?.has(n)?r.set(n,[t]):(i.push(t),this._edgeCount++)):(r.set(n,[t]),this._edgeCount++)}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[,n]of t)this._vertexCount-=n.length;e.clear()}}removeEdge(e,t,n){const r=e.edges.get(n);if(!r)return;const i=r.indexOf(t);i!==-1&&(r.splice(i,1),r.length===0&&e.edges.delete(n),this._edgeCount--,n===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 n of t)yield n}*neighboursAndEdges(e){for(const[t,n]of e.edges)for(const r of n)yield[r,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const n=this.findNeighbour(e,t);if(n)return this.getVertexValue(n)}findNeighbourWithValue(e,t,n){const r=n==null?this.neighbours(e):this.neighboursWithEdgeValue(e,n);if(r){for(const i of r)if(this.getVertexValue(i)===t)return i}}findVertexAlongEdge(e,t,n){if(n===this.cachedNeighboursEdge){let i;for(const o of t)if(i=(i??e).readCachedNeighbours()?.get(o),!i)return;return i}if(t.length===0)return;let r=e;for(const i of t){const o=r?this.neighboursWithEdgeValue(r,n):void 0;if(!o)return;r=o.find(s=>s.value===i)}return r}adjacent(e,t){for(const[,n]of e.edges)if(n.includes(t))return!0;return!1}},Vertex=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()}},CLASS_INSTANCE_TYPE="class-instance";function jsonDiff(e,t,n){if(isArray(t)){if(!isArray(e)||e.length!==t.length||t.some((r,i)=>jsonDiff(e[i],r,n)!=null))return t}else if(isPlainObject(t)){if(!isPlainObject(e))return t;const r={},i=new Set([...Object.keys(e),...Object.keys(t)]);for(const o of i)if(e[o]!==t[o])if(n?.has(o))r[o]=t[o];else if(typeof e[o]==typeof t[o]){const s=jsonDiff(e[o],t[o],n);s!==null&&(r[o]=s)}else r[o]=t[o];return Object.keys(r).length?r:null}else if(e!==t)return t;return null}function jsonPropertyCompare(e,t){for(const n of Object.keys(e))if(e[n]!==t?.[n])return!1;return!0}function deepClone(e,t){return isArray(e)?cloneArray(e,t):isPlainObject(e)?clonePlainObject(e,t):e instanceof Map?new Map(deepClone(Array.from(e))):shallowClone(e)}function cloneArray(e,t){const n=[],r=t?.seen;for(const i of e){if(typeof i=="object"&&r?.includes(i)){warn("cycle detected in array",i);continue}r?.push(i),n.push(deepClone(i,t)),r?.pop()}return n}function clonePlainObject(e,t){const n={};for(const r of Object.keys(e))t?.assign?.has(r)?n[r]=e[r]:t?.shallow?.has(r)?n[r]=shallowClone(e[r]):n[r]=deepClone(e[r],t);return n}function shallowClone(e){return isArray(e)?e.slice(0):isPlainObject(e)?{...e}:isDate(e)?new Date(e):isRegExp(e)?new RegExp(e.source,e.flags):e}function jsonWalk(e,t,n,r,i,o){if(isArray(e)){o=t(e,r,i,o);let s=0;for(const a of e)o=jsonWalk(a,t,n,r?.[s],i,o),s++}else if(isPlainObject(e)){o=t(e,r,i,o);for(const s of Object.keys(e)){if(n?.has(s))continue;const a=e[s];o=jsonWalk(a,t,n,r?.[s],i,o)}}return o}function jsonApply(e,t,n={}){const{path:r,matcherPath:i=r?.replace(/(\[[0-9+]+])/i,"[]"),skip:o=[]}=n;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${r??"<root>"}`);if(t==null)return e;if(isProperties(e))return e.set(t);const s=e,a=classify(e);for(const l of Object.keys(t)){if(SKIP_JS_BUILTINS.has(l))continue;const c=`${i?i+".":""}${l}`;if(o.includes(c))continue;const u=t[l],f=`${r?r+".":""}${l}`,h=s.constructor,d=s[l];try{const g=classify(d),p=classify(u);if(a===CLASS_INSTANCE_TYPE&&!(l in e||l==="context")){if(u===void 0)continue;warn(`unable to set [${f}] in ${h?.name} - property is unknown`);continue}if(g!=null&&p!=null&&p!==g&&(g!==CLASS_INSTANCE_TYPE||p!=="object")){warn(`unable to set [${f}] in ${h?.name} - can't apply type of [${p}], allowed types are: [${g}]`);continue}if(isProperties(d))u===void 0?d.clear():d.set(u);else if(p==="object"&&l!=="context"){if(!(l in s)){warn(`unable to set [${f}] in ${h?.name} - property is unknown`);continue}d==null?s[l]=u:jsonApply(d,u,{...n,path:f,matcherPath:c})}else s[l]=u}catch(g){warn(`unable to set [${f}] in [${h?.name}]; nested error is: ${g.message}`)}}return e}function classify(e){return e==null?null:isHtmlElement(e)||isDate(e)?"primitive":isArray(e)?"array":isObject(e)?isPlainObject(e)?"object":CLASS_INSTANCE_TYPE:isFunction(e)?"function":"primitive"}function attachListener(e,t,n,r){return e.addEventListener(t,n,r),()=>e.removeEventListener(t,n,r)}function addEscapeEventListener(e,t,n=["Escape"]){return attachListener(e,"keydown",r=>{matchesKey(r,...n)&&t(r)})}function addMouseCloseListener(e,t){const n=attachListener(getWindow(),"mousedown",r=>{[0,2].includes(r.button)&&!containsEvent(e,r)&&(t(),n())});return n}function addTouchCloseListener(e,t){const n=attachListener(getWindow(),"touchstart",r=>{Array.from(r.targetTouches).some(o=>!containsEvent(e,o))&&(t(),n())});return n}function containsEvent(e,t){return isElement(t.target)&&t.target.shadowRoot!=null?!0:isNode(t.target)&&e.contains(t.target)}function addOverrideFocusVisibleEventListener(e,t,n){const r=i=>{for(const o of t)setAttribute(o,"data-focus-visible-override",i)};return r(n),attachListener(e,"keydown",()=>r(!0),{once:!0})}function hasNoModifiers(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function matchesKey(e,...t){return hasNoModifiers(e)&&t.includes(e.key)}function linkTwoButtons(e,t,n){return attachListener(e,"keydown",r=>{matchesKey(r,n)&&t.focus()})}var PREV_NEXT_KEYS={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function initRovingTabIndex(e){const{orientation:t,buttons:n,wrapAround:r=!1,onEscape:i,onFocus:o,onBlur:s}=e,{nextKey:a,prevKey:l}=PREV_NEXT_KEYS[t],c=d=>{if(d.target&&"tabIndex"in d.target){for(const g of n)g.tabIndex=-1;d.target.tabIndex=0}},[u,f]=r?[n.length,n.length]:[0,1/0],h=new CleanupRegistry;for(let d=0;d<n.length;d++){const g=n[(u+d-1)%f],p=n[d],y=n[(u+d+1)%f];h.register(attachListener(p,"focus",c),o&&attachListener(p,"focus",o),s&&attachListener(p,"blur",s),i&&addEscapeEventListener(p,i),g&&linkTwoButtons(p,g,l),y&&linkTwoButtons(p,y,a),attachListener(p,"keydown",m=>{matchesKey(m,a,l)&&m.preventDefault()})),p.tabIndex=d===0?0:-1}return h}function makeAccessibleClickListener(e,t){return n=>{if(e.ariaDisabled==="true")return n.preventDefault();t(n)}}function isButtonClickEvent(e){return"button"in e?e.button===0:hasNoModifiers(e)&&(e.code==="Space"||e.key==="Enter")}function getLastFocus(e){const t=e?.target;if(isElement(t)&&"tabindex"in t.attributes)return t}function stopPageScrolling(e){return attachListener(e,"keydown",t=>{if(t.defaultPrevented)return;getAttribute(t.target,"data-preventdefault",!0)&&matchesKey(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var ID_MAP=new Map,nextElementID=1;function resetIds(){ID_MAP.clear(),nextElementID=1}function createId(e){const t=e.constructor;let n=Object.hasOwn(t,"className")?t.className:t.name;inDevelopmentMode(()=>{if(!n)throw new Error(`The ${String(t)} is missing the 'className' property.`)}),n??(n="Unknown");const r=(ID_MAP.get(n)??0)+1;return ID_MAP.set(n,r),`${n}-${r}`}function createElementId(){return`ag-charts-${nextElementID++}`}function generateUUID(){return crypto.randomUUID?.()??generateUUIDv4()}function generateUUIDv4(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let n=0;n<e.length;n++)(n===4||n===6||n===8||n===10)&&(t+="-"),t+=e[n].toString(16).padStart(2,"0");return t}function insertListItemsSorted(e,t,n){let r=e,i=r;for(const o of t)if(r==null||n(r.value,o)>0)r={value:o,next:r},i=r;else{for(i=i;i.next!=null&&n(i.next.value,o)<=0;)i=i.next;i.next={value:o,next:i.next}}return r}var memorizedFns=new WeakMap;function memo(e,t){const n=JSON.stringify(e,null,0);return memorizedFns.has(t)||memorizedFns.set(t,new Map),memorizedFns.get(t)?.has(n)||memorizedFns.get(t)?.set(n,t(e)),memorizedFns.get(t)?.get(n)}var MemoizeNode=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function simpleMemorize2(e,t){let n=new MemoizeNode;const r=(...i)=>{let o=n;for(const s of i){const a=typeof s=="object"||typeof s=="symbol"?o.weak:o.strong;let l=a.get(s);l==null&&(l=new MemoizeNode,a.set(s,l)),o=l}if(o.set)return t?.("hit",e,i),o.value;{const s=e(...i);return o.set=!0,o.value=s,t?.("miss",e,i),s}};return r.reset=()=>{n=new MemoizeNode},r}function simpleMemorize(e,t){const n=new Map,r=(...s)=>s.map(a=>typeof a=="object"||typeof a=="symbol"?a:(n.has(a)||n.set(a,{v:a}),n.get(a))),i={},o=new WeakMap;return(...s)=>{const a=s.length===0?[i]:r(...s);let l=o;for(const f of a.slice(0,-1))l.has(f)||l.set(f,new WeakMap),l=l.get(f);const c=a.at(-1);let u=l.get(c);return u?t?.("hit",e,s):(u=e(...s),l.set(c,u),t?.("miss",e,s)),u}}function nearestSquared(e,t,n,r=1/0){const i={nearest:void 0,distanceSquared:r};for(const o of n){const s=o.distanceSquared(e,t);if(s===0)return{nearest:o,distanceSquared:0};s<i.distanceSquared&&(i.nearest=o,i.distanceSquared=s)}return i}function nearestSquaredInContainer(e,t,n,r=1/0){const{x:i=e,y:o=t}=n.transformPoint?.(e,t)??{},s={nearest:void 0,distanceSquared:r};for(const a of n.children){const{nearest:l,distanceSquared:c}=a.nearestSquared(i,o,s.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<s.distanceSquared&&(s.nearest=l,s.distanceSquared=c)}return s}var Padding=class extends BaseProperties{constructor(e=0,t=e,n=e,r=t){super(),this.top=e,this.right=t,this.bottom=n,this.left=r}};__decorateClass([addFakeTransformToInstanceProperty],Padding.prototype,"top",2),__decorateClass([addFakeTransformToInstanceProperty],Padding.prototype,"right",2),__decorateClass([addFakeTransformToInstanceProperty],Padding.prototype,"bottom",2),__decorateClass([addFakeTransformToInstanceProperty],Padding.prototype,"left",2);function calculatePlacement(e,t,n,r){let{top:i,right:o,bottom:s,left:a,width:l,height:c}=r;return a!=null?l!=null?o=n.width-a+l:o!=null&&(l=n.width-a-o):o!=null&&l!=null&&(a=n.width-o-l),i!=null?c!=null?s=n.height-i-c:s!=null&&(c=n.height-s-i):s!=null&&c!=null&&(i=n.height-s-c),l==null?c==null?(c=t,l=e):l=Math.ceil(e*c/t):c??(c=Math.ceil(t*l/e)),a==null&&(o==null?a=Math.floor((n.width-l)/2):a=n.width-o-l),i==null&&(s==null?i=Math.floor((n.height-c)/2):i=n.height-c-s),{x:a,y:i,width:l,height:c}}var debugColor="color: green",debugQuietColor="color: grey";function StateMachineProperty(){return addObserverToInstanceProperty(()=>{})}function applyProperties(e,t){const n=listDecoratedProperties(t);if(n.length===0)return;const r=extractDecoratedProperties(e);for(const i of n)i in r&&(t[i]=r[i])}var AbstractStateMachine=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},_StateMachine=class I extends AbstractStateMachine{constructor(t,n,r){super(),this.defaultState=t,this.states=n,this.enterEach=r,this.debug=create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,debugColor)}transition(t,n){if(!this.transitionChild(t,n)||this.state===I.child||this.state===I.parent)return;const i=this.state,o=this.states[this.state];let s=o[t];const a=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(s))s=s.find(u=>{if(!u.guard)return!0;const f=u.guard(n);return f||this.debug(`${a} (guarded)`,u.target,debugQuietColor),f});else if(typeof s=="object"&&!(s instanceof I)&&s.guard&&!s.guard(n)){this.debug(`${a} (guarded)`,s.target,debugQuietColor);return}if(!s){this.debug(`${a} ${this.state}`,debugQuietColor);return}const l=this.getDestinationState(s),c=l===this.state?void 0:o.onExit;this.debug(`${a} ${l}`,debugColor),this.state=l,typeof s=="function"?s(n):typeof s=="object"&&!(s instanceof I)&&s.action?.(n),c?.(),this.enterEach?.(i,l),l!==i&&l!==I.child&&l!==I.parent&&this.states[l].onEnter?.(i,n)}transitionAsync(t,n){setTimeout(()=>{this.transition(t,n)},0)}is(t){return this.state===I.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,n){return this.state!==I.child||!this.childState||(applyProperties(this,this.childState),this.childState.transition(t,n),!this.childState.is(I.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,debugColor),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let n=this.state;return typeof t=="string"?n=t:t instanceof I?(this.childState=t,this.childState.parent=this,n=I.child):typeof t=="object"&&(t.target instanceof I?(this.childState=t.target,this.childState.parent=this,n=I.child):t.target!=null&&(n=t.target)),n}};_StateMachine.child="__child",_StateMachine.parent="__parent";var StateMachine=_StateMachine,ParallelStateMachine=class extends AbstractStateMachine{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const n of this.stateMachines)applyProperties(this,n),n.transition(e,t)}transitionAsync(e,t){for(const n of this.stateMachines)applyProperties(this,n),n.transitionAsync(e,t)}},TextMeasurer=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:n,fontBoundingBoxAscent:r=t.emHeightAscent,fontBoundingBoxDescent:i=t.emHeightDescent}=t,o=r+i;return{width:n,height:o,ascent:r,descent:i}}measureLines(e){const t=typeof e=="string"?e.split(LineSplitter):e;let n=0,r=0;const i=t.map(o=>{const s=this.measureText(o);return n<s.width&&(n=s.width),r+=s.height,{text:o,...s}});return{width:n,height:r,lineMetrics:i}}textWidth(e,t){if(t){let n=0;for(let r=0;r<e.length;r++)n+=this.textWidth(e.charAt(r));return n}return e.length>1?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}},instanceMap=new LRUCache(50);function cachedTextMeasurer(e){typeof e=="object"&&(e=toFontString(e));let t=instanceMap.get(e);if(t)return t;const n=new LRUCache(1e4),r=createCanvasContext();return r.font=e,t=new TextMeasurer(r,i=>{let o=n.get(i);return o||(o=r.measureText(i),n.set(i,o),o)}),instanceMap.set(e,t),t}cachedTextMeasurer.clear=()=>instanceMap.clear();function measureTextSegments(e,t){let n={segments:[],width:0,height:0,ascent:0,descent:0};const r=[n];for(const s of e){const{text:a,fontSize:l=t.fontSize,fontStyle:c=t.fontStyle,fontWeight:u=t.fontWeight,fontFamily:f=t.fontFamily,...h}=s,d={fontSize:l,fontStyle:c,fontWeight:u,fontFamily:f},g=cachedTextMeasurer(d),p=toTextString(a).split(LineSplitter);for(let y=0;y<p.length;y++){const m=p[y],b=g.measureText(m);y>0&&(n={segments:[],width:0,height:0,ascent:0,descent:0},r.push(n)),m&&(n.width+=b.width,n.ascent=Math.max(n.ascent,b.ascent),n.descent=Math.max(n.descent,b.descent),n.height=Math.max(n.height,n.ascent+n.descent),n.segments.push({...d,...h,text:m,textMetrics:b}))}}let i=0,o=0;for(const s of r)i=Math.max(i,s.width),o+=s.height;return{width:i,height:o,lineMetrics:r}}function createElement(e,t,n){const r=getDocument().createElement(e);if(typeof t=="object"&&(n=t,t=void 0),t)for(const i of t.split(" "))r.classList.add(i);return n&&Object.assign(r.style,n),r}function createSvgElement(e){return getDocument().createElementNS("http://www.w3.org/2000/svg",e)}function downloadUrl(e,t){const n=getDocument("body"),r=createElement("a",{display:"none"});r.href=e,r.download=t,n.appendChild(r),r.click(),setTimeout(()=>r.remove())}function shouldHideOverflow(e,t){return t.overflow==="hide"&&e.some(isTextTruncated)}function wrapTextOrSegments(e,t){return isArray(e)?wrapTextSegments(e,t):wrapLines(toTextString(e),t).join(`
|
|
`)}function wrapText(e,t){return wrapLines(e,t).join(`
|
|
`)}function wrapLines(e,t){return textWrap(e,t)}function truncateLine(e,t,n,r){const i=t.textWidth(EllipsisChar);let o=0,s=0;for(;s<e.length;s++){const a=t.textWidth(e.charAt(s));if(o+a>n)break;o+=a}if(e.length===s&&(!r||o+i<=n))return r?appendEllipsis(e):e;for(e=e.slice(0,s).trimEnd();e.length&&t.textWidth(e)+i>n;)e=e.slice(0,-1).trimEnd();return appendEllipsis(e)}function textWrap(e,t,n=0){const r=e.split(LineSplitter),i=cachedTextMeasurer(t.font),o=[];if(t.textWrap==="never"){for(const c of r){const u=truncateLine(c.trimEnd(),i,Math.max(0,t.maxWidth-n));if(!u)break;o.push(u),n=0}return shouldHideOverflow(o,t)?[]:o}const s=t.textWrap==="hyphenate",a=t.textWrap==null||t.textWrap==="on-space";for(const c of r){let u=c.trimEnd();if(u===""){o.push(u);continue}let f=0,h=0,d=0;for(o.length||(h=n);f<u.length;){const g=u.charAt(f);if(g===" "&&(d=f),h+=i.textWidth(g),h>t.maxWidth){if(f===0){u="";break}let p=i.textWidth(u.slice(0,f+1));if(o.length||(p+=n),p<=t.maxWidth){h=p,f++;continue}if(d){const b=getWordAt(u,d+1),E=i.textWidth(b);if(E<=t.maxWidth){o.push(u.slice(0,d).trimEnd()),u=u.slice(d).trimStart(),f=0,h=0,d=0;continue}else a&&E>t.maxWidth&&o.push(u.slice(0,d).trimEnd(),truncateLine(u.slice(d).trimStart(),i,t.maxWidth,!0))}else if(a){const b=truncateLine(u,i,t.maxWidth,!0);b&&o.push(b)}if(a){u="";break}const y=s?"-":"";let m=u.slice(0,f).trim();for(;m.length&&i.textWidth(m+y)>t.maxWidth;)m=m.slice(0,-1).trimEnd();if(m&&m!==TrimEdgeGuard)o.push(m+y);else{u="";break}u=u.slice(m.length).trimStart(),f=-1,h=0,d=0}f++}u&&o.push(u)}avoidOrphans(o,i,t);const l=clipLines(o,i,t);return shouldHideOverflow(l,t)?[]:l}function getWordAt(e,t){const n=e.indexOf(" ",t);return n===-1?e.slice(t):e.slice(t,n)}function clipLines(e,t,n){if(!isFiniteNumber(n.maxHeight))return e;const{height:r,lineMetrics:i}=t.measureLines(e);if(r<=n.maxHeight)return e;for(let o=0,s=0;o<i.length;o++)if(s+=i[o].height,s>n.maxHeight){if(n.overflow==="hide"||o===0)return[];const a=e.slice(0,o),l=a.pop();return a.concat(isTextTruncated(l)?l:truncateLine(l,t,n.maxWidth,!0))}return e}function avoidOrphans(e,t,n){if(n.avoidOrphans===!1||e.length<2)return;const{length:r}=e,i=e[r-1],o=e[r-2];if(o.length<i.length)return;const s=o.lastIndexOf(" ");if(s===-1||s===o.indexOf(" ")||i.includes(" "))return;const a=o.slice(s+1);t.textWidth(i+a)<=n.maxWidth&&(e[r-2]=o.slice(0,s),e[r-1]=a+" "+i)}function wrapTextSegments(e,t){const{maxHeight:n=1/0}=t,r=[];let i=0,o=0;function s(){const a=r.pop();if(!a)return;const l=cachedTextMeasurer(a),c=truncateLine(a.text,l,t.maxWidth,!0),u=l.measureText(c);r.push({...a,text:c,textMetrics:u})}for(const{width:a,height:l,segments:c}of measureTextSegments(e,t.font).lineMetrics){if(o+l>n){r.length&&s();break}if(i+a<=t.maxWidth){i+=a,o+=l,r.push(...c);continue}for(const u of c){if(i+u.textMetrics.width<=t.maxWidth){i+=u.textMetrics.width,r.push(u);continue}const f=cachedTextMeasurer(u),h=guardTextEdges(u.text),d={...t,font:u,maxHeight:n-o};let g=textWrap(h,{...d,overflow:"hide"},i);if(g.length===0)if(t.textWrap==="never")g=textWrap(h,d,i);else{g=textWrap(h,d);const m=r.at(-1);m&&(m.text+=`
|
|
`,i=0)}if(g.length===0){s();break}const p=g.findIndex(isTextTruncated);p!==-1&&(g=g.slice(0,p+1));const y=g.at(-1);for(const m of g){const b=unguardTextEdges(m),E=f.measureText(b),v={...u,text:b,textMetrics:E};m===y?i+=E.width:(v.text+=`
|
|
`,i=0),o+=E.height,r.push(v)}if(p!==-1)break}}return r}function rescaleVisibleRange(e,[t,n],[r,i]){const o=i-r,s=n-t,a=t+s*e[0],l=t+s*e[1];return[(a-r)/o,(l-r)/o]}var durationSecond=1e3,durationMinute=durationSecond*60,durationHour=durationMinute*60,durationDay=durationHour*24,durationWeek=durationDay*7,durationMonth=durationDay*30,durationYear=durationDay*365,tzOffset=new Date().getTimezoneOffset()*durationMinute,unitEncoding={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:durationSecond,hierarchy:"day",encode(e,t){const n=t?0:tzOffset;return Math.floor((e.getTime()-n)/durationSecond)},decode(e,t){const n=t?0:tzOffset;return new Date(n+e*durationSecond)}},minute:{milliseconds:durationMinute,hierarchy:"day",encode(e,t){const n=t?0:tzOffset;return Math.floor((e.getTime()-n)/durationMinute)},decode(e,t){const n=t?0:tzOffset;return new Date(n+e*durationMinute)}},hour:{milliseconds:durationHour,hierarchy:"day",encode(e,t){const n=t?0:tzOffset;return Math.floor((e.getTime()-n)/durationHour)},decode(e,t){const n=t?0:tzOffset;return new Date(n+e*durationHour)}},day:{milliseconds:durationDay,hierarchy:"month",encode(e,t){const n=t?0:e.getTimezoneOffset()*durationMinute;return Math.floor((e.getTime()-n)/durationDay)},decode(e,t){let n;return t?(n=new Date(0),n.setUTCDate(n.getUTCDate()+e),n.setUTCHours(0,0,0,0)):(n=new Date(1970,0,1),n.setDate(n.getDate()+e)),n}},month:{milliseconds:durationMonth,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const n=Math.floor(e/12),r=e-n*12;return new Date(Date.UTC(n,r,1))}else{const n=Math.floor(e/12),r=e-n*12;return new Date(n,r,1)}}},year:{milliseconds:durationYear,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){let n;return t?(n=new Date,n.setUTCFullYear(e),n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)):n=new Date(e,0,1,0,0,0,0),n}}};function timeInterval(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 getOffset(e,t,n,r){if(n==null)return 0;const i=unitEncoding[e];return Math.floor(i.encode(new Date(n),r))%t}function encode(e,t,n,r,i){const o=unitEncoding[t];return Math.floor((o.encode(new Date(e),r)-i)/n)}function decode(e,t,n,r,i){return unitEncoding[t].decode(e*n+i,r)}function encodingFloor(e,t,n,r,i){const o=new Date(e),s=encode(o,t,n,r,i);return decode(s,t,n,r,i)}function encodingCeil(e,t,n,r,i){const o=new Date(Number(e)-1),s=encode(o,t,n,r,i);return decode(s+1,t,n,r,i)}function intervalFloor(e,t){const{unit:n,step:r,epoch:i,utc:o}=timeInterval(e),s=getOffset(n,r,i,o);return encodingFloor(t,n,r,o,s)}function intervalCeil(e,t){const{unit:n,step:r,epoch:i,utc:o}=timeInterval(e),s=getOffset(n,r,i,o);return encodingCeil(t,n,r,o,s)}function intervalPrevious(e,t){const{unit:n,step:r,epoch:i,utc:o}=timeInterval(e),s=getOffset(n,r,i,o);return decode(encode(encodingCeil(t,n,r,o,s),n,r,o,s)-1,n,r,o,s)}function intervalNext(e,t){const{unit:n,step:r,epoch:i,utc:o}=timeInterval(e),s=getOffset(n,r,i,o);return decode(encode(encodingFloor(t,n,r,o,s),n,r,o,s)+1,n,r,o,s)}function intervalExtent(e,t,n){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],n!=null&&(n=[1-n[1],1-n[0]])),n!=null){const r=t.valueOf()-e.valueOf(),i=e.valueOf();e=new Date(i+n[0]*r),t=new Date(i+n[1]*r)}return[new Date(e),new Date(t)]}function rangeData(e,t,n,{extend:r=!1,visibleRange:i=[0,1],limit:o,defaultAlignment:s="start"}={}){const a=timeInterval(e),{unit:l,step:c,utc:u}=a;let f;a.epoch!=null?f=a.epoch:s==="interval"?f=void 0:t.valueOf()>n.valueOf()?f=n:f=t;const h=getOffset(a.unit,a.step,f,a.utc);let[d,g]=intervalExtent(t,n,i);d=r?encodingFloor(d,l,c,u,h):encodingCeil(d,l,c,u,h),g=r?encodingCeil(g,l,c,u,h):encodingFloor(g,l,c,u,h);const p=encode(d,l,c,u,h);let y=encode(g,l,c,u,h);return o!=null&&y-p>o&&(y=p+o),{range:[p,y],unit:l,step:c,utc:u,offset:h}}function intervalRangeCount(e,t,n,r){const{range:[i,o]}=rangeData(e,t,n,r);return Math.abs(o-i)}function intervalRange(e,t,n,r){const{range:[i,o],unit:s,step:a,utc:l,offset:c}=rangeData(e,t,n,r),u=[];for(let f=i;f<=o;f+=1){const h=decode(f,s,a,l,c);u.push(h)}return u}function intervalRangeNumeric(e,t,n,r){const{range:[i,o],unit:s,step:a,utc:l,offset:c}=rangeData(e,t,n,r),u=Math.max(0,o-i+1),f=new Array(u);for(let h=0;h<u;h++)f[h]=i+h;return{encodedValues:f,encodingParams:{unit:s,step:a,utc:l,offset:c}}}function decodeIntervalValue(e,t){return decode(e,t.unit,t.step,t.utc,t.offset)}var tzOffsetMs=new Date().getTimezoneOffset()*6e4,DURATION_SECOND=1e3,DURATION_MINUTE=6e4,DURATION_HOUR=36e5;function encodedToTimestamp(e,t){const{unit:n,step:r,utc:i,offset:o}=t,s=e*r+o;switch(n){case"millisecond":return s;case"second":return(i?0:tzOffsetMs)+s*DURATION_SECOND;case"minute":return(i?0:tzOffsetMs)+s*DURATION_MINUTE;case"hour":return(i?0:tzOffsetMs)+s*DURATION_HOUR;default:return unitEncoding[n].decode(s,i).valueOf()}}function intervalRangeStartIndex(e,t,n,{extend:r,visibleRange:i,limit:o,defaultAlignment:s}={}){const{range:[a]}=rangeData(e,t,n,{extend:r,visibleRange:i,limit:o,defaultAlignment:s}),{range:[l]}=rangeData(e,t,n,{extend:r,limit:o,defaultAlignment:s});return a-l}function intervalUnit(e){return typeof e=="string"?e:e.unit}function intervalStep(e){return typeof e=="string"?1:e.step??1}function intervalEpoch(e){return typeof e=="string"?void 0:e.epoch}function intervalHierarchy(e){return unitEncoding[intervalUnit(e)].hierarchy}function intervalMilliseconds(e){return intervalStep(e)*unitEncoding[intervalUnit(e)].milliseconds}var tInterval=(e,t)=>({duration:intervalMilliseconds(e)*t,timeInterval:e,step:t}),TickIntervals=[tInterval({unit:"second"},1),tInterval({unit:"second"},5),tInterval({unit:"second"},15),tInterval({unit:"second"},30),tInterval({unit:"minute"},1),tInterval({unit:"minute"},5),tInterval({unit:"minute"},15),tInterval({unit:"minute"},30),tInterval({unit:"hour"},1),tInterval({unit:"hour"},3),tInterval({unit:"hour"},6),tInterval({unit:"hour"},12),tInterval({unit:"day"},1),tInterval({unit:"day"},2),tInterval({unit:"day",step:7},1),tInterval({unit:"day",step:7},2),tInterval({unit:"day",step:7},3),tInterval({unit:"month"},1),tInterval({unit:"month"},2),tInterval({unit:"month"},3),tInterval({unit:"month"},4),tInterval({unit:"month"},6),tInterval({unit:"year"},1)],TickMultipliers=[1,2,5,10];function isCloseToInteger(e,t){return Math.abs(Math.round(e)-e)<t}function countTicks(e,t,n){return Math.abs(t-e)>=n?Math.abs(t-e)/n+1:1}function createTicks(e,t,n,r,i,o){if(e===t)return{ticks:[e],count:1,firstTickIndex:0};if(n<2)return{ticks:[e,t],count:2,firstTickIndex:0};const s=tickStep(e,t,n,r,i);if(!Number.isFinite(s))return{ticks:[],count:0,firstTickIndex:void 0};let a=e,l=t;isCloseToInteger(a/s,1e-12)||(a=Math.ceil(a/s)*s),isCloseToInteger(l/s,1e-12)||(l=Math.floor(l/s)*s),o!=null&&(o=rescaleVisibleRange(o,[e,t],[a,l]));const{ticks:c}=range(a,l,s,o),u=c.at(0);return{ticks:c,count:countTicks(a,l,s),firstTickIndex:u==null?void 0:Math.round((u-a)/s)}}var minPrimaryTickRatio=Math.floor(2*durationWeek/durationMonth*10)/10;function isPrimaryTickInterval({timeInterval:e,step:t}){const n=intervalMilliseconds(e)*t,r=intervalHierarchy(e),i=r?intervalMilliseconds(r):void 0;return n<=(i??1/0)*minPrimaryTickRatio}function defaultEpoch(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function getTickTimeInterval(e,t,n,r,i,{weekStart:o,primaryOnly:s=!1,targetInterval:a}){if(n<=0)return;const l=a??Math.abs(t-e)/Math.max(n,1),c=TickIntervals.findLast(d=>(!s||isPrimaryTickInterval(d))&&l>d.duration),u=TickIntervals.find(d=>(!s||isPrimaryTickInterval(d))&&l<=d.duration);if(c==null)return{unit:"millisecond",step:Math.max(tickStep(e,t,n,r,i),1)};if(u==null)return{unit:"year",step:a==null?tickStep(e/durationYear,t/durationYear,n,r,i):1};const{timeInterval:f,step:h}=l-c.duration<u.duration-l?c:u;return{unit:f.unit,step:intervalStep(f)*h,epoch:defaultEpoch(f,{weekStart:o})}}function tickStep(e,t,n,r=0,i=1/0){if(e===t)return clamp(1,r,i);if(n<1)return Number.NaN;const o=Math.abs(t-e),s=10**Math.floor(Math.log10(o/n));let a=Number.NaN,l=1/0,c=!1;for(const u of TickMultipliers){const f=Math.ceil(o/(u*s)),h=f>=r&&f<=i;if(c&&!h)continue;const d=Math.abs(f-n);(l>d||c!==h)&&(c||(c=h),l=d,a=u)}return a*s}function decimalPlaces(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function tickFormat(e,t){const n=parseNumberFormat(t??",f");if(n==null)return;(n.precision==null||Number.isNaN(n.precision))&&(!n.type||"eEFgGnprs".includes(n.type)?n.precision=Math.max(...e.map(i=>{if(!Number.isFinite(i))return 0;const[o,s]=i.toExponential((n.type?6:12)-1).split(/[.e]/g);return(o!=="1"&&o!=="-1"?1:0)+decimalPlaces(s)+1})):"f%".includes(n.type)&&(n.precision=Math.max(...e.map(i=>{if(!Number.isFinite(i)||i===0)return 0;const o=Math.floor(Math.log10(Math.abs(i))),s=n.type?6:12,a=i.toExponential(s-1).split(/[.e]/g)[1],l=decimalPlaces(a);return Math.max(0,l-o)}))));const r=createNumberFormatter(n);return i=>r(Number(i))}function range(e,t,n,r){if(!Number.isFinite(n)||n<=0)return{ticks:[],count:0,firstTickIndex:void 0};if(e===t)return{ticks:[e],count:1,firstTickIndex:0};const i=10**countFractionDigits(n),o=Math.min(e,t),s=Math.max(e,t);let a,l;if(r!=null&&(r[0]!==0||r[1]!==1)){const f=t-e,h=e+f*r[0],d=t-f*(1-r[1]);a=Math.min(h,d),l=Math.max(h,d)}else a=o,l=s;a=Math.floor(a*i)/i,l=Math.ceil(l*i)/i;const c=[];for(let f=0;;f+=1){const h=Math.round((o+n*f)*i)/i;if(h>s)break;h>=a&&h<=l&&c.push(h)}const u=c.at(0);return{ticks:c,count:countTicks(o,s,n),firstTickIndex:u==null?void 0:Math.round((u-o)/n)}}function isDenseInterval(e,t){return e>=t?(warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function niceTicksDomain(e,t){const n=Math.abs(t-e),r=10**Math.floor(Math.log10(n));let i=1/0,o=[e,t];for(const s of TickMultipliers){const a=s*r,l=Math.floor(e/a)*a,c=Math.ceil(t/a)*a,u=1-n/Math.abs(c-l);i>u&&(i=u,o=[l,c])}return o}function estimateTickCount(e,t,n,r,i,o){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};o=Math.max(o,e/(i+1)),n??(n=o),r??(r=e),n>r&&(n===o?n=r:r=n),n=Math.max(n,1);const s=Math.max(1,Math.floor(e/(t*n))),a=Math.min(s,Math.ceil(e/(t*r))),l=clamp(a,Math.floor(i/t),s);return{minTickCount:a,maxTickCount:s,tickCount:l}}function dateToNumber(e){return e instanceof Date?e.getTime():e}function lowestGranularityForInterval(e){return e<durationSecond?"millisecond":e<durationMinute?"second":e<durationHour?"minute":e<durationHour*23?"hour":e<28*durationDay?"day":e<durationYear?"month":"year"}function lowestGranularityUnitForTicks(e){if(e.length===0)return"millisecond";if(e.length===1)return lowestGranularityUnitForValue(e[0]);let t=1/0;for(let n=1;n<e.length;n++)t=Math.min(t,Math.abs(e[n].valueOf()-e[n-1].valueOf()));return lowestGranularityForInterval(t)}function lowestGranularityUnitForValue(e){return intervalFloor("second",e)<e?"millisecond":intervalFloor("minute",e)<e?"second":intervalFloor("hour",e)<e?"minute":intervalFloor("day",e)<e?"hour":intervalFloor("month",e)<e?"day":intervalFloor("year",e)<e?"month":"year"}function dateTruncationForDomain(e){const[t,n]=e.length===0?[0,0]:findMinMax([e[0].valueOf(),e.at(-1).valueOf()]),r=new Date(t).getFullYear(),i=new Date(n).getFullYear();if(r!==i)return;const o=new Date(t).getMonth(),s=new Date(n).getMonth();if(o!==s)return"year";const a=new Date(t).getDate(),l=new Date(n).getDate();return a!==l?"month":"day"}function createIdsGenerator(){const e=new Map;return t=>{const n=e.get(t);return n?(e.set(t,n+1),`${t}_${n}`):(e.set(t,1),t)}}function isStringObject(e){return e!=null&&Object.hasOwn(e,"toString")&&isString(e.toString())}function isNumberObject(e){return e!=null&&Object.hasOwn(e,"valueOf")&&isFiniteNumber(e.valueOf())}function isContinuous(e){return isFiniteNumber(e)||isValidDate(e)||isNumberObject(e)}function checkDatum(e,t){return e!=null&&(!t||isContinuous(e))}function transformIntegratedCategoryValue(e){return isStringObject(e)&&Object.hasOwn(e,"id")?e.id:e}function readIntegratedWrappedValue(e){return isStringObject(e)&&Object.hasOwn(e,"value")?e.value:e}var vector_exports={};__export(vector_exports,{add:()=>add,angle:()=>angle,apply:()=>apply,distance:()=>distance,distanceSquared:()=>distanceSquared,equal:()=>equal,from:()=>from,gradient:()=>gradient,intercept:()=>intercept,intersectAtX:()=>intersectAtX,intersectAtY:()=>intersectAtY,length:()=>length,lengthSquared:()=>lengthSquared,multiply:()=>multiply,normalized:()=>normalized,origin:()=>origin,required:()=>required2,rotate:()=>rotate,round:()=>round,sub:()=>sub});function add(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 sub(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 multiply(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 length(e){return Math.hypot(e.x,e.y)}function lengthSquared(e){return e.x*e.x+e.y*e.y}function distance(e,t){return length(sub(e,t))}function distanceSquared(e,t){return lengthSquared(sub(e,t))}function normalized(e){const t=length(e);return{x:e.x/t,y:e.y/t}}function angle(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function rotate(e,t,n=origin()){const r=length(e);return{x:n.x+r*Math.cos(t),y:n.y+r*Math.sin(t)}}function gradient(e,t,n){const r=t.x-e.x;return(n==null?t.y-e.y:n-t.y-(n-e.y))/r}function intercept(e,t,n){return(n==null?e.y:n-e.y)-t*e.x}function intersectAtY(e,t,n=0,r){return{x:e===1/0?1/0:(n-t)/e,y:r==null?n:r-n}}function intersectAtX(e,t,n=0,r){const i=e===1/0?1/0:e*n+t;return{x:n,y:r==null?i:r-i}}function round(e,t=2){return{x:roundTo(e.x,t),y:roundTo(e.y,t)}}function equal(e,t){return e.x===t.x&&e.y===t.y}function from(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 apply(e,t){return e.x=t.x,e.y=t.y,e}function required2(e){return{x:e?.x??0,y:e?.y??0}}function origin(){return{x:0,y:0}}var vector4_exports={};__export(vector4_exports,{bottomCenter:()=>bottomCenter,center:()=>center,clone:()=>clone,collides:()=>collides,end:()=>end,from:()=>from2,height:()=>height,normalise:()=>normalise,origin:()=>origin2,round:()=>round2,start:()=>start,topCenter:()=>topCenter,width:()=>width});function start(e){return{x:e.x1,y:e.y1}}function end(e){return{x:e.x2,y:e.y2}}function topCenter(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function center(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function bottomCenter(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function width(e){return Math.abs(e.x2-e.x1)}function height(e){return Math.abs(e.y2-e.y1)}function round2(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function clone(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function collides(e,t){const n=normalise(e),r=normalise(t);return n.x1<=r.x2&&n.x2>=r.x1&&n.y1<=r.y2&&n.y2>=r.y1}function normalise(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 from2(e,t,n,r){if(typeof e=="number")return{x1:e,y1:t,x2:n,y2:r};if("width"in e)return normalise({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}] [${n}] [${r}]`)}function origin2(){return{x1:0,y1:0,x2:0,y2:0}}function isGradientFill(e){return isObject(e)&&e.type=="gradient"}function isGradientFillArray(e){return isArray(e)&&e.every(isGradientFill)}function isStringFillArray(e){return isArray(e)&&e.every(t=>typeof t=="string")}function isPatternFill(e){return e!==null&&isObject(e)&&e.type=="pattern"}function isImageFill(e){return e!==null&&isObject(e)&&e.type=="image"}function isGradientOrPatternFill(e){return isGradientFill(e)||isPatternFill(e)}function evaluateBezier(e,t,n,r,i){return(1-i)**3*e+3*(1-i)**2*i*t+3*(1-i)*i**2*n+i**3*r}function solveBezier(e,t,n,r,i){if(i<=Math.min(e,r))return e<r?0:1;if(i>=Math.max(e,r))return e<r?1:0;let o=0,s=1,a=Number.NaN;for(let l=0;l<12;l+=1)a=(o+s)/2,evaluateBezier(e,t,n,r,a)<i?o=a:s=a;return a}function splitBezier2D(e,t,n,r,i,o,s,a,l){const c=(1-l)*e+l*n,u=(1-l)*t+l*r,f=(1-l)*n+l*i,h=(1-l)*r+l*o,d=(1-l)*i+l*s,g=(1-l)*o+l*a,p=(1-l)*c+l*f,y=(1-l)*u+l*h,m=(1-l)*f+l*d,b=(1-l)*h+l*g,E=(1-l)*p+l*m,v=(1-l)*y+l*b;return[[{x:e,y:t},{x:c,y:u},{x:p,y},{x:E,y:v}],[{x:E,y:v},{x:m,y:b},{x:d,y:g},{x:s,y:a}]]}function calculateDerivativeExtrema(e,t,n,r){const i=-e+3*t-3*n+r,o=2*(e-2*t+n),s=-e+t;if(i===0){if(o!==0){const l=-s/o;if(l>0&&l<1)return[l]}return[]}const a=o*o-4*i*s;if(a>=0){const l=Math.sqrt(a),c=(-o+l)/(2*i),u=(-o-l)/(2*i);return[c,u].filter(f=>f>0&&f<1)}return[]}function bezier2DExtrema(e,t,n,r,i,o,s,a){const l=calculateDerivativeExtrema(e,n,i,s),c=calculateDerivativeExtrema(t,r,o,a);return[...l,...c]}function bezierCandidate(e,t,n){const r=evaluateBezier(e[0].x,e[1].x,e[2].x,e[3].x,.5),i=evaluateBezier(e[0].y,e[1].y,e[2].y,e[3].y,.5),o=Math.hypot(r-t,i-n),s=Math.min(Math.hypot(e[0].x-t,e[0].y-n),Math.hypot(e[1].x-t,e[1].y-n),Math.hypot(e[2].x-t,e[2].y-n),Math.hypot(e[3].x-t,e[3].y-n));return{points:e,distance:o,minDistance:s}}function bezier2DDistance(e,t,n,r,i,o,s,a,l,c,u=1){let h={value:bezierCandidate([{x:e,y:t},{x:n,y:r},{x:i,y:o},{x:s,y:a}],l,c),next:null},d;for(;h!=null;){const{points:g,distance:p,minDistance:y}=h.value;if(h=h.next,(d==null||p<d.distance)&&(d={distance:p,minDistance:y}),d!=null&&d.distance-y<=u)continue;const[m,b]=splitBezier2D(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,.5),E=[bezierCandidate(m,l,c),bezierCandidate(b,l,c)].sort(bezierCandidateCmp);h=insertListItemsSorted(h,E,bezierCandidateCmp)}return d?.distance??1/0}var bezierCandidateCmp=(e,t)=>t.minDistance-e.minDistance;function circleRectOverlap({point:e,anchor:t},n,r,i,o){if(e.size===0)return!1;let s=e.x,a=e.y;t!=null&&(s-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=s;s<n?l=n:s>n+i&&(l=n+i);let c=a;a<r?c=r:a>r+o&&(c=r+o);const u=s-l,f=a-c;return Math.hypot(u,f)<=e.size/2}function isPointLabelDatum(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var labelPlacements={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 placeLabels(e,t,n=5){const r=new Map,i=[],o=new Map(Array.from(e.entries(),([a,l])=>[a,l.toSorted((c,u)=>u.point.size-c.point.size)])),s=[...o.values()].flat();for(const[a,l]of o.entries()){const c=[];if(l[0]?.label){for(let u=0,f=l.length;u<f;u++){const h=l[u],{point:d,label:g,anchor:p}=h,{text:y,width:m,height:b}=g,E=d.size/2;let v=0,_=0;if(E>0&&h.placement!=null){const x=labelPlacements[h.placement];v=(m/2+E+n)*x.x,_=(b/2+E+n)*x.y}let O=d.x-m/2+v,T=d.y-b/2+_;if(p&&(O-=(p.x-.5)*d.size,T-=(p.y-.5)*d.size),boxContains(t,O,T,m,b)&&!s.some(x=>circleRectOverlap(x,O,T,m,b))&&!i.some(x=>boxCollides(x,O,T,m,b))){const x={index:u,text:y,x:O,y:T,width:m,height:b,datum:h};c.push(x),i.push(x)}}r.set(a,c)}}return r}function isContinuousScaling(e){return e.type==="continuous"||e.type==="log"}function isCategoryScaling(e){return e.type==="category"}function isUnitTimeCategoryScaling(e){return"variant"in e&&e.variant==="unit-time"}function isStandardCategoryScaling(e){return!("variant"in e)}function areScalingEqual(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:isContinuousScaling(e)&&isContinuousScaling(t)?e.type===t.type&&arraysEqual(e.domain,t.domain)&&arraysEqual(e.range,t.range):isCategoryScaling(e)&&isCategoryScaling(t)?isUnitTimeCategoryScaling(e)&&isUnitTimeCategoryScaling(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:isStandardCategoryScaling(e)&&isStandardCategoryScaling(t)?e.inset===t.inset&&e.step===t.step&&arraysEqual(e.domain,t.domain):!1:!1}function isScaleValid(e){return e==null?!1:e.type==="category"?isUnitTimeCategoryScaling(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 spanRange(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 spanRangeNormalized(e){const t=spanRange(e);return t[0].x>t[1].x&&t.reverse(),t}function collapseSpanToPoint(e,t){const{x:n,y:r}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:n,y0:r,x1:n,y1:r};case"step":return{type:"step",moveTo:e.moveTo,x0:n,y0:r,x1:n,y1:r,stepX:n};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:n,cp0y:r,cp1x:n,cp1y:r,cp2x:n,cp2y:r,cp3x:n,cp3y:r};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:n,y0:r,x1:n,y1:r,midPoints:e.midPoints.map(()=>({x:n,y:r}))}}}function rescaleSpan(e,t,n){const[r,i]=spanRange(e),o=i.x===r.x?0:(n.x-t.x)/(i.x-r.x),s=i.y===r.y?0:(n.y-t.y)/(i.y-r.y);switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:n.x,y1:n.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:n.x-(e.cp2x-r.x)*o,cp1y:n.y-(e.cp2y-r.y)*s,cp2x:n.x-(e.cp1x-r.x)*o,cp2y:n.y-(e.cp1y-r.y)*s,cp3x:n.x,cp3y:n.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:n.x,y1:n.y,stepX:n.x-(e.stepX-r.x)*o};case"multi-line":return{type:"multi-line",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:n.x,y1:n.y,midPoints:e.midPoints.map(a=>({x:t.x+(a.x-r.x)*o,y:t.y+(a.y-r.y)*s}))}}}function clipSpanX(e,t,n){const{moveTo:r}=e,[i,o]=spanRangeNormalized(e),{x:s,y:a}=i,{x:l,y:c}=o;if(n<s)return rescaleSpan(e,i,i);if(t>l)return rescaleSpan(e,o,o);switch(e.type){case"linear":{const u=a===c?void 0:(c-a)/(l-s),f=u==null?a:u*(t-s)+a,h=u==null?a:u*(n-s)+a;return{type:"linear",moveTo:r,x0:t,y0:f,x1:n,y1:h}}case"step":if(n<=e.stepX){const u=e.y0;return{type:"step",moveTo:r,x0:t,y0:u,x1:n,y1:u,stepX:n}}else if(t>=e.stepX){const u=e.y1;return{type:"step",moveTo:r,x0:t,y0:u,x1:n,y1:u,stepX:t}}else{const{y0:u,y1:f,stepX:h}=e;return{type:"step",moveTo:r,x0:t,y0:u,x1:n,y1:f,stepX:h}}case"cubic":{const u=solveBezier(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[f,h]=splitBezier2D(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,u);const d=solveBezier(h[0].x,h[1].x,h[2].x,h[3].x,n);return[h,f]=splitBezier2D(h[0].x,h[0].y,h[1].x,h[1].y,h[2].x,h[2].y,h[3].x,h[3].y,d),{type:"cubic",moveTo:r,cp0x:h[0].x,cp0y:h[0].y,cp1x:h[1].x,cp1y:h[1].y,cp2x:h[2].x,cp2y:h[2].y,cp3x:h[3].x,cp3y:h[3].y}}case"multi-line":{const{midPoints:u}=e,f=u.findLastIndex(O=>O.x<=t);let h=u.findIndex(O=>O.x>=n);h===-1&&(h=u.length);const d=f>=0?u[f]:void 0,g=d?.x??s,p=d?.y??a,y=h<u.length?u[h]:void 0,m=y?.x??l,b=y?.y??c,E=p===b?void 0:(b-p)/(m-g),v=E==null?p:E*(g-s)+p,_=E==null?p:E*(m-s)+p;return{type:"multi-line",moveTo:r,x0:t,y0:v,x1:n,y1:_,midPoints:u.slice(Math.max(f,0),h)}}}}var SpanJoin=(e=>(e[e.MoveTo=0]="MoveTo",e[e.LineTo=1]="LineTo",e[e.Skip=2]="Skip",e))(SpanJoin||{});function linearPoints(e){const t=[];let n=0,r=Number.NaN,i=Number.NaN;for(const{x:o,y:s}of e){if(n>0){const a=n===1;t.push({type:"linear",moveTo:a,x0:r,y0:i,x1:o,y1:s})}n+=1,r=o,i=s}return t}var lineSteps={start:0,middle:.5,end:1};function stepPoints(e,t){const n=[];let r=0,i=Number.NaN,o=Number.NaN;const s=typeof t=="number"?t:lineSteps[t];for(const{x:a,y:l}of e){if(r>0){const c=r===1,u=i+(a-i)*s;n.push({type:"step",moveTo:c,x0:i,y0:o,x1:a,y1:l,stepX:u})}r+=1,i=a,o=l}return n}function smoothPoints(e,t){const n=Array.isArray(e)?e:Array.from(e);if(n.length<=1)return[];const r=.05,i=n.map((s,a)=>{const l=a===0?s:n[a-1],c=a===n.length-1?s:n[a+1],u=a===0||a===n.length-1;if(Math.sign(l.y-s.y)===Math.sign(c.y-s.y))return 0;if(!u){const f=Math.abs(l.y-c.y),h=Math.abs(s.y-l.y)/f,d=Math.abs(s.y-c.y)/f;if(h<=r||1-h<=r||d<=r||1-d<=r)return 0}return(c.y-l.y)/(c.x-l.x)});i[1]===0&&(i[0]*=2),i.at(-2)===0&&(i[i.length-1]*=2);const o=[];for(let s=1;s<n.length;s+=1){const a=n[s-1],l=i[s-1],c=n[s],u=i[s],f=c.x-a.x,h=c.y-a.y;let d=f*t/3,g=f*l*t/3,p=f*t/3,y=f*u*t/3;u===0&&Math.abs(g)>Math.abs(h)&&(d*=Math.abs(h/g),g=Math.sign(g)*Math.abs(h)),l===0&&Math.abs(y)>Math.abs(h)&&(p*=Math.abs(h/y),y=Math.sign(y)*Math.abs(h)),o.push({type:"cubic",moveTo:s===1,cp0x:a.x,cp0y:a.y,cp1x:a.x+d,cp1y:a.y+g,cp2x:c.x-p,cp2y:c.y-y,cp3x:c.x,cp3y:c.y})}return o}var UNIT_MIN=0,UNIT_MAX=1;function definedZoomState(e){return{x:{min:e?.x?.min??UNIT_MIN,max:e?.x?.max??UNIT_MAX},y:{min:e?.y?.min??UNIT_MIN,max:e?.y?.max??UNIT_MAX}}}var ChangeDetectableProperties=class extends BaseProperties{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},CONSTANTS={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 dayOfYear(e,t=new Date(e.getFullYear(),0,1)){const n=e.getTimezoneOffset()-t.getTimezoneOffset(),r=e.getTime()-t.getTime()+n*6e4,i=36e5*24;return Math.floor(r/i)}function weekOfYear(e,t){const r=new Date(e.getFullYear(),0,1).getDay(),i=(t-r+7)%7,o=new Date(e.getFullYear(),0,i+1);return o<=e?Math.floor(dayOfYear(e,o)/7)+1:0}var SUNDAY=0,MONDAY=1,THURSDAY=4;function isoWeekOfYear(e,t=e.getFullYear()){const r=new Date(t,0,1).getDay(),i=(THURSDAY-r+7)%7,o=new Date(t,0,i-(THURSDAY-MONDAY)+1);return o<=e?Math.floor(dayOfYear(e,o)/7)+1:isoWeekOfYear(e,t-1)}function timezone(e){const t=e.getTimezoneOffset(),n=Math.abs(t);return`${t>0?"-":"+"}${pad(Math.floor(n/60),2,"0")}${pad(Math.floor(n%60),2,"0")}`}var FORMATTERS={a:e=>CONSTANTS.shortDays[e.getDay()],A:e=>CONSTANTS.days[e.getDay()],b:e=>CONSTANTS.shortMonths[e.getMonth()],B:e=>CONSTANTS.months[e.getMonth()],c:"%x, %X",d:(e,t)=>pad(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>pad(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>pad(e.getHours(),2,t??"0"),I:(e,t)=>{const n=e.getHours()%12;return n===0?"12":pad(n,2,t??"0")},j:(e,t)=>pad(dayOfYear(e)+1,3,t??"0"),m:(e,t)=>pad(e.getMonth()+1,2,t??"0"),M:(e,t)=>pad(e.getMinutes(),2,t??"0"),L:(e,t)=>pad(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)=>pad(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>pad(weekOfYear(e,SUNDAY),2,t??"0"),V:(e,t)=>pad(isoWeekOfYear(e),2,t??"0"),w:(e,t)=>pad(e.getDay(),2,t??"0"),W:(e,t)=>pad(weekOfYear(e,MONDAY),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>pad(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>pad(e.getFullYear(),4,t??"0"),Z:e=>timezone(e),"%":()=>"%"},PADS={_:" ",0:"0","-":""};function pad(e,t,n){const r=String(Math.floor(e));return r.length>=t?r:`${n.repeat(t-r.length)}${r}`}function buildDateFormatter(e){const t=[];for(;e.length>0;){let n=e.indexOf("%");if(n!==0){const a=n>0?e.substring(0,n):e;t.push(a)}if(n<0)break;const r=e[n+1],i=PADS[r];i!=null&&n++;const o=e[n+1],s=FORMATTERS[o];if(typeof s=="function")t.push([s,i]);else if(typeof s=="string"){const a=buildDateFormatter(s);t.push([a,i])}else t.push(`${i??""}${o}`);e=e.substring(n+2)}return n=>{const r=typeof n=="number"?new Date(n):n;return t.map(i=>typeof i=="string"?i:i[0](r,i[1])).join("")}}function createButton(e,t){const n=createElement("button",getClassName("ag-charts-input ag-charts-button",t));return e.label===void 0?(n.append(createIcon(e.icon)),n.ariaLabel=e.altText):n.append(e.label),n.addEventListener("click",e.onPress),setAttributes(n,t),n}function createCheckbox(e,t){const n=createElement("input",getClassName("ag-charts-input ag-charts-checkbox",t));return n.type="checkbox",n.checked=e.checked,n.addEventListener("change",r=>e.onChange(n.checked,r)),n.addEventListener("keydown",r=>{isButtonClickEvent(r)&&(r.preventDefault(),n.click())}),setAttributes(n,t),n}function createSelect(e,t){const n=createElement("select",getClassName("ag-charts-input ag-charts-select",t));return n.append(...e.options.map(r=>{const i=createElement("option");return i.value=r.value,i.textContent=r.label,i})),setAttribute(n,"data-preventdefault",!1),n.value=e.value,n.addEventListener("change",r=>e.onChange(n.value,r)),setAttributes(n,t),n}function createTextArea(e,t){const n=createElement("textarea",getClassName("ag-charts-input ag-charts-textarea",t));return n.value=e.value,n.addEventListener("input",r=>e.onChange(n.value,r)),setAttributes(n,t),setAttribute(n,"data-preventdefault",!1),n}function createIcon(e){const t=createElement("span",`ag-charts-icon ag-charts-icon-${e}`);return setAttribute(t,"aria-hidden",!0),t}function getClassName(e,t){return t==null?e:`${e} ${t.class}`}var linear=e=>e,easeIn=e=>1-Math.cos(e*Math.PI/2),easeOut=e=>Math.sin(e*Math.PI/2),easeInOut=e=>-(Math.cos(e*Math.PI)-1)/2,easeInQuad=e=>e*e,easeOutQuad=e=>1-(1-e)**2,easeInOutQuad=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,inverseEaseOut=e=>2*Math.asin(e)/Math.PI,TRIPLE_EQ=(e,t)=>e===t;function SceneChangeDetection(e){return function(t,n){const r=`__${n}`;t[n]||prepareGetSet(t,n,r,e)}}function SceneRefChangeDetection(e){return SceneChangeDetection(e)}function SceneObjectChangeDetection(e){return SceneChangeDetection(e)}function SceneArrayChangeDetection(e){const t=e??{};return t.equals=arraysEqual,SceneChangeDetection(e)}function DeclaredSceneChangeDetection(e){return function(t,n){const r=`__${n}`;t[n]||prepareGetSet(t,n,r,e)}}function DeclaredSceneObjectChangeDetection(e){return function(t,n){const r=`__${n}`;t[n]||prepareGetSet(t,n,r,e)}}function prepareGetSet(e,t,n,r){const{changeCb:i,convertor:o,checkDirtyOnAssignment:s=!1}=r??{},a={changeCb:i,checkDirtyOnAssignment:s,convertor:o},l=buildCheckDirtyChain(n,buildChangeCallbackChain(buildConvertorChain(buildSetter(n,a),a),a),a);function c(){return this[n]}Object.defineProperty(e,t,{set:l,get:c,enumerable:!0,configurable:!0})}function buildConvertorChain(e,t){const{convertor:n}=t;if(n){let i=function(s){e.call(this,o(s))};var r=i;const o=n;return i}return e}var NO_CHANGE=Symbol("no-change");function buildChangeCallbackChain(e,t){const{changeCb:n}=t;if(n){let i=function(s){const a=e.call(this,s);return a!==NO_CHANGE&&o.call(this,this),a};var r=i;const o=n;return i}return e}function buildCheckDirtyChain(e,t,n){const{checkDirtyOnAssignment:r}=n;if(r){let o=function(s){const a=t.call(this,s);return s?._dirty===!0&&this.markDirty(e),a};var i=o;return o}return t}function buildSetter(e,t){const{equals:n=TRIPLE_EQ}=t;function r(i){const o=this[e];return n(i,o)?NO_CHANGE:(this[e]=i,this.onChangeDetection(e),i)}return r}
|