/**
 * Highcharts JS v13.0.0 (2026-06-11)
 * @module highcharts/modules/item-series
 * @requires highcharts
 *
 * Item series type for Highcharts
 *
 * (c) 2019-2026 Highsoft AS
 * Author: Torstein Hønsi
 *
 * A commercial license may be required depending on use,
 * see www.highcharts.com/license
 */import*as t from"../highcharts.js";var e={};e.n=t=>{var i=t&&t.__esModule?()=>t.default:()=>t;return e.d(i,{a:i}),i},e.d=(t,i)=>{for(var s in i)e.o(i,s)&&!e.o(t,s)&&Object.defineProperty(t,s,{enumerable:!0,get:i[s]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let i=t.default;var s=e.n(i);let o=t.default.SeriesRegistry;var r=e.n(o);let{series:{prototype:{pointClass:a}},seriesTypes:{pie:{prototype:{pointClass:n}}}}=r();class l extends n{}(0,i.extend)(l.prototype,{haloPath:a.prototype.haloPath});let h={endAngle:void 0,innerSize:"40%",itemPadding:.1,layout:"vertical",marker:(0,i.merge)({lineWidth:2,allowPointSelect:!1,crisp:!0,showCheckbox:!1,animation:{duration:1e3},enableMouseTracking:!0,events:{},marker:{enabledThreshold:2,lineColor:"var(--highcharts-background-color)",lineWidth:0,radius:4,states:{normal:{animation:!0},hover:{animation:{duration:150},enabled:!0,radiusPlus:2,lineWidthPlus:1},select:{fillColor:"var(--highcharts-neutral-color-20)",lineColor:"var(--highcharts-neutral-color-100)",lineWidth:2}}},point:{events:{}},dataLabels:{animation:{},align:"center",borderWidth:0,defer:!0,distance:4,formatter:function(){let{numberFormatter:t}=this.series.chart;return"number"!=typeof this.y?"":t(this.y,-1)},padding:[1,3],style:{fontSize:"0.7em",fontWeight:"bold",color:"contrast",textOutline:"1px contrast"},verticalAlign:"bottom",x:0,y:0},cropThreshold:300,opacity:1,pointRange:0,softThreshold:!0,states:{normal:{animation:!0},hover:{animation:{duration:150},lineWidthPlus:1,marker:{},halo:{size:10,opacity:.25}},select:{animation:{duration:0}},inactive:{animation:{duration:150},opacity:.2}},stickyTracking:!0,turboThreshold:1e3,findNearestPointBy:"x"}.marker,{radius:null}),rows:void 0,crisp:!1,showInLegend:!0,startAngle:void 0},{pie:d}=r().seriesTypes;class c extends d{animate(t){let e=this.group;e&&(t?e.attr({opacity:0}):e.animate({opacity:1},this.options.animation))}drawDataLabels(){if(this.center&&this.slots)super.drawDataLabels();else for(let t of this.points)t.destroyElements({dataLabel:1})}drawPoints(){let t=this.options,e=this.chart.renderer,s=t.marker,o=this.borderWidth%2?.5:1,r=this.getRows(),a=Math.ceil(this.total/r),n=this.chart.plotWidth/a,l=this.chart.plotHeight/r,h=this.itemSize||Math.min(n,l),d=0;for(let c of this.points){let p,g,u,f,m,y,b=c.marker||{},v=b.symbol||s.symbol,M=(0,i.pick)(b.radius,s.radius),w=(0,i.defined)(M)?2*M:h,A=w*t.itemPadding;if(c.graphics=g=c.graphics||[],this.chart.styledMode||(u=this.pointAttribs(c,c.selected&&"select")),!c.isNull&&c.visible){c.graphic||(c.graphic=e.g("point").add(this.group));for(let s=0;s<(c.y||0);++s){if(this.center&&this.slots){let t=this.slots.shift();f=t.x-h/2,m=t.y-h/2}else"horizontal"===t.layout?(f=d%a*n,m=l*Math.floor(d/a)):(f=n*Math.floor(d/r),m=d%r*l);f+=A,m+=A,y=Math.round(w-2*A),this.options.crisp&&(f=Math.round(f)-o,m=Math.round(m)+o),p={x:f,y:m,width:y,height:y},void 0!==M&&(p.r=M),u&&(0,i.extend)(p,u);let b=g[s];b?b.animate(p):b=e.symbol(v,void 0,void 0,void 0,void 0,{backgroundSize:"within"}).attr(p).add(c.graphic),b.isActive=!0,g[s]=b,++d}}for(let t=0;t<g.length;t++){let e=g[t];if(!e)return;e.isActive?e.isActive=!1:(e.destroy(),g.splice(t,1),t--)}}}getRows(){let t=this.chart,e=this.total||0,i=this.options.rows,s;if(!i)if(s=t.plotWidth/t.plotHeight,i=Math.sqrt(e),s>1)for(i=Math.ceil(i);i>1&&!(e/i/i>s);)i--;else for(i=Math.floor(i);i<e&&!(e/i/i<s);)i++;return i}getSlots(){let t=this.center,e=t[2],i=this.slots=this.slots||[],s=this.endAngleRad-this.startAngleRad,o=this.options.rows,r=s%(2*Math.PI)==0,a=this.total||0,n=t[3],l,h,d,c,p,g,u,f,m=0,y,b=Number.MAX_VALUE,v,M,w,A=(e-n)/e;for(;b>a+(M&&r?M.length:0);){v=b,i.length=0,b=0,M=w,w=[],y=e/++m/2,o?(n=(y-o)/y*e)>=0?y=o:(n=0,A=1):y=Math.floor(y*A);for(let t=y;t>0;t--)p=Math.ceil((c=s*(d=(n+t/y*(e-n-m))/2))/m),w.push({rowRadius:d,rowLength:c,colCount:p}),b+=p+1}if(!M)return;let k=v-this.total-(r?M.length:0),x=t=>{k>0&&(t.row.colCount--,k--)};for(;k>0;)M.map(t=>({angle:t.colCount/t.rowLength,row:t})).sort((t,e)=>e.angle-t.angle).slice(0,Math.min(k,Math.ceil(M.length/2))).forEach(x);for(let e of M){let o=e.rowRadius,r=e.colCount;for(f=0,g=r?s/r:0;f<=r;f+=1)u=this.startAngleRad+f*g,l=t[0]+Math.cos(u)*o,h=t[1]+Math.sin(u)*o,i.push({x:l,y:h,angle:u})}return i.sort((t,e)=>t.angle-e.angle),this.itemSize=m,i}translate(t){0===this.total&&(0,i.isNumber)(this.options.startAngle)&&(0,i.isNumber)(this.options.endAngle)&&(this.center=this.getCenter()),this.slots||(this.slots=[]),(0,i.isNumber)(this.options.startAngle)&&(0,i.isNumber)(this.options.endAngle)?(super.translate(t),this.slots=this.getSlots()):(this.generatePoints(),(0,i.fireEvent)(this,"afterTranslate"))}}c.defaultOptions=(0,i.merge)(d.defaultOptions,h),(0,i.extend)(c.prototype,{markerAttribs:void 0,pointClass:l}),r().registerSeriesType("item",c);let p=s();export{p as default};