/**
 * Highcharts JS v12.6.0 (2026-04-13)
 * @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 t from"../highcharts.js";var e={};e.n=t=>{var r=t&&t.__esModule?()=>t.default:()=>t;return e.d(r,{a:r}),r},e.d=(t,r)=>{for(var i in r)e.o(r,i)&&!e.o(t,i)&&Object.defineProperty(t,i,{enumerable:!0,get:r[i]})},e.o=(t,e)=>Object.prototype.hasOwnProperty.call(t,e);let r=t.default;var i=e.n(r);let{doc:n,win:o}=i();function a(t,e,r,n={}){let o="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let h=o.hcEvents;i().Point&&t instanceof i().Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let s=t.addEventListener;s&&s.call(t,e,r,!!i().supportsPassiveEvents&&{passive:void 0===n.passive?-1!==e.indexOf("touch"):n.passive,capture:!1}),h[e]||(h[e]=[]);let l={fn:r,order:"number"==typeof n.order?n.order:1/0};return h[e].push(l),h[e].sort((t,e)=>t.order-e.order),function(){f(t,e,r)}}function h(t,e){let r;for(r in t||(t={}),e)t[r]=e[r];return t}function s(t){return l(t)&&"number"==typeof t.nodeType}function l(t,e){let r;return!!t&&"object"==typeof t&&(!e||"[object Array]"!==(r=Object.prototype.toString.call(t))&&"[object Array Iterator]"!==r)}function c(t,...e){let r,i=[t,...e],n={},o=function(t,e){return"object"!=typeof t&&(t={}),p(e,function(r,i){if("__proto__"!==i&&"constructor"!==i){let n;!l(r,!0)||(n=r?.constructor,l(r,!0)&&!s(r)&&n?.name&&"Object"!==n.name)||s(r)?t[i]=e[i]:t[i]=o(t[i]||{},r)}}),t};!0===t&&(n=i[1],i=Array.prototype.slice.call(i,2));let a=i.length;for(r=0;r<a;r++)n=o(n,i[r]);return n}function p(t,e,r){for(let i in t)Object.hasOwnProperty.call(t,i)&&e.call(r||t[i],t[i],i,t)}function d(){let t=arguments,e=t.length;for(let r=0;r<e;r++){let e=t[r];if(null!=e)return e}}function f(t,e,r){function i(e,r){let i=t.removeEventListener;i&&i.call(t,e,r,!1)}function n(r){let n,o;t.nodeName&&(e?(n={})[e]=!0:n=r,p(n,function(t,e){if(r[e])for(o=r[e].length;o--;)i(e,r[e][o].fn)}))}let o="function"==typeof t&&t.prototype||t;if(Object.hasOwnProperty.call(o,"hcEvents")){let t=o.hcEvents;if(e){let o=t[e]||[];r?(t[e]=o.filter(function(t){return r!==t.fn}),i(e,r)):(n(t),t[e]=[])}else n(t),delete o.hcEvents}}Array.prototype.find;let{animObject:u}=i(),{getOptions:g}=i(),m=function(){let t=[],e=g().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 y(t,e){let r=JSON.stringify(t),i=r.length||0,n=0,o=0,a;if(e){a=Math.max(Math.floor(i/500),1);for(let t=0;t<i;t+=a)n+=r.charCodeAt(t);n&=n}for(;o<i;++o)n=(n<<5)-n+r.charCodeAt(o),n&=n;return n.toString(16).replace("-","1")}function x(){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 w(){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]&&(!function(t,e){let r=t.length;for(;r--;)if(t[r]===e){t.splice(r,1);break}}(e.defIds,i),e.patternElements[i]&&(e.patternElements[i].destroy(),delete e.patternElements[i]))}function _(){let t=this.options.color;t&&(t.pattern||void 0!==t.patternIndex)&&("string"==typeof t.pattern?.path&&(t.pattern.path={d:t.pattern.path}),this.color=this.options.color=c(this.series.options.color,t))}function b(t){let e=t.args[0],r=t.args[1],i=t.args[2],n=this.chartIndex||0,o=e.pattern,a="#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");if(t=t&&t.indexOf("highcharts-legend")>-1,("defer"===o._width||"defer"===o._height)&&L.call({graphic:{element:i}},o),t||!o.id||o.anchorToPoint){let t,e;(o=c({},o)).anchorToPoint&&(t=c({},o),t._x=(e=i.getBBox?i.getBBox():{x:0,y:0,width:32,height:32}).x,t._y=e.y,o=t),o.id="highcharts-pattern-"+n+"-"+y(o)+y(o,!0)+(o.anchorToPoint?"-anchored":"")}this.addPattern(o,!this.forExport&&d(o.animation,this.globalAnimation,{duration:100})),a=`url(${this.url}#${o.id+(this.forExport?"-export":"")})`}else a=o.color||a;return i.setAttribute(r,a),e.toString=function(){return a},!1}function M(){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 L(t){if(t.width&&t.height&&!t.anchorToPoint)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;null!=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.anchorToPoint?(t._x=0,t._y=0,t.width||(t._width=e.width),t.height||(t._height=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 v(t,e){let r=d(e,!0),i=u(r),n=t.color||"#333333",o=t.height||("number"==typeof t._height?t._height:0)||32,a=t.width||("number"==typeof t._width?t._width:0)||32,h=t.anchorToPoint?"userSpaceOnUse":t.patternContentUnits||"userSpaceOnUse",s=t=>this.rect(0,0,a,o).attr({fill:t}).add(y),c,p=t.id,g;if(!p&&(this.idCounter=this.idCounter||0,p="highcharts-pattern-"+this.idCounter+"-"+(this.chartIndex||0),++this.idCounter),this.forExport&&(p+="-export"),this.defIds=this.defIds||[],this.defIds.indexOf(p)>-1)return;this.defIds.push(p);let m={id:p,patternUnits:"userSpaceOnUse",patternContentUnits:h,width:a,height:o,x:t._x||t.x||0,y:t._y||t.y||0};t._inverted&&(m.patternTransform="scale(1, -1)",t.patternTransform&&(t.patternTransform+=" scale(1, -1)")),t.patternTransform&&(m.patternTransform=t.patternTransform);let y=this.createElement("pattern").attr(m).add(this.defs);return y.id=p,t.path?(g=l(t.path)?t.path:{d:t.path},t.backgroundColor&&s(t.backgroundColor),c={d:g.d},this.styledMode||(c.stroke=g.stroke||n,c["stroke-width"]=d(g.strokeWidth,2),c.fill=g.fill||"none"),g.transform&&(c.transform=g.transform),this.createElement("path").attr(c).add(y),y.color=n):t.image&&(r?this.image(t.image,0,0,a,o,function(){this.animate({opacity:d(t.opacity,1)},i),f(this.element,"load")}).attr({opacity:0}).add(y):this.image(t.image,0,0,a,o).add(y)),t.image&&r||void 0===t.opacity||[].forEach.call(y.element.childNodes,e=>{e.setAttribute("opacity",t.opacity)}),this.patternElements=this.patternElements||{},this.patternElements[p]=y,y}function A(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 E(){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 O=i();O.patterns=m,function(t,e,r){let i=e.prototype.pointClass,n=i.prototype;if(!n.calculatePatternDimensions){var o,s;let l;a(t,"endResize",x),a(t,"redraw",w),h(n,{calculatePatternDimensions:L}),a(i,"afterInit",_),a(e,"render",M),o=e.prototype,l=o[s="getColor"],o[s]=function(){let t=arguments,e=this;return A.apply(this,[function(){return l.apply(e,arguments.length?arguments:t)}].concat([].slice.call(arguments)))},a(e,"afterRender",E),a(e,"mapZoomComplete",E),h(r.prototype,{addPattern:v}),a(r,"complexColor",b)}}(O.Chart,O.Series,O.SVGRenderer);let P=i();export{P as default};