!/**
 * Highstock JS v13.0.0 (2026-06-11)
 * @module highcharts/indicators/volume-by-price
 * @requires highcharts
 * @requires highcharts/modules/stock
 *
 * Indicator series type for Highcharts Stock
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Paweł Dalek
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(t._Highcharts,t._Highcharts.SeriesRegistry):"function"==typeof define&&define.amd?define("highcharts/indicators/volume-by-price",["highcharts/highcharts"],function(t){return e(t,t.SeriesRegistry)}):"object"==typeof exports?exports["highcharts/indicators/volume-by-price"]=e(t._Highcharts,t._Highcharts.SeriesRegistry):t.Highcharts=e(t.Highcharts,t.Highcharts.SeriesRegistry)}("u"<typeof window?this:window,function(t,e){return function(){"use strict";var o,i,n={512:function(t){t.exports=e},944:function(e){e.exports=t}},r={};function s(t){var e=r[t];if(void 0!==e)return e.exports;var o=r[t]={exports:{}};return n[t](o,o.exports,s),o.exports}s.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return s.d(e,{a:e}),e},s.d=function(t,e){for(var o in e)s.o(e,o)&&!s.o(t,o)&&Object.defineProperty(t,o,{enumerable:!0,get:e[o]})},s.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};var a={};s.d(a,{default:function(){return D}});var p=s(944),l=s.n(p),u=s(512),h=s.n(u),c=(o=function(t,e){return(o=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)e.hasOwnProperty(o)&&(t[o]=e[o])})(t,e)},function(t,e){function i(){this.constructor=t}o(t,e),t.prototype=null===e?Object.create(e):(i.prototype=e.prototype,new i)}),d=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return c(e,t),e.prototype.destroy=function(){this.negativeGraphic&&(this.negativeGraphic=this.negativeGraphic.destroy()),t.prototype.destroy.apply(this,arguments)},e}(h().seriesTypes.sma.prototype.pointClass),f=(i=function(t,e){return(i=Object.setPrototypeOf||({__proto__:[]})instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var o in e)Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o])})(t,e)},function(t,e){if("function"!=typeof e&&null!==e)throw TypeError("Class extends value "+String(e)+" is not a constructor or null");function o(){this.constructor=t}i(t,e),t.prototype=null===e?Object.create(e):(o.prototype=e.prototype,new o)}),v=l().animObject,m=l().noop,y=h().seriesTypes,g=y.column.prototype,x=y.sma,S=Math.abs,b=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return f(e,t),e.prototype.init=function(e,o){var i=this;delete o.data,t.prototype.init.apply(i,arguments);var n=(0,p.addEvent)(this.chart.constructor,"afterLinkSeries",function(){if(i.options){var t=i.options.params,o=i.linkedParent,r=(null==t?void 0:t.volumeSeriesID)?e.get(null==t?void 0:t.volumeSeriesID):void 0;o&&r&&i.addCustomEvents(o,r)}n()},{order:1});return i},e.prototype.addCustomEvents=function(t,e){var o=this,i=function(){o.chart.redraw(),o.setData([]),o.zoneStarts=[],o.zoneLinesSVG&&(o.zoneLinesSVG=o.zoneLinesSVG.destroy())};return o.dataEventsToUnbind.push((0,p.addEvent)(t,"remove",function(){i()})),e&&o.dataEventsToUnbind.push((0,p.addEvent)(e,"remove",function(){i()})),o},e.prototype.animate=function(t){var e=this,o=e.chart.inverted,i=e.group,n={};if(!t&&i){var r=o?e.yAxis.top:e.xAxis.left;o?(i["forceAnimate:translateY"]=!0,n.translateY=r):(i["forceAnimate:translateX"]=!0,n.translateX=r),i.animate(n,(0,p.extend)(v(e.options.animation),{step:function(t,o){e.group.attr({scaleX:Math.max(.001,o.pos)})}}))}},e.prototype.drawPoints=function(){this.options.volumeDivision.enabled&&(this.posNegVolume(!0,!0),g.drawPoints.apply(this,arguments),this.posNegVolume(!1,!1)),g.drawPoints.apply(this,arguments)},e.prototype.posNegVolume=function(t,e){var o,i,n,r,s=e?["positive","negative"]:["negative","positive"],a=this.options.volumeDivision,p=this.points.length,l=[],u=[],h=0;for(t?(this.posWidths=l,this.negWidths=u):(l=this.posWidths,u=this.negWidths);h<p;h++)(r=this.points[h])[s[0]+"Graphic"]=r.graphic,r.graphic=r[s[1]+"Graphic"],t&&(o=r.shapeArgs.width,(n=(i=this.priceZones[h]).wholeVolumeData)?(l.push(o/n*i.positiveVolumeData),u.push(o/n*i.negativeVolumeData)):(l.push(0),u.push(0))),r.color=e?a.styles.positiveColor:a.styles.negativeColor,r.shapeArgs.width=e?this.posWidths[h]:this.negWidths[h],r.shapeArgs.x=e?r.shapeArgs.x:this.posWidths[h]},e.prototype.translate=function(){var t,e,o,i,n,r,s,a,l,u,h,c=this,d=c.options,f=c.chart,v=c.yAxis,m=v.min,y=c.options.zoneLines,x=c.priceZones,b=0;g.translate.apply(c);var D=c.points;D.length&&(a=d.pointPadding<.5?d.pointPadding:.1,t=c.volumeDataArray,e=(0,p.arrayMax)(t),o=f.plotWidth/2,l=f.plotTop,i=S(v.toPixels(m)-v.toPixels(m+c.rangeStep)),r=S(v.toPixels(m)-v.toPixels(m+c.rangeStep)),a&&(n=S(i*(1-2*a)),b=S((i-n)/2),i=S(n)),D.forEach(function(t,n){u=t.barX=t.plotX=0,h=t.plotY=v.toPixels(x[n].start)-l-(v.reversed?i-r:i)-b,t.pointWidth=s=(0,p.correctFloat)(o*x[n].wholeVolumeData/e),t.shapeArgs=c.crispCol.apply(c,[u,h,s,i]),t.volumeNeg=x[n].negativeVolumeData,t.volumePos=x[n].positiveVolumeData,t.volumeAll=x[n].wholeVolumeData,delete t.origin,t.isInside=c.isPointInside(t)}),y.enabled&&c.drawZones(f,v,c.zoneStarts,y.styles))},e.prototype.getExtremes=function(){var e,o=this.options.compare,i=this.options.cumulative;return this.options.compare?(this.options.compare=void 0,e=t.prototype.getExtremes.call(this),this.options.compare=o):this.options.cumulative?(this.options.cumulative=!1,e=t.prototype.getExtremes.call(this),this.options.cumulative=i):e=t.prototype.getExtremes.call(this),e},e.prototype.getValues=function(t,e){var o=t.getColumn("x",!0),i=t.processedYData,n=this.chart,r=e.ranges,s=[],a=[],l=[],u=n.get(e.volumeSeriesID);if(!t.chart)return void(0,p.error)("Base series not found! In case it has been removed, add a new one.",!0,n);if(!u||!u.getColumn("x",!0).length){var h=u&&!u.getColumn("x",!0).length?" does not contain any data.":" not found! Check `volumeSeriesID`.";(0,p.error)("Series "+e.volumeSeriesID+h,!0,n);return}var c=(0,p.isArray)(i[0]);return c&&4!==i[0].length?void(0,p.error)("Type of "+t.name+" series is different than line, OHLC or candlestick.",!0,n):((this.priceZones=this.specifyZones(c,o,i,r,u)).forEach(function(t,e){s.push([t.x,t.end]),a.push(s[e][0]),l.push(s[e][1])}),{values:s,xData:a,yData:l})},e.prototype.specifyZones=function(t,e,o,i,n){var r=!!t&&function(t){for(var e,o=t.length,i=t[0][3],n=i,r=1;r<o;r++)(e=t[r][3])<i&&(i=e),e>n&&(n=e);return{min:i,max:n}}(o),s=this.zoneStarts=[],a=[],l=r?r.min:(0,p.arrayMin)(o),u=r?r.max:(0,p.arrayMax)(o),h=0,c=1,d=this.linkedParent;if(!this.options.compareToMain&&d.dataModify&&(l=d.dataModify.modifyValue(l),u=d.dataModify.modifyValue(u)),!(0,p.defined)(l)||!(0,p.defined)(u))return this.points.length&&(this.setData([]),this.zoneStarts=[],this.zoneLinesSVG&&(this.zoneLinesSVG=this.zoneLinesSVG.destroy())),[];var f=this.rangeStep=(0,p.correctFloat)(u-l)/i;for(s.push(l);h<i-1;h++)s.push((0,p.correctFloat)(s[h]+f));s.push(u);for(var v=s.length;c<v;c++)a.push({index:c-1,x:e[0],start:s[c-1],end:s[c]});return this.volumePerZone(t,a,n,e,o)},e.prototype.volumePerZone=function(t,e,o,i,n){var r,s,a,p,l,u=this,h=o.getColumn("x",!0),c=o.getColumn("y",!0),d=e.length-1,f=n.length,v=c.length;return S(f-v)&&(i[0]!==h[0]&&c.unshift(0),i[f-1]!==h[v-1]&&c.push(0)),u.volumeDataArray=[],e.forEach(function(e){for(l=0,e.wholeVolumeData=0,e.positiveVolumeData=0,e.negativeVolumeData=0;l<f;l++){s=!1,a=!1,p=t?n[l][3]:n[l],r=l?t?n[l-1][3]:n[l-1]:p;var o=u.linkedParent;!u.options.compareToMain&&o.dataModify&&(p=o.dataModify.modifyValue(p),r=o.dataModify.modifyValue(r)),p<=e.start&&0===e.index&&(s=!0),p>=e.end&&e.index===d&&(a=!0),(p>e.start||s)&&(p<e.end||a)&&(e.wholeVolumeData+=c[l],r>p?e.negativeVolumeData+=c[l]:e.positiveVolumeData+=c[l])}u.volumeDataArray.push(e.wholeVolumeData)}),e},e.prototype.drawZones=function(t,e,o,i){var n,r=t.renderer,s=t.plotWidth,a=t.plotTop,p=this.zoneLinesSVG,l=[];o.forEach(function(o){n=e.toPixels(o)-a,l=l.concat(t.renderer.crispLine([["M",0,n],["L",s,n]],i.lineWidth))}),p?p.animate({d:l}):p=this.zoneLinesSVG=r.path(l).attr({"stroke-width":i.lineWidth,stroke:i.color,dashstyle:i.dashStyle,zIndex:this.group.zIndex+.1}).add(this.group)},e.defaultOptions=(0,p.merge)(x.defaultOptions,{params:{index:void 0,period:void 0,ranges:12,volumeSeriesID:"volume"},zoneLines:{enabled:!0,styles:{color:"#0A9AC9",dashStyle:"LongDash",lineWidth:1}},volumeDivision:{enabled:!0,styles:{positiveColor:"rgba(144, 237, 125, 0.8)",negativeColor:"rgba(244, 91, 91, 0.8)"}},animationLimit:1e3,enableMouseTracking:!1,pointPadding:0,zIndex:-1,crisp:!0,dataGrouping:{enabled:!1},dataLabels:{align:"left",allowOverlap:!0,distance:0,enabled:!0,format:"P: {point.volumePos:.2f} | N: {point.volumeNeg:.2f}",padding:0,style:{fontSize:"0.5em"},verticalAlign:"top"}}),e}(x);(0,p.extend)(b.prototype,{nameBase:"Volume by Price",nameComponents:["ranges"],calculateOn:{chart:"render",xAxis:"afterSetExtremes"},pointClass:d,markerAttribs:m,drawGraph:m,getColumnMetrics:g.getColumnMetrics,crispCol:g.crispCol}),h().registerSeriesType("vbp",b);var D=l();return a.default}()});