@progress/kendo-ui
Version:
This package is part of the [Kendo UI for jQuery](http://www.telerik.com/kendo-ui) suite.
3 lines • 514 kB
JavaScript
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports,require("kendo.drawing.cmn.chunk.js")):"function"==typeof define&&define.amd?define(["exports","kendo.drawing.cmn.chunk.min"],e):e(((t="undefined"!=typeof globalThis?globalThis:t||self).kendo=t.kendo||{},t.kendo._globals=t.kendo._globals||{},t.kendo._globals.ChartsCmnChunk={}),t.kendo._globals.DrawingCmnChunk)}(this,(function(t,e){const i="arc",s="ArrowUp",o="ArrowDown",n="ArrowLeft",r="ArrowRight",a="aria-activedescendant",l="axisLabelClick",h="#000",c="bottom",d="center",u="circle",p="cross",g="date",m="12px sans-serif",f=10,x=600,y="end",v="Enter",b="Escape",w=/\{\d+:?/,_="height",k="inside",A="inherit",S="left",C=Number.MAX_VALUE,T=-Number.MAX_VALUE,P="none",M="noteClick",E="noteHover",L="noteLeave",I="object",R="outside",B="right",O="roundedRect",V="start",D="string",z="top",F="triangle",H="square",N="rect",j="value",U="#fff",G="width",W="x",X="y",Y="pointer",q="horizontal",Z="vertical";var $=Object.freeze({__proto__:null,ARC:i,ARIA_ACTIVE_DESCENDANT:a,ARROW_DOWN:o,ARROW_LEFT:n,ARROW_RIGHT:r,ARROW_UP:s,AXIS_LABEL_CLICK:l,BLACK:h,BOTTOM:c,CENTER:d,CIRCLE:u,COORD_PRECISION:3,CROSS:p,DATE:g,DEFAULT_FONT:m,DEFAULT_HEIGHT:400,DEFAULT_PRECISION:f,DEFAULT_SERIES_OPACITY:1,DEFAULT_WIDTH:x,END:y,ENTER:v,ESCAPE:b,FORMAT_REGEX:w,HEIGHT:_,HIGHLIGHT_ZINDEX:100,HORIZONTAL:q,INHERIT:A,INSIDE:k,LEFT:S,MAX_VALUE:C,MIN_VALUE:T,NONE:P,NOTE_CLICK:M,NOTE_HOVER:E,NOTE_LEAVE:L,OBJECT:I,OUTSIDE:R,POINTER:Y,RECT:N,RIGHT:B,ROUNDED_RECT:O,SQUARE:H,START:V,STRING:D,TAB:"Tab",TOP:z,TRIANGLE:F,VALUE:j,VERTICAL:Z,WHITE:U,WIDTH:G,X:W,Y:X});function Q(t){return Array.isArray(t)}function K(t,e){const i=Q(e)?e:[e];for(let e=0;e<i.length;e++){const s=i[e];-1===t.className.indexOf(s)&&(t.className+=" "+s)}}const J=/\s+/g;function tt(t,e){t&&t.className&&(t.className=t.className.replace(e,"").replace(J," "))}function et(t){let i=.5;t.options.stroke&&e.d(t.options.stroke.width)&&t.options.stroke.width%2==0&&(i=0);for(let e=0;e<t.segments.length;e++)t.segments[e].anchor().round(0).translate(i,i);return t}function it(t,e){return-t.x*e.y+t.y*e.x<0}function st(t){return"number"==typeof t&&!isNaN(t)}function ot(t){return typeof t===D}function nt(t){return st(t)||ot(t)&&isFinite(t)}function rt(t,e){return(t+1)%e}function at(t,e){let i=t-1;return i<0?e-1:i}function lt(t,e){return 1===e||t%e==0?0:t<0?e+t%e:t>=e?t%e:t}function ht(t){return"function"==typeof t}const ct="object";function dt(t,e){for(let i in e){if("__proto__"===i||"constructor"===i)continue;let s,o=e[i],n=typeof o;if(s=n===ct&&null!==o?o.constructor:null,s&&s!==Array)if(o instanceof Date)t[i]=new Date(o.getTime());else if(ht(o.clone))t[i]=o.clone();else{let e=t[i];t[i]=typeof e===ct&&e||{},dt(t[i],o)}else"undefined"!==n&&(t[i]=o)}return t}function ut(t){const e=arguments.length;for(let i=1;i<e;i++)dt(t,arguments[i]);return t}function pt(t){return"object"==typeof t}function gt(t){return st(t)?t+"px":t}const mt=/width|height|top|left|bottom|right/i;function ft(t){return mt.test(t)}function xt(t,e){const i=ot(e)?[e]:e;if(Q(i)){const e={},s=window.getComputedStyle(t);for(let t=0;t<i.length;t++){let o=i[t];e[o]=ft(o)?parseFloat(s[o]):s[o]}return e}if(pt(e))for(let i in e)t.style[i]=gt(e[i])}function yt(t,e=0){const i={top:0,right:0,bottom:0,left:0};return"number"==typeof t?i[z]=i[B]=i[c]=i[S]=t:(i[z]=t[z]||e,i[B]=t[B]||e,i[c]=t[c]||e,i[S]=t[S]||e),i}let vt={compile:function(t){return t}};class bt{static register(t){vt=t}static compile(t,e){return vt.compile(t,e)}}function wt(t={}){let e;return t.template?t.template=e=bt.compile(t.template):ht(t.content)&&(e=t.content),e}function _t(t={}){let e;return t.ariaTemplate?t.ariaTemplate=e=bt.compile(t.ariaTemplate):ht(t.ariaContent)&&(e=t.ariaContent),e}const kt=/\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g,At={};function St(t){if(At[t])return At[t];const i=[];return t.replace(kt,(function(t,s,o,n){i.push(e.d(s)?s:o||n)})),At[t]=function(t){let e=t;for(let t=0;t<i.length&&e;t++)e=e[i[t]];return e},At[t]}function Ct(t,e){const i=t.length,s=[];for(let o=0;o<i;o++)e(t[o])&&s.push(t[o]);return s}function Tt(t,e){if(t.className){const i=e.split(" ");for(let e=0;e<i.length;e++)if(t.className.indexOf&&-1!==t.className.indexOf(i[e]))return!0}}At[void 0]=function(t){return t};class Pt{constructor(){this._map=new Map}get(t){return this._map.get(t)}set(t,e){this._map.set(t,e)}}function Mt(t,e){if(e)return-1!==e.indexOf(t)}function Et(t,i,s){return e.r(t+(i-t)*s,3)}const Lt="trigger";class It{constructor(t,e){this.observer=t,this.handlerMap=ut({},this.handlerMap,e)}trigger(t,e){const{observer:i,handlerMap:s}=this;let o;return s[t]?o=this.callObserver(s[t],e):i[Lt]&&(o=this.callObserver(Lt,t,e)),o}callObserver(t,...e){return this.observer[t].apply(this.observer,e)}requiresHandlers(t){if(this.observer.requiresHandlers)return this.observer.requiresHandlers(t);for(let e=0;e<t.length;e++)if(this.handlerMap[t[e]])return!0}}function Rt(t){return"[object Object]"===Object.prototype.toString.call(t)}function Bt(t,i){const s=t.length,o=[];for(let n=0;n<s;n++){let s=i(t[n]);e.d(s)&&o.push(s)}return o}const Ot=e.s.browser||{};function Vt(t){let e=0;return t.wheelDelta?(e=-t.wheelDelta/120,Ot.webkit&&(e/=2*Math.max(window.devicePixelRatio,.625))):t.detail&&(e=t.detail/3),e=e>0?Math.ceil(e):Math.floor(e),e}const{append:Dt,bindEvents:zt,defined:Ft,deg:Ht,elementOffset:Nt,elementSize:jt,eventCoordinates:Ut,eventElement:Gt,hashKey:Wt,last:Xt,limitValue:Yt,objectKey:qt,rad:Zt,round:$t,unbindEvents:Qt,valueOrDefault:Kt}=e.u;class Jt{static fetchFonts(t,e,i={depth:0}){!t||i.depth>5||!document.fonts||Object.keys(t).forEach((function(s){const o=t[s];"dataSource"!==s&&"$"!==s[0]&&o&&("font"===s?e.push(o):"object"==typeof o&&(i.depth++,Jt.fetchFonts(o,e,i),i.depth--))}))}static loadFonts(t,i){let s=[];if(t.length>0&&document.fonts){try{s=t.map((function(t){return document.fonts.load(t)}))}catch(t){e.l(t)}Promise.all(s).then(i,i)}else i()}static preloadFonts(t,e){const i=[];Jt.fetchFonts(t,i),Jt.loadFonts(i,e)}}function te(t,e){const i=t.prototype;i.options?i.options=ut({},i.options,e):i.options=e}const ee="k-i-",ie="k-svg-i-";class se{constructor(t,e){this.element=t,this.options=ut({},this.options,e),this.wrapper()}wrapper(){this.addClasses()}addClasses(){}html(){return this.element.outerHTML}}te(se,{name:"",size:"none",themeColor:"none",flip:"default",iconClass:"",stylingOptions:["size","themeColor","fill"]});class oe extends se{constructor(t,e){super(t,e)}wrapper(){let t=this.element.className.split(" ").find((t=>t.startsWith(ee))),e=this.options.icon?`${this.options.icon.startsWith(ee)?"":ee}${this.options.icon}`:"";this._className=e,K(this.element,"k-icon"),K(this.element,"k-font-icon"),tt(this.element,t),K(this.element,e),K(this.element,this.options.iconClass||""),super.wrapper()}}te(oe,{name:"HTMLFontIcon",icon:null});class ne extends se{constructor(t,e){t.innerHTML="",super(t,e)}wrapper(){let t=this.options.icon,e=this.options.iconClass,i=this.element.className.split(" ").find((t=>t.startsWith(ie)));if(!t&&e){const i=/k-i-(\w+(?:-\w+)*)/;let s=e.match(i);s&&(t=s[1],e=e.replace(s[0],""))}ot(t)&&(t=t.replace("k-i-","").replace(/-./g,(t=>t[1].toUpperCase())),t=this.options.svgIcons[t]||this.options.svgIcons[`${t}Icon`]);let s=t&&t.name?`${ie}${t.name}`:"";if(this._className=s,K(this.element,"k-svg-icon"),tt(this.element,i),K(this.element,s),K(this.element,e||""),this.element.setAttribute("aria-hidden","true"),t&&Rt(t)){let e=document.createElementNS("http://www.w3.org/2000/svg","svg");e.setAttribute("viewBox",t.viewBox||""),e.setAttribute("focusable","false"),e.innerHTML=t.content||"",this.element.appendChild(e)}super.wrapper()}}te(ne,{name:"HTMLSvgIcon",icon:null,svgIcons:{}});const re={svg:ne,font:oe};function ae(t,e){let i=t,s=e;return i&&(!pt(i)||i instanceof HTMLElement)&&!ot(i)||(s=i,i=document.createElement("span")),ot(s)&&(s={icon:s}),s.type||(s.type="svg"),re[s.type]?new re[s.type](i,s).html():null}function le(t){let e=C,i=T;for(let s=0,o=t.length;s<o;s++){const o=t[s];null!==o&&isFinite(o)&&(e=Math.min(e,o),i=Math.max(i,o))}return{min:e===C?void 0:e,max:i===T?void 0:i}}function he(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(e(s,i,t))return s}}const ce=e.M,de=/matrix\((.*)\)/;function ue(t){const e=getComputedStyle(t).transform;return"none"===e?ce.unit():function(t){const e=t.match(de);if(null===e||2!==e.length)return ce.unit();const i=e[1].split(",").map((t=>parseFloat(t)));return new ce(...i)}(e)}function pe(t){if(!t)return ce.unit();let e=ue(t),i=t.parentElement;for(;i;){const t=ue(i);e=e.multiplyCopy(t),i=i.parentElement}return e.b=e.c=e.e=e.f=0,e}function ge(t){return new e.C(t).isDark()?U:h}const me={};class fe{constructor(t){this._index={},this._values=t?t.slice(0):[];for(let t=0;t<this._values.length;t++)this._index[this._values[t]]=t}values(){return this._values.filter((t=>t!==me))}has(t){return void 0!==this._index[t]}add(t){this.has(t)||(this._index[t]=this._values.length,this._values.push(t))}delete(t){const e=this._index[t];void 0!==e&&(this._values[e]=me,delete this._index[t])}clear(){this._index={},this._values=[]}get size(){return this._values.length}}class xe{constructor(t){this._set=new Set(t)}values(){return Array.from(this._set)}has(t){return this._set.has(t)}add(t){this._set.add(t)}delete(t){this._set.delete(t)}clear(){this._set.clear()}get size(){return this._set.size}}function ye(t){return(()=>{let t=!1;"function"==typeof Set&&(t=new Set([1]).has(1));return t})()?new xe(t):new fe(t)}function ve(t){throw t}let be={INSERT:45,DELETE:46,BACKSPACE:8,TAB:9,ENTER:13,ESC:27,LEFT:37,UP:38,RIGHT:39,DOWN:40,END:35,HOME:36,SPACEBAR:32,PAGEUP:33,PAGEDOWN:34,F2:113,F10:121,F12:123,NUMPAD_PLUS:107,NUMPAD_MINUS:109,NUMPAD_DOT:110};function we(t,e){return Object.prototype.hasOwnProperty.call(t,e)}class _e{constructor(){this.height=0,this.width=0,this.data=[]}clone(){const t=new _e;return t.height=this.height,t.width=this.width,t.data=this.data.map((t=>t.slice())),t}get(t,e){const i=this.data[t];return i?i[e]:null}set(t,e,i){let s=this.data[t];null==s&&(s=this.data[t]=[]),s[e]=i,t>=this.height&&(this.height=t+1),e>=this.width&&(this.width=e+1)}each(t,e){for(let i=0;i<this.height;++i)for(let s=0;s<this.width;++s){let o=this.get(i,s);if((e||null!=o)&&(o=t(o,i,s),void 0!==o))return o}}map(t,e){const i=new _e;return this.each((function(e,s,o){i.set(s,o,t(e,s,o))}),e),i}transpose(){const t=new _e;return this.each((function(e,i,s){t.set(s,i,e)})),t}unit(t){this.width=this.height=t;const e=this.data=new Array(t);for(let i=t;--i>=0;){const s=e[i]=new Array(t);for(let e=t;--e>=0;)s[e]=i===e?1:0}return this}multiply(t){const e=this,i=new _e;for(let s=0;s<e.height;++s)for(let o=0;o<t.width;++o){let n=0;for(let i=0;i<e.width;++i){const r=e.get(s,i),a=t.get(i,o);"number"==typeof r&&"number"==typeof a&&(n+=r*a)}i.set(s,o,n)}return i}inverse(){const t=this.width,e=this.augment((new _e).unit(t)),i=e.data;for(let e=0;e<t;++e){const s=ke(e,t,(function(t){return i[t][e]}));if(!i[s][e])return null;if(e!==s){let t=i[e];i[e]=i[s],i[s]=t}for(let s=e+1;s<t;++s){for(let o=e+1;o<2*t;++o)i[s][o]-=i[e][o]*i[s][e]/i[e][e];i[s][e]=0}}for(let e=0;e<t;++e)for(let s=i[e][e],o=0;o<2*t;++o)i[e][o]/=s;for(let e=t;--e>=0;)for(let s=e;--s>=0;)if(i[s][e])for(let o=2*t;--o>=t;)i[s][o]-=i[e][o]*i[s][e];return e.slice(0,t,t,t)}augment(t){const e=this.clone(),i=e.width;return t.each((function(t,s,o){e.set(s,o+i,t)})),e}slice(t,e,i,s){const o=new _e;for(let n=0;n<i;++n)for(let i=0;i<s;++i)o.set(n,i,this.get(t+n,e+i));return o}}function ke(t,e,i){let s=i(t),o=t;for(let n=t+1;n<e;n++){const e=i(t);e>s&&(s=e,o=t)}return o}const Ae={down:"pointerdown",move:"pointermove",up:"pointerup",cancel:"pointercancel pointerleave"};function Se(t){return Ae[t]||t}const Ce=t=>t.replace(/([^ ]+)/g,Se);function Te(){let t,e,i="";for(t=0;t<32;t++)e=16*Math.random()|0,8!==t&&12!==t&&16!==t&&20!==t||(i+="-"),i+=(12===t?4:16===t?3&e|8:e).toString(16);return i}const Pe=new WeakMap,Me=Symbol("id");function Ee(t,e,i,s,o){!function(t,e,i,s,o){const n=Q(e)?e:(e||"").split(" ");n.forEach((function(e){!function(t,e,i,s,o){let n,r=s;i&&ht(i)&&!s?r=i:i&&function(t){return"string"==typeof t}(i)&&ht(r)&&(n=i);const a=function(e){const i=e.target?e.target.closest(n):null;if(!n||n&&e.target&&i){const s=n?i:e.currentTarget;Object.defineProperty(e,"currentTarget",{value:s}),Object.defineProperty(e,"delegateTarget",{value:t}),r(e)}};r[Me]||(r[Me]=Te());let l=Pe.get(t);l||(l=new Map,Pe.set(t,l));l.set(e+r[Me],a),t.addEventListener(e,a,Boolean(o))}(t,e,i,s,o)}))}(t,e,i,s,o)}function Le(t,e,i,s,o){!function(t,e,i,s){const o=Q(e)?e:(e||"").split(" ");o.forEach((function(e){!function(t,e,i,s){const o=Pe.get(t);if(o&&i&&i[Me]){const n=e+i[Me],r=o.get(n);o.delete(n),r&&t.removeEventListener(e,r,Boolean(s))}}(t,e,i,s)}))}(t,e,i,s)}function Ie(){const t=function(t){let e=!1;const i={wp:/(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,fire:/(Silk)\/(\d+)\.(\d+(\.\d+)?)/,android:/(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.?(\d+(\.\d+)?)?/,iphone:/(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,ipad:/(iPad).*OS\s+(\d+)[\._]([\d_]+)/,playbook:/(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,windows:/(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,tizen:/(tizen).*?Version\/(\d+)\.(\d+(\.\d+)?)/i,sailfish:/(sailfish).*rv:(\d+)\.(\d+(\.\d+)?).*firefox/i},s={ios:/^i(phone|pad|pod)$/i,android:/^android|fire$/i,windows:/windows/,wp:/wp/,flat:/sailfish|ffos|tizen/i};for(let o in i){if(t.match(i[o])){if("windows"===o&&"plugins"in navigator)return!1;e={},e.device=o,e.name=Re(o,s),e[e.name]=!0;break}}return e}(navigator.userAgent),e={};return e.mobileOS=t,e}function Re(t,e,i){for(let i in e)if(e[i].test(t))return i;return void 0!==i?i:t}function Be(){}function Oe(){return(new Date).getTime()}const Ve="string",De="function";let ze=function(){this._defaultPrevented=!0},Fe=function(){return!0===this._defaultPrevented};class He extends e.a{constructor(){super(),this._events={}}destroy(){this.unbind()}bind(t,e,i){let s,o,n,r,a,l=this,h=typeof t===Ve?[t]:t||[],c=typeof e===De;if(void 0===e){for(s in t)l.bind(s,t[s]);return l}for(s=0,o=h.length;s<o;s++){let t=h[s];r=c?e:e[t],r&&(i&&(n=r,r=function(){l.unbind(t,r),n.apply(l,arguments)},r.original=n),a=l._events[t]=l._events[t]||[],a.push(r))}return l}one(t,e){return this.bind(t,e,!0)}first(t,e){let i,s,o,n,r=this,a=typeof t===Ve?[t]:t,l=typeof e===De;for(i=0,s=a.length;i<s;i++){let t=a[i];o=l?e:e[t],o&&(n=r._events[t]=r._events[t]||[],n.unshift(o))}return r}trigger(t,e){let i,s,o=this,n=o._events[t];if(n){let t=e||{};for(t.sender=o,t._defaultPrevented=!1,t.preventDefault=ze,t.isDefaultPrevented=Fe,n=n.slice(),i=0,s=n.length;i<s;i++)n[i].call(o,t);return!0===t._defaultPrevented}return!1}unbind(t,e){let i,s=this,o=s._events[t];if(void 0===t)s._events={};else if(o)if(e)for(i=o.length-1;i>=0;i--)o[i]!==e&&o[i].original!==e||o.splice(i,1);else s._events[t]=[];return s}_setEvents(t){const e=(this.events||[]).length;for(let i=0;i<e;i++){let e=this.events[i];this.options[e]&&t[e]&&(this.unbind(e,this.options[e]),this._events&&this._events[e]&&delete this._events[e])}this.bind(this.events,t)}}const Ne=Object.assign,je=t=>{t.preventDefault()};let Ue=800,Ge=0,We="press",Xe="hold",Ye="select",qe="start",Ze="move",$e="end",Qe="cancel",Ke="tap",Je="doubleTap",ti="release",ei="gesturechange",ii="gestureend",si="gesturetap",oi={api:0,touch:0,mouse:9,pointer:9};function ni(t){let e=[],i=t.originalEvent||t,s=t.currentTarget;return t.api?e.push({id:2,event:t,target:t.target,currentTarget:t.target,location:t,type:"api"}):e.push({location:i,event:t,target:t.target,currentTarget:s,id:i.pointerId,type:"pointer"}),e}class ri extends e.a{constructor(t,e){super();let i=this;i.support=Ie(),i.invalidZeroEvents=this.support.mobileOS&&this.support.mobileOS.android,i.axis=t,i._updateLocationData(e),i.startLocation=i.location,i.velocity=i.delta=0,i.timeStamp=Oe()}move(t){let e=this,i=t["page"+e.axis],s=Oe(),o=s-e.timeStamp||1;!i&&this.invalidZeroEvents||(e.delta=i-e.location,e._updateLocationData(t),e.initialDelta=i-e.startLocation,e.velocity=e.delta/o,e.timeStamp=s)}_updateLocationData(t){let e=this,i=e.axis;e.location=t["page"+i],e.client=t["client"+i],e.screen=t["screen"+i]}}class ai extends e.a{constructor(t,e,i){super(),Ne(this,{x:new ri("X",i.location),y:new ri("Y",i.location),type:i.type,threshold:t.threshold||oi[i.type],userEvents:t,target:e,currentTarget:i.currentTarget,initialTouch:i.target,id:i.id,pressEvent:i,_clicks:t._clicks,supportDoubleTap:t.supportDoubleTap,_moved:!1,_finished:!1})}press(){this._holdTimeout=setTimeout((()=>this._hold()),this.userEvents.minHold),this._trigger(We,this.pressEvent)}_tap(t){let e=this;e.userEvents._clicks++,1===e.userEvents._clicks&&(e._clickTimeout=setTimeout((function(){1===e.userEvents._clicks?e._trigger(Ke,t):e._trigger(Je,t),e.userEvents._clicks=0}),300))}_hold(){this._trigger(Xe,this.pressEvent)}move(t){let e=this,i="api"!==t.type&&e.userEvents._shouldNotMove;if(!e._finished&&!i){if(e.x.move(t.location),e.y.move(t.location),!e._moved){if(e._withinIgnoreThreshold())return;if(hi.current&&hi.current!==e.userEvents)return e.dispose();e._start(t)}e._finished||e._trigger(Ze,t)}}end(t){this.endTime=Oe(),this._finished||(this._finished=!0,this._trigger(ti,t),this._moved?this._trigger($e,t):this.supportDoubleTap?this._tap(t):this._trigger(Ke,t),clearTimeout(this._holdTimeout),this.dispose())}dispose(){let t=this.userEvents.touches||[];this._finished=!0,this.pressEvent=null,clearTimeout(this._holdTimeout);const e=t.indexOf(this);t.splice(e,1)}skip(){this.dispose()}cancel(){this.dispose()}isMoved(){return this._moved}_start(t){clearTimeout(this._holdTimeout),this.startTime=Oe(),this._moved=!0,this._trigger(qe,t)}_trigger(t,e){const i=e.event,s={touch:this,x:this.x,y:this.y,target:this.target,event:i};this.userEvents.notify(t,s)&&i.preventDefault()}_withinIgnoreThreshold(){let t=this.x.initialDelta,e=this.y.initialDelta;return Math.sqrt(t*t+e*e)<=this.threshold}}function li(t){let e=Ae.up.split(" "),i=0,s=e.length;for(;i<s;i++)t(e[i])}class hi extends He{constructor(t,e){super();let i,s=this;const o=Ie();if(this.support=o,e=e||{},this.options=e,i=s.filter=e.filter,s.threshold=e.threshold||Ge,s.minHold=e.minHold||Ue,s.touches=[],s._maxTouches=e.multiTouch?2:1,s.allowSelection=e.allowSelection,s.captureUpIfMoved=e.captureUpIfMoved,s._clicks=0,s.supportDoubleTap=e.supportDoubleTap,Ne(s,{element:t,surface:e.surface||t,stopPropagation:e.stopPropagation,pressed:!1}),this._surfaceMoveHandler=this._move.bind(this),Ee(s.surface,Ce("move"),this._surfaceMoveHandler),this._surfaceEndHandler=this._end.bind(this),Ee(s.surface,Ce("up cancel"),this._surfaceEndHandler),this._elementStartHandler=this._start.bind(this),Ee(t,Ce("down"),i,this._elementStartHandler),t.style["touch-action"]=e.touchAction||"none",e.preventDragEvent&&(this._elementDragStartHandler=je,Ee(t,Ce("dragstart"),this._elementDragStartHandler)),this._elementSelectHandler=this._select.bind(this),Ee(t,Ce("mousedown"),i,this._elementSelectHandler),s.captureUpIfMoved){let t=s.surface;s._preventIfMovingProxy=s.preventIfMoving.bind(s),li((function(e){t.addEventListener(e,s._preventIfMovingProxy,!0)}))}s.bind([We,Xe,Ke,Je,qe,Ze,$e,ti,Qe,"gesturestart",ei,ii,si,Ye],e)}preventIfMoving(t){this._isMoved()&&t.preventDefault()}destroy(){let t=this;const e=this.options,i=this.element;if(!t._destroyed){if(t._destroyed=!0,t.captureUpIfMoved){let e=t.surface;li((function(i){e.removeEventListener(i,t._preventIfMovingProxy,!0)}))}Le(t.surface,Ce("move"),this._surfaceMoveHandler),Le(t.surface,Ce("up cancel"),this._surfaceEndHandler),Le(i,Ce("down"),this._elementStartHandler),e.preventDragEvent&&Le(i,Ce("dragstart"),this._elementDragStartHandler),Le(i,Ce("mousedown"),this._elementSelectHandler),t._disposeAll(),t.unbind(),delete t.surface,delete t.element,delete t.currentTarget}}capture(){hi.current=this}cancel(){this._disposeAll(),this.trigger(Qe)}notify(t,e){let i=this.touches,s=t;if(this._isMultiTouch()){switch(s){case Ze:s=ei;break;case $e:s=ii;break;case Ke:s=si}Ne(e,{touches:i},function(t,e){let i=t.x.location,s=t.y.location,o=e.x.location,n=e.y.location,r=i-o,a=s-n;return{center:{x:(i+o)/2,y:(s+n)/2},distance:Math.sqrt(r*r+a*a)}}(i[0],i[1]))}return this.trigger(s,Ne(e,{type:s}))}press(t,e,i){this._apiCall("_start",t,e,i)}move(t,e){this._apiCall("_move",t,e)}end(t,e){this._apiCall("_end",t,e)}_isMultiTouch(){return this.touches.length>1}_maxTouchesReached(){return this.touches.length>=this._maxTouches}_disposeAll(){let t=this.touches;for(;t.length>0;)t.pop().dispose()}_isMoved(){return Ct(this.touches,(function(t){return t.isMoved()})).length}_select(t){this.allowSelection&&!this.trigger(Ye,{event:t})||t.preventDefault()}_start(t){if(t.which&&t.which>1||this._maxTouchesReached())return;let e;hi.current=null,this.currentTarget=t.currentTarget,this.stopPropagation&&t.stopPropagation();const i=ni(t);for(let t=0;t<i.length&&!this._maxTouchesReached();t++){const s=i[t];if(e=this.filter?s.currentTarget:this.element,e&&0===e.length)continue;const o=new ai(this,e,s);this.touches.push(o),o.press(),this._isMultiTouch()&&this.notify("gesturestart",{})}}_move(t){this._eachTouch("move",t)}_end(t){this._eachTouch("end",t)}_eachTouch(t,e){let i,s,o,n,r={},a=ni(e),l=this.touches;for(i=0;i<l.length;i++)s=l[i],r[s.id]=s;for(i=0;i<a.length;i++)if(o=a[i],n=r[o.id],n){"move"===t&&"pointer"===o.type&&!this.surface.hasPointerCapture(o.id)&&this.surface.setPointerCapture(o.id),n[t](o)}}_apiCall(t,e,i,s){this[t]({api:!0,pageX:e,pageY:i,clientX:e,clientY:i,target:s||this.element,stopPropagation:Be,preventDefault:Be})}static defaultThreshold(t){Ge=t}static minHold(t){Ue=t}}function ci(t,e){let i=$t(e-t,9);if(0===i){if(0===e)return.1;i=Math.abs(e)}const s=Math.pow(10,Math.floor(Math.log(i)/Math.log(10))),o=$t(i/s,f);let n=1;return n=o<1.904762?.2:o<4.761904?.5:o<9.523809?1:2,$t(s*n,f)}let di=class t extends e.a{constructor(t,e){super(),this.x=t||0,this.y=e||0}clone(){return new t(this.x,this.y)}equals(t){return t&&this.x===t.x&&this.y===t.y}rotate(t,e){const i=Zt(e),s=Math.cos(i),o=Math.sin(i),{x:n,y:r}=t,{x:a,y:l}=this;return this.x=$t(n+(a-n)*s+(l-r)*o,3),this.y=$t(r+(l-r)*s-(a-n)*o,3),this}multiply(t){return this.x*=t,this.y*=t,this}distanceTo(t){const e=this.x-t.x,i=this.y-t.y;return Math.sqrt(e*e+i*i)}static onCircle(e,i,s){const o=Zt(i);return new t(e.x-s*Math.cos(o),e.y-s*Math.sin(o))}};class ui extends e.a{constructor(t,e,i,s){super(),this.x1=t||0,this.y1=e||0,this.x2=i||0,this.y2=s||0}equals(t){return this.x1===t.x1&&this.x2===t.x2&&this.y1===t.y1&&this.y2===t.y2}width(){return this.x2-this.x1}height(){return this.y2-this.y1}translate(t,e){return this.x1+=t,this.x2+=t,this.y1+=e,this.y2+=e,this}move(t,e){const i=this.height(),s=this.width();return Ft(t)&&(this.x1=t,this.x2=this.x1+s),Ft(e)&&(this.y1=e,this.y2=this.y1+i),this}wrap(t){return this.x1=Math.min(this.x1,t.x1),this.y1=Math.min(this.y1,t.y1),this.x2=Math.max(this.x2,t.x2),this.y2=Math.max(this.y2,t.y2),this}wrapPoint(t){const e=Q(t),i=e?t[0]:t.x,s=e?t[1]:t.y;return this.wrap(new ui(i,s,i,s)),this}snapTo(t,e){return e!==W&&e||(this.x1=t.x1,this.x2=t.x2),e!==X&&e||(this.y1=t.y1,this.y2=t.y2),this}alignTo(t,e){const i=this.height(),s=this.width(),o=e===z||e===c?X:W,n=o===X?i:s;if(e===d){const e=t.center(),i=this.center();this.x1+=e.x-i.x,this.y1+=e.y-i.y}else this[o+1]=e===z||e===S?t[o+1]-n:t[o+2];return this.x2=this.x1+s,this.y2=this.y1+i,this}shrink(t,e){return this.x2-=t,this.y2-=e,this}expand(t,e){return this.shrink(-t,-e),this}pad(t){const e=yt(t);return this.x1-=e.left,this.x2+=e.right,this.y1-=e.top,this.y2+=e.bottom,this}unpad(t){const e=yt(t);return e.left=-e.left,e.top=-e.top,e.right=-e.right,e.bottom=-e.bottom,this.pad(e)}clone(){return new ui(this.x1,this.y1,this.x2,this.y2)}center(){return new di(this.x1+this.width()/2,this.y1+this.height()/2)}containsPoint(t){return t.x>=this.x1&&t.x<=this.x2&&t.y>=this.y1&&t.y<=this.y2}points(){return[new di(this.x1,this.y1),new di(this.x2,this.y1),new di(this.x2,this.y2),new di(this.x1,this.y2)]}getHash(){return[this.x1,this.y1,this.x2,this.y2].join(",")}overlaps(t){return!(t.y2<this.y1||this.y2<t.y1||t.x2<this.x1||this.x2<t.x1)}rotate(t){let e=this.width(),i=this.height();const{x:s,y:o}=this.center(),n=pi(0,0,s,o,t),r=pi(e,0,s,o,t),a=pi(e,i,s,o,t),l=pi(0,i,s,o,t);return e=Math.max(n.x,r.x,a.x,l.x)-Math.min(n.x,r.x,a.x,l.x),i=Math.max(n.y,r.y,a.y,l.y)-Math.min(n.y,r.y,a.y,l.y),this.x2=this.x1+e,this.y2=this.y1+i,this}toRect(){return new e.R([this.x1,this.y1],[this.width(),this.height()])}hasSize(){return 0!==this.width()&&0!==this.height()}align(t,e,i){const s=e+1,o=e+2,n=e===W?G:_,r=this[n]();Mt(i,[S,z])?(this[s]=t[s],this[o]=this[s]+r):Mt(i,[B,c])?(this[o]=t[o],this[s]=this[o]-r):i===d&&(this[s]=t[s]+(t[n]()-r)/2,this[o]=this[s]+r)}}function pi(t,e,i,s,o){const n=Zt(o);return new di(i+(t-i)*Math.cos(n)+(e-s)*Math.sin(n),s-(t-i)*Math.sin(n)+(e-s)*Math.cos(n))}class gi extends e.a{constructor(t,e,i,s,o){super(),this.center=t,this.innerRadius=e,this.radius=i,this.startAngle=s,this.angle=o}clone(){return new gi(this.center,this.innerRadius,this.radius,this.startAngle,this.angle)}middle(){return this.startAngle+this.angle/2}setRadius(t,e){return e?this.innerRadius=t:this.radius=t,this}point(t,e){const i=Zt(t),s=Math.cos(i),o=Math.sin(i),n=e?this.innerRadius:this.radius,r=$t(this.center.x-s*n,3),a=$t(this.center.y-o*n,3);return new di(r,a)}adjacentBox(t,e,i){const s=this.clone().expand(t),o=s.middle(),n=s.point(o),r=e/2,a=i/2,l=Math.sin(Zt(o)),h=Math.cos(Zt(o));let c=n.x-r,d=n.y-a;return Math.abs(l)<.9&&(c+=r*-h/Math.abs(h)),Math.abs(h)<.9&&(d+=a*-l/Math.abs(l)),new ui(c,d,c+e,d+i)}containsPoint(t){const e=this.center,i=this.innerRadius,s=this.radius,o=this.startAngle,n=this.startAngle+this.angle,r=t.x-e.x,a=t.y-e.y,l=new di(r,a),h=this.point(o),c=new di(h.x-e.x,h.y-e.y),d=this.point(n),u=new di(d.x-e.x,d.y-e.y),p=$t(r*r+a*a,3);return(c.equals(l)||it(c,l))&&!it(u,l)&&p>=i*i&&p<=s*s}getBBox(){const t=new ui(C,C,T,T),e=$t(this.startAngle%360),i=$t((e+this.angle)%360),s=this.innerRadius,o=[0,90,180,270,e,i].sort(mi),n=o.indexOf(e),r=o.indexOf(i);let a;a=e===i?o:n<r?o.slice(n,r+1):[].concat(o.slice(0,r+1),o.slice(n,o.length));for(let e=0;e<a.length;e++){let i=this.point(a[e]);t.wrapPoint(i),t.wrapPoint(i,s)}return s||t.wrapPoint(this.center),t}expand(t){return this.radius+=t,this}}function mi(t,e){return t-e}class fi extends gi{constructor(t,e,i,s){super(t,0,e,i,s)}expand(t){return super.expand(t)}clone(){return new fi(this.center,this.radius,this.startAngle,this.angle)}setRadius(t){return this.radius=t,this}}class xi extends e.a{createRing(t,i){const s=t.startAngle+180;let o=t.angle+s;(0===t.angle||t.angle>0&&s===o)&&(o+=.001);const n=new e.P(t.center.x,t.center.y),r=Math.max(t.radius,0),a=Math.max(t.innerRadius,0),l=new e.A(n,{startAngle:s,endAngle:o,radiusX:r,radiusY:r}),h=e.b.fromArc(l,i).close();if(a){l.radiusX=l.radiusY=a;const t=l.pointAt(o);h.lineTo(t.x,t.y),h.arc(o,s,a,a,!0)}else h.lineTo(n.x,n.y);return h}}xi.current=new xi;class yi extends e.a{constructor(t){super(),this.children=[],this.options=ut({},this.options,this.initUserOptions(t))}initUserOptions(t){return t}reflow(t){const e=this.children;let i;for(let s=0;s<e.length;s++){let o=e[s];o.reflow(t),i=i?i.wrap(o.box):o.box.clone()}this.box=i||t}destroy(){const t=this.children;this.animation&&this.animation.destroy();for(let e=0;e<t.length;e++)t[e].destroy()}getRoot(){const t=this.parent;return t?t.getRoot():null}getSender(){const t=this.getService();if(t)return t.sender}getService(){let t=this;for(;t;){if(t.chartService)return t.chartService;t=t.parent}}translateChildren(t,e){const i=this.children,s=i.length;for(let o=0;o<s;o++)i[o].box.translate(t,e)}append(){for(let t=0;t<arguments.length;t++){let e=arguments[t];this.children.push(e),e.parent=this}}renderVisual(){!1!==this.options.visible&&(this.createVisual(),this.addVisual(),this.renderChildren(),this.createAnimation(),this.renderComplete())}addVisual(){this.visual&&(this.visual.chartElement=this,this.parent&&this.parent.appendVisual(this.visual))}renderChildren(){const t=this.children,e=t.length;for(let i=0;i<e;i++)t[i].renderVisual()}createVisual(){this.visual=new e.G({zIndex:this.options.zIndex,visible:Kt(this.options.visible,!0)})}createAnimation(){this.visual&&this.options.animation&&(this.animation=e.c.create(this.visual,this.options.animation))}appendVisual(t){t.chartElement||(t.chartElement=this),t.options.noclip?this.clipRoot().visual.append(t):Ft(t.options.zIndex)?this.stackRoot().stackVisual(t):this.isStackRoot?this.stackVisual(t):this.visual?this.visual.append(t):this.parent.appendVisual(t)}clipRoot(){return this.parent?this.parent.clipRoot():this}stackRoot(){return this.parent?this.parent.stackRoot():this}stackVisual(t){const e=t.options.zIndex||0,i=this.visual.children,s=i.length;let o;for(o=0;o<s;o++){let t=i[o];if(Kt(t.options.zIndex,0)>e)break}this.visual.insert(o,t)}traverse(t){const e=this.children,i=e.length;for(let s=0;s<i;s++){let i=e[s];t(i),i.traverse&&i.traverse(t)}}closest(t){let e=this,i=!1;for(;e&&!i;)i=t(e),i||(e=e.parent);if(i)return e}renderComplete(){}hasHighlight(){const t=(this.options||{}).highlight;return!(!this.createHighlight||t&&!1===t.visible||!1===this.visible)}toggleHighlight(t,e){const i=(this.options||{}).highlight||{},s=i.visual;let o=this._highlight;if(!o){const t={fill:{color:U,opacity:e||.2},stroke:{color:U,width:1,opacity:e||.2}};if(s){if(o=this._highlight=s(Object.assign(this.highlightVisualArgs(),{createVisual:()=>this.createHighlight(t),sender:this.getSender(),series:this.series,dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,runningTotal:this.runningTotal,total:this.total})),!o)return}else o=this._highlight=this.createHighlight(t);Ft(o.options.zIndex)||(o.options.zIndex=Kt(i.zIndex,this.options.zIndex)),this.appendVisual(o)}o.visible(t)}toggleFocusHighlight(t){const e=(this.options||{}).focusHighlight||{};let i=this._focusHighlight;if(t||i){if(!i){const t=ge(this.getRoot().options.background),s={fill:{opacity:e.opacity,color:e.color},stroke:Object.assign({},{color:t},e.border),zIndex:e.zIndex};i=this._focusHighlight=this.createFocusHighlight(s),this.appendVisual(i)}i.visible(t)}}createGradientOverlay(t,i,s){const o=new e.b(Object.assign({stroke:{color:"none"},fill:this.createGradient(s),closed:t.options.closed},i));return o.segments.elements(t.segments.elements()),o}createGradient(t){if(this.parent)return this.parent.createGradient(t)}supportsPointInactiveOpacity(){return!0}}yi.prototype.options={};const{dotsPattern:vi,verticalStripesPattern:bi,crosshatchPattern:wi,diagonalStripesPattern:_i,gridPattern:ki}=e.e,Ai={dots:vi,verticalStripes:bi,crosshatch:wi,diagonalStripes:_i,grid:ki};function Si(t,e,i){const s=function(t,e){return ht(t)?t(e):t}(t,i),o=s&&Ai[s.type];return o?o(Object.assign({},e,s)):e}class Ci extends yi{constructor(t){super(t),this.options.margin=yt(this.options.margin),this.options.padding=yt(this.options.padding)}reflow(t){const e=this.options,{width:i,height:s,shrinkToFit:o}=e,n=i&&s,r=e.margin,a=e.padding,l=e.border.width;let h;const c=()=>{this.align(t,W,e.align),this.align(t,X,e.vAlign),this.paddingBox=h.clone().unpad(r).unpad(l)};let d=t.clone();n&&(d.x2=d.x1+i,d.y2=d.y1+s),o&&d.unpad(r).unpad(l).unpad(a),super.reflow(d),h=n?this.box=new ui(0,0,i,s):this.box,o&&n?(c(),d=this.contentBox=this.paddingBox.clone().unpad(a)):(d=this.contentBox=h.clone(),h.pad(a).pad(l).pad(r),c()),this.translateChildren(h.x1-d.x1+r.left+l+a.left,h.y1-d.y1+r.top+l+a.top);const u=this.children;for(let t=0;t<u.length;t++){let e=u[t];e.reflow(e.box)}}align(t,e,i){this.box.align(t,e,i)}hasBox(){const t=this.options;return t.border.width||t.background}createVisual(){super.createVisual();this.options.visible&&this.hasBox()&&this.visual.append(e.b.fromRect(this.paddingBox.toRect(),this.visualStyle()))}visualStyle(){const t=this.options,e=t.border||{};return{stroke:{width:e.width,color:e.color,opacity:Kt(e.opacity,t.opacity),dashType:e.dashType},fill:Si(t.pattern,{color:t.background,opacity:t.opacity},void 0),cursor:t.cursor}}}function Ti(t,e){e&&(t.options.className=e.className,t.options.role=e.role,t.options.ariaLabel=e.ariaLabel,t.options.ariaRoleDescription=e.ariaRoleDescription,t.options.ariaChecked=e.ariaChecked)}te(Ci,{align:S,vAlign:z,margin:{},padding:{},border:{color:h,width:0},background:"",shrinkToFit:!1,width:0,height:0,visible:!0});class Pi extends Ci{constructor(t,e){super(t),this.pointData=e}getElement(){const{options:t,paddingBox:i}=this,{type:s,rotation:o}=t,n=i.center(),r=i.width()/2,a=i.height()/2;if(!t.visible||!this.hasBox())return null;const l=this.visualStyle();let h;if(s===u)h=new e.f(new e.g([$t(i.x1+r,3),$t(i.y1+a,3)],Math.min(r,a)),l);else if(s===F)h=e.b.fromPoints([[i.x1+r,i.y1],[i.x1,i.y2],[i.x2,i.y2]],l).close();else if(s===p)h=new e.h(l),h.moveTo(i.x1,i.y1).lineTo(i.x2,i.y2),h.moveTo(i.x1,i.y2).lineTo(i.x2,i.y1);else{const o=i.toRect();if(s===O){const e=Kt(t.borderRadius,o.width()/5);o.setCornerRadius(e)}h=e.b.fromRect(o,l)}return o&&h.transform(e.t().rotate(-o,[n.x,n.y])),h.options.zIndex=t.zIndex,h}createElement(){const t=this.options.visual,e=this.pointData||{};let i;return i=t?t({value:e.value,dataItem:e.dataItem,sender:this.getSender(),series:e.series,category:e.category,rect:this.paddingBox.toRect(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),i}visualOptions(){const t=this.options;return{background:t.background,border:t.border,margin:t.margin,padding:t.padding,type:t.type,size:t.width,visible:t.visible}}createVisual(){this.visual=this.createElement(),Ti(this.visual,this.options.accessibilityOptions)}}te(Pi,{type:u,align:d,vAlign:d});const Mi="radial",Ei={glass:{type:"linear",rotation:0,stops:[{offset:0,color:U,opacity:0},{offset:.25,color:U,opacity:.3},{offset:1,color:U,opacity:0}]},sharpBevel:{type:Mi,stops:[{offset:0,color:U,opacity:.55},{offset:.65,color:U,opacity:0},{offset:.95,color:U,opacity:.25}]},roundedBevel:{type:Mi,stops:[{offset:.33,color:U,opacity:.06},{offset:.83,color:U,opacity:.2},{offset:.95,color:U,opacity:0}]},roundedGlass:{type:Mi,supportVML:!1,stops:[{offset:0,color:U,opacity:0},{offset:.5,color:U,opacity:.3},{offset:.99,color:U,opacity:0}]},sharpGlass:{type:Mi,supportVML:!1,stops:[{offset:0,color:U,opacity:.2},{offset:.15,color:U,opacity:.15},{offset:.17,color:U,opacity:.35},{offset:.85,color:U,opacity:.05},{offset:.87,color:U,opacity:.15},{offset:.99,color:U,opacity:0}]},bubbleShadow:{type:Mi,center:[.5,.5],radius:.5}};function Li(t,e){if(t.x1===e.x1&&t.y1===e.y1&&t.x2===e.x2&&t.y2===e.y2)return e;const i=Math.min(t.x1,e.x1),s=Math.max(t.x1,e.x1),o=Math.min(t.x2,e.x2),n=Math.max(t.x2,e.x2),r=Math.min(t.y1,e.y1),a=Math.max(t.y1,e.y1),l=Math.min(t.y2,e.y2),h=Math.max(t.y2,e.y2),c=[];return c[0]=new ui(s,r,o,a),c[1]=new ui(i,a,s,l),c[2]=new ui(o,a,n,l),c[3]=new ui(s,l,o,h),t.x1===i&&t.y1===r||e.x1===i&&e.y1===r?(c[4]=new ui(i,r,s,a),c[5]=new ui(o,l,n,h)):(c[4]=new ui(o,r,n,a),c[5]=new ui(i,l,s,h)),Ct(c,(function(t){return t.height()>0&&t.width()>0}))[0]}class Ii extends yi{constructor(t){super(t);const e=this.options;e.width=parseInt(e.width,10),e.height=parseInt(e.height,10),this.gradients={}}reflow(){const{options:t,children:e}=this;let i=new ui(0,0,t.width,t.height);this.box=i.unpad(t.margin);for(let t=0;t<e.length;t++)e[t].reflow(i),i=Li(i,e[t].box)||new ui}createVisual(){this.visual=new e.G,this.createBackground()}createBackground(){const t=this.options,i=t.border||{},s=this.box.clone().pad(t.margin).unpad(i.width),o=e.b.fromRect(s.toRect(),{stroke:{color:i.width?i.color:"",width:i.width,dashType:i.dashType},fill:{color:t.background,opacity:t.opacity},zIndex:-10});this.visual.append(o)}getRoot(){return this}createGradient(t){const i=this.gradients,s=qt(t),o=Ei[t.gradient];let n;if(i[s])n=i[s];else{const r=Object.assign({},o,t);"linear"===o.type?n=new e.L(r):(t.innerRadius&&(r.stops=function(t){const e=t.stops,i=t.innerRadius/t.radius*100,s=e.length,o=[];for(let t=0;t<s;t++){let s=Object.assign({},e[t]);s.offset=(s.offset*(100-i)+i)/100,o.push(s)}return o}(r)),n=new e.i(r),n.supportVML=!1!==o.supportVML),i[s]=n}return n}cleanGradients(){const t=this.gradients;for(let e in t)t[e]._observers=[]}size(){const t=this.options;return new ui(0,0,t.width,t.height)}}te(Ii,{width:x,height:400,background:U,border:{color:h,width:0},margin:yt(5),zIndex:-2});class Ri extends yi{constructor(t){super(t),this._initDirection()}_initDirection(){const t=this.options;t.vertical?(this.groupAxis=W,this.elementAxis=X,this.groupSizeField=G,this.elementSizeField=_,this.groupSpacing=t.spacing,this.elementSpacing=t.vSpacing):(this.groupAxis=X,this.elementAxis=W,this.groupSizeField=_,this.elementSizeField=G,this.groupSpacing=t.vSpacing,this.elementSpacing=t.spacing)}reflow(t){this.box=t.clone(),this.reflowChildren()}reflowChildren(){const{box:t,elementAxis:e,groupAxis:i,elementSizeField:s,groupSizeField:o}=this,{groups:n,groupsSize:r,maxGroupElementsSize:a}=this.groupOptions(),l=n.length,h=t[i+1]+this.alignStart(r,t[o]());if(l){let c=h;for(let r=0;r<l;r++){let a=n[r],l=a.groupElements,h=t[e+1],d=l.length;for(let t=0;t<d;t++){let n=l[t],r=this.elementSize(n),d=c+this.alignStart(r[o],a.groupSize),u=new ui;u[i+1]=d,u[i+2]=d+r[o],u[e+1]=h,u[e+2]=h+r[s],n.reflow(u),h+=r[s]+this.elementSpacing}c+=a.groupSize+this.groupSpacing}t[i+1]=h,t[i+2]=h+r,t[e+2]=t[e+1]+a}}alignStart(t,e){let i=0;const s=this.options.align;return s===B||s===c?i=e-t:s===d&&(i=(e-t)/2),i}groupOptions(){const{box:t,children:e,elementSizeField:i,groupSizeField:s,elementSpacing:o,groupSpacing:n}=this,r=$t(t[i]()),a=e.length,l=[];let h=0,c=0,d=0,u=0,p=[];for(let g=0;g<a;g++){let a=e[g];a.box||a.reflow(t);let m=this.elementSize(a);this.options.wrap&&$t(c+o+m[i])>r&&(l.push({groupElements:p,groupSize:h,groupElementsSize:c}),u=Math.max(u,c),d+=n+h,h=0,c=0,p=[]),h=Math.max(h,m[s]),c>0&&(c+=o),c+=m[i],p.push(a)}return l.push({groupElements:p,groupSize:h,groupElementsSize:c}),u=Math.max(u,c),d+=h,{groups:l,groupsSize:d,maxGroupElementsSize:u}}elementSize(t){return{width:t.box.width(),height:t.box.height()}}createVisual(){}}te(Ri,{vertical:!0,wrap:!0,vSpacing:0,spacing:0});const Bi=e.T;let Oi=class extends yi{constructor(t,e){super(e),this.content=t,this.reflow(new ui)}reflow(t){const i=this.options,s=i.size=e.m(this.content,{font:i.font});this.baseline=s.baseline,this.box=new ui(t.x1,t.y1,t.x1+s.width,t.y1+s.height)}createVisual(){const{font:t,color:e,opacity:i,cursor:s,stroke:o,paintOrder:n}=this.options;this.visual=new Bi(this.content,this.box.toRect().topLeft(),{font:t,fill:{color:e,opacity:i},cursor:s,stroke:o,paintOrder:n})}};function Vi(t){const e=t.origin,i=t.bottomRight();return new ui(e.x,e.y,i.x,i.y)}te(Oi,{font:m,color:h});const Di=/\n/m;class zi extends Ci{constructor(t,e,i){super(e),this.content=t,this.data=i,this._initContainer(),!1!==this.options._autoReflow&&this.reflow(new ui)}_initContainer(){const t=this.options,e=String(this.content).split(Di),i=new Ri({vertical:!0,align:t.align,wrap:!1}),s=ut({},t,{opacity:1,animation:null});this.container=i,this.append(i);for(let t=0;t<e.length;t++){let o=new Oi(e[t].trim(),s);i.append(o)}}reflow(t){const i=this.options,s=i.visual;if(this.container.options.align=i.align,s&&!this._boxReflow){let o=t;o.hasSize()||(this._boxReflow=!0,this.reflow(o),this._boxReflow=!1,o=this.box);const n=this.visual=s(this.visualContext(o));n&&(o=Vi(n.clippedBBox()||new e.R),n.options.zIndex=i.zIndex),this.box=this.contentBox=this.paddingBox=o}else if(super.reflow(t),i.rotation){const e=yt(i.margin);let s=this.box.unpad(e);this.targetBox=t,this.normalBox=s.clone(),s=this.rotate(),s.translate(e.left-e.right,e.top-e.bottom),this.rotatedBox=s.clone(),s.pad(e)}}createVisual(){const t=this.options;if(this.visual=new e.G({transform:this.rotationTransform(),zIndex:t.zIndex,noclip:t.noclip}),this.hasBox()){const t=e.b.fromRect(this.paddingBox.toRect(),this.visualStyle());this.visual.append(t)}}renderVisual(){if(this.options.visible)if(this.options.visual){const t=this.visual;t&&!Ft(t.options.noclip)&&(t.options.noclip=this.options.noclip),this.addVisual(),this.createAnimation()}else super.renderVisual()}visualContext(t){const e={text:this.content,rect:t.toRect(),sender:this.getSender(),options:this.options,createVisual:()=>(this._boxReflow=!0,this.reflow(t),this._boxReflow=!1,this.getDefaultVisual())};return this.data&&Object.assign(e,this.data),e}getDefaultVisual(){this.createVisual(),this.renderChildren();const t=this.visual;return delete this.visual,t}rotate(){const t=this.options;return this.box.rotate(t.rotation),this.align(this.targetBox,W,t.align),this.align(this.targetBox,X,t.vAlign),this.box}rotationTransform(){const t=this.options.rotation;if(!t)return null;const{x:i,y:s}=this.normalBox.center(),o=this.rotatedBox.center();return e.t().translate(o.x-i,o.y-s).rotate(t,[i,s])}}let Fi=class t extends yi{constructor(t){super(t),this._textBox=new zi(this.options.text,Object.assign({},this.options,{vAlign:this.options.position})),this.append(this._textBox)}reflow(t){super.reflow(t),this.box.snapTo(t,W)}static buildTitle(e,i){let s,o=e;return"string"==typeof e&&(o={text:e}),o=Object.assign({visible:!0},i,o),o&&o.visible&&o.text&&(s=new t(o)),s}static orderTitles(t){const e=[].concat(t),i=e.filter((t=>t&&t.options.position!==c)),s=e.filter((t=>t&&t.options.position===c));return Hi(i),Hi(s),s.reverse(),i.concat(s)}};function Hi(t){for(let e=1;e<t.length;e++){const i=t[e]._textBox,s=t[e-1]._textBox;s.options.margin=Object.assign(yt(s.options.margin),{bottom:0}),i.options.margin=Object.assign(yt(i.options.margin),{top:0})}}te(Fi,{color:h,position:z,align:d,margin:yt(5),padding:yt(5)});class Ni extends zi{constructor(t,e,i,s,o){super(e,o),this.text=e,this.value=t,this.index=i,this.dataItem=s,this.reflow(new ui)}visualContext(t){const e=super.visualContext(t);return e.value=this.value,e.dataItem=this.dataItem,e.format=this.options.format,e.culture=this.options.culture,e}click(t,e){t.trigger(l,{element:Gt(e),value:this.value,text:this.text,index:this.index,dataItem:this.dataItem,axis:this.parent.options})}rotate(){if(this.options.alignRotation!==d){const t=this.normalBox.toRect(),e=this.rotationTransform();this.box=Vi(t.bbox(e.matrix()))}else super.rotate();return this.box}rotationTransform(){const t=this.options,i=t.rotation;if(!i)return null;if(t.alignRotation===d)return super.rotationTransform();const s=e.t().rotate(i).matrix(),o=this.normalBox.toRect(),n=this.targetBox.toRect(),r=t.rotationOrigin||z,a=r===z||r===c?W:X,l=r===z||r===c?X:W,h=r===z||r===S?n.origin:n.bottomRight(),u=o.topLeft().transformCopy(s),p=o.topRight().transformCopy(s),g=o.bottomRight().transformCopy(s),m=o.bottomLeft().transformCopy(s),x=e.R.fromPoints(u,p,g,m),y={[l]:n.origin[l]-x.origin[l]},v=Math.abs(u[l]+y[l]-h[l]),b=Math.abs(p[l]+y[l]-h[l]);let w,_;$t(v,f)===$t(b,f)?(w=u,_=p):b<v?(w=p,_=g):(w=u,_=m);const k=w[a]+(_[a]-w[a])/2;return y[a]=n.center()[a]-k,e.t().translate(y.x,y.y).rotate(i)}}te(Ni,{_autoReflow:!1});class ji extends Ci{constructor(t,e,i){super(e),this.fields=t,this.chartService=i,this.render()}hide(){this.options.visible=!1}show(){this.options.visible=!0}render(){const t=this.options;if(t.visible){const{label:e,icon:i}=t,s=new ui,o=()=>this;let n,r,a=i.size,l=this.fields.text;if(Ft(e)&&e.visible){const t=wt(e);t?l=t(this.fields):e.format&&(l=this.chartService.format.auto(e.format,l)),e.color||(e.color=e.position===k?"#fff":i.background),this.label=new zi(l,ut({},e)),this.label.aliasFor=o,e.position!==k||Ft(a)||(i.type===u?a=Math.max(this.label.box.width(),this.label.box.height()):(n=this.label.box.width(),r=this.label.box.height()),s.wrap(this.label.box))}i.width=n||a||7,i.height=r||a||7;const h=new Pi(ut({},i));h.aliasFor=o,this.marker=h,this.append(h),this.label&&this.append(this.label),h.reflow(new ui),this.wrapperBox=s.wrap(h.box)}}reflow(t){const{options:e,label:i,marker:s,wrapperBox:o}=this,n=t.center(),r=e.line.length,a=e.position;if(e.visible){let l,h,d;Mt(a,[S,B])?a===S?(d=o.alignTo(t,a).translate(-r,t.center().y-o.center().y),e.line.visible&&(l=[t.x1,n.y],this.linePoints=[l,[d.x2,n.y]],h=d.clone().wrapPoint(l))):(d=o.alignTo(t,a).translate(r,t.center().y-o.center().y),e.line.visible&&(l=[t.x2,n.y],this.linePoints=[l,[d.x1,n.y]],h=d.clone().wrapPoint(l))):a===c?(d=o.alignTo(t,a).translate(t.center().x-o.center().x,r),e.line.visible&&(l=[n.x,t.y2],this.linePoints=[l,[n.x,d.y1]],h=d.clone().wrapPoint(l))):(d=o.alignTo(t,a).translate(t.center().x-o.center().x,-r),e.line.visible&&(l=[n.x,t.y1],this.linePoints=[l,[n.x,d.y2]],h=d.clone().wrapPoint(l))),s&&s.reflow(d),i&&(i.reflow(d),s&&(e.label.position===R&&i.box.alignTo(s.box,a),i.reflow(i.box))),this.contentBox=d,this.targetBox=t,this.box=h||d}}createVisual(){super.createVisual(),this.visual.options.noclip=this.options.noclip,this.options.visible&&this.createLine()}renderVisual(){const t=this.options,e=t.visual;t.visible&&e?(this.visual=e(Object.assign(this.fields,{sender:this.getSender(),rect:this.targetBox.toRect(),options:{background:t.background,border:t.background,icon:t.icon,label:t.label,line:t.line,position:t.position,visible:t.visible},createVisual:()=>{this.createVisual(),this.renderChildren();const t=this.visual;return delete this.visual,t}})),this.addVisual()):super.renderVisual()}createLine(){const t=this.options.line;if(this.linePoints){const i=e.b.fromPoints(this.linePoints,{stroke:{color:t.color,width:t.width,dashType:t.dashType}});et(i),this.visual.append(i)}}click(t,e){const i=this.eventArgs(e);t.trigger(M,i)||e.preventDefault()}over(t,e){const i=this.eventArgs(e);t.trigger(E,i)||e.preventDefault()}out(t,e){const i=this.eventArgs(e);t.trigger(L,i)}eventArgs(t){const e=this.options;return Object.assign(this.fields,{element:Gt(t),text:Ft(e.label)?e.label.text:"",visual:this.visual})}}te(ji,{icon:{visible:!0,type:u},label:{position:k,visible:!0,align:d,vAlign:d},line:{visible:!0},visible:!0,position:z,zIndex:2});const Ui={format:(t,e)=>e,toString:t=>t,parseDate:t=>new Date(t),firstDay:()=>0};let Gi=Ui;class Wi{static register(t){Gi=t}static get implementation(){return Gi}}const Xi=/\{(\d+)(:[^\}]+)?\}/g;class Yi{constructor(t){this._intlService=t}get intl(){return this._intlService||Wi.implementation}set intl(t){this._intlService=t}auto(t,...e){const i=this.intl;return ot(t)&&t.match(w)?i.format(t,...e):i.toString(e[0],t)}localeAuto(t,e,i){const s=this.intl;let o;return o=ot(t)&&t.match(w)?t.replace(Xi,(function(t,o,n){let r=e[parseInt(o,10)];return s.toString(r,n?n.substring(1):"",i)})):s.toString(e[0],t,i),o}}class qi{constructor(t,e={}){this._intlService=e.intlService,this.sender=e.sender||t,this.format=new Yi(e.intlService),this.chart=t,this.rtl=Boolean(e.rtl)}get intl(){return this._intlService||Wi.implementation}set intl(t){this._intlService=t,this.format.intl=t}notify(t,e){this.chart&&this.chart.trigger(t,e)}isPannable(t){const e=((this.chart||{}).options||{}).pannable;return e&&e.lock!==t}}let Zi;class $i{static register(t){Zi=t}static create(t,e){let i;return i=Zi?Zi.create(t,e):new hi(t,Object.assign({},{multiTouch:!0},e)),i}}var Qi=Object.freeze({__proto__:null,ChartService:qi,DomEventsBuilder:$i,FormatService:Yi,IntlService:Wi,TemplateService:bt});function Ki(t,i){const{tickX:s,tickY:o,position:n}=t,r=new e.b({stroke:{width:i.width,color:i.color}});return t.vertical?r.moveTo(s,n).lineTo(s+i.size,n):r.moveTo(n,o).lineTo(n,o+i.size),et(r),r}function Ji(t,i){const{lineStart:s,lineEnd:o,position:n}=t,r=new e.b({stroke:{width:i.width,color:i.color,dashType:i.dashType}});return t.vertical?r.moveTo(s,n).lineTo(o,n):r.moveTo(n,s).lineTo(n,o),et(r),r}class ts extends yi{constructor(t,e=new qi){super(t),this.chartService=e,this.options.visible||(this.options=ut({},this.options,{labels:{visible:!1},line:{visible:!1},margin:0,majorTickSize:0,minorTickSize:0})),this.options.minorTicks=ut({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.minorTickType!==P},this.options.minorTicks,{size:this.options.minorTickSize,align:this.options.minorTickType}),this.options.majorTicks=ut({},{color:this.options.line.color,width:this.options.line.width,visible:this.options.majorTickType!==P},this.options.majorTicks,{size:this.options.majorTickSize,align:this.options.majorTickType}),this.initFields(),this.options._deferLabels||this.createLabels(),this.createTitle(),this.createNotes()}initFields(){}labelsRange(){return{min:this.options.labels.skip,max:this.labelsCount()}}normalizeLabelRotation(t){const e=t.rotation;pt(e)&&(t.alignRotation=e.align,t.rotation=e.angle)}createLabels(){const t=this.options,e=t.vertical?B:d,i=ut({},t.labels,{align:e,zIndex:t.zIndex}),s=Math.max(1,i.step);if(this.clearLabels(),i.visible){this.normalizeLabelRotation(i),"auto"===i.rotation&&(i.rotation=0,t.autoRotateLabels=!0);const e=this.labelsRange();for(let t=e.min;t<e.max;t+=s){const s={index:t,count:e.max};let o=this.createAxisLabel(t,i,s);o&&(this.append(o),this.labels.push(o))}}}clearLabels(){this.children=Ct(this.children,(t=>!(t instanceof Ni))),this.labels=[]}clearTitle(){this.title&&(this.children=Ct(this.children,(t=>t!==this.title)),this.title=void 0)}clear(){this.clearLabels(),this.clearTitle()}lineBox(){const{options:t,box:e}=this,i=t.vertical,s=t.labels.mirror,o=s?e.x1:e.x2,n=s?e.y2:e.y1,r=t.line.width||0;return i?new ui(o,e.y1,o,e.y2-r):new ui(e.x1,n,e.x2-r,n)}createTitle(){const t=this.options,e=ut({rotation:t.vertical?-90:0,text:"",zIndex:1,visualSize:!0},t.title);if(e.visible&&e.text){const t=new zi(e.text,e);this.append(t),this.title=t}}createNotes(){const t=this.options,e=t.notes,i=e.data||[];this.notes=[];for(let s=0;s<i.length;s++){const o=ut({},e,i[s]);o.value=this.parseNoteValue(o.value);const n=new ji({value:o.value,text:o.label.text,dataItem:o},o,this.chartService);n.options.visible&&(Ft(n.options.position)?t.vertical&&!Mt(n.options.position,[S,B])?n.options.position=t.reverse?S:B:t.vertical||Mt(n.options.position,[z,c])||(n.options.position=t.reverse?c:z):t.vertical?n.options.position=t.reverse?S:B:n.options.position=t.reverse?c:z,this.append(n),this.notes.push(n))}}parseNoteValue(t){return t}renderVisual(){super.renderVisual(),this.createPlotBands()}createVisual(){super.createVisual(),this.createBackground(),this.createLine()}gridLinesVisual(){let t=this._gridLines;return t||(t=this._gridLines=new e.G({zIndex:-2}),this.appendVisual(this._gridLines)),t}createTicks(t){const e=this.options,i=this.lineBox(),s=e.labels.mirror,o=e.majorTicks.visible?e.majorUnit:0,n={vertical:e.vertical};function r(e,o,r){const a=e.length,l=Math.max(1,o.step);if(o.visible)for(let h=o.skip;h<a;h+=l)Ft(r)&&h%r==0||(n.tickX=s?i.x2:i.x2-o.size,n.tickY=s?i.y1-o.size:i.y1,n.position=e[h],t.append(Ki(n,o)))}r(this.getMajorTickPositions(),e.majorTicks),r(this.getMinorTickPositions(),e.minorTicks,o/e.minorUnit)}createLine(){const t=this.options,i=t.line,s=this.lineBox();if(i.width>0&&i.visible){const o=new e.b({stroke:{width:i.width,color:i.color,dashType:i.dashType}});o.moveTo(s.x1,s.y1).lineTo(s.x2,s.y2),t._alignLines&&et(o);const n=this._lineGroup=new e.G;n.append(o),this.visual.append(n),this.createTicks(n)}}getActualTickSize(){const t=this.options;let e=0;return t.majorTicks.visible&&t.minorTicks.visible?e=Math.max(t.majorTicks.size,t.minorTicks.size):t.majorTicks.visible?e=t.majorTicks.size:t.minorTicks.visible&&(e=t.minorTicks.size),e}createBackground(){const{options:t,box:i}=this,s=t.background;s&&(this._backgroundPath=e.b.fromRect(i.toRect(),{fill:{color:s},stroke:null}),this.visual.append(this._backgroundPath))}createPlotBands(){const t=this.options,i=t.plotBands||[],s=t.vertical,o=this.plotArea;if(0===i.length)return;const n=this._plotbandGroup=new e.G({zIndex:-1}),r=Ct(this.pane.axes,(t=>t.options.vertical!==this.options.vertical))[0];for(let t=0;t<i.length;t++){let a,l,h,c=i[t],d=c.label;if(s?(a=(r||o.axisX).lineBox(),l=this.getSlot(c.from,c.to,!0)):(a=this.getSlot(c.from,c.to,!0),l=(r||o.axisY).lineBox()),d&&(d.vAlign=d.position||S,h=this.createPlotBandLabel(d,c,new ui(a.x1,l.y1,a.x2,l.y2))),0!==a.width()&&0!==l.height()){const t=new e.R([a.x1,l.y1],[a.width(),l.height()]),i=e.b.fromRect(t,{fill:{color:c.color,opacity:c.opacity},stroke:null});n.append(i),h&&n.append(h)}}this.appendVisual(n)}createPlotBandLabel(t,e,i){if(!1===t.visible)return null;let s,o=t.text;if(Ft(t)&&t.visible){const i=wt(t);i?o=i({text:o,item:e}):t.format&&(o=this.chartService.format.auto(t.format,o)),t.color||(t.color=this.options.labels.color)}return s=new zi(o,t),s.reflow(i),s.renderVisual(),s.visual}createGridLines(t){const e=this.options,{minorGridLines:i,majorGridLines:s,minorUnit:o,vertical:n}=e,r=t.options.line.visible,a=s.visible?e.majorUnit:0,l=t.lineBox(),h=l[n?"y1":"x1"],c={lineStart:l[n?"x1":"y1"],lineEnd:l[n?"x2":"y2"],vertical:n},d=[],u=this.gridLinesVisual();function p(t,e,i){const s=t.length,o=Math.max(1,e.step);if(e.visible)for(let n=e.skip;n<s;n+=o){let s=$t(t[n]);Mt(s,d)||n%i==0||r&&h===s||(c.position=s,u.append(Ji(c,e)),d.push(s))}}return p(this.getMajorTickPositions(),s),p(this.getMinorTickPositions(),i,a/o),u.children}reflow(t){const{options:e,labels:i,title:s}=this,o=e.vertical,n=i.length,r=o?G:_,a=s?s.box[r]():0,l=this.getActualTickSize()+e.margin+a,h=((this.getRoot()||{}).box||t)[r]();let c=0;for(let t=0;t<n;t++){let e=i[t].box[r]();e+l<=h&&(c=Math.max(c,e))}this.box=o?new ui(t.x1,t.y1,t.x1+c+l,t.y2):new ui(t.x1,t.y1,t.x2,t.y1+c+l),this.arrangeTitle(),this.arrangeLabels(),this.arrangeNotes()}getLabelsTickPositions(){return this.getMajorTickPositions()}labelTickIndex(t){return t.index}arrangeLabels(){const{options:t,labels:e}=this,i=this.labelsBetweenTicks(),s=t.vertical,o=t.labels.mirror,n=this.getLabelsTickPositions();for(let t=0;t<e.length;t++){const r=e[t],a=this.labelTickIndex(r),l=s?r.box.height():r.box.width(),h=n[a],c=n[a+1];let d,u;if(s){if(i){d=h+(c-h)/2-l/2}else d=h-l/2;u=d}else i?(d=h,u=c):(d=h-l/2,u=d+l);this.positionLabel(r,o,d,u)}}positionLabel(t,e,i,s=i){const o=this.options,n=o.vertical,r=this.lineBox(),a=this.getActualTickSize()+o.margin;let l;if(n){let s=r.x2;e?(s+=a,t.options.rotationOrigin=S):(s-=a+t.box.width(),t.options.rotationOrigin=B),l=t.box.move(s,i)}else{let o=r.y1;e?(o-=a+t.box.height(),t.options.rotationOrigin=c):(o+=a,t.options.rotationOrigin=z),l=new ui(i,o,s,o+t.box.height())}t.reflow(l)}autoRotateLabelAngle(t,e){return t.width()<e?0:t.height()>e?-90:-45}autoRotateLabels(){if(!this.options.autoRotateLabels||this.options.vertical)return!1;const t=this.getMajorTickPositions(),e=this.labels,i=Math.min(e.length,t.length-1);let s=0;for(let o=0;o<i;o++){const i=Math.abs(t[o+1]-t[o]),n=e[o].box,r=this.autoRotateLabelAngle(n,i);if(0!==r&&(s=r),-90===s)break}if(0!==s){for(let t=0;t<e.length;t++)e[t].options.rotation=s,e[t].reflow(new ui);return!0}}arrangeTitle(){const{options:t,title:e}=this,i=t.labels.mirror,s=t.vertical;e&&(s?(e.options.align=i?B:S,e.options.vAlign=e.options.position):(e.options.align=e.options.position,e.options.vAlign=i?z:c),e.reflow(this.box))}arrangeNotes(){for(let t=0;t<this.notes.length;t++){const e=this.notes[t],i=e.options.value;let s;Ft(i)?(this.shouldRenderNote(i)?e.show():e.hide(),s=this.noteSlot(i)):e.hide(),e.reflow(s||this.lineBox())}}noteSlot(t){return this.getSlot(t)}alignTo(t){const e=t.lineBox(),i=this.options.vertical,s=i?X:W;this.box.snapTo(e,s),i?this.box.shrink(0,this.lineBox().height()-e.height()):this.box.shrink(this.lineBox().width()-e.width(),0),this.box[s+1]-=this.lineBox()[s+1]-e[s+1],this.box[s+2]-=this.lineBox()[s+2]-e[s+2]}axisLabelText(t,e,i){let s;const o=wt(e),n=()=>e.format?this.chartService.format.localeAuto(e.format,[t],e.culture):t;if(o){s=o(Object.assign({},i,{get text(){return n()},value:t,format:e.format,culture:e.culture}))}else s=n();return s}slot(t,e,i){const s=this.getSlot(t,e,i);if(s)return s.toRect()}contentBox(){const t=this.box.clone(),e=this.labels;if(e.length){const i=this.options.vertical?X:W;if(this.chartService.isPannable(i)){const e=this.maxLabelOffset();t[i+1]-=e.start,t[i+2]+=e.end}else{e[0].options.visible&&t.wrap(e[0].box);const i=e[e.length-1];i.options.visible&&t.wrap(i.box)}}return t}maxLabelOffset(){const{vertical:t,reverse:e}=this.options,i=this.labelsBetweenTicks(),s=this.getLabelsTickPositions(),o=t?X:W,n=this.labels,r=e?1:0,a=e?0:1;let l=0,h=0;for(let t=0;t<n.length;t++){const e=n[t],c=this.labelTickIndex(e);let d,u;i?(d=s[c+r],u=s[c+a]):d=u=s[c],l=Math.max(l,d-e.box[o+1]),h=Math.max(h,e.box[o+2]-u)}return{start:l,end:h}}limitRange(t,e,i,s,o){const n=this.options;if(t<i&&o<0&&(!Ft(n.min)||n.min<=i)||s<e&&o>0&&(!Ft(n.max)||s<=n.max))return null;if(e<i&&o>0||s<t&&o<0)return{min:t,max:e};const r=e-t;let a=t,l=e;return t<i&&o<0?(a=Yt(t,i,s),l=Yt(t+r,i+r,s)):e>s&&o>0&&(l=Yt(e,i,s),a=Yt(e-r,i,s-r)),{min:a,max:l}}valueRange(){return{min:this.seriesMin,max:this.seriesMax}}lineDir(){const{vertical:t,reverse:e}=this.options;return(t?-1:1)*(e?-1:1)}lineInfo(){const{vertical:t}=this.options,e=this.lineBox(),i=t?e.height():e.width(),s=t?X:W,o=this.lineDir(),n=s+(1===o?1:2).toString();return{axis:s,axisOrigin:n,axisDir:o,lineBox:e,lineSize:i,lineStart:e[n]}}pointOffset(t){const{axis:e,axisDir:i,axisOrigin:s,lineBox:o,lineSize:n}=this.lineInfo();return(i>0?t[e]-o[s]:o[s]-t[e])/n}scaleToDelta(t,e){const i=Yt(t,-.999,.999);let s;return s=i>0?e*Math.min(1,i):e-e/(1+i),s}labelsBetweenTicks(){return!this.options.justified}prepareUserOptions(){}}te(ts,{labels:{visible:!0,rotation:0,mirror:!1,step:1,skip:0},line:{width:1,color:h,visible:!0},title:{visible:!0,position:d},majorTicks:{align:R,size:4,skip:0,step:1},minorTicks:{align:R,size:3,skip:0,step:1},axisCrossingValue:0,majorTickType:R,minorTickType:P,majorGridLines:{skip:0,step:1},minorGridLines:{visible:!1,width:1,color:h,skip:0,step:1},margin:5,visible:!0,reverse:!1,justified:!0,notes:{label:{text:""}},_alignLines:!0,_deferLabels:!1});const es="milliseconds",is="seconds",ss="minutes",os="hours",ns="days",rs="weeks",as="months",ls="years",hs=1e3,cs=6e4,ds=36e5,us=864e5,ps=6048e5,gs=26784e5,ms=31536e6,fs={years:ms,months:gs,weeks:ps,days:us,hours:ds,minutes:cs,seconds:hs,milliseconds:1};function xs(t,e){return t.getTime()-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*cs}function ys(t,e){return new Date(t.getTime()+e)}function vs(t){let e;return t instanceof Date?e=t:t&&(e=new Date(t)),e}function bs(t,e=0){let i=0,s=t.getDay();if(!isNaN(s))for(;s!==e;)0===s?s=6:s--,i++;return ys(t,-i*us)}function ws(t,e){return 0===e&&23===t.getHours()&&(t.setHours(t.getHours()+2),!0)}function _s(t,e,i,s){let o=t;if(t){let n=vs(t);const r=n.getHours();i===ls?(o=new Date(n.getFullYear()+e,0,1),ws(o,0)):i===as?(o=new Date(n.getFullYear(),n.getMonth()+e,1),ws(o,r)):i===rs?(o=_s(bs(n,s),7*e,ns),ws(o,r)):i===ns?(o=new Date(n.getFullYear(),n.getMonth(),n.getDate()+e),ws(o,r)):i===os?o=function(t,e){const i=new Date(t);i.setMinutes(0,0,0);const s=(t.getTimezoneOffset()-i.getTimezoneOffset())*cs;return ys(i,s+e*ds)}(n,e):i===ss?(o=ys(n,e*cs),o.getSeconds()>0&&o.setSeconds(0)):i===is?o=ys(n,e*hs):i===es&&(o=ys(n,e)),i!==es&&o.getMilliseconds()>0&&o.setMilliseconds(0)}return o}function ks(t,e,i){return _s(vs(t),0,e,i)}function As(t,e,i){const s=vs(t);return s&&ks(s,e,i).getTime()===s.getTime()?s:_s(s,1,e,i)}function Ss(t,e){return t&&e?t.getTime()-e.getTime():-1}function Cs(t,e){return t.getTime()-e}function Ts(t){if(Q(t)){let e=[];for(let i=0;i<t.length;i++)e.push(Ts(t[i]));return e}if(t)return vs(t).getTime()}function Ps(t,e){return t&&e?Ts(t)===Ts(e):t===e}function Ms(t,e,i){return xs(t,e)/fs[i]}function Es(t,e,i,s){const o=vs(t),n=vs(e);let r;return r=i===as?o.getMonth()-n.getMonth()+12*(o.getFullYear()-n.getFullYear())+Ms(o,new Date(o.getFullYear(),o.getMonth()),ns)/new Date(o.getFullYear(),o.getMonth()+1,0).getDate():i===ls?o.getFullYear()-n.getFullYear()+Es(o,new Date(o.getFullYear(),0),as,1)/12:i===ns||i===rs?Ms(o,n,i):Cs(o,e)/fs[i],r/s}function Ls(t,e,i){let s;return s=i===ls?e.getFullYear()-t.getFullYear():i===as?12*Ls(t,e,ls)+e.getMonth()-t.getMonth():i===ns?Math.floor(Cs(e,t)/us):Math.floor(Cs(e,t)/fs[i]),s}function Is(t,e){let i;return i=ot(e)&&t.parseDate(e)||vs(e),i}function Rs(t,e){if(Q(e)){const i=[];for(let s=0;s<e.length;s++)i.push(Is(t,e[s]));return i}return Is(t,e)}function Bs(t,e){return st(t.weekStartDay)?t.weekStartDay:e&&e.firstDay?e.firstDay():0}class Os extends ts{initFields(){this._ticks={}}categoriesHash(){return""}clone(){const t=new Os(Object.assign({},this.options,{categories:this.options.srcCategories}),this.chartService);return t.createLabels(),t}initUserOptions(t){const e=t.categories||[],i=Ft(t.min),s=Ft(t.max);if(t.srcCategories=t.categories=e,(i||s)&&e.length){const o=i?Math.floor(t.min):0;let n;n=s?t.justified?Math.floor(t.max)+1:Math.ceil(t.max):e.length,t.categories=t.categories.slice(o,n)}return t}rangeIndices(){const t=this.options,e=t.categories.length||1,i=st(t.min)?t.min%1:0;let s;return s=st(t.max)&&t.max%1!=0&&t.max<this.totalRange().max?e-(1-t.max%1):e-(t.justified?1:0),{min:i,max:s}}range(){const t=this.options;return{min:st(t.min)?t.min:0,max:st(t.max)?t.max:this.totalRange().max}}roundedRange(){return this.range()}totalRange(){const t=this.options;return{min:0,max:Math.max(this._seriesMax||0,t.srcCategories.length)-(t.justified?1:0)}}scaleOptions(){const{min:t,max:e}=this.rangeIndices(),i=this.lineBox();return{scale:(this.options.vertical?i.height():i.width())/(e-t||1)*(this.options.reverse?-1:1),box:i,min:t,max:e}}arrangeLabels(){super.arrangeLabels(),this.hideOutOfRangeLabels()}hideOutOfRangeLabels(){const{box:t,labels:e}=this;if(e.length>0){const i=this.options.vertical?X:W,s=t[i+1],o=t[i+2],n=e[0],r=Xt(e);(n.box[i+1]>o||n.box[i+2]<s)&&(n.options.visible=!1),(r.box[i+1]>o||r.box[i+2]<s)&&(r.options.visible=!1)}}getMajorTickPositions(){return this.getTicks().majorTicks}getMinorTickPositions(){return this.getTicks().minorTicks}getLabelsTickPositions(){return this.getTicks().labelTicks}tickIndices(t){const{min:e,max:i}=this.rangeIndices(),s=Math.ceil(i);let o=Math.floor(e);const n=[];for(;o<=s;)n.push(o),o+=t;return n}getTickPositions(t){const{vertical:e,reverse:i}=this.options,{scale:s,box:o,min:n}=this.scaleOptions(),r=o[(e?X:W)+(i?2:1)],a=this.tickIndices(t),l=[];for(let t=0;t<a.length;t++)l.push(r+$t(s*(a[t]-n),3));return l}getTicks(){const t=this.options,e=this._ticks,i=this.rangeIndices(),s=this.lineBox(),o=s.getHash()+i.min+","+i.max+t.reverse+t.justified;if(e._hash!==o){const i=t.minorTicks.visible||t.minorGridLines.visible;e._hash=o,e.labelTicks=this.getTickPositions(1),e.majorTicks=this.filterOutOfRangePositions(e.labelTicks,s),e.minorTicks=i?this.filterOutOfRangePositions(this.getTickPositions(.5),s):[]}return e}filterOutOfRangePositions(t,e){if(!t.length)return t;const i=this.options.vertical?X:W,s=t=>e[i+1]<=t&&t<=e[i+2],o=t.length-1;let n=0;for(;!s(t[n])&&n<=o;)n++;let r=o;for(;!s(t[r])&&r>=0;)r--;return t.slice(n,r+1)}lineInfo(){const{vertical:t,reverse:e}=this.options,i=this.lineBox(),s=t?i.height():i.width(),o=t?X:W,n=e?-1:1,r=o+(1===n?1:2).toString();return{axis:o,axisOrigin:r,axisDir:n,lineBox:i,lineSize:s,lineStart:i[r]}}lineDir(){const{reverse:t}=this.options;return t?-1:1}getSlot(t,e,i){const s=this.options,{reverse:o,justified:n}=s,{scale:r,box:a,min:l}=this.scaleOptions(),{axis:h,lineStart:c}=this.lineInfo(),d=a.clone(),u=!Ft(e),p=Kt(t,0);let g=Kt(e,p);g=Math.max(g-1,p),g=Math.max(p,g);let m=c+(p-l)*r,f=c+(g+1-l)*r;return u&&n&&(f=m),i&&(m=Yt(m,a[h+1],a[h+2]),f=Yt(f,a[h+1],a[h+2])),d[h+1]=o?f:m,d[h+2]=o?m:f,d}limitSlot(t){const e=this.options.vertical?X:W,i=this.lineBox(),s=t.clone();return s[e+1]=Yt(t[e+1],i[e+1],i[e+2]),s[e+2]=Yt(t[e+2],i[e+1],i[e+2]),s}slot(t,e,i){const s=Math.floor(this.options.min||0);let o=t,n=e;return"string"==typeof o?o=this.categoryIndex(o):st(o)&&(o-=s),"string"==typeof n?n=this.categoryIndex(n):st(n)&&(n-=s),super.slot(o,n,i)}pointCategoryIndex(t){const{reverse:e,justified:i,vertical:s}=this.options,o=s?X:W,{scale:n,box:r,min:a,max:l}=this.scaleOptions(),h=e?l:a,c=r[o+1],d=r[o+2],u=t[o];if(u<c||u>d)return null;let p=h+(u-c)/n;const g=p%1;return i?p=Math.round(p):0===g&&p>0&&p--,Math.floor(p)}getCategory(t){const e=this.pointCategoryIndex(t);return null===e?null:this.options.categories[e]}categoryIndex(t){return this.totalIndex(t)-Math.floor(this.options.min||0)}categoryAt(t,e){const i=this.options;return(e?i.srcCategories:i.categories)[t]}categoriesCount(){return(this.options.categories||[]).length}translateRange(t){const e=this.options,i=this.lineBox(),s=e.vertical?i.height():i.width(),o=e.categories.length,n=$t(t/(s/o),f);return{min:n,max:o+n}}scaleRange(t,e){const i=Math.abs(this.pointOffset(e)),s=this.limitedRangeIndices(),o=s.max-s.min,n=this.scaleToDelta(t,o),r=i*n,a=(1-i)*n,l=s.min+r;let h=s.max-a;return h-l<.1&&(h=l+.1),{min:l,max:h}}zoomRange(t,e){const{min:i,max:s}=this.totalRange(),o=this.scaleRange(t,e);return{min:Yt(o.min,i,s),max:Yt(o.max,i,s)}}labelsCount(){const t=this.labelsRange();return t.max-t.min}labelsRange(){const t=this.options,{justified:e,labels:i}=t;let{min:s,max:o}=this.limitedRangeIndices(!0);const n=Math.floor(s);let r;return e?(s=Math.ceil(s),o=Math.floor(o)):(s=Math.floor(s),o=Math.ceil(o)),r=s>i.skip?i.skip+i.step*Math.ceil((s-i.skip)/i.step):i.skip,{min:r-n,max:(t.categories.length?o+(e?1:0):0)-n}}createAxisLabel(t,e,i){const s=this.options,o=s.dataItems?s.dataItems[t]:null,n=Kt(s.categories[t],"");i.dataItem=o;const r=this.axisLabelText(n,e,i);return new Ni(n,r,t,o,e)}shouldRenderNote(t){const e=this.limitedRangeIndices();return Math.floor(e.min)<=t&&t<=Math.ceil(e.max)}noteSlot(t){const e=this.options,i=t-Math.floor(e.min||0);return this.getSlot(i)}arrangeNotes(){super.arrangeNotes(),this.hideOutOfRangeNotes()}hideOutOfRangeNotes(){const{notes:t,box:e}=this;if(t&&t.length){const i=this.options.vertical?X:W,s=e[i+1],o=e[i+2];for(let e=0;e<t.length;e++){const n=t[e];n.box&&(o<n.box[i+1]||n.box[i+2]<s)&&n.hide()}}}pan(t){const e=this.limitedRangeIndices(!0),{scale:i}=this.scaleOptions(),s=$t(t/i,f),o=this.totalRange(),n=e.min+s,r=e.max+s;return this.limitRange(n,r,0,o.max,s)}pointsRange(t,e){const{reverse:i,vertical:s}=this.options,o=s?X:W,n=this.limitedRangeIndices(!0),{scale:r,box:a}=this.scaleOptions(),l=a[o+(i?2:1)],h=t[o]-l,c=e[o]-l,d=n.min+h/r,u=n.min+c/r,p=Math.min(d,u),g=Math.max(d,u);if(g-p>=.01)return{min:p,max:g}}valueRange(){return this.range()}totalIndex(t){const e=this.options,i=this._categoriesMap?this._categoriesMap.get(t):function(t,e){if(t instanceof Date){const i=e.length;for(let s=0;s<i;s++)if(Ps(e[s],t))return s;return-1}return e.indexOf(t)}(t,e.srcCategories);return i}currentRangeIndices(){const t=this.options;let e,i=0;return st(t.min)&&(i=Math.floor(t.min)),e=st(t.max)?t.justified?Math.floor(t.max):Math.ceil(t.max)-1:this.totalCount()-1,{min:i,max:e}}limitedRangeIndices(t){const e=this.options;let i,s=st(e.min)?e.min:0;if(i=st(e.max)?e.max:st(e.min)?s+e.categories.length:this.totalRange().max||1,t){const t=this.totalRange();s=Yt(s,0,t.max),i=Yt(i,0,t.max)}return{min:s,max:i}}totalRangeIndices(){return{min:0,max:this.totalRange().max||1}}indexCategories(){if(!this._categoriesMap){const t=this._categoriesMap=new Pt,e=this.options.srcCategories;for(let i=0;i<e.length;i++)t.set(e[i],i)}}totalCount(){return Math.max(this.options.srcCategories.length,this._seriesMax||0)}}te(Os,{type:"category",vertical:!1,majorGridLines:{visible:!1,width:1,color:h},labels:{zIndex:1},justified:!1,_deferLabels:!0});const Vs=3e5,Ds={milliseconds:"HH:mm:ss.fff",seconds:"HH:mm:ss",minutes:"HH:mm",hours:"HH:mm",days:"M/d",weeks:"M/d",months:"MMM 'yy",years:"yyyy"},zs=[es,is,ss,os,ns,rs,as,ls],Fs="fit";function Hs(t,e){e&&(t._range=void 0);let i=t._range;return i||(i=t._range=le(t),i.min=vs(i.min),i.max=vs(i.max)),i}class Ns{constructor(t){this.options=t}displayIndices(){return{min:0,max:1}}displayRange(){return{}}total(){return{}}valueRange(){return{}}valueIndex(){return-1}values(){return[]}totalIndex(){return-1}valuesCount(){return 0}totalCount(){return 0}dateAt(){return null}}class js{constructor(t,e,i){this.options=i,i.baseUnitStep=i.baseUnitStep||1;const{roundToBaseUnit:s,justified:o}=i;this.start=_s(t,0,i.baseUnit,i.weekStartDay);const n=this.roundToTotalStep(e),r=!o&&Ps(e,n)&&!i.justifyEnd;this.end=this.roundToTotalStep(e,!o,r?1:0);const a=i.min||t;this.valueStart=this.roundToTotalStep(a),this.displayStart=s?this.valueStart:a;const l=i.max;if(l){const t=!o&&Ps(l,this.roundToTotalStep(l))?-1:0;this.valueEnd=this.roundToTotalStep(l,!1,t),this.displayEnd=s?this.roundToTotalStep(l,!o):i.max}else this.valueEnd=n,this.displayEnd=s||r?this.end:e;this.valueEnd<this.valueStart&&(this.valueEnd=this.valueStart),this.displayEnd<=this.displayStart&&(this.displayEnd=this.roundToTotalStep(this.displayStart,!1,1))}displayRange(){return{min:this.displayStart,max:this.displayEnd}}displayIndices(){if(!this._indices){const t=this.options,{baseUnit:e,baseUnitStep:i}=t,s=Es(this.displayStart,this.valueStart,e,i),o=Es(this.displayEnd,this.valueStart,e,i);this._indices={min:s,max:o}}return this._indices}total(){return{min:this.start,max:this.end}}totalCount(){return this.totalIndex(this.end)+(this.options.justified?1:0)}valueRange(){return{min:this.valueStart,max:this.valueEnd}}valueIndex(t){const e=this.options;return Math.floor(Es(t,this.valueStart,e.baseUnit,e.baseUnitStep))}totalIndex(t){const e=this.options;return Math.floor(Es(t,this.start,e.baseUnit,e.baseUnitStep))}dateIndex(t){const e=this.options;return Es(t,this.valueStart,e.baseUnit,e.baseUnitStep)}valuesCount(){return this.valueIndex(this.valueEnd)+1}values(){let t=this._values;if(!t){const e=this.options,i=this.valueRange();this._values=t=[];for(let s=i.min;s<=i.max;)t.push(s),s=_s(s,e.baseUnitStep,e.baseUnit,e.weekStartDay)}return t}dateAt(t,e){const i=this.options;return _s(e?this.start:this.valueStart,i.baseUnitStep*t,i.baseUnit,i.weekStartDay)}roundToTotalStep(t,e,i){const{baseUnit:s,baseUnitStep:o,weekStartDay:n}=this.options,r=this.start,a=Es(t,r,s,o);let l=e?Math.ceil(a):Math.floor(a);return i&&(l+=i),_s(r,l*o,s,n)}}function Us(t,e,i){const s=Hs(t.categories),o=(t.max||s.max)-(t.min||s.min),{autoBaseUnitSteps:n,maxDateGroups:r}=t,a=t.baseUnit===Fs;let l,h,c,d=e?zs.indexOf(e):0,u=a?zs[d++]:t.baseUnit,p=o/fs[u],g=p;for(;!h||p>=r;){l=l||n[u].slice(0);do{c=l.shift()}while(c&&e===u&&c<i);if(c)h=c,p=g/h;else{if(u===Xt(zs)){h=Math.ceil(g/r);break}if(!a){p>r&&(h=Math.ceil(g/r));break}u=zs[d++]||Xt(zs),g=o/fs[u],l=null}}t.baseUnitStep=h,t.baseUnit=u}function Gs(t){const e=(t.baseUnit||"").toLowerCase();return e!==Fs&&!Mt(e,zs)&&function(t){const e=t.categories,i=Ft(e)?e.length:0;let s,o,n=C;for(let t=0;t<i;t++){const i=e[t];if(i&&s){let t=Math.abs(xs(i,s));0!==t&&(n=Math.min(n,t),o=n>=ms?ls:n>=24192e5?as:n>=ps?rs:n>=us?ns:n>=ds?os:n>=cs?ss:is)}s=i}t.baseUnit=o||ns}(t),e!==Fs&&"auto"!==t.baseUnitStep||Us(t),t}class Ws extends Os{clone(){const t=new Ws(Object.assign({},this.options),this.chartService);return t.createLabels(),t}categoriesHash(){const t=this.dataRange.total().min;return this.options.baseUnit+this.options.baseUnitStep+t}initUserOptions(t){return t}initFields(){super.initFields();const t=this.chartService,e=t.intl;let i=this.options,s=i.categories||[];if(s._parsed||(s=Rs(e,s),s._parsed=!0),i=ut({roundToBaseUnit:!0},i,{categories:s,min:Is(e,i.min),max:Is(e,i.max),weekStartDay:Bs(i,e)}),t.panning&&t.isPannable(i.vertical?X:W)&&(i.roundToBaseUnit=!1),i.userSetBaseUnit=i.userSetBaseUnit||i.baseUnit,i.userSetBaseUnitStep=i.userSetBaseUnitStep||i.baseUnitStep,this.options=i,i.srcCategories=s,s.length>0){const t=Hs(s,!0),e=i.maxDivisions,o=Gs(i),n=i._forecast;if(n&&(n.before>0&&(t.min=_s(t.min,-n.before,o.baseUnit,o.weekStartDay)),n.after>0&&(t.max=_s(t.max,n.after,o.baseUnit,o.weekStartDay))),this.dataRange=new js(t.min,t.max,o),e){const s=this.dataRange.displayRange(),o=Object.assign({},i,{justified:!0,roundToBaseUnit:!1,baseUnit:"fit",min:s.min,max:s.max,maxDateGroups:e}),n=this.dataRange.options;Us(o,n.baseUnit,n.baseUnitStep),this.divisionRange=new js(t.min,t.max,o)}else this.divisionRange=this.dataRange}else i.baseUnit=i.baseUnit||ns,this.dataRange=this.divisionRange=new Ns(i);this.rangeLabels=[]}tickIndices(t){const{dataRange:e,divisionRange:i}=this,s=i.valuesCount();if(!this.options.maxDivisions||!s)return super.tickIndices(t);const o=[];let n=i.values(),r=0;this.options.justified||(n=n.concat(i.dateAt(s)),r=.5);for(let i=0;i<n.length;i++)if(o.push(e.dateIndex(n[i])+r),1!==t&&i>=1){const e=o.length-1;o.splice(i,0,o[e-1]+(o[e]-o[e-1])*t)}return o}shouldRenderNote(t){const e=this.range(),i=this.options.categories||[];return Ss(t,e.min)>=0&&Ss(t,e.max)<=0&&i.length}parseNoteValue(t){return Is(this.chartService.intl,t)}noteSlot(t){return this.getSlot(t)}translateRange(t){const e=this.options,{baseUnit:i,weekStartDay:s,vertical:o}=e,n=this.lineBox(),r=o?n.height():n.width();let a=this.range();const l=r/(a.max-a.min),h=$t(t/l,f);if(a.min&&a.max){const t=ys(e.min||a.min,h),o=ys(e.max||a.max,h);a={min:_s(t,0,i,s),max:_s(o,0,i,s)}}return a}labelsRange(){return{min:this.options.labels.skip,max:this.divisionRange.valuesCount()}}pan(t){if(this.isEmpty())return null;const e=this.options,i=this.lineBox(),s=e.vertical?i.height():i.width(),{min:o,max:n}=this.dataRange.displayRange(),r=this.dataRange.total(),a=$t(t/(s/(n-o)),f)*(e.reverse?-1:1),l=ys(o,a),h=ys(n,a),c=this.limitRange(Ts(l),Ts(h),Ts(r.min),Ts(r.max),a);return c?(c.min=vs(c.min),c.max=vs(c.max),c.baseUnit=e.baseUnit,c.baseUnitStep=e.baseUnitStep||1,c.userSetBaseUnit=e.userSetBaseUnit,c.userSetBaseUnitStep=e.userSetBaseUnitStep,c):void 0}pointsRange(t,e){if(this.isEmpty())return null;const i=super.pointsRange(t,e),s=this.dataRange.displayRange(),o=this.dataRange.displayIndices(),n=Cs(s.max,s.min)/(o.max-o.min),r=this.options;return{min:ys(s.min,i.min*n),max:ys(s.min,i.max*n),baseUnit:r.userSetBaseUnit||r.baseUnit,baseUnitStep:r.userSetBaseUnitStep||r.baseUnitStep}}scaleRange(t,e){if(this.isEmpty())return{};const i=this.options,s=i.userSetBaseUnit===Fs,o=this.dataRange.total(),{min:n,max:r}=this.dataRange.displayRange(),a=Math.abs(this.pointOffset(e)),l=r-n,h=this.scaleToDelta(t,l),c=Math.round(a*h),d=Math.round((1-a)*h);let{baseUnit:u}=this.dataRange.options,p=new Date(n.getTime()+c),g=new Date(r.getTime()-d);if(s){const{autoBaseUnitSteps:t,maxDateGroups:e}=i,s=Xt(t[u])*e*fs[u],a=Cs(r,n),l=Cs(g,p);let h,c,d=zs.indexOf(u);if(l<fs[u]&&u!==es)u=zs[d-1],h=Xt(t[u]),c=(a-(e-1)*h*fs[u])/2,p=ys(n,c),g=ys(r,-c);else if(l>s&&u!==ls){let e=0;do{d++,u=zs[d],e=0,c=2*fs[u];do{h=t[u][e],e++}while(e<t[u].length&&c*h<a)}while(u!==ls&&c*h<a);c=(c*h-a)/2,c>0&&(p=ys(n,-c),g=ys(r,c),p=ys(p,Yt(g,o.min,o.max)-g),g=ys(g,Yt(p,o.min,o.max)-p))}}return p&&g&&Cs(g,p)>0?{min:p,max:g,baseUnit:i.userSetBaseUnit||i.baseUnit,baseUnitStep:i.userSetBaseUnitStep||i.baseUnitStep}:void 0}zoomRange(t,e){const i=this.dataRange.total(),s=this.scaleRange(t,e);return s&&(s.min<i.min&&(s.min=i.min),s.max>i.max&&(s.max=i.max)),s}range(){return this.dataRange.displayRange()}createLabels(){super.createLabels(),this.createRangeLabels()}clearLabels(){super.clearLabels(),this.rangeLabels=[]}arrangeLabels(){this.arrangeRangeLabels(),super.arrangeLabels()}arrangeRangeLabels(){const{options:t,rangeLabels:e}=this;if(0===e.length)return;const i=this.lineBox(),s=t.vertical,o=t.rangeLabels.mirror||t.labels.mirror,n=e[0];if(n){const t=s?i.y1-n.box.height()/2:i.x1;this.positionLabel(n,o,t)}const r=e[1];if(r){const t=s?i.y2-r.box.height()/2:i.x2;this.positionLabel(r,o,t)}}autoRotateLabels(){super.autoRotateLabels(),this.autoRotateRangeLabels()}hideOutOfRangeLabels(){super.hideOutOfRangeLabels(),this.hideOverlappingLabels()}hideOverlappingLabels(){const{rangeLabels:t,labels:e}=this;if(0===t.length)return;function i(t,e){return!(e.options.visible&&!e.box.overlaps(t.box))&&(e.options.visible=!1,!0)}const s=t[0];if(s&&s.options.visible)for(let t=0;t<e.length;t++){if(!i(s,e[t]))break}const o=t[1];if(o&&o.options.visible)for(let t=e.length-1;t>0;--t){if(!i(o,e[t]))break}}contentBox(){const t=super.contentBox(),e=this.rangeLabels;for(let i=0;i<e.length;i++){const s=e[i];s.options.visible&&t.wrap(s.box)}return t}createAxisLabel(t,e,i={}){const s=this.options,o=s.dataItems&&!s.maxDivisions?s.dataItems[t]:null,n=this.divisionRange.dateAt(t),r=e.dateFormats[this.divisionRange.options.baseUnit];e.format=e.format||r,i.dataItem=o;const a=this.axisLabelText(n,e,i);if(a)return new Ni(n,a,t,o,e)}createRangeLabels(){const{displayStart:t,displayEnd:e}=this.divisionRange,i=this.options,s=Object.assign({},i.labels,i.rangeLabels,{align:d,zIndex:i.zIndex});if(!0!==s.visible)return;this.normalizeLabelRotation(s),s.alignRotation=d,"auto"===s.rotation&&(s.rotation=0,i.autoRotateRangeLabels=!0);const o=s.dateFormats[this.divisionRange.options.baseUnit];s.format=s.format||o;const n=(t,e,i)=>{if(i){const o=new Ni(e,i,t,null,s);this.append(o),this.rangeLabels.push(o)}};n(0,t,this.axisLabelText(t,s,{index:0,count:2}));n(1,e,this.axisLabelText(e,s,{index:1,count:2}))}autoRotateRangeLabels(){const t=this.rangeLabels;if(!this.options.autoRotateRangeLabels||this.options.vertical||2!==t.length)return;const e=(t,e,i)=>{const s=2*Math.abs(e[i+1]-e[i]),o=this.autoRotateLabelAngle(t.box,s);0!==o&&(t.options.rotation=o,t.reflow(new ui))},i=this.getMajorTickPositions();e(t[0],i,0),e(t[1],i,i.length-2)}categoryIndex(t){return this.dataRange.valueIndex(t)}slot(t,e,i){const s=this.dataRange;let o=t,n=e;o instanceof Date&&(o=s.dateIndex(o)),n instanceof Date&&(n=s.dateIndex(n));const r=this.getSlot(o,n,i);if(r)return r.toRect()}getSlot(t,e,i){let s=t,o=e;return typeof s===I&&(s=this.categoryIndex(s)),typeof o===I&&(o=this.categoryIndex(o)),super.getSlot(s,o,i)}valueRange(){const t=Hs(this.options.srcCategories);return{min:vs(t.min),max:vs(t.max)}}categoryAt(t,e){return this.dataRange.dateAt(t,e)}categoriesCount(){return this.dataRange.valuesCount()}rangeIndices(){return this.dataRange.displayIndices()}labelsBetweenTicks(){return!this.divisionRange.options.justified}prepareUserOptions(){this.isEmpty()||(this.options.categories=this.dataRange.values())}getCategory(t){const e=this.pointCategoryIndex(t);return null===e?null:this.dataRange.dateAt(e)}totalIndex(t){return this.dataRange.totalIndex(t)}currentRangeIndices(){const t=this.dataRange.valueRange();return{min:this.dataRange.totalIndex(t.min),max:this.dataRange.totalIndex(t.max)}}totalRange(){return this.dataRange.total()}totalRangeIndices(){const t=this.dataRange.total();return{min:this.dataRange.totalIndex(t.min),max:this.dataRange.totalIndex(t.max)}}totalCount(){return this.dataRange.totalCount()}isEmpty(){return!this.options.srcCategories.length}roundedRange(){if(!1!==this.options.roundToBaseUnit||this.isEmpty())return this.range();const t=this.options,e=Hs(t.srcCategories);return new js(e.min,e.max,Object.assign({},t,{justified:!1,roundToBaseUnit:!0,justifyEnd:!1})).displayRange()}}function Xs(t,e){return $t(Math.floor(t/e)*e,f)}function Ys(t,e){return $t(Math.ceil(t/e)*e,f)}function qs(t){return Math.max(Math.min(t,Vs),-3e5)}te(Ws,{type:g,labels:{dateFormats:Ds},rangeLabels:{visible:!1},autoBaseUnitSteps:{milliseconds:[1,10,100],seconds:[1,2,5,15,30],minutes:[1,2,5,15,30],hours:[1,2,3],days:[1,2,3],weeks:[1,2],months:[1,2,3,6],years:[1,2,3,5,10,25,50]},maxDateGroups:10});const Zs=Math.pow(10,-9);class $s extends ts{constructor(t,e,i,s){super(Object.assign({},i,{seriesMin:t,seriesMax:e}),s)}initUserOptions(t){const e=function(t,e,i){const s=i.narrowRange;let o=function(t,e,i){if(!t&&!e)return 0;let s;if(t>=0&&e>=0){const o=t===e?0:t;if(!1===i||!i&&(e-o)/e>.2)return 0;s=Math.max(0,o-(e-o)/2)}else s=t;return s}(t,e,s),n=function(t,e,i){if(!t&&!e)return 1;let s;if(t<=0&&e<=0){const o=t===e?0:e;let n=Math.abs((o-t)/o);if(!1===i||!i&&n>.2)return 0;s=Math.min(0,o-(t-o)/2)}else s=e;return s}(t,e,s);const r=ci(o,n),a={majorUnit:r};!1!==i.roundToMajorUnit&&(o<0&&Qs(o,r,1/3)&&(o-=r),n>0&&Qs(n,r,1/3)&&(n+=r));return a.min=Xs(o,r),a.max=Ys(n,r),a}(t.seriesMin,t.seriesMax,t);return this.totalOptions=function(t,e){return{min:Ft(e.min)?Math.min(t.min,e.min):t.min,max:Ft(e.max)?Math.max(t.max,e.max):t.max,majorUnit:t.majorUnit}}(e,t),function(t,e){let i,s,o=e;if(e){!function(t,e){for(let i=0;i<e.length;i++){const s=e[i];null===t[s]&&(t[s]=void 0)}}(e,["min","max"]),i=Ft(e.min),s=Ft(e.max);const n=i||s;n&&e.min===e.max&&(e.min>0?e.min=0:e.max=1),e.majorUnit?(t.min=Xs(t.min,e.majorUnit),t.max=Ys(t.max,e.majorUnit)):n&&(o=ut(t,e),t.majorUnit=ci(o.min,o.max))}t.minorUnit=(o.majorUnit||t.majorUnit)/5;const n=ut(t,o);n.min>=n.max&&(i&&!s?n.max=n.min+n.majorUnit:!i&&s&&(n.min=n.max-n.majorUnit));return n}(e,t)}initFields(){this.totalMin=this.totalOptions.min,this.totalMax=this.totalOptions.max,this.totalMajorUnit=this.totalOptions.majorUnit,this.seriesMin=this.options.seriesMin,this.seriesMax=this.options.seriesMax}clone(){return new $s(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}startValue(){return 0}range(){const t=this.options;return{min:t.min,max:t.max}}getDivisions(t){if(0===t)return 1;const e=this.options,i=e.max-e.min;return Math.floor($t(i/t,3))+1}getTickPositions(t,e){const i=this.options,{axisDir:s,axisOrigin:o,lineBox:n,lineSize:r}=this.lineInfo(),a=t*(r/(i.max-i.min)),l=this.getDivisions(t),h=[];let c=n[o],d=0;e&&(d=e/t);for(let t=0;t<l;t++)t%d!=0&&h.push($t(c,3)),c+=a*s;return h}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(t,e,i=!1){const s=this.options,{axis:o,axisDir:n,lineBox:r,lineSize:a,lineStart:l}=this.lineInfo(),h=n*(a/(s.max-s.min));let c=Kt(t,e||0),d=Kt(e,t||0);i&&(c=Yt(c,s.min,s.max),d=Yt(d,s.min,s.max));const u=Math.min(c,d)-s.min,p=Math.max(c,d)-s.min,g=new ui(r.x1,r.y1,r.x1,r.y1);return g[o+1]=qs(l+h*(n>0?u:p)),g[o+2]=qs(l+h*(n>0?p:u)),g}getValue(t){const e=this.options,i=Number(e.max),s=Number(e.min),o=this.pointOffset(t);if(o<0||o>1)return null;return $t(s+o*(i-s),f)}translateRange(t){const e=this.options,{vertical:i,reverse:s,max:o,min:n}=e,{lineSize:r}=this.lineInfo();let a=$t(t/(r/(o-n)),f);return!i&&!s||i&&s||(a=-a),{min:n+a,max:o+a,offset:a}}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(t,e,i){const s=this.options,o=$t(s.min+t*s.majorUnit,f),n=this.axisLabelText(o,e,i);return new Ni(o,n,t,null,e)}shouldRenderNote(t){const e=this.range();return e.min<=t&&t<=e.max}pan(t){const e=this.translateRange(t);return this.limitRange(e.min,e.max,this.totalMin,this.totalMax,e.offset)}pointsRange(t,e){const i=this.getValue(t),s=this.getValue(e),o=Math.min(i,s),n=Math.max(i,s);if(this.isValidRange(o,n))return{min:o,max:n}}scaleRange(t,e){const i=Math.abs(this.pointOffset(e)),s=this.options.max-this.options.min,o=this.scaleToDelta(t,s),n=i*o,r=(1-i)*o,a=$t(this.options.min+n,f);let l=$t(this.options.max-r,f);return l-a<Zs&&(l=a+Zs),{min:a,max:l}}zoomRange(t,e){const{totalMin:i,totalMax:s}=this,o=this.scaleRange(t,e);return{min:Yt(o.min,i,s),max:Yt(o.max,i,s),narrowRange:!1}}isValidRange(t,e){return e-t>Zs}}function Qs(t,e,i){const s=$t(Math.abs(t%e),f);return 0===s||s>e*(1-i)}te($s,{type:"numeric",min:0,max:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:h},labels:{format:"#.####################"},zIndex:1});class Ks extends ts{constructor(t,e,i,s){const o=vs(t),n=vs(e),r=s.intl;let a=i||{};a=ut(a||{},{min:Is(r,a.min),max:Is(r,a.max),axisCrossingValue:Rs(r,a.axisCrossingValues||a.axisCrossingValue),weekStartDay:Bs(a,r)}),a=function(t,e,i){const s=i.min||t,o=i.max||e,n=i.baseUnit||(o&&s?function(t){let e=os;t>=ms?e=ls:t>=gs?e=as:t>=ps?e=rs:t>=us&&(e=ns);return e}(xs(o,s)):os),r=fs[n],a=i.weekStartDay||0,l=ks(Ts(s)-1,n,a)||vs(o),h=As(Ts(o)+1,n,a),c=i.majorUnit?i.majorUnit:void 0,d=c||Ys(ci(l.getTime(),h.getTime()),r)/r,u=Ls(l,h,n),p=Ys(u,d)-u,g=Math.floor(p/2),m=p-g;i.baseUnit||delete i.baseUnit;return i.baseUnit=i.baseUnit||n,i.min=i.min||_s(l,-g,n,a),i.max=i.max||_s(h,m,n,a),i.minorUnit=i.minorUnit||d/5,i.majorUnit=d,i}(o,n,a),super(a,s),this.intlService=r,this.seriesMin=o,this.seriesMax=n;const l=a.weekStartDay||0;this.totalMin=Ts(ks(Ts(o)-1,a.baseUnit,l)),this.totalMax=Ts(As(Ts(n)+1,a.baseUnit,l))}clone(){return new Ks(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}range(){const t=this.options;return{min:t.min,max:t.max}}getDivisions(t){const e=this.options;return Math.floor(Ls(e.min,e.max,e.baseUnit)/t+1)}getTickPositions(t){const e=this.options,{axisDir:i,lineSize:s,lineStart:o}=this.lineInfo(),n=this.getDivisions(t),r=s/Cs(e.max,e.min),a=e.weekStartDay||0,l=[o];for(let s=1;s<n;s++){const n=o+Cs(_s(e.min,s*t,e.baseUnit,a),e.min)*r*i;l.push($t(n,3))}return l}getMajorTickPositions(){return this.getTickPositions(this.options.majorUnit)}getMinorTickPositions(){return this.getTickPositions(this.options.minorUnit)}getSlot(t,e,i){return $s.prototype.getSlot.call(this,Is(this.intlService,t),Is(this.intlService,e),i)}getValue(t){const e=$s.prototype.getValue.call(this,t);return null!==e?vs(e):null}labelsCount(){return this.getDivisions(this.options.majorUnit)}createAxisLabel(t,e,i){const s=this.options,o=t*s.majorUnit,n=s.weekStartDay||0;let r=s.min;o>0&&(r=_s(r,o,s.baseUnit,n));const a=e.dateFormats[s.baseUnit];e.format=e.format||a;const l=this.axisLabelText(r,e,i);return new Ni(r,l,t,null,e)}translateRange(t){const e=this.options,i=this.lineBox(),{vertical:s,reverse:o}=e,n=s?i.height():i.width(),r=this.range(),a=n/Cs(r.max,r.min);let l=$t(t/a,f);return!s&&!o||s&&o||(l=-l),{min:ys(e.min,l),max:ys(e.max,l),offset:l}}shouldRenderNote(t){const e=this.range();return Ss(t,e.min)>=0&&Ss(t,e.max)<=0}pan(t){const e=this.translateRange(t,!0),i=this.limitRange(Ts(e.min),Ts(e.max),this.totalMin,this.totalMax,e.offset);if(i)return{min:vs(i.min),max:vs(i.max)}}pointsRange(t,e){const i=this.getValue(t),s=this.getValue(e),o=Math.min(i,s),n=Math.max(i,s);return{min:vs(o),max:vs(n)}}scaleRange(t,e){const i=Math.abs(this.pointOffset(e)),s=this.options.max-this.options.min,o=this.scaleToDelta(t,s),n=i*o,r=(1-i)*o,a=vs(Ts(this.options.min)+n);let l=vs(Ts(this.options.max)-r);return l-a<1e3&&(l=vs(Ts(a)+1e3)),{min:a,max:l}}zoomRange(t,e){const i=this.scaleRange(t,e);return{min:vs(Yt(Ts(i.min),this.totalMin,this.totalMax)),max:vs(Yt(Ts(i.max),this.totalMin,this.totalMax))}}}te(Ks,{type:g,majorGridLines:{visible:!0,width:1,color:h},labels:{dateFormats:Ds}});const Js=1e-6;class to extends ts{constructor(t,e,i,s){const o=ut({majorUnit:10,min:t,max:e},i),n=o.majorUnit,r=function(t,e){const i=$t(io(t,e),f)%1;let s;s=t<=0?e:0!==i&&(i<.3||i>.9)?Math.pow(e,io(t,e)+.2):Math.pow(e,Math.ceil(io(t,e)));return s}(e,n),a=function(t,e,i){const s=i.majorUnit;let o=t;t<=0?o=e<=1?Math.pow(s,-2):1:i.narrowRange||(o=Math.pow(s,Math.floor(io(t,s))));return o}(t,e,o),l=function(t,e,i,s){let{min:o,max:n}=i;Ft(i.axisCrossingValue)&&i.axisCrossingValue<=0&&eo();Ft(s.max)?s.max<=0&&eo():n=e;Ft(s.min)?s.min<=0&&eo():o=t;return{min:o,max:n}}(a,r,o,i);o.max=l.max,o.min=l.min,o.minorUnit=i.minorUnit||$t(n-1,f),super(o,s),this.totalMin=Ft(i.min)?Math.min(a,i.min):a,this.totalMax=Ft(i.max)?Math.max(r,i.max):r,this.logMin=$t(io(l.min,n),f),this.logMax=$t(io(l.max,n),f),this.seriesMin=t,this.seriesMax=e,this.createLabels()}clone(){return new to(this.seriesMin,this.seriesMax,Object.assign({},this.options),this.chartService)}startValue(){return this.options.min}getSlot(t,e,i){const{options:s,logMin:o,logMax:n}=this,{majorUnit:r,min:a,max:l}=s,{axis:h,axisDir:c,lineBox:d,lineSize:u,lineStart:p}=this.lineInfo(),g=c*(u/(n-o));let m=Kt(t,e||1),f=Kt(e,t||1);if(m<=0||f<=0)return null;i&&(m=Yt(m,a,l),f=Yt(f,a,l)),m=io(m,r),f=io(f,r);const x=Math.min(m,f)-o,y=Math.max(m,f)-o,v=new ui(d.x1,d.y1,d.x1,d.y1);return v[h+1]=qs(p+g*(c>0?x:y)),v[h+2]=qs(p+g*(c>0?y:x)),v}getValue(t){const{options:e,logMin:i,logMax:s}=this,{majorUnit:o}=e,{axis:n,axisDir:r,lineStart:a,lineSize:l}=this.lineInfo(),h=(s-i)/l,c=r*(t[n]-a);if(c<0||c>l)return null;const d=i+c*h;return $t(Math.pow(o,d),f)}range(){const t=this.options;return{min:t.min,max:t.max}}translateRange(t){const{options:e,logMin:i,logMax:s}=this,{reverse:o,vertical:n,majorUnit:r}=e,a=this.lineBox(),l=n?a.height():a.width();let h=$t(t/(l/(s-i)),f);return!n&&!o||n&&o||(h=-h),{min:Math.pow(r,i+h),max:Math.pow(r,s+h),offset:h}}labelsCount(){const t=Math.floor(this.logMax);return Math.floor(t-this.logMin)+1}getMajorTickPositions(){const t=[];return this.traverseMajorTicksPositions((e=>{t.push(e)}),{step:1,skip:0}),t}createTicks(t){const e=this.options,{majorTicks:i,minorTicks:s,vertical:o}=e,n=e.labels.mirror,r=this.lineBox(),a={vertical:o};function l(e,i){a.tickX=n?r.x2:r.x2-i.size,a.tickY=n?r.y1-i.size:r.y1,a.position=e,t.append(Ki(a,i))}return i.visible&&this.traverseMajorTicksPositions(l,i),s.visible&&this.traverseMinorTicksPositions(l,s),[]}createGridLines(t){const e=this.options,{minorGridLines:i,majorGridLines:s,vertical:o}=e,n=t.lineBox(),r={lineStart:n[o?"x1":"y1"],lineEnd:n[o?"x2":"y2"],vertical:o},a=[],l=this.gridLinesVisual();function h(t,e){Mt(t,a)||(r.position=t,l.append(Ji(r,e)),a.push(t))}return s.visible&&this.traverseMajorTicksPositions(h,s),i.visible&&this.traverseMinorTicksPositions(h,i),l.children}traverseMajorTicksPositions(t,e){const{lineStart:i,step:s}=this.lineInfo(),{logMin:o,logMax:n}=this;for(let r=Math.ceil(o)+e.skip;r<=n;r+=e.step){t($t(i+s*(r-o),f),e)}}traverseMinorTicksPositions(t,e){const{min:i,max:s,minorUnit:o,majorUnit:n}=this.options,{lineStart:r,step:a}=this.lineInfo(),{logMin:l,logMax:h}=this;for(let c=Math.floor(l);c<h;c++){const h=this._minorIntervalOptions(c);for(let c=e.skip;c<o;c+=e.step){const o=h.value+c*h.minorStep;if(o>s)break;if(o>=i){t($t(r+a*(io(o,n)-l),f),e)}}}}createAxisLabel(t,e,i){const s=Math.ceil(this.logMin+t),o=Math.pow(this.options.majorUnit,s),n=this.axisLabelText(o,e,i);return new Ni(o,n,t,null,e)}shouldRenderNote(t){const e=this.range();return e.min<=t&&t<=e.max}pan(t){const e=this.translateRange(t);return this.limitRange(e.min,e.max,this.totalMin,this.totalMax,e.offset)}pointsRange(t,e){const i=this.getValue(t),s=this.getValue(e);return{min:Math.min(i,s),max:Math.max(i,s)}}scaleRange(t,e){const{majorUnit:i}=this.options,s=io(this.options.min,i),o=io(this.options.max,i),n=Math.abs(this.pointOffset(e)),r=o-s,a=this.scaleToDelta(t,r),l=Math.pow(i,s+n*a);let h=Math.pow(i,o-(1-n)*a);return h-l<Js&&(h=l+Js),{min:l,max:h}}zoomRange(t,e){const i=this.scaleRange(t,e),{totalMin:s,totalMax:o}=this;return{min:Yt(i.min,s,o),max:Yt(i.max,s,o)}}_minorIntervalOptions(t){const{minorUnit:e,majorUnit:i}=this.options,s=Math.pow(i,t);return{value:s,minorStep:(Math.pow(i,t+1)-s)/e}}lineInfo(){const t=super.lineInfo();return t.step=t.axisDir*(t.lineSize/(this.logMax-this.logMin)),t}}function eo(){throw new Error("Non positive values cannot be used for a logarithmic axis")}function io(t,e){return Math.log(t)/Math.log(e)}te(to,{type:"log",majorUnit:10,minorUnit:1,axisCrossingValue:1,vertical:!0,majorGridLines:{visible:!0,width:1,color:h},zIndex:1,_deferLabels:!0});const so={createGridLines:function(t){const e=this.options,i=Math.abs(this.box.center().y-t.lineBox().y1);let s,o,n=[],r=!1;return e.majorGridLines.visible&&(s=this.majorGridLineAngles(t),r=!0,n=this.renderMajorGridLines(s,i,e.majorGridLines)),e.minorGridLines.visible&&(o=this.minorGridLineAngles(t,r),Dt(n,this.renderMinorGridLines(o,i,e.minorGridLines,t,r))),n},renderMajorGridLines:function(t,e,i){return this.renderGridLines(t,e,i)},renderMinorGridLines:function(t,e,i,s,o){const n=this.radiusCallback&&this.radiusCallback(e,s,o);return this.renderGridLines(t,e,i,n)},renderGridLines:function(t,i,s,o){const n={stroke:{width:s.width,color:s.color,dashType:s.dashType}},r=this.box.center(),a=new e.g([r.x,r.y],i),l=this.gridLinesVisual();for(let i=0;i<t.length;i++){const s=new e.b(n);o&&(a.radius=o(t[i])),s.moveTo(a.center).lineTo(a.pointAt(t[i]+180)),l.append(s)}return l.children},gridLineAngles:function(t,e,i,s,o){const n=this.intervals(e,i,s,o),r=t.options,a=r.visible&&!1!==(r.line||{}).visible;return Bt(n,(t=>{const e=this.intervalAngle(t);if(!a||90!==e)return e}))}};class oo extends Os{range(){return{min:0,max:this.options.categories.length}}reflow(t){this.box=t,this.reflowLabels()}lineBox(){return this.box}reflowLabels(){const{labels:t,options:{labels:e}}=this,i=e.skip||0,s=e.step||1,o=new ui;for(let e=0;e<t.length;e++){t[e].reflow(o);const n=t[e].box;t[e].reflow(this.getSlot(i+e*s).adjacentBox(0,n.width(),n.height()))}}intervals(t,e,i,s=!1){const o=this.options,n=o.categories.length/t||1,r=360/n,a=i||1,l=[];let h=0;for(let t=e||0;t<n;t+=a)h=o.reverse?360-t*r:t*r,h=$t(h,3)%360,s&&Mt(h,s)||l.push(h);return l}majorIntervals(){return this.intervals(1)}minorIntervals(){return this.intervals(.5)}intervalAngle(t){return(360+t+this.options.startAngle)%360}majorAngles(){return Bt(this.majorIntervals(),(t=>this.intervalAngle(t)))}createLine(){return[]}majorGridLineAngles(t){const e=this.options.majorGridLines;return this.gridLineAngles(t,1,e.skip,e.step)}minorGridLineAngles(t,e){const{minorGridLines:i,majorGridLines:s}=this.options,o=e?this.intervals(1,s.skip,s.step):null;return this.gridLineAngles(t,.5,i.skip,i.step,o)}radiusCallback(t,e,s){if(e.options.type!==i){const e=Zt(360/(2*this.options.categories.length)),i=Math.cos(e)*t,o=this.majorAngles();return function(e){return!s&&Mt(e,o)?t:i}}}createPlotBands(){const t=this.options.plotBands||[],i=this._plotbandGroup=new e.G({zIndex:-1});for(let e=0;e<t.length;e++){const s=t[e],o=this.plotBandSlot(s),n=this.getSlot(s.from),r=s.from-Math.floor(s.from);o.startAngle+=r*n.angle;const a=Math.ceil(s.to)-s.to;o.angle-=(a+r)*n.angle;const l=xi.current.createRing(o,{fill:{color:s.color,opacity:s.opacity},stroke:{opacity:s.opacity}});i.append(l)}this.appendVisual(i)}plotBandSlot(t){return this.getSlot(t.from,t.to-1)}getSlot(t,e){const i=this.options,s=i.justified,o=this.box,n=this.majorAngles(),r=n.length,a=360/r;let l=t;i.reverse&&!s&&(l=(l+1)%r),l=Yt(Math.floor(l),0,r-1);let h=n[l];s&&(h-=a/2,h<0&&(h+=360));const c=a*(Yt(Math.ceil(e||l),l,r-1)-l+1);return new gi(o.center(),0,o.height()/2,h,c)}slot(t,i){const s=this.getSlot(t,i),o=s.startAngle+180,n=o+s.angle;return new e.A([s.center.x,s.center.y],{startAngle:o,endAngle:n,radiusX:s.radius,radiusY:s.radius})}pointCategoryIndex(t){const e=this.options.categories.length;let i=null;for(let s=0;s<e;s++){if(this.getSlot(s).containsPoint(t)){i=s;break}}return i}}te(oo,{startAngle:90,labels:{margin:yt(10)},majorGridLines:{visible:!0},justified:!0}),ut(oo.prototype,so);class no extends ts{constructor(t,e){super(t,e);const i=this.options;i.minorUnit=i.minorUnit||i.majorUnit/2}getDivisions(t){return $s.prototype.getDivisions.call(this,t)-1}reflow(t){this.box=t,this.reflowLabels()}reflowLabels(){const{options:t,labels:e,options:{labels:i}}=this,s=i.skip||0,o=i.step||1,n=new ui,r=this.intervals(t.majorUnit,s,o);for(let t=0;t<e.length;t++){e[t].reflow(n);const i=e[t].box;e[t].reflow(this.getSlot(r[t]).adjacentBox(0,i.width(),i.height()))}}lineBox(){return this.box}intervals(t,e,i,s=!1){const o=this.options.min,n=this.getDivisions(t),r=[],a=i||1;for(let i=e||0;i<n;i+=a){const e=(360+o+i*t)%360;s&&Mt(e,s)||r.push(e)}return r}majorIntervals(){return this.intervals(this.options.majorUnit)}minorIntervals(){return this.intervals(this.options.minorUnit)}intervalAngle(t){return(540-t-this.options.startAngle)%360}createLine(){return[]}majorGridLineAngles(t){const e=this.options.majorGridLines;return this.gridLineAngles(t,this.options.majorUnit,e.skip,e.step)}minorGridLineAngles(t,e){const i=this.options,{minorGridLines:s,majorGridLines:o}=i,n=e?this.intervals(i.majorUnit,o.skip,o.step):null;return this.gridLineAngles(t,i.minorUnit,s.skip,s.step,n)}plotBandSlot(t){return this.getSlot(t.from,t.to)}getSlot(t,e){const{options:i,box:s}=this,o=i.startAngle;let n=Yt(t,i.min,i.max),r=Yt(e||n,n,i.max);if(i.reverse&&(n*=-1,r*=-1),n=(540-n-o)%360,r=(540-r-o)%360,r<n){const t=n;n=r,r=t}return new gi(s.center(),0,s.height()/2,n,r-n)}slot(t,i=t){const s=this.options,o=360-s.startAngle,n=this.getSlot(t,i),r=Math.min(t,i),a=Math.max(t,i);let l,h;return s.reverse?(l=r,h=a):(l=360-a,h=360-r),l=(l+o)%360,h=(h+o)%360,new e.A([n.center.x,n.center.y],{startAngle:l,endAngle:h,radiusX:n.radius,radiusY:n.radius})}getValue(t){const e=this.options,i=this.box.center(),s=t.x-i.x,o=t.y-i.y;let n=Math.round(Ht(Math.atan2(o,s))),r=e.startAngle;return e.reverse||(n*=-1,r*=-1),(n+r+360)%360}valueRange(){return{min:0,max:2*Math.PI}}}te(no,{type:"polar",startAngle:0,reverse:!1,majorUnit:60,min:0,max:360,labels:{margin:yt(10)},majorGridLines:{color:h,visible:!0,width:1},minorGridLines:{color:"#aaa"}}),ut(no.prototype,so,{createPlotBands:oo.prototype.createPlotBands,majorAngles:oo.prototype.majorAngles,range:$s.prototype.range,labelsCount:$s.prototype.labelsCount,createAxisLabel:$s.prototype.createAxisLabel});const ro={options:{majorGridLines:{visible:!0}},createPlotBands:function(){const{majorGridLines:{type:t},plotBands:s=[]}=this.options,o=this.plotArea.polarAxis,n=o.majorAngles(),r=o.box.center(),a=this._plotbandGroup=new e.G({zIndex:-1});for(let o=0;o<s.length;o++){const l=s[o],h={fill:{color:l.color,opacity:l.opacity},stroke:{opacity:l.opacity}},c=this.getSlot(l.from,l.to,!0),d=new gi(r,r.y-c.y2,r.y-c.y1,0,360);let u;u=t===i?xi.current.createRing(d,h):e.b.fromPoints(this.plotBandPoints(d,n),h).close(),a.append(u)}this.appendVisual(a)},plotBandPoints:function(t,i){const s=[],o=[],n=[t.center.x,t.center.y],r=new e.g(n,t.innerRadius),a=new e.g(n,t.radius);for(let t=0;t<i.length;t++)s.push(r.pointAt(i[t]+180)),o.push(a.pointAt(i[t]+180));return s.reverse(),s.push(s[0]),o.push(o[0]),o.concat(s)},createGridLines:function(t){const e=this.options,i=this.radarMajorGridLinePositions(),s=t.majorAngles(),o=t.box.center();let n=[];if(e.majorGridLines.visible&&(n=this.renderGridLines(o,i,s,e.majorGridLines)),e.minorGridLines.visible){const t=this.radarMinorGridLinePositions();Dt(n,this.renderGridLines(o,t,s,e.minorGridLines))}return n},renderGridLines:function(t,s,o,n){const r={stroke:{width:n.width,color:n.color,dashType:n.dashType}},{skip:a=0,step:l=0}=n,h=this.gridLinesVisual();for(let c=a;c<s.length;c+=l){const a=t.y-s[c];if(a>0){const s=new e.g([t.x,t.y],a);if(n.type===i)h.append(new e.f(s,r));else{const t=new e.b(r);for(let e=0;e<o.length;e++)t.lineTo(s.pointAt(o[e]+180));t.close(),h.append(t)}}}return h.children},getValue:function(t){const e=this.lineBox(),s=this.plotArea.polarAxis,o=s.majorAngles(),n=s.box.center(),r=t.distanceTo(n);let a=r;if(this.options.majorGridLines.type!==i&&o.length>1){const e=t.x-n.x,i=t.y-n.y,s=(Ht(Math.atan2(i,e))+540)%360;o.sort((function(t,e){return ao(t,s)-ao(e,s)}));const l=90-ao(o[0],o[1])/2,h=180-ao(s,o[0])-l;a=r*(Math.sin(Zt(h))/Math.sin(Zt(l)))}return this.axisType().prototype.getValue.call(this,new di(e.x1,e.y2-a))}};function ao(t,e){return 180-Math.abs(Math.abs(t-e)-180)}class lo extends $s{radarMajorGridLinePositions(){return this.getTickPositions(this.options.majorUnit)}radarMinorGridLinePositions(){const t=this.options;let e=0;return t.majorGridLines.visible&&(e=t.majorUnit),this.getTickPositions(t.minorUnit,e)}axisType(){return $s}}ut(lo.prototype,ro);class ho extends to{radarMajorGridLinePositions(){const t=[];return this.traverseMajorTicksPositions((function(e){t.push(e)}),this.options.majorGridLines),t}radarMinorGridLinePositions(){const t=[];return this.traverseMinorTicksPositions((function(e){t.push(e)}),this.options.minorGridLines),t}axisType(){return to}}ut(ho.prototype,ro);class co extends e.a{constructor(t){super(),this.closed=t}process(t){const i=t.slice(0),s=[];let o=this.closed,n=i.length;if(n>2&&(this.removeDuplicates(0,i),n=i.length),n<2||2===n&&i[0].equals(i[1]))return s;let r,a,l=i[0],h=i[1],c=i[2];for(s.push(new e.S(l));l.equals(i[n-1]);)o=!0,i.pop(),n--;if(2===n){const t=this.tangent(l,h,W,X);return Xt(s).controlOut(this.firstControlPoint(t,l,h,W,X)),s.push(new e.S(h,this.secondControlPoint(t,l,h,W,X))),s}if(o){l=i[n-1],h=i[0],c=i[1];const t=this.controlPoints(l,h,c);r=t[1],a=t[0]}else{const t=this.tangent(l,h,W,X);r=this.firstControlPoint(t,l,h,W,X)}let d=r;for(let t=0;t<=n-3;t++)if(this.removeDuplicates(t,i),n=i.length,t+3<=n){l=i[t],h=i[t+1],c=i[t+2];const o=this.controlPoints(l,h,c);Xt(s).controlOut(d),d=o[1];const n=o[0];s.push(new e.S(h,n))}if(o){l=i[n-2],h=i[n-1],c=i[0];const t=this.controlPoints(l,h,c);Xt(s).controlOut(d),s.push(new e.S(h,t[0])),Xt(s).controlOut(t[1]),s.push(new e.S(c,a))}else{const t=this.tangent(h,c,W,X);Xt(s).controlOut(d),s.push(new e.S(c,this.secondControlPoint(t,h,c,W,X)))}return s}removeDuplicates(t,e){for(;e[t+1]&&(e[t].equals(e[t+1])||e[t+1].equals(e[t+2]));)e.splice(t+1,1)}invertAxis(t,e,i){let s=!1;if(t.x===e.x)s=!0;else if(e.x===i.x)(e.y<i.y&&t.y<=e.y||i.y<e.y&&e.y<=t.y)&&(s=!0);else{const o=this.lineFunction(t,e),n=this.calculateFunction(o,i.x);t.y<=e.y&&i.y<=n||e.y<=t.y&&i.y>=n||(s=!0)}return s}isLine(t,e,i){const s=this.lineFunction(t,e),o=this.calculateFunction(s,i.x);return t.x===e.x&&e.x===i.x||$t(o,1)===$t(i.y,1)}lineFunction(t,e){const i=(e.y-t.y)/(e.x-t.x);return[t.y-i*t.x,i]}controlPoints(t,e,i){let s,o=W,n=X,r=!1,a=!1;if(this.isLine(t,e,i))s=this.tangent(t,e,W,X);else{const l={x:this.isMonotonicByField(t,e,i,W),y:this.isMonotonicByField(t,e,i,X)};if(l.x&&l.y)s=this.tangent(t,i,W,X),r=!0;else if(this.invertAxis(t,e,i)&&(o=X,n=W),l[o])s=0;else{let r;r=i[n]<t[n]&&t[n]<=e[n]||t[n]<i[n]&&e[n]<=t[n]?uo((i[n]-t[n])*(e[o]-t[o])):-uo((i[o]-t[o])*(e[n]-t[n])),s=.01*r,a=!0}}const l=this.secondControlPoint(s,t,e,o,n);if(a){const t=o;o=n,n=t}const h=this.firstControlPoint(s,e,i,o,n);return r&&(this.restrictControlPoint(t,e,l,s),this.restrictControlPoint(e,i,h,s)),[l,h]}restrictControlPoint(t,e,i,s){t.y<e.y?e.y<i.y?(i.x=t.x+(e.y-t.y)/s,i.y=e.y):i.y<t.y&&(i.x=e.x-(e.y-t.y)/s,i.y=t.y):i.y<e.y?(i.x=t.x-(t.y-e.y)/s,i.y=e.y):t.y<i.y&&(i.x=e.x+(t.y-e.y)/s,i.y=t.y)}tangent(t,e,i,s){const o=e[i]-t[i],n=e[s]-t[s];let r;return r=0===o?0:n/o,r}isMonotonicByField(t,e,i,s){return i[s]>e[s]&&e[s]>t[s]||i[s]<e[s]&&e[s]<t[s]}firstControlPoint(t,e,i,s,o){const n=e[s],r=.333*(i[s]-n);return this.point(n+r,e[o]+r*t,s,o)}secondControlPoint(t,e,i,s,o){const n=e[s],r=i[s],a=.333*(r-n);return this.point(r-a,i[o]-a*t,s,o)}point(t,i,s,o){const n=new e.P;return n[s]=t,n[o]=i,n}calculateFunction(t,e){const i=t.length;let s=0;for(let o=0;o<i;o++)s+=Math.pow(e,o)*t[o];return s}}function uo(t){return t<=0?-1:1}var po=Object.freeze({__proto__:null,Axis:ts,AxisLabel:Ni,Box:ui,BoxElement:Ci,CategoryAxis:Os,ChartElement:yi,Class:e.a,CurveProcessor:co,DateCategoryAxis:Ws,DateValueAxis:Ks,FloatElement:Ri,FontLoader:Jt,Gradients:Ei,HashMap:Pt,InstanceObserver:It,LogarithmicAxis:to,Matrix:_e,Note:ji,NumericAxis:$s,Observable:He,Point:di,PolarAxis:no,RadarCategoryAxis:oo,RadarLogarithmicAxis:ho,RadarNumericAxis:lo,Ring:gi,RootElement:Ii,Sector:fi,ShapeBuilder:xi,ShapeElement:Pi,Text:Oi,TextBox:zi,Title:Fi,UserEvents:hi,absoluteDateDiff:xs,addClass:K,addDuration:_s,addTicks:ys,alignPathToPixel:et,append:Dt,applyEventMap:Ce,autoMajorUnit:ci,autoTextColor:ge,bindEvents:zt,ceilDate:As,clockwise:it,constants:$,convertableToNumber:nt,createHashSet:ye,createPatternFill:Si,cycleDown:at,cycleIndex:lt,cycleUp:rt,dateComparer:Ss,dateDiff:Cs,dateEquals:Ps,dateIndex:Es,deepExtend:ut,defaultErrorHandler:ve,defined:Ft,deg:Ht,duration:Ls,elementOffset:Nt,elementScale:pe,elementSize:jt,elementStyles:xt,eventCoordinates:Ut,eventElement:Gt,eventMap:Ae,find:he,firstDay:Bs,floorDate:ks,getAriaTemplate:_t,getSpacing:yt,getSupportedFeatures:Ie,getTemplate:wt,getter:St,grep:Ct,hasClasses:Tt,hasOwnProperty:we,hashKey:Wt,inArray:Mt,interpolateValue:Et,isArray:Q,isFunction:ht,isNumber:st,isObject:pt,isPlainObject:Rt,isString:ot,keys:be,last:Xt,limitValue:Yt,logToConsole:e.l,lteDateIndex:function(t,e){let i,s=0,o=e.length-1;for(;s<=o;){i=Math.floor((s+o)/2);const n=e[i];if(n<t)s=i+1;else{if(!(n>t)){for(;Ps(e[i-1],t);)i--;return i}o=i-1}}return e[i]<=t?i:i-1},map:Bt,mousewheelDelta:Vt,noop:Be,now:Oe,objectKey:qt,off:Le,on:Ee,parseDate:Is,parseDates:Rs,rad:Zt,rectToBox:Vi,removeClass:tt,renderIcon:ae,round:$t,services:Qi,setDefaultOptions:te,sparseArrayLimits:le,startOfWeek:bs,styleValue:gt,toDate:vs,toTime:Ts,unbindEvents:Qt,valueOrDefault:Kt});class go extends e.a{constructor(t){super(),this._axis=t,this.options=t.options}value(t){const e=this._axis;return e.getCategory?e.getCategory(t):e.getValue(t)}slot(t,e,i=!0){return this._axis.slot(t,e,i)}range(){return this._axis.range()}valueRange(){return this._axis.valueRange()}}function mo(t,e){for(let i=0;i<e.length;i++)if(e[i].options.name===t)return e[i].prepareUserOptions(),new go(e[i])}class fo{constructor(t){this.visual=t.visual,this.chartsVisual=t.chartContainer.visual,this._pane=t}findAxisByName(t){return mo(t,this._pane.axes)}}class xo extends e.a{constructor(t){super(),this._plotArea=t,this.visual=t.visual,this.backgroundVisual=t._bgVisual}}function yo(t){const e=t.length;let i=0;for(let s=0;s<e;s++){st(t[s])&&i++}return i}const vo={min:function(t){const e=t.length;let i=C;for(let s=0;s<e;s++){const e=t[s];st(e)&&(i=Math.min(i,e))}return i===C?t[0]:i},max:function(t){const e=t.length;let i=T;for(let s=0;s<e;s++){const e=t[s];st(e)&&(i=Math.max(i,e))}return i===T?t[0]:i},sum:function(t){const e=t.length;let i=0;for(let s=0;s<e;s++){const e=t[s];st(e)&&(i+=e)}return i},sumOrNull:function(t){let e=null;return yo(t)&&(e=vo.sum(t)),e},count:function(t){const e=t.length;let i=0;for(let s=0;s<e;s++){const e=t[s];null!==e&&Ft(e)&&i++}return i},avg:function(t){const e=yo(t);let i=t[0];return e>0&&(i=vo.sum(t)/e),i},first:function(t){const e=t.length;for(let i=0;i<e;i++){const e=t[i];if(null!==e&&Ft(e))return e}return t[0]}};function bo(t,e){if(null===e)return e;return St(t)(e)}class wo extends e.a{constructor(){super(),this._valueFields={},this._otherFields={},this._nullValue={},this._undefinedValue={}}register(t,e=[j],i={}){for(let s=0;s<t.length;s++){const o=t[s];this._valueFields[o]=e,this._otherFields[o]=i,this._nullValue[o]=this._makeValue(e,null),this._undefinedValue[o]=this._makeValue(e,void 0)}}canonicalFields(t){return this.valueFields(t).concat(this.otherFields(t))}valueFields(t){return this._valueFields[t.type]||[j]}otherFields(t){return this._otherFields[t.type]||[j]}bindPoint(t,e,i){const s=t.data,o=Ft(i)?i:s[e],n={valueFields:{value:o}},r=this.valueFields(t),a=this._otherFields[t.type];let l,h;if(null===o)h=this._nullValue[t.type];else if(Ft(o)){if(Array.isArray(o)){const t=o.slice(r.length);h=this._bindFromArray(o,r),l=this._bindFromArray(t,a)}else if("object"==typeof o){const e=this.sourceFields(t,r),i=this.sourceFields(t,a);h=this._bindFromObject(o,r,e),l=this._bindFromObject(o,a,i)}}else h=this._undefinedValue[t.type];return Ft(h)&&(1===r.length?n.valueFields.value=h[r[0]]:n.valueFields=h),n.fields=l||{},n}_makeValue(t,e){const i={},s=t.length;for(let o=0;o<s;o++){i[t[o]]=e}return i}_bindFromArray(t,e){const i={};if(e){const s=Math.min(e.length,t.length);for(let o=0;o<s;o++)i[e[o]]=t[o]}return i}_bindFromObject(t,e,i=e){const s={};if(e){const o=e.length;for(let n=0;n<o;n++){const o=e[n],r=i[n];null!==r&&(s[o]=bo(r,t))}}return s}sourceFields(t,e){const i=[];if(e){const s=e.length;for(let o=0;o<s;o++){const s=e[o],n=s===j?"field":s+"Field";i.push(null!==t[n]?t[n]||s:null)}}return i}}wo.current=new wo;const _o=/percent(?:\w*)\((\d+)\)/,ko=new RegExp("^stddev(?:\\((\\d+(?:\\.\\d+)?)\\))?$");class Ao extends e.a{constructor(t,e,i){super(),this.initGlobalRanges(t,e,i)}initGlobalRanges(t,e,i){const s=e.data,o=ko.exec(t);if(o){this.valueGetter=this.createValueGetter(e,i);const t=this.getAverage(s),n=this.getStandardDeviation(s,t,!1),r=o[1]?parseFloat(o[1]):1,a={low:t.value-n*r,high:t.value+n*r};this.globalRange=function(){return a}}else if(t.indexOf&&t.indexOf("stderr")>=0){this.valueGetter=this.createValueGetter(e,i);const t=this.getStandardError(s,this.getAverage(s));this.globalRange=function(e){return{low:e-t,high:e+t}}}}createValueGetter(t,e){const i=t.data,s=wo.current,o=s.valueFields(t),n=Ft(i[0])?i[0]:{};let r;if(Q(n)){r=St("["+(e?o.indexOf(e):0)+"]")}else if(st(n))r=St();else if(typeof n===I){r=St(s.sourceFields(t,o)[o.indexOf(e)])}return r}getErrorRange(t,e){let i,s,o;if(!Ft(e))return null;if(this.globalRange)return this.globalRange(t);if(Q(e))i=t-e[0],s=t+e[1];else if(st(o=parseFloat(e)))i=t-o,s=t+o;else{if(!(o=_o.exec(e)))throw new Error("Invalid ErrorBar value: "+e);{const e=t*(parseFloat(o[1])/100);i=t-Math.abs(e),s=t+Math.abs(e)}}return{low:i,high:s}}getStandardError(t,e){return this.getStandardDeviation(t,e,!0)/Math.sqrt(e.count)}getStandardDeviation(t,e,i){const s=t.length,o=i?e.count-1:e.count;let n=0;for(let i=0;i<s;i++){const s=this.valueGetter(t[i]);st(s)&&(n+=Math.pow(s-e.value,2))}return Math.sqrt(n/o)}getAverage(t){const e=t.length;let i=0,s=0;for(let o=0;o<e;o++){const e=this.valueGetter(t[o]);st(e)&&(i+=e,s++)}return{value:i/s,count:s}}}const So=e.s.browser||{},Co=600,To="fadeIn",Po=.8,Mo=So.msie?.001:0,Eo="errorLow",Lo="errorHigh",Io="xErrorLow",Ro="xErrorHigh",Bo="yErrorLow",Oo="yErrorHigh",Vo="zero",Do="interpolate",zo="gap",Fo="above",Ho="below",No="smooth",jo="step",Uo="area",Go="bar",Wo="boxPlot",Xo="bubble",Yo="bullet",qo="candlestick",Zo="column",$o="donut",Qo="funnel",Ko="pyramid",Jo="heatmap",tn="horizontalWaterfall",en="line",sn="ohlc",on="pie",nn="polarArea",rn="polarLine",an="polarScatter",ln="radarArea",hn="radarColumn",cn="radarLine",dn="rangeArea",un="rangeBar",pn="rangeColumn",gn="scatter",mn="scatterLine",fn="verticalArea",xn="verticalBoxPlot",yn="verticalBullet",vn="verticalLine",bn="verticalRangeArea",wn="waterfall",_n=[Go,Zo,sn,qo,Wo,xn,Yo,pn,un,wn,tn],kn="exponentialTrendline",An="linearTrendline",Sn="logarithmicTrendline",Cn="movingAverageTrendline",Tn="polynomialTrendline",Pn="powerTrendline",Mn=[kn,An,Sn,Cn,Tn,Pn],En="legendItemClick",Ln="legendItemHover",In="legendItemLeave",Rn="seriesClick",Bn="seriesHover",On="seriesOver",Vn="seriesLeave",Dn="plotAreaClick",zn="plotAreaHover",Fn="plotAreaLeave",Hn="drag",Nn="dragEnd",jn="dragStart",Un="zoomStart",Gn="zoom",Wn="zoomEnd",Xn="selectStart",Yn="select",qn="selectEnd",Zn="render",$n="showTooltip",Qn="hideTooltip",Kn="paneRender",Jn="graphics-symbol",tr="k-chart-point",er="Point",ir="checkbox",sr="k-chart-legend-item",or="Legend item",nr="log",rr="category",ar="insideEnd",lr="insideBase",hr="outsideEnd",cr="wheel",dr=150,ur="drilldown",pr="drilldown",gr="pattern";var mr=Object.freeze({__proto__:null,ABOVE:Fo,AREA:Uo,BAR:Go,BELOW:Ho,BORDER_BRIGHTNESS:Po,BOTTOM:"bottom",BOX_PLOT:Wo,BUBBLE:Xo,BULLET:Yo,CANDLESTICK:qo,CATEGORY:rr,CHART_POINT_CLASSNAME:tr,CHART_POINT_ROLE:Jn,CHART_POINT_ROLE_DESCRIPTION:er,COLUMN:Zo,DONUT:$o,DRAG:Hn,DRAG_END:Nn,DRAG_START:jn,DRILLDOWN:ur,DRILLDOWN_FIELD:pr,EQUALLY_SPACED_SERIES:_n,ERROR_HIGH_FIELD:Lo,ERROR_LOW_FIELD:Eo,FADEIN:To,FUNNEL:Qo,GAP:zo,GLASS:"glass",HEATMAP:Jo,HIDE_TOOLTIP:Qn,HORIZONTAL_WATERFALL:tn,INITIAL_ANIMATION_DURATION:Co,INSIDE_BASE:lr,INSIDE_END:ar,INTERPOLATE:Do,LEGEND_ITEM_ARIA_ROLE_DESCRIPTION:or,LEGEND_ITEM_CLASSNAME:sr,LEGEND_ITEM_CLICK:En,LEGEND_ITEM_HOVER:Ln,LEGEND_ITEM_LEAVE:In,LEGEND_ITEM_ROLE:ir,LINE:en,LINE_MARKER_SIZE:8,LOGARITHMIC:nr,MIN_MOVING_AVERAGE_PERIOD:2,MOUSEWHEEL:cr,MOUSEWHEEL_DELAY:dr,MOUSEWHEEL_ZOOM_RATE:.3,OHLC:sn,OUTSIDE_END:hr,PANE_RENDER:Kn,PATTERN_FIELD:gr,PIE:on,PLOT_AREA_CLICK:Dn,PLOT_AREA_HOVER:zn,PLOT_AREA_LEAVE:Fn,POLAR_AREA:nn,POLAR_LINE:rn,POLAR_SCATTER:an,PYRAMID:Ko,RADAR_AREA:ln,RADAR_COLUMN:hn,RADAR_LINE:cn,RANGE_AREA:dn,RANGE_BAR:un,RANGE_COLUMN:pn,RENDER:Zn,SCATTER:gn,SCATTER_LINE:mn,SELECT:Yn,SELECT_END:qn,SELECT_START:Xn,SERIES_CLICK:Rn,SERIES_HOVER:Bn,SERIES_LEAVE:Vn,SERIES_OVER:On,SHOW_TOOLTIP:$n,SMOOTH:No,START_SCALE:Mo,STEP:jo,TOOLTIP_OFFSET:5,TRENDLINE_EXPONENTIAL:kn,TRENDLINE_LINEAR:An,TRENDLINE_LOGARITHMIC:Sn,TRENDLINE_MOVING_AVERAGE:Cn,TRENDLINE_POLYNOMIAL:Tn,TRENDLINE_POWER:Pn,TRENDLINE_SERIES:Mn,VERTICAL_AREA:fn,VERTICAL_BOX_PLOT:xn,VERTICAL_BULLET:yn,VERTICAL_LINE:vn,VERTICAL_RANGE_AREA:bn,WATERFALL:wn,X_ERROR_HIGH_FIELD:Ro,X_ERROR_LOW_FIELD:Io,Y_ERROR_HIGH_FIELD:Oo,Y_ERROR_LOW_FIELD:Bo,ZERO:Vo,ZOOM:Gn,ZOOM_END:Wn,ZOOM_START:Un});class fr extends yi{constructor(t,e,i,s,o,n){super(n),this.low=t,this.high=e,this.isVertical=i,this.chart=s,this.series=o}reflow(t){const e=this.options.endCaps,i=this.isVertical,s=this.getAxis().getSlot(this.low,this.high),o=t.center(),n=this.getCapsWidth(t,i),r=i?o.x:o.y,a=r-n,l=r+n;let h;i?(h=[new di(o.x,s.y1),new di(o.x,s.y2)],e&&h.push(new di(a,s.y1),new di(l,s.y1),new di(a,s.y2),new di(l,s.y2)),this.box=new ui(a,s.y1,l,s.y2)):(h=[new di(s.x1,o.y),new di(s.x2,o.y)],e&&h.push(new di(s.x1,a),new di(s.x1,l),new di(s.x2,a),new di(s.x2,l)),this.box=new ui(s.x1,a,s.x2,l)),this.linePoints=h}getCapsWidth(t,e){const i=e?t.width():t.height();return Math.min(Math.floor(i/2),4)||4}createVisual(){const t=this.options,e=t.visual;e?this.visual=e({low:this.low,high:this.high,rect:this.box.toRect(),sender:this.getSender(),options:{endCaps:t.endCaps,color:t.color,line:t.line},createVisual:()=>{this.createDefaultVisual();const t=this.visual;return delete this.visual,t}}):this.createDefaultVisual()}createDefaultVisual(){const{options:t,linePoints:i}=this,s={stroke:{color:t.color,width:t.line.width,dashType:t.line.dashType}};super.createVisual();for(let t=0;t<i.length;t+=2){const o=new e.b(s).moveTo(i[t].x,i[t].y).lineTo(i[t+1].x,i[t+1].y);et(o),this.visual.append(o)}}}te(fr,{animation:{type:To,delay:Co},endCaps:!0,line:{width:2},zIndex:1});class xr extends fr{getAxis(){return this.chart.seriesValueAxis(this.series)}}function yr(t){for(let e=0;e<t.length;e++)if(Ft(t[e].zIndex))return!0}function vr(t,e){null!==e&&t.push(e)}function br(t){return yo(t)===t.length}function wr(t,e,i){const s=e.visible;if(Ft(s))return s;const o=t.pointVisibility;return o?o[i]:void 0}function _r(t){const e=t.data,i=[];let s=0,o=0;for(let n=0;n<e.length;n++){const e=wo.current.bindPoint(t,n);let r=e.valueFields.value;ot(r)&&(r=parseFloat(r)),st(r)?(e.visible=!1!==wr(t,e.fields,n),e.value=Math.abs(r),i.push(e),e.visible&&(s+=e.value),0!==r&&o++):i.push(null)}return{total:s,points:i,count:o}}function kr(t){const e=t.length;let i=0;for(let s=0;s<e;s++)i=Math.max(i,t[s].data.length);return i}function Ar(t,e){return t&&e?t.toLowerCase()===e.toLowerCase():t===e}function Sr(t,e,i={},s=!1){const o=i.defaults=i.defaults||{},n=i.depth=i.depth||0;let r=!1;if(i.excluded=i.excluded||[],n>5)return null;for(let n in t)if(!Mt(n,i.excluded)&&we(t,n)){const a=t[n];ht(a)?(r=!0,s||(t[n]=Kt(a(e),o[n]))):pt(a)&&(s||(i.defaults=o[n]),i.depth++,r=Sr(a,e,i,s)||r,i.depth--)}return r}function Cr(t,e){const i=[],s=[].concat(e);for(let e=0;e<t.length;e++){const o=t[e];Mt(o.type,s)&&i.push(o)}return i}const Tr=new WeakMap;function Pr(t,e,i){if(null===e||"object"!=typeof e)return Is(i,t);let s=Tr.get(e);return s||(s=Is(i,t),Tr.set(e,s)),s}function Mr(t){const e=t.overlay;return e&&e.gradient&&"none"!==e.gradient}function Er(t){return Ft(t)&&null!==t}function Lr(t,e){const i=t.type,s=e instanceof Date;return!i&&s||Ar(i,g)}function Ir(t){return 1===t.length?t[0]:t}const Rr=/area/i;function Br(t,e){const i=wo.current.bindPoint(t,null,e).valueFields;for(let t in i)if(nt(i[t]))return!0}function Or({start:t,dir:e,min:i,max:s,getter:o,hasItem:n,series:r}){let a,l,h=t;do{h+=e,n(h)&&(l=o(h),a=Br(r,l.item))}while(i<=h&&h<=s&&!a);if(a)return l}function Vr(t,e,i,s,o){const{min:n,max:r}=e,a=n>0&&n<i,l=r+1<i;if(a||l){const e=function(t){return t.missingValues?t.missingValues:Rr.test(t.type)||t.stack?Vo:Do}(t);let h,c;if(e!==Do)a&&(h=s(n-1)),l&&(c=s(r+1));else{let e,d;a&&(e=s(n-1),d=Br(t,e.item),h=d?e:Or({start:n,dir:-1,min:0,max:i-1,getter:s,hasItem:o,series:t})),l&&(e=s(r+1),d=Br(t,e.item),c=d?e:Or({start:r,dir:1,min:0,max:i-1,getter:s,hasItem:o,series:t}))}h&&(t._outOfRangeMinPoint=h),c&&(t._outOfRangeMaxPoint=c)}}class Dr extends yi{constructor(t,e){super(e),this.plotArea=t,this.chartService=t.chartService,this.categoryAxis=t.seriesCategoryAxis(e.series[0]),this.valueAxisRanges={},this.points=[],this.categoryPoints=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[],this.render()}render(){this.traverseDataPoints(this.addValue.bind(this))}pointOptions(t,e){let i=this.seriesOptions[e];if(!i){const s=this.pointType().prototype.defaults;this.seriesOptions[e]=i=ut({},s,{vertical:!this.options.invertAxes},t)}return i}plotValue(t){if(!t)return 0;if(this.options.isStacked100&&st(t.value)){const e=t.categoryIx,i=this.categoryPoints[e],s=[];let o=0;for(let e=0;e<i.length;e++){const n=i[e];if(n){const e=t.series.stack,i=n.series.stack;if(e&&i&&e.group!==i.group)continue;st(n.value)&&(o+=Math.abs(n.value),s.push(Math.abs(n.value)))}}if(o>0)return t.value/o}return t.value}plotRange(t,e=0){const i=this.categoryPoints[t.categoryIx];if(this.options.isStacked){let s=this.plotValue(t);const o=s>=0;let n=e,r=!1;const a=Ft(t.series.stack)?t.series.stack:this.options.defaultStack,l=t=>!0===t||typeof t===I&&!t.group;if(a)for(let h=0;h<i.length;h++){const c=i[h];if(t===c)break;const d=Ft(c.series.stack)?c.series.stack:this.options.defaultStack;if(!d)continue;if(typeof a===D&&a!==d)continue;if(l(a)&&!l(d))continue;if(a.group&&a.group!==d.group)continue;const u=this.plotValue(c);(u>=0&&o||u<0&&!o)&&(0!==e&&0===u||(n+=u,s+=u,r=!0,this.options.isStacked100&&(s=Math.min(s,1))))}return r&&(n-=e),[n,s]}const s=t.series,o=this.seriesValueAxis(s),n=this.categoryAxisCrossingValue(o);return[n,nt(t.value)?t.value:n]}stackLimits(t,e){let i=C,s=T;for(let o=0;o<this.categoryPoints.length;o++){const n=this.categoryPoints[o];if(n)for(let o=0;o<n.length;o++){const r=n[o];if(r&&(r.series.stack===e||r.series.axis===t)){const t=this.plotRange(r,0)[1];Ft(t)&&isFinite(t)&&(s=Math.max(s,t),i=Math.min(i,t))}}}return{min:i,max:s}}updateStackRange(){const{isStacked:t,series:e}=this.options,i={};if(t)for(let t=0;t<e.length;t++){const s=e[t],o=s.axis,n=o+s.stack;let r=i[n];if(!r){r=this.stackLimits(o,s.stack);const t=this.errorTotals;t&&(t.negative.length&&(r.min=Math.min(r.min,le(t.negative).min)),t.positive.length&&(r.max=Math.max(r.max,le(t.positive).max))),r.min!==C||r.max!==T?i[n]=r:r=null}r&&(this.valueAxisRanges[o]=r)}}addErrorBar(t,e,i){const{value:s,series:o,seriesIx:n}=t,r=t.options.errorBars,a=e.fields[Eo],l=e.fields[Lo];let h;st(a)&&st(l)?h={low:a,high:l}:r&&Ft(r.value)&&(this.seriesErrorRanges=this.seriesErrorRanges||[],this.seriesErrorRanges[n]=this.seriesErrorRanges[n]||new Ao(r.value,o,j),h=this.seriesErrorRanges[n].getErrorRange(s,r.value)),h&&(t.low=h.low,t.high=h.high,this.addPointErrorBar(t,i))}addPointErrorBar(t,e){const i=!this.options.invertAxes,s=t.options.errorBars;let{series:o,low:n,high:r}=t;if(this.options.isStacked){const i=this.stackedErrorRange(t,e);n=i.low,r=i.high}else{const t={categoryIx:e,series:o};this.updateRange({value:n},t),this.updateRange({value:r},t)}const a=new xr(n,r,i,this,o,s);t.errorBars=[a],t.append(a)}stackedErrorRange(t,e){const i=this.plotRange(t,0)[1]-t.value,s=t.low+i,o=t.high+i;return this.errorTotals=this.errorTotals||{positive:[],negative:[]},s<0&&(this.errorTotals.negative[e]=Math.min(this.errorTotals.negative[e]||0,s)),o>0&&(this.errorTotals.positive[e]=Math.max(this.errorTotals.positive[e]||0,o)),{low:s,high:o}}addValue(t,e){const{categoryIx:i,series:s,seriesIx:o}=e;let n=this.categoryPoints[i];n||(this.categoryPoints[i]=n=[]);let r=this.seriesPoints[o];r||(this.seriesPoints[o]=r=[]);const a=this.createPoint(t,e);a&&(Object.assign(a,e),a.owner=this,a.noteText=t.fields.noteText,Ft(a.dataItem)||(a.dataItem=s.data[i]),this.addErrorBar(a,t,i)),this.points.push(a),r.push(a),n.push(a),this.updateRange(t.valueFields,e)}evalPointOptions(t,e,i){const s=i.categoryIx,o=i.category,n=i.series,r=i.seriesIx,a={defaults:n._defaults,excluded:["data","aggregate","_events","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint","drilldownSeriesFactory","ariaTemplate","ariaContent"]};let l=this._evalSeries[r];Ft(l)||(this._evalSeries[r]=l=Sr(t,{},a,!0));let h=t;return l&&(h=ut({},h),Sr(h,{value:e,category:o,index:s,series:n,dataItem:n.data[s]},a)),h}updateRange(t,e){const i=e.series.axis,s=t.value;let o=this.valueAxisRanges[i];isFinite(s)&&null!==s&&(o=this.valueAxisRanges[i]=o||{min:C,max:T},o.min=Math.min(o.min,s),o.max=Math.max(o.max,s))}seriesValueAxis(t){const e=this.plotArea,i=t.axis,s=i?e.namedValueAxes[i]:e.valueAxis;if(!s)throw new Error("Unable to locate value axis with name "+i);return s}reflow(t){const e=this.categorySlots=[],i=this.points,s=this.categoryAxis;let o=0;this.traverseDataPoints(((t,n)=>{const{categoryIx:r,series:a}=n,l=this.seriesValueAxis(a),h=i[o++];let c=e[r];if(c||(e[r]=c=this.categorySlot(s,r,l)),h){const t=this.plotRange(h,l.startValue()),e=this.valueSlot(l,t);if(e){const i=this.pointSlot(c,e);h.aboveAxis=this.aboveAxis(h,l),h.stackValue=t[1],this.options.isStacked100&&(h.percentage=this.plotValue(h)),this.reflowPoint(h,i)}else h.visible=!1}})),this.reflowCategories(e),!this.options.clip&&this.options.limitPoints&&this.points.length&&this.limitPoints(),this.box=t}valueSlot(t,e){return t.getSlot(e[0],e[1],!this.options.clip)}limitPoints(){const t=this.categoryPoints,e=t[0].concat(Xt(t));for(let t=0;t<e.length;t++)e[t]&&this.limitPoint(e[t])}limitPoint(t){const e=this.categoryAxis.limitSlot(t.box);e.equals(t.box)||t.reflow(e)}aboveAxis(t,e){const i=this.categoryAxisCrossingValue(e),s=t.value;return e.options.reverse?s<i:s>=i}categoryAxisCrossingValue(t){const e=this.categoryAxis,i=t.options;return[].concat(i.axisCrossingValues||i.axisCrossingValue)[e.axisIndex||0]||0}reflowPoint(t,e){t.reflow(e)}reflowCategories(){}pointSlot(t,e){const i=this.options.invertAxes,s=i?e:t,o=i?t:e;return new ui(s.x1,o.y1,s.x2,o.y2)}categorySlot(t,e){return t.getSlot(e)}traverseDataPoints(t){const e=this.options.series,i=kr(e),s=e.length;for(let i=0;i<s;i++)this._outOfRangeCallback(e[i],"_outOfRangeMinPoint",i,t);for(let o=0;o<i;o++)for(let n=0;n<s;n++){const s=e[n],r=this.categoryAxis.categoryAt(o);t(this.plotArea.bindPoint(s,o),{category:r,categoryIx:o,categoriesCount:i,series:s,seriesIx:n})}for(let i=0;i<s;i++)this._outOfRangeCallback(e[i],"_outOfRangeMaxPoint",i,t)}_outOfRangeCallback(t,e,i,s){const o=t[e];if(o){const e=o.categoryIx;s(this.plotArea.bindPoint(t,e,o.item),{category:o.category,categoryIx:e,series:t,seriesIx:i,dataItem:o.item})}}formatPointValue(t,e){return null===t.value?"":this.chartService.format.auto(e,t.value)}pointValue(t){return t.valueFields.value}}te(Dr,{series:[],invertAxes:!1,isStacked:!1,clip:!0,limitPoints:!0});const zr={click:function(t,e){return t.trigger(Rn,this.eventArgs(e))},hover:function(t,e){return t.trigger(Bn,this.eventArgs(e))},over:function(t,e){return t.trigger(On,this.eventArgs(e))},out:function(t,e){return t.trigger(Vn,this.eventArgs(e))},eventArgs:function(t){return{value:this.value,percentage:this.percentage,stackValue:this.stackValue,category:this.category,series:this.series,dataItem:this.dataItem,runningTotal:this.runningTotal,total:this.total,element:Gt(t),originalEvent:t,point:this}}},Fr={createNote:function(){const t=this.options.notes,e=this.noteText||t.label.text;!1!==t.visible&&Ft(e)&&null!==e&&(this.note=new ji({value:this.value,text:e,dataItem:this.dataItem,category:this.category,series:this.series},this.options.notes,this.owner.chartService),this.append(this.note))}};class Hr extends yi{constructor(t,e){super(),this.value=t,this.options=e,this.aboveAxis=Kt(this.options.aboveAxis,!0),this.tooltipTracking=!0,this._id=Te()}render(){const{markers:t}=this.options;this._rendered||(this._rendered=!0,t.visible&&t.size&&(this.marker=this.createMarker(),this.append(this.marker)),this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))}createLabel(){const t=this.options.labels;t.visible&&(this.label=this.createLabelElement(t),this.append(this.label))}createLabelElement(t){return new zi(this.getLabelText(t),ut({align:d,vAlign:d,margin:{left:5,right:5},zIndex:Kt(t.zIndex,this.series.zIndex)},t),this.pointData())}getLabelText(t){let e=wt(t);return e?e(this.pointData()):t.format?this.formatValue(t.format):this.value}getAriaLabelText(){const t=this.options.labels,e=_t(t);return e?e(this.pointData()):this.getLabelText(t)}markerBorder(){const t=this.options.markers,i=t.background,s=ut({color:this.color},t.border);return Ft(s.color)||(s.color=new e.C(i).brightness(Po).toHex()),s}createVisual(){}createMarker(){const t=this.options.markers;return new Pi({type:t.type,width:t.size,height:t.size,rotation:t.rotation,background:t.background,border:this.markerBorder(),opacity:t.opacity,pattern:this.options.pattern,zIndex:Kt(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual,accessibilityOptions:ut({ariaLabel:this.getAriaLabelText(this.options.labels)},this.options.accessibility)},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category})}markerBox(){return this.marker||(this.marker=this.createMarker(),this.marker.reflow(this._childBox)),this.marker.box}reflow(t){const{options:e,aboveAxis:i}=this,s=e.vertical;this.render(),this.box=t;const o=t.clone();if(s?i?o.y1-=o.height():o.y2+=o.height():i?o.x1+=o.width():o.x2-=o.width(),this._childBox=o,this.marker&&this.marker.reflow(o),this.reflowLabel(o),this.errorBars)for(let t=0;t<this.errorBars.length;t++)this.errorBars[t].reflow(o);if(this.note){let t=this.markerBox();if(!e.markers.visible||!e.markers.size){const e=t.center();t=new ui(e.x,e.y,e.x,e.y)}this.note.reflow(t)}}reflowLabel(t){const{options:e,label:i}=this;let s=e.labels.position;i&&(s=s===Fo?z:s,s=s===Ho?c:s,i.reflow(t),i.box.alignTo(this.markerBox(),s),i.reflow(i.box))}createHighlight(){const t=this.options.highlight.markers,e=this.markerBorder().color,i=this.options.markers,s=i.size+(i.border.width||0)+(t.border.width||0),o=new Pi({type:i.type,width:s,height:s,rotation:i.rotation,background:t.color||e,border:{color:t.border.color,width:t.border.width,opacity:Kt(t.border.opacity,1)},opacity:Kt(t.opacity,1)});return o.reflow(this._childBox),o.getElement()}highlightVisual(){return(this.marker||{}).visual}highlightVisualArgs(){const t=this.marker;let i,s;if(t)s=t.paddingBox.toRect(),i=t.visual;else{const t=this.options.markers.size,i=t/2,o=this.box.center();s=new e.R([o.x-i,o.y-i],[t,t])}return{options:this.options,rect:s,visual:i}}createFocusHighlight(){const t=this.options.markers,e=this.options.focusHighlight,i=t.size+(t.border.width||0),s=new Pi({type:t.type,width:i,height:i,rotation:t.rotation,background:e.color,border:e.border,opacity:e.opacity,padding:e.border.width/2,zIndex:e.zIndex});return s.reflow(this._childBox),s.getElement()}tooltipAnchor(){const t=this.markerBox(),e=this.owner.pane.clipBox();if(!e||e.overlaps(t)){const e=t.x2+5,i=S;let s,o;return this.aboveAxis?(s=t.y1,o=c):(s=t.y2,o=z),{point:new di(e,s),align:{horizontal:i,vertical:o}}}}formatValue(t){return this.owner.formatPointValue(this,t)}overlapsBox(t){return this.markerBox().overlaps(t)}unclipElements(){this.label&&(this.label.options.noclip=!0),this.note&&(this.note.options.noclip=!0)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,series:this.series}}focusVisual(){this.marker&&(this.marker.visual&&this.marker.visual.options.set("id",this._id),this.toggleFocusHighlight(!0))}clearFocusFromVisual(){this.marker&&(this.marker.visual&&this.marker.visual.options.set("id",""),this.toggleFocusHighlight(!1))}getIndex(){return Ft(this.categoryIx)?this.categoryIx:this.pointIx}}Hr.prototype.defaults={vertical:!0,markers:{visible:!0,background:U,size:8,type:u,border:{width:2},opacity:1},labels:{visible:!1,position:Fo,margin:yt(3),padding:yt(4),animation:{type:To,delay:Co}},notes:{label:{}},highlight:{markers:{border:{color:"#fff",width:2}},zIndex:100},errorBars:{line:{width:1}},accessibility:{tabIndex:0,role:Jn,className:tr,ariaRoleDescription:er}},ut(Hr.prototype,zr),ut(Hr.prototype,Fr);class Nr extends yi{constructor(t,e,i){super(),this.linePoints=t,this.series=e,this.seriesIx=i}points(){return this.toGeometryPoints(this.linePoints)}toGeometryPoints(t){const e=[];for(let i=0,s=t.length;i<s;i++)t[i]&&!1!==t[i].visible&&e.push(t[i]._childBox.toRect().center());return e}createVisual(){const t=this.series.visual;t?(this.visual=t({points:this.toGeometryPoints(this.linePoints),series:this.series,sender:this.getSender(),createVisual:()=>(this.segmentVisual(),this.visual)}),this.visual&&!Ft(this.visual.options.zIndex)&&(this.visual.options.zIndex=this.series.zIndex)):this.segmentVisual()}segmentVisual(){const{options:t,series:i}=this;let{color:s,_defaults:o}=i;ht(s)&&o&&(s=o.color);const n=e.b.fromPoints(this.points(),{stroke:{color:s,width:i.width,opacity:i.opacity,dashType:i.dashType},zIndex:i.zIndex});t.closed&&n.close(),this.visual=n}aliasFor(t,e){return this.parent.getNearestPoint(e.x,e.y,this.seriesIx)}}te(Nr,{closed:!1});const jr={calculateStepPoints:function(t){const i=this.parent.plotArea.seriesCategoryAxis(this.series),{justified:s,vertical:o,reverse:n}=i.options,r=o?W:X,a=o?X:W,l=n?2:1,h=l;let c=Ur(t[0],r,l,a,h);const d=[c];for(let i=1;i<t.length;i++){const s=Ur(t[i],r,l,a,h);if(c[r]!==s[r]){const t=new e.P;t[r]=c[r],t[a]=s[a],d.push(t,s)}c=s}return s?c!==Xt(d)&&d.push(c):d.push(Ur(Xt(t),r,l,a,n?1:2)),d}};function Ur(t,i,s,o,n){const r=t.box,a=new e.P;return a[i]=r[i+s],a[o]=r[o+n],a}class Gr extends Nr{points(){return this.calculateStepPoints(this.linePoints)}}ut(Gr.prototype,jr);class Wr extends Nr{segmentVisual(){const t=this.series,i=t._defaults;let s=t.color;ht(s)&&i&&(s=i.color);const o=new co(this.options.closed).process(this.points()),n=new e.b({stroke:{color:s,width:t.width,opacity:t.opacity,dashType:t.dashType},zIndex:t.zIndex});n.segments.push.apply(n.segments,o),this.visual=n}}const Xr={renderSegments:function(){const{options:t,seriesPoints:e}=this,i=t.series,s=e.length;let o;this._segments=[];for(let t=0;t<s;t++){const s=i[t],n=this.sortPoints(e[t]),r=n.length;let a=[];for(let e=0;e<r;e++){const i=n[e];i?a.push(i):this.seriesMissingValues(s)!==Do&&(a.length>1&&(o=this.createSegment(a,s,t,o),this._addSegment(o)),a=[])}a.length>1&&(o=this.createSegment(a,s,t,o),this._addSegment(o))}this.children.unshift.apply(this.children,this._segments)},_addSegment:function(t){this._segments.push(t),t.parent=this},sortPoints:function(t){return t},seriesMissingValues:function(t){const e=t.missingValues;return!e&&this.options.isStacked?Vo:e||Do},getNearestPoint:function(t,e,i){const s=new di(t,e),o=this.seriesPoints[i];let n,r=C;for(let t=0;t<o.length;t++){const e=o[t];if(e&&Ft(e.value)&&null!==e.value&&!1!==e.visible){const t=e.box.center().distanceTo(s);t<r&&(n=e,r=t)}}return n}};class Yr extends e.c{setup(){this._setEnd(this.options.box.x1)}step(t){const e=this.options.box;this._setEnd(Et(e.x1,e.x2,t))}_setEnd(t){const e=this.element,i=e.segments,s=i[1].anchor(),o=i[2].anchor();e.suspend(),s.setX(t),e.resume(),o.setX(t)}}te(Yr,{duration:Co}),e.j.current.register("clip",Yr);const qr={createAnimation:function(){const t=this.getRoot();if(t&&!1!==(t.options||{}).transitions){const i=t.size(),s=e.b.fromRect(i.toRect());this.visual.clip(s),this.animation=new Yr(s,{box:i}),yr(this.options.series)&&this._setChildrenAnimation(s)}},_setChildrenAnimation:function(t){const e=this.animationPoints();for(let i=0;i<e.length;i++){const s=e[i];s&&s.visual&&Ft(s.visual.options.zIndex)&&s.visual.clip(t)}}};class Zr extends Dr{render(){super.render(),this.updateStackRange(),this.renderSegments()}pointType(){return Hr}createPoint(t,e){const{series:i,seriesIx:s}=e,o=this.seriesMissingValues(i);let n=t.valueFields.value;if(!Ft(n)||null===n){if(o!==Vo)return null;n=0}let r=this.pointOptions(i,s);r=this.evalPointOptions(r,n,e);let a=t.fields.color||i.color;ht(i.color)&&(a=r.color);const l=new Hr(n,r);return l.color=a,this.append(l),l}plotRange(t){let e=this.plotValue(t);if(this.options.isStacked){const i=t.categoryIx,s=this.categoryPoints[i];for(let i=0;i<s.length;i++){const o=s[i];if(t===o)break;e+=this.plotValue(o),this.options.isStacked100&&(e=Math.min(e,1))}}return[e,e]}createSegment(t,e,i){const s=e.style;let o;return o=s===jo?Gr:s===No?Wr:Nr,new o(t,e,i)}animationPoints(){const t=this.points,e=[];for(let i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e.concat(this._segments)}supportsPointInactiveOpacity(){return!1}}ut(Zr.prototype,Xr,qr);class $r extends Nr{constructor(t,e,i,s,o){super(t,e,i),this.prevSegment=s,this.stackPoints=o}createVisual(){const t=this.series,i=t._defaults,s=t.line||{};let o=t.color;ht(o)&&i&&(o=i.color),this.visual=new e.G({zIndex:t.zIndex}),this.createFill({fill:Si(t.pattern,{color:o,opacity:t.opacity}),stroke:null}),s.width>0&&!1!==s.visible&&this.createStroke({stroke:ut({color:o,opacity:t.opacity,lineCap:"butt"},s)})}strokeSegments(){let t=this._strokeSegments;return t||(t=this._strokeSegments=this.createStrokeSegments()),t}createStrokeSegments(){return this.segmentsFromPoints(this.points())}stackSegments(){return this.prevSegment?this.prevSegment.createStackSegments(this.stackPoints):this.createStackSegments(this.stackPoints)}createStackSegments(t){return this.segmentsFromPoints(this.toGeometryPoints(t)).reverse()}segmentsFromPoints(t){return t.map((t=>new e.S(t)))}createStroke(t){const i=new e.b(t);i.segments.push.apply(i.segments,this.strokeSegments()),this.visual.append(i)}hasStackSegment(){return this.prevSegment||this.stackPoints&&this.stackPoints.length}createFill(t){const i=this.strokeSegments(),s=i.slice(0),o=this.hasStackSegment();if(o){const t=this.stackSegments();Dt(s,t)}const n=new e.b(t);n.segments.push.apply(n.segments,s),!o&&i.length>1&&this.fillToAxes(n),this.visual.append(n)}fillToAxes(t){const e=this.parent,i=e.options.invertAxes,s=e.seriesValueAxis(this.series),o=e.categoryAxisCrossingValue(s),n=s.getSlot(o,o,!0),r=this.strokeSegments(),a=r[0].anchor(),l=Xt(r).anchor();let h=i?n.x1:n.y1;i?t.lineTo(h,l.y).lineTo(h,a.y):t.lineTo(l.x,h).lineTo(a.x,h)}}class Qr extends $r{createStrokeSegments(){return this.segmentsFromPoints(this.calculateStepPoints(this.linePoints))}createStackSegments(t){return this.segmentsFromPoints(this.calculateStepPoints(t)).reverse()}}ut(Qr.prototype,jr);class Kr extends $r{createStrokeSegments(){const t=new co(this.options.closed),e=this.points();return t.process(e)}createStackSegments(){const t=this.strokeSegments(),i=[];for(let s=t.length-1;s>=0;s--){const o=t[s];i.push(new e.S(o.anchor(),o.controlOut(),o.controlIn()))}return i}}class Jr extends Zr{createSegment(t,e,i,s){const o=this.options.isStacked,n=(e.line||{}).style;let r,a,l;if(o&&i>0&&s){"gap"!==this.seriesMissingValues(e)?(a=s.linePoints,r=s):a=this._gapStackPoints(t,i,n)}return l=n===jo?Qr:n===No?Kr:$r,new l(t,e,i,r,a)}reflow(t){super.reflow(t);const e=this._stackPoints;if(e)for(let t=0;t<e.length;t++){const i=e[t],s=this.categoryAxis.getSlot(i.categoryIx);i.reflow(s)}}_gapStackPoints(t,e,i){const s=this.seriesPoints;let o=t[0].categoryIx,n=t.length;o<0&&(o=0,n--);const r=o+n,a=this.seriesOptions[0]._outOfRangeMinPoint?1:0,l=[];this._stackPoints=this._stackPoints||[];for(let t=o;t<r;t++){const n=t+a;let h,c=e;do{c--,h=s[c][n]}while(c>0&&!h);if(h)i!==jo&&t>o&&!s[c][n-1]&&l.push(this._previousSegmentPoint(t,n,n-1,c)),l.push(h),i!==jo&&t+1<r&&!s[c][n+1]&&l.push(this._previousSegmentPoint(t,n,n+1,c));else{const e=this._createGapStackPoint(t);this._stackPoints.push(e),l.push(e)}}return l}_previousSegmentPoint(t,e,i,s){const o=this.seriesPoints;let n,r=s;for(;r>0&&!n;)r--,n=o[r][i];return n?n=o[r][e]:(n=this._createGapStackPoint(t),this._stackPoints.push(n)),n}_createGapStackPoint(t){const e=this.pointOptions({},0),i=new Hr(0,e);return i.categoryIx=t,i.series={},i}seriesMissingValues(t){return t.missingValues||Vo}supportsPointInactiveOpacity(){return!1}}class ta extends e.a{constructor(){super(),this.axisRanges={}}update(t){const e=this.axisRanges;for(let i in t){const s=t[i];let o=e[i];e[i]=o=o||{min:C,max:T},o.min=Math.min(o.min,s.min),o.max=Math.max(o.max,s.max)}}reset(t){this.axisRanges[t]=void 0}query(t){return this.axisRanges[t]}}class ea extends yi{constructor(t,e,i){super(e),this.textBox=new zi(t,this.options,i),this.append(this.textBox)}createVisual(){this.textBox.options.noclip=this.options.noclip}reflow(t){const e=this.options,{vertical:i,aboveAxis:s}=e,o=this.children[0],n=o.options,r=o.box,a=o.options.padding;let l=t;if(n.align=i?d:S,n.vAlign=i?z:d,e.position===ar)i?(n.vAlign=z,!s&&r.height()<t.height()&&(n.vAlign=c)):n.align=s?B:S;else if(e.position===d)n.vAlign=d,n.align=d;else if(e.position===lr)i?n.vAlign=s?c:z:n.align=s?S:B;else if(e.position===hr)if(i)if(s){const e=(r.width()-t.width()-a.left-a.right)/2;l=new ui(t.x1-e,t.y1-r.height(),t.x2+e,t.y1)}else l=new ui(t.x1,t.y2,t.x2,t.y2+r.height());else n.align=d,l=s?new ui(t.x2,t.y1,t.x2+r.width(),t.y2):new ui(t.x1-r.width(),t.y1,t.x1,t.y2);e.rotation||(i?a.left=a.right=(l.width()-o.contentBox.width())/2:a.top=a.bottom=(l.height()-o.contentBox.height())/2),o.reflow(l)}alignToClipBox(t){const e=this.options.vertical?X:W,i=e+"1",s=e+"2",o=this.children[0],n=this.parent.box;if(n[i]<t[i]||t[s]<n[s]){const e=o.paddingBox.clone();e[i]=Math.max(n[i],t[i]),e[s]=Math.min(n[s],t[s]),this.reflow(e)}}}te(ea,{position:hr,margin:yt(3),padding:yt(4),color:h,background:"",border:{width:1,color:""},aboveAxis:!0,vertical:!1,animation:{type:To,delay:Co},zIndex:2});const ia={addAccessibilityAttributesToVisual:function(){this._id=this._id||Te();const t=ut({ariaLabel:this.getAriaLabelText()},this.options.accessibility);Ti(this.visual,t)},getAriaLabelText(){const t=this.options.labels,e=_t(t);return e?e(this.pointData()):this.getLabelText(t)},focusVisual(){this.visual.options.set("id",this._id),this.toggleFocusHighlight(!0)},clearFocusFromVisual(){this.visual.options.set("id",""),this.toggleFocusHighlight(!1)}};class sa extends yi{constructor(t,e){super(),this.options=e,this.color=e.color||U,this.aboveAxis=Kt(this.options.aboveAxis,!0),this.value=t}render(){this._rendered||(this._rendered=!0,this.createLabel(),this.createNote(),this.errorBar&&this.append(this.errorBar))}createLabel(){const t=this.options.labels;t.visible&&(this.label=this.createLabelElement(t),this.append(this.label))}createLabelElement(t){return new ea(this.getLabelText(t),ut({vertical:this.options.vertical},t),this.pointData())}getLabelText(t){let e=wt(t);return e?e(this.pointData()):this.formatValue(t.format)}formatValue(t){return this.owner.formatPointValue(this,t)}reflow(t){this.render();const e=this.label;if(this.box=t,e&&(e.options.aboveAxis=this.aboveAxis,e.reflow(t)),this.note&&this.note.reflow(t),this.errorBars)for(let e=0;e<this.errorBars.length;e++)this.errorBars[e].reflow(t)}createVisual(){const{box:t,options:i}=this,s=i.visual;if(!1!==this.visible)if(super.createVisual(),this.addAccessibilityAttributesToVisual(),s){const o=this.rectVisual=s({category:this.category,dataItem:this.dataItem,value:this.value,sender:this.getSender(),series:this.series,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,rect:t.toRect(),createVisual:()=>{const t=new e.G;return this.createRect(t),t},options:i});o&&this.visual.append(o)}else t.width()>0&&t.height()>0&&this.createRect(this.visual)}createRect(t){const i=this.options,s=i.border,o=Ft(s.opacity)?s.opacity:i.opacity,n=this.box.toRect();n.size.width=Math.round(n.size.width);const r=this.rectVisual=e.b.fromRect(n,{fill:Si(i.pattern,{color:this.color,opacity:i.opacity}),stroke:{color:this.getBorderColor(),width:s.width,opacity:o,dashType:s.dashType}}),a=this.box.width(),l=this.box.height();if((i.vertical?a:l)>6&&(et(r),(a<1||l<1)&&(r.options.stroke.lineJoin="round")),t.append(r),Mr(i)){const e=this.createGradientOverlay(r,{baseColor:this.color},ut({end:i.vertical?void 0:[0,1]},i.overlay));t.append(e)}}createHighlight(t){return et(e.b.fromRect(this.box.toRect(),t))}highlightVisual(){return this.rectVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}}createFocusHighlight(t){const i=this.options.focusHighlight.border.width;return et(e.b.fromRect(this.box.pad(i/2).toRect(),t))}getBorderColor(){const t=this.color,i=this.options.border,s=i._brightness||Po;let o=i.color;return Ft(o)||(o=new e.C(t).brightness(s).toHex()),o}tooltipAnchor(){const{options:t,box:e,aboveAxis:i}=this,s=this.owner.pane.clipBox()||e;let o,n,r=S,a=z;if(t.vertical)o=Math.min(e.x2,s.x2)+5,i?n=Math.max(e.y1,s.y1):(n=Math.min(e.y2,s.y2),a=c);else{const l=Math.max(e.x1,s.x1),h=Math.min(e.x2,s.x2);t.isStacked?(a=c,i?(r=B,o=h):o=l,n=Math.max(e.y1,s.y1)-5):(i?o=h+5:(o=l-5,r=B),n=Math.max(e.y1,s.y1))}return{point:new di(o,n),align:{horizontal:r,vertical:a}}}overlapsBox(t){return this.box.overlaps(t)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,percentage:this.percentage,stackValue:this.stackValue,runningTotal:this.runningTotal,total:this.total,series:this.series}}getIndex(){return this.categoryIx}}function oa(t,e){t.forEach(e)}function na(t,e){const i=t.length;for(let s=i-1;s>=0;s--)e(t[s],s-i-1)}ut(sa.prototype,zr),ut(sa.prototype,Fr),ut(sa.prototype,ia),sa.prototype.defaults={border:{width:1},vertical:!0,overlay:{gradient:"glass"},labels:{visible:!1,format:"{0}"},opacity:1,notes:{label:{}},accessibility:{role:Jn,className:tr,ariaRoleDescription:er}};class ra extends yi{constructor(t){super(t),this.forEach=t.rtl?na:oa}reflow(t){const{vertical:e,gap:i,spacing:s}=this.options,o=this.children,n=o.length,r=e?X:W,a=n+i+s*(n-1),l=(e?t.height():t.width())/a;let h=t[r+1]+l*(i/2);this.forEach(o,((e,i)=>{const o=(e.box||t).clone();o[r+1]=h,o[r+2]=h+l,e.reflow(o),i<n-1&&(h+=l*s),h+=l}))}}te(ra,{vertical:!1,gap:0,spacing:0});class aa extends yi{reflow(t){const e=this.options.vertical?W:X,i=this.children,s=i.length;let o=this.box=new ui;for(let n=0;n<s;n++){const s=i[n];if(!1!==s.visible){const i=s.box.clone();i.snapTo(t,e),0===n&&(o=this.box=i.clone()),s.reflow(i),o.wrap(i)}}}}te(aa,{vertical:!0});class la extends Dr{render(){super.render(),this.updateStackRange()}pointType(){return sa}clusterType(){return ra}stackType(){return aa}stackLimits(t,e){return super.stackLimits(t,e)}createPoint(t,e){const{categoryIx:i,series:s,seriesIx:o}=e,{options:n,children:r}=this,a=Ft(s.stack)?s.stack:n.defaultStack,l=this.pointValue(t);let h=this.pointOptions(s,o);const c=h.labels;a&&c.position===hr&&(c.position=ar),h.isStacked=a;let d=t.fields.color||s.color;l<0&&h.negativeColor&&(d=h.negativeColor),h=this.evalPointOptions(h,l,e),ht(s.color)&&(d=h.color);const u=new(this.pointType())(l,h);u.color=d;let p=r[i];if(!p){p=new(this.clusterType())({vertical:n.invertAxes,gap:n.gap,spacing:n.spacing,rtl:!n.invertAxes&&(this.chartService||{}).rtl}),this.append(p)}if(n.isStacked){this.getStackWrap(a,p).append(u)}else p.append(u);return u}getStackWrap(t,e){const i=typeof t===I?t.group||!0:t,s=e.children;let o;if(typeof i===D||!0===i)for(let t=0;t<s.length;t++)if(s[t]._stackGroup===i){o=s[t];break}if(!o){o=new(this.stackType())({vertical:!this.options.invertAxes}),o._stackGroup=i,e.append(o)}return o}categorySlot(t,e,i){const s=this.options,o=t.getSlot(e),n=i.startValue();if(s.isStacked){const t=i.getSlot(n,n,!0),e=s.invertAxes?W:X;o[e+1]=o[e+2]=t[e+1]}return o}reflowCategories(t){const e=this.children,i=e.length;for(let s=0;s<i;s++)e[s].reflow(t[s])}createAnimation(){this._setAnimationOptions(),super.createAnimation(),yr(this.options.series)&&this._setChildrenAnimation()}_setChildrenAnimation(){const t=this.points;for(let e=0;e<t.length;e++){const i=t[e],s=i.visual;s&&Ft(s.options.zIndex)&&(i.options.animation=this.options.animation,i.createAnimation())}}_setAnimationOptions(){const t=this.options,i=t.animation||{};let s;if(t.isStacked){const e=this.seriesValueAxis(t.series[0]);s=e.getSlot(e.startValue())}else s=this.categoryAxis.getSlot(0);i.origin=new e.P(s.x1,s.y1),i.vertical=!t.invertAxes}}te(la,{animation:{type:Go}});class ha extends yi{constructor(t,e){super(e),this.value=t}getLabelText(t){return this.formatValue(t.format)}reflow(t){const{options:e,value:i,owner:s}=this,o=s.seriesValueAxis(e),n=o.getSlot(i.open,i.close),r=o.getSlot(i.low,i.high);n.x1=r.x1=t.x1,n.x2=r.x2=t.x2,this.realBody=n;const a=r.center().x,l=[];l.push([[a,r.y1],[a,n.y1]]),l.push([[a,n.y2],[a,r.y2]]),this.lines=l,this.box=r.clone().wrap(n),this._rendered||(this._rendered=!0,this.createNote()),this.reflowNote()}reflowNote(){this.note&&this.note.reflow(this.box)}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual(),this._mainVisual=this.mainVisual(this.options),this.visual.append(this._mainVisual),this.createOverlay()}mainVisual(t){const i=new e.G;return this.createBody(i,t),this.createLines(i,t),i}createBody(t,i){const s=e.b.fromRect(this.realBody.toRect(),{fill:Si(i.pattern,{color:this.color,opacity:i.opacity}),stroke:null});i.border.width>0&&s.options.set("stroke",{color:this.getBorderColor(),width:i.border.width,dashType:i.border.dashType,opacity:Kt(i.border.opacity,i.opacity)}),et(s),t.append(s),Mr(i)&&t.append(this.createGradientOverlay(s,{baseColor:this.color},ut({end:i.vertical?void 0:[0,1]},i.overlay)))}createLines(t,e){this.drawLines(t,e,this.lines,e.line)}drawLines(t,i,s,o){if(!s)return;const n={stroke:{color:o.color||this.color,opacity:Kt(o.opacity,i.opacity),width:o.width,dashType:o.dashType,lineCap:"butt"}};for(let i=0;i<s.length;i++){const o=e.b.fromPoints(s[i],n);et(o),t.append(o)}}getBorderColor(){const t=this.options.border;let i=t.color;return Ft(i)||(i=new e.C(this.color).brightness(t._brightness).toHex()),i}createOverlay(){const t=e.b.fromRect(this.box.toRect(),{fill:{color:U,opacity:0},stroke:null});this.visual.append(t)}createHighlight(){const t=this.options.highlight,e=this.color;this.color=t.color||this.color;const i=this.mainVisual(ut({},this.options,{line:{color:this.getBorderColor()}},t));return this.color=e,i}highlightVisual(){return this._mainVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this._mainVisual}}tooltipAnchor(){const t=this.box,e=this.owner.pane.clipBox()||t;return{point:new di(t.x2+5,Math.max(t.y1,e.y1)+5),align:{horizontal:S,vertical:z}}}formatValue(t){return this.owner.formatPointValue(this,t)}overlapsBox(t){return this.box.overlaps(t)}pointData(){return{dataItem:this.dataItem,value:this.value,meanPoints:this.meanPoints,medianPoints:this.medianPoints,whiskerPoints:this.whiskerPoints,stackValue:this.stackValue,series:this.series}}getIndex(){return this.categoryIx}}ha.prototype.createFocusHighlight=sa.prototype.createFocusHighlight,te(ha,{vertical:!0,border:{_brightness:.8},line:{width:2},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{4:d}</th></tr><tr><td>Open:</td><td>{0:C}</td></tr><tr><td>High:</td><td>{1:C}</td></tr><tr><td>Low:</td><td>{2:C}</td></tr><tr><td>Close:</td><td>{3:C}</td></tr></table>"},labels:{format:""},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},accessibility:{role:Jn,className:tr,ariaRoleDescription:er}}),ut(ha.prototype,zr),ut(ha.prototype,Fr),ut(ha.prototype,ia);class ca extends Dr{reflowCategories(t){const e=this.children,i=e.length;for(let s=0;s<i;s++)e[s].reflow(t[s])}addValue(t,e){const{categoryIx:i,category:s,series:o,seriesIx:n}=e,{children:r,options:a}=this,l=t.valueFields,h=br(this.splitValue(l)),c=o.data[i];let d,u=this.categoryPoints[i];u||(this.categoryPoints[i]=u=[]),h&&(d=this.createPoint(t,e));let p=r[i];p||(p=new ra({vertical:a.invertAxes,gap:a.gap,spacing:a.spacing,rtl:!a.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),d&&(this.updateRange(l,e),p.append(d),d.categoryIx=i,d.category=s,d.series=o,d.seriesIx=n,d.owner=this,d.dataItem=c,d.noteText=t.fields.noteText),this.points.push(d),u.push(d)}pointType(){return ha}createPoint(t,e){const{series:i}=e,s=this.pointType(),o=t.valueFields;let n=ut({},i),r=t.fields.color||i.color;n=this.evalPointOptions(n,o,e),i.type!==qo&&i.type!==sn||o.open>o.close&&(r=t.fields.downColor||i.downColor||i.color),ht(i.color)&&(r=n.color),n.vertical=!this.options.invertAxes;const a=new s(o,n);return a.color=r,a}splitValue(t){return[t.low,t.open,t.close,t.high]}updateRange(t,e){const i=e.series.axis,s=this.splitValue(t);let o=this.valueAxisRanges[i]||{min:C,max:T};this.valueAxisRanges[i]={min:Math.min.apply(Math,s.concat([o.min])),max:Math.max.apply(Math,s.concat([o.max]))}}formatPointValue(t,e){const i=t.value;return this.chartService.format.auto(e,i.open,i.high,i.low,i.close,t.category)}animationPoints(){return this.points}}ut(ca.prototype,qr);class da extends ha{constructor(t,e){super(t,e),this.createNote()}reflow(t){const{options:e,value:i,owner:s}=this,o=s.seriesValueAxis(e);let n,r;this.boxSlot=r=o.getSlot(i.q1,i.q3),this.realBody=r,this.reflowBoxSlot(t),this.whiskerSlot=n=o.getSlot(i.lower,i.upper),this.reflowWhiskerSlot(t);const a=o.getSlot(i.median);if(i.mean){const e=o.getSlot(i.mean);this.meanPoints=this.calcMeanPoints(t,e)}this.whiskerPoints=this.calcWhiskerPoints(r,n),this.medianPoints=this.calcMedianPoints(t,a),this.box=n.clone().wrap(r),this.reflowNote()}reflowBoxSlot(t){this.boxSlot.x1=t.x1,this.boxSlot.x2=t.x2}reflowWhiskerSlot(t){this.whiskerSlot.x1=t.x1,this.whiskerSlot.x2=t.x2}calcMeanPoints(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]}calcWhiskerPoints(t,e){const i=e.center().x;return[[[i-5,e.y1],[i+5,e.y1],[i,e.y1],[i,t.y1]],[[i-5,e.y2],[i+5,e.y2],[i,e.y2],[i,t.y2]]]}calcMedianPoints(t,e){return[[[t.x1,e.y1],[t.x2,e.y1]]]}renderOutliers(t){const i=this.value,s=i.outliers||[],o=3*Math.abs(i.q3-i.q1),n=[];let r=t.markers||{};for(let a=0;a<s.length;a++){const l=s[a];r=l<i.q3+o&&l>i.q1-o?t.outliers:t.extremes;let h=ut({},r.border);Ft(h.color)||(Ft(this.color)?h.color=this.color:h.color=new e.C(r.background).brightness(Po).toHex());const c=new Pi({type:r.type,width:r.size,height:r.size,rotation:r.rotation,background:r.background,border:h,opacity:r.opacity});c.value=l,n.push(c)}return this.reflowOutliers(n),n}reflowOutliers(t){const e=this.owner.seriesValueAxis(this.options),i=this.box.center();for(let s=0;s<t.length;s++){const o=t[s].value,n=e.getSlot(o);this.options.vertical?n.move(i.x):n.move(void 0,i.y),this.box=this.box.wrap(n),t[s].reflow(n)}}mainVisual(t){const e=super.mainVisual(t),i=this.renderOutliers(t);for(let t=0;t<i.length;t++){const s=i[t].getElement();s&&e.append(s)}return e}createLines(t,e){this.drawLines(t,e,this.whiskerPoints,e.whiskers),this.drawLines(t,e,this.medianPoints,e.median),this.drawLines(t,e,this.meanPoints,e.mean)}getBorderColor(){return(this.options.border||{}).color?this.options.border.color:this.color?this.color:super.getBorderColor()}}te(da,{border:{_brightness:.8},line:{width:2},median:{color:"#f6f6f6"},mean:{width:2,dashType:"dash",color:"#f6f6f6"},overlay:{gradient:"glass"},tooltip:{format:"<table><tr><th colspan='2'>{6:d}</th></tr><tr><td>Lower:</td><td>{0:C}</td></tr><tr><td>Q1:</td><td>{1:C}</td></tr><tr><td>Median:</td><td>{2:C}</td></tr><tr><td>Mean:</td><td>{5:C}</td></tr><tr><td>Q3:</td><td>{3:C}</td></tr><tr><td>Upper:</td><td>{4:C}</td></tr></table>"},highlight:{opacity:1,border:{width:1,opacity:1},line:{width:1,opacity:1}},notes:{visible:!0,label:{}},outliers:{visible:!0,size:8,type:p,background:U,border:{width:2,opacity:1},opacity:0},extremes:{visible:!0,size:8,type:u,background:U,border:{width:2,opacity:1},opacity:0}}),ut(da.prototype,zr);class ua extends da{reflowBoxSlot(t){this.boxSlot.y1=t.y1,this.boxSlot.y2=t.y2}reflowWhiskerSlot(t){this.whiskerSlot.y1=t.y1,this.whiskerSlot.y2=t.y2}calcMeanPoints(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]}calcWhiskerPoints(t,e){const i=e.center().y;return[[[e.x1,i-5],[e.x1,i+5],[e.x1,i],[t.x1,i]],[[e.x2,i-5],[e.x2,i+5],[e.x2,i],[t.x2,i]]]}calcMedianPoints(t,e){return[[[e.x1,t.y1],[e.x1,t.y2]]]}}class pa extends ca{addValue(t,e){const{categoryIx:i,category:s,series:o,seriesIx:n}=e,{children:r,options:a}=this,l=t.valueFields,h=br(this.splitValue(l)),c=o.data[i];let d,u=this.categoryPoints[i];u||(this.categoryPoints[i]=u=[]),h&&(d=this.createPoint(t,e));let p=r[i];p||(p=new ra({vertical:a.invertAxes,gap:a.gap,spacing:a.spacing,rtl:!a.invertAxes&&(this.chartService||{}).rtl}),this.append(p)),d&&(this.updateRange(l,e),p.append(d),d.categoryIx=i,d.category=s,d.series=o,d.seriesIx=n,d.owner=this,d.dataItem=c),this.points.push(d),u.push(d)}pointType(){return this.options.invertAxes?ua:da}splitValue(t){return[t.lower,t.q1,t.median,t.q3,t.upper]}updateRange(t,e){const i=e.series.axis;let s=this.splitValue(t).concat(this.filterOutliers(t.outliers));Ft(t.mean)&&(s=s.concat(t.mean));let o=this.valueAxisRanges[i]||{min:C,max:T};this.valueAxisRanges[i]={min:Math.min.apply(Math,s.concat([o.min])),max:Math.max.apply(Math,s.concat([o.max]))}}formatPointValue(t,e){const i=t.value;return this.chartService.format.auto(e,i.lower,i.q1,i.median,i.q3,i.upper,i.mean,t.category)}filterOutliers(t){const e=(t||[]).length,i=[];for(let s=0;s<e;s++){const e=t[s];Ft(e)&&null!==e&&i.push(e)}return i}supportsPointInactiveOpacity(){return!1}}class ga extends fr{getAxis(){const t=this.chart.seriesAxes(this.series);return this.isVertical?t.y:t.x}}class ma extends yi{constructor(t,e){super(e),this.plotArea=t,this.chartService=t.chartService,this._initFields(),this.render()}_initFields(){this.xAxisRanges={},this.yAxisRanges={},this.points=[],this.seriesPoints=[],this.seriesOptions=[],this._evalSeries=[]}render(){this.traverseDataPoints(this.addValue.bind(this))}addErrorBar(t,e,i){const s=t.value[e],o=e+"Value",n=e+"ErrorLow",r=e+"ErrorHigh",{seriesIx:a,series:l}=i,h=t.options.errorBars,c=i[n],d=i[r];if(st(s)){let i;st(c)&&st(d)&&(i={low:c,high:d}),h&&Ft(h[o])&&(this.seriesErrorRanges=this.seriesErrorRanges||{x:[],y:[]},this.seriesErrorRanges[e][a]=this.seriesErrorRanges[e][a]||new Ao(h[o],l,e),i=this.seriesErrorRanges[e][a].getErrorRange(s,h[o])),i&&this.addPointErrorBar(i,t,e)}}addPointErrorBar(t,e,i){const{low:s,high:o}=t,{series:n,options:{errorBars:r}}=e,a=i===X,l={};e[i+"Low"]=s,e[i+"High"]=o,e.errorBars=e.errorBars||[];const h=new ga(s,o,a,this,n,r);e.errorBars.push(h),e.append(h),l[i]=s,this.updateRange(l,n),l[i]=o,this.updateRange(l,n)}addValue(t,e){const{x:i,y:s}=t,o=e.seriesIx,n=this.options.series[o],r=this.seriesMissingValues(n),a=this.seriesPoints[o];let l,h=t;Er(i)&&Er(s)||(h=this.createMissingValue(h,r)),h&&(l=this.createPoint(h,e),l&&(Object.assign(l,e),this.addErrorBar(l,W,e),this.addErrorBar(l,X,e)),this.updateRange(h,e.series)),this.points.push(l),a.push(l)}seriesMissingValues(t){return t.missingValues}createMissingValue(){}updateRange(t,e){const i=this.chartService.intl,{xAxis:s,yAxis:o}=e;let{x:n,y:r}=t,a=this.xAxisRanges[s],l=this.yAxisRanges[o];Er(n)&&(a=this.xAxisRanges[s]=a||{min:C,max:T},ot(n)&&(n=Is(i,n)),a.min=Math.min(a.min,n),a.max=Math.max(a.max,n)),Er(r)&&(l=this.yAxisRanges[o]=l||{min:C,max:T},ot(r)&&(r=Is(i,r)),l.min=Math.min(l.min,r),l.max=Math.max(l.max,r))}evalPointOptions(t,e,i){const{series:s,seriesIx:o}=i,n={defaults:s._defaults,excluded:["data","tooltip","content","template","visual","toggle","_outOfRangeMinPoint","_outOfRangeMaxPoint","drilldownSeriesFactory","ariaTemplate","ariaContent"]};let r=this._evalSeries[o];Ft(r)||(this._evalSeries[o]=r=Sr(t,{},n,!0));let a=t;return r&&(a=ut({},t),Sr(a,{value:e,series:s,dataItem:i.dataItem},n)),a}pointType(){return Hr}pointOptions(t,e){let i=this.seriesOptions[e];if(!i){const s=this.pointType().prototype.defaults;this.seriesOptions[e]=i=ut({},s,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return i}createPoint(t,e){const i=e.series;let s=this.pointOptions(i,e.seriesIx),o=e.color||i.color;s=this.evalPointOptions(s,t,e),ht(i.color)&&(o=s.color);const n=new Hr(t,s);return n.color=o,this.append(n),n}seriesAxes(t){const{xAxis:e,yAxis:i}=t,s=this.plotArea,o=e?s.namedXAxes[e]:s.axisX,n=i?s.namedYAxes[i]:s.axisY;if(!o)throw new Error("Unable to locate X axis with name "+e);if(!n)throw new Error("Unable to locate Y axis with name "+i);return{x:o,y:n}}reflow(t){const e=this.points,i=!this.options.clip;let s=0;this.traverseDataPoints(((t,o)=>{const n=e[s++],r=this.seriesAxes(o.series),a=r.x.getSlot(t.x,t.x,i),l=r.y.getSlot(t.y,t.y,i);if(n)if(a&&l){const t=this.pointSlot(a,l);n.reflow(t)}else n.visible=!1})),this.box=t}pointSlot(t,e){return new ui(t.x1,e.y1,t.x2,e.y2)}traverseDataPoints(t){const{options:{series:e},seriesPoints:i}=this;for(let s=0;s<e.length;s++){const o=e[s];i[s]||(i[s]=[]);for(let e=0;e<o.data.length;e++){const{valueFields:i,fields:n}=this.plotArea.bindPoint(o,e);t(i,ut({pointIx:e,series:o,seriesIx:s,dataItem:o.data[e],owner:this},n))}}}formatPointValue(t,e){const i=t.value;return this.chartService.format.auto(e,i.x,i.y)}animationPoints(){const t=this.points,e=[];for(let i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e}}te(ma,{series:[],tooltip:{format:"{0}, {1}"},labels:{format:"{0}, {1}"},clip:!0}),ut(ma.prototype,qr);class fa extends Hr{constructor(t,e){super(t,e),this.category=t.category}createHighlight(){const t=this.options.highlight,i=t.border,s=this.options.markers,o=this.box.center(),n=(s.size+s.border.width+i.width)/2,r=new e.G,a=new e.f(new e.g([o.x,o.y+n/5+i.width/2],n+i.width/2),{stroke:{color:"none"},fill:this.createGradient({gradient:"bubbleShadow",color:s.background,stops:[{offset:0,color:s.background,opacity:.3},{offset:1,color:s.background,opacity:0}]})}),l=new e.f(new e.g([o.x,o.y],n),{stroke:{color:i.color||new e.C(s.background).brightness(Po).toHex(),width:i.width,opacity:i.opacity},fill:Si(this.options.pattern,{color:s.background,opacity:t.opacity})});return r.append(a,l),r}createFocusHighlight(t){const i=this.options.focusHighlight,s=this.options.markers,o=this.box.center(),n=(s.size+s.border.width)/2+i.border.width/2;return new e.f(new e.g([o.x,o.y],n),t)}}fa.prototype.defaults=ut({},fa.prototype.defaults,{labels:{position:d},highlight:{opacity:1,border:{color:"#fff",width:2,opacity:1}}}),fa.prototype.defaults.highlight.zIndex=void 0;class xa extends ma{_initFields(){this._maxSize=T,super._initFields()}addValue(t,e){null!==t.size&&(t.size>0||t.size<0&&e.series.negativeValues.visible)?(this._maxSize=Math.max(this._maxSize,Math.abs(t.size)),super.addValue(t,e)):(this.points.push(null),this.seriesPoints[e.seriesIx].push(null))}reflow(t){this.updateBubblesSize(t),super.reflow(t)}pointType(){return fa}createPoint(t,e){const i=e.series,s=i.data.length,o=e.pointIx*(Co/s),n={delay:o,duration:Co-o,type:Xo};let r=e.color||i.color;t.size<0&&i.negativeValues.visible&&(r=Kt(i.negativeValues.color,r));let a=ut({labels:{animation:{delay:o,duration:Co-o}}},this.pointOptions(i,e.seriesIx),{markers:{type:u,border:i.border,opacity:i.opacity,animation:n}});a=this.evalPointOptions(a,t,e),ht(i.color)&&(r=a.color),a.markers.background=r;const l=new fa(t,a);return l.color=r,this.append(l),l}updateBubblesSize(t){const{options:{series:e}}=this,i=Math.min(t.width(),t.height());for(let t=0;t<e.length;t++){const s=e[t],o=this.seriesPoints[t],n=(s.minSize||Math.max(.02*i,10))/2,r=(s.maxSize||.2*i)/2,a=Math.PI*n*n,l=(Math.PI*r*r-a)/this._maxSize;for(let t=0;t<o.length;t++){const e=o[t];if(e){const t=Math.abs(e.value.size)*l,i=Math.sqrt((a+t)/Math.PI),s=Kt(e.options.zIndex,0)+(1-i/r);ut(e.options,{zIndex:s,markers:{size:2*i,zIndex:s},labels:{zIndex:s+1}})}}}}formatPointValue(t,e){const i=t.value;return this.chartService.format.auto(e,i.x,i.y,i.size,t.category)}createAnimation(){}createVisual(){}}te(xa,{tooltip:{format:"{3}"},labels:{format:"{3}"}});class ya extends Pi{}ut(ya.prototype,zr);class va extends yi{constructor(t,e){super(e),this.aboveAxis=this.options.aboveAxis,this.color=e.color||U,this.value=t}render(){const t=this.options;this._rendered||(this._rendered=!0,Ft(this.value.target)&&(this.target=new ya({type:t.target.shape,background:t.target.color||this.color,opacity:t.opacity,zIndex:t.zIndex,border:t.target.border,vAlign:z,align:B}),this.target.value=this.value,this.target.dataItem=this.dataItem,this.target.series=this.series,this.append(this.target)),this.createLabel(),this.createNote())}createLabel(){const t=this.options.labels;t.visible&&(this.label=this.createLabelElement(t),this.append(this.label))}createLabelElement(t){return new ea(this.getLabelText(t),t,this.pointData())}getLabelText(t){let e=wt(t);return e?e(this.pointData()):this.formatValue(t.format)}reflow(t){this.render();const{options:e,target:i,owner:s}=this,o=e.invertAxes,n=s.seriesValueAxis(this.options),r=s.categorySlot(s.categoryAxis,e.categoryIx,n),a=n.getSlot(this.value.target),l=o?a:r,h=o?r:a;if(i){const t=new ui(l.x1,h.y1,l.x2,h.y2);i.options.height=o?t.height():e.target.line.width,i.options.width=o?e.target.line.width:t.width(),i.reflow(t)}const c=this.label;c&&(c.options.aboveAxis=this.aboveAxis,c.reflow(t)),this.note&&this.note.reflow(t),this.box=t}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual();const t=this.options,i=e.b.fromRect(this.box.toRect(),{fill:Si(t.pattern,{color:this.color,opacity:t.opacity}),stroke:null});t.border.width>0&&i.options.set("stroke",{color:t.border.color||this.color,width:t.border.width,dashType:t.border.dashType,opacity:Kt(t.border.opacity,t.opacity)}),this.bodyVisual=i,et(i),this.visual.append(i)}createAnimation(){this.bodyVisual&&(this.animation=e.c.create(this.bodyVisual,this.options.animation))}createHighlight(t){return e.b.fromRect(this.box.toRect(),t)}highlightVisual(){return this.bodyVisual}highlightVisualArgs(){return{rect:this.box.toRect(),visual:this.bodyVisual,options:this.options}}formatValue(t){return this.owner.formatPointValue(this,t)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series}}overlapsBox(t){return this.box.overlaps(t)}getIndex(){return this.categoryIx}}va.prototype.tooltipAnchor=sa.prototype.tooltipAnchor,va.prototype.createFocusHighlight=sa.prototype.createFocusHighlight,te(va,{border:{width:1},vertical:!1,opacity:1,target:{shape:"",border:{width:0,color:"green"},line:{width:2}},labels:{visible:!1},tooltip:{format:"Current: {0}<br />Target: {1}"},notes:{label:{}},accessibility:{role:Jn,className:tr,ariaRoleDescription:er}}),ut(va.prototype,zr),ut(va.prototype,Fr),ut(va.prototype,ia);class ba extends Dr{constructor(t,e){!function(t){const e=t.series;for(let t=0;t<e.length;t++){const i=e[t],s=i.data;!s||Q(s[0])||pt(s[0])||(i.data=[s])}}(e),super(t,e)}reflowCategories(t){const e=this.children,i=e.length;for(let s=0;s<i;s++)e[s].reflow(t[s])}plotRange(t){const e=t.series,i=this.seriesValueAxis(e),s=this.categoryAxisCrossingValue(i);return[s,t.value.current||s]}createPoint(t,e){const{categoryIx:i,series:s}=e,{options:o,children:n}=this,r=t.valueFields;let a=ut({vertical:!o.invertAxes,overlay:s.overlay,categoryIx:i,invertAxes:o.invertAxes},s),l=t.fields.color||s.color;a=this.evalPointOptions(a,r,e),ht(s.color)&&(l=a.color);const h=new va(r,a);h.color=l;let c=n[i];return c||(c=new ra({vertical:o.invertAxes,gap:o.gap,spacing:o.spacing,rtl:!o.invertAxes&&(this.chartService||{}).rtl}),this.append(c)),c.append(h),h}updateRange(t,e){const{current:i,target:s}=t,o=e.series.axis;let n=this.valueAxisRanges[o];Ft(i)&&!isNaN(i)&&Ft(s&&!isNaN(s))&&(n=this.valueAxisRanges[o]=n||{min:C,max:T},n.min=Math.min(n.min,i,s),n.max=Math.max(n.max,i,s))}formatPointValue(t,e){return this.chartService.format.auto(e,t.value.current,t.value.target)}pointValue(t){return t.valueFields.current}aboveAxis(t){return t.value.current>0}createAnimation(){const t=this.points;this._setAnimationOptions();for(let e=0;e<t.length;e++){const i=t[e];i.options.animation=this.options.animation,i.createAnimation()}}}ba.prototype._setAnimationOptions=la.prototype._setAnimationOptions,te(ba,{animation:{type:Go}});class wa extends e.a{constructor(t,e){super(),this.chartService=t,this.options=ut({},this.options,e)}getStyle(t,e){let{background:i,border:{color:s}}=t;if(e){const t=e.color||e.options.color;i=Kt(i,t),s=Kt(s,t)}const o=void 0!==t.padding?yt(t.padding):{};return"object"==typeof t.padding&&(o.top=void 0!==t.padding.top?o.top:void 0,o.right=void 0!==t.padding.right?o.right:void 0,o.bottom=void 0!==t.padding.bottom?o.bottom:void 0,o.left=void 0!==t.padding.left?o.left:void 0),{backgroundColor:i,borderColor:s,font:t.font,color:t.color,opacity:t.opacity,borderWidth:gt(t.border.width),paddingTop:gt(o.top),paddingBottom:gt(o.bottom),paddingLeft:gt(o.left),paddingRight:gt(o.right)}}show(t,i,s){if(!this.chartService)return;t.format=i.format;const o=this.getStyle(i,s);t.style=o;const n=new e.C(o.backgroundColor);Ft(i.color)||n.isDark()||(t.className="k-chart-tooltip-inverse"),this.chartService.notify($n,t),this.visible=!0}hide(){this.chartService&&this.chartService.notify(Qn),this.visible=!1}destroy(){delete this.chartService}}te(wa,{border:{width:1},opacity:1});class _a extends wa{constructor(t,e,i){super(t,i),this.crosshair=e,this.formatService=t.format,this.initAxisName()}initAxisName(){const t=this.crosshair.axis;let e;e=t.plotArea.categoryAxis?t.getCategory?"categoryAxis":"valueAxis":t.options.vertical?"yAxis":"xAxis",this.axisName=e}showAt(t){const{crosshair:{axis:e},options:i}=this;let s=e[i.stickyMode?"getCategory":"getValue"](t),o=s;i.format?o=this.formatService.auto(i.format,s):e.options.type===g&&(o=this.formatService.auto(e.options.labels.dateFormats[e.options.baseUnit],s)),this.show({point:t,anchor:this.getAnchor(),crosshair:this.crosshair,value:o,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex},this.options)}hide(){this.chartService.notify(Qn,{crosshair:this.crosshair,axisName:this.axisName,axisIndex:this.crosshair.axis.axisIndex})}getAnchor(){const{crosshair:t,options:{position:e,padding:i}}=this,s=!t.axis.options.vertical,o=t.line.bbox();let n,r,a;return s?(n=d,e===c?(r=z,a=o.bottomLeft().translate(0,i)):(r=c,a=o.topLeft().translate(0,-i))):(r=d,e===S?(n=B,a=o.topLeft().translate(-i,0)):(n=S,a=o.topRight().translate(i,0))),{point:a,align:{horizontal:n,vertical:r}}}}te(_a,{padding:10});class ka extends yi{constructor(t,e,i){super(i),this.axis=e,this.stickyMode=e instanceof Os;const s=this.options.tooltip;s.visible&&(this.tooltip=new _a(t,this,ut({},s,{stickyMode:this.stickyMode})))}showAt(t){this.point=t,this.moveLine(),this.line.visible(!0),this.tooltip&&this.tooltip.showAt(t)}hide(){this.line.visible(!1),this.tooltip&&this.tooltip.hide()}moveLine(){const{axis:t,point:i}=this,s=t.options.vertical,o=this.getBox(),n=s?X:W,r=new e.P(o.x1,o.y1);let a;if(a=s?new e.P(o.x2,o.y1):new e.P(o.x1,o.y2),i)if(this.stickyMode){const e=t.getSlot(t.pointCategoryIndex(i));r[n]=a[n]=e.center()[n]}else r[n]=a[n]=i[n];this.box=o,this.line.moveTo(r).lineTo(a)}getBox(){const t=this.axis,e=t.pane.axes,i=e.length,s=t.options.vertical,o=t.lineBox().clone(),n=s?W:X;let r;for(let t=0;t<i;t++){const i=e[t];i.options.vertical!==s&&(r?r.wrap(i.lineBox()):r=i.lineBox().clone())}return o[n+1]=r[n+1],o[n+2]=r[n+2],o}createVisual(){super.createVisual();const t=this.options;this.line=new e.b({stroke:{color:t.color,width:t.width,opacity:t.opacity,dashType:t.dashType},visible:!1}),this.moveLine(),this.visual.append(this.line)}destroy(){this.tooltip&&this.tooltip.destroy(),super.destroy()}}te(ka,{color:h,width:2,zIndex:-1,tooltip:{visible:!1}});class Aa extends yi{constructor(t,e){super(t),this.pane=e}shouldClip(){const t=this.children,e=t.length;for(let i=0;i<e;i++)if(!0===t[i].options.clip)return!0;return!1}_clipBox(){return this.pane.chartsBox()}createVisual(){if(this.visual=new e.G({zIndex:0}),this.shouldClip()){const t=(this.clipBox=this._clipBox()).toRect(),i=e.b.fromRect(t);et(i),this.visual.clip(i),this.unclipLabels()}}stackRoot(){return this}unclipLabels(){const{children:t,clipBox:e}=this;for(let i=0;i<t.length;i++){const s=t[i].points||{},o=s.length;for(let t=0;t<o;t++){const i=s[t];if(i&&!1!==i.visible&&i.overlapsBox&&i.overlapsBox(e))if(i.unclipElements)i.unclipElements();else{const{label:t,note:s}=i;t&&t.options.visible&&(t.alignToClipBox&&t.alignToClipBox(e),t.options.noclip=!0),s&&s.options.visible&&(s.options.noclip=!0)}}}}destroy(){super.destroy(),delete this.parent}}Aa.prototype.isStackRoot=!0;let Sa=class t extends Ci{constructor(t){super(t),this.id="pane"+Ca++,this.createTitle(),this.content=new yi,this.chartContainer=new Aa({},this),this.append(this.content),this.axes=[],this.charts=[]}createTitle(){let e=this.options.title;pt(e)&&(e=ut({},e,{align:e.position,position:z})),this.title=Fi.buildTitle(e,t.prototype.options.title),this.title&&this.append(this.title)}appendAxis(t){this.content.append(t),this.axes.push(t),t.pane=this}appendAxisAt(t,e){this.content.append(t),this.axes.splice(e,0,t),t.pane=this}appendChart(t){this.chartContainer.parent!==this.content&&this.content.append(this.chartContainer),this.charts.push(t),this.chartContainer.append(t),t.pane=this}empty(){const t=this.parent;if(t){for(let e=0;e<this.axes.length;e++)t.removeAxis(this.axes[e]);for(let e=0;e<this.charts.length;e++)t.removeChart(this.charts[e])}this.axes=[],this.charts=[],this.content.destroy(),this.content.children=[],this.chartContainer.children=[]}reflow(t){let e;Xt(this.children)===this.content&&(e=this.children.pop()),super.reflow(t),e&&this.children.push(e),this.title&&(this.contentBox.y1+=this.title.box.height())}visualStyle(){const t=super.visualStyle();return t.zIndex=-10,t}renderComplete(){this.options.visible&&this.createGridLines()}stackRoot(){return this}clipRoot(){return this}createGridLines(){const t=this.axes,e=t.concat(this.parent.axes),i=[],s=[];for(let o=0;o<t.length;o++){const n=t[o],r=n.options.vertical,a=r?i:s;for(let t=0;t<e.length;t++)if(0===a.length){const i=e[t];r!==i.options.vertical&&Dt(a,n.createGridLines(i))}}}refresh(){this.visual.clear(),this.content.parent=null,this.content.createGradient=this.createGradient.bind(this),this.content.renderVisual(),this.content.parent=this,this.title&&this.visual.append(this.title.visual),this.visual.append(this.content.visual),this.renderComplete(),this.notifyRender()}chartsBox(){const t=this.axes,e=t.length,i=new ui;for(let s=0;s<e;s++){const e=t[s],o=e.options.vertical?X:W,n=e.lineBox();i[o+1]=n[o+1],i[o+2]=n[o+2]}if(0===i.x2){const t=this.parent.axes,e=t.length;for(let s=0;s<e;s++){const e=t[s];if(!e.options.vertical){const t=e.lineBox();i.x1=t.x1,i.x2=t.x2}}}return i}clipBox(){return this.chartContainer.clipBox}notifyRender(){const t=this.getService();t&&t.notify(Kn,{pane:new fo(this),index:this.paneIndex,name:this.options.name})}},Ca=1;Sa.prototype.isStackRoot=!0,te(Sa,{zIndex:-1,shrinkToFit:!0,title:{align:S},visible:!0});const Ta=t=>!1!==t.options.visible;class Pa extends yi{constructor(t,e,i){super(e),this.initFields(t,e),this.series=t,this.initSeries(),this.charts=[],this.options.legend=this.options.legend||{},this.options.legend.data=[],this.axes=[],this.crosshairs=[],this.chartService=i,this.originalOptions=e,this.originalSeries=t,this._bindCache=new WeakMap,this.createPanes(),this.render(),this.createCrosshairs()}initFields(){}initSeries(){const t=this.series;for(let e=0;e<t.length;e++)t[e].index=e}bindPoint(t,e,i){let s=this._bindCache.get(t);s||(s=[],this._bindCache.set(t,s));let o=s[e];return o||(o=s[e]=wo.current.bindPoint(t,e,i)),o}createPanes(){const t=this.options.title||{},e=this.options.paneDefaults,i=this.options.panes||[],s=Math.max(i.length,1),o=[],n=ut({title:{color:t.color}},e);for(let t=0;t<s;t++){const e=ut({},n,i[t]);ot(e.title)&&(e.title=ut({text:e.title},n.title));const s=new Sa(e);s.paneIndex=t,o.push(s),this.append(s)}this.panes=o}crosshairOptions(t){return t.options.crosshair}createCrosshairs(t=this.panes){for(let e=0;e<t.length;e++){const i=t[e];for(let t=0;t<i.axes.length;t++){const e=i.axes[t],s=this.crosshairOptions(e);if(s&&s.visible){const t=new ka(this.chartService,e,s);this.crosshairs.push(t),i.content.append(t)}}}}removeCrosshairs(t){const e=this.crosshairs,i=t.axes;for(let t=e.length-1;t>=0;t--)for(let s=0;s<i.length;s++)if(e[t].axis===i[s]){e.splice(t,1);break}}hideCrosshairs(){const t=this.crosshairs;for(let e=0;e<t.length;e++)t[e].hide()}findPane(t){const e=this.panes;let i;for(let s=0;s<e.length;s++)if(e[s].options.name===t){i=e[s];break}return i||e[0]}findPointPane(t){const e=this.panes;let i;for(let s=0;s<e.length;s++)if(e[s].box.containsPoint(t)){i=e[s];break}return i}appendAxis(t){this.findPane(t.options.pane).appendAxis(t),this.axes.push(t),t.plotArea=this}removeAxis(t){const e=[];for(let i=0;i<this.axes.length;i++){const s=this.axes[i];t!==s?e.push(s):s.destroy()}this.axes=e}appendChart(t,e){this.charts.push(t),e?e.appendChart(t):this.append(t)}removeChart(t){const e=[];for(let i=0;i<this.charts.length;i++){const s=this.charts[i];s!==t?e.push(s):s.destroy()}this.charts=e}addToLegend(t){const e=t.length,i=this.options.legend,s=i.labels||{},o=i.inactiveItems||{},n=o.labels||{},r=[];for(let i=0;i<e;i++){const e=t[i],a=!1!==e.visible;if(!1===e.visibleInLegend)continue;let l=e.name;const h=a?wt(s):wt(n)||wt(s);h&&(l=h({text:Er(l)?l:"",series:e}));const c=e._defaults;let d,u,p=e.color;ht(p)&&c&&(p=c.color),a?(d={},u=p):(d={color:n.color,font:n.font},u=o.markers.color),Er(l)&&""!==l&&r.push({text:l,labels:d,markerColor:u,series:e,active:a})}Dt(i.data,r)}groupAxes(t){const e=[],i=[];for(let s=0;s<t.length;s++){const o=t[s].axes;for(let t=0;t<o.length;t++){const s=o[t];s.options.vertical?i.push(s):e.push(s)}}return{x:e,y:i,any:e.concat(i)}}groupSeriesByPane(){const t=this.series,e={};for(let i=0;i<t.length;i++){const s=t[i],o=this.seriesPaneName(s);e[o]?e[o].push(s):e[o]=[s]}return e}filterVisibleSeries(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i];!1!==s.visible&&e.push(s)}return e}reflow(t){const e=this.options.plotArea,i=this.panes,s=yt(e.margin);this.box=t.clone().unpad(s),this.reflowPanes(),this.detachLabels(),this.reflowAxes(i),this.reflowCharts(i)}redraw(t){const e=[].concat(t);this.initSeries();const i=this.getRoot();i&&i.cleanGradients();for(let t=0;t<e.length;t++)this.removeCrosshairs(e[t]),e[t].empty();this._bindCache=new WeakMap,this.render(e),this.detachLabels(),this.reflowAxes(this.panes),this.reflowCharts(e),this.createCrosshairs(e);for(let t=0;t<e.length;t++)e[t].refresh()}axisCrossingValues(t,e){const i=t.options,s=[].concat(i.axisCrossingValues||i.axisCrossingValue),o=e.length-s.length,n=s[0]||0;for(let t=0;t<o;t++)s.push(n);return s}alignAxisTo(t,e,i,s){const o=t.getSlot(i,i,!0),n=t.options.reverse?2:1,r=e.getSlot(s,s,!0),a=e.options.reverse?2:1,l=t.box.translate(r[W+a]-o[W+n],r[X+a]-o[X+n]);t.pane!==e.pane&&l.translate(0,t.pane.box.y1-e.pane.box.y1),t.reflow(l)}alignAxes(t,e){const i=t[0],s=e[0],o=this.axisCrossingValues(i,e),n=this.axisCrossingValues(s,t),r={},a={},l={},h={};for(let l=0;l<e.length;l++){const h=e[l],c=h.pane,d=c.id,u=!1!==h.options.visible,p=La(t,c)||i;let g=o;if(p!==i&&(g=this.axisCrossingValues(p,e)),this.alignAxisTo(h,p,n[l],g[l]),h.options._overlap)continue;$t(h.lineBox().x1)===$t(p.lineBox().x1)&&(r[d]&&h.reflow(h.box.alignTo(r[d].box,S).translate(-h.options.margin,0)),u&&(r[d]=h)),$t(h.lineBox().x2)===$t(p.lineBox().x2)&&(h._mirrored||(h.options.labels.mirror=!h.options.labels.mirror,h._mirrored=!0),this.alignAxisTo(h,p,n[l],g[l]),a[d]&&h.reflow(h.box.alignTo(a[d].box,B).translate(h.options.margin,0)),u&&(a[d]=h));const m=La(e,c)||s;m!==h&&(h.alignTo(m),h.reflow(h.box))}for(let r=0;r<t.length;r++){const a=t[r],d=a.pane,u=d.id,p=!1!==a.options.visible,g=La(e,d)||s;let m=n;g!==s&&(m=this.axisCrossingValues(g,t)),this.alignAxisTo(a,g,o[r],m[r]),a.options._overlap||($t(a.lineBox().y1)===$t(g.lineBox().y1)&&(a._mirrored||(a.options.labels.mirror=!a.options.labels.mirror,a._mirrored=!0),this.alignAxisTo(a,g,o[r],m[r]),l[u]&&a.reflow(a.box.alignTo(l[u].box,z).translate(0,-a.options.margin)),p&&(l[u]=a)),$t(a.lineBox().y2,3)===$t(g.lineBox().y2,3)&&(h[u]&&a.reflow(a.box.alignTo(h[u].box,c).translate(0,a.options.margin)),p&&(h[u]=a)),0!==r&&(a.alignTo(i),a.reflow(a.box)))}}shrinkAxisWidth(t){const e=this.groupAxes(t).any,i=Ea(e);let s=0;for(let e=0;e<t.length;e++){const o=t[e];o.axes.length>0&&(s=Math.max(s,i.width()-o.contentBox.width()))}if(0!==s)for(let t=0;t<e.length;t++){const i=e[t];i.options.vertical||i.reflow(i.box.shrink(s,0))}}shrinkAxisHeight(t){let e;for(let i=0;i<t.length;i++){const s=t[i],o=s.axes,n=Math.max(0,Ea(o).height()-s.contentBox.height());if(0!==n){for(let t=0;t<o.length;t++){const e=o[t];e.options.vertical&&e.reflow(e.box.shrink(0,n))}e=!0}}return e}fitAxes(t){const e=this.groupAxes(t).any;let i=0;for(let e=0;e<t.length;e++){const s=t[e],o=s.axes,n=s.contentBox;if(o.length>0){const t=Ea(o),e=Math.max(n.y1-t.y1,n.y2-t.y2);i=Math.max(i,n.x1-t.x1);for(let t=0;t<o.length;t++){const i=o[t];i.reflow(i.box.translate(0,e))}}}for(let t=0;t<e.length;t++){const s=e[t];s.reflow(s.box.translate(i,0))}}reflowAxes(t){const e=this.groupAxes(t);for(let e=0;e<t.length;e++)this.reflowPaneAxes(t[e]);e.x.length>0&&e.y.length>0&&(this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t),this.autoRotateAxisLabels(e),this.alignAxes(e.x,e.y),this.shrinkAxisWidth(t)&&this.alignAxes(e.x,e.y),this.shrinkAxisHeight(t),this.alignAxes(e.x,e.y),this.shrinkAxisHeight(t)&&this.alignAxes(e.x,e.y),this.fitAxes(t))}autoRotateAxisLabels(t){const{panes:e}=this,i=Ia(e);let s;for(let t=0;t<i.length;t++){i[t].autoRotateLabels()&&(s=!0)}if(s){for(let t=0;t<e.length;t++)this.reflowPaneAxes(e[t]);t.x.length>0&&t.y.length>0&&(this.alignAxes(t.x,t.y),this.shrinkAxisWidth(e))}}reflowPaneAxes(t){const e=t.axes,i=e.length;if(i>0)for(let s=0;s<i;s++)e[s].reflow(t.contentBox)}reflowCharts(t){const e=this.charts,i=e.length,s=this.box;for(let o=0;o<i;o++){const i=e[o].pane;i&&!Mt(i,t)||e[o].reflow(s)}}reflowPanes(){const{box:t,panes:e}=this,i=e.length;let s=t.height(),o=0,n=t.y1;for(let n=0;n<i;n++){const i=e[n],r=i.options.height;if(i.options.width=t.width(),i.options.height){if(r.indexOf&&r.indexOf("%")){const e=parseInt(r,10)/100;i.options.height=e*t.height()}i.reflow(t.clone()),s-=i.options.height}else o++}for(let t=0;t<i;t++){const i=e[t];i.options.height||(i.options.height=s/o)}for(let s=0;s<i;s++){const i=e[s],o=t.clone().move(t.x1,n);i.reflow(o),n+=i.options.height}}backgroundBox(){const t=this.axes,e=t.length;let i;for(let s=0;s<e;s++){const o=t[s];for(let s=0;s<e;s++){const e=t[s];if(o.options.vertical!==e.options.vertical){const t=o.lineBox().clone().wrap(e.lineBox());i=i?i.wrap(t):t}}}return i||this.box}chartsBoxes(){const t=this.panes,e=[];for(let i=0;i<t.length;i++)e.push(t[i].chartsBox());return e}addBackgroundPaths(t){const i=this.chartsBoxes();for(let s=0;s<i.length;s++)t.paths.push(e.b.fromRect(i[s].toRect()))}backgroundContainsPoint(t){const e=this.chartsBoxes();for(let i=0;i<e.length;i++)if(e[i].containsPoint(t))return!0}createVisual(){super.createVisual();const t=this.options.plotArea;let{opacity:i,background:s,border:o={}}=t;var n;""!==(n=s)&&null!==n&&"none"!==n&&"transparent"!==n&&Ft(n)||(s=U,i=0);const r=this._bgVisual=new e.h({fill:{color:s,opacity:i},stroke:{color:o.width?o.color:"",width:o.width,dashType:o.dashType},zIndex:-1});this.addBackgroundPaths(r),this.appendVisual(r)}pointsByCategoryIndex(t){const e=this.charts,i=[];if(null!==t)for(let s=0;s<e.length;s++){if("_navigator"===e[s].pane.options.name)continue;const o=e[s].categoryPoints[t];if(o&&o.length)for(let t=0;t<o.length;t++){const e=o[t];e&&Ft(e.value)&&null!==e.value&&i.push(e)}}return i}pointsBySeriesIndex(t){return this.filterPoints((function(e){return e.series.index===t}))}pointsByPointIndex(t){return this.filterPoints((function(e){return e.getIndex()===t}))}pointsBySeriesName(t){return this.filterPoints((function(e){return e.series.name===t}))}filterPoints(t){const e=this.charts,i=[];for(let s=0;s<e.length;s++){const o=e[s].points;for(let e=0;e<o.length;e++){const s=o[e];s&&!1!==s.visible&&t(s)&&i.push(s)}}return i}findPoint(t){const e=this.charts;for(let i=0;i<e.length;i++){const s=e[i].points;for(let e=0;e<s.length;e++){const i=s[e];if(i&&!1!==i.visible&&t(i))return i}}}paneByPoint(t){const e=this.panes;for(let i=0;i<e.length;i++){const s=e[i];if(s.box.containsPoint(t))return s}}detachLabels(){const t=this.groupAxes(this.panes),e=t.x,i=t.y;this.detachAxisGroupLabels(i,e),this.detachAxisGroupLabels(e,i)}detachAxisGroupLabels(t,e){let i=0;for(let s=0;s<t.length;s++){const o=t[s],n=o.pane,r=La(e,n)||e[0],a=s+i,l=this.createLabelAxis(o,a,r);if(l){i++;const t=n.axes.indexOf(o)+i;n.appendAxisAt(l,t)}}}createLabelAxis(t,e,i){const s=t.options.labels,o=s.position,n=o!==y&&o!==V,r=s.visible;if(n||!1===r)return null;const a=this.groupAxes(this.panes),l=i.options.vertical?a.x:a.y,h=this.axisCrossingValues(i,l),c=o===y,d=i.range(),u=c?d.max:d.min;if(Yt(h[e],d.min,d.max)-u==0)return null;h.splice(e+1,0,u),i.options.axisCrossingValues=h;const p=t.clone();return t.clear(),p.options.name=void 0,p.options.line.visible=!1,p.options.crosshair=void 0,p.options.notes=void 0,p.options.plotBands=void 0,p}isTrendline(t){return t&&Mt(t.type,Mn)}trendlineFactory(){}createTrendlineSeries(){const t=[];return this.series=this.series.map((e=>{if(!this.isTrendline(e))return e;const i=this.seriesByName(e.for);if(!i)throw new Error(`Invalid Configuration: Unable to locate linked series "${e.for}" for trendline "${e.name}".`);const s=wo.current.valueFields(i),o=Xt(s),n=this.trendlineFactory(Object.assign({},{field:o},e),i);return n&&(!1===i.visible&&(n.visible=!1),n.color===A&&(n.color=i.color),t.push(n)),n})).filter((t=>null!==t)),t}seriesByName(t){return this.series.find((e=>e.name===t))}getFirstPoint(){for(let t=0;t<this.series.length;t++){const e=this.pointsBySeriesIndex(t).find(Ta);if(e)return e}}getPointBelow(t){return this._getNextPoint(t,this._pointsByVertical,1)}getPointAbove(t){return this._getNextPoint(t,this._pointsByVertical,-1)}getPointToTheRight(t){return this._getNextPoint(t,this._pointsByHorizontal,1)}getPointToTheLeft(t){return this._getNextPoint(t,this._pointsByHorizontal,-1)}_getNextPoint(t,e,i){let s=e.call(this,t).filter(Ta);let o=s.indexOf(t)+i;const n=i=>{let s,o=0;do{o+=i,s=e.call(this,t,o).filter(Ta)}while(0===s.length);return s};return o<0?(s=n(-1),s.at(-1)):o>=s.length?(s=n(1),s.at(0)):s[o]}_pointsByVertical(t){return this.pointsByPointIndex(t.getIndex())}_pointsByHorizontal(t,e=0){let i=lt(t.series.index+e,this.series.length);return this.pointsBySeriesIndex(i)}}function Ma(t){return!t.pane.axes.some((e=>e.options.vertical===t.options.vertical&&e!==t&&!1!==e.options.visible))}function Ea(t){const e=t.length;let i;for(let s=0;s<e;s++){const e=t[s],o=!1!==e.options.visible;if(o||Ma(e)){const t=o?e.contentBox():e.lineBox();i?i.wrap(t):i=t.clone()}}return i||new ui}function La(t,e){for(let i=0;i<t.length;i++){const s=t[i];if(s&&s.pane===e)return s}}const Ia=t=>t.reduce(((t,e)=>t.concat(e.axes)),[]);te(Pa,{series:[],plotArea:{margin:{}},background:"",border:{color:h,width:0},paneDefaults:{title:{}},legend:{inactiveItems:{labels:{color:"#919191"},markers:{color:"#919191"}}}});const Ra={hover:function(t,e){this._dispatchEvent(t,e,zn)},click:function(t,e){this._dispatchEvent(t,e,Dn)}};class Ba extends e.a{constructor(t,e,i){super();const s=e.canonicalFields(t),o=e.valueFields(t),n=e.sourceFields(t,s),r=this._seriesFields=[],a=i.query(t.type),l=t.aggregate||a;this._series=t,this._binder=e;for(let t=0;t<s.length;t++){const e=s[t];let i;if(pt(l))i=l[e];else{if(0!==t&&!Mt(e,o))break;i=l}i&&r.push({canonicalName:e,name:n[t],transform:ht(i)?i:vo[i]})}}aggregatePoints(t,e){const{_series:i,_seriesFields:s}=this,o=this._bindPoints(t||[]),n=o.dataItems[0];let r={};if(n&&!st(n)&&!Q(n)){const t=function(){};t.prototype=n,r=new t}for(let t=0;t<s.length;t++){const n=s[t],a=this._bindField(o.values,n.canonicalName),l=n.transform(a,i,o.dataItems,e);if(!(null===l||!pt(l)||Ft(l.length)||l instanceof Date)){r=l;break}Ft(l)&&Oa(n.name,r,l)}return r}_bindPoints(t){const{_binder:e,_series:i}=this,s=[],o=[];for(let n=0;n<t.length;n++){const r=t[n];s.push(e.bindPoint(i,r)),o.push(i.data[r])}return{values:s,dataItems:o}}_bindField(t,e){const i=[],s=t.length;for(let o=0;o<s;o++){const s=t[o],n=s.valueFields;let r;r=Ft(n[e])?n[e]:s.fields[e],i.push(r)}return i}}function Oa(t,e,i){let s=e,o=t;if(t.indexOf(".")>-1){const e=t.split(".");for(;e.length>1;)o=e.shift(),Ft(s[o])||(s[o]={}),s=s[o];o=e.shift()}s[o]=i}class Va extends e.a{constructor(){super(),this._defaults={}}register(t,e){for(let i=0;i<t.length;i++)this._defaults[t[i]]=e}query(t){return this._defaults[t]}}Va.current=new Va;class Da extends sa{createLabel(){const t=this.options.labels,e=ut({},t,t.from),i=ut({},t,t.to);e.visible&&(this.labelFrom=this.createLabelElement(e),this.append(this.labelFrom)),i.visible&&(this.labelTo=this.createLabelElement(i),this.append(this.labelTo))}reflow(t){this.render();const{labelFrom:e,labelTo:i,value:s}=this;this.box=t,e&&(e.options.aboveAxis=s.from>s.to,e.reflow(t)),i&&(i.options.aboveAxis=s.to>s.from,i.reflow(t)),this.note&&this.note.reflow(t)}}Da.prototype.defaults=ut({},Da.prototype.defaults,{labels:{format:"{0} - {1}"},tooltip:{format:"{1}"}});class za extends la{pointType(){return Da}pointValue(t){return t.valueFields}formatPointValue(t,e){return null===t.value.from&&null===t.value.to?"":this.chartService.format.auto(e,t.value.from,t.value.to)}plotRange(t){return t?[t.value.from,t.value.to]:0}updateRange(t,e){const i=e.series.axis,{from:s,to:o}=t;let n=this.valueAxisRanges[i];null!==t&&st(s)&&st(o)&&(n=this.valueAxisRanges[i]=n||{min:C,max:T},n.min=Math.min(n.min,s),n.max=Math.max(n.max,s),n.min=Math.min(n.min,o),n.max=Math.max(n.max,o))}aboveAxis(t){const e=t.value;return e.from<e.to}}za.prototype.plotLimits=Dr.prototype.plotLimits;class Fa extends Hr{aliasFor(){return this.parent}}const Ha="auto";class Na extends yi{constructor(t,e){super(),this.value=t,this.options=e,this.aboveAxis=Kt(this.options.aboveAxis,!0),this.tooltipTracking=!0,this._id=Te(),this.initLabelsFormat()}render(){if(this._rendered)return;this._rendered=!0;const{markers:t,labels:e}=this.options,i=this.value,s=this.fromPoint=new Fa(i,ut({},this.options,{labels:e.from,markers:t.from})),o=this.toPoint=new Fa(i,ut({},this.options,{labels:e.to,markers:t.to}));this.copyFields(s),this.copyFields(o),this.append(s),this.append(o)}reflow(t){this.render();const{from:e,to:i}=t;this.positionLabels(e,i),this.fromPoint.reflow(e),this.toPoint.reflow(i),this.box=this.fromPoint.markerBox().clone().wrap(this.toPoint.markerBox())}createHighlight(){const t=new e.G;return t.append(this.fromPoint.createHighlight()),t.append(this.toPoint.createHighlight()),t}highlightVisual(){return this.visual}highlightVisualArgs(){return{options:this.options,from:this.fromPoint.highlightVisualArgs(),to:this.toPoint.highlightVisualArgs()}}createFocusHighlight(){const t=new e.G;return t.append(this.fromPoint.createFocusHighlight()),t.append(this.toPoint.createFocusHighlight()),t}tooltipAnchor(){const t=this.owner.pane.clipBox();if(!t||t.overlaps(this.box)){const t=this.box,e=t.center(),i=S;let s,o,n;return this.options.vertical?(s=e.x,o=t.y1-5,n=c):(s=t.x2+5,o=e.y,n=d),{point:new di(s,o),align:{horizontal:i,vertical:n}}}}formatValue(t){return this.owner.formatPointValue(this,t)}overlapsBox(t){return this.box.overlaps(t)}unclipElements(){this.fromPoint.unclipElements(),this.toPoint.unclipElements()}initLabelsFormat(){const t=this.options.labels;t.format||(t.from&&t.from.format||(t.from=Object.assign({},t.from,{format:"{0}"})),t.to&&t.to.format||(t.to=Object.assign({},t.to,{format:"{1}"})))}positionLabels(t,e){const{labels:i,vertical:s}=this.options;if(i.position===Ha){let o,n;s?e.y1<=t.y1?(n=Fo,o=Ho):(n=Ho,o=Fo):e.x1<=t.x1?(n=S,o=B):(n=B,o=S),i.from&&i.from.position||(this.fromPoint.options.labels.position=o),i.to&&i.to.position||(this.toPoint.options.labels.position=n)}}copyFields(t){t.dataItem=this.dataItem,t.category=this.category,t.series=this.series,t.color=this.color,t.owner=this.owner}focusVisual(){this.fromPoint.focusVisual()}clearFocusFromVisual(){this.toPoint.clearFocusFromVisual()}getIndex(){return this.categoryIx}}ut(Na.prototype,zr),ut(Na.prototype,Fr),Na.prototype.defaults={markers:{visible:!1,background:U,size:8,type:u,border:{width:2},opacity:1},labels:{visible:!1,margin:yt(3),padding:yt(4),animation:{type:To,delay:Co},position:Ha},notes:{label:{}},highlight:{markers:{border:{color:U,width:2}},zIndex:100},tooltip:{format:"{0} - {1}"},accessibility:{role:Jn,className:tr,ariaRoleDescription:er}};class ja extends $r{createStrokeSegments(){return this.segmentsFromPoints(this.toGeometryPoints(this.toPoints()))}stackSegments(){let t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.segmentsFromPoints(this.toGeometryPoints(this.fromPoints().reverse()))),t}createStroke(t){const i=new e.b(t),s=new e.b(t);i.segments.push.apply(i.segments,this.strokeSegments()),s.segments.push.apply(s.segments,this.stackSegments()),this.visual.append(i),this.visual.append(s)}hasStackSegment(){return!0}fromPoints(){return this.linePoints.map((t=>t.fromPoint))}toPoints(){return this.linePoints.map((t=>t.toPoint))}}class Ua extends ja{createStrokeSegments(){return this.createCurveSegments(this.toPoints())}stackSegments(){let t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.createCurveSegments(this.fromPoints().reverse())),t}createCurveSegments(t){return(new co).process(this.toGeometryPoints(t))}}class Ga extends ja{createStrokeSegments(){return this.segmentsFromPoints(this.calculateStepPoints(this.toPoints()))}stackSegments(){let t=this.fromSegments;return this.fromSegments||(t=this.fromSegments=this.segmentsFromPoints(this.calculateStepPoints(this.fromPoints())),t.reverse()),t}}ut(Ga.prototype,jr);class Wa extends Dr{render(){super.render(),this.renderSegments()}pointType(){return Na}createPoint(t,e){const{series:i,seriesIx:s}=e;let o=t.valueFields;if(!Er(o.from)&&!Er(o.to)){if(this.seriesMissingValues(i)!==Vo)return null;o={from:0,to:0}}let n=this.pointOptions(i,s);n=this.evalPointOptions(n,o,e);let r=t.fields.color||i.color;ht(i.color)&&(r=n.color);const a=new Na(o,n);return a.color=r,this.append(a),a}createSegment(t,e,i){const s=(e.line||{}).style;let o;return o="smooth"===s?Ua:"step"===s?Ga:ja,new o(t,e,i)}plotRange(t,e){return t?[t.value.from,t.value.to]:[e,e]}valueSlot(t,e){const i=t.getSlot(e[0],e[0],!this.options.clip),s=t.getSlot(e[1],e[1],!this.options.clip);if(i&&s)return{from:i,to:s}}pointSlot(t,e){const{from:i,to:s}=e;let o,n;return this.options.invertAxes?(o=new ui(i.x1,t.y1,i.x2,t.y2),n=new ui(s.x1,t.y1,s.x2,t.y2)):(o=new ui(t.x1,i.y1,t.x2,i.y2),n=new ui(t.x1,s.y1,t.x2,s.y2)),{from:o,to:n}}addValue(t,e){const i=t.valueFields;st(i.from)||(i.from=i.to),st(i.to)||(i.to=i.from),super.addValue(t,e)}updateRange(t,e){if(null!==t&&st(t.from)&&st(t.to)){const i=e.series.axis,s=this.valueAxisRanges[i]=this.valueAxisRanges[i]||{min:C,max:T},{from:o,to:n}=t;s.min=Math.min(s.min,o,n),s.max=Math.max(s.max,o,n)}}formatPointValue(t,e){const i=t.value;return this.chartService.format.auto(e,i.from,i.to)}animationPoints(){const t=this.points,e=[];for(let i=0;i<t.length;i++){const s=t[i];s&&(e.push((s.fromPoint||{}).marker),e.push((s.toPoint||{}).marker))}return e.concat(this._segments)}}ut(Wa.prototype,Xr,qr);class Xa extends ha{reflow(t){const{options:e,value:i,owner:s}=this,o=s.seriesValueAxis(e),n=[],r=[],a=[],l=o.getSlot(i.low,i.high),h=o.getSlot(i.open,i.open),c=o.getSlot(i.close,i.close);h.x1=c.x1=l.x1=t.x1,h.x2=c.x2=l.x2=t.x2;const d=l.center().x;n.push([h.x1,h.y1]),n.push([d,h.y1]),r.push([d,c.y1]),r.push([c.x2,c.y1]),a.push([d,l.y1]),a.push([d,l.y2]),this.lines=[n,r,a],this.box=l.clone().wrap(h.clone().wrap(c)),this.reflowNote()}createBody(){}}class Ya extends ca{pointType(){return Xa}}class qa extends yi{constructor(t,e,i){super(),this.from=t,this.to=e,this.series=i}linePoints(){const t=this.from,{from:{box:e},to:{box:i}}=this,s=[];if(t.isVertical){const o=t.aboveAxis?e.y1:e.y2;s.push([e.x1,o],[i.x2,o])}else{const o=t.aboveAxis?e.x2:e.x1;s.push([o,e.y1],[o,i.y2])}return s}createVisual(){super.createVisual();const t=this.series.line||{},i=e.b.fromPoints(this.linePoints(),{stroke:{color:t.color,width:t.width,opacity:t.opacity,dashType:t.dashType}});et(i),this.visual.append(i)}}te(qa,{animation:{type:To,delay:Co}});class Za extends la{render(){super.render(),this.createSegments()}traverseDataPoints(t){const e=this.options.series,i=kr(e),s=!this.options.invertAxes;for(let o=0;o<e.length;o++){const n=e[o];let r=0,a=0;for(let e=0;e<i;e++){const i=wo.current.bindPoint(n,e),l=i.valueFields.value,h=i.fields.summary;let c,d=r;h?"total"===h.toLowerCase()?(i.valueFields.value=r,d=0,c=r):(i.valueFields.value=a,c=d-a,a=0):st(l)&&(a+=l,r+=l,c=r),t(i,{category:this.categoryAxis.categoryAt(e),categoryIx:e,series:n,seriesIx:o,total:r,runningTotal:a,from:d,to:c,isVertical:s})}}}updateRange(t,e){super.updateRange({value:e.to},e)}aboveAxis(t){return t.value>=0}plotRange(t){return[t.from,t.to]}createSegments(){const t=this.options.series,e=this.seriesPoints,i=this.segments=[];for(let s=0;s<t.length;s++){const o=t[s],n=e[s];if(n){let t;for(let e=0;e<n.length;e++){const s=n[e];if(s&&t){const e=new qa(t,s,o);i.push(e),this.append(e)}t=s}}}}}function $a(t,e,i){const s=t[String(e)];return s?s(i):null}function Qa(t,e){let i,s,o=0,n=0,r=0,a=0,l=0,h=Number.MAX_VALUE,c=Number.MIN_VALUE;for(let i=0;i<t.length;i++){const s=t[i],{xValue:d,yValue:u}=e(s);isFinite(d)&&null!==d&&isFinite(u)&&null!==u&&(h=Math.min(d,h),c=Math.max(d,c),l++,o+=d,n+=u,r+=Math.pow(d,2),a+=d*u)}return l>0&&(i=(l*a-o*n)/(l*r-Math.pow(o,2)),s=(n-i*o)/l),{slope:i,intercept:s,count:l,xMin:h,xMax:c}}const Ka=(t,e)=>t.every((({valueFields:t})=>!Er(t[e])||t[e]>0));function Ja(t,e){const i=[],s=e.totalRangeIndices(),o=e.currentRangeIndices(),n={min:Math.floor(Math.max(o.min-1,s.min)),max:Math.ceil(Math.min(o.max+2,s.max))};for(let s=n.min;s<n.max;s++){const o=s+1;i[s]={category:e.categoryAt(s,!0),value:t(o)}}return i}const tl=t=>({categoryIx:e,valueFields:i})=>({xValue:e+1,yValue:Math.log(i[t])});const el=t=>({categoryIx:e,valueFields:i})=>({xValue:e+1,yValue:i[t]});const il=t=>({categoryIx:e,valueFields:i})=>({xValue:Math.log(e+1),yValue:i[t]});function sl(t,e,i){const s=[],o=[],n=Math.max(2,i)-1;let r=0,a=0;for(let i=0;i<t.length;i++){const l=t[i],{xValue:h,yValue:c}=e(l);if(isFinite(c)&&null!==c?(o.push(c),a+=c,r=Math.max(i,r)):o.push(null),i>=n){const t=o.filter((t=>null!==t)).length,e=o.shift()||0;if(t>0){const i=a/t;s.push([h,i]),a-=e;continue}}s.push([h,null])}return s.slice(0,r+1)}const ol=t=>({categoryIx:e,valueFields:i})=>({xValue:e,yValue:i[t]});function nl(t,e,i){let s=Math.min(Math.max(i||1,1),6)+1,o=new _e,n=new _e,r=0,a=Number.MAX_VALUE,l=Number.MIN_VALUE,h=t=>t,c=[];for(let i=0;i<t.length;i++){const h=t[i];let{xValue:c,yValue:d}=e(h);if(isFinite(c)&&null!==c&&isFinite(d)&&null!==d){a=Math.min(c,a),l=Math.max(c,l),r++,n.set(i,0,d),o.set(i,0,1),o.set(i,1,c);for(let t=2;t<=s;t++)o.set(i,t,Math.pow(o.get(i,1),t))}else o.set(i,0,0)}return o.width=Math.min(s,r),r>0&&(c=function(t,e){const i=t.transpose(),s=i.multiply(t).inverse().multiply(i).multiply(e),o=[];for(let t=0;t<s.height;t++)o.push(s.get(t,0));return o}(o,n),h=t=>c.reduce(((e,i,s)=>e+i*Math.pow(t,s)),0)),{coefficients:c,count:r,valueMapper:h,xMin:a,xMax:l}}const rl=t=>({categoryIx:e,valueFields:i})=>({xValue:e+1,yValue:i[t]});const al=t=>({categoryIx:e,valueFields:i})=>({xValue:Math.log(e+1),yValue:Math.log(i[t])});const ll={};ll[kn]=function(t){const{options:e,categoryAxis:i,seriesValues:s}=t,o=function({seriesValues:t,categoryAxis:e,options:i}){const s=t();if(!Ka(s,i.field))return null;let{slope:o,intercept:n,count:r}=Qa(s,tl(i.field));if(r>0){const t=Math.exp(n),i=o;return Ja((e=>t*Math.exp(i*e)),e)}return null}({seriesValues:s,categoryAxis:i,options:e});return o?Object.assign({},e,{type:"line",data:o,categoryField:"category",field:"value"}):null},ll[An]=function(t){const{options:e,categoryAxis:i,seriesValues:s}=t,o=function({seriesValues:t,categoryAxis:e,options:i}){const{slope:s,intercept:o,count:n}=Qa(t(),el(i.field));if(n>0)return Ja((t=>s*t+o),e);return null}({seriesValues:s,categoryAxis:i,options:e});return o?Object.assign({},e,{type:"line",data:o,categoryField:"category",field:"value"}):null},ll[Sn]=function(t){const{options:e,categoryAxis:i,seriesValues:s}=t,o=function({seriesValues:t,categoryAxis:e,options:i}){let{slope:s,intercept:o,count:n}=Qa(t(),il(i.field));if(n>0){const t=s,i=o;return Ja((e=>t*Math.log(e)+i),e)}return null}({seriesValues:s,categoryAxis:i,options:e});return o?Object.assign({},e,{type:"line",data:o,categoryField:"category",field:"value"}):null},ll[Cn]=function(t){const{options:e}=t,i=function(t){const{categoryAxis:e}=t,i=function({options:t,categoryAxis:e,seriesValues:i}){const s=(t.trendline||{}).period||2,o=e.totalRangeIndices(),n=e.currentRangeIndices(),r={min:Math.floor(Math.max(n.min-s,o.min)),max:Math.ceil(Math.min(n.max+s+2,o.max))};return sl(i(r),ol(t.field),s)}(t),s=[];if(i.forEach((([t,i])=>{s[t]={category:e.categoryAt(t,!0),value:i}})),s.length>0)return s;return null}(t);return i?Object.assign({},e,{type:"line",data:i,categoryField:"category",field:"value"}):null},ll[Tn]=function(t){const{options:e,categoryAxis:i,seriesValues:s}=t,o=function({seriesValues:t,categoryAxis:e,options:i}){const s=(i.trendline||{}).order,{count:o,valueMapper:n}=nl(t(),rl(i.field),s);if(o>0)return Ja((t=>n(t)),e);return null}({seriesValues:s,categoryAxis:i,options:e});return o?Object.assign({},e,{type:"line",data:o,categoryField:"category",field:"value"}):null},ll[Pn]=function(t){const{options:e,categoryAxis:i,seriesValues:s}=t,o=function({seriesValues:t,categoryAxis:e,options:i}){const s=t();if(!Ka(s,i.field))return null;let{slope:o,intercept:n,count:r}=Qa(s,al(i.field));if(r>0){const t=Math.exp(n),i=o;return Ja((e=>t*Math.pow(e,i)),e)}return null}({seriesValues:s,categoryAxis:i,options:e});return o?Object.assign({},e,{type:"line",data:o,categoryField:"category",field:"value"}):null};const hl=[Uo,fn,dn,bn],cl=[en,vn].concat(hl);class dl extends Pa{initFields(t){if(this.namedCategoryAxes={},this.namedValueAxes={},this.valueAxisRangeTracker=new ta,this._seriesPointsCache={},this._currentPointsCache={},t.length>0){this.invertAxes=Mt(t[0].type,[Go,Yo,vn,fn,bn,un,tn,xn]);for(let e=0;e<t.length;e++){const i=t[e].stack;if(i&&"100%"===i.type){this.stack100=!0;break}}}}render(t=this.panes){this.series=[...this.originalSeries],this.createCategoryAxes(t),this.aggregateCategories(t),this.createTrendlineSeries(t),this.createCategoryAxesLabels(t),this.createCharts(t),this.createValueAxes(t)}removeAxis(t){const e=t.options.name;super.removeAxis(t),t instanceof Os?delete this.namedCategoryAxes[e]:(this.valueAxisRangeTracker.reset(e),delete this.namedValueAxes[e]),t===this.categoryAxis&&delete this.categoryAxis,t===this.valueAxis&&delete this.valueAxis}trendlineFactory(t,e){const i=this.seriesCategoryAxis(t),s=this.seriesValues.bind(this,e.index),o=$a(ll,t.type,{options:t,categoryAxis:i,seriesValues:s});return o?(o.categoryAxis=e.categoryAxis,o.valueAxis=e.valueAxis,this.filterSeries(o,i)):o}trendlineAggregateForecast(){return this.series.map((t=>(t.trendline||{}).forecast)).filter((t=>void 0!==t)).reduce(((t,e)=>({before:Math.max(t.before,e.before||0),after:Math.max(t.after,e.after||0)})),{before:0,after:0})}seriesValues(t,e){const i=[];let s=this.srcSeries[t];const o=this.seriesCategoryAxis(s);Ar(o.options.type,g)&&(this._seriesPointsCache={},this._currentPointsCache={},o.options.dataItems=[],s=this.aggregateSeries(s,o,o.totalRangeIndices()));const n=e?e.min:0,r=e?e.max:s.data.length;for(let t=n;t<r;t++){const e=this.bindPoint(s,t);i.push({categoryIx:t,category:e.fields.category,valueFields:e.valueFields})}return i}createCharts(t){const e=this.groupSeriesByPane();for(let i=0;i<t.length;i++){const s=t[i],o=e[s.options.name||"default"]||[];this.addToLegend(o);const n=this.filterVisibleSeries(o);if(!n)continue;const r=this.groupSeriesByCategoryAxis(n);for(let t=0;t<r.length;t++)this.createChartGroup(r[t],s)}}createChartGroup(t,e){this.createAreaChart(Cr(t,[Uo,fn]),e),this.createRangeAreaChart(Cr(t,[dn,bn]),e),this.createBarChart(Cr(t,[Zo,Go]),e),this.createRangeBarChart(Cr(t,[pn,un]),e),this.createBulletChart(Cr(t,[Yo,yn]),e),this.createCandlestickChart(Cr(t,qo),e),this.createBoxPlotChart(Cr(t,[Wo,xn]),e),this.createOHLCChart(Cr(t,sn),e),this.createWaterfallChart(Cr(t,[wn,tn]),e),this.createLineChart(Cr(t,[en,vn]),e)}aggregateCategories(t){const e=[...this.series],i=[];this._currentPointsCache={},this._seriesPointsCache=this._seriesPointsCache||{};for(let s=0;s<e.length;s++){let o=e[s];if(!this.isTrendline(o)){const e=this.seriesCategoryAxis(o),i=this.findPane(e.options.pane);o=(Ar(e.options.type,g)||o.categoryField)&&Mt(i,t)?this.aggregateSeries(o,e,e.currentRangeIndices()):this.filterSeries(o,e)}i.push(o)}this._seriesPointsCache=this._currentPointsCache,this._currentPointsCache=null,this.srcSeries=e,this.series=i}filterSeries(t,e){const i=(t.data||{}).length;if(e._seriesMax=Math.max(e._seriesMax||0,i),!Ft(e.options.min)&&!Ft(e.options.max))return t;const s=e.currentRangeIndices(),o=Mt(t.type,cl),n=ut({},t);return n.data=(n.data||[]).slice(s.min,s.max+1),o&&Vr(n,s,i,(i=>({item:t.data[i],category:e.categoryAt(i,!0),categoryIx:i-s.min})),(e=>Ft(t.data[e]))),n}clearSeriesPointsCache(){this._seriesPointsCache={}}seriesSourcePoints(t,e){const i=`${t.index};${e.categoriesHash()}`;if(this._seriesPointsCache&&this._seriesPointsCache[i])return this._currentPointsCache[i]=this._seriesPointsCache[i],this._seriesPointsCache[i];const s=e.options,o=s.srcCategories,n=Ar(s.type,g),r=t.data,a=[];n||e.indexCategories();for(let i=0;i<r.length;i++){let s=wo.current.bindPoint(t,i).fields.category;if(n&&(s=Pr(s,r[i],this.chartService.intl)),Ft(s)||(s=o[i]),Ft(s)&&null!==s){const t=e.totalIndex(s);a[t]=a[t]||{items:[],category:s},a[t].items.push(i)}}return this._currentPointsCache[i]=a,a}aggregateSeries(t,e,i){if(!t.data.length)return t;const s=this.seriesSourcePoints(t,e),o=ut({},t),n=new Ba(ut({},t),wo.current,Va.current),r=o.data=[],a=e.options.dataItems||[],l=t=>{const o=t-i.min;let r=s[t];if(r||(r=s[t]={}),r.categoryIx=o,!r.item){const i=e.categoryAt(t,!0);r.category=i,r.item=n.aggregatePoints(r.items,i)}return r};for(let t=i.min;t<=i.max;t++){const e=l(t);r[e.categoryIx]=e.item,e.items&&e.items.length&&(a[e.categoryIx]=e.item)}return Mt(o.type,cl)&&Vr(o,i,e.totalCount(),l,(t=>s[t])),e.options.dataItems=a,o}appendChart(t,e){const i=t.options.series,s=this.seriesCategoryAxis(i[0]);let o=s.options.categories,n=Math.max(0,kr(i)-o.length);if(n>0)for(o=s.options.categories=s.options.categories.slice(0);n--;)o.push("");this.valueAxisRangeTracker.update(t.valueAxisRanges),super.appendChart(t,e)}seriesPaneName(t){const e=this.options,i=t.axis,s=Ct([].concat(e.valueAxis),(function(t){return t.name===i}))[0],o=((e.panes||[{}])[0]||{}).name||"default";return(s||{}).pane||o}seriesCategoryAxis(t){const e=t.categoryAxis,i=e?this.namedCategoryAxes[e]:this.categoryAxis;if(!i)throw new Error("Unable to locate category axis with name "+e);return i}stackableChartOptions(t,e){const i=t.some((t=>t.stack)),s=t.some((t=>t.stack&&"100%"===t.stack.type)),o=e.options.clip;return{defaultStack:t[0].stack,isStacked:i,isStacked100:s,clip:o}}groupSeriesByCategoryAxis(t){const e=[],i={};for(let s=0;s<t.length;s++){const o=t[s].categoryAxis||"$$default$$";we(i,o)||(i[o]=!0,e.push(o))}const s=[];for(let i=0;i<e.length;i++){const o=pl(t,e[i],i);0!==o.length&&s.push(o)}return s}createBarChart(t,e){if(0===t.length)return;const i=t[0],s=new la(this,Object.assign({series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing},this.stackableChartOptions(t,e)));this.appendChart(s,e)}createRangeBarChart(t,e){if(0===t.length)return;const i=t[0],s=new za(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(s,e)}createBulletChart(t,e){if(0===t.length)return;const i=t[0],s=new ba(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing,clip:e.options.clip});this.appendChart(s,e)}createLineChart(t,e){if(0===t.length)return;const i=new Zr(this,Object.assign({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(t,e)));this.appendChart(i,e)}createAreaChart(t,e){if(0===t.length)return;const i=new Jr(this,Object.assign({invertAxes:this.invertAxes,series:t},this.stackableChartOptions(t,e)));this.appendChart(i,e)}createRangeAreaChart(t,e){if(0===t.length)return;const i=new Wa(this,{invertAxes:this.invertAxes,series:t,clip:e.options.clip});this.appendChart(i,e)}createOHLCChart(t,e){if(0===t.length)return;const i=t[0],s=new Ya(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(s,e)}createCandlestickChart(t,e){if(0===t.length)return;const i=t[0],s=new ca(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(s,e)}createBoxPlotChart(t,e){if(0===t.length)return;const i=t[0],s=new pa(this,{invertAxes:this.invertAxes,gap:i.gap,series:t,spacing:i.spacing,clip:e.options.clip});this.appendChart(s,e)}createWaterfallChart(t,e){if(0===t.length)return;const i=t[0],s=new Za(this,{series:t,invertAxes:this.invertAxes,gap:i.gap,spacing:i.spacing});this.appendChart(s,e)}axisRequiresRounding(t,e){const i=Cr(this.series,_n);for(let t=0;t<this.series.length;t++){const e=this.series[t];if(Mt(e.type,hl)){const t=e.line;t&&t.style===jo&&i.push(e)}}for(let s=0;s<i.length;s++){const o=i[s].categoryAxis||"";if(o===t||!o&&0===e)return!0}}aggregatedAxis(t,e){const i=this.series;for(let s=0;s<i.length;s++){const o=i[s].categoryAxis||"";if((o===t||!o&&0===e)&&i[s].categoryField)return!0}}createCategoryAxesLabels(){const t=this.axes;for(let e=0;e<t.length;e++)t[e]instanceof Os&&t[e].createLabels()}createCategoryAxes(t){const e=this.invertAxes,i=[].concat(this.options.categoryAxis),s=[];for(let o=0;o<i.length;o++){let n=i[o];if(Mt(this.findPane(n.pane),t)){const{name:t,categories:r=[]}=n;let a;if(n=ut({vertical:e,reverse:!e&&this.chartService.rtl,axisCrossingValue:e?C:0},n),Ft(n.justified)||(n.justified=this.isJustified()),this.axisRequiresRounding(t,o)&&(n.justified=!1),Lr(n,r[0])?(n._forecast=this.trendlineAggregateForecast(),a=new Ws(n,this.chartService)):a=new Os(n,this.chartService),i[o].categories=a.options.srcCategories,t){if(this.namedCategoryAxes[t])throw new Error(`Category axis with name ${t} is already defined`);this.namedCategoryAxes[t]=a}a.axisIndex=o,s.push(a),this.appendAxis(a)}}const o=this.categoryAxis||s[0];this.categoryAxis=o,e?this.axisY=o:this.axisX=o}isJustified(){const t=this.series;for(let e=0;e<t.length;e++){if(!Mt(t[e].type,hl))return!1}return!0}createValueAxes(t){const e=this.valueAxisRangeTracker,i=e.query(),s=[].concat(this.options.valueAxis),o=this.invertAxes,n={vertical:!o,reverse:o&&this.chartService.rtl},r=[];this.stack100&&(n.roundToMajorUnit=!1,n.labels={format:"P0"});for(let o=0;o<s.length;o++){const a=s[o];if(Mt(this.findPane(a.pane),t)){const t=a.name,s=Ar(a.type,nr)?{min:.1,max:1}:{min:0,max:1},l=e.query(t)||i||s;let h;0===o&&l&&i&&(l.min=Math.min(l.min,i.min),l.max=Math.max(l.max,i.max)),h=Ar(a.type,nr)?to:$s;const c=new h(l.min,l.max,ut({},n,a),this.chartService);if(t){if(this.namedValueAxes[t])throw new Error(`Value axis with name ${t} is already defined`);this.namedValueAxes[t]=c}c.axisIndex=o,r.push(c),this.appendAxis(c)}}const a=this.valueAxis||r[0];this.valueAxis=a,o?this.axisX=a:this.axisY=a}_dispatchEvent(t,e,i){const s=t._eventCoordinates(e),o=new di(s.x,s.y),n=this.pointPane(o),r=[],a=[];if(!n)return;const l=n.axes;for(let t=0;t<l.length;t++){const e=l[t];e.getValue?vr(a,e.getValue(o)):vr(r,e.getCategory(o))}0===r.length&&vr(r,this.categoryAxis.getCategory(o)),r.length>0&&a.length>0&&t.trigger(i,{element:Gt(e),originalEvent:e,category:Ir(r),value:Ir(a)})}pointPane(t){const e=this.panes;for(let i=0;i<e.length;i++){const s=e[i];if(s.contentBox.containsPoint(t))return s}}updateAxisOptions(t,e){ul(this.options,t,e),ul(this.originalOptions,t,e)}_pointsByVertical(t,e=0){return this.invertAxes?this._siblingsBySeriesIndex(t.series.index,e):this._siblingsByPointIndex(t.getIndex())}_pointsByHorizontal(t,e=0){if(this.invertAxes)return this._siblingsByPointIndex(t.getIndex());const i=this._siblingsBySeriesIndex(t.series.index,e);return this.chartService.rtl?i.reverse():i}_siblingsByPointIndex(t){const e=this.charts,i=[];for(let s=0;s<e.length;s++){let o=e[s];if(o.pane&&"_navigator"===o.pane.options.name)continue;let n=o.points.filter((e=>e&&!1!==e.visible&&e.getIndex()===t));i.push(...n.sort(this._getSeriesCompareFn(n[0])))}return i}_siblingsBySeriesIndex(t,e){const i=lt(t+e,this.series.length);return this.pointsBySeriesIndex(i)}_getSeriesCompareFn(t){const e=this._isInStackedSeries(t);return e&&this.invertAxes||!e&&!this.invertAxes?(t,e)=>t.box.center().x-e.box.center().x:(t,e)=>t.box.center().y-e.box.center().y}_isInStackedSeries(t){const e=Mt(t.series.type,[Uo,fn,dn,bn,en,vn,cn,ln]),i=Mt(t.series.type,[Zo,Go]);return e||i&&t.options.isStacked}}function ul(t,e,i){ut([].concat(e instanceof Os?t.categoryAxis:t.valueAxis)[e.axisIndex],i)}function pl(t,e,i){return Ct(t,(function(t){return 0===i&&!t.categoryAxis||t.categoryAxis===e}))}te(dl,{categoryAxis:{},valueAxis:{}}),ut(dl.prototype,Ra);class gl extends e.a{constructor(){super(),this._points=[]}destroy(){this._points=[]}show(t,e){const i=[].concat(t);this.hide();for(let t=0;t<i.length;t++){const s=i[t];s&&s.toggleHighlight&&s.hasHighlight()&&(this.togglePointHighlight(s,!0,e),this._points.push(s))}}togglePointHighlight(t,e,i){const s=(t.options.highlight||{}).toggle;if(s){const o={category:t.category,series:t.series,dataItem:t.dataItem,value:t.value,stackValue:t.stackValue,preventDefault:ml,visual:t.highlightVisual(),show:e};s(o),o._defaultPrevented||t.toggleHighlight(e,i)}else t.toggleHighlight(e,i)}hide(){const t=this._points;for(;t.length;)this.togglePointHighlight(t.pop(),!1)}isHighlighted(t){const e=this._points;for(let i=0;i<e.length;i++){if(t===e[i])return!0}return!1}}function ml(){this._defaultPrevented=!0}function fl(t,e){const i=(e||"").toLowerCase(),s=t.event;return"none"===i&&!(s.ctrlKey||s.shiftKey||s.altKey)||s[i+"Key"]}function xl(t){const e={};for(let i=0;i<t.length;i++){const s=t[i];s.axis.options.name&&(e[s.axis.options.name]={min:s.range.min,max:s.range.max})}return e}class yl extends e.a{constructor(t,e){super(),this.plotArea=t,this.options=ut({},this.options,e)}start(t){return this._active=fl(t,this.options.key),this._active}move(t){if(this._active){const e=this.axisRanges=this._panAxes(t,W).concat(this._panAxes(t,X));if(e.length)return this.axisRanges=e,xl(e)}}end(){const t=this._active;return this._active=!1,t}pan(){const{plotArea:t,axisRanges:e}=this;if(e.length){for(let i=0;i<e.length;i++){const s=e[i];t.updateAxisOptions(s.axis,s.range)}t.redraw(t.panes)}}destroy(){delete this.plotArea}_panAxes(t,e){const i=this.plotArea,s=-t[e].delta,o=(this.options.lock||"").toLowerCase(),n=[];if(0!==s&&(o||"").toLowerCase()!==e){const t=i.axes;for(let i=0;i<t.length;i++){const o=t[i];if(e===W&&!o.options.vertical||e===X&&o.options.vertical){const t=o.pan(s);t&&(t.limitRange=!0,n.push({axis:o,range:t}))}}}return n}}yl.prototype.options={key:"none",lock:"none"};class vl extends e.a{constructor(t,e){super(),this.chart=t,this.options=ut({},this.options,e),this.createElement()}createElement(){const t=this._marquee=document.createElement("div");t.className="k-marquee";const e=document.createElement("div");e.className="k-marquee-color",t.appendChild(e)}removeElement(){this._marquee.parentNode&&this._marquee.parentNode.removeChild(this._marquee)}setStyles(t){xt(this._marquee,t)}start(t){if(fl(t,this.options.key)){const e=this.chart,i=e._eventCoordinates(t),s=this._zoomPane=e._plotArea.paneByPoint(i),o=s?s.chartsBox().clone():null;if(s&&o){const e=this._elementOffset();return o.translate(e.left,e.top),this._zoomPaneClipBox=o,document.body.appendChild(this._marquee),this.setStyles({left:t.pageX+1,top:t.pageY+1,width:0,height:0}),!0}}return!1}_elementOffset(){const t=this.chart.element,{paddingLeft:e,paddingTop:i}=xt(t,["paddingLeft","paddingTop"]),s=Nt(t);return{left:e+s.left,top:i+s.top}}move(t){this._zoomPane&&this.setStyles(this._selectionPosition(t))}end(t){if(this._zoomPane){const e=this._elementOffset(),i=this._selectionPosition(t);i.left-=e.left,i.top-=e.top;const s={x:i.left,y:i.top},o={x:i.left+i.width,y:i.top+i.height};return this._updateAxisRanges(s,o),this.removeElement(),delete this._zoomPane,xl(this.axisRanges)}}zoom(){const t=this.axisRanges;if(t&&t.length){const e=this.chart._plotArea;for(let i=0;i<t.length;i++){const s=t[i];e.updateAxisOptions(s.axis,s.range)}e.redraw(e.panes)}}destroy(){this.removeElement(),delete this._marquee,delete this.chart}_updateAxisRanges(t,e){const i=(this.options.lock||"").toLowerCase(),s=[],o=this._zoomPane.axes;for(let n=0;n<o.length;n++){const r=o[n],a=r.options.vertical;if((i!==W||a)&&(i!==X||!a)&&Ft(r.axisIndex)){const i=r.pointsRange(t,e);i&&s.push({axis:r,range:i})}}this.axisRanges=s}_selectionPosition(t){const e=this._zoomPaneClipBox,i={x:t.x.startLocation,y:t.y.startLocation},{x:{location:s},y:{location:o}}=t,n=(this.options.lock||"").toLowerCase();let r=Math.min(i.x,s),a=Math.min(i.y,o),l=Math.abs(i.x-s),h=Math.abs(i.y-o);return n===W&&(r=e.x1,l=e.width()),n===X&&(a=e.y1,h=e.height()),s>e.x2&&(l=e.x2-i.x),s<e.x1&&(l=i.x-e.x1),o>e.y2&&(h=e.y2-i.y),o<e.y1&&(h=i.y-e.y1),{left:Math.max(r,e.x1),top:Math.max(a,e.y1),width:l,height:h}}}vl.prototype.options={key:"shift",lock:"none"};class bl extends e.a{constructor(t,e){super(),this.chart=t,this.options=ut({rate:.3},this.options,e)}updateRanges(t,e){const i=(this.options.lock||"").toLowerCase(),s=[],o=this.chart._plotArea.axes;for(let n=0;n<o.length;n++){const r=o[n],a=r.options.vertical;if((i!==W||a)&&(i!==X||!a)&&r.zoomRange){const i=Yt(this.options.rate,.01,.9),o=r.zoomRange(-t*i,e);o&&s.push({axis:r,range:o})}}return this.axisRanges=s,xl(s)}zoom(){const t=this.axisRanges,e=this.chart._plotArea;if(t&&t.length&&e.updateAxisOptions){for(let i=0;i<t.length;i++){const s=t[i];e.updateAxisOptions(s.axis,s.range)}e.redraw(e.panes)}}destroy(){delete this.chart}}class wl extends yi{constructor(t,e){super(t),this.chartService=e}render(){const{children:t,options:i}=this,s=i.vertical;var o;this.visual=new e.k(null,{spacing:s?0:i.spacing,lineSpacing:s?i.spacing:0,orientation:s?Z:q,reverse:i.rtl,alignItems:s?(o=i.rtl,o?y:V):d});for(let e=0;e<t.length;e++){let i=t[e];i.reflow(new ui),i.renderVisual()}}reflow(t){this.visual.rect(t.toRect()),this.visual.reflow();const e=this.visual.clippedBBox();this.box=e?Vi(e):new ui}renderVisual(){this.addVisual()}createVisual(){}}const _l=10;class kl extends Pi{visualStyle(){const t=this.markerOptions(),e=t.border;return{stroke:{width:e.width,color:e.color,opacity:Kt(e.opacity,t.opacity),dashType:e.dashType},fill:{color:t.background,opacity:t.opacity},cursor:t.cursor}}markerOptions(){return this.options}markerHighlightOptions(){const t=this.markerOptions(),e=t.highlight.border.width;return ut({},t,{background:t.border.color},t.highlight,t.type===p?{background:t.highlight.border.color,border:{color:t.highlight.background,width:e/2},width:t.width,height:t.height,margin:{top:0,left:0}}:{})}createHighlight(){const t=new Pi(this.markerHighlightOptions()),e=this.paddingBox.clone();return t.reflow(e.pad(t.options.border.width)),this.highlight=[t.getElement()],this.highlight}}te(kl,{border:{width:2},width:8,height:8,background:U,margin:{top:-1,left:-1},vAlign:z,align:S,highlight:{width:_l,height:_l,border:{color:U,width:2}}});class Al extends Pi{getElement(){const t=new e.G,i=new e.h(this.visualStyle()),{paddingBox:s}=this,o=s.height()/2;return i.moveTo(s.x1,s.y1+o).lineTo(s.x1,s.y2).lineTo(s.x2,s.y2),t.append(i),t}}te(Al,{width:15,height:15,align:B,vAlign:c,margin:{right:-2,bottom:2}});class Sl extends Pi{getElement(){const t=new e.G,i=new e.h({stroke:{color:this.options.border.color,opacity:this.options.opacity,width:this.options.height,dashType:this.options.dashType}}),s=this.paddingBox,o=s.center().y;return i.moveTo(s.x1,o).lineTo(s.x2,o),t.append(i),t}createHighlight(){return this.highlight=[this.createHighlightLine(),this.createHighlightMarker()],this.highlight}createHighlightLine(){const t=ut({},{border:{color:this.options.border.color,opacity:this.options.border.opacity,dashType:this.options.border.dashType}},this.options.highlight),e=new Al(t);return e.reflow(this.parent.paddingBox.clone()),this.highlightLine=e.getElement(),this.highlightLine}createHighlightMarker(){const t=ut({},{background:this.options.background},this.options.highlight.markers),e=new Pi(t),i=this.parent.paddingBox,s=t.border.width,o=this.parent.box.clone();return o.pad({left:s-i.x1,top:s-i.y1}),e.reflow(o),this.highlightMarker=e.getElement(),this.highlightMarker}}te(Sl,{border:{width:0},type:N,align:S,vAlign:d,highlight:{border:{width:2},markers:{type:u,width:_l,height:_l,border:{width:2,color:U},align:S,vAlign:z}}});class Cl extends Pi{createHighlight(){const t=ut({},{background:this.options.background},this.options.highlight.markers),e=new Pi(t),i=this.paddingBox.clone(),s=this.parent.box.clone();return i.align(s,W,S),i.align(s,X,z),e.reflow(i),this.highlight=[e.getElement()],this.highlight}}te(Cl,{highlight:{markers:{type:u,width:_l,height:_l,border:{width:2,color:U},margin:{top:-3,left:-3}}}});class Tl extends Ci{constructor(t){super(t),this.createContainer(),t.rtl?(this.createLabel(),this.createMarker()):(this.createMarker(),this.createLabel()),this._id=Te(),this.options.accessibility.ariaChecked=t.active}createContainer(){this.container=new Ri({vertical:!1,wrap:!1,align:d,spacing:this.options.spacing}),this.append(this.container)}createMarker(){this.markerWrap=new Ci({vertical:!1,shrinkToFit:!0,wrap:!1,margin:1,width:22,height:22}),this.container.append(this.markerWrap),this.createMarkerArea(),this.options.markers.visible&&(this._marker=this._createMarker(),this.markerWrap.append(this._marker))}createMarkerArea(){const t=this.options,{markerColor:e,line:i={}}=t,s={border:{color:i.color||e,opacity:i.opacity,dashType:i.dashType}};return this._createLine(s)||this._createMarkerLine(s,i)||this._createSquare()}markerOptions(){const t=this.options,{markers:e={},markerColor:i}=t,{border:s={}}=e;return e.zIndex=void 0,ut({},e,{border:{color:s.color||i},highlight:t.highlight.markers})}_highlightOptions(){const t=this.options;return ut({markers:{type:t.markers.type}},t.highlight)}_createLine(t){const e=this.options;return e.type!==en||e.markers.visible||(this._line=new Sl(ut({},{background:e.markerColor,highlight:this._highlightOptions()},t,e.line)),this.markerWrap.append(this._line)),this._line}_createMarkerLine(t,e){return this.options.type===en&&(this._markerLineArea=new Al(ut({},{border:{width:e.height}},t)),this.markerWrap.append(this._markerLineArea)),this._markerLineArea}_reduceSize(t,e,i=.6){"number"==typeof t[e]&&(t[e]=t[e]*i)}_createSquare(){const t=this.options;if(t.type===Uo){let e=t.pattern||(t.series||{}).pattern;e&&("function"==typeof e&&(e=e(t.series)),e=Object.assign({},e),this._reduceSize(e,"gap"),this._reduceSize(e,"width"),this._reduceSize(e,"radius")),this._square=new Cl(Object.assign({},{border:t.border,vAlign:t.markers.visible?c:d,highlight:this._highlightOptions()},t.area,{pattern:e,background:t.area.background||t.markerColor})),this.markerWrap.append(this._square)}return this._square}_createMarker(){return new kl(this.markerOptions())}_highlightMarkers(){this.options.active&&this._toggleHighlight(!0)}_restoreMarkers(){this._toggleHighlight(!1)}_toggleHighlight(t){if(!this.options.highlight.visible)return;const e=this._marker||this._square||this._line;if(e&&e===this._line&&this._line.visual.visible(!t),e){let i=e.highlight;i||(i=e.createHighlight(),i.forEach((t=>t&&this.markerWrap.appendVisual(t)))),i.forEach((e=>e&&e.visible(t)))}}createLabel(){const t=this.options,e=ut({},t.labels);this.container.append(new zi(t.text,e))}getAriaLabelText(){return this.options.text}focusVisual(){this.visual.options.set("id",this._id),this.toggleFocusHighlight(!0),this._highlightMarkers()}clearFocusFromVisual(){this.visual.options.set("id",""),this.toggleFocusHighlight(!1),this._restoreMarkers()}renderComplete(){super.renderComplete();const t=this.options.cursor||{},i=this._itemOverlay=e.b.fromRect(this.container.box.toRect(),{fill:{color:U,opacity:0},stroke:null,cursor:t.style||t});this.appendVisual(i)}click(t,e){const i=this.eventArgs(e);!t.trigger(En,i)&&e&&"contextmenu"===e.type&&e.preventDefault()}over(t,e){const i=this.eventArgs(e);return t.trigger(Ln,i)||(t._legendItemHover(i.seriesIndex,i.pointIndex),this._highlightMarkers()),!0}out(t,e){t._unsetActivePoint(),this._restoreMarkers(),t.trigger(In,this.eventArgs(e))}eventArgs(t){const e=this.options;return{element:Gt(t),text:e.text,series:e.series,seriesIndex:e.series.index,pointIndex:e.pointIndex}}createVisual(){super.createVisual();const t=this.options;if(this.options.visible){const e=ut({ariaLabel:void 0!==t.accessibility.ariaLabel?t.accessibility.ariaLabel:t.text},t.accessibility);Ti(this.visual,e)}}renderVisual(){const t=this.options,e=t.visual;e?(this.visual=e({active:t.active,series:t.series,sender:this.getSender(),pointIndex:t.pointIndex,options:{type:t.type,markers:ut({background:this.options.markerColor},this.markerOptions()),labels:t.labels},createVisual:()=>{this.createVisual(),this.renderChildren(),this.renderComplete();const t=this.visual;return delete this.visual,t}}),this._marker=this._markerLineArea=this._square=this._line=null,this.addVisual()):super.renderVisual()}createFocusHighlight(t){const i=t.stroke.width;return e.b.fromRect(this.container.box.pad(i/2).toRect(),t)}}te(Tl,{accessibility:{role:ir,className:sr,ariaRoleDescription:or},markers:{},highlight:{visible:!0,markers:{}}});const Pl="custom";let Ml=class extends yi{constructor(t,e={}){super(t),this.chartService=e,Mt(this.options.position,[z,B,c,S,Pl])||(this.options.position=B),this.createContainers(),this.createLegendTitle(t.title),this.createItems()}createContainers(){const t=this.options,{position:e,align:i}=t;let s=e,o=d;e===Pl?s=S:Mt(e,[z,c])?(s=i===V?S:i===y?B:d,o=e):i&&(i===V?o=z:i===y&&(o=c)),this.container=new Ci({margin:t.margin,padding:t.padding,background:t.background,border:t.border,vAlign:o,align:s,zIndex:t.zIndex,shrinkToFit:!0}),this.hasTitle()?this.itemsContainer=new Ci({vAlign:o,align:s,zIndex:t.zIndex,shrinkToFit:!0}):this.itemsContainer=this.container,this.append(this.container)}createItems(){const t=this.getService(),e=this.options,i=this.isVertical(),s=new wl({vertical:i,spacing:e.spacing,rtl:t.rtl},t);let o=e.data;e.reverse&&(o=o.slice(0).reverse());const n=o.length;for(let i=0;i<n;i++){let n=o[i];const{markers:r={},dashType:a,legendItem:l,opacity:h}=n.series||{},c=ut({visible:!1!==r.visible,type:u},r);delete c.size;const d=ut({},{markers:c,labels:e.labels,rtl:t.rtl,line:Object.assign({},{dashType:a},e.line),area:Object.assign({},{opacity:h},e.area),opacity:h,accessibility:e.accessibility,focusHighlight:e.focusHighlight},e.item,l,n,{markers:e.markers});s.append(new Tl(d))}s.render(),this.itemsContainer.append(s)}isVertical(){const{orientation:t,position:e}=this.options;return e===Pl&&t!==q||(Ft(t)?t!==q:Mt(e,[S,B]))}hasItems(){return this.container.children[0].children.length>0}getItems(){return this.itemsContainer.children[0].children}reflow(t){const e=this.options,i=t.clone();this.hasItems()?(e.position===Pl?(this.containerCustomReflow(i),this.box=i):this.containerReflow(i),this.hasTitle()&&this.title.reflow(new ui(this.container.box.x1,this.title.box.y1,this.container.box.x2,this.title.box.y2))):this.box=i}containerReflow(t){const{options:e,container:i}=this,{position:s,width:o,height:n}=e,r=s===z||s===c?W:X,a=this.isVertical(),l=t.clone();let h=t.clone();s!==S&&s!==B||(h.y1=l.y1=0),a&&n?(h.y2=h.y1+n,h.align(l,X,i.options.vAlign)):!a&&o&&(h.x2=h.x1+o,h.align(l,W,i.options.align)),i.reflow(h),h=i.box;const d=h.clone();(e.offsetX||e.offsetY)&&(h.translate(e.offsetX,e.offsetY),i.reflow(h)),d[r+1]=t[r+1],d[r+2]=t[r+2],this.box=d}containerCustomReflow(t){const{options:e,container:i}=this,{offsetX:s,offsetY:o,width:n,height:r}=e,a=this.isVertical();let l=t.clone();a&&r?l.y2=l.y1+r:!a&&n&&(l.x2=l.x1+n),i.reflow(l),l=i.box,i.reflow(new ui(s,o,s+l.width(),o+l.height()))}renderVisual(){this.hasItems()&&super.renderVisual()}createLegendTitle(t){let e=ut({},{color:h,position:z,align:d},t),i=e.text;if(t&&!1!==t.visible&&t.text){if(Ft(e)&&e.visible){const t=wt(e);t?i=t({text:i}):e.format&&(i=this.chartService.format.auto(e.format,i))}this.title=new zi(i,e),this.createTitleLayout(),this.appendTitleLayoutContent()}}createTitleLayout(){this.layout=new Ri({vertical:!0,wrap:!1}),this.container.append(this.layout)}hasTitle(){return Boolean(this.options.title&&!1!==this.options.title.visible&&this.options.title.text)}appendTitleLayoutContent(){this.options.title.position===c?(this.layout.append(this.itemsContainer),this.layout.append(this.title)):(this.layout.append(this.title),this.layout.append(this.itemsContainer))}};te(Ml,{position:B,data:[],offsetX:0,offsetY:0,margin:yt(2),padding:yt(5),border:{color:h,width:0},item:{cursor:Y,spacing:6},spacing:6,background:"",zIndex:1,markers:{},line:{width:20,height:2,cursor:Y,opacity:1},area:{type:H,align:B,width:15,height:15}});class El extends e.a{constructor(){super(),this._registry=[]}register(t,e){this._registry.push({type:t,seriesTypes:e})}create(t,e,i){const s=this._registry;let o,n=s[0];for(let e=0;e<s.length;e++){const i=s[e];o=Cr(t,i.seriesTypes);const r=Cr(t,Mn);if(o.length-r.length>0){n=i;break}}return new n.type(o,e,i)}}El.current=new El;function Ll(t){const e=document.createElement("div");return t&&(e.className=t),e}function Il(t){let e=t;for(;e&&!Tt(e,"k-handle");)e=e.parentNode;return e}class Rl extends e.a{constructor(t,e,i,s){super();const o=t.element;this.options=ut({},this.options,i),this.chart=t,this.observer=s,this.chartElement=o,this.categoryAxis=e,this._dateAxis=this.categoryAxis instanceof Ws,this.initOptions(),this.visible=this.options.visible&&o.offsetHeight,this.visible&&(this.createElements(),this.set(this._index(this.options.from),this._index(this.options.to)),this.bindEvents())}onPane(t){return this.categoryAxis.pane===t}createElements(){const t=this.options,e=this.wrapper=Ll("k-selector k-pointer-events-none");xt(e,{top:t.offset.top,left:t.offset.left,width:t.width,height:t.height,direction:"ltr"});const i=this.selection=Ll("k-selection k-pointer-events-none");this.leftMask=Ll("k-mask k-pointer-events-none"),this.rightMask=Ll("k-mask k-pointer-events-none"),e.appendChild(this.leftMask),e.appendChild(this.rightMask),e.appendChild(i);const s=this.body=Ll("k-selection-bg k-pointer-events-none");i.appendChild(s);const o=this.leftHandle=Ll("k-handle k-left-handle k-pointer-events-auto"),n=this.rightHandle=Ll("k-handle k-right-handle k-pointer-events-auto");o.appendChild(Ll()),n.appendChild(Ll()),i.appendChild(o),i.appendChild(n),this.chartElement.appendChild(e);const r=xt(i,["borderLeftWidth","borderRightWidth","height"]),a=xt(o,"height").height,l=xt(n,"height").height;t.selection={border:{left:r.borderLeftWidth,right:r.borderRightWidth}},xt(o,{top:(r.height-a)/2}),xt(n,{top:(r.height-l)/2}),e.style.cssText=e.style.cssText}bindEvents(){!1!==this.options.mousewheel&&(this._mousewheelHandler=this._mousewheel.bind(this),zt(this.chartElement,{[cr]:this._mousewheelHandler})),this._domEvents=$i.create(this.chartElement,{stopPropagation:!0,start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),press:this._press.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)})}initOptions(){const{options:t,categoryAxis:e}=this,i=e.pane.chartsBox(),s=this.chart.chartService.intl;this._dateAxis&&ut(t,{min:Is(s,t.min),max:Is(s,t.max),from:Is(s,t.from),to:Is(s,t.to)});const{paddingLeft:o,paddingTop:n}=xt(this.chartElement,["paddingLeft","paddingTop"]);this.options=ut({},{width:i.width(),height:i.height()+.1,padding:{left:o,top:n},offset:{left:i.x1+o,top:i.y1+n},from:t.min,to:t.max},t)}destroy(){this._domEvents&&(this._domEvents.destroy(),delete this._domEvents),clearTimeout(this._mwTimeout),this._state=null,this.wrapper&&(this._mousewheelHandler&&(Qt(this.chartElement,{[cr]:this._mousewheelHandler}),this._mousewheelHandler=null),this.chartElement.removeChild(this.wrapper),this.wrapper=null)}_rangeEventArgs(t){return{axis:this.categoryAxis.options,from:this._value(t.from),to:this._value(t.to)}}_pointInPane(t,e){const i=this.categoryAxis.pane.box,s=this.chart._toModelCoordinates(t,e);return i.containsPoint(s)}_start(t){const e=this.options,i=Gt(t);if(this._state||!i)return;const s=Ut(t);if(!this._pointInPane(s.x,s.y))return;const o=Il(i),n=this.body.getBoundingClientRect(),r=!o&&s.x>=n.x&&s.x<=n.x+n.width&&s.y>=n.y&&s.y<=n.y+n.height;this.chart._unsetActivePoint(),this._state={moveTarget:o,startLocation:t.x?t.x.location:0,inBody:r,range:{from:this._index(e.from),to:this._index(e.to)}};const a=this._rangeEventArgs({from:this._index(e.from),to:this._index(e.to)});this.trigger(Xn,a)&&(this._state=null)}_press(t){let e;e=this._state?this._state.moveTarget:Il(Gt(t)),e&&K(e,"k-handle-active")}_move(t){if(!this._state)return;const{_state:e,options:i,categoryAxis:s}=this,{range:o,moveTarget:n}=e,r=s.options.reverse,a=this._index(i.from),l=this._index(i.to),h=this._index(i.min),c=this._index(i.max),d=e.startLocation-t.x.location,u=o.from,p=o.to,g=o.to-o.from,m=xt(this.wrapper,"width").width/(s.categoriesCount()-1),f=Math.round(d/m)*(r?-1:1);if(!n&&!e.inBody)return;const x=n&&Tt(n,"k-left-handle"),y=n&&Tt(n,"k-right-handle");e.inBody?(o.from=Math.min(Math.max(h,a-f),c-g),o.to=Math.min(o.from+g,c)):x&&!r||y&&r?(o.from=Math.min(Math.max(h,a-f),c-1),o.to=Math.max(o.from+1,o.to)):(x&&r||y&&!r)&&(o.to=Math.min(Math.max(h+1,l-f),c),o.from=Math.min(o.to-1,o.from)),o.from===u&&o.to===p||(this.move(o.from,o.to),this.trigger(Yn,this._rangeEventArgs(o)))}_end(){if(this._state){const t=this._state.moveTarget;t&&tt(t,"k-handle-active");const e=this._state.range;this.set(e.from,e.to),this.trigger(qn,this._rangeEventArgs(e)),delete this._state}}_tap(t){const{options:e,categoryAxis:i}=this,s=this.chart._eventCoordinates(t),o=i.pointCategoryIndex(new di(s.x,i.box.y1)),n=this._index(e.from),r=this._index(e.to),a=this._index(e.min),l=this._index(e.max),h=r-n,c=n+h/2,d={},u=3===t.event.which;let p=Math.round(c-o);this._state||u||(this.chart._unsetActivePoint(),i.options.justified||p--,d.from=Math.min(Math.max(a,n-p),l-h),d.to=Math.min(d.from+h,l),this._start(t),this._state&&(this._state.range=d,this.trigger(Yn,this._rangeEventArgs(d)),this._end()))}_mousewheel(t){let e=Vt(t);if(this._start(t),this._state){const i=this._state.range;t.preventDefault(),t.stopPropagation(),Math.abs(e)>1&&(e*=3),this.options.mousewheel.reverse&&(e*=-1),this.expand(e)&&this.trigger(Yn,{axis:this.categoryAxis.options,delta:e,originalEvent:t,from:this._value(i.from),to:this._value(i.to)}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout((()=>{this._end()}),dr)}}_gesturestart(t){const e=this.options,i=t.touches[0];if(!this._pointInPane(i.pageX,i.pageY))return;this._state={range:{from:this._index(e.from),to:this._index(e.to)}};const s=this._rangeEventArgs(this._state.range);this.trigger(Xn,s)?this._state=null:t.preventDefault()}_gestureend(){this._state&&(this.trigger(qn,this._rangeEventArgs(this._state.range)),delete this._state)}_gesturechange(t){if(!this._state)return;const{chart:e,_state:i,options:s,categoryAxis:o}=this,n=i.range,r=e._toModelCoordinates(t.touches[0].x.location).x,a=e._toModelCoordinates(t.touches[1].x.location).x,l=Math.min(r,a),h=Math.max(r,a);t.preventDefault(),n.from=o.pointCategoryIndex(new di(l))||s.min,n.to=o.pointCategoryIndex(new di(h))||s.max,this.move(n.from,n.to),this.trigger(Yn,this._rangeEventArgs(n))}_index(t){let e=t;return t instanceof Date&&(e=this.categoryAxis.categoryIndex(t)),e}_value(t){let e=t;return this._dateAxis&&(e=this.categoryAxis.categoryAt(t),e>this.options.max&&(e=this.options.max)),e}_slot(t){const e=this.categoryAxis,i=this._index(t);return e.getSlot(i,i,!0)}move(t,e){const i=this.options,s=this.categoryAxis.options.reverse,{offset:o,padding:n,selection:{border:r}}=i,a=s?e:t,l=s?t:e,h="x"+(s?2:1);let c=this._slot(a);const d=$t(c[h]-o.left+n.left);xt(this.leftMask,{width:d}),xt(this.selection,{left:d}),c=this._slot(l);const u=$t(i.width-(c[h]-o.left+n.left));xt(this.rightMask,{width:u});let p=i.width-u;p!==i.width&&(p+=r.right),xt(this.rightMask,{left:p}),xt(this.selection,{width:Math.max(i.width-(d+u)-r.right,0)})}set(t,e){const i=this.options,s=this._index(i.min),o=this._index(i.max),n=Yt(this._index(t),s,o),r=Yt(this._index(e),n+1,o);i.visible&&this.move(n,r),i.from=this._value(n),i.to=this._value(r)}expand(t){const e=this.options,i=this._index(e.min),s=this._index(e.max),o=e.mousewheel.zoom,n=this._index(e.from),r=this._index(e.to);let a={from:n,to:r};const l=ut({},a);if(this._state&&(a=this._state.range),o!==B&&(a.from=Yt(Yt(n-t,0,r-1),i,s)),o!==S&&(a.to=Yt(Yt(r+t,a.from+1,s),i,s)),a.from!==l.from||a.to!==l.to)return this.set(a.from,a.to),!0}zoom(t,e){const i=this.options,s=this._index(i.min),o=this._index(i.max),n=this._index(i.from),r=this._index(i.to);let a={from:n,to:r};const l=ut({},a),{reverse:h}=this.categoryAxis.options,c=W+(h?"2":"1"),d=this.categoryAxis.lineBox(),u=Math.abs(d[c]-e[W]),p=d.width(),g=$t(u/p,2),m=$t(g*t),f=$t((1-g)*t);if(this._state&&(a=this._state.range),a.from=Yt(Yt(n-m,0,r-1),s,o),a.to=Yt(Yt(r+f,a.from+1,o),s,o),a.from!==l.from||a.to!==l.to)return this.set(a.from,a.to),!0}trigger(t,e){return(this.observer||this.chart).trigger(t,e)}}te(Rl,{visible:!0,mousewheel:{zoom:"both"},min:T,max:C});let Bl=class extends wa{show(t){if(!t||!t.tooltipAnchor||this._current&&this._current===t)return;const e=ut({},this.options,t.options.tooltip),i=t.tooltipAnchor();i?(this._current=t,super.show({point:t,anchor:i},e,t)):this.hide()}hide(){delete this._current,super.hide()}},Ol=class extends wa{constructor(t,e){super(t.chartService,e),this.plotArea=t,this.formatService=t.chartService.format}showAt(t,e){const i=Ct(t,(function(t){const e=t.series.tooltip;return!(e&&!1===e.visible)}));if(i.length>0){const s=i[0],o=this.plotArea.categoryAxis.getSlot(s.categoryIx),n=e?this._slotAnchor(e,o):this._defaultAnchor(s,o);this.show({anchor:n,shared:!0,points:t,category:s.category,categoryText:this.formatService.auto(this.options.categoryFormat,s.category),series:this.plotArea.series},this.options)}}_slotAnchor(t,e){return this.plotArea.categoryAxis.options.vertical||(t.x=e.center().x),{point:t,align:{horizontal:"left",vertical:"center"}}}_defaultAnchor(t,e){const i=t.owner.pane.chartsBox(),s=this.plotArea.categoryAxis.options.vertical,o=i.center(),n=e.center();let r;return r=s?new di(o.x,n.y):new di(n.x,o.y),{point:r,align:{horizontal:"center",vertical:"center"}}}};te(Ol,{categoryFormat:"{0:d}"});class Vl extends e.c{setup(){const{element:t,options:i}=this;if(t.bbox()){this.origin=i.origin;const s=i.vertical?X:W,o=this.fromScale=new e.P(1,1);o[s]=Mo,t.transform(e.t().scale(o.x,o.y))}else this.abort()}step(t){const i=Et(this.fromScale.x,1,t),s=Et(this.fromScale.y,1,t);this.element.transform(e.t().scale(i,s,this.origin))}abort(){super.abort(),this.element.transform(null)}}te(Vl,{duration:Co}),e.j.current.register(Go,Vl);class Dl extends e.c{setup(){const t=this.center=this.element.bbox().center();this.element.transform(e.t().scale(Mo,Mo,t))}step(t){this.element.transform(e.t().scale(t,t,this.center))}}te(Dl,{easing:"easeOutElastic"}),e.j.current.register(Xo,Dl);class zl extends e.c{setup(){this.fadeTo=this.element.opacity(),this.element.opacity(0)}step(t){this.element.opacity(t*this.fadeTo)}}te(zl,{duration:200,easing:"linear"}),e.j.current.register(To,zl);class Fl extends e.c{setup(){this.element.transform(e.t().scale(Mo,Mo,this.options.center))}step(t){this.element.transform(e.t().scale(t,t,this.options.center))}}te(Fl,{easing:"easeOutElastic",duration:Co}),e.j.current.register(on,Fl);class Hl extends ma{render(){super.render(),this.renderSegments()}createSegment(t,e,i){let s;return s=e.style===No?Wr:Nr,new s(t,e,i)}animationPoints(){return super.animationPoints().concat(this._segments)}createMissingValue(t,e){if(e===Vo){const e={x:t.x,y:t.y};return Er(e.x)||(e.x=0),Er(e.y)||(e.y=0),e}}}function Nl(t,e,i){const s=[];let{xMin:o,xMax:n}=e;const r=(i||{}).forecast;r&&(r.before>0&&(o-=r.before),r.after>0&&(n+=r.after));const a=(i||{}).samplingInterval;let l=Kt(a,ci(o,n)/10);a<=0&&(l=n-o);for(let e=o;e<=n;e+=l)s.push([e,t(e)]);return s}ut(Hl.prototype,Xr);const jl=t=>({valueFields:e})=>({xValue:e.x,yValue:Math.log(e[t])});const Ul=t=>({valueFields:e})=>({xValue:e.x,yValue:e[t]});function Gl(t,e){let i=Number.MAX_VALUE,s=Number.MIN_VALUE;for(let o=0;o<t.length;o++){const n=t[o],{xValue:r,yValue:a}=e(n);isFinite(r)&&null!==r&&isFinite(a)&&null!==a&&(i=Math.min(r,i),s=Math.max(r,s))}return{xMin:i,xMax:s}}const Wl=t=>({valueFields:e})=>({xValue:e.x,yValue:e[t]}),Xl=t=>({valueFields:e})=>({xValue:Math.log(e.x),yValue:e[t]});const Yl=t=>({valueFields:e})=>({xValue:Math.log(e.x),yValue:Math.log(e[t])});const ql={};ql[kn]=function(t){const{options:e,seriesValues:i}=t,s=function({seriesValues:t,options:e}){const i=t();if(!Ka(i,e.field))return null;let{slope:s,intercept:o,count:n,xMin:r,xMax:a}=Qa(i,jl(e.field));const l={xMin:r,xMax:a};if(n>0){const t=Math.exp(o),i=s;return Nl((e=>t*Math.exp(i*e)),l,e.trendline)}return null}({seriesValues:i,options:e});return s?Object.assign({},e,{type:"scatterLine",data:s}):null},ql[An]=function(t){const{options:e,seriesValues:i}=t,s=function({seriesValues:t,options:e}){let{slope:i,intercept:s,count:o,xMin:n,xMax:r}=Qa(t(),Ul(e.field));const a={xMin:n,xMax:r};if(o>0)return Nl((t=>i*t+s),a,e.trendline);return null}({seriesValues:i,options:e});return s?Object.assign({},e,{type:"scatterLine",data:s}):null},ql[Sn]=function(t){const{options:e,seriesValues:i}=t,s=function({seriesValues:t,options:e}){const i=t();if(!Ka(i,"x"))return null;let{slope:s,intercept:o,count:n}=Qa(i,Xl(e.field)),r=Gl(i,Wl(e.field));if(n>0){const t=s,i=o;return Nl((e=>t*Math.log(e)+i),r,e.trendline)}return null}({seriesValues:i,options:e});return s?Object.assign({},e,{type:"scatterLine",data:s}):null},ql[Cn]=function(t){const{options:e}=t,i=function({options:t,seriesValues:e}){const i=(t.trendline||{}).period||2,s=sl(e({before:i,after:i}),Ul(t.field),i);if(s.length>0)return s;return null}(t);return i?Object.assign({},e,{type:"scatterLine",data:i}):null},ql[Tn]=function(t){const{options:e,seriesValues:i}=t,s=function({seriesValues:t,options:e}){const i=(e.trendline||{}).order,s=Ul(e.field),{count:o,valueMapper:n,xMin:r,xMax:a}=nl(t(),s,i),l={xMin:r,xMax:a};if(o>0)return Nl(n,l,e.trendline);return null}({seriesValues:i,options:e});return s?Object.assign({},e,{type:"scatterLine",data:s}):null},ql[Pn]=function(t){const{options:e,seriesValues:i}=t,s=function({seriesValues:t,options:e}){const i=t();if(!Ka(i,"x"))return null;let{slope:s,intercept:o,count:n}=Qa(i,Yl(e.field)),r=Gl(i,Ul(e.field));if(n>0){const t=Math.exp(o),i=s;return Nl((e=>t*Math.pow(e,i)),r,e.trendline)}return null}({seriesValues:i,options:e});return s?Object.assign({},e,{type:"scatterLine",data:s}):null};class Zl extends Pa{initFields(){this.namedXAxes={},this.namedYAxes={},this.xAxisRangeTracker=new ta,this.yAxisRangeTracker=new ta}render(t=this.panes){this.series=[...this.originalSeries],this.createTrendlineSeries();const e=this.groupSeriesByPane();for(let i=0;i<t.length;i++){const s=t[i],o=e[s.options.name||"default"]||[];this.addToLegend(o);const n=this.filterVisibleSeries(o);n&&(this.createScatterChart(Cr(n,gn),s),this.createScatterLineChart(Cr(n,mn),s),this.createBubbleChart(Cr(n,Xo),s))}this.createAxes(t)}appendChart(t,e){this.xAxisRangeTracker.update(t.xAxisRanges),this.yAxisRangeTracker.update(t.yAxisRanges),super.appendChart(t,e)}removeAxis(t){const e=t.options.name;super.removeAxis(t),t.options.vertical?(this.yAxisRangeTracker.reset(e),delete this.namedYAxes[e]):(this.xAxisRangeTracker.reset(e),delete this.namedXAxes[e]),t===this.axisX&&delete this.axisX,t===this.axisY&&delete this.axisY}seriesPaneName(t){const e=this.options,i=t.xAxis,s=Ct([].concat(e.xAxis),(function(t){return t.name===i}))[0],o=t.yAxis,n=Ct([].concat(e.yAxis),(function(t){return t.name===o}))[0],r=(e.panes||[{}])[0].name||"default";return(s||{}).pane||(n||{}).pane||r}createScatterChart(t,e){t.length>0&&this.appendChart(new ma(this,{series:t,clip:e.options.clip}),e)}createScatterLineChart(t,e){t.length>0&&this.appendChart(new Hl(this,{series:t,clip:e.options.clip}),e)}createBubbleChart(t,e){t.length>0&&this.appendChart(new xa(this,{series:t,clip:e.options.clip}),e)}createXYAxis(t,e,i){const s=t.name,o=e?this.namedYAxes:this.namedXAxes,n=e?this.yAxisRangeTracker:this.xAxisRangeTracker,r=ut({reverse:!e&&this.chartService.rtl},t,{vertical:e}),a=Ar(r.type,nr),l=n.query(),h=a?{min:.1,max:1}:{min:0,max:1},c=n.query(s)||l||h,d=[r.min,r.max],u=this.series;for(let t=0;t<u.length;t++){const s=u[t],o=s[e?"yAxis":"xAxis"];if(o===r.name||0===i&&!o){const t=wo.current.bindPoint(s,0).valueFields;d.push(t[e?"y":"x"]);break}}let p,m;0===i&&l&&(c.min=Math.min(c.min,l.min),c.max=Math.max(c.max,l.max));for(let t=0;t<d.length;t++)if(d[t]instanceof Date){p=!0;break}m=Ar(r.type,g)||!r.type&&p?Ks:a?to:$s;const f=new m(c.min,c.max,r,this.chartService);if(f.axisIndex=i,s){if(o[s])throw new Error(`${e?"Y":"X"} axis with name ${s} is already defined`);o[s]=f}return this.appendAxis(f),f}createAxes(t){const e=this.options,i=[].concat(e.xAxis),s=[],o=[].concat(e.yAxis),n=[];for(let e=0;e<i.length;e++){Mt(this.findPane(i[e].pane),t)&&s.push(this.createXYAxis(i[e],!1,e))}for(let e=0;e<o.length;e++){Mt(this.findPane(o[e].pane),t)&&n.push(this.createXYAxis(o[e],!0,e))}this.axisX=this.axisX||s[0],this.axisY=this.axisY||n[0]}_dispatchEvent(t,e,i){const s=t._eventCoordinates(e),o=new di(s.x,s.y),n=this.axes,r=n.length,a=[],l=[];for(let t=0;t<r;t++){const e=n[t],i=e.options.vertical?l:a,s=e.getValue(o);null!==s&&i.push(s)}a.length>0&&l.length>0&&t.trigger(i,{element:Gt(e),originalEvent:e,x:Ir(a),y:Ir(l)})}updateAxisOptions(t,e){const i=t.options.vertical,s=this.groupAxes(this.panes),o=(i?s.y:s.x).indexOf(t);$l(this.options,o,i,e),$l(this.originalOptions,o,i,e)}trendlineFactory(t,e){const i=this.seriesValues.bind(this,e.index),s=$a(ql,t.type,{options:t,seriesValues:i});return s&&(s.xAxis=e.xAxis,s.yAxis=e.yAxis),s}seriesValues(t){const e=[],i=this.series[t];for(let t=0;t<i.data.length;t++){const s=this.bindPoint(i,t);e.push({pointIx:t,valueFields:s.valueFields})}return e}}function $l(t,e,i,s){ut([].concat(i?t.yAxis:t.xAxis)[e],s)}te(Zl,{xAxis:{},yAxis:{}}),ut(Zl.prototype,Ra);class Ql extends yi{constructor(t,e,i){super(i),this.value=t,this.sector=e}render(){this._rendered||!1===this.visible||(this._rendered=!0,this.createLabel())}createLabel(){const t=this.options.labels,e=this.owner.chartService;let i=this.getLabelText(t);if(t.visible&&(i||0===i)){if(t.position===d||t.position===ar)t.color||(t.color=ge(this.options.color)),t.background||(t.background=this.options.color);else{const i=e.theme.seriesDefaults.labels;t.color=t.color||i.color,t.background=t.background||i.background}this.label=new zi(i,ut({},t,{align:d,vAlign:"",animation:{type:To,delay:this.animationDelay}}),this.pointData()),this.append(this.label)}}getLabelText(t){let e=wt(t);return e?e(this.pointData()):this.owner.chartService.format.auto(t.format,this.value)}reflow(t){this.render(),this.box=t,this.reflowLabel()}reflowLabel(){const{options:{labels:t},label:e}=this,i=this.sector.clone(),s=t.distance,o=i.middle();if(e){const n=e.box.height(),r=e.box.width();let a;if(t.position===d)i.radius=Math.abs((i.radius-n)/2)+n,a=i.point(o),e.reflow(new ui(a.x,a.y-n/2,a.x,a.y));else if(t.position===ar)i.radius=i.radius-n/2,a=i.point(o),e.reflow(new ui(a.x,a.y-n/2,a.x,a.y));else{let t;a=i.clone().expand(s).point(o),a.x>=i.center.x?(t=a.x+r,e.orientation=B):(t=a.x-r,e.orientation=S),e.reflow(new ui(t,a.y-n,a.x,a.y))}}}createVisual(){const{sector:t,options:i}=this;if(super.createVisual(),this.addAccessibilityAttributesToVisual(),this.value)if(i.visual){const s=(t.startAngle+180)%360,o=i.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,center:new e.P(t.center.x,t.center.y),radius:t.radius,innerRadius:t.innerRadius,startAngle:s,endAngle:s+t.angle,options:i,sender:this.getSender(),createVisual:()=>{const t=new e.G;return this.createSegmentVisual(t),t}});o&&this.visual.append(o)}else this.createSegmentVisual(this.visual)}createSegmentVisual(t){const{sector:e,options:i}=this,s=i.border||{},o=s.width>0?{stroke:{color:s.color,width:s.width,opacity:s.opacity,dashType:s.dashType}}:{},n=i.color,r=Si(i.pattern,{color:n,opacity:i.opacity}),a=this.createSegment(e,ut({fill:r,stroke:{opacity:i.opacity},zIndex:i.zIndex},o));t.append(a),Mr(i)&&t.append(this.createGradientOverlay(a,{baseColor:n,fallbackFill:r},ut({center:[e.center.x,e.center.y],innerRadius:e.innerRadius,radius:e.radius,userSpace:!0},i.overlay)))}createSegment(t,i){return i.singleSegment?new e.f(new e.g(new e.P(t.center.x,t.center.y),t.radius),i):xi.current.createRing(t,i)}createAnimation(){const{options:t,sector:{center:e}}=this;ut(t,{animation:{center:[e.x,e.y],delay:this.animationDelay}}),super.createAnimation()}createHighlight(t){const e=this.options.highlight||{},i=e.border||{};return this.createSegment(this.sector,ut({},t,{fill:{color:e.color,opacity:e.opacity},stroke:{opacity:i.opacity,width:i.width,color:i.color}}))}highlightVisual(){return this.visual.children[0]}highlightVisualArgs(){const t=this.sector;return{options:this.options,radius:t.radius,innerRadius:t.innerRadius,center:new e.P(t.center.x,t.center.y),startAngle:t.startAngle,endAngle:t.angle+t.startAngle,visual:this.visual}}createFocusHighlight(t){const i=this.options.focusHighlight.border.width,s=this.createSegment(this.sector,ut({},t,{stroke:{width:2*i}})),o=new e.h;return o.paths.push(e.b.fromRect(s.bbox())),o.paths.push(this.createSegment(this.sector,{})),s.clip(o),s}tooltipAnchor(){const t=this.sector.clone().expand(5),e=t.middle();return{point:t.point(e),align:th(e+180)}}formatValue(t){return this.owner.formatPointValue(this,t)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}}getIndex(){return this.index}}const Kl=$t(Zt(30),f),Jl=$t(Zt(60),f);function th(t){const e=Zt(t),i=$t(Math.sin(e),f),s=$t(Math.cos(e),f);let o,n;return o=Math.abs(i)>Jl?d:s<0?B:S,n=Math.abs(i)<Kl?d:i<0?c:z,{horizontal:o,vertical:n}}te(Ql,{color:U,overlay:{gradient:"roundedBevel"},border:{width:.5},labels:{visible:!1,distance:35,font:m,margin:yt(.5),align:u,zIndex:1,position:hr},animation:{type:on},highlight:{visible:!0,border:{width:1}},visible:!0,accessibility:{role:Jn,className:tr,ariaRoleDescription:er}}),ut(Ql.prototype,zr),ut(Ql.prototype,ia);const eh={createLegendItem:function(t,e,i){const s=this.options.legend||{},o=s.labels||{},n=s.inactiveItems||{},r=n.labels||{};if(i&&!1!==i.visibleInLegend){const s=!1!==i.visible,a=s?wt(o):wt(r)||wt(o);let l,h,c=i.category;a&&(c=a({text:c,series:i.series,dataItem:i.dataItem,percentage:i.percentage,value:t})),s?(l={},h=e.color):(l={color:r.color,font:r.font},h=(n.markers||{}).color),Er(c)&&""!==c&&this.legendItems.push({active:s,pointIndex:i.index,text:c,series:i.series,markerColor:h,pattern:e.pattern,labels:l})}}};class ih extends yi{constructor(t,e){super(e),this.plotArea=t,this.chartService=t.chartService,this.points=[],this.legendItems=[],this.render()}render(){this.traverseDataPoints(this.addValue.bind(this))}traverseDataPoints(t){const{options:e,plotArea:{options:{seriesColors:i=[]}}}=this,s=i.length,o=e.series,n=o.length;for(let r=0;r<n;r++){const a=o[r],l=a.data,{total:h,points:c,count:u}=_r(a),p=360/h;let g,m;isFinite(p)||(g=360/u),m=Ft(a.startAngle)?a.startAngle:e.startAngle,r!==n-1&&a.labels.position===hr&&(a.labels.position=d);for(let e=0;e<c.length;e++){const o=c[e];if(!o)continue;const{fields:d,value:u,visible:f}=o,x=0!==u?g||u*p:0,y=1!==l.length&&Boolean(d.explode);ht(a.color)||(a.color=d.color||i[e%s]),t(u,new gi(null,0,0,m,x),{owner:this,category:Ft(d.category)?d.category:"",pattern:Ft(d.pattern)?d.pattern:a.pattern,index:e,series:a,seriesIx:r,dataItem:l[e],percentage:0!==h?u/h:0,explode:y,visibleInLegend:d.visibleInLegend,visible:f,zIndex:n-r,animationDelay:this.animationDelay(e,r,n)}),!1!==f&&(m+=x)}}}evalSegmentOptions(t,e,i){const s=i.series;Sr(t,{value:e,series:s,dataItem:i.dataItem,category:i.category,percentage:i.percentage},{defaults:s._defaults,excluded:["data","content","template","visual","toggle","ariaTemplate","ariaContent"]})}addValue(t,e,i){const s=ut({},i.series,{index:i.index});if(s.pattern=i.pattern||s.pattern,this.evalSegmentOptions(s,t,i),this.createLegendItem(t,s,i),!1===i.visible)return;const o=new Ql(t,e,s);Object.assign(o,i),this.append(o),this.points.push(o)}reflow(t){const{options:e,points:i,seriesConfigs:s=[]}=this,o=i.length,n=t.clone(),r=Math.min(n.width(),n.height()),a=r/2,l=r-.85*r,h=new ui(n.x1,n.y1,n.x1+r,n.y1+r),c=h.center(),d=n.center(),u=e.series.length,p=[],g=[];let m=Kt(e.padding,l);this.targetBox=t,m=m>a-5?a-5:m,h.translate(d.x-c.x,d.y-c.y);const f=a-m,x=new di(f+h.x1+m,f+h.y1+m);for(let t=0;t<o;t++){const e=i[t],o=e.sector,n=e.seriesIx;if(o.radius=f,o.center=x,s.length){const t=s[n];o.innerRadius=t.innerRadius,o.radius=t.radius}n===u-1&&e.explode&&(o.center=o.clone().setRadius(.15*o.radius).point(o.middle())),e.reflow(h);const r=e.label;r&&r.options.position===hr&&n===u-1&&(r.orientation===B?g.push(r):p.push(r))}p.length>0&&(p.sort(this.labelComparator(!0)),this.leftLabelsReflow(p)),g.length>0&&(g.sort(this.labelComparator(!1)),this.rightLabelsReflow(g)),this.box=h}leftLabelsReflow(t){const e=this.distanceBetweenLabels(t);this.distributeLabels(e,t)}rightLabelsReflow(t){const e=this.distanceBetweenLabels(t);this.distributeLabels(e,t)}distanceBetweenLabels(t){const e=Xt(this.points),i=e.sector,s=t.length-1,o=i.radius+e.options.labels.distance,n=[];let r=t[0].box,a=$t(r.y1-(i.center.y-o-r.height()-r.height()/2));n.push(a);for(let e=0;e<s;e++){const i=t[e+1].box;r=t[e].box,a=$t(i.y1-r.y2),n.push(a)}return a=$t(i.center.y+o-t[s].box.y2-t[s].box.height()/2),n.push(a),n}distributeLabels(t,e){const i=t.length;let s,o,n;for(let e=0;e<i;e++)for(n=-t[e],s=o=e;n>0&&(s>=0||o<i);)n=this._takeDistance(t,e,--s,n),n=this._takeDistance(t,e,++o,n);this.reflowLabels(t,e)}_takeDistance(t,e,i,s){let o=s;if(t[i]>0){const s=Math.min(t[i],o);o-=s,t[i]-=s,t[e]+=s}return o}reflowLabels(t,e){const i=Xt(this.points),s=i.sector,o=i.options.labels,n=e.length,r=o.distance;let a,l=s.center.y-(s.radius+r)-e[0].box.height();t[0]+=2;for(let i=0;i<n;i++){const n=e[i],h=n.box;l+=t[i],a=this.hAlignLabel(h.x2,s.clone().expand(r),l,l+h.height(),n.orientation===B),n.orientation===B?(o.align!==u&&(a=s.radius+s.center.x+r),n.reflow(new ui(a+h.width(),l,a,l))):(o.align!==u&&(a=s.center.x-s.radius-r),n.reflow(new ui(a-h.width(),l,a,l))),l+=h.height()}}createVisual(){const{options:{connectors:t},points:i}=this,s=i.length;super.createVisual(),this._connectorLines=[];for(let o=0;o<s;o++){const s=i[o],{sector:n,label:r}=s,a=n.middle(),l=(s.options.connectors||{}).color||t.color;if(r){const i=new e.b({stroke:{color:l,width:t.width},animation:{type:To,delay:s.animationDelay}});if(r.options.position===hr){const e=r.box,o=n.center;let l,h,c,d=n.point(a),u=new di(e.x1,e.center().y);d=n.clone().expand(t.padding).point(a),i.moveTo(d.x,d.y),r.orientation===B?(h=new di(e.x1-t.padding,e.center().y),c=sh(o,d,u,h),u=new di(h.x-4,h.y),c=c||u,c.x=Math.min(c.x,u.x),this.pointInCircle(c,n.center,n.radius+4)||c.x<n.center.x?(l=n.center.x+n.radius+4,s.options.labels.align!==Zo?l<u.x?i.lineTo(l,d.y):i.lineTo(d.x+8,d.y):i.lineTo(l,d.y),i.lineTo(u.x,h.y)):(c.y=h.y,i.lineTo(c.x,c.y))):(h=new di(e.x2+t.padding,e.center().y),c=sh(o,d,u,h),u=new di(h.x+4,h.y),c=c||u,c.x=Math.max(c.x,u.x),this.pointInCircle(c,n.center,n.radius+4)||c.x>n.center.x?(l=n.center.x-n.radius-4,s.options.labels.align!==Zo?l>u.x?i.lineTo(l,d.y):i.lineTo(d.x-8,d.y):i.lineTo(l,d.y),i.lineTo(u.x,h.y)):(c.y=h.y,i.lineTo(c.x,c.y))),i.lineTo(h.x,h.y),this._connectorLines.push(i),this.visual.append(i)}}}}renderVisual(){if(super.renderVisual(),he(this.options.series,(t=>t.autoFit))){const t=this.targetBox,i=this.box.center(),s=this.visual.bbox();if(!s)return;const o=s.bottomRight(),n=Math.min((i.y-t.y1)/(i.y-s.origin.y),(t.y2-i.y)/(o.y-i.y),(i.x-t.x1)/(i.x-s.origin.x),(t.x2-i.x)/(o.x-i.x));n<1&&this.visual.transform(e.t().scale(n,n,[i.x,i.y]))}}labelComparator(t){const e=t?-1:1;return function(t,i){return((t.parent.sector.middle()+270)%360-(i.parent.sector.middle()+270)%360)*e}}hAlignLabel(t,e,i,s,o){const{radius:n,center:{x:r,y:a}}=e,l=Math.min(Math.abs(a-i),Math.abs(a-s));return l>n?t:r+Math.sqrt(n*n-l*l)*(o?1:-1)}pointInCircle(t,e,i){return Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2)<Math.pow(i,2)}formatPointValue(t,e){return this.chartService.format.auto(e,t.value)}animationDelay(t){return 70*t}stackRoot(){return this}}function sh(t,e,i,s){const o=(s.x-i.x)*(t.y-i.y)-(s.y-i.y)*(t.x-i.x),n=(s.y-i.y)*(e.x-t.x)-(s.x-i.x)*(e.y-t.y);let r;if(0!==n){const i=o/n;r=new di(t.x+i*(e.x-t.x),t.y+i*(e.y-t.y))}return r}te(ih,{startAngle:90,connectors:{width:2,color:"#939393",padding:8},inactiveItems:{markers:{},labels:{}}}),ut(ih.prototype,eh),ih.prototype.isStackRoot=!0;class oh extends Pa{render(){this.createPieChart(this.series)}createPieChart(t){const e=t[0],i=new ih(this,{series:t,padding:e.padding,startAngle:e.startAngle,connectors:e.connectors,legend:this.options.legend});this.appendChart(i)}appendChart(t,e){super.appendChart(t,e),Dt(this.options.legend.data,t.legendItems)}getPointBelow(t){return this.getPointToTheRight(t)}getPointAbove(t){return this.getPointToTheLeft(t)}}class nh extends Ql{reflowLabel(){const{options:{labels:t},label:e}=this,i=this.sector.clone(),s=i.middle();if(e){const o=e.box.height();if(t.position===d){i.radius-=(i.radius-i.innerRadius)/2;const t=i.point(s);e.reflow(new ui(t.x,t.y-o/2,t.x,t.y))}else super.reflowLabel()}}createSegment(t,e){return xi.current.createRing(t,e)}}te(nh,{overlay:{gradient:"roundedGlass"},labels:{position:d},animation:{type:on}}),ut(nh.prototype,zr);class rh extends ih{addValue(t,e,i){const s=ut({},i.series,{index:i.index});if(s.pattern=i.pattern||s.pattern,this.evalSegmentOptions(s,t,i),this.createLegendItem(t,s,i),!1===i.visible)return;const o=new nh(t,e,s);Object.assign(o,i),this.append(o),this.points.push(o)}reflow(t){const e=this.options,i=t.clone(),s=Math.min(i.width(),i.height()),o=s/2,n=s-.85*s,r=e.series,a=r.length;let l=Kt(e.padding,n);l=l>o-5?o-5:l;let h,c=o-l,d=0;for(let t=0;t<a;t++){const e=r[t];0===t&&Ft(e.holeSize)&&(h=e.holeSize,c-=e.holeSize),Ft(e.size)?c-=e.size:d++,Ft(e.margin)&&t!==a-1&&(c-=e.margin)}if(!Ft(h)){h=.75*((o-l)/(a+.75)),c-=h}let u,p,g=h,m=0;this.seriesConfigs=[];for(let t=0;t<a;t++){const e=r[t];u=Kt(e.size,c/d),g+=m,p=g+u,this.seriesConfigs.push({innerRadius:g,radius:p}),m=e.margin||0,g=p}super.reflow(t)}animationDelay(t,e,i){return 50*t+Co*(e+1)/(i+1)}}te(rh,{startAngle:90,connectors:{width:2,color:"#939393",padding:8}});class ah extends oh{render(){this.createDonutChart(this.series)}createDonutChart(t){const e=t[0],i=new rh(this,{series:t,padding:e.padding,connectors:e.connectors,legend:this.options.legend});this.appendChart(i)}getPointBelow(t){return this._getNextPoint(t,this._pointsByVertical,-1)}getPointAbove(t){return this._getNextPoint(t,this._pointsByVertical,1)}}class lh extends Pa{initFields(){this.valueAxisRangeTracker=new ta}render(){this.addToLegend(this.series),this.createPolarAxis(),this.createCharts(),this.createValueAxis()}alignAxes(){const t=this.valueAxis,e=t.range(),i=t.options.reverse?e.max:e.min,s=t.getSlot(i),o=this.polarAxis.getSlot(0).center,n=t.box.translate(o.x-s.x1,o.y-s.y1);t.reflow(n)}createValueAxis(){const t=this.valueAxisRangeTracker.query(),e=this.valueAxisOptions({roundToMajorUnit:!1,zIndex:-1});let i,s;e.type===nr?(i=ho,s={min:.1,max:1}):(i=lo,s={min:0,max:1});const o=t||s,n=new i(o.min,o.max,e,this.chartService);this.valueAxis=n,this.appendAxis(n)}reflowAxes(){const{options:{plotArea:t},valueAxis:e,polarAxis:i,box:s}=this,o=.15*Math.min(s.width(),s.height()),n=yt(t.padding||{},o),r=s.clone().unpad(n),a=r.clone();a.y2=a.y1+Math.min(a.width(),a.height()),a.align(r,X,d);const l=a.clone().shrink(0,a.height()/2);i.reflow(a),e.reflow(l);const h=e.lineBox().height()-e.box.height();e.reflow(e.box.unpad({top:h})),this.axisBox=a,this.alignAxes(a)}backgroundBox(){return this.box}detachLabels(){}}class hh extends ma{pointSlot(t,e){const i=t.center.y-e.y1,s=di.onCircle(t.center,t.startAngle,i);return new ui(s.x,s.y,s.x,s.y)}}te(hh,{clip:!1});class ch extends Hl{}ch.prototype.pointSlot=hh.prototype.pointSlot,te(ch,{clip:!1});class dh extends Kr{fillToAxes(t){const e=this._polarAxisCenter();t.lineTo(e.x,e.y)}_polarAxisCenter(){return this.parent.plotArea.polarAxis.box.center()}strokeSegments(){let t=this._strokeSegments;if(!t){const e=this._polarAxisCenter(),i=new co(!1),s=this.points();s.push(e),t=this._strokeSegments=i.process(s),t.pop()}return t}}class uh extends $r{fillToAxes(t){const i=this.parent.plotArea.polarAxis.box.center(),s=new e.S([i.x,i.y]);t.segments.unshift(s),t.segments.push(s)}}class ph extends ch{createSegment(t,e,i){let s;return s=(e.line||{}).style===No?new dh(t,e,i):new uh(t,e,i),s}createMissingValue(t,e){let i;return Er(t.x)&&e!==Do&&(i={x:t.x,y:t.y},e===Vo&&(i.y=0)),i}seriesMissingValues(t){return t.missingValues||Vo}_hasMissingValuesGap(){const t=this.options.series;for(let e=0;e<t.length;e++)if(this.seriesMissingValues(t[e])===zo)return!0}sortPoints(t){if(t.sort(gh),this._hasMissingValuesGap())for(let e=0;e<t.length;e++){const i=t[e];if(i){Er(i.value.y)||this.seriesMissingValues(i.series)!==zo||delete t[e]}}return t}}function gh(t,e){return t.value.x-e.value.x}class mh extends lh{createPolarAxis(){const t=new no(this.options.xAxis,this.chartService);this.polarAxis=t,this.axisX=t,this.appendAxis(t)}render(){this.series=[...this.originalSeries],this.createTrendlineSeries(),super.render()}valueAxisOptions(t){return ut(t,{majorGridLines:{type:i},minorGridLines:{type:i}},this.options.yAxis)}createValueAxis(){super.createValueAxis(),this.axisY=this.valueAxis}trendlineFactory(t,e){const i=Zl.prototype.trendlineFactory.call(this,t,e);return i&&(i.type=rn),i}appendChart(t,e){this.valueAxisRangeTracker.update(t.yAxisRanges),Pa.prototype.appendChart.call(this,t,e)}createCharts(){const t=this.filterVisibleSeries(this.series),e=this.panes[0];this.createLineChart(Cr(t,[rn]),e),this.createScatterChart(Cr(t,[an]),e),this.createAreaChart(Cr(t,[nn]),e)}createLineChart(t,e){if(0===t.length)return;const i=new ch(this,{series:t});this.appendChart(i,e)}createScatterChart(t,e){if(0===t.length)return;const i=new hh(this,{series:t});this.appendChart(i,e)}createAreaChart(t,e){if(0===t.length)return;const i=new ph(this,{series:t});this.appendChart(i,e)}_dispatchEvent(t,e,i){const s=t._eventCoordinates(e),o=new di(s.x,s.y),n=this.axisX.getValue(o),r=this.axisY.getValue(o);null!==n&&null!==r&&t.trigger(i,{element:Gt(e),x:n,y:r})}createCrosshairs(){}}te(mh,{xAxis:{},yAxis:{}}),ut(mh.prototype,Ra,{seriesValues:Zl.prototype.seriesValues});class fh extends Zr{pointSlot(t,e){const i=t.center.y-e.y1,s=di.onCircle(t.center,t.middle(),i);return new ui(s.x,s.y,s.x,s.y)}renderSegments(){if(super.renderSegments(),this._segments&&this._segments.length>1){const t=function(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i];e[s.seriesIx]=e[s.seriesIx]||[],e[s.seriesIx].push(s)}return e}(this._segments);for(let e=0;e<t.length;e++){const i=t[e];if(i&&i.length>1){const t=i[0].linePoints[0],e=Xt(i),s=Xt(e.linePoints),o=0===t.categoryIx,n=s.categoryIx===s.categoriesCount-1;o&&n&&Xt(i).linePoints.push(t)}}}}createSegment(t,e,i){let s;s=e.style===No?Wr:Nr;const o=new s(t,e,i),n=this.seriesMissingValues(e);return t.length!==e.data.length&&n!==Do||(o.options.closed=!0),o}}te(fh,{clip:!1,limitPoints:!1});class xh extends Kr{fillToAxes(){}}class yh extends $r{fillToAxes(){}}class vh extends fh{createSegment(t,e,i,s){const o=this.options.isStacked,n=(e.line||{}).style;let r,a,l;return o&&i>0&&s&&(a=s.linePoints.slice(0),r=s),n===No?(l=new xh(t,e,i,r,a),l.options.closed=!0):(t.push(t[0]),l=new yh(t,e,i,r,a)),l}seriesMissingValues(t){return t.missingValues||Vo}}class bh extends nh{constructor(t,e){super(t,null,e)}getIndex(){return this.categoryIx}}te(bh,{overlay:{gradient:"none"},labels:{distance:10}});class wh extends yi{constructor(t){super(t),this.forEach=t.rtl?na:oa}reflow(t){const{options:e,children:i}=this,{gap:s,spacing:o}=e,n=i.length,r=n+s+o*(n-1),a=t.angle/r;let l=t.startAngle+a*(s/2);this.forEach(i,(e=>{const i=t.clone();i.startAngle=l,i.angle=a,e.sector&&(i.radius=e.sector.radius),e.reflow(i),e.sector=i,l+=a+a*o}))}}te(wh,{gap:1,spacing:0});class _h extends yi{reflow(t){const{options:{reverse:e},children:i}=this,s=i.length,o=e?s-1:0,n=e?-1:1;this.box=new ui;for(let e=o;e>=0&&e<s;e+=n){const s=i[e].sector;s.startAngle=t.startAngle,s.angle=t.angle}}}class kh extends la{pointType(){return bh}clusterType(){return wh}stackType(){return _h}categorySlot(t,e){return t.getSlot(e)}pointSlot(t,e){const i=t.clone(),s=t.center.y;return i.radius=s-e.y1,i.innerRadius=s-e.y2,i}reflowPoint(t,e){t.sector=e,t.reflow()}createAnimation(){this.options.animation.center=this.box.toRect().center(),super.createAnimation()}}kh.prototype.reflow=Dr.prototype.reflow,te(kh,{clip:!1,limitPoints:!1,animation:{type:"pie"}});class Ah extends lh{createPolarAxis(){const t=new oo(this.options.categoryAxis,this.chartService);this.polarAxis=t,this.categoryAxis=t,this.appendAxis(t),this.aggregateCategories(),this.createTrendlineSeries(),this.createCategoryAxesLabels()}valueAxisOptions(t){return this._hasBarCharts&&ut(t,{majorGridLines:{type:i},minorGridLines:{type:i}}),this._isStacked100&&ut(t,{roundToMajorUnit:!1,labels:{format:"P0"}}),ut(t,this.options.valueAxis)}aggregateCategories(){dl.prototype.aggregateCategories.call(this,this.panes)}createCategoryAxesLabels(){dl.prototype.createCategoryAxesLabels.call(this,this.panes)}filterSeries(t){return t}trendlineFactory(t,e){const i=dl.prototype.trendlineFactory.call(this,t,e);return i&&(i.type=cn),i}createCharts(){const t=this.filterVisibleSeries(this.series),e=this.panes[0];this.createAreaChart(Cr(t,[ln]),e),this.createLineChart(Cr(t,[cn]),e),this.createBarChart(Cr(t,[hn]),e)}chartOptions(t){const e={series:t},i=t[0];if(i){const s=this.filterVisibleSeries(t),o=i.stack;e.isStacked=o&&s.length>1,e.isStacked100=o&&"100%"===o.type&&s.length>1,e.isStacked100&&(this._isStacked100=!0)}return e}createAreaChart(t,e){if(0===t.length)return;const i=new vh(this,this.chartOptions(t));this.appendChart(i,e)}createLineChart(t,e){if(0===t.length)return;const i=new fh(this,this.chartOptions(t));this.appendChart(i,e)}createBarChart(t,e){if(0===t.length)return;const i=t[0],s=this.chartOptions(t),o=this.filterVisibleSeries(t),n=o.some((t=>t.stack)),r=o.some((t=>t.stack&&"100%"===t.stack.type));s.gap=i.gap,s.spacing=i.spacing,s.defaultStack=i.stack&&o.length>1,s.isStacked=n&&o.length>1,s.isStacked100=r&&o.length>1;const a=new kh(this,s);this.appendChart(a,e),this._hasBarCharts=!0}seriesCategoryAxis(){return this.categoryAxis}_dispatchEvent(t,e,i){const s=t._eventCoordinates(e),o=new di(s.x,s.y),n=this.categoryAxis.getCategory(o),r=this.valueAxis.getValue(o);null!==n&&null!==r&&t.trigger(i,{element:Gt(e),category:n,value:r})}createCrosshairs(){}_pointsByVertical(t){return super._pointsByVertical(t).sort(this._getSeriesCompareFn())}_getSeriesCompareFn(){return(t,e)=>e.value-t.value}}ut(Ah.prototype,Ra,{appendChart:dl.prototype.appendChart,aggregateSeries:dl.prototype.aggregateSeries,seriesSourcePoints:dl.prototype.seriesSourcePoints,seriesValues:dl.prototype.seriesValues}),te(Ah,{categoryAxis:{categories:[]},valueAxis:{}});class Sh extends yi{constructor(t,e,i){super(e),this.value=t,this.options.index=i.index}getLabelText(t){let e=wt(t);return e?e(this.pointData()):t.format?this.formatValue(t.format):this.value}reflow(t){const e=this.points,i=this.children[0],s=Math.min(e[0].x,e[3].x),o=Math.max(e[1].x,e[2].x);this.box=new ui(s,e[0].y,o,e[2].y),i&&i.reflow(new ui(t.x1,e[0].y,t.x2,e[2].y))}createVisual(){const t=this.options;let e;super.createVisual(),this.addAccessibilityAttributesToVisual(),e=t.visual?t.visual({category:this.category,dataItem:this.dataItem,value:this.value,series:this.series,percentage:this.percentage,points:this.points,options:t,sender:this.getSender(),createVisual:()=>this.createPath()}):this.createPath(),e&&this.visual.append(e)}createPath(){const t=this.options,i=t.border;return e.b.fromPoints(this.points,{fill:Si(t.pattern,{color:t.color,opacity:t.opacity}),stroke:{color:i.color,opacity:i.opacity,width:i.width}}).close()}createHighlight(t){return e.b.fromPoints(this.points,t)}highlightVisual(){return this.visual.children[0]}highlightVisualArgs(){const t=e.b.fromPoints(this.points).close();return{options:this.options,path:t}}createFocusHighlight(t){const i=this.options.focusHighlight.border.width,s=e.b.fromPoints(this.points,ut({},t,{stroke:{width:2*i}})).close(),o=new e.h;return o.paths.push(e.b.fromRect(this.box.clone().pad(i).toRect())),o.paths.push(e.b.fromPoints(this.points)),s.clip(o),s}tooltipAnchor(){const t=this.box;return{point:new di(t.center().x,t.y1),align:{horizontal:"center",vertical:"top"}}}formatValue(t){return this.owner.formatPointValue(this,t)}pointData(){return{dataItem:this.dataItem,category:this.category,value:this.value,series:this.series,percentage:this.percentage}}getIndex(){return this.index}}te(Sh,{color:U,border:{width:1},labels:{format:""},accessibility:{role:Jn,className:tr,ariaRoleDescription:er}}),ut(Sh.prototype,zr),ut(Sh.prototype,ia);class Ch extends yi{constructor(t,e){super(e),this.plotArea=t,this.chartService=t.chartService,this.points=[],this.labels=[],this.legendItems=[],this.render()}formatPointValue(t,e){return this.plotArea.chartService.format.auto(e,t.value)}render(){const{options:t,plotArea:{options:{seriesColors:e=[]}}}=this,i=t.series[0],s=i.data;if(!s)return;const{total:o,points:n}=_r(i);for(let t=0;t<n.length;t++){const r=n[t];if(!r)continue;let a=r.fields;ht(i.color)||(i.color=a.color||e[t%e.length]),a=ut({index:t,owner:this,series:i,seriesIx:0,dataItem:s[t],percentage:r.value/o},a,{visible:r.visible});const l=r.valueFields.value,h=this.createSegment(l,a),c=this.createLabel(l,a);h&&c&&h.append(c)}}evalSegmentOptions(t,e,i){const s=i.series;Sr(t,{value:e,series:s,dataItem:i.dataItem,index:i.index},{defaults:s._defaults,excluded:["data","content","template","toggle","visual","ariaTemplate","ariaContent"]})}createSegment(t,e){const i=ut({},e.series);if(i.pattern=e.pattern||i.pattern,this.evalSegmentOptions(i,t,e),this.createLegendItem(t,i,e),!1!==e.visible){const s=new Sh(t,i,e);return Object.assign(s,e),this.append(s),this.points.push(s),s}}createLabel(t,e){const{series:i,dataItem:s}=e,o=ut({},this.options.labels,i.labels);let n=t;if(o.visible){const r=wt(o),a={dataItem:s,value:t,percentage:e.percentage,category:e.category,series:i};r?n=r(a):o.format&&(n=this.chartService.format.auto(o.format,n)),o.color||(o.color=ge(i.color),o.background||(o.background=i.color)),this.evalSegmentOptions(o,t,e);const l=new zi(n,ut({vAlign:o.position},o),a);return this.labels.push(l),l}}labelPadding(){const t=this.labels,e={left:0,right:0};for(let i=0;i<t.length;i++){const s=t[i].options.align;if(s!==d){const o=t[i].box.width();s===S?e.left=Math.max(e.left,o):e.right=Math.max(e.right,o)}}return e}dynamicSlopeReflow(t,i,s){const{options:o,points:n}=this,r=n.length,a=n[0];let l=a;for(let t=0;t<n.length;t++)n[t].percentage>l.percentage&&(l=n[t]);let h=a.percentage/l.percentage*i,c=(i-h)/2,d=0;for(let a=0;a<r;a++){const l=n[a].percentage,u=n[a+1],p=u?u.percentage:l,g=n[a].points=[],m=o.dynamicHeight?s*l:s/r;let f;f=l?(i-h*(p/l))/2:p?0:i/2,f=Yt(f,0,i),g.push(new e.P(t.x1+c,t.y1+d)),g.push(new e.P(t.x1+i-c,t.y1+d)),g.push(new e.P(t.x1+i-f,t.y1+m+d)),g.push(new e.P(t.x1+f,t.y1+m+d)),c=f,d+=m+o.segmentSpacing,h=Yt(i-2*f,0,i)}}constantSlopeReflow(t,i,s){const{options:o,points:n}=this,r=n.length,a=o.neckRatio<=1,l=a?o.neckRatio*i:i;let h=a?0:(i-i/o.neckRatio)/2;const c=((a?i:i-2*h)-l)/2;let d=0;for(let a=0;a<r;a++){const l=n[a].points=[],u=n[a].percentage,p=o.dynamicHeight?c*u:c/r,g=o.dynamicHeight?s*u:s/r;l.push(new e.P(t.x1+h,t.y1+d)),l.push(new e.P(t.x1+i-h,t.y1+d)),l.push(new e.P(t.x1+i-h-p,t.y1+g+d)),l.push(new e.P(t.x1+h+p,t.y1+g+d)),h+=p,d+=g+o.segmentSpacing}}reflow(t){const e=this.points,i=e.length;if(!i)return;const s=this.options,o=t.clone().unpad(this.labelPadding()),n=o.height()-s.segmentSpacing*(i-1),r=o.width();s.dynamicSlope?this.dynamicSlopeReflow(o,r,n):this.constantSlopeReflow(o,r,n);for(let s=0;s<i;s++)e[s].reflow(t)}}te(Ch,{neckRatio:.3,width:300,dynamicSlope:!1,dynamicHeight:!0,segmentSpacing:0,labels:{visible:!1,align:d,position:d,zIndex:1}}),ut(Ch.prototype,eh);class Th extends Ch{constructor(t,e){e.dynamicSlope=!1,e.neckRatio=1e6,super(t,e)}}class Ph extends yi{constructor(t,e){super(),this.options=e,this.color=e.color||U,this.value=t}render(){this._rendered||(this._rendered=!0,this.createMarker(),this.createLabel(),this.createNote())}createLabel(){const t=this.options.labels;t.visible&&(this.label=this.createLabelElement(t),this.append(this.label))}createLabelElement(t){let e=t.color;return e||(e=ge(this.color)),new zi(this.getLabelText(t),ut({align:d,vAlign:d,margin:{left:5,right:5},zIndex:Kt(t.zIndex,this.series.zIndex)},t,{color:e}),this.pointData())}getLabelText(t){let e=wt(t);return e?e(this.pointData()):this.formatValue(t.format)}formatValue(t){return this.owner.formatPointValue(this,t)}reflow(t){this.render();const e=this.label;this.box=t,e&&e.reflow(this.markerBox()),this.note&&this.note.reflow(t),this.marker.reflow(this.markerBox())}createVisual(){super.createVisual(),this.addAccessibilityAttributesToVisual()}markerBox(){const t=this.options.markers,e=t.border,i=this.box.toRect(),s=Kt(t.type,"rect")===O;let o=Kt(e.width,s?1:0);const n=Math.round(o/2);if(t.size){const e=i.center();i.size.width=i.size.height=t.size,i.origin.x=Math.round(e.x-i.size.width/2),i.origin.y=Math.round(e.y-i.size.height/2)}return i.size.width-=o,i.size.height-=o,i.origin.y+=n+.5,i.origin.x+=n+.5,Vi(i)}markerBorder(){const t=this.options,e=t.markers.border,i=Kt(e.opacity,t.opacity);return{color:e.color||this.color,width:e.width,opacity:i,dashType:e.dashType}}createMarker(){const t=this.options,e=t.markers,i=new Pi({type:Kt(e.type,"rect"),width:e.size,height:e.size,rotation:e.rotation,background:this.color,border:this.markerBorder(),pattern:t.pattern,borderRadius:e.borderRadius,opacity:this.series.opacity||t.opacity,zIndex:Kt(t.zIndex,this.series.zIndex),animation:t.animation,visual:t.visual},{dataItem:this.dataItem,value:this.value,series:this.series,category:this.category});this.marker=i,this.append(i)}createHighlight(t){const e=this.options,i=this.options.highlight.markers||this.options.markers,s=new Pi({type:Kt(i.type,"rect"),width:i.size,height:i.size,rotation:i.rotation,background:i.color||this.color,border:this.markerBorder(),borderRadius:i.borderRadius,opacity:this.series.opacity||e.opacity,zIndex:Kt(e.zIndex,this.series.zIndex)});s.reflow(this.markerBox());const o=s.getElement();return o.options.fill=t.fill,o.options.stroke=t.stroke,o}highlightVisual(){return this.rectVisual}highlightVisualArgs(){return{options:this.options,rect:this.box.toRect(),visual:this.rectVisual}}createFocusHighlight(){const t=this.options.markers,e=this.options.focusHighlight,i=new Pi({type:Kt(t.type,"rect"),width:t.size,height:t.size,rotation:t.rotation,background:e.color,border:e.border,borderRadius:t.borderRadius,padding:e.border.width/2,zIndex:e.zIndex});return i.reflow(this.markerBox()),i.getElement()}tooltipAnchor(){const t=this.box.center().x,e=this.box.y1-5;return{point:new di(t,e),align:{horizontal:d,vertical:c}}}overlapsBox(t){return this.box.overlaps(t)}unclipElements(){}pointData(){return{x:this.value.x,y:this.value.y,value:this.value.value,dataItem:this.dataItem,series:this.series}}}ut(Ph.prototype,zr),ut(Ph.prototype,Fr),ut(Ph.prototype,ia),Ph.prototype.defaults={markers:{type:"rect",borderRadius:4,border:{color:"transparent"}},padding:{top:1},labels:{visible:!1,padding:3},opacity:1,notes:{label:{}},accessibility:{role:Jn,className:tr,ariaRoleDescription:er}};class Mh extends yi{constructor(t,e){super(e),this.plotArea=t,this.chartService=t.chartService,this._initFields(),this.render()}_initFields(){this.points=[],this.seriesOptions=[],this.valueRange={min:C,max:T},this._evalSeries=[]}render(){this.setRange(),this.traverseDataPoints(this.addValue.bind(this))}setRange(){const{options:{series:t}}=this;for(let e=0;e<t.length;e++){const i=t[e];for(let t=0;t<i.data.length;t++){const{valueFields:e}=this.plotArea.bindPoint(i,t);Ft(e.value)&&null!==e.value&&(this.valueRange.min=Math.min(this.valueRange.min,e.value),this.valueRange.max=Math.max(this.valueRange.max,e.value))}}}addValue(t,e){let i;t&&Ft(t.value)&&null!==t.value&&(i=this.createPoint(t,e),i&&Object.assign(i,e)),this.points.push(i)}evalPointOptions(t,e,i){const{series:s,seriesIx:o}=i,n={defaults:s._defaults,excluded:["data","tooltip","content","template","visual","toggle","drilldownSeriesFactory","ariaTemplate","ariaContent"]};let r=this._evalSeries[o];Ft(r)||(this._evalSeries[o]=r=Sr(t,{},n,!0));let a=t;return r&&(a=ut({},t),Sr(a,{value:e,series:s,dataItem:i.dataItem,min:this.valueRange.min,max:this.valueRange.max},n)),a}pointType(){return Ph}pointOptions(t,e){let i=this.seriesOptions[e];if(!i){const s=this.pointType().prototype.defaults;this.seriesOptions[e]=i=ut({},s,{markers:{opacity:t.opacity},tooltip:{format:this.options.tooltip.format},labels:{format:this.options.labels.format}},t)}return Object.assign({},i)}createPoint(t,i){const s=i.series;let o=this.pointOptions(s,i.seriesIx),n=i.color||s.color;if(o.pattern=i.pattern||o.pattern,o=this.evalPointOptions(o,t,i),ht(s.color))n=o.color;else if(0!==this.valueRange.max){const i=((t,i=.05)=>{const s=e.p(t),o=1-i;return t=>{const e=s.toHSL(),i=100-e.l,n=o-t;return e.l+=Math.min(n*i,i),e.toCss()}})(n);n=i(t.value/this.valueRange.max)}const r=new Ph(t,o);return r.color=n,this.append(r),r}seriesAxes(t){const{xAxis:e,yAxis:i}=t,s=this.plotArea,o=e?s.namedXAxes[e]:s.axisX,n=i?s.namedYAxes[i]:s.axisY;if(!o)throw new Error("Unable to locate X axis with name "+e);if(!n)throw new Error("Unable to locate Y axis with name "+i);return{xAxis:o,yAxis:n}}reflow(t){const e=this.points,i=!this.options.clip;let s=0;this.traverseDataPoints(((t,o)=>{const n=e[s++],{xAxis:r,yAxis:a}=this.seriesAxes(o.series),l=r.categoryIndex(t.x),h=a.categoryIndex(t.y),c=r.getSlot(l,l,i),d=a.getSlot(h,h,i);if(n)if(c&&d){const t=this.pointSlot(c,d);n.reflow(t)}else n.visible=!1})),this.box=t}pointSlot(t,e){return new ui(t.x1,e.y1,t.x2,e.y2)}traverseDataPoints(t){const{options:{series:e}}=this;for(let i=0;i<e.length;i++){const s=e[i],{xAxis:o,yAxis:n}=this.seriesAxes(s),r=o.currentRangeIndices(),a=n.currentRangeIndices();for(let e=0;e<s.data.length;e++){const{valueFields:l,fields:h}=this.plotArea.bindPoint(s,e),c=o.totalIndex(l.x),d=n.totalIndex(l.y),u=r.min<=c&&c<=r.max,p=a.min<=d&&d<=a.max;u&&p&&t(l,ut({pointIx:e,series:s,seriesIx:i,dataItem:s.data[e],owner:this},h))}}}formatPointValue(t,e){const i=t.value;return this.chartService.format.auto(e,i.x,i.y,i.value)}animationPoints(){const t=this.points,e=[];for(let i=0;i<t.length;i++)e.push((t[i]||{}).marker);return e}}te(Mh,{series:[],tooltip:{format:"{0}, {1}: {2}"},labels:{format:"{2}"},clip:!0});class Eh extends Pa{initFields(){this.namedXAxes={},this.namedYAxes={}}render(t=this.panes){this.bindCategories(),this.createAxes(t),this.createCharts(t),this.createAxisLabels()}bindCategories(){const t=this.srcSeries||this.series;for(let e=0;e<t.length;e++){const i=t[e],s=i.data||[],{xAxis:o,yAxis:n}=this.seriesAxes(i),r=ye(o.categories||[]),a=ye(n.categories||[]);for(let t=0;t<s.length;t++){const{x:e,y:s}=wo.current.bindPoint(i,t).valueFields;r.has(e)||r.add(e),a.has(s)||a.add(s)}o.categories=r.values(),n.categories=a.values()}}createCharts(t){const e=this.groupSeriesByPane();for(let i=0;i<t.length;i++){const s=t[i],o=e[s.options.name||"default"]||[];this.addToLegend(o);const n=this.filterVisibleSeries(o);n&&this.createHeatmapChart(Cr(n,[Jo]),s)}}createHeatmapChart(t,e){const i=new Mh(this,{series:t});this.appendChart(i,e)}seriesPaneName(t){const e=this.options,i=t.xAxis,s=Ct([].concat(e.xAxis),(function(t){return t.name===i}))[0],o=t.yAxis,n=Ct([].concat(e.yAxis),(function(t){return t.name===o}))[0],r=(e.panes||[{}])[0].name||"default";return(s||{}).pane||(n||{}).pane||r}seriesAxes(t){let e,i;const s=this.options,o=[].concat(s.xAxis),n=t.xAxis;e=n?o.find((t=>t.name===n)):o[0];const r=[].concat(s.yAxis),a=t.yAxis;if(i=a?r.find((t=>t.name===a)):r[0],!e)throw new Error("Unable to locate X axis with name "+n);if(!i)throw new Error("Unable to locate Y axis with name "+a);return{xAxis:e,yAxis:i}}createAxisLabels(){const t=this.axes;for(let e=0;e<t.length;e++)t[e].createLabels()}createXYAxis(t,e,i){const s=t.name,o=e?this.namedYAxes:this.namedXAxes,n=Object.assign({axisCrossingValue:0},t,{vertical:e,reverse:e||this.chartService.rtl?!t.reverse:t.reverse,justified:!1}),r=n.categories?n.categories[0]:null,a=[n.min,n.max,r],l=this.series;for(let t=0;t<l.length;t++){const s=l[t],o=s[e?"yAxis":"xAxis"];if(o===n.name||0===i&&!o){const t=wo.current.bindPoint(s,0).valueFields;a.push(t[e?"y":"x"]);break}}let h,c;for(let t=0;t<a.length;t++)if(a[t]instanceof Date){h=!0;break}c=Ar(n.type,g)||!n.type&&h?Ws:Os;const d=new c(n,this.chartService);if(d.axisIndex=i,s){if(o[s])throw new Error(`${e?"Y":"X"} axis with name ${s} is already defined`);o[s]=d}return this.appendAxis(d),d.indexCategories(),d}createAxes(t){const e=this.options,i=[].concat(e.xAxis),s=[],o=[].concat(e.yAxis),n=[];for(let e=0;e<i.length;e++){Mt(this.findPane(i[e].pane),t)&&s.push(this.createXYAxis(i[e],!1,e))}for(let e=0;e<o.length;e++){Mt(this.findPane(o[e].pane),t)&&n.push(this.createXYAxis(o[e],!0,e))}this.axisX=this.axisX||s[0],this.axisY=this.axisY||n[0]}removeAxis(t){const e=t.options.name;super.removeAxis(t),t.options.vertical?delete this.namedYAxes[e]:delete this.namedXAxes[e],t===this.axisX&&delete this.axisX,t===this.axisY&&delete this.axisY}_dispatchEvent(t,e,i){const s=t._eventCoordinates(e),o=new di(s.x,s.y),n=this.axes,r=n.length,a=[],l=[];for(let t=0;t<r;t++){const e=n[t];vr(e.options.vertical?l:a,e.getCategory(o))}a.length>0&&l.length>0&&t.trigger(i,{element:Gt(e),originalEvent:e,x:Ir(a),y:Ir(l)})}updateAxisOptions(t,e){const i=t.options.vertical,s=this.groupAxes(this.panes),o=(i?s.y:s.x).indexOf(t);Ih(this.options,o,i,e),Ih(this.originalOptions,o,i,e)}crosshairOptions(t){return Object.assign({},t.options.crosshair,{zIndex:0})}_pointsByVertical(t,e=0){const i=this.axisX.options.reverse?-1*e:e,s=this.axisX.children;let o=this._getPointAxisXIndex(t)+i;o=lt(o,s.length);const n=s[o].value,r=this.filterPoints((t=>Lh(t.pointData().x,n))).sort(((t,e)=>this._getPointAxisYIndex(t)-this._getPointAxisYIndex(e)));return this.axisY.options.reverse?r.reverse():r}_pointsByHorizontal(t,e=0){const i=this.axisY.options.reverse?-1*e:e,s=this.axisY.children;let o=this._getPointAxisYIndex(t)+i;o=lt(o,s.length);const n=s[o].value,r=this.filterPoints((t=>Lh(t.pointData().y,n))).sort(((t,e)=>this._getPointAxisXIndex(t)-this._getPointAxisXIndex(e)));return this.axisX.options.reverse?r.reverse():r}_getPointAxisXIndex(t){return this._getPointAxisIndex(this.axisX,t.pointData().x)}_getPointAxisYIndex(t){return this._getPointAxisIndex(this.axisY,t.pointData().y)}_getPointAxisIndex(t,e){return t.children.findIndex((t=>Lh(e,t.value)))}}function Lh(t,e){return t instanceof Date&&e instanceof Date?Ps(t,e):t===e}function Ih(t,e,i,s){ut([].concat(i?t.yAxis:t.xAxis)[e],s)}te(Eh,{xAxis:{},yAxis:{}}),ut(Eh.prototype,Ra);const Rh="color",Bh="first",Oh="max",Vh="min",Dh="noteText";El.current.register(dl,[Go,Zo,en,vn,Uo,fn,qo,sn,Yo,yn,Wo,xn,pn,un,wn,tn,dn,bn,...Mn]),El.current.register(Zl,[gn,mn,Xo,...Mn]),El.current.register(oh,[on]),El.current.register(ah,[$o]),El.current.register(class extends Pa{render(){this.createChart(Ch,Cr(this.series,[Qo])),this.createChart(Th,Cr(this.series,[Ko]))}createChart(t,e){const i=e[0];if(!i)return;const s=new t(this,{series:e,legend:this.options.legend,neckRatio:i.neckRatio,dynamicHeight:i.dynamicHeight,dynamicSlope:i.dynamicSlope,segmentSpacing:i.segmentSpacing,highlight:i.highlight});this.appendChart(s)}appendChart(t,e){super.appendChart(t,e),Dt(this.options.legend.data,t.legendItems)}_pointsByVertical(t){return this.pointsBySeriesIndex(t.series.index)}getPointToTheRight(t){return this.getPointBelow(t)}getPointToTheLeft(t){return this.getPointAbove(t)}},[Qo,Ko]),El.current.register(mh,[nn,rn,an,...Mn]),El.current.register(Ah,[ln,hn,cn,...Mn]),El.current.register(Eh,[Jo]),wo.current.register([Go,Zo,en,vn,Uo,fn],[j],[rr,Rh,Dh,Eo,Lo,pr,gr]),wo.current.register([pn,un,dn,bn],["from","to"],[rr,Rh,Dh,pr,gr]),wo.current.register([wn,tn],[j],[rr,Rh,Dh,"summary",pr,gr]),wo.current.register([nn,rn,an],[W,X],[Rh,pr,gr]),wo.current.register([ln,hn,cn],[j],[rr,Rh,pr,gr]),wo.current.register([Qo,Ko],[j],[rr,Rh,"visibleInLegend","visible",pr,gr]),Va.current.register([Go,Zo,en,vn,Uo,fn,wn,tn],{value:Oh,color:Bh,noteText:Bh,errorLow:Vh,errorHigh:Oh}),Va.current.register([pn,un,dn,bn],{from:Vh,to:Oh,color:Bh,noteText:Bh}),Va.current.register([ln,hn,cn],{value:Oh,color:Bh}),wo.current.register([gn,mn,Xo],[W,X],[Rh,Dh,Io,Ro,Bo,Oo]),wo.current.register([Xo],[W,X,"size"],[Rh,rr,Dh,gr]),wo.current.register([Jo],[W,X,j],[Rh,Dh,gr]),wo.current.register([qo,sn],["open","high","low","close"],[rr,Rh,"downColor",Dh,gr]),Va.current.register([qo,sn],{open:Oh,high:Oh,low:Vh,close:Oh,color:Bh,downColor:Bh,noteText:Bh}),wo.current.register([Wo,xn],["lower","q1","median","q3","upper","mean","outliers"],[rr,Rh,Dh,pr,gr]),Va.current.register([Wo,xn],{lower:Oh,q1:Oh,median:Oh,q3:Oh,upper:Oh,mean:Oh,outliers:Bh,color:Bh,noteText:Bh}),wo.current.register([Yo,yn],["current","target"],[rr,Rh,"visibleInLegend",Dh,pr,gr]),Va.current.register([Yo,yn],{current:Oh,target:Oh,color:Bh,noteText:Bh}),wo.current.register([on,$o],[j],[rr,Rh,"explode","visibleInLegend","visible",pr,gr]);const zh=[rr,j,W,X],Fh="mousedown",Hh="mousemove",Nh="contextmenu",jh="mouseleave",Uh="keydown",Gh="focus",Wh="blur",Xh="k-chart-overlay-top";class Yh extends e.a{constructor(t,e,i,s={}){super(),this.observers=[],this.addObserver(s.observer),this.chartService=new qi(this,s),this.chartService.theme=i,this._initElement(t);const o=ut({},this.options,e);this._originalOptions=ut({},o),this._theme=i,this._initTheme(o,i),this._focusState={},this._initHandlers(),this._initSurface(),this.bindCategories(),Jt.preloadFonts(e,(()=>{this.fontLoaded=!0,this._destroyed||(this.trigger("init"),this._redraw(),this._attachEvents(),this._restoreOverlayElement())}))}_initElement(t){this._setElementClass(t),t.style.position="relative",t.tabIndex=t.getAttribute("tabindex")?t.getAttribute("tabindex"):0,t.setAttribute("role","graphics-document document");for(let e=t.childNodes.length-1;e>=0;e--){const i=t.childNodes[e];Tt(i,"k-chart-overlay")?this.overlayElement=i:t.removeChild(i)}this.element=t}_setElementClass(t){K(t,"k-chart")}_restoreOverlayElement(){this.overlayElement&&(this._hasSeriesData()?this.overlayElement.style.display="none":(!this.options.title||this.options.title&&this.options.title.position!==c?K(this.overlayElement,Xh):tt(this.overlayElement,Xh),this.overlayElement.style.display=""),this.overlayElement.parentElement!==this.element&&this.element.appendChild(this.overlayElement))}_hasSeriesData(){const t=this.options.series||[];return t.length>0&&t.some((t=>t.data&&t.data.length>0))}_initTheme(t,e){const i=[],s=t.series||[];for(let t=0;t<s.length;t++)i.push(Object.assign({},s[t]));t.series=i,function(t){const e=zh;for(let i=0;i<e.length;i++){const s=e[i]+"Axes";t[s]&&(t[e[i]+"Axis"]=t[s],delete t[s])}}(t),this.applyDefaults(t,e),null===t.seriesColors&&delete t.seriesColors,ot(t.title)&&(t.title={text:t.title}),this.options=ut({},e,t),this.applySeriesColors()}getSize(){const t=this.options.chartArea||{};return{width:t.width?parseInt(t.width,10):Math.floor(this.element.offsetWidth),height:t.height?parseInt(t.height,10):Math.floor(this.element.offsetHeight)}}resize(t){const e=this.getSize(),i=this._size,s=e.width>0||e.height>0;t||s&&(!i||e.width!==i.width||e.height!==i.height)?(this._size=e,this._resize(e,t),this.trigger("resize",e)):s&&this._selections&&he(this._selections,(t=>!t.visible))&&(this._destroySelections(),this._setupSelection())}_resize(){this._noTransitionsRedraw()}redraw(t){if(this.applyDefaults(this.options),this.applySeriesColors(),t){const e=this._model._plotArea,i=e.findPane(t);e.redraw(i)}else this._redraw()}getAxis(t){return mo(t,this._plotArea.axes)}findAxisByName(t){return this.getAxis(t)}findPaneByName(t){const e=this._plotArea.panes;for(let i=0;i<e.length;i++)if(e[i].options.name===t)return new fo(e[i])}findPaneByIndex(t){const e=this._plotArea.panes;if(e[t])return new fo(e[t])}plotArea(){return new xo(this._plotArea)}toggleHighlight(t,e){const i=this._plotArea,s=(i.srcSeries||i.series||[])[0];let o;if(ht(e))o=i.filterPoints(e);else{let t,n;pt(e)?(t=e.series,n=e.category):t=n=e,o=s.type===$o?qh(i.pointsBySeriesName(t),n):Mt(s.type,[on,Qo,Ko])?qh((i.charts[0]||{}).points,n):i.pointsBySeriesName(t)}o&&this.togglePointsHighlight(t,o)}togglePointsHighlight(t,e){const i=this._highlight;for(let s=0;s<e.length;s++)i.togglePointHighlight(e[s],t)}showTooltip(t){const e=this._sharedTooltip(),{_tooltip:i,_plotArea:s}=this;let o,n;if(ht(t)?(o=s.findPoint(t),o&&e&&(n=o.categoryIx)):e&&Ft(t)&&(n=s.categoryAxis.categoryIndex(t)),e){if(n>=0){const t=this._plotArea.pointsByCategoryIndex(n);i.showAt(t)}}else o&&i.show(o)}hideTooltip(){this._tooltip.hide()}_initSurface(){const t=this.surface,i=this._surfaceWrap(),s=this.options.chartArea||{};s.width&&jt(i,{width:s.width}),s.height&&jt(i,{height:s.height}),t&&t.options.type===this.options.renderAs?(this.surface.clear(),this.surface.resize()):(this._destroySurface(),this.surface=e.n.create(i,{type:this.options.renderAs}),this.surface.bind("mouseenter",this._surfaceMouseenterHandler),this.surface.bind("mouseleave",this._surfaceMouseleaveHandler)),this.element._kendoExportVisual=this._kendoExportVisual.bind(this)}_surfaceWrap(){return this.element}_redraw(){const t=this._getModel();this._size={width:t.options.width,height:t.options.height},this._destroyView(),this._setElementAccessibilityAttributes(),this._model=t,this._plotArea=t._plotArea,this._legend=t._legend,t.renderVisual(),!1!==this.options.transitions&&t.traverse((function(t){t.animation&&t.animation.setup()})),this._initSurface(),this.surface.draw(t.visual),!1!==this.options.transitions&&t.traverse((function(t){t.animation&&t.animation.play()})),this._tooltip=this._createTooltip(),this._highlight=new gl,this._setupSelection(),this._createPannable(),this._createZoomSelection(),this._createMousewheelZoom(),this._setComputedStyles(),this.trigger(Zn),Jh(this._plotArea.panes),this._navState||this._cancelDomEvents(),this._redrawFocusHighlight()}_setComputedStyles(){const t=this.titleHeight();this.element.style.setProperty("--kendo-chart-computed-title-height",`${t}px`)}_redrawFocusHighlight(){if(this._destroyed)return;const{_focusState:{legendInFocus:t,preserveHighlight:e}}=this;t&&e&&(this._focusElement(this._getFocusedLegendItem(),!1),this._focusState.preserveHighlight=!1)}_setElementAccessibilityAttributes(){let t=this.options.title,e=ot(t)?t:t.description||t.text;e&&this.element.setAttribute("aria-roledescription",e)}_kendoExportVisual(t){if(t&&t.width&&t.height){const e=this._originalOptions.chartArea||{},i={width:e.width||t.width,height:e.height||t.height};return this.exportVisual(i)}return this.exportVisual()}exportVisual(t){let e;if(t&&(t.width||t.height||t.options)){const i=this.options,s=ut({},t.options,{chartArea:{width:t.width,height:t.height}});Kh(this._originalOptions,s),this.options=ut({},this._originalOptions,s),this._initTheme(this.options,this._theme),this.bindCategories();const o=this._getModel();o.renderVisual(),Jh(o._plotArea.panes),e=o.visual,this.options=i}else e=this.surface.exportVisual();return e}_sharedTooltip(){return this._plotArea instanceof dl&&this.options.tooltip&&this.options.tooltip.shared}_createPannable(){const t=this.options;!1!==t.pannable&&(this._pannable=new yl(this._plotArea,t.pannable))}_createZoomSelection(){const t=this.options.zoomable,e=(t||{}).selection;!1!==t&&!1!==e&&(this._zoomSelection=new vl(this,e))}_createMousewheelZoom(){const t=this.options.zoomable,e=(t||{}).mousewheel;!1!==t&&!1!==e&&(this._mousewheelZoom=new bl(this,e))}_toggleDragZoomEvents(){const t=this.options.pannable,e=this.options.zoomable,i=(e||{}).selection,s=(e||{}).mousewheel,o=!(t||!1!==e&&!1!==i||this.requiresHandlers([jn,Hn,Nn])),n=(!1===e||!1===s)&&!this.requiresHandlers([Un,Gn,Wn]),r=this.element;this._dragZoomEnabled&&o&&n?(r.style.touchAction=this._touchAction||"",this._dragZoomEnabled=!1):this._dragZoomEnabled||o&&n||(r.style.touchAction="none",this._dragZoomEnabled=!0),this._toggleDomEvents(!o,!n)}_toggleDomEvents(t,e){const i=this.domEvents;i&&(i.toggleDrag&&i.toggleDrag(t),i.toggleZoom&&i.toggleZoom(e))}_createTooltip(){const{options:{tooltip:t}}=this;let e;return e=this._sharedTooltip()?this._createSharedTooltip(t):new Bl(this.chartService,t),e}_createSharedTooltip(t){return new Ol(this._plotArea,t)}applyDefaults(t,e){!function(t,e){const i=(e||{}).axisDefaults||{};let s,o,n;function r(t){const e=(t||{}).color||o.color,n=ut({},i,i[s],o,o[s],{line:{color:e},labels:{color:e},title:{color:e}},t);return delete n[s],n}for(let e=0;e<zh.length;e++)s=zh[e]+"Axis",o=t.axisDefaults||{},n=[].concat(t[s]),n=n.map(r),t[s]=n.length>1?n:n[0]}(t,e),function(t,e){const i=t.series,s=i.length,o=t.seriesDefaults,n=ut({},t.seriesDefaults),r=e?ut({},e.seriesDefaults):{},a=ut({},r);Zh(n),Zh(a);for(let e=0;e<s;e++){const s=i[e].type||t.seriesDefaults.type,l=ut({data:[]},a,r[s],{tooltip:t.tooltip},n,o[s]);i[e]._defaults=l,i[e]=ut({},l,i[e]),i[e].data=i[e].data||[]}}(t,e)}applySeriesColors(){const t=this.options,e=t.series,i=t.seriesColors||[];for(let t=0;t<e.length;t++){const s=e[t],o=i[t%i.length],n=s._defaults;s.color=s.color||o,n&&(n.color=n.color||o)}}_getModel(){const t=this.options,e=this._createPlotArea(),i=new Ii(this._modelOptions());i.chart=this,i._plotArea=e;const s=Fi.buildTitle(t.title),o=Fi.buildTitle(t.subtitle,{align:t.title.align,position:t.title.position});if(i.append.apply(i,Fi.orderTitles([s,o])),t.legend&&t.legend.visible){const t=new Ml(e.options.legend,this.chartService);i.append(t),i._legend=t}return i.append(e),i.reflow(),this._setTitleBox(s,o),i}_setTitleBox(t,e){if(!t&&!e)return;this._titleBox=(t||e).box.clone();const i=t?t.options.position:"",s=e?e.options.position:"",o=s!==c;i===s&&e?this._titleBox.wrap(e.box):t&&e&&o&&(this._titleBox=e.box.clone())}_modelOptions(){const t=this.options,e=this.getSize();return ut({transitions:t.transitions,width:e.width||x,height:e.height||400},t.chartArea)}_createPlotArea(t){const e=this.options;return El.current.create(t?[]:e.series,e,this.chartService)}_setupSelection(){const{_plotArea:{axes:t}}=this,e=this._selections=[];for(let i=0;i<t.length;i++){const s=t[i],o=s.options;if(s instanceof Os&&o.select&&!o.vertical){const t=s.range(),i=new Rl(this,s,ut({min:t.min,max:t.max},o.select));e.push(i)}}}_selectStart(t){return this.trigger(Xn,t)}_select(t){return this.trigger(Yn,t)}_selectEnd(t){return this.trigger(qn,t)}_initHandlers(){this._clickHandler=this._click.bind(this),this._keydownHandler=this._keydown.bind(this),this._focusHandler=this._focus.bind(this),this._blurHandler=this._blur.bind(this),this._mousedownHandler=this._mousedown.bind(this),this._mousewheelHandler=this._mousewheel.bind(this),this._mouseleaveHandler=this._mouseleave.bind(this),this._surfaceMouseenterHandler=this._mouseover.bind(this),this._surfaceMouseleaveHandler=this._mouseout.bind(this),this._mousemoveThrottled=e.o(this._mousemove.bind(this),20)}addObserver(t){t&&this.observers.push(t)}removeObserver(t){const e=this.observers.indexOf(t);e>=0&&this.observers.splice(e,1)}requiresHandlers(t){const e=this.observers;for(let i=0;i<e.length;i++)if(e[i].requiresHandlers(t))return!0}trigger(t,e={}){e.sender=this,t===$n?e.anchor.point=this._toDocumentCoordinates(e.anchor.point):t===On?this._updateDrilldownPoint(e.point):t===Vn?this._resetDrilldownPoint():t===Rn?(this._focusPoint(e.point),this._startDrilldown(e.point)):t===En&&this._focusLegendItem(e);const i=this.observers;let s=!1;for(let o=0;o<i.length;o++)i[o].trigger(t,e)&&(s=!0);return s}titleHeight(){return this._titleBox?this._titleBox.height():0}_attachEvents(){const t=this.element;this._touchAction=t.style.touchAction,zt(t,{[Nh]:this._clickHandler,[cr]:this._mousewheelHandler,[jh]:this._mouseleaveHandler,[Uh]:this._keydownHandler,[Fh]:this._mousedownHandler,[Gh]:this._focusHandler,[Wh]:this._blurHandler}),this._shouldAttachMouseMove()&&zt(t,{[Hh]:this._mousemoveThrottled}),this.domEvents=$i.create(this.element,{start:this._start.bind(this),move:this._move.bind(this),end:this._end.bind(this),tap:this._tap.bind(this),gesturestart:this._gesturestart.bind(this),gesturechange:this._gesturechange.bind(this),gestureend:this._gestureend.bind(this)}),this._toggleDragZoomEvents()}_mouseleave(t){this._hoveredPoint&&(this._hoveredPoint.out(this,t),this._hoveredPoint=null),this._plotAreaHovered&&(this._plotAreaHovered=!1,this.trigger(Fn)),this._hasInactiveOpacity()&&this._activeChartInstance&&(this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._updateSeriesOpacity(null,!0))}_cancelDomEvents(){this.domEvents&&this.domEvents.cancel&&this.domEvents.cancel()}_gesturestart(t){this._mousewheelZoom&&!this._stopChartHandlers(t)&&(this._gestureDistance=t.distance,this._unsetActivePoint(),this._clearFocusedElement(),this.surface.suspendTracking())}_gestureend(t){this._zooming&&!this._stopChartHandlers(t)&&(this.surface&&this.surface.resumeTracking(),this._zooming=!1,this.trigger(Wn,{}))}_gesturechange(t){const e=this._mousewheelZoom;if(e&&!this._stopChartHandlers(t)){t.preventDefault();const i=this._gestureDistance;let s=-t.distance/i+1;if(Math.abs(s)>=.1){s=Math.round(10*s),this._gestureDistance=t.distance;const i={delta:s,axisRanges:$h(this._plotArea.axes),originalEvent:t};if(this._zooming||!this.trigger(Un,i)){const o=this._eventCoordinates(t);this._zooming||(this._zooming=!0);(i.axisRanges=e.updateRanges(s,o))&&!this.trigger(Gn,i)&&e.zoom()}}}}_mouseout(t){if(t.element){const e=this._drawingChartElement(t.element,t);e&&e.leave&&e.leave(this,t.originalEvent)}}_start(t){const e=this._eventCoordinates(t);!this._stopChartHandlers(t)&&this._plotArea.backgroundContainsPoint(e)&&(this.requiresHandlers([jn,Hn,Nn])&&this._startNavigation(t,e,jn),this._pannable&&this._pannable.start(t)&&(this.surface.suspendTracking(),this._unsetActivePoint(),this._clearFocusedElement(),this._suppressHover=!0,this.chartService.panning=!0),this._zoomSelection&&this._zoomSelection.start(t)&&this.trigger(Un,{axisRanges:$h(this._plotArea.axes),originalEvent:t}))}_move(t){let{_navState:e,_pannable:i}=this;if(!this._stopChartHandlers(t)){if(i){const e=i.move(t);e&&!this.trigger(Hn,{axisRanges:e,originalEvent:t})&&i.pan()}else if(e){const i={},s=e.axes;for(let e=0;e<s.length;e++){const o=s[e];if(o.options.name){const e=o.options.vertical?t.y:t.x,s=e.startLocation-e.location;0!==s&&(i[o.options.name]=o.translateRange(s))}}e.axisRanges=i,this.trigger(Hn,{axisRanges:i,originalEvent:t})}this._zoomSelection&&this._zoomSelection.move(t)}}_end(t){if(this._stopChartHandlers(t))return;const e=this._pannable;if(e&&e.end(t)?(this.surface.resumeTracking(),this.trigger(Nn,{axisRanges:$h(this._plotArea.axes),originalEvent:t}),this._suppressHover=!1,this.chartService.panning=!1):this._endNavigation(t,Nn),this._zoomSelection){const e=this._zoomSelection.end(t);e&&!this.trigger(Gn,{axisRanges:e,originalEvent:t})&&(this._zoomSelection.zoom(),this.trigger(Wn,{axisRanges:e,originalEvent:t}))}}_stopChartHandlers(t){const e=this._selections||[];if(!e.length)return!1;const i=this._eventCoordinates(t),s=this._plotArea.paneByPoint(i);if(s)for(let t=0;t<e.length;t++)if(e[t].onPane(s))return!0}_mousewheelZoomRate(){const t=(this.options.zoomable||{}).mousewheel||{};return Kt(t.rate,.3)}_mousewheel(t){const e=Vt(t),i=this._mousewheelZoom,s=this._eventCoordinates(t);if(!this._stopChartHandlers(t)&&this._plotArea.backgroundContainsPoint(s))if(i){const o={delta:e,axisRanges:$h(this._plotArea.axes),originalEvent:t};!this._zooming&&this.trigger(Un,o)||(t.preventDefault(),this._zooming||(this._unsetActivePoint(),this._clearFocusedElement(),this.surface.suspendTracking(),this._zooming=!0),this._mwTimeout&&clearTimeout(this._mwTimeout),o.axisRanges=i.updateRanges(e,s),o.axisRanges&&!this.trigger(Gn,o)&&i.zoom(),this._mwTimeout=setTimeout((()=>{this.trigger(Wn,o),this._zooming=!1,this.surface&&this.surface.resumeTracking()}),dr))}else{let i=this._navState;if(!i){this._startNavigation(t,s,Un)||(i=this._navState)}if(i){const o=i.totalDelta||e;i.totalDelta=o+e;const n=this._navState.axes,r={};for(let t=0;t<n.length;t++){const e=n[t],i=e.options.name;i&&(r[i]=e.scaleRange(-o*this._mousewheelZoomRate(),s))}this.trigger(Gn,{delta:e,axisRanges:r,originalEvent:t}),this._mwTimeout&&clearTimeout(this._mwTimeout),this._mwTimeout=setTimeout((()=>{this._endNavigation(t,Wn)}),dr)}}}_startNavigation(t,e,i){const s=this._model._plotArea,o=s.findPointPane(e),n=s.axes.slice(0);if(!o)return;const r=$h(n);this.trigger(i,{axisRanges:r,originalEvent:t})?this._cancelDomEvents():(this._suppressHover=!0,this._unsetActivePoint(),this._clearFocusedElement(),this._navState={axisRanges:r,pane:o,axes:n})}_endNavigation(t,e){this._navState&&(this.trigger(e,{axisRanges:this._navState.axisRanges,originalEvent:t}),this._suppressHover=!1,this._navState=null)}_getChartElement(t,e){const i=this.surface.eventTarget(t);if(i)return this._drawingChartElement(i,t,e)}_drawingChartElement(t,e,i){let s,o=t;for(;o&&!s;)s=o.chartElement,o=o.parent;if(s)return s.aliasFor&&(s=s.aliasFor(e,this._eventCoordinates(e))),i&&(s=s.closest(i),s&&s.aliasFor&&(s=s.aliasFor())),s}_eventCoordinates(t){const e=Ut(t);return this._toModelCoordinates(e.x,e.y)}_elementPadding(){if(!this._padding){const{paddingLeft:t,paddingTop:e}=xt(this.element,["paddingLeft","paddingTop"]);this._padding={top:e,left:t}}return this._padding}_toDocumentCoordinates(t){const e=this._elementPadding(),i=Nt(this.element);return{left:$t(t.x+e.left+i.left),top:$t(t.y+e.top+i.top)}}_toModelCoordinates(t,i){const s=this.element,o=Nt(s),n=this._elementPadding(),r=pe(s).invert(),a=new e.P(t-o.left-n.left,i-o.top-n.top).transform(r);return new di(a.x,a.y)}_tap(t){const e=this.surface.eventTarget(t),i=this._drawingChartElement(e,t),s=this._sharedTooltip();this._startHover(e,t)||s||this._unsetActivePoint(),s&&this._trackSharedTooltip(this._eventCoordinates(t),t,!0),this._propagateClick(i,t),this.handlingTap=!0,setTimeout((()=>{this.handlingTap=!1}),0)}_click(t){const e=this._getChartElement(t);this._propagateClick(e,t)}_propagateClick(t,e){let i=t;for(;i;)i.click&&i.click(this,e),i=i.parent}_isLegendBeforeChart(){const{options:{legend:{position:t}},_legend:e}=this;return e&&e.hasItems()&&(t===z||t===S)}_focus(){this._preventInitialPointFocus||(this._isLegendBeforeChart()?this._focusFirstLegendItem():this._focusFirstPoint()),this._preventInitialPointFocus=!1}_keydown(t){const{_focusState:{legendInFocus:e,focusedElement:i},_legend:s}=this;if("Tab"===t.key){this._clearFocusedElement();const i=this._isLegendBeforeChart();e&&i!==t.shiftKey?this._navigatePoints(t):!e&&i===t.shiftKey&&s.hasItems()&&this._navigateLegend(t)}else t.key===b?(i&&t.stopPropagation(),this._tooltip&&this._tooltip.visible?this._hideTooltip():this._blur()):t.key===v?i&&(this._focusState.preserveHighlight=!0,this._propagateClick(i,t),this._focusElement(i)):e?this._navigateLegend(t):this._navigatePoints(t)}_navigatePoints(t){const{_focusState:e,_plotArea:i}=this;if(e.legendInFocus=!1,!e.focusedElement)return this._focusFirstPoint(),void t.preventDefault();const a=i=>{e.focusedPoint=i,this._focusElement(e.focusedPoint),this._displayTooltip(i),t.preventDefault()};switch(t.key){case r:a(i.getPointToTheRight(e.focusedPoint));break;case n:a(i.getPointToTheLeft(e.focusedPoint));break;case o:a(i.getPointBelow(e.focusedPoint));break;case s:a(i.getPointAbove(e.focusedPoint))}}_navigateLegend(t){const{_focusState:e,_legend:i,chartService:{rtl:a}}=this;if(e.legendInFocus=!0,!e.focusedElement)return this._focusFirstLegendItem(),void t.preventDefault();const l=i.getItems().length,h=i=>{e.focusedLegendItemIndex=i(e.focusedLegendItemIndex,l),this._focusElement(this._getFocusedLegendItem()),t.preventDefault()};switch(t.key){case s:case n:h(a?rt:at);break;case o:case r:h(a?at:rt)}}_focusFirstPoint(){const t=this._focusState.focusedPoint=this._plotArea.getFirstPoint();t&&(this._focusElement(t),this._displayTooltip(t))}_hasFocus(){return this.element.ownerDocument.activeElement===this.element}_mousedown(){this._hasFocus()||(this._preventInitialPointFocus=!0)}_focusChart(){this._hasFocus()||(this._preventInitialPointFocus=!0,this.element.focus())}_focusPoint(t){this._focusState.focusedPoint=t,this._focusChart(),this._focusElement(t,!0)}_focusFirstLegendItem(){const{_focusState:t}=this;t.focusedLegendItemIndex=0,this._focusElement(this._getFocusedLegendItem()),t.legendInFocus=!0,this._hideTooltip()}_focusLegendItem(t){const{_focusState:e}=this;e.focusedLegendItemIndex=this._legend.getItems().findIndex((e=>e.options.series.index===t.seriesIndex&&e.options.pointIndex===t.pointIndex)),e.legendInFocus=!0,this._focusChart(),this._focusElement(this._getFocusedLegendItem(),!0)}_getFocusedLegendItem(){const{_focusState:t,_legend:e}=this;return e.getItems()[t.focusedLegendItemIndex]}_focusElement(t,e){const{_focusState:i}=this;if(this._clearFocusedElement(),t&&(i.focusedElement=t,this._setElementActiveDescendant(t),!e))if(t.focusVisual(),i.legendInFocus){const e=t.options;this._showSeriesInactiveOpacity(e.series.index,e.pointIndex)}else this._showInactiveOpacity(t)}_clearFocusedElement(){const{_focusState:t}=this;t&&(t.focusedElement&&t.focusedElement.clearFocusFromVisual&&(t.focusedElement.clearFocusFromVisual(),this._clearElementActiveDescendant()),t.focusedElement=null)}_setElementActiveDescendant(t){"canvas"===this.options.renderAs&&(this._pseudoFocusedElement=this._createPseudoFocusedElement(t),this.element.append(this._pseudoFocusedElement)),this.element.setAttribute(a,t._id)}_clearElementActiveDescendant(){this._pseudoFocusedElement&&(this._pseudoFocusedElement.remove(),this._pseudoFocusedElement=null),this.element.removeAttribute(a)}_createPseudoFocusedElement(t){const e=document.createElement("div"),i=t.options.accessibility;e.id=t._id,e.setAttribute("aria-label",t.getAriaLabelText()),e.setAttribute("role",i.role),e.setAttribute("aria-roledescription",i.ariaRoleDescription);const s=i.ariaChecked;return Ft(s)&&e.setAttribute("aria-checked",s),e}_blur(){this._focusState.legendInFocus=!1,this._clearFocusedElement(),this._hideInactiveOpacity()}_startHover(t,e){if(this._suppressHover)return!1;let i=this._drawingChartElement(t,e,(function(t){return(t.hover||t.over)&&!(t instanceof Pa)}));const s=this._activePoint;return this._updateHoveredPoint(i,e),i&&s!==i&&i.hover&&(this._activePoint=i,this._sharedTooltip()||i.hover(this,e)||(this._displayTooltip(i),this._showInactiveOpacity(i))),i}_displayTooltip(t){ut({},this.options.tooltip,t.options.tooltip).visible&&(this._sharedTooltip()&&t.box?this._trackSharedTooltip(t.box.center(),{}):this._tooltip.show(t))}_hideTooltip(){this._tooltip&&this._tooltip.hide()}_displayInactiveOpacity(t,e,i){const s=this._activeChartInstance=this._chartInstanceFromPoint(t);if(s)if(e)this._updateSeriesOpacity(t),this._applySeriesOpacity(s.children,null,!0),this._applySeriesOpacity(s.children,t.series),this._highlight.show(i||t);else{let e;if(!s.supportsPointInactiveOpacity())return void this._highlight.show(t);e=this._getInactivePoints(t,s),e&&e.length&&this._highlight.show(e,1-this._getInactiveOpacityForSeries(t.series))}}_getInactivePoints(t,e){return this._getAllPointsOfType(e,t.constructor).filter((e=>e!==t))}_getAllPointsOfType(t,e){let i=[];for(let s=0;s<t.children.length;s++){const o=t.children[s];o.constructor===e?i.push(o):o.children&&o.children.length&&(i=i.concat(this._getAllPointsOfType(o,e)))}return i}_updateHoveredPoint(t,e){const i=this._hoveredPoint;i&&i!==t&&(i.out(this,e),this._hoveredPoint=null),t&&i!==t&&t.over&&(this._hoveredPoint=t,t.over(this,e))}_updateDrilldownPoint(t){if(!t||!t.series)return;const{fields:e}=wo.current.bindPoint(t.series,null,t.dataItem);e.drilldown&&(this._drilldownState={cursor:this.element.style.cursor},this.element.style.cursor="pointer")}_resetDrilldownPoint(){this._drilldownState&&(this.element.style.cursor=this._drilldownState.cursor,this._drilldownState=null)}_startDrilldown(t){if(!t||!t.series)return;const e=t.series,{fields:i}=wo.current.bindPoint(e,null,t.dataItem),s=i.drilldown;if(s){const i={series:e,point:t,value:s,sender:this};this.trigger(ur,i)}}_updateSeriesOpacity(t,e){const i=this._plotArea,s=i.series.length;for(let o=0;o<s;o++){const s=i.series[o],n=this._getDefaultOpacityForSeries(s),r=this._getInactiveOpacityForSeries(s);e||s===t.series?(s.opacity=n,s.line&&(s.line.opacity=n)):(s.defaultOpacity=n,s.opacity=r,s.line&&(s.line.opacity=r))}}_applySeriesOpacity(t,e,i,s){for(let o=0;o<t.length;o++){const n=t[o],r=n.series||s;if(r&&(r.highlight||{}).visible&&n.visual){const t=s?s.opacity:n.series.opacity;(r!==e||i)&&n.visual.opacity(i?1:t)}n.children&&n.children.length&&this._applySeriesOpacity(n.children,e,i,n.series)}}_chartInstanceFromPoint(t){let e=t.parent;for(;e&&!e.plotArea;)e=e.parent;return e}_showInactiveOpacity(t){const e=this._plotArea.series.length>1;this._hasInactiveOpacity()?this._displayInactiveOpacity(t,e):this._highlight.show(t)}_hideInactiveOpacity(t){const e=this._plotArea.series.length>1;this._hasInactiveOpacity()&&(e&&this._activeChartInstance&&(this._updateSeriesOpacity(t,!0),this._applySeriesOpacity(this._activeChartInstance.children,null,!0),this._activeChartInstance=null),this._highlight&&this._highlight.hide(),this._activePoint=null)}_hasInactiveOpacity(){let t=void 0!==this.options.seriesDefaults.highlight.inactiveOpacity,e=this.options.series.filter((t=>void 0!==t.highlight.inactiveOpacity)).length>0;return t||e}_getInactiveOpacityForSeries(t){let e=this.options.seriesDefaults.highlight.inactiveOpacity;return t.highlight.inactiveOpacity||e||t.opacity||1}_getDefaultOpacityForSeries(t){return t.defaultOpacity||t.opacity||1}_mouseover(t){const e=this._startHover(t.element,t.originalEvent);e&&e.tooltipTracking&&!this._mouseMoveTrackHandler&&!this._sharedTooltip()&&(this._mouseMoveTrackHandler=this._mouseMoveTracking.bind(this),zt(document,{[Hh]:this._mouseMoveTrackHandler}))}_mouseMoveTracking(t){const{options:e,_tooltip:i,_highlight:s,_activePoint:o}=this,n=this._eventCoordinates(t);if(this._plotArea.box.containsPoint(n)){if(o&&o.tooltipTracking&&o.series&&o.parent.getNearestPoint){const r=o.parent.getNearestPoint(n.x,n.y,o.seriesIx);if(r&&r!==o&&(this._activePoint=r,!r.hover(this,t))){ut({},e.tooltip,r.options.tooltip).visible&&i.show(r),s.show(r)}}}else Qt(document,{[Hh]:this._mouseMoveTrackHandler}),this._unsetActivePoint(),this._clearFocusedElement(),this._mouseMoveTrackHandler=null,this._hideInactiveOpacity(o)}_mousemove(t){const e=this._eventCoordinates(t),i=this._plotArea;if(this._trackCrosshairs(e),i.hover){const s=i.backgroundContainsPoint(e);s?(this._plotAreaHovered=!0,this._plotArea.hover(this,t)):this._plotAreaHovered&&!s&&(this._plotAreaHovered=!1,this.trigger(Fn))}this._sharedTooltip()&&this._trackSharedTooltip(e,t)}_trackCrosshairs(t){const e=this._plotArea.crosshairs;for(let i=0;i<e.length;i++){const s=e[i];s.box.containsPoint(t)?s.showAt(t):s.hide()}}_trackSharedTooltip(t,e,i){if(this._suppressHover)return;const{options:{tooltip:s},_plotArea:o,_plotArea:{categoryAxis:n},_tooltip:r,_highlight:a}=this;if(o.backgroundContainsPoint(t)){const l=n.pointCategoryIndex(t);if(l!==this._tooltipCategoryIx||!this._sharedHighlight&&i){const i=o.pointsByCategoryIndex(l),n=i.map((function(t){return t.eventArgs(e)})),h=n[0]||{};h.categoryPoints=n,i.length>0&&!this.trigger(Bn,h)?(s.visible&&r.showAt(i,t),a.show(i),this._sharedHighlight=!0):r.hide(),this._tooltipCategoryIx=l}else i&&this._sharedHighlight&&(a.hide(),r.hide(),this._sharedHighlight=!1)}else this._sharedHighlight&&(a.hide(),r.hide(),this._tooltipCategoryIx=null,this._sharedHighlight=!1)}hideElements(t){const e=this._plotArea;this._mousemoveThrottled.cancel(),e.hideCrosshairs(),this._unsetActivePoint(t)}_unsetActivePoint(t){const{_highlight:e}=this;this._activePoint=null,this._hoveredPoint=null,t&&t.keepTooltipOpen||this._hideTooltip(),this._tooltipCategoryIx=null,this._sharedHighlight=!1,e&&e.hide()}_deferRedraw(){this._redraw()}_clearRedrawTimeout(){this._redrawTimeout&&(clearInterval(this._redrawTimeout),this._redrawTimeout=null)}bindCategories(){const t=this.options,e=[].concat(t.categoryAxis);for(let t=0;t<e.length;t++){const i=e[t];!1!==i.autoBind&&this.bindCategoryAxisFromSeries(i,t)}}bindCategoryAxisFromSeries(t,e){const i=new Set,s=this.options.series.filter((i=>i.categoryAxis===t.name||!i.categoryAxis&&0===e)),o=s.some((t=>Boolean(t.categoryField))),n=s.filter((t=>t.data&&t.data.length>0)),r=n.map((t=>wo.current.bindPoint(t,0).fields.category)),a=r.reduce(((e,i)=>e||Lr(t,i)),!1);if(n.filter(((t,e)=>t.categoryField||Ft(r[e]))).forEach((t=>t.data.forEach(((e,s)=>{let o=wo.current.bindPoint(t,s).fields.category;if(a){const t=Pr(o,e,this.chartService.intl);o=t?t.getTime():void 0}i.add(o)})))),i.size>0){let e=Array.from(i.values());a&&(e=e.sort().map((t=>t&&new Date(t)))),t.categories=e}else o&&(t.categories=[])}_isBindable(t){const e=wo.current.valueFields(t);let i=!0;for(let s=0;s<e.length;s++){let o=e[s];if(o===j?o="field":o+="Field",!Ft(t[o])){i=!1;break}}return i}_noTransitionsRedraw(){const t=this.options;let e;!1!==t.transitions&&(t.transitions=!1,e=!0),this._redraw(),e&&(t.transitions=!0)}_legendItemHover(t,e){this._showSeriesInactiveOpacity(t,e)}_showSeriesInactiveOpacity(t,e){const{_plotArea:i,_highlight:s}=this,o=(i.srcSeries||i.series)[t];let n;if(n=Mt(o.type,[on,$o,Qo,Ko])?i.findPoint((function(i){return i.series.index===t&&i.index===e})):i.pointsBySeriesIndex(t),this._hasInactiveOpacity()&&o.visible&&n){const t=i.series.length>1,e=n.length?n[0]:n;this._displayInactiveOpacity(e,t,n)}else s.show(n)}_shouldAttachMouseMove(){return this._plotArea.crosshairs.length||this._tooltip&&this._sharedTooltip()||this.requiresHandlers([zn,Fn])}updateMouseMoveHandler(){Qt(this.element,{[Hh]:this._mousemoveThrottled}),this._shouldAttachMouseMove()&&zt(this.element,{[Hh]:this._mousemoveThrottled})}applyOptions(t,e){Kh(this._originalOptions,t),this._originalOptions=ut(this._originalOptions,t),this.options=ut({},this._originalOptions),e&&(this._theme=e,this.chartService.theme=e),this._initTheme(this.options,this._theme),this._toggleDragZoomEvents()}setOptions(t,e){this.applyOptions(t,e),this.bindCategories(),this.redraw(),this.updateMouseMoveHandler(),this._restoreOverlayElement()}setDirection(t){this.chartService.rtl=Boolean(t),this.surface&&"svg"===this.surface.type&&this._destroySurface()}setIntlService(t){this.chartService.intl=t}noTransitionsRedraw(){this._noTransitionsRedraw()}destroy(){this._destroyed=!0,Qt(this.element,{[Nh]:this._clickHandler,[cr]:this._mousewheelHandler,[Hh]:this._mousemoveThrottled,[jh]:this._mouseleaveHandler,[Fh]:this._mousedownHandler,[Uh]:this._keydownHandler,[Gh]:this._focusHandler,[Wh]:this._blurHandler}),this.domEvents&&(this.domEvents.destroy(),delete this.domEvents),this._mouseMoveTrackHandler&&Qt(document,{[Hh]:this._mouseMoveTrackHandler}),this._focusState=null,this.element._kendoExportVisual=null,this._destroyView(),this._destroySurface(),this._clearRedrawTimeout()}_destroySurface(){const t=this.surface;t&&(t.unbind("mouseenter",this._surfaceMouseenterHandler),t.unbind("mouseleave",this._surfaceMouseleaveHandler),t.destroy(),this.surface=null)}_destroySelections(){const t=this._selections;if(t)for(;t.length>0;)t.shift().destroy()}_destroyView(){const t=this._model;t&&(t.destroy(),this._model=null),this._unsetActivePoint(),this._clearFocusedElement(),this._resetDrilldownPoint(),this._destroySelections(),this._tooltip&&this._tooltip.destroy(),this._highlight&&this._highlight.destroy(),this._zoomSelection&&(this._zoomSelection.destroy(),delete this._zoomSelection),this._pannable&&(this._pannable.destroy(),delete this._pannable),this._mousewheelZoom&&(this._mousewheelZoom.destroy(),delete this._mousewheelZoom)}}function qh(t,e){if(t)for(let i=0;i<t.length;i++)if(t[i].category===e)return[t[i]]}function Zh(t){delete t.bar,delete t.column,delete t.rangeColumn,delete t.line,delete t.verticalLine,delete t.pie,delete t.donut,delete t.area,delete t.verticalArea,delete t.scatter,delete t.scatterLine,delete t.bubble,delete t.candlestick,delete t.ohlc,delete t.boxPlot,delete t.bullet,delete t.verticalBullet,delete t.polarArea,delete t.polarLine,delete t.radarArea,delete t.radarLine,delete t.waterfall}function $h(t){const e={};for(let i=0;i<t.length;i++){const s=t[i],o=s.options.name;o&&(e[o]=s.range())}return e}const Qh=["data","categories"];function Kh(t,e){for(let i in e)if(!Mt(i,Qh)&&we(e,i)){const s=e[i],o=t[i];if(Ft(o)){const n=null===s;n||!Ft(s)?(delete t[i],n&&delete e[i]):o&&pt(s)&&pt(o)&&Kh(o,s)}}}function Jh(t){for(let e=0;e<t.length;e++)t[e].notifyRender()}te(Yh,{renderAs:"",chartArea:{},legend:{visible:!0,labels:{},accessibility:{},focusHighlight:{border:{opacity:1,color:h,width:2}}},categoryAxis:{},seriesDefaults:{type:Zo,data:[],highlight:{visible:!0},labels:{},negativeValues:{visible:!1},accessibility:{},focusHighlight:{border:{opacity:1,width:2},zIndex:200}},series:[],seriesColors:null,tooltip:{visible:!1},transitions:!0,valueAxis:{narrowRange:!1},plotArea:{},title:{},xAxis:{},yAxis:{},panes:[{}],pannable:!1,zoomable:!1});class tc extends Ol{_slotAnchor(t,e){const i=this.plotArea.categoryAxis.options.vertical,s=i?{horizontal:"left",vertical:"center"}:{horizontal:"center",vertical:"bottom"};let o;return o=i?new di(this.plotArea.box.x2,e.center().y):new di(e.center().x,-2),{point:o,align:s}}_defaultAnchor(t,e){return this._slotAnchor({},e)}}const ec=[Go,Yo];function ic(t){const e=[];for(let i=0;i<t.length;i++){const s=t[i];e[i]=s.style.display,s.style.display="none"}return e}function sc(t,e){for(let i=0;i<t.length;i++)t[i].style.display=e[i]}function oc(t){return st(t)?[t]:t}class nc extends Yh{_setElementClass(t){K(t,"k-sparkline")}_initElement(t){super._initElement(t),this._initialWidth=Math.floor(jt(t).width)}_resize(){const t=this.element,e=ic(t.childNodes);this._initialWidth=Math.floor(jt(t).width),sc(t.childNodes,e),super._resize()}_modelOptions(){const t=this.options,e=this._surfaceWrap(),i=ic(e.childNodes),s=document.createElement("span");s.innerHTML=" ",e.appendChild(s);const o=ut({width:this._autoWidth,height:jt(e).height,transitions:t.transitions},t.chartArea,{inline:!0,align:!1});return jt(e,{width:o.width,height:o.height}),e.removeChild(s),sc(e.childNodes,i),this.surface&&this.surface.resize(),o}_surfaceWrap(){if(!this.stage){const t=this.stage=document.createElement("span");this.element.appendChild(t)}return this.stage}_createPlotArea(t){const e=super._createPlotArea(t);return this._autoWidth=this._initialWidth||this._calculateWidth(e),e}_calculateWidth(t){const e=this.options,i=yt(e.chartArea.margin),s=t.charts,o=this._surfaceWrap();let n=0;for(let t=0;t<s.length;t++){const e=s[t],i=(e.options.series||[])[0];if(!i)continue;if(i.type===Go)return 150;if(i.type===Yo)return 150;if(i.type===on)return jt(o).height;const r=e.categoryAxis;if(r){const t=r.categoriesCount()*(!e.options.isStacked&&Mt(i.type,[Zo,yn])?e.seriesOptions.length:1);n=Math.max(n,t)}}let r=n*e.pointWidth;return r>0&&(r+=i.left+i.right),r}_createSharedTooltip(t){return new tc(this._plotArea,t)}static normalizeOptions(t){let e=oc(t);return e=Q(e)?{seriesDefaults:{data:e}}:ut({},e),e.series||(e.series=[{data:oc(e.data)}]),ut(e,{seriesDefaults:{type:e.type}}),(Mt(e.series[0].type,ec)||Mt(e.seriesDefaults.type,ec))&&(e=ut({},{categoryAxis:{crosshair:{visible:!1}}},e)),e}}te(nc,{chartArea:{margin:2},axisDefaults:{visible:!1,majorGridLines:{visible:!1},valueAxis:{narrowRange:!0}},seriesDefaults:{type:"line",area:{line:{width:.5}},bar:{stack:!0},padding:2,width:.5,overlay:{gradient:null},highlight:{visible:!1},border:{width:0},markers:{size:2,visible:!1}},tooltip:{visible:!0,shared:!0},categoryAxis:{crosshair:{visible:!0,tooltip:{visible:!1}}},legend:{visible:!1},transitions:!1,pointWidth:5,panes:[{clip:!1}]});class rc extends e.c{setup(){this._initialOpacity=parseFloat(xt(this.element,"opacity").opacity)}step(t){xt(this.element,{opacity:String(Et(this._initialOpacity,0,t))})}abort(){super.abort(),xt(this.element,{display:"none",opacity:String(this._initialOpacity)})}cancel(){super.abort(),xt(this.element,{opacity:String(this._initialOpacity)})}}function ac(t,e){const i=document.createElement("div");return i.className=t,e&&(i.style.cssText=e),i}class lc extends e.a{constructor(t,e,i){super(),this.options=ut({},this.options,i),this.container=t,this.chartService=e;const s=xt(t,["paddingLeft","paddingTop"]);this.chartPadding={top:s.paddingTop,left:s.paddingLeft},this.createElements(),t.appendChild(this.element)}createElements(){const t=this.element=ac("k-navigator-hint","display: none; position: absolute; top: 1px; left: 1px;"),e=this.tooltip=ac("k-tooltip k-chart-tooltip"),i=this.scroll=ac("k-scroll");e.innerHTML=" ",t.appendChild(e),t.appendChild(i)}show(t,e,i){const{element:s,options:o,scroll:n,tooltip:r}=this,a=vs(Ts(t)+Ts(e-t)/2),l=.4*i.width(),h=i.center().x-l,c=(i.center().x-h)/(o.max-o.min),d=a-o.min;let u=this.chartService.intl.format(o.format,t,e);const p=wt(o);this.clearHideTimeout(),this._visible||(xt(s,{visibility:"hidden",display:"block"}),this._visible=!0),p&&(u=p({from:t,to:e})),r.innerHTML=u,xt(r,{left:i.center().x-r.offsetWidth/2,top:i.y1});const g=xt(r,["marginTop","borderTopWidth","height"]);xt(n,{width:l,left:h+d*c,top:i.y1+g.marginTop+g.borderTopWidth+g.height/2}),xt(s,{visibility:"visible"})}clearHideTimeout(){this._hideTimeout&&clearTimeout(this._hideTimeout),this._hideAnimation&&this._hideAnimation.cancel()}hide(){this.clearHideTimeout(),this._hideTimeout=setTimeout((()=>{this._visible=!1,this._hideAnimation=new rc(this.element),this._hideAnimation.setup(),this._hideAnimation.play()}),this.options.hideDelay)}destroy(){this.clearHideTimeout(),this.container&&this.container.removeChild(this.element),delete this.container,delete this.chartService,delete this.element,delete this.tooltip,delete this.scroll}}te(lc,{format:"{0:d} - {1:d}",hideDelay:500});const hc="_navigator",cc=hc,dc="_default";var uc=Object.freeze({__proto__:null,DEFAULT_PANE:dc,NAVIGATOR_AXIS:cc,NAVIGATOR_PANE:hc});let pc=class t extends e.a{constructor(t){super(),this.chart=t;const e=this.options=ut({},this.options,t.options.navigator),i=e.select;i&&(i.from=this.parseDate(i.from),i.to=this.parseDate(i.to)),Ft(e.hint.visible)||(e.hint.visible=e.visible),this.chartObserver=new It(this,{[Hn]:"_drag",[Nn]:"_dragEnd",[Gn]:"_zoom",[Wn]:"_zoomEnd"}),t.addObserver(this.chartObserver)}parseDate(t){return Is(this.chart.chartService.intl,t)}clean(){this.selection&&(this.selection.destroy(),this.selection=null),this.hint&&(this.hint.destroy(),this.hint=null)}destroy(){this.chart&&(this.chart.removeObserver(this.chartObserver),delete this.chart),this.clean()}redraw(){this._redrawSelf(),this.initSelection()}initSelection(){const{chart:t,options:e}=this,i=this.mainAxis(),{min:s,max:o}=i.roundedRange(),{from:n,to:r,mousewheel:a}=e.select,l=(h=i,gc.prototype=h,new gc);var h;0!==i.categoriesCount()&&(this.clean(),l.box=i.box,this.selection=new Rl(t,l,{min:s,max:o,from:n||s,to:r||o,mousewheel:Kt(a,{zoom:"left"}),visible:e.visible},new It(this,{selectStart:"_selectStart",select:"_select",selectEnd:"_selectEnd"})),e.hint.visible&&(this.hint=new lc(t.element,t.chartService,{min:s,max:o,template:wt(e.hint),format:e.hint.format})))}setRange(){const t=this.chart._createPlotArea(!0).namedCategoryAxes[cc],{min:e,max:i}=t.roundedRange(),s=this.options.select||{};let o=s.from||e;o<e&&(o=e);let n=s.to||i;n>i&&(n=i),this.options.select=ut({},s,{from:o,to:n}),this.filterAxes()}_redrawSelf(t){const e=this.chart._plotArea;e&&e.redraw(Xt(e.panes),t)}redrawSlaves(){const t=this.chart,e=t._plotArea,i=e.panes.filter((t=>t.options.name!==hc));e.srcSeries=t.options.series,e.options.categoryAxis=t.options.categoryAxis,e.clearSeriesPointsCache(),e.redraw(i)}_drag(t){const{chart:e,selection:i}=this,s=e._eventCoordinates(t.originalEvent),o=this.mainAxis(),n=o.roundedRange(),r=o.pane.box.containsPoint(s),a=e._plotArea.categoryAxis,l=t.axisRanges[a.options.name],h=this.options.select;let c;if(!l||r||!i)return;c=h.from&&h.to?Ts(h.to)-Ts(h.from):Ts(i.options.to)-Ts(i.options.from);const d=vs(Yt(Ts(l.min),n.min,Ts(n.max)-c)),u=vs(Yt(Ts(d)+c,Ts(n.min)+c,n.max));this.options.select={from:d,to:u},this.options.liveDrag&&(this.filterAxes(),this.redrawSlaves()),i.set(d,u),this.showHint(d,u)}_dragEnd(){this.filterAxes(),this.filter(),this.redrawSlaves(),this.hint&&this.hint.hide()}readSelection(){const{selection:{options:{from:t,to:e}},options:{select:i}}=this;i.from=t,i.to=e}filterAxes(){const{options:{select:t={}},chart:e}=this,i=e.options.categoryAxis,{from:s,to:o}=t;for(let t=0;t<i.length;t++){const e=i[t];e.pane!==hc&&(e.min=s,e.max=o)}}filter(){const{chart:t,options:{select:e}}=this;if(!t.requiresHandlers(["navigatorFilter"]))return;const i=this.mainAxis(),s={from:e.from,to:e.to};if("category"!==i.options.type){const i=new Ws(ut({baseUnit:"fit"},t.options.categoryAxis[0],{categories:[e.from,e.to]}),t.chartService).options;s.from=_s(i.min,-i.baseUnitStep,i.baseUnit),s.to=_s(i.max,i.baseUnitStep,i.baseUnit)}this.chart.trigger("navigatorFilter",s)}_zoom(t){const{chart:{_plotArea:{categoryAxis:e}},selection:i,options:{select:s,liveDrag:o}}=this,n=this.mainAxis();let r=t.delta;if(!i)return;const a=n.categoryIndex(i.options.from),l=n.categoryIndex(i.options.to),h=this.chart._eventCoordinates(t.originalEvent);t.originalEvent.preventDefault(),Math.abs(r)>1&&(r*=3),l-a>1?(i.zoom(r,h),this.readSelection()):(e.options.min=s.from,s.from=e.scaleRange(-t.delta*this.chart._mousewheelZoomRate(),h).min),o&&(this.filterAxes(),this.redrawSlaves()),i.set(s.from,s.to),this.showHint(this.options.select.from,this.options.select.to)}_zoomEnd(t){this._dragEnd(t)}showHint(t,e){const i=this.chart._plotArea;this.hint&&this.hint.show(t,e,i.backgroundBox())}_selectStart(t){return this.chart._selectStart(t)}_select(t){return this.showHint(t.from,t.to),this.chart._select(t)}_selectEnd(t){return this.hint&&this.hint.hide(),this.readSelection(),this.filterAxes(),this.filter(),this.redrawSlaves(),this.chart._selectEnd(t)}mainAxis(){const t=this.chart._plotArea;if(t)return t.namedCategoryAxes[cc]}select(t,e){const i=this.options.select;return t&&e&&(i.from=this.parseDate(t),i.to=this.parseDate(e),this.filterAxes(),this.filter(),this.redrawSlaves(),this.selection.set(t,e)),{from:i.from,to:i.to}}static setup(e={},i={}){if(e.__navi)return;e.__navi=!0;const s=ut({},i.navigator,e.navigator),o=e.panes=[].concat(e.panes),n=ut({},s.pane,{name:hc});s.visible||(n.visible=!1,n.height=.1),"top"!==e.navigator.position?o.push(n):o.unshift(n),o.forEach((t=>{t.name=t.name||dc})),t.attachAxes(e,s),t.attachSeries(e,s,i)}static attachAxes(t,e){const i=e.series||[],s=t.categoryAxis=[].concat(t.categoryAxis),o=t.valueAxis=[].concat(t.valueAxis);s.concat(o).forEach((t=>{t.pane=t.pane||dc}));const n=0===Cr(i,_n).length,r=ut({type:"date",pane:hc,roundToBaseUnit:!n,justified:n,_collapse:!1,majorTicks:{visible:!0},tooltip:{visible:!1},labels:{step:1},autoBind:e.autoBindElements,autoBaseUnitSteps:{minutes:[1],hours:[1,2],days:[1,2],weeks:[],months:[1],years:[1]}}),a=e.categoryAxis;s.push(ut({},r,{maxDateGroups:200},a,{name:cc,title:null,baseUnit:"fit",baseUnitStep:"auto",labels:{visible:!1},majorTicks:{visible:!1}}),ut({},r,a,{name:cc+"_labels",maxDateGroups:20,baseUnitStep:"auto",labels:{position:""},plotBands:[],autoBaseUnitSteps:{minutes:[]},_overlap:!0}),ut({},r,a,{name:cc+"_ticks",maxDateGroups:200,majorTicks:{width:.5},plotBands:[],title:null,labels:{visible:!1,mirror:!0},_overlap:!0})),o.push(ut({name:cc,pane:hc,majorGridLines:{visible:!1},visible:!1},e.valueAxis))}static attachSeries(t,e,i){const s=t.series=t.series||[],o=[].concat(e.series||[]),n=i.seriesColors,r=e.seriesDefaults;for(let t=0;t<o.length;t++)s.push(ut({color:n[t%n.length],categoryField:e.dateField,visibleInLegend:!1,tooltip:{visible:!1}},r,o[t],{axis:cc,categoryAxis:cc,autoBind:e.autoBindElements}))}};function gc(){}class mc extends Yh{applyDefaults(t,e){const i=jt(this.element).width||x;let s=e;const o={seriesDefaults:{categoryField:t.dateField},axisDefaults:{categoryAxis:{name:"default",majorGridLines:{visible:!1},labels:{step:2},majorTicks:{visible:!1},maxDateGroups:Math.floor(i/28)}}};s&&(s=ut({},s,o)),pc.setup(t,s),super.applyDefaults(t,s)}_setElementClass(t){K(t,"k-chart k-stockchart")}setOptions(t){this.destroyNavigator(),super.setOptions(t)}noTransitionsRedraw(){const t=this.options.transitions;this.options.transitions=!1,this._fullRedraw(),this.options.transitions=t}_resize(){this.noTransitionsRedraw()}_redraw(){const t=this.navigator;!this._dirty()&&t&&t.options.partialRedraw?t.redrawSlaves():this._fullRedraw()}_dirty(){const t=this.options,e=Ct([].concat(t.series,t.navigator.series),(function(t){return t&&t.visible})).length,i=this._seriesCount!==e;return this._seriesCount=e,i}_fullRedraw(){let t=this.navigator;t||(t=this.navigator=new pc(this),this.trigger("navigatorCreated",{navigator:t})),t.clean(),t.setRange(),super._redraw(),t.initSelection()}_trackSharedTooltip(t){const e=this._plotArea.paneByPoint(t);e&&e.options.name===hc?this._unsetActivePoint():super._trackSharedTooltip(t)}bindCategories(){super.bindCategories(),this.copyNavigatorCategories()}copyNavigatorCategories(){const t=[].concat(this.options.categoryAxis);let e;for(let i=0;i<t.length;i++){const s=t[i];s.name===cc?e=s.categories:e&&s.pane===hc&&(s.categories=e)}}destroyNavigator(){this.navigator&&(this.navigator.destroy(),this.navigator=null)}destroy(){this.destroyNavigator(),super.destroy()}_stopChartHandlers(t){const e=this._eventCoordinates(t),i=this._plotArea.paneByPoint(e);return super._stopChartHandlers(t)||i&&i.options.name===hc}_toggleDragZoomEvents(){this._dragZoomEnabled||(this.element.style.touchAction="none",this._dragZoomEnabled=!0)}}te(mc,{dateField:"date",axisDefaults:{categoryAxis:{type:"date",baseUnit:"fit",justified:!0},valueAxis:{narrowRange:!0,labels:{format:"C"}}},navigator:{select:{},seriesDefaults:{markers:{visible:!1},tooltip:{visible:!1},highlight:{visible:!1},line:{width:2}},hint:{},visible:!0},tooltip:{visible:!0},legend:{visible:!1}});const fc=150,xc="arrowPointer",yc="barPointer",vc=.5,bc=Math.PI/180,wc="inside",_c="linear",kc="outside",Ac="radialPointer",Sc="radialRangePointer";function Cc(t,e){const i=t.getOrigin(),s=t.getSize(),o=yt(e);return t.setOrigin([i.x-o.left,i.y-o.top]),t.setSize([s.width+(o.left+o.right),s.height+(o.top+o.bottom)]),t}const{Group:Tc,Path:Pc,Text:Mc}=e.e;function Ec(t,i){const s=t.box,o=t.children[0].box,n=i.border||{},r=i.background||"",a=Pc.fromRect(new e.R([s.x1,s.y1],[s.width(),s.height()]),{stroke:{}}),l=new Mc(t.text,new e.P(o.x1,o.y1),{font:i.font,fill:{color:i.color}}),h=Cc(l.bbox().clone(),i.padding),c=Pc.fromRect(h,{stroke:{color:n.width?n.color:"",width:n.width,opacity:n.opacity,dashType:n.dashType,lineJoin:"round",lineCap:"round"},fill:{color:r}}),d=new Tc;return d.append(a),d.append(c),d.append(l),d}function Lc(t,e,i){const s=Ft(t.from)?t.from:T,o=Ft(t.to)?t.to:C;return t.from=Math.max(Math.min(o,s),e),t.to=Math.min(Math.max(o,s),i),t}function Ic(t,e){const i=yt(e);return i.left=-i.left,i.top=-i.top,i.right=-i.right,i.bottom=-i.bottom,Cc(t,i)}const{Path:Rc,Surface:Bc}=e.e;class Oc extends e.a{constructor(t,e,i,s={}){super(),this.element=t,this.theme=i,this.contextService=new qi(this,s),this._originalOptions=ut({},this.options,e),this.options=ut({},this._originalOptions),this._initTheme(i),this.redraw()}destroy(){this.surface&&(this.surface.destroy(),this.surface=null),delete this.element,delete this.surfaceElement}value(t){const e=this.pointers[0];if(0===arguments.length)return e.value();e.value(t),this._setValueOptions(t)}_draw(){const t=this.surface;t.clear(),t.draw(this._visuals)}exportVisual(){return this._visuals}allValues(t){const e=this.pointers,i=[];if(0===arguments.length){for(let t=0;t<e.length;t++)i.push(e[t].value());return i}if(Q(t))for(let i=0;i<t.length;i++)st(t[i])&&e[i].value(t[i]);this._setValueOptions(t)}_setValueOptions(t){const e=[].concat(this.options.pointer),i=[].concat(t);for(let t=0;t<i.length;t++)e[t].value=i[t]}resize(){this.noTransitionsRedraw()}noTransitionsRedraw(){const t=this.options.transitions;this._toggleTransitions(!1),this.redraw(),this._toggleTransitions(t)}redraw(){const t=this._surfaceSize(),i=new e.R([0,0],[t.width,t.height]);this._initSurface(),this.gaugeArea=this._createGaugeArea(),this._createModel();const s=Ic(i.bbox(),this._gaugeAreaMargin);this.reflow(s)}setOptions(t,e){this._originalOptions=ut(this._originalOptions,t),this.options=ut({},this._originalOptions),this._initTheme(e),this.redraw()}setDirection(t){this.contextService.rtl=Boolean(t),this.surface&&"svg"===this.surface.type&&(this.surface.destroy(),this.surface=null)}setIntlService(t){this.contextService.intl=t}_initTheme(t){let e=t||this.theme||{};this.theme=e,this.options=ut({},e,this.options);const i=this.options,s=i.pointer;if(Q(s)){const t=[];for(let i=0;i<s.length;i++)t.push(ut({},e.pointer,s[i]));i.pointer=t}}_createGaugeArea(){const t=this.options.gaugeArea,i=this.surface.size(),s=t.border||{};let o=new e.R([0,0],[i.width,i.height]);this._gaugeAreaMargin=t.margin||5,s.width>0&&(o=Ic(o,s.width));return Rc.fromRect(o,{stroke:{color:s.width?s.color:"",width:s.width,opacity:s.opacity,dashType:s.dashType,lineJoin:"round",lineCap:"round"},fill:{color:t.background}})}_initSurface(){const{options:t,surface:e}=this,i=this._surfaceElement(),s=this._surfaceSize();jt(i,s),e&&e.options.type===t.renderAs?(this.surface.clear(),this.surface.resize()):(e&&e.destroy(),this.surface=Bc.create(i,{type:t.renderAs}))}_surfaceSize(){const t=this.options,e=this._getSize();return t.gaugeArea&&ut(e,t.gaugeArea),e}_surfaceElement(){return this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.element.appendChild(this.surfaceElement)),this.surfaceElement}getSize(){return this._getSize()}_getSize(){const t=this.element,e=this._defaultSize();let i=t.offsetWidth,s=t.offsetHeight;return i||(i=e.width),s||(s=e.height),{width:i,height:s}}_defaultSize(){return{width:200,height:200}}_toggleTransitions(t){this.options.transitions=t;for(let e=0;e<this.pointers.length;e++)this.pointers[e].options.animation.transitions=t}}te(Oc,{plotArea:{},theme:"default",renderAs:"",pointer:{},scale:{},gaugeArea:{}});const{Path:Vc,Group:Dc}=e.e,zc=e.P;function Fc(t,e){const{position:i,tickX:s,tickY:o}=t;let n,r;t.vertical?(n=new zc(s,i),r=new zc(s+e.size,i)):(n=new zc(i,o),r=new zc(i,o+e.size));return new Vc({stroke:{color:e.color,width:e.width}}).moveTo(n).lineTo(r)}function Hc(t,e,i,s){const o=e.length;if(s.visible){const{mirror:n,lineBox:r}=i;for(let a=s.skip;a<o;a+=s.step)a%s.skipUnit!=0&&(i.tickX=n?r.x2:r.x2-s.size,i.tickY=n?r.y1-s.size:r.y1,i.position=e[a],t.append(Fc(i,s)))}}class Nc extends $s{constructor(t,e){let i=t||{};!Ft(i.reverse)&&!1===i.vertical&&(e||{}).rtl&&(i=Object.assign({},i,{reverse:!0})),super(0,1,i,e),this.options.minorUnit=this.options.minorUnit||this.options.majorUnit/10}initUserOptions(t){let e=ut({},this.options,t);return e=ut({},e,{labels:{mirror:e.mirror}}),e.majorUnit=e.majorUnit||ci(e.min,e.max),e}initFields(){}render(){const t=this.elements=new Dc,e=this.renderLabels(),i=this.renderLine(),s=this.renderTicks(),o=this.renderRanges();return t.append(i,e,s,o),t}renderRanges(){const t=this.options,{min:i,max:s,vertical:o,labels:{mirror:n}}=t,r=t.ranges||[],a=new Dc,l=r.length,h=t.rangeSize||t.minorTicks.size/2;for(let t=0;t<l;t++){const l=Lc(r[t],i,s),c=this.getSlot(l.from,l.to),d=o?this.lineBox():c,u=o?c:this.lineBox();o?d.x1-=h*(n?-1:1):u.y2+=h*(n?-1:1),a.append(Vc.fromRect(new e.R([d.x1,u.y1],[d.x2-d.x1,u.y2-u.y1]),{fill:{color:l.color,opacity:l.opacity},stroke:{}}))}return a}renderLabels(){const{labels:t,options:e}=this,i=new Dc;for(let s=0;s<t.length;s++)i.append(Ec(t[s],e.labels));return i}renderLine(){const t=this.options.line,e=this.lineBox(),i=new Dc;if(t.width>0&&t.visible){const s=new Vc({stroke:{color:t.color,dashType:t.dashType,width:t.width}});s.moveTo(e.x1,e.y1).lineTo(e.x2,e.y2),i.append(s)}return i}renderTicks(){const t=new Dc,e=this.options,i=e.majorTicks.visible?e.majorUnit:0,s={vertical:e.vertical,mirror:e.labels.mirror,lineBox:this.lineBox()};return Hc(t,this.getMajorTickPositions(),s,e.majorTicks),Hc(t,this.getMinorTickPositions(),s,ut({},{skipUnit:i/e.minorUnit},e.minorTicks)),t}}te(Nc,{min:0,max:50,majorTicks:{size:15,align:wc,color:h,width:vc,visible:!0},minorTicks:{size:10,align:wc,color:h,width:vc,visible:!0},line:{width:vc},labels:{position:wc,padding:2},mirror:!1,_alignLines:!1});class jc extends e.a{constructor(t,e){super();const{min:i,max:s}=t.options,o=this.options=ut({},this.options,e);o.fill=o.color,this.scale=t,Ft(o.value)?o.value=Yt(o.value,i,s):o.value=i}value(t){const e=this.options,i=e.value;if(0===arguments.length)return i;const{min:s,max:o}=this.scale.options;e._oldValue=Ft(e._oldValue)?e.value:s,e.value=Yt(t,s,o),this.elements&&this.repaint()}}te(jc,{color:h});class Uc extends jc{constructor(t,e){super(t,e),this.options=ut({track:{visible:Ft(e.track)}},this.options)}reflow(){const{options:t,scale:e}=this,{mirror:i,vertical:s}=e.options,o=e.lineBox(),n=t.track.size||t.size,r=t.size/2,a=yt(t.margin);let l,h,c,d=s?a[i?"left":"right"]:a[i?"bottom":"top"];d=i?-d:d,s?(c=new ui(o.x1+d,o.y1,o.x1+d,o.y2),i?c.x1-=n:c.x2+=n,t.shape!==yc&&(h=new ui(o.x2+d,o.y1-r,o.x2+d,o.y2+r),l=h)):(c=new ui(o.x1,o.y1-d,o.x2,o.y1-d),i?c.y2+=n:c.y1-=n,t.shape!==yc&&(h=new ui(o.x1-r,o.y1-d,o.x2+r,o.y1-d),l=h)),this.trackBox=c,this.pointerRangeBox=h,this.box=l||c.clone().pad(t.border.width)}getElementOptions(){const t=this.options;return{fill:{color:t.color,opacity:t.opacity},stroke:Ft(t.border)?{color:t.border.width?t.border.color||t.color:"",width:t.border.width,dashType:t.border.dashType,opacity:t.opacity}:null}}_margin(){const{scale:t,options:e}=this,{mirror:i,vertical:s}=t.options,o=yt(e.margin);return s?o[i?"left":"right"]:o[i?"bottom":"top"]}}te(Uc,{shape:yc,track:{border:{width:1}},color:h,border:{width:1},opacity:1,margin:yt(3),animation:{type:yc},visible:!0});class Gc extends e.c{setup(){const t=this.options,{margin:i,from:s,to:o,vertical:n}=t,r=n?"x1":"y1";t.mirror===n?(s[r]-=i,o[r]-=i):(s[r]+=i,o[r]+=i);const a=this.fromScale=new e.P(s.x1,s.y1),l=this.toScale=new e.P(o.x1,o.y1);0!==t.duration&&(t.duration=Math.max(a.distanceTo(l)/t.duration*1e3,1))}step(t){const i=Et(this.fromScale.x,this.toScale.x,t),s=Et(this.fromScale.y,this.toScale.y,t);this.element.transform(e.t().translate(i,s))}}te(Gc,{easing:_c,duration:250}),e.j.current.register(xc,Gc);const Wc=e.P,Xc=e.b;class Yc extends Uc{constructor(t,e){super(t,e),Ft(this.options.size)||(this.options.size=.6*this.scale.options.majorTicks.size)}pointerShape(){const{scale:t,options:{size:e}}=this,i=e/2,s=t.options.mirror?-1:1;let o;return o=t.options.vertical?[new Wc(0,0-i),new Wc(0-s*e,0),new Wc(0,0+i)]:[new Wc(0-i,0),new Wc(0,0+s*e),new Wc(0+i,0)],o}repaint(){const{scale:t,options:e}=this,i=new Gc(this.elements,ut(e.animation,{vertical:t.options.vertical,mirror:t.options.mirror,margin:this._margin(e.margin),from:t.getSlot(e._oldValue),to:t.getSlot(e.value)}));!1===e.animation.transitions&&(i.options.duration=0),i.setup(),i.play()}render(){const{scale:t,options:i}=this,s=this.getElementOptions(),o=this.pointerShape(i.value);i.animation.type=xc;const n=new Xc({stroke:s.stroke,fill:s.fill}).moveTo(o[0]).lineTo(o[1]).lineTo(o[2]).close(),r=t.getSlot(i.value);return n.transform(e.t().translate(r.x1,r.y1)),this.elements=n,n}}class qc extends e.c{setup(){const t=this.options,e=this.axis=t.vertical?X:W,i=this.to=t.newPoints[0][e],s=this.from=t.oldPoints[0][e];0!==t.duration&&(t.duration=Math.max(Math.abs(i-s)/t.speed*1e3,1)),this._set(s)}step(t){const e=Et(this.from,this.to,t);this._set(e)}_set(t){const e="set"+this.axis.toUpperCase(),i=this.options.newPoints;i[0][e](t),i[1][e](t)}}te(qc,{easing:_c,speed:250}),e.j.current.register(yc,qc);const{Group:Zc,Path:$c}=e.e;class Qc extends Uc{constructor(t,e){super(t,e),Ft(this.options.size)||(this.options.size=.3*this.scale.options.majorTicks.size)}pointerShape(t){const{scale:i,options:s}=this,{mirror:o,vertical:n}=i.options,r=o===n?-1:1,a=s.size*r,l=i.getSlot(i.options.min),h=i.getSlot(t),c=n?X:W,d=n?W:X,u=this._margin()*r,p=new e.P;p[c]=l[c+"1"],p[d]=l[d+"1"];const g=new e.P;g[c]=h[c+"1"],g[d]=h[d+"1"],n?(p.translate(u,0),g.translate(u,0)):(p.translate(0,u),g.translate(0,u));const m=g.clone(),f=p.clone();return n?(m.translate(a,0),f.translate(a,0)):(m.translate(0,a),f.translate(0,a)),[p,g,m,f]}repaint(){const{scale:t,options:e}=this,i=this.pointerShape(e.value),s=this.pointerPath,o=this.pointerShape(e._oldValue);s.moveTo(i[0]).lineTo(i[1]).lineTo(i[2]).lineTo(i[3]).close();const n=new qc(s,ut(e.animation,{reverse:t.options.reverse,vertical:t.options.vertical,oldPoints:[o[1],o[2]],newPoints:[i[1],i[2]]}));!1===e.animation.transitions&&(n.options.duration=0),n.setup(),n.play()}render(){const t=new Zc,e=this.getElementOptions();this.options.track.visible&&t.append(this.renderTrack());const i=this.pointerPath=new $c({stroke:e.stroke,fill:e.fill});return t.append(i),this.elements=t,t}renderTrack(){const t=this.options.track,e=t.border||{},i=this.trackBox.clone().pad(e.width||0);return new $c.fromRect(i.toRect(),{fill:{color:t.color,opacity:t.opacity},stroke:{color:e.width?e.color||t.color:"",width:e.width,dashType:e.dashType}})}}const Kc=e.G;class Jc extends Oc{reflow(t){const e=this.pointers,i=t.origin.x,s=t.origin.y,o=new ui(i,s,i+t.width(),s+t.height());this.scale.reflow(o),this._shrinkScaleWidth(o);for(let t=0;t<e.length;t++)e[t].reflow();this.bbox=this._getBox(o),this._alignElements(),this._shrinkElements(),this._buildVisual(),this._draw()}_buildVisual(){const t=new Kc,e=this.scale.render(),i=this.pointers;t.append(this.gaugeArea),t.append(e);for(let e=0;e<i.length;e++){const s=i[e];t.append(s.render()),s.value(s.options.value)}this._visuals=t}_createModel(){const t=this.options,e=this.scale=new Nc(t.scale,this.contextService);this.pointers=[];let i=t.pointer;i=Q(i)?i:[i];for(let s=0;s<i.length;s++){const o=ut({},i[s],{animation:{transitions:t.transitions}}),n="arrow"===o.shape?Yc:Qc;this.pointers.push(new n(e,o))}}_defaultSize(){const t=this.options.scale.vertical;return{width:t?60:200,height:t?200:60}}_getBox(t){const{scale:e,pointers:i}=this,s=t.center();let o,n=i[0].box.clone().wrap(e.box);for(let t=0;t<i.length;t++)n.wrap(i[t].box.clone());return e.options.vertical?(o=n.width()/2,n=new ui(s.x-o,t.y1,s.x+o,t.y2)):(o=n.height()/2,n=new ui(t.x1,s.y-o,t.x2,s.y+o)),n}_alignElements(){const{scale:t,pointers:e}=this,i=t.box,s=e[0].box.clone().wrap(t.box),o=this.bbox;for(let t=0;t<e.length;t++)s.wrap(e[t].box.clone());let n;t.options.vertical?(n=o.center().x-s.center().x,t.reflow(new ui(i.x1+n,o.y1,i.x2+n,o.y2))):(n=o.center().y-s.center().y,t.reflow(new ui(i.x1,i.y1+n,i.x2,i.y2+n)));for(let t=0;t<e.length;t++)e[t].reflow(this.bbox)}_shrinkScaleWidth(t){const{scale:e}=this;if(!e.options.vertical){const i=e.contentBox().width()-t.width();i>0&&(e.box.shrink(i,0),e.box.alignTo(t,"center"),e.reflow(e.box))}}_shrinkElements(){const{scale:t,pointers:e}=this,i=t.box.clone(),s=t.options.vertical?"y":"x",o=e[0].box;for(let t=0;t<e.length;t++)o.wrap(e[t].box.clone());i[s+1]+=Math.max(i[s+1]-o[s+1],0),i[s+2]-=Math.max(o[s+2]-i[s+2],0),t.reflow(i);for(let t=0;t<e.length;t++)e[t].reflow(this.bbox)}}te(Jc,{transitions:!0,gaugeArea:{background:""},scale:{vertical:!0}});const td=180,{Arc:ed,Path:id,Group:sd}=e.e;function od(t,i,s,o){const n=new sd,r=t.center,a=t.getRadiusX();if(o.visible)for(let s=0;s<i.length;s++){const l=t.pointAt(i[s]),h=new e.P(r.x+a-o.size,r.y).rotate(i[s],r);n.append(new id({stroke:{color:o.color,width:o.width}}).moveTo(l).lineTo(h))}return n}function nd(t,e,i,s){return{from:t,to:e,color:i,opacity:s}}class rd extends $s{constructor(t,e){super(0,1,t,e)}initUserOptions(t){const e=ut({},this.options,t);return e.majorUnit=e.majorUnit||ci(e.min,e.max),e.minorUnit=e.minorUnit||e.majorUnit/10,e}initFields(){}render(t,e){const i=this.renderArc(t,e);this.bbox=i.bbox(),this.labelElements=this.renderLabels(),this.ticks=this.renderTicks(),this.ranges=this.renderRanges()}reflow(t){const e=t.center(),i=Math.min(t.height(),t.width())/2;if(!Ft(this.bbox))return this.render(e,i);this.bbox=this.arc.bbox(),this.radius(this.arc.getRadiusX()),this.repositionRanges(),this.renderLabels()}slotAngle(t){const{min:e,max:i,reverse:s,startAngle:o,endAngle:n}=this.options,r=n-o;let a;return a=s?n-(t-e)/(i-e)*r:(t-e)/(i-e)*r+o,a+td}hasRanges(){const t=this.options.ranges;return t&&t.length}ticksSize(){const{majorTicks:t,minorTicks:e}=this.options;let i=0;return t.visible&&(i=t.size),e.visible&&(i=Math.max(e.size,i)),i}labelsCount(){let t=super.labelsCount();const e=this.options;return e.endAngle-e.startAngle>=360&&e.max%e.majorUnit==0&&(t-=1),t}renderLabels(){const t=this.options,i=this.arc.clone();let s=i.getRadiusX();const o=this.tickAngles(i,t.majorUnit),n=t.rangeSize=t.rangeSize||.1*s,r=new sd;let a=.05*s;Ft(t.rangeDistance)?a=t.rangeDistance:t.rangeDistance=a;const l=t.labels,h=l.position===wc,c=Ft(this.labelElements);h&&(s-=this.ticksSize(),this.hasRanges()&&!c&&(s-=n+a),i.setRadiusX(s).setRadiusY(s));const d=this.labels,u=d.length,p=yt(l.padding),g=(p.left+p.right)/2,m=(p.top+p.bottom)/2;for(let s=0;s<u;s++){const n=d[s],a=n.box.width()/2,l=n.box.height()/2,u=o[s],p=(u-td)*bc,f=i.pointAt(u),x=f.x+Math.cos(p)*(a+g)*(h?1:-1),y=f.y+Math.sin(p)*(l+m)*(h?1:-1);n.reflow(new ui(x-a,y-l,x+a,y+l));const v=new e.P(n.box.x1,n.box.y1);let b;if(c){b=this.labelElements.children[s];const t=b.bbox().origin,i=b.transform()||e.t();i.translate(v.x-t.x,v.y-t.y),b.transform(i)}else b=Ec(n,t.labels),r.append(b);this.bbox=e.R.union(this.bbox,b.bbox())}return r}repositionRanges(){const t=this.ranges.children;if(t.length>0){const{rangeDistance:i,rangeSize:s}=this.options;let o=this.getRangeRadius();this.options.labels.position===wc&&(o+=s+i);const n=o+s/2;for(let e=0;e<t.length;e++)t[e]._geometry.setRadiusX(n).setRadiusY(n);this.bbox=e.R.union(this.bbox,this.ranges.bbox())}}renderRanges(){const t=this.rangeSegments(),e=t.length,i=new sd;if(e){const{rangeSize:s,reverse:o,rangeDistance:n}=this.options,r=this.getRangeRadius();this.radius(this.radius()-s-n);for(let s=0;s<e;s++){const e=t[s],n=this.slotAngle(e[o?"to":"from"]),a=this.slotAngle(e[o?"from":"to"]);a-n!=0&&i.append(this.createRange(n,a,r,e))}}return i}createRange(t,i,s,o){const n=this.options.rangeSize,r=new e.A(this.arc.center,{radiusX:s+n/2,radiusY:s+n/2,startAngle:t,endAngle:i});return new ed(r,{stroke:{width:n,color:o.color,opacity:o.opacity,lineCap:o.lineCap}})}rangeSegments(){const t=this.options,e=t.ranges||[],i=e.length,s=[];if(i){const{min:o,max:n,rangePlaceholderColor:r}=t;s.push(nd(o,n,r));for(let t=0;t<i;t++){const i=Lc(e[t],o,n),a=s.length;for(let t=0;t<a;t++){const e=s[t];if(e.from<=i.from&&i.from<=e.to){s.push(nd(i.from,i.to,i.color,i.opacity)),e.from<=i.to&&i.to<=e.to&&s.push(nd(i.to,e.to,r,i.opacity)),e.to=i.from;break}}}}return s}getRangeRadius(){const{arc:t,options:e}=this,{rangeSize:i,rangeDistance:s,majorTicks:{size:o}}=e;let n;return n=e.labels.position===kc?t.getRadiusX()-o-s-i:t.getRadiusX()-i,n}renderArc(t,i){const s=this.options;return this.arc=new e.A(t,{radiusX:i,radiusY:i,startAngle:s.startAngle+td,endAngle:s.endAngle+td})}renderTicks(){const{arc:t,options:e}=this,i=t.clone();this.majorTickAngles=this.tickAngles(t,e.majorUnit),this.majorTicks=od(i,this.majorTickAngles,e.majorUnit,e.majorTicks);const s=new sd;s.append(this.majorTicks);const o=e.majorTicks.size,n=e.minorTicks.size;if(this._tickDifference=o-n,e.labels.position===kc){const t=i.getRadiusX();i.setRadiusX(t-o+n).setRadiusY(t-o+n)}return this.minorTickAngles=this.normalizeTickAngles(this.tickAngles(t,e.minorUnit)),this.minorTicks=od(i,this.minorTickAngles,e.minorUnit,e.minorTicks),s.append(this.minorTicks),s}normalizeTickAngles(t){const e=this.options,i=e.majorUnit/e.minorUnit;for(let e=t.length-1;e>=0;e--)e%i==0&&t.splice(e,1);return t}tickAngles(t,e){const i=this.options,s=i.reverse,o=i.max-i.min,n=t.endAngle-t.startAngle;let r=o/e,a=t.startAngle,l=n/r;s&&(a+=n,l=-l),n>=360&&i.max%e==0&&(r-=1);const h=[];for(let t=0;t<r;t++)h.push($t(a,3)),a+=l;return $t(a)<=t.endAngle&&h.push(a),h}radius(t){if(!t)return this.arc.getRadiusX();this.arc.setRadiusX(t).setRadiusY(t),this.repositionTicks(this.majorTicks.children,this.majorTickAngles),this.repositionTicks(this.minorTicks.children,this.minorTickAngles,!0)}repositionTicks(t,i,s){const o=s&&this._tickDifference||0;let n=this.arc;const r=n.getRadiusX();s&&this.options.labels.position===kc&&0!==o&&(n=this.arc.clone(),n.setRadiusX(r-o).setRadiusY(r-o));for(let s=0;s<t.length;s++){const o=n.pointAt(i[s]),r=t[s].segments,a=o.x-r[0].anchor().x,l=o.y-r[0].anchor().y;t[s].transform((new e.t).translate(a,l))}}}te(rd,{min:0,max:100,majorTicks:{size:15,align:wc,color:h,width:vc,visible:!0},minorTicks:{size:10,align:wc,color:h,width:vc,visible:!0},startAngle:-30,endAngle:210,labels:{position:wc,padding:2}});class ad extends e.c{constructor(t,e){super(t,e);const i=this.options;i.duration=Math.max(Math.abs(i.newAngle-i.oldAngle)/i.duration*1e3,1)}step(t){const i=this.options,s=Et(i.oldAngle,i.newAngle,t);this.element.transform(e.t().rotate(s,i.center))}}te(ad,{easing:_c,duration:fc}),e.j.current.register(Ac,ad);const{Circle:ld,Group:hd,Path:cd}=e.e;class dd extends jc{setAngle(t){this.elements.transform(e.t().rotate(t,this.center))}repaint(){const{scale:t,options:e}=this,i=t.slotAngle(e._oldValue),s=t.slotAngle(e.value);!1===e.animation.transitions?this.setAngle(s):new ad(this.elements,ut(e.animation,{oldAngle:i,newAngle:s})).play()}render(){const{scale:t,options:e}=this,i=new hd;return!1!==e.animation&&ut(e.animation,{startAngle:0,center:t.arc.center,reverse:t.options.reverse}),i.append(this._renderNeedle(),this._renderCap()),this.elements=i,this.setAngle(bc),i}reflow(t){const i=this.center=t.center,s=Yt(this.options.length||1,.1,1.5),o=this.radius=t.getRadiusX()*s,n=this.capSize=Math.round(o*this.options.cap.size);this.bbox=e.R.fromPoints(new e.P(i.x-n,i.y-n),new e.P(i.x+n,i.y+n))}_renderNeedle(){const t=this.scale.options.minorTicks.size,e=this.center,i=this.options.color,s=new cd({fill:{color:i},stroke:{color:i,width:vc}});return s.moveTo(e.x+this.radius-t,e.y).lineTo(e.x,e.y-this.capSize/2).lineTo(e.x,e.y+this.capSize/2).close(),s}_renderCap(){const t=this.options,i=t.cap.color||t.color,s=new e.g(this.center,this.capSize);return new ld(s,{fill:{color:i},stroke:{color:i}})}}te(dd,{cap:{size:.05},arrow:{width:16,height:14},animation:{type:Ac,duration:fc}});const ud=e.G;class pd extends Oc{reflow(t){const i=this.pointers;this.scale.reflow(t),this._initialPlotArea=this.scale.bbox;for(let t=0;t<i.length;t++)i[t].reflow(this.scale.arc),this._initialPlotArea=e.R.union(this._initialPlotArea,i[t].bbox);this.fitScale(t),this.alignScale(t),this._buildVisual(this.gaugeArea,i,this.scale),this._draw()}_buildVisual(t,e,i){const s=this._visuals=new ud;s.append(t),s.append(i.ticks),s.append(i.ranges),this._buildPointers(e),s.append(i.labelElements)}_buildPointers(t){for(let e=0;e<t.length;e++){const i=t[e];i.render(),this._visuals.append(i.elements),i.value(i.options.value)}}fitScale(t){const e=this.scale.arc,i=this._initialPlotArea,s=Math.abs(this.getDiff(i,t));let o,n,r,a,l,h=$t(s,3),c=$t(-s,3),d=0,u=0;for(;!(!(u++<100)||(d=l===r?d+1:0,d>5)||h!==a&&(o=this.getPlotBox(h,t,e),0<=o&&o<=2)||c!==a&&(r=this.getPlotBox(c,t,e),0<=r&&r<=2)||(a=o>0&&r>0?2*h:o<0&&r<0?2*c:$t((h+c)/2||1,3),n=this.getPlotBox(a,t,e),0<=n&&n<=2));)l=r,n>0?(c=a,r=n):(h=a,o=n)}getPlotBox(t,i,s){const o=this.scale,n=this.pointers,r=s.getRadiusX(),a=s.clone();a.setRadiusX(r+t).setRadiusY(r+t),o.arc=a,o.reflow(i),this.plotBbox=o.bbox;for(let t=0;t<n.length;t++)n[t].reflow(a),this.plotBbox=e.R.union(this.plotBbox,n[t].bbox);return this.getDiff(this.plotBbox,i)}getDiff(t,e){return Math.min(e.width()-t.width(),e.height()-t.height())}alignScale(t){const i=this.plotBbox.center(),s=t.center(),o=i.x-s.x,n=i.y-s.y,{scale:r,pointers:a}=this;r.arc.center.x-=o,r.arc.center.y-=n,r.reflow(t);for(let t=0;t<a.length;t++)a[t].reflow(r.arc),this.plotBbox=e.R.union(r.bbox,a[t].bbox)}_createModel(){const t=this.options,e=t.pointer,i=this.scale=new rd(t.scale,this.contextService);this.pointers=[];const s=Q(e)?e:[e];for(let e=0;e<s.length;e++){const o=new dd(i,ut({},s[e],{animation:{transitions:t.transitions}}));this.pointers.push(o)}}}te(pd,{transitions:!0,gaugeArea:{background:""}});class gd extends rd{rangeSegments(){const{min:t,max:e,rangePlaceholderColor:i,rangeLineCap:s}=this.options;return[{from:t,to:e,color:i,lineCap:s}]}hasRanges(){return!0}placeholderRangeAngle(t){const e=this.ranges.children[0].geometry();this.options.reverse?e.setEndAngle(t):e.setStartAngle(t)}addRange(t,e,i){const s=this.options.reverse,o=this.slotAngle(s?e:t),n=this.slotAngle(s?t:e),r=this.createRange(o,n,this.getRangeRadius(),i);return this.ranges.append(r),r}}te(gd,{min:0,max:100,majorTicks:{visible:!1},minorTicks:{visible:!1},labels:{visible:!1},startAngle:0,endAngle:180,rangeLineCap:"round"});class md extends e.c{constructor(t,i){super(t,i);const s=this.options,o=Math.abs(s.newAngle-s.oldAngle)/s.duration*1e3;s.duration=Yt(o,fc,800);const n=t.elements.options.get("stroke.color"),r=t.currentColor();n!==r&&(this.startColor=new e.C(n),this.color=new e.C(r))}step(t){const{options:i,startColor:s,color:o}=this,n=Et(i.oldAngle,i.newAngle,t);if(this.element.angle(n),o){const i=$t(Et(s.r,o.r,t)),n=$t(Et(s.g,o.g,t)),r=$t(Et(s.b,o.b,t));this.element.stroke(new e.C(i,n,r).toHex())}}}te(md,{easing:_c,duration:fc}),e.j.current.register(Sc,md);class fd extends jc{repaint(){const{scale:t,options:e}=this,i=t.slotAngle(e._oldValue),s=t.slotAngle(e.value);this.animation&&this.animation.abort(),!1===e.animation.transitions?(this.angle(s),this.stroke(this.currentColor())):(this.animation=new md(this,ut(e.animation,{oldAngle:i,newAngle:s})),this.animation.play())}angle(t){const e=this.elements.geometry();this.scale.options.reverse?e.setStartAngle(t):e.setEndAngle(t),this.scale.placeholderRangeAngle(t)}stroke(t){this.elements.stroke(t)}render(){if(this.elements)return;const{scale:t,options:e}=this;!1!==e.animation&&ut(e.animation,{startAngle:0,center:t.arc.center,reverse:t.options.reverse}),this.elements=t.addRange(t.options.min,this.options.value,{color:this.currentColor(),opacity:e.opacity,lineCap:t.options.rangeLineCap})}currentColor(){const{min:t,max:e}=this.scale.options,{colors:i,color:s,value:o}=this.options,n=st(o)?o:t;if(i)for(let s=0;s<i.length;s++){const{color:o,from:r=t,to:a=e}=i[s];if(r<=n&&n<=a)return o}return s}reflow(){this.render(),this.bbox=this.elements.bbox()}}te(fd,{animation:{type:Sc,duration:fc}});class xd extends pd{_initTheme(t){super._initTheme(t),this.options.color=this.options.color||(this.theme.pointer||{}).color}_createModel(){const t=this.options,e=this.scale=new gd(t.scale,this.contextService),i=new fd(e,ut({},{colors:t.colors,color:t.color,value:t.value,opacity:t.opacity,animation:{transitions:t.transitions}}));this.pointers=[i]}_buildPointers(t){for(let e=0;e<t.length;e++){const i=t[e];i.render(),i.value(i.options.value)}}_setValueOptions(t){this.options.value=t}currentColor(){const t=this.pointers[0];if(t)return t.currentColor()}centerLabelPosition(t,e){const i=this.getSize(),s=this.scale.arc.center;let o=s.x-t/2,n=s.y-e/2;if(t<i.width){const e=o+t;o=Math.max(o,0),e>i.width&&(o-=e-i.width)}if(e<i.height){const t=this.scale.bbox,i=t.bottomRight().y,s=n+e;n=Math.max(n,t.origin.y),s>i&&(n-=s-i)}return{left:o,top:n}}}class yd extends e.a{constructor(t){super(),this.setOptions(t),this.initProperties()}initProperties(){}setOptions(t){this.options=Object.assign({},this.options,t),this.quietZoneLength=this.options.addQuietZone?2*this.options.quietZoneLength:0}encode(t,e,i){const s=Ft(t)?String(t):t;return this.initValue(s,e,i),this.options.addQuietZone&&this.addQuietZone(),this.addData(),this.options.addQuietZone&&this.addQuietZone(),{baseUnit:this.baseUnit,pattern:this.pattern}}initValue(){}addQuietZone(){this.pattern.push(this.options.quietZoneLength||10)}addData(){}invalidCharacterError(t){throw new Error(`Character "${t}" is not valid for symbology ${this.name}.`)}}te(yd,{quietZoneLength:10,addQuietZone:!0,addCheckSum:!0});const vd=Object.assign;class bd extends yd{initProperties(){super.initProperties(),vd(this,{name:"Code 11",characterMap:["111121","211121","121121","221111","112121","212111","122111","111221","211211","211111","112111"],cCheckSumTotal:10,kCheckSumTotal:9,kCheckSumMinLength:10,checkSumMod:11,DASH_VALUE:10,DASH:"-",START:"112211",STOP:"11221"})}initValue(t,e){this.pattern=[],this.value=t,this.width=e,this.totalUnits=0}addData(){const t=this.value;this.addPattern(this.START);for(let e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()}setBaseUnit(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)}addCheckSum(){const t=this.value;let e=t.length;const i=this.getWeightedSum(t,e,this.cCheckSumTotal)%this.checkSumMod;if(this.checksum=String(i),this.addPattern(this.characterMap[i]),e++,e>=this.kCheckSumMinLength){let s=(i+this.getWeightedSum(t,e,this.kCheckSumTotal))%this.checkSumMod;this.checksum+=s,this.addPattern(this.characterMap[s])}}getWeightedSum(t,e,i){let s=0;for(let o=0;o<t.length;o++)s+=this.weightedValue(this.getValue(t.charAt(o)),e,o,i);return s}weightedValue(t,e,i,s){return((e-i)%s||s)*t}getValue(t){return isNaN(t)?(t!==this.DASH&&this.invalidCharacterError(t),this.DASH_VALUE):parseInt(t,10)}addCharacter(t){const e=this.getValue(t),i=this.characterMap[e];this.addPattern(i)}addPattern(t){let e;for(let i=0;i<t.length;i++)e=parseInt(t.charAt(i),10),this.pattern.push(e),this.totalUnits+=e}}te(bd,{addCheckSum:!0});const wd=Object.assign;class _d extends yd{initProperties(){super.initProperties(),wd(this,{minBaseUnitLength:.7})}addData(){const t=this.value;this.addStart();for(let e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.pushCheckSum(),this.addStop(),this.prepareValues()}addCharacter(t){const e=this.characterMap[t];e||this.invalidCharacterError(t),this.addBase(e)}addBase(){}}class kd extends _d{initProperties(){super.initProperties(),wd(this,{name:"Code 39",checkSumMod:43,minRatio:2.5,maxRatio:3,gapWidth:1,splitCharacter:"|",patternMappings:{b:"1|",w:"1|",B:"ratio|",W:"ratio|"},characterMap:{0:{pattern:"bwbWBwBwb",value:0},1:{pattern:"BwbWbwbwB",value:1},2:{pattern:"bwBWbwbwB",value:2},3:{pattern:"BwBWbwbwb",value:3},4:{pattern:"bwbWBwbwB",value:4},5:{pattern:"BwbWBwbwb",value:5},6:{pattern:"bwBWBwbwb",value:6},7:{pattern:"bwbWbwBwB",value:7},8:{pattern:"BwbWbwBwb",value:8},9:{pattern:"bwBWbwBwb",value:9},A:{pattern:"BwbwbWbwB",value:10},B:{pattern:"bwBwbWbwB",value:11},C:{pattern:"BwBwbWbwb",value:12},D:{pattern:"bwbwBWbwB",value:13},E:{pattern:"BwbwBWbwb",value:14},F:{pattern:"bwBwBWbwb",value:15},G:{pattern:"bwbwbWBwB",value:16},H:{pattern:"BwbwbWBwb",value:17},I:{pattern:"bwBwbWBwb",value:18},J:{pattern:"bwbwBWBwb",value:19},K:{pattern:"BwbwbwbWB",value:20},L:{pattern:"bwBwbwbWB",value:21},M:{pattern:"BwBwbwbWb",value:22},N:{pattern:"bwbwBwbWB",value:23},O:{pattern:"BwbwBwbWb",value:24},P:{pattern:"bwBwBwbWb",value:25},Q:{pattern:"bwbwbwBWB",value:26},R:{pattern:"BwbwbwBWb",value:27},S:{pattern:"bwBwbwBWb",value:28},T:{pattern:"bwbwBwBWb",value:29},U:{pattern:"BWbwbwbwB",value:30},V:{pattern:"bWBwbwbwB",value:31},W:{pattern:"BWBwbwbwb",value:32},X:{pattern:"bWbwBwbwB",value:33},Y:{pattern:"BWbwBwbwb",value:34},Z:{pattern:"bWBwBwbwb",value:35},"-":{pattern:"bWbwbwBwB",value:36},".":{pattern:"BWbwbwBwb",value:37}," ":{pattern:"bWBwbwBwb",value:38},$:{pattern:"bWbWbWbwb",value:39},"/":{pattern:"bWbWbwbWb",value:40},"+":{pattern:"bWbwbWbWb",value:41},"%":{pattern:"bwbWbWbWb",value:42},START:{pattern:"bWbwBwBwb"}}})}initValue(t,e,i){this.width=e,this.height=i,this.value=t,this.dataLength=t.length,this.pattern=[],this.patternString=""}prepareValues(){const t=this.minBaseUnitLength,e=this.minRatio,i=Math.ceil(Math.max(.15*this.width,24));let s,o=this.maxRatio;if(this.height<i)throw new Error(`Insufficient height for Code39 encoding: the current height is ${this.height}px and the minimum height is ${i}px.`);for(s=this.getBaseUnit(o);s<t&&o>e;)o=parseFloat((o-.1).toFixed(1)),s=this.getBaseUnit(o);if(s<t){let i=Math.ceil(this.getBaseWidth(e)*t);throw new Error(`Insufficient width for Code39 encoding: the current width is ${this.width}px and the minimum width for value "${this.value}" is ${i}px.`)}this.ratio=o,this.baseUnit=s,this.patternString=this.patternString.substring(0,this.patternString.length-1),this.pattern=this.pattern.concat(this.patternString.replace(/ratio/g,o).split(this.splitCharacter))}getBaseUnit(t){return this.width/this.getBaseWidth(t)}getBaseWidth(t){const e=3*(t+2);return this.quietZoneLength+e*(this.dataLength+2)+this.gapWidth*(this.dataLength+1)}addStart(){this.addPattern(this.characterMap.START.pattern),this.addCharacterGap()}addBase(t){this.addPattern(t.pattern),this.addCharacterGap()}addStop(){this.addPattern(this.characterMap.START.pattern)}addPattern(t){for(let e=0;e<t.length;e++)this.patternString+=this.patternMappings[t.charAt(e)]}addCharacterGap(){this.patternString+=this.gapWidth+this.splitCharacter}}te(kd,{addCheckSum:!1});const Ad={addCharacter(t){this.characterMap[t]?this.addBase(this.characterMap[t]):t.charCodeAt(0)>127?this.invalidCharacterError(t):this.addExtended(t.charCodeAt(0))},addExtended(t){let e;for(let i=0;i<this.extendedMappings.length;i++)if(e=this.extendedMappings[i].call(this,t),e){for(let t=0;t<e.length;t++){const i=e[t];this.addBase(i)}return void(this.dataLength+=e.length-1)}},extendedMappings:[function(t){if(97<=t&&t<=122)return[this.characterMap[this.shiftCharacters[0]],this.characterMap[String.fromCharCode(t-32)]]},function(t){if(33<=t&&t<=58)return[this.characterMap[this.shiftCharacters[1]],this.characterMap[String.fromCharCode(t+32)]]},function(t){if(1<=t&&t<=26)return[this.characterMap[this.shiftCharacters[2]],this.characterMap[String.fromCharCode(t+64)]]},function(t){let e,i;if(this.specialAsciiCodes[t]){e=[];for(let i=0;i<this.specialAsciiCodes[t].length;i++)e.push(this.characterMap[this.shiftCharacters[3]]),e.push(this.characterMap[this.specialAsciiCodes[t][i]])}else i=6*Math.floor(t/32)+(t-27)%32+64,e=[this.characterMap[this.shiftCharacters[3]],this.characterMap[String.fromCharCode(i)]];return e}],specialAsciiCodes:{0:["U"],64:["V"],96:["W"],127:["T","X","Y","Z"]},shiftValuesAsciiCodes:{39:36,40:47,41:43,42:37},characterMap:{"+":!1,"/":!1,$:!1,"%":!1},shiftCharacters:["SHIFT0","SHIFT1","SHIFT2","SHIFT3"]};const Sd=Object.assign;class Cd extends _d{initProperties(){super.initProperties(),Sd(this,{name:"Code 93",cCheckSumTotal:20,kCheckSumTotal:15,checkSumMod:47,characterMap:{0:{pattern:"131112",value:0},1:{pattern:"111213",value:1},2:{pattern:"111312",value:2},3:{pattern:"111411",value:3},4:{pattern:"121113",value:4},5:{pattern:"121212",value:5},6:{pattern:"121311",value:6},7:{pattern:"111114",value:7},8:{pattern:"131211",value:8},9:{pattern:"141111",value:9},A:{pattern:"211113",value:10},B:{pattern:"211212",value:11},C:{pattern:"211311",value:12},D:{pattern:"221112",value:13},E:{pattern:"221211",value:14},F:{pattern:"231111",value:15},G:{pattern:"112113",value:16},H:{pattern:"112212",value:17},I:{pattern:"112311",value:18},J:{pattern:"122112",value:19},K:{pattern:"132111",value:20},L:{pattern:"111123",value:21},M:{pattern:"111222",value:22},N:{pattern:"111321",value:23},O:{pattern:"121122",value:24},P:{pattern:"131121",value:25},Q:{pattern:"212112",value:26},R:{pattern:"212211",value:27},S:{pattern:"211122",value:28},T:{pattern:"211221",value:29},U:{pattern:"221121",value:30},V:{pattern:"222111",value:31},W:{pattern:"112122",value:32},X:{pattern:"112221",value:33},Y:{pattern:"122121",value:34},Z:{pattern:"123111",value:35},"-":{pattern:"121131",value:36},".":{pattern:"311112",value:37}," ":{pattern:"311211",value:38},$:{pattern:"321111",value:39},"/":{pattern:"112131",value:40},"+":{pattern:"113121",value:41},"%":{pattern:"211131",value:42},SHIFT0:{pattern:"122211",value:46},SHIFT1:{pattern:"311121",value:45},SHIFT2:{pattern:"121221",value:43},SHIFT3:{pattern:"312111",value:44},START:{pattern:"111141"},TERMINATION_BAR:"1"}})}initValue(t,e,i){this.value=t,this.width=e,this.height=i,this.pattern=[],this.values=[],this.dataLength=t.length}prepareValues(){let t=Math.ceil(Math.max(.15*this.width,24));if(this.height<t)throw new Error(`Insufficient height for Code93 encoding: the current height is ${this.height}px, the minimum required height is ${t}px.`);if(this.setBaseUnit(),this.baseUnit<this.minBaseUnitLength){const t=Math.ceil(this.minBaseUnitLength*(this.width/this.baseUnit));throw new Error(`Insufficient width for Code93 encoding: the current width is ${this.width}px and the minimum required width for value "${this.value}" is ${t}px.`)}}setBaseUnit(){this.baseUnit=this.width/(9*(this.dataLength+2+2)+this.quietZoneLength+1)}addStart(){let t=this.characterMap.START.pattern;this.addPattern(t)}addStop(){this.addStart(),this.pattern.push(this.characterMap.TERMINATION_BAR)}addBase(t){this.addPattern(t.pattern),this.values.push(t.value)}pushCheckSum(){const t=this._getCheckValues();let e;this.checksum=t.join("");for(let i=0;i<t.length;i++)e=this.characterMap[this._findCharacterByValue(t[i])],this.addPattern(e.pattern)}_getCheckValues(){const t=this.values,e=t.length;let i,s,o,n=0;for(o=e-1;o>=0;o--)n+=this.weightedValue(t[o],e-o,this.cCheckSumTotal);for(i=n%this.checkSumMod,n=this.weightedValue(i,1,this.kCheckSumTotal),o=e-1;o>=0;o--)n+=this.weightedValue(t[o],e-o+1,this.kCheckSumTotal);return s=n%this.checkSumMod,[i,s]}_findCharacterByValue(t){for(let e in this.characterMap)if(this.characterMap[e].value===t)return e}weightedValue(t,e,i){return(e%i||i)*t}addPattern(t){let e;for(let i=0;i<t.length;i++)e=parseInt(t.charAt(i),10),this.pattern.push(e)}}const Td=/^\d+$/,Pd=Object.assign;const Md=/^\d+$/,Ed=/^[a-z0-9]+$/i,Ld=Object.assign;class Id extends e.a{constructor(t){super(),this.encoding=t,this.initProperties()}initProperties(){}addStart(){}is(){}isCode(){return!1}move(){}pushState(){}}class Rd extends Id{constructor(t,e){super(t),this.states=e,this._initMoves(e)}initProperties(){super.initProperties(),ut(this,{FNC4:"FNC4",SHIFT:98})}addStart(){this.encoding.addPattern(this.START)}is(t,e){let i=t.charCodeAt(e);return this.isCode(i)}move(t){let e=0;for(;!this._moves[e].call(this,t)&&e<this._moves.length;)e++}pushState(t){let e,i=this.states,s=t.value,o=s.length;if(Mt("C",i)){let e=s.substr(t.index).match(/\d{4,}/g);e&&(o=s.indexOf(e[0],t.index))}for(;(e=t.value.charCodeAt(t.index))>=0&&this.isCode(e)&&t.index<o;)this.encoding.addPattern(this.getValue(e)),t.index++}_initMoves(t){this._moves=[],Mt(this.FNC4,t)&&this._moves.push(this._moveFNC),Mt(this.shiftKey,t)&&this._moves.push(this._shiftState),this._moves.push(this._moveState)}_moveFNC(t){if(t.fnc)return t.fnc=!1,t.previousState===this.key}_shiftState(t){if(t.previousState===this.shiftKey&&(t.index+1>=t.value.length||this.encoding[this.shiftKey].is(t.value,t.index+1)))return this.encoding.addPattern(this.SHIFT),t.shifted=!0,!0}_moveState(){return this.encoding.addPattern(this.MOVE),!0}}const Bd={};Bd.A=class extends Rd{initProperties(){super.initProperties(),Ld(this,{key:"A",shiftKey:"B",MOVE:101,START:103})}isCode(t){return 0<=t&&t<96}getValue(t){return t<32?t+64:t-32}},Bd.B=class extends Rd{initProperties(){super.initProperties(),Ld(this,{key:"B",shiftKey:"A",MOVE:100,START:104})}isCode(t){return 32<=t&&t<128}getValue(t){return t-32}},Bd.C=class extends Id{initProperties(){super.initProperties(),Ld(this,{key:"C",MOVE:99,START:105})}addStart(){this.encoding.addPattern(this.START)}is(t,e){let i=Vd(t,e,4);return(e+4<=t.length||2===t.length)&&Md.test(i)}move(){this.encoding.addPattern(this.MOVE)}pushState(t){let e;for(;(e=Vd(t.value,t.index,2))&&Md.test(e)&&2===e.length;)this.encoding.addPattern(parseInt(e,10)),t.index+=2}getValue(t){return t}},Bd.FNC4=class extends Id{constructor(t,e){super(t),this._initSubStates(e)}initProperties(){super.initProperties(),Ld(this,{key:"FNC4",dependentStates:["A","B"]})}addStart(t){let e=t.value.charCodeAt(0)-128,i=this._getSubState(e);this.encoding[i].addStart()}is(t,e){let i=t.charCodeAt(e);return this.isCode(i)}isCode(t){return 128<=t&&t<256}pushState(t){let e,i=this._initSubState(t),s=this.encoding,o=i.value.length;if(t.index+=o,o<3)for(;i.index<o;i.index++)e=i.value.charCodeAt(i.index),i.state=this._getSubState(e),i.previousState!==i.state&&(i.previousState=i.state,s[i.state].move(i)),s.addPattern(s[i.state].MOVE),s.addPattern(s[i.state].getValue(e));else i.state!==i.previousState&&s[i.state].move(i),this._pushStart(i),s.pushData(i,this.subStates),t.index<t.value.length&&this._pushStart(i);t.fnc=!0,t.state=i.state}_pushStart(t){this.encoding.addPattern(this.encoding[t.state].MOVE),this.encoding.addPattern(this.encoding[t.state].MOVE)}_initSubState(t){const e={value:this._getAll(t.value,t.index),index:0};return e.state=this._getSubState(e.value.charCodeAt(0)),e.previousState=t.previousState===this.key?e.state:t.previousState,e}_initSubStates(t){this.subStates=[];for(let e=0;e<t.length;e++)Mt(t[e],this.dependentStates)&&this.subStates.push(t[e])}_getSubState(t){for(let e=0;e<this.subStates.length;e++)if(this.encoding[this.subStates[e]].isCode(t))return this.subStates[e]}_getAll(t,e){let i,s="",o=e;for(;(i=t.charCodeAt(o++))&&this.isCode(i);)s+=String.fromCharCode(i-128);return s}},Bd.FNC1=class extends Id{constructor(t,e){super(t),this.states=e}initProperties(){super.initProperties(),Ld(this,{key:"FNC1",startState:"C",startAI:"(",endAI:")",dependentStates:["C","B"],applicationIdentifiers:{22:{max:29,type:"alphanumeric"},402:{length:17},7004:{max:4,type:"alphanumeric"},242:{max:6,type:"alphanumeric"},8020:{max:25,type:"alphanumeric"},703:{min:3,max:30,type:"alphanumeric"},8008:{min:8,max:12,type:"alphanumeric"},253:{min:13,max:17,type:"alphanumeric"},8003:{min:14,max:30,type:"alphanumeric"},multiKey:[{ids:["15","17","8005","8100"],ranges:[[11,13],[310,316],[320,336],[340,369]],type:{length:6}},{ids:["240","241","250","251","400","401","403","7002","8004","8007","8110"],ranges:[[-9]],type:{max:30,type:"alphanumeric"}},{ids:["7001"],ranges:[[410,414]],type:{length:13}},{ids:["10","21","254","420","8002"],type:{max:20,type:"alphanumeric"}},{ids:["00","8006","8017","8018"],type:{length:18}},{ids:["01","02","8001"],type:{length:14}},{ids:["422"],ranges:[[424,426]],type:{length:3}},{ids:["20","8102"],type:{length:2}},{ids:["30","37"],type:{max:8,type:"alphanumeric"}},{ids:["390","392"],type:{max:15,type:"alphanumeric"}},{ids:["421","423"],type:{min:3,max:15,type:"alphanumeric"}},{ids:["391","393"],type:{min:3,max:18,type:"alphanumeric"}},{ids:["7003","8101"],type:{length:10}}]},START:102})}addStart(){this.encoding[this.startState].addStart()}is(){return Mt(this.key,this.states)}pushState(t){let e,i,s,o=this.encoding,n=t.value.replace(/\s/g,""),r=new RegExp("["+this.startAI+this.endAI+"]","g"),a=t.index,l={state:this.startState};o.addPattern(this.START);for(;;){if(l.index=0,s=n.charAt(a)===this.startAI?2:0,e=s>0?this.getBySeparator(n,a):this.getByLength(n,a),e.ai.length)i=a+s+e.id.length+e.ai.length;else if(i=n.indexOf(this.startAI,a+1),i<0){if(a+e.ai.max+e.id.length+s<n.length)throw new Error("Separators are required after variable length identifiers");i=n.length}if(l.value=n.substring(a,i).replace(r,""),this.validate(e,l.value),o.pushData(l,this.dependentStates),i>=n.length)break;a=i,l.state!==this.startState&&(o[this.startState].move(l),l.state=this.startState),e.ai.length||o.addPattern(this.START)}t.index=t.value.length}validate(t,e){let i=e.substr(t.id.length),s=t.ai;if(!s.type&&!Md.test(i))throw new Error("Application identifier "+t.id+" is numeric only but contains non numeric character(s).");if("alphanumeric"===s.type&&!Ed.test(i))throw new Error("Application identifier "+t.id+" is alphanumeric only but contains non alphanumeric character(s).");if(s.length&&s.length!==i.length)throw new Error("Application identifier "+t.id+" must be "+s.length+" characters long.");if(s.min&&s.min>i.length)throw new Error("Application identifier "+t.id+" must be at least "+s.min+" characters long.");if(s.max&&s.max<i.length)throw new Error("Application identifier "+t.id+" must be at most "+s.max+" characters long.")}getByLength(t,e){let i,s;for(let o=2;o<=4;o++)if(i=Vd(t,e,o),s=this.getApplicationIdentifier(i)||this.getApplicationIdentifier(i.substring(0,i.length-1)),s)return{id:i,ai:s};this.unsupportedAIError(i)}unsupportedAIError(t){throw new Error("'"+t+"' is not a supported Application Identifier")}getBySeparator(t,e){let i=t.indexOf(this.startAI,e),s=t.indexOf(this.endAI,i),o=t.substring(i+1,s),n=this.getApplicationIdentifier(o)||this.getApplicationIdentifier(o.substr(o.length-1));return n||this.unsupportedAIError(o),{ai:n,id:o}}getApplicationIdentifier(t){let e=this.applicationIdentifiers,i=e.multiKey;if(e[t])return e[t];for(let e=0;e<i.length;e++){if(i[e].ids&&Mt(t,i[e].ids))return i[e].type;if(i[e].ranges){let s=i[e].ranges;for(let o=0;o<s.length;o++)if(s[o][0]<=t&&t<=s[o][1])return i[e].type}}}};class Od extends yd{constructor(t){super(t),this._initStates()}initProperties(){super.initProperties(),Ld(this,{characterMap:[212222,222122,222221,121223,121322,131222,122213,122312,132212,221213,221312,231212,112232,122132,122231,113222,123122,123221,223211,221132,221231,213212,223112,312131,311222,321122,321221,312212,322112,322211,212123,212321,232121,111323,131123,131321,112313,132113,132311,211313,231113,231311,112133,112331,132131,113123,113321,133121,313121,211331,231131,213113,213311,213131,311123,311321,331121,312113,312311,332111,314111,221411,431111,111224,111422,121124,121421,141122,141221,112214,112412,122114,122411,142112,142211,241211,221114,413111,241112,134111,111242,121142,121241,114212,124112,124211,411212,421112,421211,212141,214121,412121,111143,111341,131141,114113,114311,411113,411311,113141,114131,311141,411131,211412,211214,211232,2331112],STOP:106})}_initStates(){for(let t=0;t<this.states.length;t++)this[this.states[t]]=new Bd[this.states[t]](this,this.states)}initValue(t,e,i){this.pattern=[],this.value=t,this.width=e,this.height=i,this.checkSum=0,this.totalUnits=0,this.index=0,this.position=1}addData(){let t={value:this.value,index:0,state:""};0!==this.value.length&&(t.state=t.previousState=this.getNextState(t,this.states),this.addStart(t),this.pushData(t,this.states),this.addCheckSum(),this.addStop(),this.setBaseUnit())}pushData(t,e){for(;this[t.state].pushState(t),!(t.index>=t.value.length);)if(t.shifted){let e=t.state;t.state=t.previousState,t.previousState=e,t.shifted=!1}else t.previousState=t.state,t.state=this.getNextState(t,e),this[t.state].move(t)}addStart(t){this[t.state].addStart(t),this.position=1}addCheckSum(){this.checksum=this.checkSum%103,this.addPattern(this.checksum)}addStop(){this.addPattern(this.STOP)}setBaseUnit(){this.baseUnit=this.width/(this.totalUnits+this.quietZoneLength)}addPattern(t){const e=this.characterMap[t].toString();let i;for(let t=0;t<e.length;t++)i=parseInt(e.charAt(t),10),this.pattern.push(i),this.totalUnits+=i;this.checkSum+=t*this.position++}getNextState(t,e){for(let i=0;i<e.length;i++)if(this[e[i]].is(t.value,t.index))return e[i];this.invalidCharacterError(t.value.charAt(t.index))}}function Vd(t,e,i){return t.substring(e,e+i)}const Dd=Object.assign;class zd extends yd{initProperties(){super.initProperties(),Dd(this,{characterMap:["12121212","12121221","12122112","12122121","12211212","12211221","12212112","12212121","21121212","21121221"],START:"21",STOP:"121",checkSumType:"",checkSums:Fd})}initValue(t,e){this.pattern=[],this.value=t,this.checkSumLength=0,this.width=e}setBaseUnit(){this.baseUnit=this.width/(12*(this.value.length+this.checkSumLength)+this.quietZoneLength+7)}addData(){const t=this.value;this.addPattern(this.START);for(let e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.STOP),this.setBaseUnit()}addCharacter(t){const e=this.characterMap[t];e||this.invalidCharacterError(t),this.addPattern(e)}addPattern(t){for(let e=0;e<t.length;e++)this.pattern.push(parseInt(t.charAt(e),10))}addCheckSum(){const t=this.checkSums[this.checkSumType].call(this.checkSums,this.value);this.checksum=t.join("");for(let e=0;e<t.length;e++)this.checkSumLength++,this.addPattern(this.characterMap[t[e]])}}const Fd={Modulo10(t){let e,i,s,o=[0,""],n=t.length%2;for(e=0;e<t.length;e++)o[(e+n)%2]+=parseInt(t.charAt(e),10);for(s=o[0],i=(2*o[1]).toString(),e=0;e<i.length;e++)s+=parseInt(i.charAt(e),10);return[(10-s%10)%10]},Modulo11(t){let e,i,s=0,o=t.length;for(let i=0;i<o;i++)e=((o-i)%6||6)+1,s+=e*t.charAt(i);return i=(11-s%11)%11,10!==i?[i]:[1,0]},Modulo11Modulo10(t){let e,i=this.Modulo11(t);return e=t+i[0],i.concat(this.Modulo10(e))},Modulo10Modulo10(t){let e,i=this.Modulo10(t);return e=t+i[0],i.concat(this.Modulo10(e))}},Hd=Object.assign;class Nd extends yd{initProperties(){super.initProperties(),Hd(this,{name:"EAN 13",keyTable:["000000","001011","001101","001110","010011","011001","011100","010101","010110","011010"],characterMap:{digits:[[3,2,1,1],[2,2,2,1],[2,1,2,2],[1,4,1,1],[1,1,3,2],[1,2,3,1],[1,1,1,4],[1,3,1,2],[1,2,1,3],[3,1,1,2]],start:[1,1,1],middle:[1,1,1,1,1]}})}initValue(t,e,i){const s=String(t);if(12!==s.length||/\D/.test(s))throw new Error('The value of the "EAN13" encoding should be 12 symbols');this.pattern=[],this.options.height=i,this.baseUnit=e/(95+this.quietZoneLength),this.value=s,this.checksum=this.calculateChecksum(),this.leftKey=s[0],this.leftPart=s.substr(1,6),this.rightPart=s.substr(7)+this.checksum}addData(){this.addPieces(this.characterMap.start),this.addSide(this.leftPart,this.leftKey),this.addPieces(this.characterMap.middle),this.addSide(this.rightPart),this.addPieces(this.characterMap.start)}addSide(t,e){for(let i=0;i<t.length;i++)e&&parseInt(this.keyTable[e].charAt(i),10)?this.addPieces(Array.prototype.slice.call(this.characterMap.digits[t.charAt(i)]).reverse(),!0):this.addPieces(this.characterMap.digits[t.charAt(i)],!0)}addPieces(t,e){for(let i=0;i<t.length;i++)e?this.pattern.push({y1:0,y2:.95*this.options.height,width:t[i]}):this.pattern.push(t[i])}calculateChecksum(){let t=0,e=0,i=this.value.split("").reverse().join("");for(let s=0;s<i.length;s++)s%2?e+=parseInt(i.charAt(s),10):t+=parseInt(i.charAt(s),10);return(10-(3*t+e)%10)%10}}const jd=Object.assign;const Ud={code11:bd,code39:kd,code39extended:class extends kd{initProperties(){super.initProperties(),ut(this,Ad,{name:"Code 39 extended",characterMap:{SHIFT0:{pattern:"bWbwbWbWb",value:41},SHIFT1:{pattern:"bWbWbwbWb",value:40},SHIFT2:{pattern:"bWbWbWbwb",value:39},SHIFT3:{pattern:"bwbWbWbWb",value:42}}})}},code93:Cd,code93extended:class extends Cd{initProperties(){super.initProperties(),ut(this,Ad,{name:"Code 93 extended",pushCheckSum:function(){const t=this._getCheckValues();let e;this.checksum=t.join("");for(let i=0;i<t.length;i++)if(e=t[i],this.shiftValuesAsciiCodes[e])this.addExtended(this.shiftValuesAsciiCodes[e]);else{const t=this._findCharacterByValue(e);this.addPattern(this.characterMap[t].pattern)}}})}},code128:class extends Od{initProperties(){super.initProperties(),Ld(this,{name:"Code 128",states:["C","B","A","FNC4"]})}},code128a:class extends Od{initProperties(){super.initProperties(),Ld(this,{name:"Code 128 A",states:["A"]})}},code128b:class extends Od{initProperties(){super.initProperties(),Ld(this,{name:"Code 128 B",states:["B"]})}},code128c:class extends Od{initProperties(){super.initProperties(),Ld(this,{name:"Code 128 C",states:["C"]})}},"gs1-128":class extends Od{initProperties(){super.initProperties(),Ld(this,{name:"Code GS1-128",states:["FNC1","C","B"]})}},msimod10:class extends zd{initProperties(){super.initProperties(),Dd(this,{name:"MSI Modulo10",checkSumType:"Modulo10"})}},msimod11:class extends zd{initProperties(){super.initProperties(),Dd(this,{name:"MSI Modulo11",checkSumType:"Modulo11"})}},msimod1010:class extends zd{initProperties(){super.initProperties(),Dd(this,{name:"MSI Modulo10 Modulo10",checkSumType:"Modulo10Modulo10"})}},msimod1110:class extends zd{initProperties(){super.initProperties(),Dd(this,{name:"MSI Modulo11 Modulo10",checkSumType:"Modulo11Modulo10"})}},postnet:class extends yd{initProperties(){super.initProperties(),Pd(this,{name:"Postnet",START:"2",VALID_CODE_LENGTHS:[5,9,11],DIGIT_SEPARATOR:"-",characterMap:["22111","11122","11212","11221","12112","12121","12211","21112","21121","21211"]})}initValue(t,e,i){this.height=i,this.width=e,this.baseHeight=i/2,this.value=t.replace(new RegExp(this.DIGIT_SEPARATOR,"g"),""),this.pattern=[],this.validate(this.value),this.checkSum=0,this.setBaseUnit()}addData(){const t=this.value;this.addPattern(this.START);for(let e=0;e<t.length;e++)this.addCharacter(t.charAt(e));this.options.addCheckSum&&this.addCheckSum(),this.addPattern(this.START),this.pattern.pop()}addCharacter(t){const e=this.characterMap[t];this.checkSum+=parseInt(t,10),this.addPattern(e)}addCheckSum(){this.checksum=(10-this.checkSum%10)%10,this.addCharacter(this.checksum)}setBaseUnit(){this.baseUnit=this.width/(10*(this.value.length+1)+3+this.quietZoneLength)}validate(t){if(Td.test(t)||this.invalidCharacterError(t.match(/[^0-9]/)[0]),!Mt(t.length,this.VALID_CODE_LENGTHS))throw new Error("Invalid value length. Valid lengths for the Postnet symbology are "+this.VALID_CODE_LENGTHS.join(",")+".")}addPattern(t){let e;for(let i=0;i<t.length;i++)e=this.height-this.baseHeight*t.charAt(i),this.pattern.push({width:1,y1:e,y2:this.height}),this.pattern.push(1)}},ean8:class extends Nd{initProperties(){super.initProperties(),jd(this,{name:"EAN 8"})}initValue(t,e,i){if(7!==t.length||/\D/.test(t))throw new Error("Invalid value provided");this.value=t,this.options.height=i,this.checksum=this.calculateChecksum(this.value),this.leftPart=this.value.substr(0,4),this.rightPart=this.value.substr(4)+this.checksum,this.pattern=[],this.baseUnit=e/(67+this.quietZoneLength)}},ean13:Nd};function Gd(t,e){const i=t.style.display;"canvas"===e&&(t.style.display="block");const s={width:t.clientWidth,height:t.clientHeight};return t.style.display=i,s}class Wd extends e.a{constructor(t,e,i=ve){super(),this.options=ut({},this.options,e),this.element=t,this.onError=i,this._initElement(),this._initSurface(),this._setOptions(e),e&&Ft(e.value)&&this.redraw()}destroy(){this._destroySurface()}_initElement(){K(this.element,"k-barcode")}_initSurface(){const{options:t,surface:e}=this;e&&e.options.type===t.renderAs||(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_createSurface(){return e.n.create(this.surfaceElement,{type:this.options.renderAs})}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.surfaceElement.style.position="relative",this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}setOptions(t){this._setOptions(t),this._initSurface(),this.redraw()}redraw(){let t=this._getSize();this.surface.clear(),this.surface.setSize({width:t.width,height:t.height}),this.createVisual(),this.surface.draw(this.visual)}getSize(){return{width:this.element.offsetWidth,height:this.element.offsetHeight}}_resize(){this.redraw()}createVisual(){this.visual=this._render()}_render(){const t=this.options,i=t.value,s=t.text,o=yt(s.margin),n=this._getSize(),r=t.border||{},a=this.encoding,l=new ui(0,0,n.width,n.height).unpad(r.width).unpad(t.padding);let h,c,d,u=l.height();const p=new e.G;this.contentBox=l,p.append(this._getBackground(n)),s.visible&&(d=e.m(i,{font:s.font}).height,u-=d+o.top+o.bottom);try{h=a.encode(i,l.width(),u)}catch(t){return this.onError(t),p}return s.visible&&(c=i,t.checksum&&Ft(a.checksum)&&(c+=" "+a.checksum),p.append(this._getText(c))),this.barHeight=u,this._bandsGroup=this._getBands(h.pattern,h.baseUnit),p.append(this._bandsGroup),p}exportVisual(){return this._render()}_getSize(){const t=Gd(this.element,this.options.renderAs),i=new e.q(300,100);return t.width>0&&(i.width=t.width),t.height>0&&(i.height=t.height),this.options.width&&(i.width=this.options.width),this.options.height&&(i.height=this.options.height),i}value(t){if(!Ft(t))return this.options.value;this.options.value=String(t),this.redraw()}_getBands(t,i){const s=this.contentBox;let o,n,r=s.x1;const a=new e.G;for(let l=0;l<t.length;l++){if(n=pt(t[l])?t[l]:{width:t[l],y1:0,y2:this.barHeight},o=n.width*i,l%2){const t=e.R.fromPoints(new e.P(r,n.y1+s.y1),new e.P(r+o,n.y2+s.y1)),i=e.b.fromRect(t,{fill:{color:this.options.color},stroke:null});a.append(i)}r+=o}return a}_getBackground(t){const i=this.options,s=i.border||{},o=new ui(0,0,t.width,t.height).unpad(s.width/2);return e.b.fromRect(o.toRect(),{fill:{color:i.background},stroke:{color:s.width?s.color:"",width:s.width,dashType:s.dashType}})}_getText(t){const e=this.options.text,i=this._textbox=new zi(t,{font:e.font,color:e.color,align:"center",vAlign:"bottom",margin:e.margin});return i.reflow(this.contentBox),i.renderVisual(),i.visual}_setOptions(t){if(this.type=(t.type||this.options.type).toLowerCase(),"upca"===this.type&&(this.type="ean13",t.value="0"+t.value),"upce"===this.type&&(this.type="ean8",t.value="0"+t.value),!Ud[this.type])throw new Error(`Encoding '${this.type}' is not supported.`);this.encoding=new Ud[this.type],this.options=ut({},this.options,t)}}te(Wd,{name:"Barcode",renderAs:"svg",value:"",type:"code39",checksum:!1,width:0,height:0,color:"black",background:"white",text:{visible:!0,font:"16px Consolas, Monaco, Sans Mono, monospace, sans-serif",color:"black",margin:{top:0,bottom:0,left:0,right:0}},border:{width:0,dashType:"solid",color:"black"},padding:{top:0,bottom:0,left:0,right:0}});const Xd=Object.assign;function Yd(t,e){let i=[],s=0;for(;s<t.length;)i.push(t.substring(s,s+e)),s+=e;return i}function qd(t,e){let i=Number(t).toString(2);return i.length<e&&(i=new Array(e-i.length+1).join(0)+i),i}function Zd(t){return parseInt(t,2)}class $d extends e.a{constructor(t){super(),this.matrix=t,this.row=t.length-1,this.column=t.length-1,this.startColumn=this.column,this.dir=-1,this.c=0}move(){this.row+=this.dir*this.c,this.c^=1,this.column=this.startColumn-this.c}getNextCell(){for(;void 0!==this.matrix[this.row][this.column];)this.move(),(this.row<0||this.row>=this.matrix.length)&&(this.dir=-this.dir,this.startColumn-=8!==this.startColumn?2:3,this.column=this.startColumn,this.row=this.dir<0?this.matrix.length-1:0);return{row:this.row,column:this.column}}getNextRemainderCell(){if(this.move(),void 0===this.matrix[this.row][this.column])return{row:this.row,column:this.column}}}class Qd extends e.a{constructor(t,e){super(),this.dataString=t,this.version=e}}const Kd="alphanumeric",Jd=/^\d+/,tu="A-Z0-9 $%*+./:-",eu=new RegExp("^[A-Z $%*+./:-]+"),iu=new RegExp("^["+tu+"]+"),su=new RegExp("^[^"+tu+"]+");function ou(t,e,i,s,o){let n,r,a=Jd.exec(t),l=a?a[0]:"",h=eu.exec(t),c=h?h[0]:"",d=iu.exec(t),u=d?d[0]:"";return l&&(l.length>=e||t.length===l.length||l.length>=i&&!iu.test(t.charAt(l.length)))?(n="numeric",r=l):u&&(t.length===u.length||u.length>=s||o===Kd)?(n=Kd,r=l||c):(n="byte",r=u?u+su.exec(t.substring(u.length))[0]:su.exec(t)[0]),{mode:n,modeString:r}}class nu extends e.a{constructor(){super(),this.initProperties()}initProperties(){Xd(this,{modeIndicator:"",bitsInCharacterCount:[]})}getVersionIndex(t){return t<10?0:t>26?2:1}getBitsCharacterCount(t){return this.bitsInCharacterCount[this.getVersionIndex(t||40)]}getModeCountString(t,e){return this.modeIndicator+qd(t,this.getBitsCharacterCount(e))}encode(){}getStringBitsLength(){}getValue(){}}const ru="numeric",au="alphanumeric",lu="byte";let hu={[ru]:new class extends nu{initProperties(){super.initProperties(),Xd(this,{bitsInCharacterCount:[10,12,14],modeIndicator:"0001"})}getValue(t){return parseInt(t,10)}encode(t,e){let i,s=Yd(t,3),o=this.getModeCountString(t.length,e);for(i=0;i<s.length-1;i++)o+=qd(s[i],10);return o+qd(s[i],1+3*s[i].length)}getStringBitsLength(t,e){let i=t%3;return 4+this.getBitsCharacterCount(e)+10*Math.floor(t/3)+3*i+(0===i?0:1)}},[au]:new class extends nu{initProperties(){super.initProperties(),Xd(this,{characters:{0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,G:16,H:17,I:18,J:19,K:20,L:21,M:22,N:23,O:24,P:25,Q:26,R:27,S:28,T:29,U:30,V:31,W:32,X:33,Y:34,Z:35," ":36,$:37,"%":38,"*":39,"+":40,"-":41,".":42,"/":43,":":44},bitsInCharacterCount:[9,11,13],modeIndicator:"0010"})}getValue(t){return this.characters[t]}encode(t,e){let i,s,o=Yd(t,2),n=this.getModeCountString(t.length,e);for(s=0;s<o.length-1;s++)i=45*this.getValue(o[s].charAt(0))+this.getValue(o[s].charAt(1)),n+=qd(i,11);return i=2===o[s].length?45*this.getValue(o[s].charAt(0))+this.getValue(o[s].charAt(1)):this.getValue(o[s].charAt(0)),n+qd(i,1+5*o[s].length)}getStringBitsLength(t,e){return 4+this.getBitsCharacterCount(e)+11*Math.floor(t/2)+t%2*6}},[lu]:new class extends nu{initProperties(){super.initProperties(),Xd(this,{bitsInCharacterCount:[8,16,16],modeIndicator:"0100"})}getValue(t){let e=t.charCodeAt(0);if(e<=127||160<=e&&e<=255)return e;throw new Error(`Unsupported character in QR Code: "${t}".`)}encode(t,e){let i=this,s=i.getModeCountString(t.length,e);for(let e=0;e<t.length;e++)s+=qd(i.getValue(t.charAt(e)),8);return s}getStringBitsLength(t,e){return 4+this.getBitsCharacterCount(e)+8*t}}};const cu=[{L:{groups:[[1,19]],totalDataCodewords:19,errorCodewordsPerBlock:7},M:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:10},Q:{groups:[[1,13]],totalDataCodewords:13,errorCodewordsPerBlock:13},H:{groups:[[1,9]],totalDataCodewords:9,errorCodewordsPerBlock:17}},{L:{groups:[[1,34]],totalDataCodewords:34,errorCodewordsPerBlock:10},M:{groups:[[1,28]],totalDataCodewords:28,errorCodewordsPerBlock:16},Q:{groups:[[1,22]],totalDataCodewords:22,errorCodewordsPerBlock:22},H:{groups:[[1,16]],totalDataCodewords:16,errorCodewordsPerBlock:28}},{L:{groups:[[1,55]],totalDataCodewords:55,errorCodewordsPerBlock:15},M:{groups:[[1,44]],totalDataCodewords:44,errorCodewordsPerBlock:26},Q:{groups:[[2,17]],totalDataCodewords:34,errorCodewordsPerBlock:18},H:{groups:[[2,13]],totalDataCodewords:26,errorCodewordsPerBlock:22}},{L:{groups:[[1,80]],totalDataCodewords:80,errorCodewordsPerBlock:20},M:{groups:[[2,32]],totalDataCodewords:64,errorCodewordsPerBlock:18},Q:{groups:[[2,24]],totalDataCodewords:48,errorCodewordsPerBlock:26},H:{groups:[[4,9]],totalDataCodewords:36,errorCodewordsPerBlock:16}},{L:{groups:[[1,108]],totalDataCodewords:108,errorCodewordsPerBlock:26},M:{groups:[[2,43]],totalDataCodewords:86,errorCodewordsPerBlock:24},Q:{groups:[[2,15],[2,16]],totalDataCodewords:62,errorCodewordsPerBlock:18},H:{groups:[[2,11],[2,12]],totalDataCodewords:46,errorCodewordsPerBlock:22}},{L:{groups:[[2,68]],totalDataCodewords:136,errorCodewordsPerBlock:18},M:{groups:[[4,27]],totalDataCodewords:108,errorCodewordsPerBlock:16},Q:{groups:[[4,19]],totalDataCodewords:76,errorCodewordsPerBlock:24},H:{groups:[[4,15]],totalDataCodewords:60,errorCodewordsPerBlock:28}},{L:{groups:[[2,78]],totalDataCodewords:156,errorCodewordsPerBlock:20},M:{groups:[[4,31]],totalDataCodewords:124,errorCodewordsPerBlock:18},Q:{groups:[[2,14],[4,15]],totalDataCodewords:88,errorCodewordsPerBlock:18},H:{groups:[[4,13],[1,14]],totalDataCodewords:66,errorCodewordsPerBlock:26}},{L:{groups:[[2,97]],totalDataCodewords:194,errorCodewordsPerBlock:24},M:{groups:[[2,38],[2,39]],totalDataCodewords:154,errorCodewordsPerBlock:22},Q:{groups:[[4,18],[2,19]],totalDataCodewords:110,errorCodewordsPerBlock:22},H:{groups:[[4,14],[2,15]],totalDataCodewords:86,errorCodewordsPerBlock:26}},{L:{groups:[[2,116]],totalDataCodewords:232,errorCodewordsPerBlock:30},M:{groups:[[3,36],[2,37]],totalDataCodewords:182,errorCodewordsPerBlock:22},Q:{groups:[[4,16],[4,17]],totalDataCodewords:132,errorCodewordsPerBlock:20},H:{groups:[[4,12],[4,13]],totalDataCodewords:100,errorCodewordsPerBlock:24}},{L:{groups:[[2,68],[2,69]],totalDataCodewords:274,errorCodewordsPerBlock:18},M:{groups:[[4,43],[1,44]],totalDataCodewords:216,errorCodewordsPerBlock:26},Q:{groups:[[6,19],[2,20]],totalDataCodewords:154,errorCodewordsPerBlock:24},H:{groups:[[6,15],[2,16]],totalDataCodewords:122,errorCodewordsPerBlock:28}},{L:{groups:[[4,81]],totalDataCodewords:324,errorCodewordsPerBlock:20},M:{groups:[[1,50],[4,51]],totalDataCodewords:254,errorCodewordsPerBlock:30},Q:{groups:[[4,22],[4,23]],totalDataCodewords:180,errorCodewordsPerBlock:28},H:{groups:[[3,12],[8,13]],totalDataCodewords:140,errorCodewordsPerBlock:24}},{L:{groups:[[2,92],[2,93]],totalDataCodewords:370,errorCodewordsPerBlock:24},M:{groups:[[6,36],[2,37]],totalDataCodewords:290,errorCodewordsPerBlock:22},Q:{groups:[[4,20],[6,21]],totalDataCodewords:206,errorCodewordsPerBlock:26},H:{groups:[[7,14],[4,15]],totalDataCodewords:158,errorCodewordsPerBlock:28}},{L:{groups:[[4,107]],totalDataCodewords:428,errorCodewordsPerBlock:26},M:{groups:[[8,37],[1,38]],totalDataCodewords:334,errorCodewordsPerBlock:22},Q:{groups:[[8,20],[4,21]],totalDataCodewords:244,errorCodewordsPerBlock:24},H:{groups:[[12,11],[4,12]],totalDataCodewords:180,errorCodewordsPerBlock:22}},{L:{groups:[[3,115],[1,116]],totalDataCodewords:461,errorCodewordsPerBlock:30},M:{groups:[[4,40],[5,41]],totalDataCodewords:365,errorCodewordsPerBlock:24},Q:{groups:[[11,16],[5,17]],totalDataCodewords:261,errorCodewordsPerBlock:20},H:{groups:[[11,12],[5,13]],totalDataCodewords:197,errorCodewordsPerBlock:24}},{L:{groups:[[5,87],[1,88]],totalDataCodewords:523,errorCodewordsPerBlock:22},M:{groups:[[5,41],[5,42]],totalDataCodewords:415,errorCodewordsPerBlock:24},Q:{groups:[[5,24],[7,25]],totalDataCodewords:295,errorCodewordsPerBlock:30},H:{groups:[[11,12],[7,13]],totalDataCodewords:223,errorCodewordsPerBlock:24}},{L:{groups:[[5,98],[1,99]],totalDataCodewords:589,errorCodewordsPerBlock:24},M:{groups:[[7,45],[3,46]],totalDataCodewords:453,errorCodewordsPerBlock:28},Q:{groups:[[15,19],[2,20]],totalDataCodewords:325,errorCodewordsPerBlock:24},H:{groups:[[3,15],[13,16]],totalDataCodewords:253,errorCodewordsPerBlock:30}},{L:{groups:[[1,107],[5,108]],totalDataCodewords:647,errorCodewordsPerBlock:28},M:{groups:[[10,46],[1,47]],totalDataCodewords:507,errorCodewordsPerBlock:28},Q:{groups:[[1,22],[15,23]],totalDataCodewords:367,errorCodewordsPerBlock:28},H:{groups:[[2,14],[17,15]],totalDataCodewords:283,errorCodewordsPerBlock:28}},{L:{groups:[[5,120],[1,121]],totalDataCodewords:721,errorCodewordsPerBlock:30},M:{groups:[[9,43],[4,44]],totalDataCodewords:563,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[1,23]],totalDataCodewords:397,errorCodewordsPerBlock:28},H:{groups:[[2,14],[19,15]],totalDataCodewords:313,errorCodewordsPerBlock:28}},{L:{groups:[[3,113],[4,114]],totalDataCodewords:795,errorCodewordsPerBlock:28},M:{groups:[[3,44],[11,45]],totalDataCodewords:627,errorCodewordsPerBlock:26},Q:{groups:[[17,21],[4,22]],totalDataCodewords:445,errorCodewordsPerBlock:26},H:{groups:[[9,13],[16,14]],totalDataCodewords:341,errorCodewordsPerBlock:26}},{L:{groups:[[3,107],[5,108]],totalDataCodewords:861,errorCodewordsPerBlock:28},M:{groups:[[3,41],[13,42]],totalDataCodewords:669,errorCodewordsPerBlock:26},Q:{groups:[[15,24],[5,25]],totalDataCodewords:485,errorCodewordsPerBlock:30},H:{groups:[[15,15],[10,16]],totalDataCodewords:385,errorCodewordsPerBlock:28}},{L:{groups:[[4,116],[4,117]],totalDataCodewords:932,errorCodewordsPerBlock:28},M:{groups:[[17,42]],totalDataCodewords:714,errorCodewordsPerBlock:26},Q:{groups:[[17,22],[6,23]],totalDataCodewords:512,errorCodewordsPerBlock:28},H:{groups:[[19,16],[6,17]],totalDataCodewords:406,errorCodewordsPerBlock:30}},{L:{groups:[[2,111],[7,112]],totalDataCodewords:1006,errorCodewordsPerBlock:28},M:{groups:[[17,46]],totalDataCodewords:782,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[16,25]],totalDataCodewords:568,errorCodewordsPerBlock:30},H:{groups:[[34,13]],totalDataCodewords:442,errorCodewordsPerBlock:24}},{L:{groups:[[4,121],[5,122]],totalDataCodewords:1094,errorCodewordsPerBlock:30},M:{groups:[[4,47],[14,48]],totalDataCodewords:860,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[14,25]],totalDataCodewords:614,errorCodewordsPerBlock:30},H:{groups:[[16,15],[14,16]],totalDataCodewords:464,errorCodewordsPerBlock:30}},{L:{groups:[[6,117],[4,118]],totalDataCodewords:1174,errorCodewordsPerBlock:30},M:{groups:[[6,45],[14,46]],totalDataCodewords:914,errorCodewordsPerBlock:28},Q:{groups:[[11,24],[16,25]],totalDataCodewords:664,errorCodewordsPerBlock:30},H:{groups:[[30,16],[2,17]],totalDataCodewords:514,errorCodewordsPerBlock:30}},{L:{groups:[[8,106],[4,107]],totalDataCodewords:1276,errorCodewordsPerBlock:26},M:{groups:[[8,47],[13,48]],totalDataCodewords:1e3,errorCodewordsPerBlock:28},Q:{groups:[[7,24],[22,25]],totalDataCodewords:718,errorCodewordsPerBlock:30},H:{groups:[[22,15],[13,16]],totalDataCodewords:538,errorCodewordsPerBlock:30}},{L:{groups:[[10,114],[2,115]],totalDataCodewords:1370,errorCodewordsPerBlock:28},M:{groups:[[19,46],[4,47]],totalDataCodewords:1062,errorCodewordsPerBlock:28},Q:{groups:[[28,22],[6,23]],totalDataCodewords:754,errorCodewordsPerBlock:28},H:{groups:[[33,16],[4,17]],totalDataCodewords:596,errorCodewordsPerBlock:30}},{L:{groups:[[8,122],[4,123]],totalDataCodewords:1468,errorCodewordsPerBlock:30},M:{groups:[[22,45],[3,46]],totalDataCodewords:1128,errorCodewordsPerBlock:28},Q:{groups:[[8,23],[26,24]],totalDataCodewords:808,errorCodewordsPerBlock:30},H:{groups:[[12,15],[28,16]],totalDataCodewords:628,errorCodewordsPerBlock:30}},{L:{groups:[[3,117],[10,118]],totalDataCodewords:1531,errorCodewordsPerBlock:30},M:{groups:[[3,45],[23,46]],totalDataCodewords:1193,errorCodewordsPerBlock:28},Q:{groups:[[4,24],[31,25]],totalDataCodewords:871,errorCodewordsPerBlock:30},H:{groups:[[11,15],[31,16]],totalDataCodewords:661,errorCodewordsPerBlock:30}},{L:{groups:[[7,116],[7,117]],totalDataCodewords:1631,errorCodewordsPerBlock:30},M:{groups:[[21,45],[7,46]],totalDataCodewords:1267,errorCodewordsPerBlock:28},Q:{groups:[[1,23],[37,24]],totalDataCodewords:911,errorCodewordsPerBlock:30},H:{groups:[[19,15],[26,16]],totalDataCodewords:701,errorCodewordsPerBlock:30}},{L:{groups:[[5,115],[10,116]],totalDataCodewords:1735,errorCodewordsPerBlock:30},M:{groups:[[19,47],[10,48]],totalDataCodewords:1373,errorCodewordsPerBlock:28},Q:{groups:[[15,24],[25,25]],totalDataCodewords:985,errorCodewordsPerBlock:30},H:{groups:[[23,15],[25,16]],totalDataCodewords:745,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[3,116]],totalDataCodewords:1843,errorCodewordsPerBlock:30},M:{groups:[[2,46],[29,47]],totalDataCodewords:1455,errorCodewordsPerBlock:28},Q:{groups:[[42,24],[1,25]],totalDataCodewords:1033,errorCodewordsPerBlock:30},H:{groups:[[23,15],[28,16]],totalDataCodewords:793,errorCodewordsPerBlock:30}},{L:{groups:[[17,115]],totalDataCodewords:1955,errorCodewordsPerBlock:30},M:{groups:[[10,46],[23,47]],totalDataCodewords:1541,errorCodewordsPerBlock:28},Q:{groups:[[10,24],[35,25]],totalDataCodewords:1115,errorCodewordsPerBlock:30},H:{groups:[[19,15],[35,16]],totalDataCodewords:845,errorCodewordsPerBlock:30}},{L:{groups:[[17,115],[1,116]],totalDataCodewords:2071,errorCodewordsPerBlock:30},M:{groups:[[14,46],[21,47]],totalDataCodewords:1631,errorCodewordsPerBlock:28},Q:{groups:[[29,24],[19,25]],totalDataCodewords:1171,errorCodewordsPerBlock:30},H:{groups:[[11,15],[46,16]],totalDataCodewords:901,errorCodewordsPerBlock:30}},{L:{groups:[[13,115],[6,116]],totalDataCodewords:2191,errorCodewordsPerBlock:30},M:{groups:[[14,46],[23,47]],totalDataCodewords:1725,errorCodewordsPerBlock:28},Q:{groups:[[44,24],[7,25]],totalDataCodewords:1231,errorCodewordsPerBlock:30},H:{groups:[[59,16],[1,17]],totalDataCodewords:961,errorCodewordsPerBlock:30}},{L:{groups:[[12,121],[7,122]],totalDataCodewords:2306,errorCodewordsPerBlock:30},M:{groups:[[12,47],[26,48]],totalDataCodewords:1812,errorCodewordsPerBlock:28},Q:{groups:[[39,24],[14,25]],totalDataCodewords:1286,errorCodewordsPerBlock:30},H:{groups:[[22,15],[41,16]],totalDataCodewords:986,errorCodewordsPerBlock:30}},{L:{groups:[[6,121],[14,122]],totalDataCodewords:2434,errorCodewordsPerBlock:30},M:{groups:[[6,47],[34,48]],totalDataCodewords:1914,errorCodewordsPerBlock:28},Q:{groups:[[46,24],[10,25]],totalDataCodewords:1354,errorCodewordsPerBlock:30},H:{groups:[[2,15],[64,16]],totalDataCodewords:1054,errorCodewordsPerBlock:30}},{L:{groups:[[17,122],[4,123]],totalDataCodewords:2566,errorCodewordsPerBlock:30},M:{groups:[[29,46],[14,47]],totalDataCodewords:1992,errorCodewordsPerBlock:28},Q:{groups:[[49,24],[10,25]],totalDataCodewords:1426,errorCodewordsPerBlock:30},H:{groups:[[24,15],[46,16]],totalDataCodewords:1096,errorCodewordsPerBlock:30}},{L:{groups:[[4,122],[18,123]],totalDataCodewords:2702,errorCodewordsPerBlock:30},M:{groups:[[13,46],[32,47]],totalDataCodewords:2102,errorCodewordsPerBlock:28},Q:{groups:[[48,24],[14,25]],totalDataCodewords:1502,errorCodewordsPerBlock:30},H:{groups:[[42,15],[32,16]],totalDataCodewords:1142,errorCodewordsPerBlock:30}},{L:{groups:[[20,117],[4,118]],totalDataCodewords:2812,errorCodewordsPerBlock:30},M:{groups:[[40,47],[7,48]],totalDataCodewords:2216,errorCodewordsPerBlock:28},Q:{groups:[[43,24],[22,25]],totalDataCodewords:1582,errorCodewordsPerBlock:30},H:{groups:[[10,15],[67,16]],totalDataCodewords:1222,errorCodewordsPerBlock:30}},{L:{groups:[[19,118],[6,119]],totalDataCodewords:2956,errorCodewordsPerBlock:30},M:{groups:[[18,47],[31,48]],totalDataCodewords:2334,errorCodewordsPerBlock:28},Q:{groups:[[34,24],[34,25]],totalDataCodewords:1666,errorCodewordsPerBlock:30},H:{groups:[[20,15],[61,16]],totalDataCodewords:1276,errorCodewordsPerBlock:30}}];function du(t,e){let i=0,s=cu.length-1,o=Math.floor(cu.length/2);do{t<cu[o][e].totalDataCodewords?s=o:i=o,o=i+Math.floor((s-i)/2)}while(s-i>1);return t<=cu[i][e].totalDataCodewords?o+1:s+1}class uu extends e.a{getEncodingResult(t,e){let i=function(t){let e,i=[],s=0,o=t;for(i.push(ou(o,8,5,8,e)),e=i[0].mode,o=o.substr(i[0].modeString.length);o.length>0;){let t=ou(o,17,9,16,e);t.mode!==e?(e=t.mode,i.push(t),s++):i[s].modeString+=t.modeString,o=o.substr(t.modeString.length)}return i}(t),s=function(t){let e,i=0;for(let s=0;s<t.length;s++)e=hu[t[s].mode],i+=e.getStringBitsLength(t[s].modeString.length);return Math.ceil(i/8)}(i),o=du(s,e),n=function(t,e){let i,s="";for(let o=0;o<t.length;o++)i=hu[t[o].mode],s+=i.encode(t[o].modeString,e);return s}(i,o);return new Qd(n,o)}}class pu extends e.a{constructor(){super(),this.initProperties(),this.mode=hu[this.encodingMode]}initProperties(){Xd(this,{encodingMode:"byte",utfBOM:"111011111011101110111111",initialModeCountStringLength:20,ranges:[128,2048,65536,2097152,67108864]})}getEncodingResult(t,e){let i=this.encode(t),s=du(this.getDataCodewordsCount(i),e),o=this.mode.getModeCountString(i.length/8,s)+i;return new Qd(o,s)}getDataCodewordsCount(t){let e=t.length;return Math.ceil((this.initialModeCountStringLength+e)/8)}encode(t){let e=this.utfBOM;for(let i=0;i<t.length;i++)e+=this.encodeCharacter(t.charCodeAt(i));return e}encodeCharacter(t){let e=this.getBytesCount(t),i=e-1,s="";if(1===e)s=qd(t,8);else{let o=8-e;for(let e=0;e<i;e++)s=qd(t>>6*e&63|128,8)+s;s=(t>>6*i|255>>o<<o).toString(2)+s}return s}getBytesCount(t){let e=this.ranges;for(let i=0;i<e.length;i++)if(t<e[i])return i+1}}let gu="0000",mu={1:0},fu={0:1},xu={15:20,16:20,18:24,19:24,22:20,24:22,26:24,28:20,30:20,31:24,32:28,33:24,36:18,37:22,39:20,40:24},yu=[1,0,1,1,1],vu=[1,0,1],bu={L:"01",M:"00",Q:"11",H:"10"},wu=["11101100","00010001"],_u=[(t,e)=>(t+e)%2==0,(t,e)=>t%2==0,(t,e)=>e%3==0,(t,e)=>(t+e)%3==0,(t,e)=>(Math.floor(t/2)+Math.floor(e/3))%2==0,(t,e)=>t*e%2+t*e%3==0,(t,e)=>(t*e%2+t*e%3)%2==0,(t,e)=>((t+e)%2+t*e%3)%2==0];const ku=[[1,0],[1,25,0]];function Au(t,e,i,s){for(let o=0;o<t.length;o++)t[o][i][s]=e}function Su(t,e,i,s){for(let o=0;o<_u.length;o++)t[o][i][s]=_u[o](i,s)?1^e:parseInt(e,10)}function Cu(t,e){let i=[];for(let s=t.length-2;s>=0;s--)i[s]=t[s]^e[s];return i}function Tu(t,e){let i=[];for(let s=0;s<t.length;s++)for(let o=0;o<e.length;o++)void 0===i[s+o]?i[s+o]=(t[s]+(e[o]>=0?e[o]:0))%255:i[s+o]=mu[fu[i[s+o]]^fu[(t[s]+e[o])%255]];return i}function Pu(t,e){let i=[],s=t.length-1;do{i[s]=fu[(t[s]+e)%255],s--}while(void 0!==t[s]);return i}function Mu(t,e){let i,s,o=ku[e-1],n=new Array(e).concat(t),r=new Array(n.length-o.length).concat(o),a=t.length,l=[];for(s=0;s<a;s++)i=Pu(r,mu[n[n.length-1]]),r.splice(0,1),n=Cu(i,n);for(s=n.length-1;s>=0;s--)l[e-1-s]=qd(n[s],8);return l}function Eu(t,e,i){let s=Zd(e),o=e.length-1,n=t<<o,r=qd(t,i-o),a=function(t,e){let i=e.toString(2).length,s=t.toString(2).length,o=t;do{o^=e<<s-i,s=o.toString(2).length}while(s>=i);return o}(n,s);return a=r+qd(a,o),a}function Lu(t,e){return parseInt(t.charAt(e),10)}function Iu(t,e){let i,s,o=t[0],n=0,r=e.length;for(i=0,s=8;i<=8;i++)6!==i&&Au(t,Lu(e,r-1-n++),i,s);for(i=8,s=7;s>=0;s--)6!==s&&Au(t,Lu(e,r-1-n++),i,s);for(n=0,s=o.length-1,i=8;s>=o.length-8;s--)Au(t,Lu(e,r-1-n++),i,s);for(Au(t,1,o.length-8,8),i=o.length-7,s=8;i<o.length;i++)Au(t,Lu(e,r-1-n++),i,s)}function Ru(t,e){let i,s,o,n=t[0].length,r=n-11,a=n-11;for(let n=0;n<e.length;n++)i=Math.floor(n/3),s=n%3,o=Lu(e,e.length-n-1),Au(t,o,0+i,r+s),Au(t,o,a+s,0+i)}function Bu(t,e,i,s){let o,n=e.length+2,r=e.length+1;for(let a=0;a<e.length;a++)for(let l=a;l<n-a;l++)o=e[a],Au(t,o,i+l,s+a),Au(t,o,i+a,s+l),Au(t,o,i+r-l,s+r-a),Au(t,o,i+r-a,s+r-l)}function Ou(t,e,i,s){let o=i,n=s,r=t[0];do{Au(t,0,o,s),Au(t,0,i,n),o+=e[0],n+=e[1]}while(o>=0&&o<r.length)}function Vu(t,e,i,s,o){e[t][s]=(e[t][s]<<1^o)%128,93===e[t][s]&&(i[t]+=40)}function Du(t,e,i,s,o,n){i[t][n]===s?o[t][n]++:(i[t][n]=s,o[t][n]>=5&&(e[t]+=3+o[t][n]-5),o[t][n]=1)}function zu(t,e){let i=Math.floor(t/e*100),s=i%5,o=Math.abs(i-s-50),n=Math.abs(i+5-s-50);return 10*Math.min(o/5,n/5)}function Fu(t,e,i){let s=function(t){return t&&t.toLowerCase().indexOf("utf_8")>=0?new pu:new uu}(i),o=s.getEncodingResult(t,e),n=o.version,r=cu[n-1][e],a=function(t,e){let i,s,o,n,r,a=0,l=[],h=[],c=e.groups;for(let d=0;d<c.length;d++){o=c[d][0];for(let u=0;u<o;u++){s=c[d][1],i=[],n=[];for(let e=1;e<=s;e++)r=t.substring(a,a+8),i.push(r),n[s-e]=Zd(r),a+=8;l.push(i),h.push(Mu(n,e.errorCodewordsPerBlock))}}return[l,h]}(function(t,e){let i=8*e,s=0,o=0,n=t;for(;n.length<i&&s<4;)n+=gu.charAt(s++);for(n.length%8!=0&&(n+=new Array(9-n.length%8).join("0"));n.length<i;)n+=wu[o],o^=1;return n}(o.dataString,r.totalDataCodewords),r),l=function(t){let e=[],i=17+4*t;for(let t=0;t<_u.length;t++){e[t]=new Array(i);for(let s=0;s<i;s++)e[t][s]=new Array(i)}return e}(n);!function(t){let e=t[0].length;Bu(t,yu,0,0),Ou(t,[-1,-1],7,7),Bu(t,yu,e-7,0),Ou(t,[1,-1],e-8,7),Bu(t,yu,0,e-7),Ou(t,[-1,1],7,e-8)}(l),function(t,e){if(e<2)return;let i,s,o=t[0],n=o.length,r=Math.floor(e/7),a=[6],l=0;for((i=xu[e])?s=(n-13-i)/r:i=s=(n-13)/(r+1),a.push(a[l++]+i);a[l]+s<n;)a.push(a[l++]+s);for(let e=0;e<a.length;e++)for(let i=0;i<a.length;i++)void 0===o[a[e]][a[i]]&&Bu(t,vu,a[e]-2,a[i]-2)}(l,n),function(t){let e=1,i=t[0].length;for(let s=8;s<i-8;s++)Au(t,e,6,s),Au(t,e,s,6),e^=1}(l),n>=7&&Ru(l,qd(0,18)),Iu(l,qd(0,15)),function(t,e){let i,s,o,n=new $d(t[0]);for(let r=0;r<e.length;r++)for(i=e[r],s=0;i.length>0;){for(let e=0;e<i.length;e++)for(let r=0;r<8;r++)o=n.getNextCell(),Su(t,i[e][s].charAt(r),o.row,o.column);for(s++;i[0]&&s===i[0].length;)i.splice(0,1)}for(;o=n.getNextRemainderCell();)Su(t,0,o.row,o.column)}(l,a);let h=function(t){let e,i,s=[],o=[],n=[],r=[],a=[],l=t[0].length;for(i=0;i<t.length;i++)s[i]=0,n[i]=0,a[i]=[0,0],r[i]=[0,0],o[i]=[];for(let i=0;i<l;i++)for(let h=0;h<l;h++)for(let c=0;c<t.length;c++)e=t[c],n[c]+=parseInt(e[i][h],10),o[c][0]===e[i][h]&&i+1<l&&h-1>=0&&e[i+1][h]===o[c][0]&&e[i+1][h-1]===o[c][0]&&(s[c]+=3),Vu(c,r,s,0,e[i][h]),Vu(c,r,s,1,e[h][i]),Du(c,s,o,e[i][h],a,0),Du(c,s,o,e[h][i],a,1);let h,c=l*l,d=Number.MAX_VALUE;for(i=0;i<s.length;i++)s[i]+=zu(n[i],c),s[i]<d&&(d=s[i],h=i);return h}(l),c=l[h];return n>=7&&Ru([c],function(t){return Eu(t,"1111100100101",18)}(n)),Iu([c],function(t){let e,i="";if(0===Zd(t))return"101010000010010";e=Eu(Zd(t),"10100110111",15);for(let t=0;t<e.length;t++)i+=e.charAt(t)^"101010000010010".charAt(t);return i}(bu[e]+qd(h,3))),c}!function(){let t,e;for(e=1;e<255;e++)t=2*fu[e-1],t>255&&(t^=285),fu[e]=t,mu[t]=e;t=2*fu[e-1]^285,fu[e]=t,fu[-1]=0}(),function(){for(let t=2;t<=68;t++){let e=ku[t-1],i=[t,0];ku[t]=Tu(e,i)}}();const Hu=Math.round,Nu=[[0,1],[1,1],[1,2],[2,2],[2,1],[3,1],[3,0],[2,0],[2,-1],[1,-1],[1,0]],ju=[[0,1],[1,1],[1,0]],Uu=200,Gu="L",Wu="#fff",Xu="#000",Yu=1,qu=7;class Zu extends e.a{constructor(t,e,i=ve){super(),this.options=ut({},this.options,e),this.element=t,this.wrapper=this.element,this.onError=i,this._initElement(),this._initSurface(),this.setOptions(e)}destroy(){this._destroySurface()}_initElement(){K(this.element,"k-qrcode")}_initSurface(){const{options:t,surface:e}=this;e&&e.options.type===t.renderAs||(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_createSurface(){return e.n.create(this.surfaceElement,{type:this.options.renderAs})}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.surfaceElement.style.position="relative",this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}redraw(){let t=this._getSize();this.surface.clear(),this.surface.setSize({width:t,height:t}),this.createVisual(),this.surface.draw(this.visual)}getSize(){const t=this.element,e=t.clientWidth,i=t.clientHeight,s={width:0,height:0};return e>0&&(s.width=e),i&&(s.height=i),s}_resize(){this.redraw()}createVisual(){this.visual=this._render()}exportVisual(){return this._render()}_render(){let t,i,s,o,n,r,a=this._value,l=this.options.border||{},h=this.options.padding||0,c=l.width||0;l.width=c;let d=new e.G;try{a&&(s=Fu(a,this.options.errorCorrection,this.options.encoding),o=this._getSize(),r=o-2*(c+h),t=this._calculateBaseUnit(r,s.length),n=s.length*t,i=c+h+(r-n)/2,d.append(this._renderBackground(o,l)),d.append(this._renderMatrix(s,t,i)),this._hasCustomLogo()?d.append(this._renderLogo(o,t)):this._isSwiss()&&d.append(this._renderSwissCode(o,t)))}catch(t){this.onError(t)}return d}_renderLogo(t,i){let s,o,n=Hu(t/2),r=this._getLogoSize(i*qu),a=this.options.overlay.imageUrl,l={x:n-r.width/2,y:n-r.height/2};return o=new e.R(new e.P(l.x,l.y),new e.q(r.width,r.height)),s=new e.I(a,o),s}_renderSwissCode(t,i){let s=this._getLogoSize(i*qu);s=Math.max(s.width,s.height);let o=s/4,n=o/2,r=t/2,a={},l=new e.G;return a.x=a.y=Math.ceil(r-i-s/2),l.append(this._renderShape(a,Math.ceil(s+2*i),ju,"#fff")),a.x=a.y=r-s/2,l.append(this._renderShape(a,s,ju,this.options.color)),a.x=r+n-s/2,a.y=r+n+o-s/2,l.append(this._renderShape(a,o,Nu,"#fff")),l}_renderShape(t,i,s,o){let n=new e.h({fill:{color:o},stroke:null});n.moveTo(t.x,t.y);for(let e=0;e<s.length;e++)n.lineTo(t.x+i*s[e][0],t.y+i*s[e][1]);return n.close(),n}_getSize(){let t;if(this.options.size)t=parseInt(this.options.size,10);else{const e=Gd(this.element,this.options.renderAs),i=Math.min(e.width,e.height);t=i>0?i:Uu}return t}_calculateBaseUnit(t,e){let i=Math.floor(t/e);if(i<Yu){const i=Math.ceil(e*Yu);this.onError(new Error(`Insufficient size for QR Code: the current size is ${t}px and the minimum size is ${i}px.`))}else i*e>=t&&i-1>=Yu&&i--;return i}_renderMatrix(t,i,s){let o=new e.h({fill:{color:this.options.color},stroke:null});for(let e=0;e<t.length;e++){let n=s+e*i,r=0;for(;r<t.length;){for(;0===t[e][r]&&r<t.length;)r++;if(r<t.length){let a=r;for(;1===t[e][r];)r++;let l=Hu(s+a*i),h=Hu(n),c=Hu(s+r*i),d=Hu(n+i);o.moveTo(l,h).lineTo(l,d).lineTo(c,d).lineTo(c,h).close()}}}return o}_renderBackground(t,i){const s=new ui(0,0,t,t).unpad(i.width/2);return e.b.fromRect(s.toRect(),{fill:{color:this.options.background},stroke:{color:i.color,width:i.width}})}setOptions(t){let e=t||{};this.options=Xd(this.options,e),void 0!==t.value&&(this._value=String(this.options.value)),this._initSurface(),this.redraw()}value(t){if(void 0===t)return this._value;this._value=String(t),this.redraw()}_hasCustomLogo(){return Boolean(this.options.overlay.imageUrl)}_isSwiss(){return"swiss"===this.options.overlay.type}_getLogoSize(t){let e=this.options.overlay.width,i=this.options.overlay.height;return e||i?e&&!i?i=e:!e&&i&&(e=i):e=i=t,{width:e,height:i}}}te(Zu,{name:"QRCode",renderAs:"svg",encoding:"ISO_8859_1",value:"",errorCorrection:Gu,background:Wu,color:Xu,size:"",padding:0,border:{color:"",width:0},overlay:{type:"image",imageUrl:"",width:0,height:0}});const $u={WGS84:{a:6378137,b:6356752.314245179,f:.0033528106647474805,e:.08181919084262149}};function Qu(t){return t*t}let Ku=Math,Ju=Ku.abs,tp=Ku.atan,ep=Ku.atan2,ip=Ku.cos,sp=Ku.sin,op=Ku.tan;class np extends e.a{constructor(t,e){super(),this.initProperties(),1===arguments.length?(this.lat=t[0],this.lng=t[1]):(this.lat=t,this.lng=e)}initProperties(){ut(this,{DISTANCE_ITERATIONS:100,DISTANCE_CONVERGENCE:1e-12,DISTANCE_PRECISION:2,FORMAT:"{0:N6}{1:N6}"})}toArray(){return[this.lat,this.lng]}equals(t){return t&&t.lat===this.lat&&t.lng===this.lng}clone(){return new np(this.lat,this.lng)}round(t){return this.lng=$t(this.lng,t),this.lat=$t(this.lat,t),this}wrap(){return this.lng=this.lng%180,this.lat=this.lat%90,this}distanceTo(t,e){return this.greatCircleTo(t,e).distance}destination(t,e,i){let s=Zt(e),o=i||$u.WGS84,n=Zt(this.lat),r=Zt(this.lng),a=t/o.a,l=Ku.asin(sp(n)*ip(a)+ip(n)*sp(a)*ip(s)),h=r+ep(sp(s)*sp(a)*ip(n),ip(a)-sp(n)*sp(l));return new np(Ht(l),Ht(h))}greatCircleTo(t,e){let i=np.create(i),s=e||$u.WGS84;if(!i||this.clone().round(8).equals(i.clone().round(8)))return{distance:0,azimuthFrom:0,azimuthTo:0};let o,n,r,a,l,h,c,d,u=s.a,p=s.b,g=s.f,m=Zt(i.lng-this.lng),f=tp((1-g)*op(Zt(this.lat))),x=sp(f),y=ip(f),v=tp((1-g)*op(Zt(i.lat))),b=sp(v),w=ip(v),_=m,k=this.DISTANCE_ITERATIONS,A=!1;for(;!A&&k-- >0;){n=sp(_),r=ip(_),a=Ku.sqrt(Qu(w*n)+Qu(y*b-x*w*r)),h=x*b+y*w*r,d=ep(a,h);let t=y*w*n/a;l=1-Qu(t),c=0,0!==l&&(c=h-2*x*b/l),o=_;let e=g/16*l*(4+g*(4-3*l));_=m+(1-e)*g*t*(d+e*a*(c+e*h*(2*Qu(c)-1))),A=Ju(_-o)<=this.DISTANCE_CONVERGENCE}let S=l*(Qu(u)-Qu(p))/Qu(p),C=1+S/16384*(4096+S*(S*(320-175*S)-768)),T=S/1024*(256+S*(S*(74-47*S)-128)),P=T*a*(c+T/4*(h*(2*Qu(c)-1)-T/6*c*(4*Qu(a)-3)*(4*Qu(c)-3))),M=ep(w*n,y*b-x*w*r),E=ep(y*n,-x*w+y*b*r);return{distance:$t(p*C*(d-P),this.DISTANCE_PRECISION),azimuthFrom:Ht(M),azimuthTo:Ht(E)}}toString(){return String(this.lat)+","+String(this.lng)}static fromLngLat(t){return new np(t[1],t[0])}static fromLatLng(t){return new np(t[0],t[1])}static create(t,e){if(Ft(t))return t instanceof np?t.clone():1===arguments.length&&2===t.length?np.fromLatLng(t):new np(t,e)}}let rp=Math,ap=rp.atan,lp=rp.exp,hp=rp.pow,cp=rp.sin,dp=rp.log,up=rp.tan,pp=e.P,gp=rp.PI,mp=gp/2,fp=gp/4,xp=gp/180,yp=$u.WGS84;class vp extends e.a{constructor(t){super(),this.initProperties(),this._initOptions(t)}_initOptions(t){this.options=ut({},this.options,t)}initProperties(){ut(this,{MAX_LNG:180,MAX_LAT:85.0840590501,INVERSE_ITERATIONS:15,INVERSE_CONVERGENCE:1e-12})}forward(t,e){let i=this,s=i.options,o=s.datum.a,n=s.centralMeridian,r=Yt(t.lat,-i.MAX_LAT,i.MAX_LAT),a=e?Yt(t.lng,-i.MAX_LNG,i.MAX_LNG):t.lng,l=Zt(a-n)*o,h=i._projectLat(r);return new pp(l,h)}_projectLat(t){let e=this.options.datum,i=e.e,s=e.a,o=Zt(t),n=up(fp+o/2),r=i*cp(o),a=hp((1-r)/(1+r),i/2);return s*dp(n*a)}inverse(t,e){let i=this,s=i.options,o=s.datum.a,n=s.centralMeridian,r=t.x/(xp*o)+n,a=Yt(i._inverseY(t.y),-i.MAX_LAT,i.MAX_LAT);return e&&(r=Yt(r,-i.MAX_LNG,i.MAX_LNG)),new np(a,r)}_inverseY(t){let e,i=this,s=i.options.datum,o=s.a,n=s.e,r=n/2,a=lp(-t/o),l=mp-2*ap(a);for(e=0;e<=i.INVERSE_ITERATIONS;e++){let t=n*cp(l),e=hp((1-t)/(1+t),r),s=mp-2*ap(a*e)-l;if(l+=s,rp.abs(s)<=i.INVERSE_CONVERGENCE)break}return Ht(l)}}te(vp,{centralMeridian:0,datum:yp});class bp extends vp{initProperties(){super.initProperties(),ut(this,{MAX_LAT:85.0511287798})}_projectLat(t){let e=this.options.datum.a,i=Zt(t),s=up(fp+i/2);return e*dp(s)}_inverseY(t){let e=this.options.datum.a,i=lp(-t/e);return Ht(mp-2*ap(i))}}e.a;class wp extends e.a{constructor(){super();let t=this._proj=new bp,i=this.c=2*gp*t.options.datum.a;this._tm=e.t().translate(.5,.5).scale(1/i,-1/i),this._itm=e.t().scale(i,-i).translate(-.5,-.5)}toPoint(t,e,i){return this._proj.forward(t,i).transform(this._tm).scale(e||1)}toLocation(t,e,i){let s=t.clone().scale(1/(e||1)).transform(this._itm);return this._proj.inverse(s,i)}}e.a;e.a;Object.assign;const _p=(t,e)=>t.bind(e);let kp=t=>{const e=document.createElement("div");return e.innerHTML=t,e.firstChild},Ap=t=>{for(;t.firstChild;)t.removeChild(t.firstChild)},Sp=(t,e)=>{e.insertBefore(t,e.firstChild)},Cp=t=>t.replace(/([a-z][A-Z])/g,(function(t){return t.charAt(0)+"-"+t.charAt(1).toLowerCase()})),Tp=t=>{let e;return e=t&&String(t).endsWith("px")?t:String(t)+"px",e};const Pp=(t,e)=>{const i=t.prototype;i.events?e.forEach((t=>{i.events.indexOf(t)<0&&i.events.push(t)})):i.events=e},Mp=t=>{let e=[];if(t){let i=Cp(t).split("-");for(let t=0;t<i.length;t++)e.push("k-pos-"+i[t])}return e.join(" ")};class Ep extends He{constructor(t,e){super(),this.element=t,this._initOptions(e),this.items=[],K(this.element,"k-widget k-attribution")}_initOptions(t){this.options=ut({},this.options,t)}filter(t,e){this._extent=t,this._zoom=e,this._render()}add(t){let e=t;Ft(t)&&("string"==typeof t&&(e={text:t}),this.items.push(e),this._render())}remove(t){let e=[];for(let i=0;i<this.items.length;i++){let s=this.items[i];s.text!==t&&e.push(s)}this.items=e,this._render()}clear(){this.items=[],Ap(this.element)}_render(){let t=[];for(let e=0;e<this.items.length;e++){let i=this.items[e],s=this._itemText(i);""!==s&&t.push(s)}if(t.length>0){Ap(this.element);((t,e)=>{const i=document.createElement("div");for(i.innerHTML=t;i.childNodes.length>0;)e.appendChild(i.childNodes[0])})(t.join(this.options.separator),this.element),this.showElement()}else this.hideElement()}hideElement(){this.element.style.display="none"}showElement(){this.element.style.display=""}_itemText(t){let e="",i=this._inZoomLevel(t.minZoom,t.maxZoom),s=this._inArea(t.extent);return i&&s&&(e+=t.text),e}_inZoomLevel(t,e){let i=!0,s=Kt(t,-Number.MAX_VALUE),o=Kt(e,Number.MAX_VALUE);return i=this._zoom>s&&this._zoom<o,i}_inArea(t){let e=!0;return t&&(e=t.contains(this._extent)),e}}te(Ep,{name:"Attribution",separator:" | "});const Lp={up:{className:"k-navigator-n",iconClass:"k-i-caret-alt-up"},down:{className:"k-navigator-s",iconClass:"k-i-caret-alt-down"},right:{className:"k-navigator-e",iconClass:"k-i-caret-alt-right"},left:{className:"k-navigator-w",iconClass:"k-i-caret-alt-left"}};function Ip(t,e){const i='<button class="k-button k-button-square k-rounded-full k-button-flat k-button-flat-base k-icon-button '+Lp[t].className+'" aria-label="move '+t+'">'+ae({icon:`caret-alt-${t}`,iconClass:"k-button-icon",svgIcons:e.svgIcons,type:e.type})+"</button>";return kp(i)}class Rp extends He{constructor(t,e){super(),this.element=t,this._initOptions(e);const i=Ip("up",e.icons),s=Ip("right",e.icons),o=Ip("down",e.icons),n=Ip("left",e.icons);this.element.appendChild(i),this.element.appendChild(s),this.element.appendChild(o),this.element.appendChild(n),K(this.element,"k-widget k-navigator"),Ee(this.element,"click",".k-button",_p(this._click,this));let r=this.element.parentNode.closest("[data-role]");this._keyroot=r||this.element,this._tabindex(this._keyroot),this._keydownHandler=_p(this._keydown,this),Ee(this._keyroot,"keydown",this._keydownHandler)}destroy(){this.dispose()}dispose(){Le(this._keyroot,"keydown",this._keydownHandler)}_tabindex(t){const e=t||this.wrapper||this.element;let i=this.element,s="tabindex",o=e.getAttribute(s)||i.getAttribute(s);i.removeAttribute(s),e.setAttribute(s,isNaN(o)?0:o)}_initOptions(t){this.options=ut({},this.options,t)}_pan(t,e){let i=this.options.panStep;this.trigger("pan",{x:t*i,y:e*i})}_click(t){let e=0,i=0,s=t.currentTarget;s.matches(".k-navigator-n")?i=1:s.matches(".k-navigator-s")?i=-1:s.matches(".k-navigator-e")?e=1:s.matches(".k-navigator-w")&&(e=-1),this._pan(e,i),t.preventDefault()}_keydown(t){switch(t.which){case be.UP:this._pan(0,1),t.preventDefault();break;case be.DOWN:this._pan(0,-1),t.preventDefault();break;case be.RIGHT:this._pan(1,0),t.preventDefault();break;case be.LEFT:this._pan(-1,0),t.preventDefault()}}}function Bp(t,e,i){const s='<button class="k-button k-button-md k-rounded-md k-button-solid k-button-solid-base k-icon-button k-zoom-'+t+'" title="zoom-'+t+'" aria-label="zoom-'+t+'">'+ae({icon:e,iconClass:"k-button-icon",svgIcons:i.svgIcons,type:i.type})+"</button>";return kp(s)}te(Rp,{name:"Navigator",panStep:1}),Pp(Rp,["pan"]);const Op="change";class Vp extends He{constructor(t,e,i){super(),this.element=t,this._initOptions(e);const s=Bp("in","plus",i),o=Bp("out","minus",i);this.element.appendChild(s),this.element.appendChild(o),this.element.setAttribute("role","group"),K(this.element,"k-widget k-zoom-control k-button-group k-group-horizontal"),this._clickHandler=this._click.bind(this),Ee(this.element,"click",".k-button",this._clickHandler);let n=this.element.parentNode.closest("[data-role]");this._keyroot=n||this.element,this._tabindex(this._keyroot),this._keydownHandler=this._keydown.bind(this),Ee(this._keyroot,"keydown",this._keydownHandler)}destroy(){this.element&&Le(this.element,"click",this._clickHandler),this._keyroot&&Le(this._keyroot,"keydown",this._keydownHandler)}_tabindex(t){const e=t||this.wrapper||this.element;let i=this.element,s="tabindex",o=e.getAttribute(s)||i.getAttribute(s);i.removeAttribute(s),e.setAttribute(s,isNaN(o)?0:o)}_initOptions(t){this.options=ut({},this.options,t)}_change(t){let e=this.options.zoomStep;this.trigger(Op,{delta:t*e})}_click(t){let e=1;Tt(t.currentTarget,"k-zoom-out")&&(e=-1),this._change(e),t.preventDefault()}_keydown(t){switch(t.which){case be.NUMPAD_PLUS:case 187:case 61:this._change(1);break;case be.NUMPAD_MINUS:case 189:case 173:this._change(-1)}}}te(Vp,{name:"ZoomControl",zoomStep:1}),Pp(Vp,[Op]);let Dp=Math,zp=Dp.max,Fp=Dp.min;class Hp extends e.a{constructor(t,e){super();let i=np.create(t),s=np.create(e);i.lng+180>s.lng+180&&i.lat+90<s.lat+90?(this.se=i,this.nw=s):(this.se=s,this.nw=i)}contains(t){let e=this.nw,i=this.se,s=Kt(t.lng,t[1]),o=Kt(t.lat,t[0]);return t&&s+180>=e.lng+180&&s+180<=i.lng+180&&o+90>=i.lat+90&&o+90<=e.lat+90}center(){let t=this.nw,e=this.se,i=t.lng+(e.lng-t.lng)/2,s=t.lat+(e.lat-t.lat)/2;return new np(s,i)}containsAny(t){let e=!1;for(let i=0;i<t.length;i++)e=e||this.contains(t[i]);return e}include(t){let e=this.nw,i=this.se,s=Kt(t.lng,t[1]),o=Kt(t.lat,t[0]);e.lng=Fp(e.lng,s),e.lat=zp(e.lat,o),i.lng=zp(i.lng,s),i.lat=Fp(i.lat,o)}includeAll(t){for(let e=0;e<t.length;e++)this.include(t[e])}edges(){let t=this.nw,e=this.se;return{nw:this.nw,ne:new np(t.lat,e.lng),se:this.se,sw:new np(e.lat,t.lng)}}toArray(){let t=this.nw,e=this.se;return[t,new np(t.lat,e.lng),e,new np(e.lat,t.lng)]}overlaps(t){return this.containsAny(t.toArray())||t.containsAny(this.toArray())}static create(t,e){return t instanceof Hp?t:t&&e?new Hp(t,e):t&&4===t.length&&!e?new Hp([t[0],t[1]],[t[2],t[3]]):void 0}static get World(){return new Hp([90,-180],[-90,180])}}const Np="centerChange";class jp extends e.a{constructor(t,e){super(),this.widgetService=t,this.options=ut({},this.options,e),this.offset={x:0,y:0}}show(t,e){this.location!==e.location&&(this.anchor=t,this.location=e.location,this.widgetService.notify("showTooltip",Object.assign({anchor:this.anchor},e)),this.visible=!0)}hide(){this.widgetService&&this.widgetService.notify("hideTooltip"),this.visible=!1,this.location=null}get anchor(){return this._anchor}set anchor(t){const e=this.widgetService.widget._toDocumentCoordinates({x:t.left-this.offset.x,y:t.top-this.offset.y});this._anchor={left:e.left,top:e.top}}destroy(){this.widgetService=null}}te(jp,{border:{width:1},opacity:1});class Up extends e.a{constructor(t,e){super(),this.support=Ie(),this._initOptions(e),this.map=t;let i=document.createElement("div");K(i,"k-layer"),i.style.zIndex=this.options.zIndex,i.style.opacity=this.options.opacity,this.element=i,t.scrollElement.appendChild(this.element),this._beforeReset=this._beforeReset.bind(this),this._reset=this._reset.bind(this),this._resize=this._resize.bind(this),this._panEnd=this._panEnd.bind(this),this._activate(),this._updateAttribution()}destroy(){this._deactivate()}_initOptions(t){this.options=ut({},this.options,t)}show(){this.reset(),this._activate(),this._applyExtent(!0)}hide(){this._deactivate(),this._setVisibility(!1)}reset(){this._beforeReset(),this._reset()}_reset(){this._applyExtent()}_beforeReset(){}_resize(){}_panEnd(){this._applyExtent()}_applyExtent(){let t=this.options,e=this.map.zoom(),i=!Ft(t.minZoom)||e>=t.minZoom,s=!Ft(t.maxZoom)||e<=t.maxZoom,o=Hp.create(t.extent),n=!o||o.overlaps(this.map.extent());this._setVisibility(i&&s&&n)}_setVisibility(t){this.element.style.display=t?"":"none"}_activate(){let t=this.map;this._deactivate(),t.bind("beforeReset",this._beforeReset),t.bind("reset",this._reset),t.bind("resize",this._resize),t.bind("panEnd",this._panEnd)}_deactivate(){let t=this.map;t.unbind("beforeReset",this._beforeReset),t.unbind("reset",this._reset),t.unbind("resize",this._resize),t.unbind("panEnd",this._panEnd)}_updateAttribution(){const t=this.map.attribution;t&&t.add(this.options.attribution)}_readData(){return this.options.data||[]}_hasData(){return this._data&&this._data.length>0}_layerIndex(){return(this.map.layers||[]).indexOf(this)}}let Gp=Math,Wp=e.P;function Xp(t){return ht(t)?t:bt.compile(t)}function Yp(t){return new Wp($t(t.x),$t(t.y))}function qp(t){let e=t;return"string"!=typeof t&&(e+="px"),e}class Zp extends Up{constructor(t,e){super(t,e),"string"==typeof this.options.subdomains&&(this.options.subdomains=this.options.subdomains.split(""));let i=this._viewType();this._view=new i(this.element,this.options)}destroy(){super.destroy(),this._view.destroy(),this._view=null}_beforeReset(){let t=this.map,e=t.locationToLayer(t.extent().nw).round();this._view.viewOrigin(e)}_reset(){super._reset(),this._updateView(),this._view.reset()}_viewType(){return $p}_activate(){super._activate(),this.support.mobileOS||(this._pan||(this._pan=e.o(this._render.bind(this),100)),this.map.bind("pan",this._pan))}_deactivate(){super._deactivate(),this._pan&&this.map.unbind("pan",this._pan)}_updateView(){let t=this._view,e=this.map,i=e.extent(),s={nw:e.locationToLayer(i.nw).round(),se:e.locationToLayer(i.se).round()};t.center(e.locationToLayer(e.center())),t.extent(s),t.zoom(e.zoom())}_resize(){this._render()}_panEnd(t){super._panEnd(t),this._render()}_render(){this._updateView(),this._view.render()}}te(Zp,{tileSize:256,subdomains:["a","b","c"],urlTemplate:"",zIndex:1});class $p extends e.a{constructor(t,e){super(),this.element=t,this._initOptions(e),this.pool=new Kp}_initOptions(t){this.options=ut({},this.options,t)}center(t){this._center=t}extent(t){this._extent=t}viewOrigin(t){this._viewOrigin=t}zoom(t){this._zoom=t}pointToTileIndex(t){return new Wp(Gp.floor(t.x/this.options.tileSize),Gp.floor(t.y/this.options.tileSize))}tileCount(){let t=this.size(),e=this.pointToTileIndex(this._extent.nw),i=this._extent.nw,s=this.indexToPoint(e).translate(-i.x,-i.y);return{x:Gp.ceil((Gp.abs(s.x)+t.width)/this.options.tileSize),y:Gp.ceil((Gp.abs(s.y)+t.height)/this.options.tileSize)}}size(){let t=this._extent.nw,e=this._extent.se.clone().translate(-t.x,-t.y);return{width:e.x,height:e.y}}indexToPoint(t){let e=t.x,i=t.y;return new Wp(e*this.options.tileSize,i*this.options.tileSize)}subdomainText(){let t=this.options.subdomains;return t[this.subdomainIndex++%t.length]}destroy(){Ap(this.element),this.pool.empty()}reset(){this.pool.reset(),this.subdomainIndex=0,this.render()}render(){let t,e,i,s=this.tileCount(),o=this.pointToTileIndex(this._extent.nw);for(e=0;e<s.x;e++)for(i=0;i<s.y;i++)t=this.createTile({x:o.x+e,y:o.y+i}),t.visible||t.show()}createTile(t){let e=this.tileOptions(t),i=this.pool.get(this._center,e);return i.element.parentNode||this.element.append(i.element),i}tileOptions(t){let e=this.wrapIndex(t),i=this.indexToPoint(t),s=this._viewOrigin,o=i.clone().translate(-s.x,-s.y);return{index:e,currentIndex:t,point:i,offset:Yp(o),zoom:this._zoom,size:this.options.tileSize,subdomain:this.subdomainText(),urlTemplate:this.options.urlTemplate,errorUrlTemplate:this.options.errorUrlTemplate}}wrapIndex(t){let e=Gp.pow(2,this._zoom);return{x:this.wrapValue(t.x,e),y:Yt(t.y,0,e-1)}}wrapValue(t,e){let i=Gp.abs(t)%e,s=t;return s=t>=0?i:e-(0===i?e:i),s}}class Qp extends e.a{constructor(t,e){super(),this.id=t,this.visible=!0,this._initOptions(e),this.createElement(),this.show()}destroy(){const t=this.element,e=t?t.parentNode:null;t&&(e&&e.removeChild(t),this.element=null)}_initOptions(t){this.options=ut({},this.options,t)}createElement(){let t=document.createElement("img");const e=this.options.size+"px";t.setAttribute("alt",""),t.style.position="absolute",t.style.display="block",t.style.width=t.style.maxWidth=e,t.style.height=t.style.maxHeight=e,this.element=t}show(){let t=this.element;t.style.top=qp(this.options.offset.y),t.style.left=qp(this.options.offset.x);let e=this.url();e&&t.setAttribute("src",e),t.style.visibility="visible",this.visible=!0}hide(){this.element.style.visibility="hidden",this.visible=!1}url(){return Xp(this.options.urlTemplate)(this.urlOptions())}errorUrl(){return Xp(this.options.errorUrlTemplate)(this.urlOptions())}urlOptions(){let t=this.options;return{zoom:t.zoom,subdomain:t.subdomain,z:t.zoom,x:t.index.x,y:t.index.y,s:t.subdomain,quadkey:t.quadkey,q:t.quadkey,culture:t.culture,c:t.culture}}}te(Qp,{urlTemplate:"",errorUrlTemplate:""});class Kp extends e.a{constructor(){super(),this._items=[]}get(t,e){return this._items.length>=this.options.maxSize&&this._remove(t),this._create(e)}empty(){let t=this._items;for(let e=0;e<t.length;e++)t[e].destroy();this._items=[]}reset(){let t=this._items;for(let e=0;e<t.length;e++)t[e].hide()}_create(t){let e,i=this._items,s=Wt(t.point.toString()+t.offset.toString()+t.zoom+t.urlTemplate);for(let t=0;t<i.length;t++)if(i[t].id===s){e=i[t];break}return e?e.show():(e=new Qp(s,t),this._items.push(e)),e}_remove(t){let e=this._items,i=-1,s=-1;for(let o=0;o<e.length;o++){let n=e[o].options.point.distanceTo(t);n>i&&!e[o].visible&&(s=o,i=n)}-1!==s&&(e[s].destroy(),e.splice(s,1))}}te(Kp,{maxSize:100});const Jp=Object.assign,tg="change";class eg extends He{constructor(t,e){super();let i=this,s=t[0]||t;i.capture=!1,s.addEventListener?(Ae.down.split(" ").forEach((function(t){s.addEventListener(t,_p(i._press,i),!0)})),Ae.up.split(" ").forEach((function(t){s.addEventListener(t,_p(i._release,i),!0)}))):(Ae.down.split(" ").forEach((function(t){s.attachEvent(t,_p(i._press,i))})),Ae.up.split(" ").forEach((function(t){s.attachEvent(t,_p(i._release,i))}))),i.bind(["press","release"],e||{})}captureNext(){this.capture=!0}cancelCapture(){this.capture=!1}_press(t){this.trigger("press"),this.capture&&t.preventDefault()}_release(t){let e=this;e.trigger("release"),e.capture&&(t.preventDefault(),e.cancelCapture())}}class ig extends He{constructor(t){super();let e=this;e.forcedEnabled=!1,Jp(e,t),e.scale=1,e.horizontal?(e.measure="offsetWidth",e.scrollSize="scrollWidth",e.axis="x"):(e.measure="offsetHeight",e.scrollSize="scrollHeight",e.axis="y")}makeVirtual(){Jp(this,{virtual:!0,forcedEnabled:!0,_virtualMin:0,_virtualMax:0})}virtualSize(t,e){this._virtualMin===t&&this._virtualMax===e||(this._virtualMin=t,this._virtualMax=e,this.update())}outOfBounds(t){return t>this.max||t<this.min}forceEnabled(){this.forcedEnabled=!0}getSize(){return this.container[this.measure]}getTotal(){return this.element[this.scrollSize]}rescale(t){this.scale=t}update(t){let e=this,i=e.virtual?e._virtualMax:e.getTotal(),s=i*e.scale,o=e.getSize();(0!==i||e.forcedEnabled)&&(e.max=e.virtual?-e._virtualMin:0,e.size=o,e.total=s,e.min=Math.min(e.max,o-s),e.minScale=o/i,e.centerOffset=(s-o)/2,e.enabled=e.forcedEnabled||s>o,t||e.trigger(tg,e))}}class sg extends He{constructor(t){super();let e=this;e.x=new ig(Jp({horizontal:!0},t)),e.y=new ig(Jp({horizontal:!1},t)),e.container=t.container,e.forcedMinScale=t.minScale,e.maxScale=t.maxScale||100,e.bind(tg,t)}rescale(t){this.x.rescale(t),this.y.rescale(t),this.refresh()}centerCoordinates(){return{x:Math.min(0,-this.x.centerOffset),y:Math.min(0,-this.y.centerOffset)}}refresh(){let t=this;t.x.update(),t.y.update(),t.enabled=t.x.enabled||t.y.enabled,t.minScale=t.forcedMinScale||Math.min(t.x.minScale,t.y.minScale),t.fitScale=Math.max(t.x.minScale,t.y.minScale),t.trigger(tg)}}class og extends He{constructor(t){super(),Jp(this,t)}outOfBounds(){return this.dimension.outOfBounds(this.movable[this.axis])}dragMove(t){let e=this,i=e.dimension,s=e.axis,o=e.movable,n=o[s]+t;if(!i.enabled)return;let r=t;(n<i.min&&t<0||n>i.max&&t>0)&&(r*=e.resistance),o.translateAxis(s,r),e.trigger(tg,e)}}class ng extends e.a{constructor(t){super();let e,i,s,o,n=this;Jp(n,{elastic:!0},t),s=n.elastic?.5:0,o=n.movable,n.x=e=new og({axis:"x",dimension:n.dimensions.x,resistance:s,movable:o}),n.y=i=new og({axis:"y",dimension:n.dimensions.y,resistance:s,movable:o}),n.userEvents.bind(["press","move","end","gesturestart","gesturechange"],{gesturestart(t){n.gesture=t,n.offset=Nt(n.dimensions.container)},press(t){const e=t.event.target.closest("a");e&&e.matches("[data-navigate-on-press=true]")&&t.sender.cancel()},gesturechange(t){let s,r=n.gesture,a=r.center,l=t.center,h=t.distance/r.distance,c=n.dimensions.minScale,d=n.dimensions.maxScale;o.scale<=c&&h<1&&(h+=.8*(1-h)),o.scale*h>=d&&(h=d/o.scale);let u=o.x+n.offset.left,p=o.y+n.offset.top;s={x:(u-a.x)*h+l.x-u,y:(p-a.y)*h+l.y-p},o.scaleWith(h),e.dragMove(s.x),i.dragMove(s.y),n.dimensions.rescale(o.scale),n.gesture=t,t.preventDefault()},move(t){t.event.target.tagName.match(/textarea|input/i)||(e.dimension.enabled||i.dimension.enabled?(e.dragMove(t.x.delta),i.dragMove(t.y.delta),t.preventDefault()):t.touch.skip())},end(t){t.preventDefault()}})}}let rg=function(t,e,i){return"translate3d("+t+"px,"+e+"px,0) scale("+i+")"};class ag extends He{constructor(t){super();let e=this;e.element=t,e.element.style.transformOrigin="left top",e.x=0,e.y=0,e.scale=1;const i=rg(e.x,e.y,e.scale);e.element.style.transform=i,e._saveCoordinates(i)}translateAxis(t,e){this[t]+=e,this.refresh()}scaleTo(t){this.scale=t,this.refresh()}scaleWith(t){this.scale*=t,this.refresh()}translate(t){this.x+=t.x,this.y+=t.y,this.refresh()}moveAxis(t,e){this[t]=e,this.refresh()}moveTo(t){Jp(this,t),this.refresh()}refresh(){let t,e=this,i=e.x,s=e.y;e.round&&(i=Math.round(i),s=Math.round(s)),t=rg(i,s,e.scale),t!==e.coordinates&&(e.element.style.transform=t,e._saveCoordinates(t),e.trigger(tg))}_saveCoordinates(t){this.coordinates=t}}const lg=e.G;class hg extends Up{constructor(t,i){super(t,i),this._pan=_p(this._pan,this),this.surface=e.n.create(this.element,{width:t.scrollElement.clientWidth,height:t.scrollElement.clientHeight}),this._initRoot(),this.movable=new ag(this.surface.element),this._markers=[],this._click=this._handler("shapeClick"),this.surface.bind("click",this._click),this._mouseleave=this._handler("shapeMouseLeave"),this.surface.bind("mouseleave",this._mouseleave),this.surface.bind("mouseenter",this._mouseenter.bind(this))}destroy(){super.destroy(),this.surface.destroy()}_reset(){super._reset(),this._translateSurface(),this._data=this._readData(),this._hasData()&&this._load(this._data)}_initRoot(){this._root=new lg,this.surface.draw(this._root)}_beforeReset(){this.surface.clear(),this._initRoot()}_resize(){this.surface.size(this.map.size())}_readData(){const t=super._readData();return"FeatureCollection"===t.type?t.features:"GeometryCollection"===t.type?t.geometries:t}_load(t){this._data=t,this._clearMarkers(),this._loader||(this._loader=new cg(this.map,this.options.style,this));let e=new lg;for(let i=0;i<t.length;i++){let s=this._loader.parse(t[i]);s&&e.append(s)}this._root.clear(),this._root.append(e)}shapeCreated(t){let i=!1;if(t instanceof e.f&&this.map.options.renderPointsAsMarkers&&(i=Ft(this._createMarker(t))),!i){let e={layer:this,shape:t};i=this.map.trigger("shapeCreated",e)}return i}featureCreated(t){t.layer=this,this.map.trigger("shapeFeatureCreated",t)}_createMarker(t){let e=this.map.markers.bind({location:t.location},t.dataItem);return e&&this._markers.push(e),e}_clearMarkers(){for(let t=0;t<this._markers.length;t++)this.map.markers.remove(this._markers[t]);this._markers=[]}_pan(){this._panning||(this._panning=!0,this.surface.suspendTracking())}_panEnd(t){super._panEnd(t),this._translateSurface(),this.surface.resumeTracking(),this._panning=!1}_translateSurface(){let t=this.map,e=t.locationToView(t.extent().nw);this.surface.translate&&(this.surface.translate(e),this.movable.moveTo({x:e.x,y:e.y}))}_eventArgs(t){return{layer:this,layerIndex:this._layerIndex(),shape:t.element,shapeIndex:(this._data||[]).indexOf(t.element.dataItem),originalEvent:t.originalEvent}}_handler(t){return e=>{e.element&&this.map.trigger(t,this._eventArgs(e))}}_mouseenter(t){if(!t.element)return;this.map.trigger("shapeMouseEnter",this._eventArgs(t));const e=t.element,i=this._tooltipAnchor(t);this.map._tooltip.show(i,this._tooltipContext(e))}_tooltipContext(t){return{type:"shape",layerIndex:this._layerIndex(),className:"k-map-shape-tooltip",dataItem:t.dataItem,location:t.location}}_tooltipAnchor(t){const e=this.map.eventOffset(t.originalEvent);return{top:e.y,left:e.x}}_activate(){super._activate(),this._panHandler=_p(this._pan,this),this.map.bind("pan",this.panHandler)}_deactivate(){super._deactivate(),this.map.unbind("pan",this._panHandler)}}te(hg,{autoBind:!0,zIndex:100});class cg extends e.a{constructor(t,e,i){super(),this.observer=i,this.locator=t,this.style=e}parse(t){let e=new lg,i=!0;return"Feature"===t.type?(i=!1,this._loadGeometryTo(e,t.geometry,t),this._featureCreated(e,t)):this._loadGeometryTo(e,t,t),i&&e.children.length<2&&(e=e.children[0]),e}_shapeCreated(t){let e=!1;return this.observer&&this.observer.shapeCreated&&(e=this.observer.shapeCreated(t)),e}_featureCreated(t,e){this.observer&&this.observer.featureCreated&&this.observer.featureCreated({group:t,dataItem:e,properties:e.properties})}_loadGeometryTo(t,e,i){let s,o,n=e.coordinates;switch(e.type){case"LineString":o=this._loadPolygon(t,[n],i),this._setLineFill(o);break;case"MultiLineString":for(s=0;s<n.length;s++)o=this._loadPolygon(t,[n[s]],i),this._setLineFill(o);break;case"Polygon":this._loadPolygon(t,n,i);break;case"MultiPolygon":for(s=0;s<n.length;s++)this._loadPolygon(t,n[s],i);break;case"Point":this._loadPoint(t,n,i);break;case"MultiPoint":for(s=0;s<n.length;s++)this._loadPoint(t,n[s],i)}}_setLineFill(t){let e=t.segments;(e.length<4||!e[0].anchor().equals(Xt(e).anchor()))&&(t.options.fill=null)}_loadShape(t,e){return this._shapeCreated(e)||t.append(e),e}_loadPolygon(t,e,i){let s=this._buildPolygon(e);return s.dataItem=i,s.location=this.locator.viewToLocation(s.bbox().center()),this._loadShape(t,s)}_buildPolygon(t){let i=new(t.length>1?e.h:e.b)(this.style);for(let e=0;e<t.length;e++)for(let s=0;s<t[e].length;s++){let o=this.locator.locationToView(np.fromLngLat(t[e][s]));0===s?i.moveTo(o.x,o.y):i.lineTo(o.x,o.y)}return i}_loadPoint(t,i,s){let o=np.fromLngLat(i),n=this.locator.locationToView(o),r=new e.g(n,10),a=new e.f(r,this.style);return a.dataItem=s,a.location=o,this._loadShape(t,a)}}class dg extends hg{_readData(){return this.options.data||[]}_load(t){if(this._data=t,this.surface.clear(),0===t.length)return;let e=this.options,i=St(e.valueField),s=t.slice(0);s.sort((function(t,e){return i(e)-i(t)}));let o,n=this._scaleType(),r=St(this.options.locationField);for(let t=0;t<s.length;t++){let a=s[t],l=r(a),h=i(a);if(Ft(l)&&Ft(h)){o||(o=new n([0,h],[e.minSize,e.maxSize])),l=np.create(l);let t=this.map.locationToView(l),i=o.map(h),s=this._createSymbol({center:t,size:i,style:e.style,dataItem:a,location:l});s.dataItem=a,s.location=l,s.value=h,this._drawSymbol(s)}}}_scaleType(){let t=this.options.scale;return ht(t)?t:pg[t]}_createSymbol(t){let e=this.options.symbol;return ht(e)||(e=gg[e]),e(t)}_drawSymbol(t){let e={layer:this,shape:t};this.map.trigger("shapeCreated",e)||this.surface.draw(t)}_tooltipContext(t){return{type:"bubble",layerIndex:this._layerIndex(),className:"k-map-bubble-tooltip",dataItem:t.dataItem,location:t.location,value:t.value}}_tooltipAnchor(t){const e=t.element.bbox().center();return{top:e.y,left:e.x}}}te(dg,{locationField:"location",valueField:"value",minSize:0,maxSize:100,scale:"sqrt",symbol:"circle",zIndex:200});class ug extends e.a{constructor(t,e){super(),this._domain=t,this._range=e;let i=Math.sqrt(t[1])-Math.sqrt(t[0]),s=e[1]-e[0];this._ratio=s/i}map(t){let e=(Math.sqrt(t)-Math.sqrt(this._domain[0]))*this._ratio;return this._range[0]+e}}let pg={sqrt:ug},gg={circle:function(t){let i=new e.g(t.center,t.size/2);return new e.f(i,t.style)},square:function(t){let i=new e.b(t.style),s=t.size/2,o=t.center;return i.moveTo(o.x-s,o.y-s).lineTo(o.x+s,o.y-s).lineTo(o.x+s,o.y+s).lineTo(o.x-s,o.y+s).close(),i}};const mg="click",fg="mouseenter",xg="mouseleave",yg=Object.assign,vg="k-marker",bg="."+vg;class wg extends Up{constructor(t,e){super(t,e),this._markerClickHandler=_p(this._markerClick,this),Ee(this.element,mg,bg,this._markerClickHandler),this.items=[],this._load(this._readData())}destroy(){super.destroy(),Le(this.element,mg,this._markerClickHandler),this.clear()}add(t){if(!Q(t))return this._addOne(t);for(let e=0;e<t.length;e++)this._addOne(t[e])}remove(t){t.destroy();let e=(this.items||[]).indexOf(t);e>-1&&this.items.splice(e,1)}clear(){for(let t=0;t<this.items.length;t++)this.items[t].destroy();this.items=[]}update(t){let e=t.location();if(e){t.showAt(this.map.locationToView(e));let i={marker:t,layer:this};this.map.trigger("markerActivate",i)}}_reset(){super._reset();let t=this.items;for(let e=0;e<t.length;e++)this.update(t[e])}bind(t,e){let i=_g.create(t,this.options);i.dataItem=e;let s={marker:i,layer:this};if(!this.map.trigger("markerCreated",s))return this.add(i),i}_addOne(t){let e=_g.create(t,this.options);return e.addTo(this),e}_readData(){return this.options.data||[]}_load(t){this._data=t,this.clear();let e=St(this.options.locationField),i=St(this.options.titleField);for(let s=0;s<t.length;s++){let o=t[s];this.bind({location:e(o),title:i(o)},o)}}_markerClick(t){const e=t.currentTarget._kendoNode;let i={layer:this,layerIndex:this._layerIndex(),marker:e,markerIndex:(this.items||[]).indexOf(e),originalEvent:t};this.map.trigger("markerClick",i)}_markerMouseEnter(t){const e=this._createMarkerEventArgs(t);this.map.trigger("markerMouseEnter",e)}_markerMouseLeave(t){const e=this._createMarkerEventArgs(t);this.map.trigger("markerMouseLeave",e)}_createMarkerEventArgs(t){const e=t.marker;return yg({},{layer:this,layerIndex:this._layerIndex(),marker:e,markerIndex:(this.items||[]).indexOf(e)},t)}}te(wg,{zIndex:1e3,autoBind:!0,locationField:"location",titleField:"title",template:""});class _g extends e.a{constructor(t){super(),this.options=t||{}}destroy(){this.layer=null,this.unbindEvents(),this.hide()}addTo(t){this.layer=t.markers||t,this.layer.items.push(this),this.layer.update(this)}location(t){return t?(this.options.location=np.create(t).toArray(),this.layer&&this.layer.update(this),this):np.create(this.options.location)}showAt(t){this.render(),this._anchor={left:Math.round(t.x),top:Math.round(t.y)},this.element.style.left=Tp(this._anchor.left),this.element.style.top=Tp(this._anchor.top)}hide(){this.element&&(this.element.remove(),this.element=null)}bindEvents(){this.element&&(this._mouseEnterHandler=_p(this._mouseEnter,this),Ee(this.element,fg,bg,this._mouseEnterHandler),this._mouseLeaveHandler=_p(this._mouseLeave,this),Ee(this.element,xg,bg,this._mouseLeaveHandler))}unbindEvents(){this.element&&(Le(this.element,fg,this._mouseEnterHandler),Le(this.element,xg,this._mouseLeaveHandler))}render(){if(!this.element){let t=this.options,e=this.layer,i=document.createElement("span");if(K(i,vg),this.options.template){const t=this._compileTemplate(this.options.template)(this.dataItem),e=kp(t);i.appendChild(e)}else if(t.svgIcon)ae(i,{icon:t.svgIcon,iconClass:"k-icon-xxl",svgIcons:this.options.icons.svgIcons,type:"svg"});else{let e={icon:"map-marker",iconClass:"k-icon-xxl",svgIcons:this.options.icons.svgIcons,type:this.options.icons.type};t.shape?"pinTarget"===t.shape?(e.icon="map-marker-target",ae(i,e)):"pin"===t.shape?ae(i,e):K(i,"k-icon k-icon-xxl k-i-marker-"+Cp(t.shape||"pin")):ae(i,e)}t.title&&i.setAttribute("title",t.title);const s=t.attributes||{};Object.keys(s).forEach((function(t){i.setAttribute(t,s[t])})),i._kendoNode=this,i.style.zIndex=t.zIndex,this.element=i,e&&e.element.appendChild(this.element),this.bindEvents()}}_mouseEnter(t){const e=this._createEventArgs(t);this.layer._markerMouseEnter(e),this.layer.map._tooltip.show({top:this._anchor.top-this.element.offsetHeight,left:this._anchor.left},this._tooltipContext())}_tooltipContext(){return{type:"marker",layerIndex:this.layer._layerIndex(),className:"k-map-marker-tooltip",dataItem:this.dataItem,title:this.options.title,location:this.location()}}_mouseLeave(t){const e=this._createEventArgs(t);this.layer._markerMouseLeave(e)}_createEventArgs(t){return{marker:this,originalEvent:t}}_compileTemplate(t){return bt.compile(t,{paramName:"dataItem",useWithBlock:!1})}static create(t,e){return t instanceof _g?t:new _g(ut({},e,t))}}const kg=Object.assign;function Ag(t){window.requestAnimationFrame(t)}class Sg extends e.a{constructor(){super();let t=this;t._tickProxy=_p(t._tick,t),t._started=!1}tick(){}done(){}onEnd(){}onCancel(){}start(){this.enabled()&&(this.done()?this.onEnd():(this._started=!0,Ag(this._tickProxy)))}enabled(){return!0}cancel(){this._started=!1,this.onCancel()}_tick(){let t=this;t._started&&(t.tick(),t.done()?(t._started=!1,t.onEnd()):Ag(t._tickProxy))}}class Cg extends Sg{constructor(t){super(),kg(this,t)}done(){return this.timePassed()>=this.duration}timePassed(){return Math.min(this.duration,Oe()-this.startDate)}moveTo(t){let e=this,i=e.movable;e.initial=i[e.axis],e.delta=t.location-e.initial,e.duration="number"==typeof t.duration?t.duration:300,e.tick=e._easeProxy(t.ease),e.startDate=Oe(),e.start()}_easeProxy(t){let e=this;return function(){e.movable.moveAxis(e.axis,t(e.timePassed(),e.initial,e.delta,e.duration))}}static easeOutExpo(t,e,i,s){return t===s?e+i:i*(1-Math.pow(2,-10*t/s))+e}}let Tg=Object.assign,Pg=Math.abs,Mg="change",Eg="scroll";class Lg extends Sg{constructor(t){super(t);let e=this;Tg(e,t),e.userEvents.bind("gestureend",e.start.bind(this)),e.tapCapture.bind("press",e.cancel.bind(this))}enabled(){return this.movable.scale<this.dimensions.minScale}done(){return this.dimensions.minScale-this.movable.scale<.01}tick(){let t=this.movable;t.scaleWith(1.1),this.dimensions.rescale(t.scale)}onEnd(){let t=this.movable;t.scaleTo(this.dimensions.minScale),this.dimensions.rescale(t.scale)}}class Ig extends Sg{constructor(t){super();let e=this;Tg(e,t,{transition:new Cg({axis:t.axis,movable:t.movable,onEnd(){e._end()}})}),e.tapCapture.bind("press",(function(){e.cancel()})),e.userEvents.bind("end",_p(e.start,e)),e.userEvents.bind("gestureend",_p(e.start,e)),e.userEvents.bind("tap",_p(e.onEnd,e))}onCancel(){this.transition.cancel()}freeze(t){this.cancel(),this._moveTo(t)}onEnd(){let t=this;t.paneAxis.outOfBounds()?t._snapBack():t._end()}done(){return Pg(this.velocity)<1}start(t){let e,i=this;i.dimension.enabled&&(i.paneAxis.outOfBounds()?i.transition._started?(i.transition.cancel(),i.velocity=Math.min(t.touch[i.axis].velocity*i.velocityMultiplier,55),super.start()):i._snapBack():(e=2===t.touch.id?0:t.touch[i.axis].velocity,i.velocity=Math.max(Math.min(e*i.velocityMultiplier,55),-55),i.tapCapture.captureNext(),super.start()))}tick(){let t=this,e=t.dimension,i=t.paneAxis.outOfBounds()?.5:t.friction,s=t.velocity*=i,o=t.movable[t.axis]+s;!t.elastic&&e.outOfBounds(o)&&(o=Math.max(Math.min(o,e.max),e.min),t.velocity=0),t.movable.moveAxis(t.axis,o)}_end(){this.tapCapture.cancelCapture(),this.end()}_snapBack(){let t=this,e=t.dimension,i=t.movable[t.axis]>e.max?e.max:e.min;t._moveTo(i)}_moveTo(t){this.transition.moveTo({location:t,duration:500,ease:Cg.easeOutExpo})}}class Rg extends Sg{constructor(t){super(t);Tg(this,t,{origin:{},destination:{},offset:{}})}tick(){this._updateCoordinates(),this.moveTo(this.origin)}done(){return Pg(this.offset.y)<5&&Pg(this.offset.x)<5}onEnd(){this.moveTo(this.destination),this.callback&&this.callback.call()}setCoordinates(t,e){this.offset={},this.origin=t,this.destination=e}setCallback(t){t&&ht(t)?this.callback=t:t=void 0}_updateCoordinates(){this.offset={x:(this.destination.x-this.origin.x)/4,y:(this.destination.y-this.origin.y)/4},this.origin={y:this.origin.y+this.offset.y,x:this.origin.x+this.offset.x}}}class Bg extends e.a{constructor(t){super();let e=this,i="x"===t.axis;const s=kp('<div class="km-touch-scrollbar km-'+(i?"horizontal":"vertical")+'-scrollbar" />');Tg(e,t,{element:s,elementSize:0,movable:new ag(s),scrollMovable:t.movable,alwaysVisible:t.alwaysVisible,size:i?"width":"height"}),e.scrollMovable.bind(Mg,e.refresh.bind(e)),e.container.appendChild(s),t.alwaysVisible&&e.show()}refresh(){let t=this,e=t.axis,i=t.dimension,s=i.size,o=t.scrollMovable,n=s/i.total,r=Math.round(-o[e]*n),a=Math.round(s*n);this.element.style.display=n>=1?"none":"",r+a>s?a=s-r:r<0&&(a+=r,r=0),t.elementSize!==a&&(t.element.style[t.size]=a+"px",t.elementSize=a),t.movable.moveAxis(e,r)}show(){this.element.style.opacity=.7,this.element.style.visibility="visible"}hide(){this.alwaysVisible||(this.element.style.opacity=0)}}class Og extends He{constructor(t,e){super();let i=this;this.element=t,this._initOptions(e);const s=(()=>{const{mobileOS:t}=Ie();return t.ios||t.android})(navigator.userAgent);i._native=i.options.useNative&&s;const o=kp('<div class="km-scroll-header"/>');if(i._native)return K(t,"km-native-scroller"),Sp(o,t),void Tg(i,{scrollElement:t,fixedContainer:t.children[0]});t.style.overflow="hidden",K(t,"km-scroll-wrapper");((t,e)=>{for(t.appendChild(e);t.firstChild!==e;)e.appendChild(t.firstChild)})(t,kp('<div class="km-scroll-container"/>')),Sp(o,t);let n=t.children[1],r=new eg(t),a=new ag(n),l=new sg({element:n,container:t,forcedEnabled:i.options.zoom}),h=this.options.avoidScrolling,c=new hi(t,{touchAction:"none",allowSelection:!0,preventDragEvent:!0,captureUpIfMoved:!0,multiTouch:i.options.zoom,supportDoubleTap:i.options.supportDoubleTap,start(t){l.refresh();let e=Pg(t.x.velocity),s=Pg(t.y.velocity),o=2*e>=s,n=2*s>=e;!i.fixedContainer.contains(t.event.target)&&!h(t)&&i.enabled&&(l.x.enabled&&o||l.y.enabled&&n)?c.capture():c.cancel()}}),d=new ng({movable:a,dimensions:l,userEvents:c,elastic:i.options.elastic}),u=new Lg({movable:a,dimensions:l,userEvents:c,tapCapture:r}),p=new Rg({moveTo(t){i.scrollTo(t.x,t.y)}});a.bind(Mg,(function(){i.scrollTop=-a.y,i.scrollLeft=-a.x,i.trigger(Eg,{scrollTop:i.scrollTop,scrollLeft:i.scrollLeft})})),i.options.mousewheelScrolling&&(this._wheelScrollHandler=this._wheelScroll.bind(this),Ee(t,"wheel",this._wheelScrollHandler)),Tg(i,{movable:a,dimensions:l,zoomSnapBack:u,animatedScroller:p,userEvents:c,pane:d,tapCapture:r,pulled:!1,enabled:!0,scrollElement:n,scrollTop:0,scrollLeft:0,fixedContainer:t.children[0]}),i._initAxis("x"),i._initAxis("y"),i._wheelEnd=function(){i._wheel=!1,i.userEvents.end(0,i._wheelY)},l.refresh(),i.options.pullToRefresh&&i._initPullToRefresh()}_initOptions(t){this.options=ut({},this.options,t)}_wheelScroll(t){if(t.ctrlKey)return;this._wheel||(this._wheel=!0,this._wheelY=0,this.userEvents.press(0,this._wheelY)),clearTimeout(this._wheelTimeout),this._wheelTimeout=setTimeout(this._wheelEnd,50);let e=(t=>{const e=t.wheelDeltaY;let i;return t.wheelDelta?(void 0===e||e)&&(i=t.wheelDelta):t.detail&&t.axis===t.VERTICAL_AXIS&&(i=10*-t.detail),i})(t);e&&(this._wheelY+=e,this.userEvents.move(0,this._wheelY)),t.preventDefault()}makeVirtual(){this.dimensions.y.makeVirtual()}virtualSize(t,e){this.dimensions.y.virtualSize(t,e)}height(){return this.dimensions.y.size}scrollHeight(){return this.scrollElement.scrollHeight}scrollWidth(){return this.scrollElement.scrollWidth}_resize(){this._native||this.contentResized()}setOptions(t){let e=this;this._initOptions(t),t.pullToRefresh&&e._initPullToRefresh()}reset(){this._native?this.scrollElement.scrollTop(0):(this.movable.moveTo({x:0,y:0}),this._scale(1))}contentResized(){this.dimensions.refresh(),this.pane.x.outOfBounds()&&this.movable.moveAxis("x",this.dimensions.x.min),this.pane.y.outOfBounds()&&this.movable.moveAxis("y",this.dimensions.y.min)}zoomOut(){let t=this.dimensions;t.refresh(),this._scale(t.fitScale),this.movable.moveTo(t.centerCoordinates())}enable(){this.enabled=!0}disable(){this.enabled=!1}scrollTo(t,e){this._native?(this.scrollElement.scrollLeft(Pg(t)),this.scrollElement.scrollTop(Pg(e))):(this.dimensions.refresh(),this.movable.moveTo({x:t,y:e}))}animatedScrollTo(t,e,i){let s,o;this._native?this.scrollTo(t,e):(s={x:this.movable.x,y:this.movable.y},o={x:t,y:e},this.animatedScroller.setCoordinates(s,o),this.animatedScroller.setCallback(i),this.animatedScroller.start())}pullHandled(){}destroy(){Le(this.element,"wheel",this._wheelScrollHandler),this.userEvents&&this.userEvents.destroy()}_scale(t){this.dimensions.rescale(t),this.movable.scaleTo(t)}_initPullToRefresh(){}_dragEnd(){}_paneChange(){}_initAxis(t){let e=this,i=e.movable,s=e.dimensions[t],o=e.tapCapture,n=e.pane[t],r=new Bg({axis:t,movable:i,dimension:s,container:e.element,alwaysVisible:e.options.visibleScrollHints});s.bind(Mg,(function(){r.refresh()})),n.bind(Mg,(function(){r.show()})),e[t+"inertia"]=new Ig({axis:t,paneAxis:n,movable:i,tapCapture:o,userEvents:e.userEvents,dimension:s,elastic:e.options.elastic,friction:e.options.friction||.96,velocityMultiplier:e.options.velocityMultiplier||10,end(){r.hide(),e.trigger("scrollEnd",{axis:t,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft})}})}}te(Og,{name:"Scroller",zoom:!1,pullOffset:140,visibleScrollHints:!1,elastic:!0,useNative:!1,mousewheelScrolling:!0,avoidScrolling:()=>!1,pullToRefresh:!1,messages:{pullTemplate:"Pull to refresh",releaseTemplate:"Release to refresh",refreshTemplate:"Refreshing"}}),Pp(Og,["pull",Eg,"resize"]);class Vg{constructor(t,e={}){this.sender=e.sender||t,this.widget=t,this.rtl=Boolean(e.rtl)}notify(t,e){this.widget&&this.widget.trigger(t,e)}}let Dg=Math,zg=Dg.min,Fg=Dg.pow,Hg=e.P,Ng="marker",jg="location",Ug="wheel";const Gg={bubble:dg,shape:hg,tile:Zp,[Ng]:wg};let Wg=class extends He{constructor(t,e={},i={},s={}){super(),this._init(t,e,i,s)}destroy(){this.scroller.destroy(),this._tooltip&&this._tooltip.destroy(),this.navigator&&this.navigator.destroy(),this.attribution&&this.attribution.destroy(),this.zoomControl&&this.zoomControl.destroy(),Q(this.markers)?this.markers.forEach((t=>{t.destroy()})):this.markers.destroy();for(let t=0;t<this.layers.length;t++)this.layers[t].destroy();Le(this.element,Ug,this._mousewheelHandler),super.destroy()}_init(t,i={},s={},o={}){this.support=Ie(),this.context=o,this.initObserver(o),this.initServices(o),this._notifyObserver("init"),this._initOptions(i),this._setEvents(i),this.crs=new wp,this._initElement(t),this._viewOrigin=this._getOrigin(),this._tooltip=this._createTooltip(),this._initScroller(),this._initMarkers(),this._initControls(),this._initLayers(),this._reset();const n=e.o(this._mousewheel.bind(this),50);this._mousewheelHandler=t=>{t.preventDefault(),n(t)},Ee(this.element,Ug,this._mousewheelHandler)}_initOptions(t){this.options=ut({},this.options,t)}_initElement(t){this.element=t,K(t,"k-map"),t.style.position="relative",t.setAttribute("data-role","map"),Ap(t);const e=kp("<div />");this.element.appendChild(e)}initServices(t={}){this.widgetService=new Vg(this,t)}initObserver(t={}){this.observers=[],this.addObserver(t.observer)}addObserver(t){t&&this.observers.push(t)}removeObserver(t){const e=this.observers.indexOf(t);e>=0&&this.observers.splice(e,1)}requiresHandlers(t){const e=this.observers;for(let i=0;i<e.length;i++)if(e[i].requiresHandlers(t))return!0}trigger(t,e={}){e.sender=this;const i=this.observers;let s=!1;for(let o=0;o<i.length;o++)i[o].trigger(t,e)&&(s=!0);return s||super.trigger(t,e),s}_notifyObserver(t,e={}){e.sender=this;const i=this.observers;let s=!1;for(let o=0;o<i.length;o++)i[o].trigger(t,e)&&(s=!0);return s}zoom(t){let e,i=this.options;if(Ft(t)){const s=Dg.round(Yt(t,i.minZoom,i.maxZoom));i.zoom!==s&&(i.zoom=s,this.widgetService.notify("zoomChange",{zoom:i.zoom}),this._reset()),e=this}else e=i.zoom;return e}center(t){let e;if(t){const i=np.create(t),s=np.create(this.options.center);i.equals(s)||(this.options.center=i.toArray(),this.widgetService.notify(Np,{center:this.options.center}),this._reset()),e=this}else e=np.create(this.options.center);return e}extent(t){let e;return t?(this._setExtent(t),e=this):e=this._getExtent(),e}setOptions(t={}){const e=this.element;this.destroy(),Ap(e),this._init(e,t,{},this.context),this._reset()}locationToLayer(t,e){let i=!this.options.wraparound;const s=np.create(t);return this.crs.toPoint(s,this._layerSize(e),i)}layerToLocation(t,e){let i=!this.options.wraparound;const s=Hg.create(t);return this.crs.toLocation(s,this._layerSize(e),i)}locationToView(t){const e=np.create(t);let i=this.locationToLayer(this._viewOrigin);return this.locationToLayer(e).translateWith(i.scale(-1))}viewToLocation(t,e){const i=this.locationToLayer(this._getOrigin(),e),s=Hg.create(t).clone().translateWith(i);return this.layerToLocation(s,e)}eventOffset(t){let i,s,o=Nt(this.element);if(t.x&&t.x[jg]||t.y&&t.y[jg])i=t.x[jg]-o.left,s=t.y[jg]-o.top;else{let e=t.originalEvent||t;i=Kt(e.pageX,e.clientX)-o.left,s=Kt(e.pageY,e.clientY)-o.top}return new e.P(i,s)}eventToView(t){let e=this.eventOffset(t);return this.locationToView(this.viewToLocation(e))}eventToLayer(t){return this.locationToLayer(this.eventToLocation(t))}eventToLocation(t){let e=this.eventOffset(t);return this.viewToLocation(e)}viewSize(){let t=this.element,e=this._layerSize(),i=t.clientWidth;return this.options.wraparound||(i=zg(e,i)),{width:i,height:zg(e,t.clientHeight)}}exportVisual(){return this._reset(),!1}hideTooltip(){this._tooltip&&this._tooltip.hide()}_setOrigin(t,e){let i,s=this.viewSize();const o=this._origin=np.create(t);return i=this.locationToLayer(o,e),i.x+=s.width/2,i.y+=s.height/2,this.options.center=this.layerToLocation(i,e).toArray(),this.widgetService.notify(Np,{center:this.options.center}),this}_getOrigin(t){let e,i=this.viewSize();return!t&&this._origin||(e=this.locationToLayer(this.center()),e.x-=i.width/2,e.y-=i.height/2,this._origin=this.layerToLocation(e)),this._origin}_setExtent(t){let e=Hp.create(t),i=e.se.clone();this.options.wraparound&&i.lng<0&&t.nw.lng>0&&(i.lng=180+(180+i.lng));const s=new Hp(e.nw,i);this.center(s.center());let o,n=this.element.clientWidth,r=this.element.clientHeight;for(o=this.options.maxZoom;o>=this.options.minZoom;o--){let t=this.locationToLayer(s.nw,o),e=this.locationToLayer(s.se,o),i=Dg.abs(e.x-t.x),a=Dg.abs(e.y-t.y);if(i<=n&&a<=r)break}this.zoom(o)}_getExtent(){let t=this._getOrigin(),e=this.locationToLayer(t),i=this.viewSize();e.x+=i.width,e.y+=i.height;let s=this.layerToLocation(e);return new Hp(t,s)}_zoomAround(t,e){this._setOrigin(this.layerToLocation(t,e),e),this.zoom(e)}_initControls(){let t=this.options.controls;t.attribution&&this._createAttribution(t.attribution),this.support.mobileOS||(t.navigator&&this._createNavigator(t.navigator),t.zoom&&this._createZoomControl(t.zoom))}_createControlElement(t,e){let i=t.position||e,s="."+Mp(i).replace(" ","."),o=this.element.querySelector(".k-map-controls"+s)||[];if(0===o.length){let t=document.createElement("div");K(t,"k-map-controls "+Mp(i)),o=t,this.element.appendChild(o)}let n=document.createElement("div");return o.appendChild(n),n}_createAttribution(t){let e=this._createControlElement(t,"bottomRight");this.attribution=new Ep(e,t)}_createNavigator(t){let e=this._createControlElement(t,"topLeft"),i=this.navigator=new Rp(e,ut({},t,{icons:this.options.icons}));this._navigatorPan=this._navigatorPan.bind(this),i.bind("pan",this._navigatorPan),this._navigatorCenter=this._navigatorCenter.bind(this),i.bind("center",this._navigatorCenter)}_navigatorPan(t){let e=this.scroller,i=e.scrollLeft+t.x,s=e.scrollTop-t.y,o=this._virtualSize,n=this.element.clientWidth,r=this.element.clientHeight;i=Yt(i,o.x.min,o.x.max-n),s=Yt(s,o.y.min,o.y.max-r),this.scroller.one("scroll",_p(this._scrollEnd,this)),this.scroller.scrollTo(-i,-s)}_navigatorCenter(){this.center(this.options.center)}_createZoomControl(t){let e=this._createControlElement(t,"topLeft"),i=this.zoomControl=new Vp(e,t,this.options.icons);this._zoomControlChange=this._zoomControlChange.bind(this),i.bind("change",this._zoomControlChange)}_zoomControlChange(t){this.trigger("zoomStart",{originalEvent:t})||(this.zoom(this.zoom()+t.delta),this.trigger("zoomEnd",{originalEvent:t}))}_initScroller(){let t=this.support.mobileOS?.93:.9,e=!1!==this.options.zoomable,i=this.scroller=new Og(this.element.children[0],{friction:t,velocityMultiplier:5,zoom:e,mousewheelScrolling:!1,supportDoubleTap:!0});i.bind("scroll",_p(this._scroll,this)),i.bind("scrollEnd",_p(this._scrollEnd,this)),i.userEvents.bind("gesturestart",_p(this._scaleStart,this)),i.userEvents.bind("gestureend",_p(this._scale,this)),i.userEvents.bind("doubleTap",_p(this._doubleTap,this)),i.userEvents.bind("tap",_p(this._tap,this)),this.scrollElement=i.scrollElement}_initLayers(){let t=this.options.layers,e=this.layers=[];for(let i=0;i<t.length;i++){let s=t[i];const o=this._createLayer(s);e.push(o)}}_createLayer(t){let e=t.type||"shape",i=this.options.layerDefaults[e],s=e===Ng?ut({},this.options.markerDefaults,t,{icons:this.options.icons}):ut({},i,t),o=new(0,Gg[e])(this,s);return e===Ng&&(this.markers=o),o}_createTooltip(){return new jp(this.widgetService,this.options.tooltip)}_initMarkers(){(this.options.layers||[]).filter((t=>t&&t.type===Ng)).length>0||(this.markers=new wg(this,ut({},this.options.markerDefaults,{icons:this.options.icons})),this.markers.add(this.options.markers))}_scroll(t){let i=this.locationToLayer(this._viewOrigin).round(),s=t.sender.movable,o=new e.P(s.x,s.y).scale(-1).scale(1/s.scale);i.x+=o.x,i.y+=o.y,this._scrollOffset=o,this._tooltip.offset=o,this.hideTooltip(),this._setOrigin(this.layerToLocation(i)),this.trigger("pan",{originalEvent:t,origin:this._getOrigin(),center:this.center()})}_scrollEnd(t){this._scrollOffset&&this._panComplete()&&(this._scrollOffset=null,this._panEndTimestamp=Oe(),this.trigger("panEnd",{originalEvent:t,origin:this._getOrigin(),center:this.center()}))}_panComplete(){return Oe()-(this._panEndTimestamp||0)>50}_scaleStart(t){if(this.trigger("zoomStart",{originalEvent:t})){let e=t.touches[1];e&&e.cancel()}}_scale(t){let i=this.scroller.movable.scale,s=this._scaleToZoom(i),o=new e.P(t.center.x,t.center.y),n=this.viewToLocation(o,s),r=this.locationToLayer(n,s).translate(-o.x,-o.y);this._zoomAround(r,s),this.trigger("zoomEnd",{originalEvent:t})}_scaleToZoom(t){let e=this._layerSize()*t/this.options.minSize,i=Dg.log(e)/Dg.log(2);return Dg.round(i)}_reset(){this.attribution&&this.attribution.filter(this.center(),this.zoom()),this._viewOrigin=this._getOrigin(!0),this._resetScroller(),this.hideTooltip(),this.trigger("beforeReset"),this.trigger("reset")}_resetScroller(){let t=this.scroller,e=t.dimensions.x,i=t.dimensions.y,s=this._layerSize(),o=this.extent().nw,n=this.locationToLayer(o).round();t.movable.round=!0,t.reset(),t.userEvents.cancel();let r=this.zoom();t.dimensions.forcedMinScale=Fg(2,this.options.minZoom-r),t.dimensions.maxScale=Fg(2,this.options.maxZoom-r);let a={min:-n.x,max:s-n.x},l={min:-n.y,max:s-n.y};if(this.options.wraparound&&(a.max=20*s,a.min=-a.max),!1===this.options.pannable){let t=this.viewSize();a.min=l.min=0,a.max=t.width,l.max=t.height}e.makeVirtual(),i.makeVirtual(),e.virtualSize(a.min,a.max),i.virtualSize(l.min,l.max),this._virtualSize={x:a,y:l}}_renderLayers(){}_layerSize(t){const e=Kt(t,this.options.zoom);return this.options.minSize*Fg(2,e)}_tap(t){if(!this._panComplete())return;let e=this.eventOffset(t);this.hideTooltip(),this.trigger("click",{originalEvent:t,location:this.viewToLocation(e)})}_doubleTap(t){if(!1!==this.options.zoomable&&!this.trigger("zoomStart",{originalEvent:t})){let e=this.zoom()+1,i=this.eventOffset(t),s=this.viewToLocation(i),o=this.locationToLayer(s,e).translate(-i.x,-i.y);this._zoomAround(o,e),this.trigger("zoomEnd",{originalEvent:t})}}_mousewheel(t){let e=Vt(t)>0?-1:1,i=this.options,s=this.zoom(),o=Yt(s+e,i.minZoom,i.maxZoom);if(!1!==i.zoomable&&o!==s&&!this.trigger("zoomStart",{originalEvent:t})){let e=this.eventOffset(t),i=this.viewToLocation(e),s=this.locationToLayer(i,o).translate(-e.x,-e.y);this._zoomAround(s,o),this.trigger("zoomEnd",{originalEvent:t})}}_toDocumentCoordinates(t){const e=Nt(this.element);return{left:$t(t.x+e.left),top:$t(t.y+e.top)}}};te(Wg,{name:"Map",controls:{attribution:!0,navigator:{panStep:100},zoom:!0},layers:[],layerDefaults:{shape:{style:{fill:{color:"#fff"},stroke:{color:"#aaa",width:.5}}},bubble:{style:{fill:{color:"#fff",opacity:.5},stroke:{color:"#aaa",width:.5}}},marker:{shape:"pinTarget",tooltip:{position:"top"}}},center:[0,0],icons:{type:"font",svgIcons:{}},zoom:3,minSize:256,minZoom:1,maxZoom:19,markers:[],markerDefaults:{shape:"pinTarget",tooltip:{position:"top"}},wraparound:!0,renderPointsAsMarkers:!1}),Pp(Wg,["beforeReset","click","markerActivate","markerClick","markerCreated","markerMouseEnter","markerMouseLeave","pan","panEnd","reset","shapeClick","shapeCreated","shapeFeatureCreated","shapeMouseEnter","shapeMouseLeave","zoomEnd","zoomStart"]);const Xg=(t,e)=>t.map(e).reduce(((t,e)=>t+e),0),Yg=(t,e)=>t.y0===e.y0?t.index-e.index:t.y0+t.y1-e.y0-e.y1,qg=(t,e)=>Yg(t.source,e.source),Zg=(t,e)=>Yg(t.target,e.target),$g=t=>t.value;function Qg(t){t.forEach((t=>{t.targetLinks.forEach((t=>{t.source.sourceLinks.sort(Zg)})),t.sourceLinks.forEach((t=>{t.target.targetLinks.sort(qg)}))}))}const Kg=(t,e)=>"left"===t.align?t.depth:"right"===t.align?e-t.height:t.sourceLinks.length?t.depth:e;let Jg=class{constructor(t){const{offset:e={},align:i}=t.nodesOptions;this.data={nodes:t.nodes.map((t=>ut({},{offset:e,align:i},t))),links:t.links.map((t=>ut({},t)))},this.width=t.width,this.height=t.height,this.offsetX=t.offsetX||0,this.offsetY=t.offsetY||0,this.nodeWidth=t.nodesOptions.width,this.nodePadding=t.nodesOptions.padding,this.reverse=t.reverse,this.targetColumnIndex=t.targetColumnIndex,this.loops=t.loops,this.autoLayout=t.autoLayout}calculate(){const{nodes:t,links:e}=this.data;this.connectLinksToNodes(t,e),this.calculateNodeValues(t);const i=this.calculateNodeHeights(t);if(i)return{nodes:[],links:[],columns:[],circularLinks:i};this.calculateNodeDepths(t);const s=this.calculateNodeColumns(t);return this.calculateNodeBreadths(s),this.applyNodesOffset(t),this.calculateLinkBreadths(t),Object.assign({},this.data,{columns:s})}connectLinksToNodes(t,e){const i=new Map;t.forEach(((t,e)=>{t.index=e,t.sourceLinks=[],t.targetLinks=[],t.id=void 0!==t.id?t.id:t.label.text,i.set(t.id,t)})),e.forEach((t=>{t.source=i.get(t.sourceId),t.target=i.get(t.targetId),t.source.sourceLinks.push(t),t.target.targetLinks.push(t)}))}calculateNodeValues(t){t.forEach((t=>{t.value=Math.max(Xg(t.sourceLinks,$g),Xg(t.targetLinks,$g))}))}calculateNodeDepths(t){let e=new Set(t),i=new Set,s=0;for(;e.size;){const t=Array.from(e);for(let e=0;e<t.length;e++){const o=t[e];o.depth=s;for(let t=0;t<o.sourceLinks.length;t++){const e=o.sourceLinks[t];i.add(e.target)}}s++,e=i,i=new Set}}calculateNodeHeights(t){const e=t.length;let i=new Set(t),s=new Set,o=0;const n=t=>{t.height=o,t.targetLinks.forEach((t=>{s.add(t.source)}))};for(;i.size;){if(i.forEach(n),o++,o>e)return!0;i=s,s=new Set}return!1}calculateNodeColumns(t){const e=(i=t,s=t=>t.depth,Math.max.apply(null,i.map(s)));var i,s;const o=(this.width-this.offsetX-this.nodeWidth)/e,n=new Array(e+1);for(let i=0;i<t.length;i++){const s=t[i],r=Math.max(0,Math.min(e,Kg(s,e)));s.x0=this.offsetX+r*o,s.x1=s.x0+this.nodeWidth,s.layer=r,n[r]=n[r]||[],n[r].push(s)}return n}calculateNodeBreadths(t){const e=(i=t,s=t=>(this.height-this.offsetY-(t.length-1)*this.nodePadding)/Xg(t,$g),Math.min.apply(null,i.map(s)));var i,s;if(t.forEach((t=>{let i=this.offsetY;t.forEach((t=>{t.y0=i,t.y1=i+t.value*e,i=t.y1+this.nodePadding,t.sourceLinks.forEach((t=>{t.width=t.value*e}))})),i=(this.height-i+this.nodePadding)/(t.length+1),t.forEach(((t,e)=>{t.y0+=i*(e+1),t.y1+=i*(e+1)}))})),!1!==this.autoLayout){const e=void 0!==this.loops?this.loops:t.length-1,i=this.targetColumnIndex||1;for(let s=0;s<e;s++)this.reverse?(this.uncurlLinksToRight(t,i),this.uncurlLinksToLeft(t,i)):(this.uncurlLinksToLeft(t,i),this.uncurlLinksToRight(t,i))}t.forEach(Qg)}applyNodesOffset(t){t.forEach((t=>{const e=(t.offset?t.offset.left:0)||0,i=(t.offset?t.offset.top:0)||0;t.x0+=e,t.x1+=e,t.y0+=i,t.y1+=i}))}calculateLinkBreadths(t){t.forEach((t=>{const{sourceLinks:e,targetLinks:i}=t;let s=t.y0,o=s;e.forEach((t=>{t.x0=t.source.x1,t.y0=s+t.width/2,s+=t.width})),i.forEach((t=>{t.x1=t.target.x0,t.y1=o+t.width/2,o+=t.width}))}))}uncurlLinksToRight(t,e){const i=t.length;for(let s=e;s<i;s++){const e=t[s];e.forEach((t=>{let e=0,i=0;t.targetLinks.forEach((s=>{let o=s.value*(t.layer-s.source.layer);e+=this.targetTopPos(s.source,t)*o,i+=o}));let s=0===e?0:e/i-t.y0;t.y0+=s,t.y1+=s,Qg([t])})),e.sort(Yg),this.arrangeNodesVertically(e)}}uncurlLinksToLeft(t,e){for(let i=t.length-1-e;i>=0;i--){const e=t[i];for(let t=0;t<e.length;t++){const i=e[t];let s=0,o=0;i.sourceLinks.forEach((t=>{let e=t.value*(t.target.layer-i.layer);s+=this.sourceTopPos(i,t.target)*e,o+=e}));let n=0===s?0:s/o-i.y0;i.y0+=n,i.y1+=n,Qg([i])}e.sort(Yg),this.arrangeNodesVertically(e)}}arrangeNodesVertically(t){const e=t.length-1;this.arrangeUp(t,this.height,e),this.arrangeDown(t,this.offsetY,0)}arrangeDown(t,e,i){let s=e;for(let e=i;e<t.length;e++){const i=t[e],o=Math.max(0,s-i.y0);i.y0+=o,i.y1+=o,s=i.y1+this.nodePadding}}arrangeUp(t,e,i){let s=e;for(let e=i;e>=0;--e){const i=t[e],o=Math.max(0,i.y1-s);i.y0-=o,i.y1-=o,s=i.y0-this.nodePadding}}sourceTopPos(t,e){let i=e.y0-(e.targetLinks.length-1)*this.nodePadding/2;for(let s=0;s<e.targetLinks.length;s++){const o=e.targetLinks[s];if(o.source===t)break;i+=o.width+this.nodePadding}for(let s=0;s<t.sourceLinks.length;s++){const o=t.sourceLinks[s];if(o.target===e)break;i-=o.width}return i}targetTopPos(t,e){let i=t.y0-(t.sourceLinks.length-1)*this.nodePadding/2;for(let s=0;s<t.sourceLinks.length;s++){const o=t.sourceLinks[s];if(o.target===e)break;i+=o.width+this.nodePadding}for(let s=0;s<e.targetLinks.length;s++){const o=e.targetLinks[s];if(o.source===t)break;i-=o.width}return i}};const tm=t=>new Jg(t).calculate();function em(t,e,i,s,o,n){const r=(n-e)*(i-t),a=(s-e)*(o-t);return r>a?1:r===a?0:-1}function im(t,e){const i=em(t.x0,t.y0,t.x1,t.y1,e.x1,e.y1),s=em(t.x0,t.y0,t.x1,t.y1,e.x0,e.y0),o=em(t.x0,t.y0,e.x0,e.y0,e.x1,e.y1),n=em(t.x1,t.y1,e.x0,e.y0,e.x1,e.y1);return i!==s&&o!==n}class sm extends e.a{constructor(t){super(),this.options=ut({},this.options,t),this.createVisual()}createVisual(){this.visual=this.createElement()}exportVisual(){return this.visual}createElement(){const t=this.options.visual;let e;return e=t?t({sender:this.getSender(),options:this.visualOptions(),createVisual:()=>this.getElement()}):this.getElement(),e}getSender(){return this}}class om extends sm{getElement(){return e.b.fromRect(this.getRect(),this.visualOptions())}getRect(){const t=this.options.node;return new e.R([t.x0,t.y0],[t.x1-t.x0,t.y1-t.y0])}getLabelText(t){let e=t.labels.ariaTemplate;if(e)return e({node:t.node})}visualOptions(){const t=ut({},this.options,this.options.node),e=this.getLabelText(t);return{fill:{color:t.color,opacity:t.opacity},stroke:{width:0},className:"k-sankey-node",role:"graphics-symbol",ariaRoleDescription:"Node",ariaLabel:e}}createFocusHighlight(){if(this.options.navigatable)return this._highlight=e.b.fromRect(this.getRect(),{stroke:this.options.focusHighlight.border,visible:!1}),this._highlight}focus(t){if(this._highlight){const{highlight:e=!0}=t||{};e&&this._highlight.options.set("visible",!0);const i=this.options.node.id;this.visual.options.set("id",i),this.options.root()&&this.options.root().setAttribute(a,i)}}blur(){this._highlight&&(this._highlight.options.set("visible",!1),this.visual.options.set("id",""),this.options.root()&&this.options.root().removeAttribute(a))}}const nm=(t,e,i)=>t.color||e[i%e.length],rm=(t,e,i,s)=>{const o=ut({},e,e.node);return ut({},{color:nm(t,i,s)},o,{node:t},{visual:t.visual,opacity:t.opacity,offset:t.offset,color:t.color})},am=(t,e,i,s,o)=>{const n=1-o,r=n*n,a=o*o;return t*r*n+3*e*o*r+3*i*a*n+s*a*o};const lm=(t,e)=>{const i=t.width/2,s=e?t.x1:t.x0,o=e?t.x0:t.x1,n=e?t.y1:t.y0,r=e?t.y0:t.y1,a=(s+o)/2,l=[a,am(n,n,r,r,.5)],h=.4999,c=[am(s,a,a,o,h),am(n,n,r,r,h)],d=function(t,e,i,s,o){let n,r,a=(t+i)/2,l=(e+s)/2;if(e===s)n=0,r=o/2;else if(t===i)n=o/2,r=0;else{let a=-1/((s-e)/(i-t));n=o/2/Math.sqrt(1+a*a),r=a*n}return{P1:{x:a-n,y:l-r},P2:{x:a+n,y:l+r}}}(l[0],l[1],c[0],c[1],t.width),u=[a,am(n+i,n+i,r+i,r+i,.5)],p=d.P1.y>d.P2.y?d.P1:d.P2,g=(n>r?1:-1)*i,m=function(t,e,i,s,o){const n=(t.x+e.x)/2,r=(t.y+e.y)/2,a=e.x-t.x;let l=-(e.y-t.y),h=a;const c=Math.sqrt(l*l+h*h);l=l/c*i,h=h/c*i;const d=n+l,u=r+h,p=n-l,g=r-h,m=o.x-s.x,f=o.y-s.y,x=f*(d-p)-m*(u-g);if(Math.abs(x)<1e-10)return null;const y=(m*(g-s.y)-f*(p-s.x))/x,v=((d-p)*(g-s.y)-(u-g)*(p-s.x))/x;if(y>=0&&y<=1&&v>=0&&v<=1)return{x:p+y*(d-p)};return null}(p,{x:u[0],y:u[1]},i,{x:u[0],y:u[1]},{x:Math.max(1,u[0]+g),y:u[1]})||{x:(u[0]+p.x)/2},f=s,x=o;return a-(m.x-.125*f-.125*x)/.75};class hm extends sm{getElement(){const t=this.options.link,{x0:i,x1:s,y0:o,y1:n}=t,r=(i+s)/2;return new e.b(this.visualOptions()).moveTo(i,o).curveTo([r,o],[r,n],[s,n])}getLabelText(t){let e=t.labels.ariaTemplate;if(e)return e({link:t.link})}visualOptions(){const t=this.options,e=this.options.link,i=this.getLabelText(t);return{stroke:{width:t.link.width,color:e.color||t.color,opacity:Ft(e.opacity)?e.opacity:t.opacity},role:"graphics-symbol",ariaRoleDescription:"Link",ariaLabel:i}}createFocusHighlight(){if(!this.options.navigatable)return;const{link:t}=this.options,{x0:i,x1:s,y0:o,y1:n}=t,r=(i+s)/2,a=t.width/2,l=lm(t,this.options.rtl);this._highlight=new e.b({stroke:this.options.focusHighlight.border,visible:!1}).moveTo(i,o+a).lineTo(i,o-a).curveTo([r+l,o-a],[r+l,n-a],[s,n-a]).lineTo(s,n+a).curveTo([r-l,n+a],[r-l,o+a],[i,o+a])}focus(t){if(this._highlight){const{highlight:e=!0}=t||{};e&&this._highlight.options.set("visible",!0);const i=`${this.options.link.sourceId}->${this.options.link.targetId}`;this.visual.options.set("id",i),this.options.root()&&this.options.root().setAttribute(a,i)}}blur(){this._highlight&&(this._highlight.options.set("visible",!1),this.visual.options.set("id",""),this.options.root()&&this.options.root().removeAttribute(a))}}const cm="inside",dm="before",um="after";class pm extends sm{getElement(){const t=ut({},this.options,this.options.node.label),{node:e,diagramMinX:i,diagramMaxX:s,text:o,offset:n,rtl:r}=t;let a=t.position;if(r&&a!==cm&&(a=a===dm?um:dm),!t.visible||!o)return null;const l=new ui(e.x0,e.y0,e.x1,e.y1),h=this.visualOptions();r&&!h.align&&(h.align="right");const c=new zi(o,h);c.reflow(new ui);const d=c.box,u=l.center().y-d.height()/2,p=e.x1+d.width()>s,g=e.x0-d.width()<i;let m=a===dm||a===cm&&p?dm:um;r&&(m=a===um||a===cm&&g?um:dm);const f=[m===dm?e.x0-d.width():e.x1,u],x=new ui(f[0],f[1],f[0]+d.width(),f[1]+d.height());return x.translate(n.left||0,n.top||0),c.reflow(x),c.renderVisual(),c.visual}visualOptions(){const t=ut({},this.options,this.options.node.label);return{color:t.color,font:t.font,border:t.border,margin:t.margin,padding:t.padding,align:t.align,paintOrder:t.paintOrder,stroke:t.stroke}}}te(pm,{position:cm});const gm=(t,e,i,s,o)=>ut({},e,{node:t,diagramMinX:s,diagramMaxX:o,rtl:i,visual:t.label.visual,visible:t.label.visible,margin:t.label.margin,padding:t.label.padding,border:t.label.border,align:t.label.align,offset:t.label.offset});class mm extends sm{getElement(){const t=this.options,{drawingRect:e,text:i}=t;if(!1===t.visible||!i)return null;const s=Fi.buildTitle(i,t);return s.reflow(e),s.renderVisual(),s.visual}createElement(){return this.getElement()}}te(mm,{align:d,border:{width:0},margin:yt(5),padding:yt(5)});const fm=(t,e)=>t.node.x0-e.node.x0!=0?t.node.x0-e.node.x0:t.node.y0-e.node.y0,xm=(t,e)=>t.node.x1-e.node.x1!=0?t.node.x1-e.node.x1:e.node.y0-t.node.y0;class ym extends sm{getElement(){const t=this.options,{drawingRect:e,rtl:i,nodes:s=[],item:o,position:n}=t;if(!1===t.visible||!s.length)return null;const r=t.labels||{};let a;r.content&&(a=wt(r));const l=s.map((t=>({text:a?a(t):t.label&&t.label.text||"",area:{background:void 0!==o.areaBackground?o.areaBackground:t.color,opacity:void 0!==o.areaOpacity?o.areaOpacity:t.opacity},node:t})));l.sort((t=>t?xm:fm)(i));const h=i&&n!==S&&n!==B,c=new Ml(Object.assign({},t,{data:l,reverse:h}),{rtl:i});return c.reflow(e),c.renderVisual(),c.visual}createElement(){return this.getElement()}}te(ym,{markers:{visible:!1},item:{type:Uo,cursor:Y,opacity:1},position:c,align:d,accessibility:{role:"presentation",ariaLabel:null,ariaRoleDescription:null},border:{width:0}});const vm="link",bm="node";class wm extends He{constructor(t,e,i){super(),this._initTheme(i),this._setOptions(e),this._initElement(t),this._initSurface(),e&&e.data&&(this._redraw(),this._initResizeObserver(),this._initNavigation(t))}destroy(){this.unbind(),this._destroySurface(),this._destroyResizeObserver(),this.element&&(this.element.removeEventListener("keydown",this._keydownHandler),this.element.removeEventListener("focus",this._focusHandler),this.element.removeEventListener("mousedown",this._onDownHandler),this.element.removeEventListener("touchstart",this._onDownHandler),this.element.removeEventListener("pointerdown",this._onDownHandler)),this._focusState=null,this.element=null}_initElement(t){this.element=t,K(t,["k-chart","k-sankey"]),t.setAttribute("role","graphics-document");const{title:e}=this.options;e.text&&t.setAttribute("aria-label",e.text),e.description&&t.setAttribute("aria-roledescription",e.description)}_initSurface(){this.surface||(this._destroySurface(),this._initSurfaceElement(),this.surface=this._createSurface())}_initNavigation(t){t.tabIndex=t.getAttribute("tabindex")||0,this.options.disableKeyboardNavigation||(this._keydownHandler=this._keydown.bind(this),this._focusHandler=this._focus.bind(this),this._blurHandler=this._blur.bind(this),this._onDownHandler=this._onDown.bind(this),t.addEventListener("keydown",this._keydownHandler),t.addEventListener("focus",this._focusHandler),t.addEventListener("blur",this._blurHandler),t.addEventListener("mousedown",this._onDownHandler),t.addEventListener("touchstart",this._onDownHandler),t.addEventListener("pointerdown",this._onDownHandler),this._focusState={node:this.firstFocusableNode(),link:null})}firstFocusableNode(){return this.columns[0][0]}_initResizeObserver(){const t=new ResizeObserver((t=>{t.forEach((t=>{const{width:e,height:i}=t.contentRect;t.target!==this.element||this.size&&this.size.width===e&&this.size.height===i||(this.size={width:e,height:i},this.surface.setSize(this.size),this.resize=!0,this._redraw())}))}));this._resizeObserver=t,t.observe(this.element)}_createSurface(){return e.n.create(this.surfaceElement,{mouseenter:this._mouseenter.bind(this),mouseleave:this._mouseleave.bind(this),mousemove:this._mousemove.bind(this),click:this._click.bind(this)})}_initTheme(t){let e=t||this.theme||{};this.theme=e,this.options=ut({},e,this.options)}setLinksOpacity(t){this.linksVisuals.forEach((e=>{this.setOpacity(e,t,e.linkOptions.opacity)}))}setLinksInactivityOpacity(t){this.linksVisuals.forEach((e=>{this.setOpacity(e,t,e.linkOptions.highlight.inactiveOpacity)}))}setOpacity(t,e,i){t.options.set("stroke",Object.assign({},t.options.stroke,{opacity:Ft(i)?i:e}))}trigger(t,e){let i=e.element.dataItem;const s=e.element.type,o=Object.assign({},e,{type:t,targetType:s,dataItem:i});return super.trigger(t,o)}_mouseenter(t){const e=t.element,i=e.type===vm,s=e.type===bm,o=Boolean(e.chartElement&&e.chartElement.options.node);if(i&&this.trigger("linkEnter",t)||s&&this.trigger("nodeEnter",t))return;const{highlight:n}=this.options.links;if(i)this.setLinksInactivityOpacity(n.inactiveOpacity),this.setOpacity(e,n.opacity,e.linkOptions.highlight.opacity);else if(s)this.highlightLinks(e,n);else if(o){const t=this.nodesVisuals.get(e.chartElement.options.node.id);this.highlightLinks(t,n)}}_mouseleave(t){const e=t.element,i=e.type===vm,s=e.type===bm,o=Boolean(e.chartElement&&e.chartElement.options.node),n=t.originalEvent.relatedTarget;i&&n&&"text"===n.nodeName||((i||s)&&(this.tooltipTimeOut&&(clearTimeout(this.tooltipTimeOut),this.tooltipTimeOut=null),this.tooltipShown=!1,this.trigger("tooltipHide",t)),i&&this.trigger("linkLeave",t)||s&&this.trigger("nodeLeave",t)||(i||s||o)&&this.linksVisuals.forEach((t=>{this.setOpacity(t,this.options.links.opacity,t.linkOptions.opacity)})))}_mousemove(t){const{followPointer:e,delay:i}=this.options.tooltip,s=t.element,o=s.type;if(o!==vm&&o!==bm||this.tooltipShown&&!e)return;const n=t.originalEvent,r=this.element.getBoundingClientRect(),a=n.clientX-r.left<r.width/2,l=n.clientY-r.top<r.height/2;if(t.tooltipData={popupOffset:{left:n.pageX,top:n.pageY},popupAlign:{horizontal:a?"left":"right",vertical:l?"top":"bottom"}},o===bm){const{sourceLinks:e,targetLinks:i}=s.dataItem,o=i.length?i:e;t.nodeValue=o.reduce(((t,e)=>t+e.value),0)}this.tooltipTimeOut&&(clearTimeout(this.tooltipTimeOut),this.tooltipTimeOut=null);const h=e&&this.tooltipShown?0:i;this.tooltipTimeOut=setTimeout((()=>{this.trigger("tooltipShow",t),this.tooltipShown=!0,this.tooltipTimeOut=null}),h)}_click(t){const e=t.element,i=e.dataItem,s=e.type===vm,o=e.type===bm,n=this._focusState||{};if(o){!n.link&&this.sameNode(n.node,i)||(this._focusState={node:i,link:null},this._focusNode({highlight:!1})),this.trigger("nodeClick",t)}else if(s){const e={sourceId:i.source.id,targetId:i.target.id,value:i.value};this.sameLink(n.link,e)||(this._focusState={node:i.source,link:e},this._focusLink({highlight:!1})),this.trigger("linkClick",t)}}sameNode(t,e){return t&&e&&t.id===e.id}sameLink(t,e){return t&&e&&t.sourceId===e.sourceId&&t.targetId===e.targetId}_focusNode(t){this._cleanFocusHighlight();const e=this._focusState.node;this.models.map.get(e.id).focus(t)}_focusLink(t){this._cleanFocusHighlight();const e=this._focusState.link;this.models.map.get(`${e.sourceId}-${e.targetId}`).focus(t)}_focusNextNode(t=1){const e=this._focusState.node,i=this.columns.findIndex((t=>t.find((t=>t.id===e.id)))),s=this.columns[i],o=s.findIndex((t=>t.id===e.id)),n=s[o+t];n&&(this._focusState.node=n,this._focusNode())}_focusNextLink(t=1){const e=this._focusState.node,i=this._focusState.link,s=e.sourceLinks.findIndex((t=>t.sourceId===i.sourceId&&t.targetId===i.targetId)),o=e.targetLinks.findIndex((t=>t.sourceId===i.sourceId&&t.targetId===i.targetId));if(-1!==s){const i=e.sourceLinks[s+t];i&&(this._focusState.link=i,this._focusLink())}else if(-1!==o){const i=e.targetLinks[o+t];i&&(this._focusState.link=i,this._focusLink())}}_focusSourceNode(){const t=this._focusState.link,e=this.models.map.get(t.sourceId);this._focusState={node:e.options.node,link:null},this._focusNode()}_focusTargetNode(){const t=this._focusState.link,e=this.models.map.get(t.targetId);this._focusState={node:e.options.node,link:null},this._focusNode()}_focusSourceLink(){const t=this._focusState.node.sourceLinks[0];t&&(this._focusState.link=t,this._focusLink())}_focusTargetLink(){const t=this._focusState.node.targetLinks[0];t&&(this._focusState.link=t,this._focusLink())}_focus(){this._skipFocusHighlight||(this._focusState.link?this._focusLink():this._focusNode()),this._skipFocusHighlight=!1}_blur(){this._cleanFocusHighlight()}_onDown(){this._hasFocus()||(this._skipFocusHighlight=!0)}_hasFocus(){return this.element.ownerDocument.activeElement===this.element}_cleanFocusHighlight(){this.models.nodes.forEach((t=>t.blur())),this.models.links.forEach((t=>t.blur()))}_keydown(t){let e=this["on"+t.key];const i=this.options.rtl;i&&"ArrowLeft"===t.key?e=this.onArrowRight:i&&"ArrowRight"===t.key&&(e=this.onArrowLeft),e&&e.call(this,t)}onEscape(t){t.preventDefault(),this._focusState={node:this.firstFocusableNode(),link:null},this._focusNode()}onArrowDown(t){t.preventDefault(),this._focusState.link?this._focusNextLink(1):this._focusNextNode(1)}onArrowUp(t){t.preventDefault(),this._focusState.link?this._focusNextLink(-1):this._focusNextNode(-1)}onArrowLeft(t){t.preventDefault(),this._focusState.link?this._focusSourceNode():this._focusTargetLink()}onArrowRight(t){t.preventDefault(),this._focusState.link?this._focusTargetNode():this._focusSourceLink()}highlightLinks(t,e){t&&(this.setLinksInactivityOpacity(e.inactiveOpacity),t.links.forEach((t=>{this.setOpacity(t,e.opacity,t.linkOptions.highlight.opacity)})))}_destroySurface(){this.surface&&(this.surface.destroy(),this.surface=null,this._destroySurfaceElement())}_destroyResizeObserver(){this._resizeObserver&&(this._resizeObserver.disconnect(),this._resizeObserver=null)}_initSurfaceElement(){this.surfaceElement||(this.surfaceElement=document.createElement("div"),this.element.appendChild(this.surfaceElement))}_destroySurfaceElement(){this.surfaceElement&&this.surfaceElement.parentNode&&(this.surfaceElement.parentNode.removeChild(this.surfaceElement),this.surfaceElement=null)}setOptions(t,e){this._setOptions(t),this._initTheme(e),this._initSurface(),this._redraw()}_redraw(){this.surface.clear();const{width:t,height:e}=this._getSize();this.size={width:t,height:e},this.surface.setSize(this.size),this.createVisual(),this.surface.draw(this.visual)}_getSize(){return this.element.getBoundingClientRect()}createVisual(){this.visual=this._render()}titleBox(t,e){if(!t||!1===t.visible||!t.text)return null;return new mm(Object.assign({},{drawingRect:e},t)).exportVisual().chartElement.box}legendBox(t,e,i){if(!t||!1===t.visible)return null;return new ym(Object.assign({},{nodes:e},t,{drawingRect:i})).exportVisual().chartElement.box}calculateSankey(t,e){const{title:i,legend:s,data:o,nodes:n,labels:r,nodeColors:a,disableAutoLayout:l,disableKeyboardNavigation:h,rtl:d}=e,u=!l,p=((n.focusHighlight||{}).border||{}).width||0,g=h?0:p/2,m=new ui(0,0,t.width,t.height);m.unpad(g);const f=this.titleBox(i,m);let x=m.clone();if(f){const e=f.height();i.position===z?(m.unpad({top:e}),x=new ui(0,e,t.width,t.height)):(m.shrink(0,e),x=new ui(0,0,t.width,t.height-e))}const y=this.legendBox(s,o.nodes,x),v=s&&s.position||ym.prototype.options.position;y&&(v===S&&m.unpad({left:y.width()}),v===B&&m.shrink(y.width(),0),v===z&&m.unpad({top:y.height()}),v===c&&m.shrink(0,y.height()));const{nodes:b,circularLinks:w}=tm(Object.assign({},t,{offsetX:0,offsetY:0,width:m.width(),height:m.height()}));if(w)return console.warn("Circular links detected. Kendo Sankey diagram does not support circular links."),{sankey:{nodes:[],links:[],columns:[[]],circularLinks:w},legendBox:y,titleBox:f};const _=new ui,k=b.reduce(((t,e)=>Math.min(t,e.x0)),1/0),A=b.reduce(((t,e)=>Math.max(t,e.x1)),0);b.forEach(((t,e)=>{if(d){const{x0:e,x1:i}=t;t.x0=A-i,t.x1=A-e}const i=rm(t,n,a,e),s=new om(i);_.wrap(Vi(s.exportVisual().rawBBox()));const o=new pm(gm(t,r,d,k,A)).exportVisual();o&&_.wrap(Vi(o.rawBBox()))}));let C=m.x1,T=m.y1,P=m.width()+C,M=m.height()+T;if(P-=_.x2>m.width()?_.x2-m.width():0,M-=_.y2>m.height()?_.y2-m.height():0,C+=_.x1<0?-_.x1:0,T+=_.y1<0?-_.y1:0,!1===u)return{sankey:tm(Object.assign({},t,{offsetX:C,offsetY:T,width:P,height:M,autoLayout:!1})),legendBox:y,titleBox:f};if(this.resize&&u&&this.permutation)return this.resize=!1,{sankey:tm(Object.assign({},t,{offsetX:C,offsetY:T,width:P,height:M},this.permutation)),legendBox:y,titleBox:f};const E=tm(Object.assign({},t,{offsetX:C,offsetY:T,width:P,height:M,autoLayout:!1})).columns.length,L=[],I=(e,i)=>{let s=(t=>{let e=0;const i=t.length;for(let s=0;s<i;s++){const o=t[s];for(let n=s+1;n<i;n++){const i=t[n];im(o,i)&&(e+=Math.min(o.value,i.value))}}return e})(tm(Object.assign({},t,{offsetX:C,offsetY:T,width:P,height:M,loops:2,targetColumnIndex:e,reverse:i})).links);return L.push({crosses:s,reverse:i,targetColumnIndex:e}),0===s};for(let t=1;t<=E-1&&(!I(t,!1)&&!I(t,!0));t++);const R=Math.min.apply(null,L.map((t=>t.crosses))),O=L.find((t=>t.crosses===R));this.permutation={targetColumnIndex:O.targetColumnIndex,reverse:O.reverse};return{sankey:tm(Object.assign({},t,{offsetX:C,offsetY:T,width:P,height:M},this.permutation)),legendBox:y,titleBox:f}}_render(t,i){const s=t||this.options,o=i||this,{labels:n,nodes:r,links:a,nodeColors:l,title:h,legend:c,rtl:d,disableKeyboardNavigation:u}=s;let p=s.data;const{width:g,height:m}=o.size,f=Object.assign({},p,{width:g,height:m,nodesOptions:r,title:h,legend:c}),{sankey:x,titleBox:y,legendBox:v}=this.calculateSankey(f,s);d&&(t=>{const{nodes:e,links:i}=t,s=Math.min(...e.map((t=>t.x0))),o=Math.max(...e.map((t=>t.x1)))-s;e.forEach((t=>{const e=o-(t.x1-2*s),i=o-(t.x0-2*s);t.x0=e,t.x1=i})),i.forEach((t=>{const e=o-(t.x1-2*s),i=o-(t.x0-2*s);t.x1=e,t.x0=i}))})(x);const{nodes:b,links:w,columns:_}=x;o.columns=_.map((t=>{const e=t.slice();return e.sort(((t,e)=>t.y0-e.y0)),e}));const k=new e.G({clip:e.b.fromRect(new e.R([0,0],[g,m]))});if(y){const t=new mm(Object.assign({},h,{drawingRect:y})).exportVisual();k.append(t)}if(x.circularLinks)return k;const A=new Map;o.nodesVisuals=A;const S={nodes:[],links:[],map:new Map};o.models=S;const C=[];b.forEach(((t,e)=>{const i=rm(t,r,l,e);i.root=()=>o.element,i.navigatable=!0!==u;const s=new om(i),n=s.exportVisual();n.links=[],n.type=bm,t.color=i.color,t.opacity=i.opacity,n.dataItem=Object.assign({},p.nodes[e],{color:i.color,opacity:i.opacity,sourceLinks:t.sourceLinks.map((t=>({sourceId:t.sourceId,targetId:t.targetId,value:t.value}))),targetLinks:t.targetLinks.map((t=>({sourceId:t.sourceId,targetId:t.targetId,value:t.value})))}),A.set(t.id,n),S.nodes.push(s),S.map.set(t.id,s),k.append(n),s.createFocusHighlight(),s._highlight&&C.push(s._highlight)}));const T=w.slice().sort(((t,e)=>e.value-t.value)),P=[];o.linksVisuals=P,T.forEach((t=>{const{source:e,target:i}=t,s=A.get(e.id),n=A.get(i.id),r=((t,e,i,s)=>{const o=ut({},e,{link:t,opacity:t.opacity,color:t.color,colorType:t.colorType,visual:t.visual,highlight:t.highlight});return"source"===o.colorType?o.color=i.options.fill.color:"target"===o.colorType&&(o.color=s.options.fill.color),o})(t,a,s,n);r.root=()=>o.element,r.navigatable=!0!==u,r.rtl=d;const l=new hm(r),h=l.exportVisual();h.type=vm,h.dataItem={source:Object.assign({},s.dataItem),target:Object.assign({},n.dataItem),value:t.value},h.linkOptions=r,P.push(h),s.links.push(h),n.links.push(h),S.links.push(l),S.map.set(`${e.id}-${i.id}`,l),l.createFocusHighlight(),l._highlight&&C.push(l._highlight),k.append(h)}));const M=b.reduce(((t,e)=>Math.min(t,e.x0)),1/0),E=b.reduce(((t,e)=>Math.max(t,e.x1)),0);if(b.forEach((t=>{const e=gm(t,n,d,M,E),i=new pm(e).exportVisual();i&&k.append(i)})),v){const t=new ym(Object.assign({},c,{rtl:d,drawingRect:v,nodes:b})).exportVisual();k.append(t)}if(0!==C.length){const t=new e.G;t.append(...C),k.append(t)}return k}exportVisual(t){const e=t&&t.options?ut({},this.options,t.options):this.options,i={size:{width:Ft(t&&t.width)?t.width:this.size.width,height:Ft(t&&t.height)?t.height:this.size.height}};return this._render(e,i)}_setOptions(t){this.options=ut({},this.options,t)}}const _m={opacity:1,width:2,color:h};te(wm,{title:{position:z},labels:{visible:!0,margin:{left:8,right:8},padding:0,border:{width:0},paintOrder:"stroke",stroke:{lineJoin:"round",width:1},offset:{left:0,top:0}},nodes:{width:24,padding:16,opacity:1,align:"stretch",offset:{left:0,top:0},focusHighlight:{border:Object.assign({},_m)},labels:{ariaTemplate:({node:t})=>t.label.text}},links:{colorType:"static",opacity:.4,highlight:{opacity:.8,inactiveOpacity:.2},focusHighlight:{border:Object.assign({},_m)},labels:{ariaTemplate:({link:t})=>`${t.source.label.text} to ${t.target.label.text}`}},tooltip:{followPointer:!1,delay:200}});const km=Object.freeze({seriesType:0,stacked:1,categoryAxisX:2,valueAxisY:3,seriesChange:4,areaMarginLeft:5,areaMarginRight:6,areaMarginTop:7,areaMarginBottom:8,areaBackground:9,titleText:10,titleFontName:11,titleFontSize:12,titleColor:13,subtitleText:14,subtitleFontName:15,subtitleFontSize:16,subtitleColor:17,seriesColor:18,seriesLabel:19,legendVisible:20,legendFontName:21,legendFontSize:22,legendColor:23,legendPosition:24,categoryAxisTitleText:25,categoryAxisTitleFontName:26,categoryAxisTitleFontSize:27,categoryAxisTitleColor:28,categoryAxisLabelsFontName:29,categoryAxisLabelsFontSize:30,categoryAxisLabelsColor:31,categoryAxisLabelsRotation:32,categoryAxisReverseOrder:33,valueAxisTitleText:34,valueAxisTitleFontName:35,valueAxisTitleFontSize:36,valueAxisTitleColor:37,valueAxisLabelsFormat:38,valueAxisLabelsFontName:39,valueAxisLabelsFontSize:40,valueAxisLabelsColor:41,valueAxisLabelsRotation:42}),Am="12px",Sm="16px",Cm=[{text:"Arial",value:"Arial, Helvetica, sans-serif",style:{fontFamily:"Arial, Helvetica, sans-serif"}},{text:"Courier New",value:"'Courier New', Courier, monospace",style:{fontFamily:"'Courier New', Courier, monospace"}},{text:"Georgia",value:"Georgia, serif",style:{fontFamily:"Georgia, serif"}},{text:"Impact",value:"Impact, Charcoal, sans-serif",style:{fontFamily:"Impact, Charcoal, sans-serif"}},{text:"Lucida Console",value:"'Lucida Console', Monaco, monospace",style:{fontFamily:"'Lucida Console', Monaco, monospace"}},{text:"Tahoma",value:"Tahoma, Geneva, sans-serif",style:{fontFamily:"Tahoma, Geneva, sans-serif"}},{text:"Times New Roman",value:"'Times New Roman', Times,serif",style:{fontFamily:"'Times New Roman', Times,serif"}},{text:"Trebuchet MS",value:"'Trebuchet MS', Helvetica, sans-serif",style:{fontFamily:"'Trebuchet MS', Helvetica, sans-serif"}},{text:"Verdana",value:"Verdana, Geneva, sans-serif",style:{fontFamily:"Verdana, Geneva, sans-serif"}}],Tm=Cm[0].value,Pm="line",Mm="scatter",Em=["column","bar",Pm,Mm],Lm={type:Pm,width:0};function Im(t){return t&&Em.includes(t)}const Rm=["string","date","number"],Bm=["number"],Om={bar:[{axisType:"category",types:Rm},{axisType:"value",types:Bm}],column:[{axisType:"category",types:Rm},{axisType:"value",types:Bm}],line:[{axisType:"category",types:Rm},{axisType:"value",types:Bm}],pie:[{axisType:"category",types:Rm},{axisType:"value",types:Bm,count:1}],scatter:[{axisType:"category",types:Rm},{axisType:"value",types:Bm}]};function Vm(t,e){return`${e||""} ${t||""}`.trim()}function Dm(t){const e=(t||"").indexOf(" ");return{size:t&&t.substring(0,e),name:t&&t.substring(e+1)}}const zm=(t,e,i)=>{const{size:s}=Dm(i);return t?Vm(t,s||e):""},Fm=(t,e,i)=>{const{name:s}=Dm(i);return t?Vm(s||e,t):""},Hm=t=>null!=t,Nm=t=>{const e=structuredClone(t[0]);return e.forEach(((e,i)=>{if(!Hm(e.value))for(let s=0;s<t.length;s++){const o=t[s][i].value;if(Hm(o)){e.value=o;break}}})),e},jm=(t,e)=>{const i=[],s=Nm(t);e.types.forEach((t=>{s.forEach(((e,s)=>{typeof e.value===t&&i.push(s)}))}));const o=i.findIndex((e=>{const i=t.map((t=>t[e].value));return new Set(i).size===i.length}));return Math.max(o,0)},Um=(t,e)=>{const i=[],s=Nm(t);return e.forEach((t=>{t.types.forEach((t=>{s.forEach(((e,s)=>{typeof e.value===t&&i.push(s)}))}))})),i},Gm=()=>structuredClone({columns:[],data:[],series:[],initialSeries:[],categoryAxis:[{categories:[],labels:{visible:!0,rotation:"auto"},title:{text:""}}],valueAxis:[{labels:{visible:!0,rotation:"auto"}}],area:{margin:{left:void 0,right:void 0,top:void 0,bottom:void 0}},title:{text:""},subtitle:{text:""},stack:!1}),Wm=(t,e,i)=>{const s=Gm();s.seriesType=e,s.data=t||[],s.legend={visible:!0,position:"bottom"};const o=Om[e];if(!o||!t.length)return s;const n=t[0].slice();s.columns=t[0].map((t=>String(t.field)));const r=o.find((t=>"category"===t.axisType));let a=-1;r&&(a=i&&i.categoryAxis?s.columns.indexOf(i.categoryAxis):jm(t,r));const l=o.filter((t=>"value"===t.axisType));let h=Um(t,l);h.includes(a)&&(h.length>1?h=h.filter((t=>t!==a)):a=-1);const c=[];h.forEach((i=>{const s=n[i],o=[];t.forEach((t=>{o.push(t[i].value)})),c.push(Object.assign({},{name:s.field,type:e,data:o,stack:!1,labels:{visible:!1}},e===Mm?Lm:{}))}));const d=a>-1?t.map((t=>String(Hm(t[a].value)?t[a].value:" "))):[];return c.length&&(s.series=c.map(((t,e)=>Object.assign({},t,{id:e}))),s.initialSeries=structuredClone(s.series)),s.categoryAxis=[{categories:d,labels:{visible:!0,rotation:"auto"}}],s.categoryField=s.columns[a],s},Xm=(t,e,i)=>{const s=Gm();s.seriesType=e,s.data=t||[];const o=Om[e];if(!o||!t.length)return s;const n=t[0].map((t=>t.field)),r=o.find((t=>"category"===t.axisType));let a=-1;r&&(a=i&&i.categoryAxis?n.indexOf(i.categoryAxis):jm(t,r));const l=o.filter((t=>"value"===t.axisType));let h=[];h=i&&i.valueAxis?[n.indexOf(i.valueAxis)]:Um(t,l),h.includes(a)&&h.length>1&&(h=h.filter((t=>t!==a))),"number"==typeof l[0].count&&(h=h.slice(0,l[0].count));const c=a>-1?t.map((t=>String(t[a].value))):[],d=[];return t.forEach((t=>{const e={};h.forEach((i=>{const s=t[i];e[s.field]=s.value||0,e[t[a].field]=t[a].value||" "})),d.push(e)})),s.columns=n,s.categoryAxis=[{categories:c,title:{text:""}}],s.series=[{id:0,data:d,type:e,name:n[a],labels:{visible:!0},categoryField:n[a],field:n[h[0]]}],s.categoryField=n[a],s.valueField=n[h[0]],s.initialSeries=structuredClone(s.series),s};function Ym(t,e){return(Im(e)?Wm:Xm)(t,e)}function qm(t,e){const i=structuredClone(e);if(i.legend=t.legend,i.area=t.area,i.title=t.title,i.subtitle=t.subtitle,i.series.length===t.series.length)for(let e=0;e<i.series.length;e++)i.series[e].color=t.series[e].color,i.series[e].labels=t.series[e].labels;return t.series.every((t=>t.labels&&t.labels.visible))&&Im(i.seriesType)&&Im(t.seriesType)&&i.series.forEach((t=>{t.labels=t.labels||{},t.labels.visible=!0})),i}function Zm(t,e,i){const s=Object.assign({},t);switch(e){case km.seriesType:return Ym(s.data,i);case km.stacked:return s.series=s.series.map((t=>Object.assign({},t,{stack:i}))),s.stack=i,s;case km.categoryAxisX:if(s.seriesType&&Im(s.seriesType)){return qm(s,Wm(s.data,s.seriesType,{categoryAxis:i}))}if("pie"===s.seriesType){return qm(s,Xm(s.data,s.seriesType,{categoryAxis:i}))}return s;case km.valueAxisY:if("pie"===s.seriesType){return qm(s,Xm(s.data,s.seriesType,{categoryAxis:s.categoryField,valueAxis:i}))}return s;case km.seriesChange:return s.series=i,s;case km.areaMarginLeft:return s.area=Object.assign({},s.area,{margin:Object.assign({},s.area&&s.area.margin||{},{left:i})}),s;case km.areaMarginRight:return s.area=Object.assign({},s.area,{margin:Object.assign({},s.area&&s.area.margin||{},{right:i})}),s;case km.areaMarginTop:return s.area=Object.assign({},s.area,{margin:Object.assign({},s.area&&s.area.margin||{},{top:i})}),s;case km.areaMarginBottom:return s.area=Object.assign({},s.area,{margin:Object.assign({},s.area&&s.area.margin||{},{bottom:i})}),s;case km.areaBackground:return s.area=Object.assign({},s.area,{background:i}),s;case km.titleText:return s.title=Object.assign({},s.title,{text:i}),s;case km.titleFontName:return s.title=Object.assign({},s.title,{font:zm(i,"20px",s.title&&s.title.font)}),s;case km.titleFontSize:return s.title=Object.assign({},s.title,{font:Fm(i,Tm,s.title&&s.title.font)}),s;case km.titleColor:return s.title=Object.assign({},s.title,{color:i}),s;case km.subtitleText:return s.subtitle=Object.assign({},s.subtitle,{text:i}),s;case km.subtitleFontName:return s.subtitle=Object.assign({},s.subtitle,{font:zm(i,"16px",s.subtitle&&s.subtitle.font)}),s;case km.subtitleFontSize:return s.subtitle=Object.assign({},s.subtitle,{font:Fm(i,Tm,s.subtitle&&s.subtitle.font)}),s;case km.subtitleColor:return s.subtitle=Object.assign({},s.subtitle,{color:i}),s;case km.seriesColor:return s.series=s.series.map((t=>Object.assign({},t,{color:i.seriesName===t.name?i.color:t.color}))),s;case km.seriesLabel:return s.series=s.series.map((t=>i.all||i.seriesName===t.name?Object.assign({},t,{labels:{visible:i.visible}}):t)),s;case km.legendVisible:return s.legend=Object.assign({},s.legend,{visible:i}),s;case km.legendFontName:{const t=s.legend||{};return s.legend=Object.assign({},t,{labels:Object.assign({},t.labels,{font:zm(i,Am,t.labels&&t.labels.font)})}),s}case km.legendFontSize:{const t=s.legend||{};return s.legend=Object.assign({},t,{labels:Object.assign({},t.labels,{font:Fm(i,Tm,t.labels&&t.labels.font)})}),s}case km.legendColor:{const t=s.legend||{};return s.legend=Object.assign({},t,{labels:Object.assign({},t.labels,{color:i})}),s}case km.legendPosition:return s.legend=Object.assign({},s.legend,{position:i}),s;case km.categoryAxisTitleText:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{text:i})}))),s;case km.categoryAxisTitleFontName:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{font:zm(i,Sm,t.title&&t.title.font)})}))),s;case km.categoryAxisTitleFontSize:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{font:Fm(i,Tm,t.title&&t.title.font)})}))),s;case km.categoryAxisTitleColor:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{color:i})}))),s;case km.categoryAxisLabelsFontName:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{font:zm(i,Am,t.labels&&t.labels.font)})}))),s;case km.categoryAxisLabelsFontSize:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{font:Fm(i,Tm,t.labels&&t.labels.font)})}))),s;case km.categoryAxisLabelsColor:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{color:i})}))),s;case km.categoryAxisLabelsRotation:{const t=Hm(i)?i:"auto";return s.categoryAxis=(s.categoryAxis||[]).map((e=>Object.assign({},e,{labels:Object.assign({},e.labels,{rotation:t})}))),s}case km.categoryAxisReverseOrder:return s.categoryAxis=(s.categoryAxis||[]).map((t=>Object.assign({},t,{reverse:i}))),s;case km.valueAxisTitleText:return s.valueAxis&&0!==s.valueAxis.length?s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{text:i})}))):s.valueAxis=[{title:{text:i}}],s;case km.valueAxisTitleFontName:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{font:zm(i,Sm,t.title&&t.title.font)})}))),s;case km.valueAxisTitleFontSize:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{font:Fm(i,Tm,t.title&&t.title.font)})}))),s;case km.valueAxisTitleColor:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{title:Object.assign({},t.title,{color:i})}))),s;case km.valueAxisLabelsFormat:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{format:i})}))),s;case km.valueAxisLabelsFontName:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{font:zm(i,Am,t.labels&&t.labels.font)})}))),s;case km.valueAxisLabelsFontSize:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{font:Fm(i,Tm,t.labels&&t.labels.font)})}))),s;case km.valueAxisLabelsColor:return s.valueAxis=(s.valueAxis||[]).map((t=>Object.assign({},t,{labels:Object.assign({},t.labels,{color:i})}))),s;case km.valueAxisLabelsRotation:{const t=Hm(i)?i:"auto";return s.valueAxis=(s.valueAxis||[]).map((e=>Object.assign({},e,{labels:Object.assign({},e.labels,{rotation:t})}))),s}default:return s}}const $m=Object.freeze({windowTitle:"Chart Preview",exportButton:"Export",exportPDFButton:"PDF File",exportSVGButton:"SVG File",exportPNGButton:"PNG File",tabChart:"Chart",tabData:"Data",tabFormat:"Format",barChart:"Bar Chart",barChartBar:"Bar",barChartStackedBar:"Stacked Bar",barChart100StackedBar:"100% Stacked Bar",pieChart:"Pie Chart",pieChartPie:"Pie",columnChart:"Column Chart",columnChartColumn:"Column",columnChartStackedColumn:"Stacked Column",columnChart100StackedColumn:"100% Stacked Column",lineChart:"Line Chart",lineChartLine:"Line",lineChartStackedLine:"Stacked Line",lineChart100StackedLine:"100% Stacked Line",scatterChart:"Scatter Chart",scatterChartScatter:"Scatter",configuration:"Configuration",configurationCategoryAxis:"Category Axis",configurationXAxis:"X Axis",configurationValueAxis:"Value Axis",configurationSeries:"Series",configurationSeriesAdd:"Add",formatChartArea:"Chart Area",formatChartAreaMargins:"Margins",formatChartAreaMarginsAuto:"Auto",formatChartAreaMarginsLeft:"Left",formatChartAreaMarginsRight:"Right",formatChartAreaMarginsTop:"Top",formatChartAreaMarginsBottom:"Bottom",formatChartAreaBackground:"Background",formatChartAreaBackgroundColor:"Color",formatTitle:"Title",formatTitleApplyTo:"Apply to",formatTitleChartTitle:"Chart Title",formatTitleChartSubtitle:"Chart Subtitle",formatTitleLabel:"Title",formatTitleFont:"Font",formatTitleFontPlaceholder:"(inherited font)",formatTitleSize:"Size",formatTitleSizePlaceholder:"px",formatTitleColor:"Color",formatSeries:"Series",formatSeriesApplyTo:"Apply to",formatSeriesAllSeries:"All Series",formatSeriesColor:"Color",formatSeriesShowLabels:"Show Labels",formatLegend:"Legend",formatLegendShowLegend:"Show Legend",formatLegendFont:"Font",formatLegendFontPlaceholder:"(inherited font)",formatLegendSize:"Size",formatLegendSizePlaceholder:"px",formatLegendColor:"Color",formatLegendPosition:"Position",formatLegendPositionTop:"Top",formatLegendPositionBottom:"Bottom",formatLegendPositionLeft:"Left",formatLegendPositionRight:"Right",formatCategoryAxis:"Category Axis",formatXAxis:"X Axis",formatCategoryAxisTitle:"Title",formatCategoryAxisTitlePlaceholder:"Axis Title",formatCategoryAxisTitleFont:"Font",formatCategoryAxisTitleFontPlaceholder:"(inherited font)",formatCategoryAxisTitleSize:"Size",formatCategoryAxisTitleSizePlaceholder:"px",formatCategoryAxisTitleColor:"Color",formatCategoryAxisLabels:"Labels",formatCategoryAxisLabelsFont:"Font",formatCategoryAxisLabelsFontPlaceholder:"(inherited font)",formatCategoryAxisLabelsSize:"Size",formatCategoryAxisLabelsSizePlaceholder:"px",formatCategoryAxisLabelsColor:"Color",formatCategoryAxisLabelsRotation:"Rotation",formatCategoryAxisLabelsRotationAuto:"Auto",formatCategoryAxisLabelsReverseOrder:"Reverse Order",formatValueAxis:"Value Axis",formatYAxis:"Y Axis",formatValueAxisTitle:"Title",formatValueAxisTitlePlaceholder:"Axis Title",formatValueAxisTitleFont:"Font",formatValueAxisTitleFontPlaceholder:"(inherited font)",formatValueAxisTitleSize:"Size",formatValueAxisTitleSizePlaceholder:"px",formatValueAxisTitleColor:"Color",formatValueAxisLabels:"Labels",formatValueAxisLabelsFormat:"Label Format",formatValueAxisLabelsFormatText:"Text",formatValueAxisLabelsFormatNumber:"Number",formatValueAxisLabelsFormatCurrency:"Currency",formatValueAxisLabelsFormatPercent:"Percent",formatValueAxisLabelsFont:"Font",formatValueAxisLabelsFontPlaceholder:"(inherited font)",formatValueAxisLabelsSize:"Size",formatValueAxisLabelsSizePlaceholder:"px",formatValueAxisLabelsColor:"Color",formatValueAxisLabelsRotation:"Rotation",formatValueAxisLabelsRotationAuto:"Auto"}),Qm=Object.freeze({getWizardDataFromDataRows:function(t){const e=[];return t.forEach((t=>{const{dataItem:i,dataColumns:s}=t,o=[];s.forEach((t=>{o.push({field:t.title||t.field,value:St(t.field)(i)})})),e.push(o)})),e},ActionTypes:km,createInitialState:function(t,e,i){const s=Ym(t,i&&i.seriesType||e);return void 0!==(i&&i.stack)?Zm(s,km.stacked,i.stack):s},createState:Ym,fontNames:Cm,fontSizes:[{text:"10",value:"10px"},{text:"12",value:"12px"},{text:"14",value:"14px"},{text:"16",value:"16px"},{text:"20",value:"20px"},{text:"28",value:"28px"},{text:"42",value:"42px"},{text:"56",value:"56px"}],isCategorical:Im,mergeStates:qm,parseFont:Dm,updateState:Zm,messages:$m}),Km=1.5,Jm=.4,tf="#000",ef="Arial, Helvetica, sans-serif",sf="11px "+ef,of="12px "+ef,nf="16px "+ef,rf="transparent",af="#fff",lf={type:en},hf={type:Uo},cf=Object.assign({},hf,{markers:{visible:!1},highlight:{visible:!1}}),df=()=>({icon:{border:{width:1}},label:{font:of,padding:3},line:{length:10,width:2},legendItem:cf,visible:!0}),uf=()=>({highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},legendItem:hf,opacity:.4}),pf=()=>({highlight:{markers:{border:{}}},line:{opacity:1,width:0},markers:{size:6,visible:!1},legendItem:hf,opacity:.4}),gf=()=>({outliersField:"",meanField:"",border:{_brightness:.8,width:1},downColor:af,gap:1,highlight:{border:{opacity:1,width:2},whiskers:{width:3},mean:{width:2},median:{width:2}},mean:{width:2},median:{width:2},spacing:.3,whiskers:{width:2},legendItem:cf}),mf=()=>({gap:Km,spacing:Jm,target:{color:"#ff0000"},legendItem:cf}),ff=()=>({width:2,legendItem:lf}),xf=()=>({line:{opacity:1,width:0},markers:{size:6,visible:!1},legendItem:hf,opacity:.5}),yf=()=>({markers:{visible:!1},legendItem:lf,width:2}),vf=()=>({gap:.5,line:{color:tf,width:1},legendItem:cf,spacing:Jm}),bf=()=>({labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}},legendItem:cf}),wf=bf,_f=t=>Object.assign({color:A,trendline:{},markers:{visible:!1},width:1,dashType:"longDash",legendItem:lf},t),kf=t=>({visible:!0,labels:{font:sf},overlay:t.gradients?{}:{gradient:"none"},area:uf(),rangeArea:pf(),verticalRangeArea:pf(),bar:{gap:Km,spacing:Jm,legendItem:cf},boxPlot:gf(),bubble:{border:{width:0},labels:{background:rf},legendItem:cf,opacity:.6},bullet:mf(),candlestick:{border:{_brightness:.8,width:1},downColor:af,gap:1,highlight:{border:{opacity:1,width:2},line:{width:2}},line:{color:tf,width:1},legendItem:cf,spacing:.3},column:{gap:Km,spacing:Jm,legendItem:cf},heatmap:{labels:{color:"",background:rf,visible:!0},highlight:{border:{width:0}},legendItem:cf},pie:{labels:{background:"",color:"",padding:{top:5,bottom:5,left:7,right:7}},legendItem:cf},donut:{margin:1,legendItem:cf},funnel:bf(),pyramid:wf(),horizontalWaterfall:vf(),line:ff(),notes:df(),ohlc:{gap:1,highlight:{line:{opacity:1,width:3}},line:{width:1},legendItem:cf,spacing:.3},radarArea:xf(),radarLine:yf(),radarColumn:{legendItem:cf},polarArea:xf(),polarLine:yf(),polarScatter:{legendItem:lf},rangeBar:{gap:Km,spacing:Jm,legendItem:cf},rangeColumn:{gap:Km,spacing:Jm,legendItem:cf},scatter:{legendItem:lf},scatterLine:{width:1,legendItem:lf},verticalArea:uf(),verticalBoxPlot:gf(),verticalBullet:mf(),verticalLine:ff(),waterfall:vf(),linearTrendline:_f(),exponentialTrendline:_f({style:"smooth"}),logarithmicTrendline:_f({style:"smooth"}),polynomialTrendline:_f({style:"smooth"}),powerTrendline:_f({style:"smooth"}),movingAverageTrendline:_f()}),Af="--kendo-chart-series-",Sf=t=>t.ownerDocument.defaultView.getComputedStyle(t),Cf={},Tf=(t,e)=>{let i=Sf(t).getPropertyValue(e);return/^color-mix/i.test(i)&&(i=((t,e)=>{if(Cf[t])return Cf[t];const i=e.style.color;e.style.color=t;const s=Sf(e).color;return e.style.color=i,Cf[t]=s,s})(i,t)),i},Pf=(t,e)=>parseFloat(Sf(t).getPropertyValue(e)),Mf=(t,e,i,s)=>{const o=Sf(t);return[o.getPropertyValue(e),o.getPropertyValue(i),o.getPropertyValue(s)||o.fontFamily].join(" ")},Ef=t=>{const e=Sf(t),i=[];let s=1,o=e.getPropertyValue(`${Af}${s}`);for(;o||s<=30;)i.push(o),s++,o=e.getPropertyValue(`${Af}${s}`);return i},Lf=t=>Mf(t,"--kendo-font-weight","--kendo-chart-font-size","--kendo-font-family"),If=t=>Mf(t,"--kendo-chart-pane-title-font-weight","--kendo-chart-pane-title-font-size","--kendo-font-family"),Rf=t=>Tf(t,"--kendo-chart-text"),Bf=t=>({color:Rf(t),font:Mf(t,"--kendo-font-weight","--kendo-chart-title-font-size","--kendo-font-family")}),Of=t=>{const e=Rf(t);return{labels:{color:e,font:Lf(t)},title:{color:e}}},Vf=t=>{const e=Tf(t,"--kendo-chart-inactive");return Object.assign({},{inactiveItems:{labels:{color:e},markers:{color:e}}},Of(t))};var Df=Object.freeze({__proto__:null,Aggregates:vo,AreaChart:Jr,AreaSegment:$r,AxisGroupRangeTracker:ta,Bar:sa,BarChart:la,BarLabel:ea,BoxPlot:da,BoxPlotChart:pa,BubbleChart:xa,Bullet:va,BulletChart:ba,Candlestick:ha,CandlestickChart:ca,CategoricalChart:Dr,CategoricalErrorBar:xr,CategoricalPlotArea:dl,Chart:Yh,ChartAxis:go,ChartContainer:Aa,ChartPane:fo,ChartPlotArea:xo,ClipAnimation:Yr,ClusterLayout:ra,Crosshair:ka,CrosshairTooltip:_a,DefaultAggregates:Va,DonutChart:rh,DonutPlotArea:ah,DonutSegment:nh,ErrorBarBase:fr,ErrorRangeCalculator:Ao,Highlight:gl,Legend:Ml,LegendItem:Tl,LegendLayout:wl,LineChart:Zr,LinePoint:Hr,LineSegment:Nr,MousewheelZoom:bl,OHLCChart:Ya,OHLCPoint:Xa,Pane:Sa,Pannable:yl,PieAnimation:Fl,PieChart:ih,PieChartMixin:eh,PiePlotArea:oh,PieSegment:Ql,PlotAreaBase:Pa,PlotAreaEventsMixin:Ra,PlotAreaFactory:El,PointEventsMixin:zr,RangeAreaChart:Wa,RangeAreaPoint:Na,RangeBar:Da,RangeBarChart:za,ScatterChart:ma,ScatterErrorBar:ga,ScatterLineChart:Hl,Selection:Rl,SeriesAggregator:Ba,SeriesBinder:wo,SharedTooltip:Ol,SplineAreaSegment:Kr,SplineSegment:Wr,StackWrap:aa,Tooltip:Bl,WaterfallChart:Za,WaterfallSegment:qa,XYPlotArea:Zl,ZoomSelection:vl,anyHasZIndex:yr,appendIfNotNull:vr,areNumbers:br,bindSegments:_r,categoriesCount:kr,constants:mr,countNumbers:yo,createOutOfRangePoints:Vr,equalsIgnoreCase:Ar,evalOptions:Sr,filterSeriesByType:Cr,findAxisByName:mo,getField:bo,hasGradientOverlay:Mr,hasValue:Er,isDateAxis:Lr,parseDateCategory:Pr,segmentVisible:wr,singleItemOrArray:Ir});t.A=xd,t.B=ui,t.C=Qm,t.D=$i,t.E=yt,t.F=hc,t.G=Ei,t.H=mc,t.I=It,t.J=lc,t.K=pc,t.L=Jc,t.M=uc,t.N=cc,t.O=nc,t.P=di,t.R=pd,t.S=wo,t.T=zi,t.__meta__={id:"charts.cmn.chunk",name:"ChartsCmnChunk",category:"web",description:"A reusable outputed chunk of code",depends:["drawing.cmn.chunk"],hidden:!0,chunk:!0},t.a=Df,t.b=(t={})=>({axisDefaults:{labels:{font:of},notes:df(),title:{font:nf,margin:5}},categoryAxis:{majorGridLines:{visible:!0}},navigator:{pane:{height:90,margin:{top:10}}},seriesDefaults:kf(t),title:{font:nf},subtitle:{font:of},legend:{labels:{font:of}}}),t.c=po,t.d=mr,t.e=Ft,t.f=bo,t.g=t=>{const e=Rf(t);return{pointer:{color:Tf(t,"--kendo-chart-gauge-pointer")},scale:{labels:{color:e},rangePlaceholderColor:Tf(t,"--kendo-chart-gauge-track"),minorTicks:{color:e},majorTicks:{color:e},line:{color:e}}}},t.h=we,t.i=Et,t.j=Yh,t.k=t=>{const e=Tf(t,"--kendo-chart-major-lines"),i=Tf(t,"--kendo-chart-text"),s=Mf(t,"--kendo-font-weight","--kendo-chart-label-font-size","--kendo-font-family"),o=Tf(t,"--kendo-chart-bg"),n=(t=>({icon:{background:Tf(t,"--kendo-chart-notes-bg"),border:{color:Tf(t,"--kendo-chart-notes-border")}},line:{color:Tf(t,"--kendo-chart-notes-lines")},label:{font:Lf(t)}}))(t),r=Pf(t,"--kendo-chart-area-opacity"),a=Tf(t,"--kendo-color-surface"),l=Tf(t,"--kendo-chart-primary-bg"),h=()=>({downColor:e,mean:{color:a},median:{color:a},whiskers:{color:l}}),c=()=>({line:{color:e}}),d=()=>({opacity:r,highlight:{inactiveOpacity:Pf(t,"--kendo-chart-area-inactive-opacity")}}),u=()=>({highlight:{inactiveOpacity:Pf(t,"--kendo-chart-line-inactive-opacity")}}),p=()=>({target:{color:i}});return{axisDefaults:{crosshair:{color:Tf(t,"--kendo-chart-crosshair-bg")},labels:{color:i,font:s},line:{color:e},majorGridLines:{color:e},minorGridLines:{color:Tf(t,"--kendo-chart-minor-lines")},notes:structuredClone(n),title:{color:i,font:Lf(t)}},chartArea:{background:o},legend:Vf(t),seriesColors:Ef(t),seriesDefaults:{area:d(),verticalArea:d(),radarArea:d(),boxPlot:h(),verticalBoxPlot:h(),bullet:p(),verticalBullet:p(),horizontalWaterfall:c(),waterfall:c(),line:u(),verticalLine:u(),candlestick:{downColor:i,line:{color:i}},errorBars:{color:Tf(t,"--kendo-chart-error-bars-bg")},icon:{border:{color:e}},labels:{background:o,color:i,font:s,opacity:r},notes:structuredClone(n)},subtitle:{color:i,font:If(t)},title:Bf(t),paneDefaults:{title:{font:If(t)}}}},t.l=Ct,t.m=Vt,t.n=Mt,t.o=t=>({labels:{color:Rf(t),font:Lf(t),stroke:{color:Tf(t,"--kendo-chart-bg")}},links:{color:Tf(t,"--kendo-color-subtle")},nodeColors:Ef(t),title:Bf(t),legend:Of(t)}),t.p=wm,t.q=(t,e,i)=>{const s=new Set,o=new Map,n=new Map;t.forEach((t=>{e.forEach((e=>{s.add(e.value(t))}));for(let s=0;s<e.length-1;s++){const r=e[s].value(t),a=e[s+1].value(t),l=`${r}_${a}`,h=i.value(t),c=o.get(l);void 0!==c?o.set(l,c+h):(o.set(l,h),n.set(l,{source:r,target:a}))}}));const r=new Map,a=Array.from(s).map(((t,e)=>(r.set(t,e),{id:e,label:{text:String(t)}}))),l=Array.from(o).map((([t,e])=>{const{source:i,target:s}=n.get(t);return{sourceId:r.get(i),targetId:r.get(s),value:e}}));return{nodes:a,links:l}},t.r=$t,t.s=Qi,t.t=class extends xd{_createModel(){const t=this.options.scale;"number"!=typeof t.startAngle&&(t.startAngle=90),t.endAngle=t.startAngle+360,super._createModel()}},t.u=Yc,t.v=Qc,t.w=Uc,t.x=dd,t.y=rd,t.z=Nc}));
//# sourceMappingURL=kendo.charts.cmn.chunk.min.js.map