let t,e;/**
 * Highcharts JS v12.5.0 (2026-01-12)
 * @module highcharts/modules/pattern-fill
 * @requires highcharts
 *
 * Module for adding patterns and images as point fills.
 *
 * (c) 2010-2026 Highsoft AS
 * Author: Torstein Hønsi, Øystein Moseng
 *
 * A commercial license may be required depending on use.
 * See www.highcharts.com/license
 */import*as r from"../highcharts.js";var i,a,o,h={};h.n=t=>{var e=t&&t.__esModule?()=>t.default:()=>t;return h.d(e,{a:e}),e},h.d=(t,e)=>{for(var r in e)h.o(e,r)&&!h.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},h.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let n=r.default;var s=h.n(n);let{animObject:l}=s(),{getOptions:p}=s(),{addEvent:c,defined:d,erase:f,extend:g,merge:u,pick:m,removeEvent:y,wrap:x}=s(),M=function(){let t=[],e=p().colors,r=0;for(let i of["M 0 0 L 5 5 M 4.5 -0.5 L 5.5 0.5 M -0.5 4.5 L 0.5 5.5","M 0 5 L 5 0 M -0.5 0.5 L 0.5 -0.5 M 4.5 5.5 L 5.5 4.5","M 2 0 L 2 5 M 4 0 L 4 5","M 0 2 L 5 2 M 0 4 L 5 4","M 0 1.5 L 2.5 1.5 L 2.5 0 M 2.5 5 L 2.5 3.5 L 5 3.5"])t.push({path:i,color:e[r++],width:5,height:5,patternTransform:"scale(1.4 1.4)"});for(let i of(r=5,["M 0 0 L 5 10 L 10 0","M 3 3 L 8 3 L 8 8 L 3 8 Z","M 5 5 m -4 0 a 4 4 0 1 1 8 0 a 4 4 0 1 1 -8 0","M 0 0 L 10 10 M 9 -1 L 11 1 M -1 9 L 1 11","M 0 10 L 10 0 M -1 1 L 1 -1 M 9 11 L 11 9"]))t.push({path:i,color:e[r++],width:10,height:10});return t}();function w(t,e){let r=JSON.stringify(t),i=r.length||0,a=0,o=0,h;if(e){h=Math.max(Math.floor(i/500),1);for(let t=0;t<i;t+=h)a+=r.charCodeAt(t);a&=a}for(;o<i;++o)a=(a<<5)-a+r.charCodeAt(o),a&=a;return a.toString(16).replace("-","1")}function _(){if(this.renderer&&(this.renderer.defIds||[]).filter(t=>t&&t.indexOf&&0===t.indexOf("highcharts-pattern-")).length){for(let t of this.series)if(t.visible)for(let e of t.points){let t=e.options&&e.options.color;t&&t.pattern&&(t.pattern._width="defer",t.pattern._height="defer")}this.redraw(!1)}}function L(){let t={},e=this.renderer,r=(e.defIds||[]).filter(t=>t.indexOf&&0===t.indexOf("highcharts-pattern-"));if(r.length)for(let i of([].forEach.call(this.renderTo.querySelectorAll('[color^="url("], [fill^="url("], [stroke^="url("]'),r=>{let i=r.getAttribute("fill")||r.getAttribute("color")||r.getAttribute("stroke");i&&(t[i.replace(e.url,"").replace("url(#","").replace(")","")]=!0)}),r))!t[i]&&(f(e.defIds,i),e.patternElements[i]&&(e.patternElements[i].destroy(),delete e.patternElements[i]))}function b(){let t=this.options.color;t&&t.pattern&&("string"==typeof t.pattern.path&&(t.pattern.path={d:t.pattern.path}),this.color=this.options.color=u(this.series.options.color,t))}function A(t){let e=t.args[0],r=t.args[1],i=t.args[2],a=this.chartIndex||0,o=e.pattern,h="#333333";if(void 0!==e.patternIndex&&M&&(o=M[e.patternIndex]),!o)return!0;if(o.image||"string"==typeof o.path||o.path&&o.path.d){let t=i.parentNode&&i.parentNode.getAttribute("class");t=t&&t.indexOf("highcharts-legend")>-1,("defer"===o._width||"defer"===o._height)&&E.call({graphic:{element:i}},o),(t||!o.id)&&((o=u({},o)).id="highcharts-pattern-"+a+"-"+w(o)+w(o,!0)),this.addPattern(o,!this.forExport&&m(o.animation,this.globalAnimation,{duration:100})),h=`url(${this.url}#${o.id+(this.forExport?"-export":"")})`}else h=o.color||h;return i.setAttribute(r,h),e.toString=function(){return h},!1}function C(){let t=this.chart.isResizing;if(this.isDirtyData||t||!this.chart.hasRendered)for(let e of this.points){let r=e.options&&e.options.color;r&&r.pattern&&(t&&!(e.shapeArgs&&e.shapeArgs.width&&e.shapeArgs.height)?(r.pattern._width="defer",r.pattern._height="defer"):e.calculatePatternDimensions(r.pattern))}}function E(t){if(t.width&&t.height)return;let e=this.graphic&&(this.graphic.getBBox&&this.graphic.getBBox(!0)||this.graphic.element&&this.graphic.element.getBBox())||{},r=this.shapeArgs;if(r&&(e.width=r.width||e.width,e.height=r.height||e.height,e.x=r.x||e.x,e.y=r.y||e.y),t.image){if(!e.width||!e.height){t._width="defer",t._height="defer";let e=this.series.chart.mapView&&this.series.chart.mapView.getSVGTransform().scaleY;d(e)&&e<0&&(t._inverted=!0);return}t.aspectRatio&&(e.aspectRatio=e.width/e.height,t.aspectRatio>e.aspectRatio?e.aspectWidth=e.height*t.aspectRatio:e.aspectHeight=e.width/t.aspectRatio),t._width=t.width||Math.ceil(e.aspectWidth||e.width),t._height=t.height||Math.ceil(e.aspectHeight||e.height)}t.width||(t._x=t.x||0,t._x+=e.x-Math.round(e.aspectWidth?Math.abs(e.aspectWidth-e.width)/2:0)),t.height||(t._y=t.y||0,t._y+=e.y-Math.round(e.aspectHeight?Math.abs(e.aspectHeight-e.height)/2:0))}function O(t,e){let r=m(e,!0),i=l(r),a=t.color||"#333333",o=t.height||("number"==typeof t._height?t._height:0)||32,h=t=>this.rect(0,0,n,o).attr({fill:t}).add(g),n=t.width||("number"==typeof t._width?t._width:0)||32,p,c=t.id,d;if(!c&&(this.idCounter=this.idCounter||0,c="highcharts-pattern-"+this.idCounter+"-"+(this.chartIndex||0),++this.idCounter),this.forExport&&(c+="-export"),this.defIds=this.defIds||[],this.defIds.indexOf(c)>-1)return;this.defIds.push(c);let f={id:c,patternUnits:"userSpaceOnUse",patternContentUnits:t.patternContentUnits||"userSpaceOnUse",width:n,height:o,x:t._x||t.x||0,y:t._y||t.y||0};t._inverted&&(f.patternTransform="scale(1, -1)",t.patternTransform&&(t.patternTransform+=" scale(1, -1)")),t.patternTransform&&(f.patternTransform=t.patternTransform);let g=this.createElement("pattern").attr(f).add(this.defs);return g.id=c,t.path?(d=s().isObject(t.path)?t.path:{d:t.path},t.backgroundColor&&h(t.backgroundColor),p={d:d.d},this.styledMode||(p.stroke=d.stroke||a,p["stroke-width"]=m(d.strokeWidth,2),p.fill=d.fill||"none"),d.transform&&(p.transform=d.transform),this.createElement("path").attr(p).add(g),g.color=a):t.image&&(r?this.image(t.image,0,0,n,o,function(){this.animate({opacity:m(t.opacity,1)},i),y(this.element,"load")}).attr({opacity:0}).add(g):this.image(t.image,0,0,n,o).add(g)),t.image&&r||void 0===t.opacity||[].forEach.call(g.element.childNodes,e=>{e.setAttribute("opacity",t.opacity)}),this.patternElements=this.patternElements||{},this.patternElements[c]=g,g}function I(t){let e=this.options.color;e&&e.pattern&&!e.pattern.color?(delete this.options.color,t.apply(this,[].slice.call(arguments,1)),e.pattern.color=this.color,this.color=this.options.color=e):t.apply(this,[].slice.call(arguments,1))}function R(){if(!this.chart?.mapView)return;let t=this.chart.renderer,e=t.patternElements;t.defIds?.length&&e&&this.points.filter(function(t){return!!t.graphic&&(t.graphic.element.hasAttribute("fill")||t.graphic.element.hasAttribute("color")||t.graphic.element.hasAttribute("stroke"))&&!t.options.color?.pattern?.image&&!!t.group?.scaleX&&!!t.group?.scaleY}).map(function(e){return{id:(e.graphic?.element.getAttribute("fill")||e.graphic?.element.getAttribute("color")||e.graphic?.element.getAttribute("stroke")||"").replace(t.url,"").replace("url(#","").replace(")",""),x:e.group?.scaleX||1,y:e.group?.scaleY||1}}).filter(function(t,e,r){return""!==t.id&&-1!==t.id.indexOf("highcharts-pattern-")&&!r.some(function(r,i){return r.id===t.id&&i<e})}).forEach(function(t){let r=t.id;e[r].scaleX=1/t.x,e[r].scaleY=1/t.y,e[r].updateTransform("patternTransform")})}let T=s();T.patterns=M,i=T.Chart,a=T.Series,o=T.SVGRenderer,(e=(t=a.prototype.pointClass).prototype).calculatePatternDimensions||(c(i,"endResize",_),c(i,"redraw",L),g(e,{calculatePatternDimensions:E}),c(t,"afterInit",b),c(a,"render",C),x(a.prototype,"getColor",I),c(a,"afterRender",R),c(a,"mapZoomComplete",R),g(o.prototype,{addPattern:O}),c(o,"complexColor",A));let k=s();export{k as default};