UNPKG

@highcharts/dashboards

Version:
11 lines 159 kB
!/**
 * Highcharts Dashboards v3.5.0 (2025-07-14)
 *
 * (c) 2009-2025 Highsoft AS
 *
 * License: www.highcharts.com/license
 */function(e,t){"object"==typeof module&&module.exports?(t.default=t,module.exports=e&&e.document?t(e):t):"function"==typeof define&&define.amd?define("dashboards/dashboards",function(){return t(e)}):(e.Dashboards&&e.Dashboards.error(16,!0),e.Dashboards=t(e))}("undefined"!=typeof window?window:this,function(e){"use strict";var t={};function i(t,i,n,s){!t.hasOwnProperty(i)&&(t[i]=s.apply(null,n),e&&"function"==typeof CustomEvent&&e.dispatchEvent(new CustomEvent("DashboardsModuleLoaded",{detail:{path:i,module:t[i]}})))}return i(t,"Core/Globals.js",[],function(){var t,i;return(i=t||(t={})).SVG_NS="http://www.w3.org/2000/svg",i.product="Highcharts",i.version="3.5.0",i.win=void 0!==e?e:{},i.doc=i.win.document,i.svg=!!i.doc?.createElementNS?.(i.SVG_NS,"svg")?.createSVGRect,i.pageLang=i.doc?.documentElement?.closest("[lang]")?.lang,i.userAgent=i.win.navigator?.userAgent||"",i.isChrome=i.win.chrome,i.isFirefox=-1!==i.userAgent.indexOf("Firefox"),i.isMS=/(edge|msie|trident)/i.test(i.userAgent)&&!i.win.opera,i.isSafari=!i.isChrome&&-1!==i.userAgent.indexOf("Safari"),i.isTouchDevice=/(Mobile|Android|Windows Phone)/.test(i.userAgent),i.isWebKit=-1!==i.userAgent.indexOf("AppleWebKit"),i.deg2rad=2*Math.PI/360,i.marginNames=["plotTop","marginRight","marginBottom","plotLeft"],i.noop=function(){},i.supportsPassiveEvents=function(){let e=!1;if(!i.isMS){let t=Object.defineProperty({},"passive",{get:function(){e=!0}});i.win.addEventListener&&i.win.removeEventListener&&(i.win.addEventListener("testPassive",i.noop,t),i.win.removeEventListener("testPassive",i.noop,t))}return e}(),i.charts=[],i.composed=[],i.dateFormats={},i.seriesTypes={},i.symbolSizes={},i.chartCount=0,t}),i(t,"Core/Utilities.js",[t["Core/Globals.js"]],function(e){let t,{charts:i,doc:n,win:s}=e;function o(t,i,n,r){let a=i?"Highcharts error":"Highcharts warning";32===t&&(t=`${a}: Deprecated member`);let l=u(t),c=l?`${a} #${t}: www.highcharts.com/errors/${t}/`:t.toString();if(void 0!==r){let e="";l&&(c+="?"),T(r,function(t,i){e+=`
 - ${i}: ${t}`,l&&(c+=encodeURI(i)+"="+encodeURI(t))}),c+=e}D(e,"displayError",{chart:n,code:t,message:c,params:r},function(){if(i)throw Error(c);s.console&&-1===o.messages.indexOf(c)&&console.warn(c)}),o.messages.push(c)}function r(e,t){return parseInt(e,t||10)}function a(e){return"string"==typeof e}function l(e){let t=Object.prototype.toString.call(e);return"[object Array]"===t||"[object Array Iterator]"===t}function c(e,t){return!!e&&"object"==typeof e&&(!t||!l(e))}function h(e){return c(e)&&"number"==typeof e.nodeType}function d(e){let t=e?.constructor;return!!(c(e,!0)&&!h(e)&&t?.name&&"Object"!==t.name)}function u(e){return"number"==typeof e&&!isNaN(e)&&e<1/0&&e>-1/0}function p(e){return null!=e}function m(e,t,i){let n,s=a(t)&&!p(i),o=(t,i)=>{p(t)?e.setAttribute(i,t):s?(n=e.getAttribute(i))||"class"!==i||(n=e.getAttribute(i+"Name")):e.removeAttribute(i)};return a(t)?o(i,t):T(t,o),n}function f(e){return l(e)?e:[e]}function g(e,t){let i;for(i in e||(e={}),t)e[i]=t[i];return e}function y(){let e=arguments,t=e.length;for(let i=0;i<t;i++){let t=e[i];if(null!=t)return t}}function b(e,t){g(e.style,t)}function C(e){return Math.pow(10,Math.floor(Math.log(e)/Math.LN10))}function v(e,t){return e>1e14?e:parseFloat(e.toPrecision(t||14))}(o||(o={})).messages=[],Math.easeInOutSine=function(e){return -.5*(Math.cos(Math.PI*e)-1)};let w=Array.prototype.find?function(e,t){return e.find(t)}:function(e,t){let i,n=e.length;for(i=0;i<n;i++)if(t(e[i],i))return e[i]};function T(e,t,i){for(let n in e)Object.hasOwnProperty.call(e,n)&&t.call(i||e[n],e[n],n,e)}function O(e,t,i){function n(t,i){let n=e.removeEventListener;n&&n.call(e,t,i,!1)}function s(i){let s,o;e.nodeName&&(t?(s={})[t]=!0:s=i,T(s,function(e,t){if(i[t])for(o=i[t].length;o--;)n(t,i[t][o].fn)}))}let o="function"==typeof e&&e.prototype||e;if(Object.hasOwnProperty.call(o,"hcEvents")){let e=o.hcEvents;if(t){let o=e[t]||[];i?(e[t]=o.filter(function(e){return i!==e.fn}),n(t,i)):(s(e),e[t]=[])}else s(e),delete o.hcEvents}}function D(t,i,s,o){if(s=s||{},n?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==e)){let e=n.createEvent("Events");e.initEvent(i,!0,!0),s=g(e,s),t.dispatchEvent?t.dispatchEvent(s):t.fireEvent(i,s)}else if(t.hcEvents){s.target||g(s,{preventDefault:function(){s.defaultPrevented=!0},target:t,type:i});let e=[],n=t,o=!1;for(;n.hcEvents;)Object.hasOwnProperty.call(n,"hcEvents")&&n.hcEvents[i]&&(e.length&&(o=!0),e.unshift.apply(e,n.hcEvents[i])),n=Object.getPrototypeOf(n);o&&e.sort((e,t)=>e.order-t.order),e.forEach(e=>{!1===e.fn.call(t,s)&&s.preventDefault()})}o&&!s.defaultPrevented&&o.call(t,s)}let x=function(){let e=Math.random().toString(36).substring(2,9)+"-",i=0;return function(){return"highcharts-"+(t?"":e)+i++}}();return s.jQuery&&(s.jQuery.fn.highcharts=function(){let t=[].slice.call(arguments);if(this[0])return t[0]?(new e[a(t[0])?t.shift():"Chart"](this[0],t[0],t[1]),this):i[m(this[0],"data-highcharts-chart")]}),{addEvent:function(t,i,n,s={}){let o="function"==typeof t&&t.prototype||t;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let r=o.hcEvents;e.Point&&t instanceof e.Point&&t.series&&t.series.chart&&(t.series.chart.runTrackerClick=!0);let a=t.addEventListener;a&&a.call(t,i,n,!!e.supportsPassiveEvents&&{passive:void 0===s.passive?-1!==i.indexOf("touch"):s.passive,capture:!1}),r[i]||(r[i]=[]);let l={fn:n,order:"number"==typeof s.order?s.order:1/0};return r[i].push(l),r[i].sort((e,t)=>e.order-t.order),function(){O(t,i,n)}},arrayMax:function(e){let t=e.length,i=e[0];for(;t--;)e[t]>i&&(i=e[t]);return i},arrayMin:function(e){let t=e.length,i=e[0];for(;t--;)e[t]<i&&(i=e[t]);return i},attr:m,clamp:function(e,t,i){return e>t?e<i?e:i:t},clearTimeout:function(e){p(e)&&clearTimeout(e)},correctFloat:v,createElement:function(e,t,i,s,o){let r=n.createElement(e);return t&&g(r,t),o&&b(r,{padding:"0",border:"none",margin:"0"}),i&&b(r,i),s&&s.appendChild(r),r},crisp:function(e,t=0,i){let n=t%2/2,s=i?-1:1;return(Math.round(e*s-n)+n)*s},css:b,defined:p,destroyObjectProperties:function(e,t,i){T(e,function(n,s){n!==t&&n?.destroy&&n.destroy(),(n?.destroy||!i)&&delete e[s]})},diffObjects:function(e,t,i,n){let s={};return!function e(t,s,o,r){let a=i?s:t;T(t,function(i,h){if(!r&&n&&n.indexOf(h)>-1&&s[h]){i=f(i),o[h]=[];for(let t=0;t<Math.max(i.length,s[h].length);t++)s[h][t]&&(void 0===i[t]?o[h][t]=s[h][t]:(o[h][t]={},e(i[t],s[h][t],o[h][t],r+1)))}else c(i,!0)&&!i.nodeType?(o[h]=l(i)?[]:{},e(i,s[h]||{},o[h],r+1),0===Object.keys(o[h]).length&&("colorAxis"!==h||0!==r)&&delete o[h]):(t[h]!==s[h]||h in t&&!(h in s))&&"__proto__"!==h&&"constructor"!==h&&(o[h]=a[h])})}(e,t,s,0),s},discardElement:function(e){e?.parentElement?.removeChild(e)},erase:function(e,t){let i=e.length;for(;i--;)if(e[i]===t){e.splice(i,1);break}},error:o,extend:g,extendClass:function(e,t){let i=function(){};return i.prototype=new e,g(i.prototype,t),i},find:w,fireEvent:D,getAlignFactor:(e="")=>({center:.5,right:1,middle:.5,bottom:1})[e]||0,getClosestDistance:function(e,t){let i,n,s,o,r=!t;return e.forEach(e=>{if(e.length>1)for(o=n=e.length-1;o>0;o--)(s=e[o]-e[o-1])<0&&!r?(t?.(),t=void 0):s&&(void 0===i||s<i)&&(i=s)}),i},getMagnitude:C,getNestedProperty:function(e,t){let i=e.split(".");for(;i.length&&p(t);){let e=i.shift();if(void 0===e||"__proto__"===e)return;if("this"===e){let e;return c(t)&&(e=t["@this"]),e??t}let n=t[e.replace(/[\\'"]/g,"")];if(!p(n)||"function"==typeof n||"number"==typeof n.nodeType||n===s)return;t=n}return t},getStyle:function e(t,i,n){let o;if("width"===i){let i=Math.min(t.offsetWidth,t.scrollWidth),n=t.getBoundingClientRect?.().width;return n<i&&n>=i-1&&(i=Math.floor(n)),Math.max(0,i-(e(t,"padding-left",!0)||0)-(e(t,"padding-right",!0)||0))}if("height"===i)return Math.max(0,Math.min(t.offsetHeight,t.scrollHeight)-(e(t,"padding-top",!0)||0)-(e(t,"padding-bottom",!0)||0));let a=s.getComputedStyle(t,void 0);return a&&(o=a.getPropertyValue(i),y(n,"opacity"!==i)&&(o=r(o))),o},insertItem:function(e,t){let i,n=e.options.index,s=t.length;for(i=e.options.isInternal?s:0;i<s+1;i++)if(!t[i]||u(n)&&n<y(t[i].options.index,t[i]._i)||t[i].options.isInternal){t.splice(i,0,e);break}return i},isArray:l,isClass:d,isDOMElement:h,isFunction:function(e){return"function"==typeof e},isNumber:u,isObject:c,isString:a,merge:function(e,...t){let i,n=[e,...t],s={},o=function(e,t){return"object"!=typeof e&&(e={}),T(t,function(i,n){"__proto__"!==n&&"constructor"!==n&&(!c(i,!0)||d(i)||h(i)?e[n]=t[n]:e[n]=o(e[n]||{},i))}),e};!0===e&&(s=n[1],n=Array.prototype.slice.call(n,2));let r=n.length;for(i=0;i<r;i++)s=o(s,n[i]);return s},normalizeTickInterval:function(e,t,i,n,s){let o,r=e;i=y(i,C(e));let a=e/i;for(!t&&(t=s?[1,1.2,1.5,2,2.5,3,4,5,6,8,10]:[1,2,2.5,5,10],!1===n&&(1===i?t=t.filter(function(e){return e%1==0}):i<=.1&&(t=[1/i]))),o=0;o<t.length&&(r=t[o],(!s||!(r*i>=e))&&(s||!(a<=(t[o]+(t[o+1]||t[o]))/2)));o++);return v(r*i,-Math.round(Math.log(.001)/Math.LN10))},objectEach:T,offset:function(e){let t=n.documentElement,i=e.parentElement||e.parentNode?e.getBoundingClientRect():{top:0,left:0,width:0,height:0};return{top:i.top+(s.pageYOffset||t.scrollTop)-(t.clientTop||0),left:i.left+(s.pageXOffset||t.scrollLeft)-(t.clientLeft||0),width:i.width,height:i.height}},pad:function(e,t,i){return Array((t||2)+1-String(e).replace("-","").length).join(i||"0")+e},pick:y,pInt:r,pushUnique:function(e,t){return 0>e.indexOf(t)&&!!e.push(t)},relativeLength:function(e,t,i){return/%$/.test(e)?t*parseFloat(e)/100+(i||0):parseFloat(e)},removeEvent:O,replaceNested:function(e,...t){let i,n;do for(n of(i=e,t))e=e.replace(n[0],n[1]);while(e!==i);return e},splat:f,stableSort:function(e,t){let i,n,s=e.length;for(n=0;n<s;n++)e[n].safeI=n;for(e.sort(function(e,n){return 0===(i=t(e,n))?e.safeI-n.safeI:i}),n=0;n<s;n++)delete e[n].safeI},syncTimeout:function(e,t,i){return t>0?setTimeout(e,t,i):(e.call(0,i),-1)},timeUnits:{millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5,week:6048e5,month:24192e5,year:314496e5},ucfirst:function(e){return a(e)?e.substring(0,1).toUpperCase()+e.substring(1):String(e)},uniqueKey:x,useSerialIds:function(e){return t=y(e,t)},wrap:function(e,t,i){let n=e[t];e[t]=function(){let e=arguments,t=this;return i.apply(this,[function(){return n.apply(t,arguments.length?arguments:e)}].concat([].slice.call(arguments)))}}}}),i(t,"Core/Renderer/HTML/AST.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{SVG_NS:i,win:n}=e,{attr:s,createElement:o,css:r,error:a,isFunction:l,isString:c,objectEach:h,splat:d}=t,{trustedTypes:u}=n,p=u&&l(u.createPolicy)&&u.createPolicy("highcharts",{createHTML:e=>e}),m=p?p.createHTML(""):"";class f{static filterUserAttributes(e){return h(e,(t,i)=>{let n=!0;-1===f.allowedAttributes.indexOf(i)&&(n=!1),-1!==["background","dynsrc","href","lowsrc","src"].indexOf(i)&&(n=c(t)&&f.allowedReferences.some(e=>0===t.indexOf(e))),n||(a(33,!1,void 0,{"Invalid attribute in config":`${i}`}),delete e[i]),c(t)&&e[i]&&(e[i]=t.replace(/</g,"&lt;"))}),e}static parseStyle(e){return e.split(";").reduce((e,t)=>{let i=t.split(":").map(e=>e.trim()),n=i.shift();return n&&i.length&&(e[n.replace(/-([a-z])/g,e=>e[1].toUpperCase())]=i.join(":")),e},{})}static setElementHTML(e,t){e.innerHTML=f.emptyHTML,t&&new f(t).addToDOM(e)}constructor(e){this.nodes="string"==typeof e?this.parseMarkup(e):e}addToDOM(t){return function t(n,o){let l;return d(n).forEach(function(n){let c,d=n.tagName,u=n.textContent?e.doc.createTextNode(n.textContent):void 0,p=f.bypassHTMLFiltering;if(d)if("#text"===d)c=u;else if(-1!==f.allowedTags.indexOf(d)||p){let a="svg"===d?i:o.namespaceURI||i,l=e.doc.createElementNS(a,d),m=n.attributes||{};h(n,function(e,t){"tagName"!==t&&"attributes"!==t&&"children"!==t&&"style"!==t&&"textContent"!==t&&(m[t]=e)}),s(l,p?m:f.filterUserAttributes(m)),n.style&&r(l,n.style),u&&l.appendChild(u),t(n.children||[],l),c=l}else a(33,!1,void 0,{"Invalid tagName in config":d});c&&o.appendChild(c),l=c}),l}(this.nodes,t)}parseMarkup(e){let t,i=[];e=e.trim().replace(/ style=(["'])/g," data-style=$1");try{t=new DOMParser().parseFromString(p?p.createHTML(e):e,"text/html")}catch(e){}if(!t){let i=o("div");i.innerHTML=e,t={body:i}}let n=(e,t)=>{let i=e.nodeName.toLowerCase(),s={tagName:i};"#text"===i&&(s.textContent=e.textContent||"");let o=e.attributes;if(o){let e={};[].forEach.call(o,t=>{"data-style"===t.name?s.style=f.parseStyle(t.value):e[t.name]=t.value}),s.attributes=e}if(e.childNodes.length){let t=[];[].forEach.call(e.childNodes,e=>{n(e,t)}),t.length&&(s.children=t)}t.push(s)};return[].forEach.call(t.body.childNodes,e=>n(e,i)),i}}return f.allowedAttributes=["alt","aria-controls","aria-describedby","aria-expanded","aria-haspopup","aria-hidden","aria-label","aria-labelledby","aria-live","aria-pressed","aria-readonly","aria-roledescription","aria-selected","class","clip-path","color","colspan","cx","cy","d","disabled","dx","dy","fill","filterUnits","flood-color","flood-opacity","height","href","id","in","in2","markerHeight","markerWidth","offset","opacity","operator","orient","padding","paddingLeft","paddingRight","patternUnits","r","radius","refX","refY","result","role","rowspan","scope","slope","src","startOffset","stdDeviation","stroke-linecap","stroke-width","stroke","style","summary","tabindex","tableValues","target","text-align","text-anchor","textAnchor","textLength","title","type","valign","width","x","x1","x2","xlink:href","y","y1","y2","zIndex"],f.allowedReferences=["https://","http://","mailto:","/","../","./","#"],f.allowedTags=["#text","a","abbr","b","br","button","caption","circle","clipPath","code","dd","defs","div","dl","dt","em","feComponentTransfer","feComposite","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feMerge","feMergeNode","feMorphology","feOffset","filter","h1","h2","h3","h4","h5","h6","hr","i","img","li","linearGradient","marker","ol","p","path","pattern","pre","rect","small","span","stop","strong","style","sub","sup","svg","table","tbody","td","text","textPath","th","thead","title","tr","tspan","u","ul"],f.emptyHTML=m,f.bypassHTMLFiltering=!1,f}),i(t,"Dashboards/Globals.js",[],function(){var t,i;return(i=t||(t={})).classNamePrefix="highcharts-dashboards-",i.classNames={layout:i.classNamePrefix+"layout",cell:i.classNamePrefix+"cell",cellHover:i.classNamePrefix+"cell-state-hover",cellActive:i.classNamePrefix+"cell-state-active",cellLoading:i.classNamePrefix+"cell-state-loading",row:i.classNamePrefix+"row",layoutsWrapper:i.classNamePrefix+"layouts-wrapper",boardContainer:i.classNamePrefix+"wrapper"},i.guiElementType={row:"row",cell:"cell",layout:"layout"},i.boards=[],i.win=e,i.doc=document,i.noop=function(){},i.isMS=/(edge|msie|trident)/i.test(i.win.navigator&&i.win.navigator.userAgent||"")&&!i.win.opera,i.supportsPassiveEvents=function(){let e=!1;if(!i.isMS){let t=Object.defineProperty({},"passive",{get:function(){e=!0}});i.win.addEventListener&&i.win.removeEventListener&&(i.win.addEventListener("testPassive",i.noop,t),i.win.removeEventListener("testPassive",i.noop,t))}return e}(),t}),i(t,"Dashboards/EditMode/EditGlobals.js",[t["Dashboards/Globals.js"]],function(e){let t=e.classNamePrefix+"edit-";return{classNames:{resizeSnap:t+"resize-snap",resizeSnapX:t+"resize-snap-x",resizeSnapY:t+"resize-snap-y",separator:t+"separator",contextMenuBtn:t+"context-menu-btn",contextMenuBtnText:t+"context-menu-btn-text",contextMenu:t+"context-menu",contextMenuItem:t+"context-menu-item",editModeEnabled:t+"enabled",editToolbar:t+"toolbar",editToolbarCellOutline:t+"toolbar-cell-outline",editToolbarRowOutline:t+"toolbar-row-outline",editToolbarItem:t+"toolbar-item",editToolbarRow:t+"toolbar-row",editToolbarCell:t+"toolbar-cell",editSidebar:t+"sidebar",editSidebarShow:t+"sidebar-show",editSidebarHide:t+"sidebar-hide",editSidebarHeader:t+"sidebar-header",editSidebarTitle:t+"sidebar-title",editSidebarMenuItem:t+"sidebar-item",rowContextHighlight:t+"row-context-highlight",cellEditHighlight:t+"cell-highlight",dashboardCellEditHighlightActive:t+"cell-highlight-active",dragMock:t+"drag-mock",dropPointer:t+"drop-pointer",contextDetectionPointer:t+"ctx-detection-pointer",resizePointer:t+"resize-pointer",currentEditedElement:t+"unmask",maskElement:t+"mask",menuItem:t+"menu-item",menu:t+"menu",menuVerticalSeparator:t+"menu-vertical-separator",menuHorizontalSeparator:t+"menu-horizontal-separator",menuDestroy:t+"menu-destroy",editSidebarWrapper:t+"sidebar-wrapper",customSelect:t+"custom-select",customSelectButton:t+"custom-option-button",toggleContainer:t+"toggle-container",toggleWrapper:t+"toggle-wrapper",toggleSlider:t+"toggle-slider",toggleWrapperColored:t+"toggle-wrapper-colored",toggleLabels:t+"toggle-labels",labeledToggleWrapper:t+"labeled-toggle-wrapper",button:t+"button",sidebarNavButton:t+"sidebar-button-nav",labelText:t+"label-text",editSidebarTabBtn:t+"sidebar-tab-btn",editToolsBtn:t+"tools-btn",editTools:t+"tools",editGridItems:t+"grid-items",confirmationPopup:t+"confirmation-popup",popupButtonContainer:t+"confirmation-popup-button-container",popupContentContainer:t+"confirmation-popup-content",popupCancelBtn:t+"confirmation-popup-cancel-btn",popupConfirmBtn:t+"confirmation-popup-confirm-btn",popupCloseButton:t+"popup-close",editOverlay:t+"overlay",editOverlayActive:t+"overlay-active",resizerMenuBtnActive:t+"resizer-menu-btn-active",sidebarCloseButton:t+"close-btn",editSidebarTabBtnWrapper:t+"tabs-buttons-wrapper",editSidebarRight:t+"sidebar-right",editSidebarRightShow:t+"sidebar-right-show",viewFullscreen:t+"view-fullscreen",accordionMenu:t+"accordion-menu",accordionContainer:t+"accordion",accordionHeader:t+"accordion-header",accordionHeaderBtn:t+"accordion-header-btn",accordionHeaderWrapper:t+"accordion-header-wrapper",accordionHeaderIcon:t+"accordion-header-icon",accordionContent:t+"accordion-content",accordionNestedWrapper:t+"accordion-nested",accordionMenuButtonsContainer:t+"accordion-menu-buttons-container",accordionMenuButton:t+"accordion-menu-button",accordionStandaloneWrapper:t+"accordion-standalone-wrapper",hiddenElement:t+"hidden-element",collapsableContentHeader:t+"collapsable-content-header",standaloneElement:t+"standalone-element",collapsedElement:t+"collapsed-element",dropdown:t+"dropdown",dropdownContent:t+"dropdown-content",dropdownButton:t+"dropdown-button",dropdownButtonContent:t+"dropdown-button-content",dropdownIcon:t+"pointer",icon:t+"icon"},lang:{accessibility:{contextMenu:{button:"Context menu"},editMode:{editMode:"Edit mode toggle button"}},addComponent:"Add component",cancelButton:"Cancel",caption:"Caption",chartClassName:"Chart class name",chartConfig:"Chart configuration",chartID:"Chart ID",chartOptions:"Chart options",chartType:"Chart type",connectorName:"Connector name",confirmButton:"Confirm",confirmDestroyCell:"Do you really want to destroy the cell?",confirmDestroyRow:"Do you really want to destroy the row?",confirmDiscardChanges:"Do you really want to discard the changes?",dataLabels:"Data labels",editMode:"Edit mode",errorMessage:"Something went wrong",exitFullscreen:"Exit full screen",htmlInput:"HTML",id:"Id",off:"off",on:"on",pointFormat:"Point format",settings:"Settings",style:"Styles",title:"Title",viewFullscreen:"View in full screen",sidebar:{HTML:"HTML",row:"Row",Highcharts:"Highcharts",DataGrid:"DataGrid",KPI:"KPI"}}}}),i(t,"Dashboards/Layout/GUIElement.js",[t["Dashboards/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{addEvent:i,createElement:n,uniqueKey:s,objectEach:o,error:r}=t;return class{static getOffsets(e,t){let i={left:0,top:0,right:0,bottom:0};if(!e.container)return i;let n=e.container.getBoundingClientRect(),s=t?t.getBoundingClientRect():{left:0,top:0};return i.left=n.left-s.left,i.top=n.top-s.top,i.right=n.right-s.left,i.bottom=n.bottom-s.top,i}static getDimFromOffsets(e){return{width:e.right-e.left,height:e.bottom-e.top}}static getElementId(t){return e.classNamePrefix+t+"-"+s().slice(11)}static getPercentageWidth(e){let t,i=/^(\d{1})[\-\/\.](\d{1,2})$/;if(i.test(e)){let n=e.match(i)||[];t=((t=100*n[1]/n[2])<=100?t:100)+"%"}else if(-1!==e.indexOf("%")){let i=parseFloat(e);t=(i<=100?i>=0?i:0:100)+"%"}return t}getElementContainer(e){let t,s=this;if(e.render)e.attribs&&!e.attribs.id&&delete e.attribs.id;else if("string"==typeof e.elementId){let t=document.getElementById(e.elementId);t?s.container=t:r("Element "+e.elementId+" does not exist")}return s.removeBindedEventFn=i(t=e.element instanceof HTMLElement?e.element:n("div",e.attribs||{},e.style||{},e.parentContainer),"bindedGUIElement",function(e){e.guiElement=s,e.stopImmediatePropagation()}),t}destroy(){let e=this;e.removeBindedEventFn&&e.removeBindedEventFn(),e.container&&e.container.parentNode&&e.container.parentNode.removeChild(e.container),o(e,function(t,i){delete e[i]})}getType(){return this.type}changeVisibility(e=!0,t){let i=this.isVisible&&!e||!this.isVisible&&e;this.container&&i&&(this.container.style.display=e?t||"block":"none",this.isVisible=e)}hide(){this.changeVisibility(!1)}show(){this.changeVisibility()}}}),i(t,"Dashboards/Layout/Cell.js",[t["Dashboards/EditMode/EditGlobals.js"],t["Dashboards/Globals.js"],t["Dashboards/Layout/GUIElement.js"],t["Core/Utilities.js"]],function(e,t,i,n){var s;let{merge:o,fireEvent:r}=n;class a extends i{constructor(e,i,n){let s;super(),this.type=t.guiElementType.cell,this.id=i.id,this.options=i,this.row=e,this.isVisible=!0;let r=document.getElementById(i.parentContainerId||"")||e.container,a=e.layout.options||{},l=e.options||{},c=a.cellClassName||"";i.height&&(s="number"==typeof i.height?i.height+"px":i.height),this.container=this.getElementContainer({render:e.layout.board.guiEnabled,parentContainer:r,attribs:{id:i.id,className:t.classNames.cell+" "+c},element:n,elementId:i.id,style:o(a.style,l.style,i.style,{height:s})}),this.options.layout&&this.setNestedLayout()}setNestedLayout(){let e=this.row.layout.board,t=this.row.layout.constructor,i=e.options.gui;this.nestedLayout=new t(e,o({},i&&i.layoutOptions,this.options.layout,{parentContainerId:this.options.id}),this)}destroy(){let{row:e}=this;this.mountedComponent?.destroy(),this.nestedLayout?.destroy(),e.unmountCell(this);let t=e.cells?.length===0;super.destroy(),t&&e.destroy()}getOptions(){return this.options}changeVisibility(e=!0){super.changeVisibility(e);let t=this,i=t.row;t.row.getVisibleCells().length?t.isVisible&&!i.isVisible&&t.row.show():t.row.hide(),setTimeout(()=>{r(i,"cellChange",{row:i,cell:t})},0)}getParentCell(e){let t;if(e<=this.row.layout.level){if(this.row.layout.level===e)return this;if(this.row.layout.level-1>=0&&(t=this.row.layout.parentCell))return t.getParentCell(e)}}getOverlappingLevels(e,t,n){let s=this.row.layout.parentCell,o=[this.row.layout.level];if(s){let r=n||i.getOffsets(this)[e],a=i.getOffsets(s)[e];Math.abs(r-a)<t&&(o=[...o,...s.getOverlappingLevels(e,t,a)])}return o}setSize(e,t){let i=this.row.layout.board.editMode;if(this.container){if(e)if("auto"===e&&"1 1 0%"!==this.container.style.flex)this.container.style.flex="1 1 0%";else{let t=this.convertWidthToValue(e);t&&this.container.style.flex!=="0 0 "+t&&(this.container.style.flex="0 0 "+t),this.options.width=t}t&&(this.options.height=this.container.style.height=t+"px"),i&&(i.hideContextPointer(),i.cellToolbar&&i.cellToolbar.isVisible&&(i.cellToolbar.cell===this?i.cellToolbar.showToolbar(this):i.cellToolbar.hide())),r(this.row.layout.board,"cellResize",{cell:this}),r(this.row,"cellChange",{cell:this,row:this.row})}}setHighlight(t){let i=this.row?.layout.board.editMode;if(this.container&&i){let i=this.container,n=i.classList.contains(e.classNames.cellEditHighlight);t||n?t&&n&&(i.classList.remove(e.classNames.cellEditHighlight),this.row.layout.board.container.classList.remove(e.classNames.dashboardCellEditHighlightActive),this.isHighlighted=!1):(i.classList.add(e.classNames.cellEditHighlight),this.row.layout.board.container.classList.add(e.classNames.dashboardCellEditHighlightActive),this.isHighlighted=!0)}}setActiveState(){this.row.layout.board.mountedComponents.forEach(e=>{e.cell.container&&e.cell.container.classList.remove(t.classNames.cellActive),e.component.isActive=!1}),this.container&&this.container.classList.add(t.classNames.cellActive)}setLoadingState(e=!0){this.container?.classList?.toggle(t.classNames.cellLoading,e)}convertWidthToValue(e){return"number"==typeof e?e+"px":/px/.test(e)?e:i.getPercentageWidth(e)||""}}return(s=a||(a={})).isCell=function(e){return e instanceof s},a}),i(t,"Dashboards/CallbackRegistry.js",[],function(){return class{constructor(){this.registry={}}addCallback(e,t){this.registry[e]=t}getCallback(e){return this.registry[e]}toJSON(){let e={};return Object.keys(this.registry).forEach(t=>{let{func:i,type:n}=this.getCallback(t);e[t]={func:i.toString(),type:n}}),e}}}),i(t,"Dashboards/Components/ConnectorHandler.js",[t["Dashboards/Layout/Cell.js"],t["Dashboards/Globals.js"]],function(e,t){return class{constructor(e,t){this.tableEvents=[],this.component=e,this.options=t}async initConnector(){let t=this.component,i=this.options.id,n=this.component.board.dataPool;if(i&&(this.connectorId!==i||n.isNewConnector(i))){e.isCell(t.cell)&&t.cell.setLoadingState();let s=await n.getConnector(i);this.destroyed||this.setConnector(s)}return t}setTable(e){this.clearTableListeners(e),this.setupTableListeners(e),e.on("setModifier",()=>this.clearTableListeners(e)),e.on("afterSetModifier",e=>{"afterSetModifier"===e.type&&e.modified&&(this.setupTableListeners(e.modified),this.component.emit({type:"tableChanged",connector:this.connector}))}),this.presentationModifier?this.presentationTable=this.presentationModifier.modifyTable(e.modified.clone()).modified:this.presentationTable=e}setConnector(e){for(;this.tableEvents.length;){let e=this.tableEvents.pop();"function"==typeof e&&e()}if(this.connector=e,e){let t=this.component.dataTableKey,i=e.dataTables;t?this.setTable(i[t]):this.setTable(Object.values(i)[0])}return this.addConnectorAssignment(),this.component}setupTableListeners(e){let i=this.connector;i&&e&&["afterDeleteRows","afterSetCell","afterSetColumns","afterSetRows"].forEach(n=>{this.tableEvents.push(e.on(n,e=>{clearTimeout(this.tableEventTimeout),this.tableEventTimeout=t.win.setTimeout(()=>{this.component.emit({...e,type:"tableChanged",targetConnector:i}),this.tableEventTimeout=void 0})}))})}clearTableListeners(e){let i=this.connector,n=this.tableEvents;this.removeTableEvents(),i&&n.push(e.on("afterSetModifier",e=>{"afterSetModifier"===e.type&&(clearTimeout(this.tableEventTimeout),this.tableEventTimeout=t.win.setTimeout(()=>{i.emit({...e,type:"tableChanged",targetConnector:i}),this.tableEventTimeout=void 0}))}))}addConnectorAssignment(){let{connector:e}=this;if(e&&(e.components||(e.components=[]),!e.components.includes(this.component))){let t=e.options;e.components.push(this.component),"enablePolling"in t&&t.enablePolling&&!e.polling&&1===e.components.length&&"dataRefreshRate"in t&&e.startPolling(1e3*Math.max(t.dataRefreshRate||0,1))}}removeConnectorAssignment(){let{connector:e}=this;if(!e?.components)return;let t=e.components.indexOf(this.component);t>-1&&(e.components.splice(t,1),e.components.length||(e.stopPolling(),delete e.components))}removeTableEvents(){this.tableEvents.forEach(e=>e()),this.tableEvents.length=0}updateOptions(e){this.options=e}destroy(){this.destroyed=!0,this.removeConnectorAssignment(),this.removeTableEvents()}}}),i(t,"Dashboards/Components/EditableOptions.js",[],function(){class e{constructor(t,i=e.defaultBindings){this.component=t,this.bindings=i}getOptions(){let e=this.component.options.editableOptions;if(!e)return[];for(let t=0,i=e.length;t<i;t++){let i=e[t];if(i.propertyPath?.some(e=>"connector"===e)){let e=this.component.board;i.selectOptions=e?e.dataPool.getConnectorIds().map(e=>({name:e})):[]}}return e}}return e.defaultBindings={keyMap:{color:"colorPicker",title:"text",caption:"text",style:"textarea"},typeMap:{string:"text",number:"input",boolean:"toggle"},skipRedraw:[]},e.defaultTypeMap={string:"text",number:"input",boolean:"toggle"},e}),i(t,"Dashboards/Components/Sync/Emitter.js",[],function(){class e{static register(e){let{id:t}=e;this.registry[t]=e}static get(e){return this.registry[e]}constructor(t,i){this.id=t,this.func=i,e.register(this)}create(e){this.callback=this.func.call(e)}remove(){this.callback&&this.callback()}}return e.registry={},e}),i(t,"Dashboards/Components/Sync/Handler.js",[],function(){class e{static register(e){let{id:t}=e;this.registry[t]=e}static get(e){return this.registry[e]}constructor(t,i){this.id=t,this.func=i,e.register(this)}register(e){let{func:t}=this;this.callback=t.call(e)}remove(){this.callback&&this.callback()}}return e.registry={},e}),i(t,"Dashboards/Components/Sync/Sync.js",[t["Dashboards/Components/Sync/Emitter.js"],t["Dashboards/Components/Sync/Handler.js"],t["Core/Utilities.js"]],function(e,t,i){let{merge:n,isObject:s}=i;class o{constructor(e,t){this.component=e,this.predefinedSyncConfig=t,this.syncConfig=o.prepareSyncConfig(t,e.options.sync),this.registeredSyncHandlers={},this.registeredSyncEmitters={},this.isSyncing=!1,this.listeners=[]}static prepareSyncConfig(e,t={}){let{defaultSyncPairs:i,defaultSyncOptions:o}=e;return Object.keys(t).reduce((e,r)=>{if(r){let a=i[r],l=o[r],c=t[r],h=n(l||{},{enabled:s(c)?c.enabled:c},s(c)?c:{});if(a&&h.enabled)for(let e of["emitter","handler"])(!0===h[e]||void 0===h[e])&&(h[e]=a[e]);e[r]=h}return e},{})}registerSyncEmitter(e){let{id:t}=e;this.registeredSyncEmitters[t]=e}isRegisteredEmitter(e){return!!this.registeredSyncEmitters[e]}registerSyncHandler(e){let{id:t}=e;this.registeredSyncHandlers[t]=e}isRegisteredHandler(e){return!!this.registeredSyncHandlers[e]}start(){let{component:i}=this;for(let n of(this.syncConfig=o.prepareSyncConfig(this.predefinedSyncConfig,i.options.sync),Object.keys(this.syncConfig))){let s=this.syncConfig[n];if(!s)continue;let{emitter:r,handler:a}=s;if(a){!0===a&&(a=o.defaultHandlers[n].handler);let e=new t(n,a);this.isRegisteredHandler(e.id)||(this.registerSyncHandler(e),e.register(i))}if(r){!0===r&&(r=o.defaultHandlers[n].emitter);let t=new e(n,r);this.isRegisteredEmitter(t.id)||(this.registerSyncEmitter(t),t.create(i))}}this.isSyncing=!0,this.listeners.push(i.on("update",()=>this.stop()))}stop(){let{component:e,listeners:t,registeredSyncHandlers:i,registeredSyncEmitters:n}=this;Object.keys(i).forEach(e=>{i[e].remove(),delete i[e]}),Object.keys(n).forEach(e=>{n[e].remove(),delete n[e]}),this.isSyncing=!1;for(let e=0,i=t.length;e<i;++e)t[e]();this.listeners.length=0,this.listeners.push(e.on("afterUpdate",()=>{this.start()}))}}return o.defaultHandlers={},o}),i(t,"Dashboards/Components/ComponentUtilities.js",[],function(){var t,i=t||(t={});function n(t,i){let n=e.getComputedStyle(t);return i.map(e=>n[e])}function s(e,t){return t&&(e+="number"==typeof t?t:parseFloat(t)),e}return i.getMargins=function(e,t=!0){let i={x:["borderLeft","borderRight"],y:["borderTop","borderBottom"]};return{y:n(e,["marginTop","marginBottom",...t?i.y:[]]).reduce(s,0),x:n(e,["marginLeft","marginTop",...t?i.x:[]]).reduce(s,0)}},i.getPaddings=function(e){return{x:n(e,["paddingLeft","paddingRight"]).reduce(s,0),y:n(e,["paddingTop","paddingBottom"]).reduce(s,0)}},i.getStyles=n,i.sumPixels=s,t}),i(t,"Dashboards/Utilities.js",[t["Dashboards/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{doc:i,supportsPassiveEvents:n}=e,{error:s,isClass:o,isDOMElement:r,isObject:a,objectEach:l,uniqueKey:c}=t;function h(e,t){let i;for(i in e||(e={}),t)e[i]=t[i];return e}function d(e,t,i){function n(t,i){let n=e.removeEventListener;n&&n.call(e,t,i,!1)}function s(i){let s,o;e.nodeName&&(t?(s={})[t]=!0:s=i,l(s,function(e,t){if(i[t])for(o=i[t].length;o--;)n(t,i[t][o].fn)}))}let o="function"==typeof e&&e.prototype||e;if(Object.hasOwnProperty.call(o,"hcEvents")){let e=o.hcEvents;if(t){let o=e[t]||[];i?(e[t]=o.filter(function(e){return i!==e.fn}),n(t,i)):(s(e),e[t]=[])}else s(e),delete o.hcEvents}}return{addEvent:function(e,t,i,s={}){let o="function"==typeof e&&e.prototype||e;Object.hasOwnProperty.call(o,"hcEvents")||(o.hcEvents={});let r=o.hcEvents,a=e.addEventListener;a&&a.call(e,t,i,!!n&&{passive:void 0===s.passive?-1!==t.indexOf("touch"):s.passive,capture:!1}),r[t]||(r[t]=[]);let l={fn:i,order:"number"==typeof s.order?s.order:1/0};return r[t].push(l),r[t].sort((e,t)=>e.order-t.order),function(){d(e,t,i)}},deepClone:function e(t,i){if(Array.isArray(t))return t.map(t=>e(t,i));if(t&&"object"==typeof t){let n={};for(let s of Object.keys(t))i&&i.includes(s)?n[s]=t[s]:n[s]=e(t[s],i);return n}return t},error:function(e,t){if(16===e)return void console.warn("Dashboard error: Dashboards library loaded more than once.This may cause undefined behavior.");s(e,t)},fireEvent:function(t,n,s,o){if(s=s||{},i?.createEvent&&(t.dispatchEvent||t.fireEvent&&t!==e)){let e=i.createEvent("Events");e.initEvent(n,!0,!0),s=h(e,s),t.dispatchEvent?t.dispatchEvent(s):t.fireEvent(n,s)}else if(t.hcEvents){s.target||h(s,{preventDefault:function(){s.defaultPrevented=!0},target:t,type:n});let e=[],i=t,o=!1;for(;i.hcEvents;)Object.hasOwnProperty.call(i,"hcEvents")&&i.hcEvents[n]&&(e.length&&(o=!0),e.unshift.apply(e,i.hcEvents[n])),i=Object.getPrototypeOf(i);o&&e.sort((e,t)=>e.order-t.order),e.forEach(e=>{!1===e.fn.call(t,s)&&s.preventDefault()})}o&&!s.defaultPrevented&&o.call(t,s)},merge:function(e,...t){let i=0,n={},s=Error("Recursive copy depth > 100"),c=(e,t)=>{if("object"!=typeof e&&(e={}),++i>100)throw s;return l(t,(i,n)=>{"__proto__"!==n&&"constructor"!==n&&(!a(i,!0)||o(i)||r(i)?e[n]=t[n]:e[n]=c(e[n]||{},i))}),--i,e};!0===e?n=t.shift():t.unshift(e);for(let e=0,i=t.length;e<i;++e)n=c(n,t[e]);return n},removeEvent:d,uniqueKey:function(){return`dashboard-${c().replace("highcharts-","")}`}}}),i(t,"Dashboards/Components/Component.js",[t["Dashboards/Layout/Cell.js"],t["Dashboards/CallbackRegistry.js"],t["Dashboards/Components/ConnectorHandler.js"],t["Dashboards/Components/EditableOptions.js"],t["Dashboards/Components/Sync/Sync.js"],t["Dashboards/Globals.js"],t["Core/Utilities.js"],t["Dashboards/Components/ComponentUtilities.js"],t["Dashboards/Utilities.js"]],function(t,i,n,s,o,r,a,l,c){let{classNamePrefix:h}=r,{createElement:d,isArray:u,merge:p,fireEvent:m,addEvent:f,objectEach:g,isFunction:y,getStyle:b,diffObjects:C,removeEvent:v}=a,{getMargins:w,getPaddings:T}=l,{deepClone:O,uniqueKey:D}=c;class x{static createTextElement(e,t,i){if("object"==typeof i){let{className:n,text:s,style:o}=i;return d(e,{className:n||`${h}component-${t}`,textContent:s},o)}if("string"==typeof i)return d(e,{className:`${h}component-${t}`,textContent:i},{})}constructor(e,r,a){this.connectorHandlers=[],this.callbackRegistry=new i,this.cellListeners=[],this.resizeTimeouts=[],this.innerResizeTimeouts=[];let l=r.renderTo||r.cell;if(this.board=a||e?.row?.layout?.board||{},this.parentElement=e?.container||document.querySelector("#"+l),this.cell=e,this.options=p(x.defaultOptions,r),this.id=this.options.id&&this.options.id.length?this.options.id:D(),this.options.connector){for(let e of u(this.options.connector)?this.options.connector:[this.options.connector])this.connectorHandlers.push(new n(this,e));this.dataTableKey=u(this.options.connector)?this.options.connector[0].dataTableKey:this.options.connector.dataTableKey}this.editableOptions=new s(this,r.editableOptionsBindings),this.dimensions={width:null,height:null},this.element=d("div",{className:this.options.className},{},this.parentElement),Number(b(this.element,"padding"))||(this.element.style.padding="0.1px"),this.contentElement=d("div",{className:`${this.options.className}-content`},{},this.element,!0),this.sync=new o(this,this.constructor.predefinedSyncConfig),this.setupEventListeners(),e&&(this.attachCellListeners(),this.on("update",()=>{t.isCell(this.cell)&&this.cell.setLoadingState()}),this.on("afterRender",()=>{t.isCell(this.cell)&&this.cell.setLoadingState(!1)})),this.on("tableChanged",()=>{this.onTableChanged()})}getOptionsOnDrop(e){return{}}getFirstConnector(){return this.connectorHandlers[0]?.connector}attachCellListeners(){for(;this.cellListeners.length;){let e=this.cellListeners.pop();e&&e()}if(this.cell&&t.isCell(this.cell)&&Object.keys(this.cell).length){let e=this.cell.row.layout.board;this.cellListeners.push(f(e,"cellResize",()=>{this.resizeTo(this.parentElement)}),f(this.cell.row,"cellChange",e=>{let{row:t}=e;t&&this.cell&&void 0===t.getCellIndex(this.cell)&&this.cell&&this.setCell(this.cell)}))}}setCell(e,t=!1){this.cell=e,e.container&&(this.parentElement=e.container),this.attachCellListeners(),t&&this.resizeTo(this.parentElement)}async initConnectors(){for(let e of(m(this,"setConnectors",{connectorHandlers:this.connectorHandlers}),this.connectorHandlers))await e.initConnector();return m(this,"afterSetConnectors",{connectorHandlers:this.connectorHandlers}),this}getContentHeight(){return(this.titleElement?this.titleElement.clientHeight+w(this.titleElement).y:0)+(this.captionElement?this.captionElement.clientHeight+w(this.captionElement).y:0)}resize(e,t){if(t){let e=T(this.element).y+w(this.element).y;this.element.style.height="calc(100% - "+e+"px)",this.contentElement.style.height="calc(100% - "+this.getContentHeight()+"px)"}else null===t&&(this.dimensions.height=null,this.element.style.removeProperty("height"));m(this,"resize",{width:e,height:t})}resizeDynamicContent(e,t){let{element:i}=this;if(t){let e=w(i).y,n=T(i).y;"string"==typeof t&&(t=parseFloat(t)),t=Math.round(t),i.style.height=`${t-e-n}px`,this.contentElement.style.height=`${i.clientHeight-this.getContentHeight()-n}px`}else null===t&&(this.dimensions.height=null,i.style.removeProperty("height"));m(this,"resize",{width:e,height:t})}resizeTo(e){for(;this.resizeTimeouts.length;){let e=this.resizeTimeouts.pop();e&&cancelAnimationFrame(e)}let t=requestAnimationFrame(()=>{let{width:t,height:i}=e.getBoundingClientRect(),n=T(e),s=w(e);this.resize(t-n.x-s.x,i-n.y-s.y)});this.resizeTimeouts.push(t)}async update(e,t=!0){let i={options:e,shouldForceRerender:!1};m(this,"update",i),e.connector&&Array.isArray(this.options.connector)&&(this.options.connector=void 0),this.options=p(this.options,e);let s=this.options.connector?u(this.options.connector)?this.options.connector:[this.options.connector]:[],o=s.length!==this.connectorHandlers.length;if(!o)for(let e=0,t=s.length;e<t;e++){if(this.connectorHandlers[e]?.options.id!==s[e]?.id){o=!0;break}this.connectorHandlers[e].updateOptions(s[e])}if(o){for(let e of this.connectorHandlers)e.destroy();for(let e of(this.connectorHandlers.length=0,s))this.connectorHandlers.push(new n(this,e));await this.initConnectors()}let r=s[0]?.dataTableKey;r&&(this.dataTableKey=r),(t||i.shouldForceRerender)&&this.render()}setupEventListeners(){let t=this.options.events;t&&(Object.keys(t).forEach(e=>{let i=t[e];i&&this.callbackRegistry.addCallback(e,{type:"component",func:i})}),g(t,(e,t)=>{y(e)&&this.on(t,e)}));let i=()=>{this.resizeTo(this.parentElement)};if("function"==typeof ResizeObserver)this.resizeObserver=new ResizeObserver(i),this.resizeObserver.observe(this.element);else{let t=f(e,"resize",i);f(this,"destroy",t)}}setTitle(e){let t=this.titleElement;if(e&&("string"==typeof e||e.text)){let i=x.createTextElement("h2","title",e);i&&(t?t.replaceWith(i):this.element.insertBefore(i,this.element.firstChild),this.titleElement=i)}else if(t){t.remove(),delete this.titleElement;return}}setCaption(e){let t=this.captionElement;if(e&&("string"==typeof e||e.text)){let i=x.createTextElement("div","caption",e);i&&(t?t.replaceWith(i):this.element.appendChild(i),this.captionElement=i)}else if(t){t.remove(),delete this.captionElement;return}}async load(){return await this.initConnectors(),this.render(),this}render(){return this.emit({type:"render"}),this.setTitle(this.options.title),this.setCaption(this.options.caption),this.resizeTo(this.parentElement),this}destroy(){for(this.sync.isSyncing&&this.sync.stop();this.element.firstChild;)this.element.firstChild.remove();for(let e of(m(this,"unmount"),this.connectorHandlers))e.destroy();v(this),this.element.remove()}on(e,t){return f(this,e,t)}emit(e){e.target||(e.target=this),m(this,e.type,e)}getOptions(){return C(this.options,x.defaultOptions)}getEditableOptions(){return O(this.options,["dataTable","points","series","data","editableOptions"])}getEditableOptionValue(e){if(!e)return;let t=this.getEditableOptions();for(let i=0,n=e.length;i<n;i++){if(u(t)&&"connector"===e[0]&&t.length>1)return"multiple connectors";if(!t)return;!1===(t=t[e[i]])&&(e.indexOf("title")>=0||e.indexOf("subtitle")>=0||e.indexOf("caption")>=0)&&(t="")}return t}}return x.Sync=o,x.predefinedSyncConfig={defaultSyncOptions:{},defaultSyncPairs:{}},x.defaultOptions={className:`${h}component`,id:"",title:!1,caption:!1,sync:o.defaultHandlers,editableOptions:[{name:"title",propertyPath:["title"],type:"input"},{name:"caption",propertyPath:["caption"],type:"input"}]},x}),i(t,"Dashboards/Components/HTMLComponent/HTMLComponentDefaults.js",[t["Dashboards/Components/Component.js"]],function(e){return{type:"HTML",className:[e.defaultOptions.className,`${e.defaultOptions.className}-html`].join(" "),elements:[],editableOptions:[...e.defaultOptions.editableOptions||[],{name:"htmlInput",propertyPath:["html"],type:"textarea"}]}}),i(t,"Dashboards/Components/HTMLComponent/HTMLSyncs/HTMLSyncs.js",[],function(){return{defaultSyncPairs:{},defaultSyncOptions:{}}}),i(t,"Dashboards/Components/HTMLComponent/HTMLComponent.js",[t["Core/Renderer/HTML/AST.js"],t["Dashboards/Components/Component.js"],t["Dashboards/Components/HTMLComponent/HTMLComponentDefaults.js"],t["Dashboards/Components/HTMLComponent/HTMLSyncs/HTMLSyncs.js"],t["Dashboards/Utilities.js"],t["Core/Utilities.js"]],function(e,t,i,n,s,o){let{merge:r,diffObjects:a}=o,{deepClone:l}=s;e.allowedTags=[...e.allowedTags,"option","select","label","input","textarea"],e.allowedAttributes=[...e.allowedAttributes,"for","value","checked","src","name","selected"],e.allowedReferences=[...e.allowedReferences,"data:image/"];class c extends t{constructor(e,t){t.className&&(t.className=`${c.defaultOptions.className} ${t.className}`),super(e,t=r(c.defaultOptions,t)),this.options=t,this.type="HTML",this.elements=[]}async load(){this.emit({type:"load"}),await super.load();let t=this.options,i=!1;if(t.elements?.length?this.elements=t.elements.map(function(t){return"string"==typeof t?new e(t).nodes[0]:(t.textContent||t.tagName||!t.attributes||(i=!0),t)}):t.html&&(this.elements=this.getElementsFromString(t.html),this.options.elements=this.elements),this.constructTree(),this.emit({type:"afterLoad"}),i)throw Error(`Missing tagName param in component: ${t.renderTo}`);return this}render(){return super.render(),this.constructTree(),this.sync.start(),this.emit({type:"afterRender"}),this}resize(e,t){return super.resize(e,t),this}async update(e,t=!0){e.html?(this.elements=this.getElementsFromString(e.html),this.options.elements=this.elements,this.constructTree()):e.elements&&(this.elements=e.elements),await super.update(e,t),this.emit({type:"afterUpdate"})}getOptionsOnDrop(){return{cell:"",type:"HTML",elements:[{tagName:"span",textContent:"[Your custom HTML here- edit the component]"}]}}constructTree(){for(;this.contentElement.firstChild;)this.contentElement.firstChild.remove();new e(this.options.elements||[]).addToDOM(this.contentElement)}getElementsFromString(t){return new e(t).nodes}getOptions(){return{...a(this.options,c.defaultOptions),type:"HTML"}}getEditableOptions(){return l(this.options,["editableOptions"])}getEditableOptionValue(e){if(e){if("html"===e[0]){let t=this.getEditableOptions();return!t.html&&t.elements?this.getStringFromElements(t.elements):t[e[0]]}return super.getEditableOptionValue(e)}}getStringFromElements(e){let t="";for(let i of e)t+=this.serializeNode(i);return t}serializeNode(e){if(!e.tagName||"#text"===e.tagName)return e.textContent||"";let t=e.attributes,i=`<${e.tagName}`;if(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];void 0!==n&&(i+=` ${e}="${n}"`)}}return i+=">",i+=e.textContent||"",(e.children||[]).forEach(e=>{i+=this.serializeNode(e)}),i+=`</${e.tagName}>`}onTableChanged(e){e.detail?.sender!==this.id&&this.render()}}return c.defaultOptions=r(t.defaultOptions,i),c.predefinedSyncConfig=n,c}),i(t,"Data/ColumnUtils.js",[],function(){var e,t;return(t=e||(e={})).setLength=function(e,t,i){return Array.isArray(e)?(e.length=t,e):e[i?"subarray":"slice"](0,t)},t.splice=function(e,t,i,n,s=[]){if(Array.isArray(e))return Array.isArray(s)||(s=Array.from(s)),{removed:e.splice(t,i,...s),array:e};let o=Object.getPrototypeOf(e).constructor,r=e[n?"subarray":"slice"](t,t+i),a=new o(e.length-i+s.length);return a.set(e.subarray(0,t),0),a.set(s,t),a.set(e.subarray(t+i),t+s.length),{removed:r,array:a}},e}),i(t,"Data/DataTableCore.js",[t["Data/ColumnUtils.js"],t["Core/Utilities.js"]],function(e,t){let{setLength:i,splice:n}=e,{fireEvent:s,objectEach:o,uniqueKey:r}=t;return class{constructor(e={}){this.autoId=!e.id,this.columns={},this.id=e.id||r(),this.modified=this,this.rowCount=0,this.versionTag=r();let t=0;o(e.columns||{},(e,i)=>{this.columns[i]=e.slice(),t=Math.max(t,e.length)}),this.applyRowCount(t)}applyRowCount(e){this.rowCount=e,o(this.columns,(t,n)=>{t.length!==e&&(this.columns[n]=i(t,e))})}deleteRows(e,t=1){if(t>0&&e<this.rowCount){let i=0;o(this.columns,(s,o)=>{this.columns[o]=n(s,e,t).array,i=s.length}),this.rowCount=i}s(this,"afterDeleteRows",{rowIndex:e,rowCount:t}),this.versionTag=r()}getColumn(e,t){return this.columns[e]}getColumns(e,t){return(e||Object.keys(this.columns)).reduce((e,t)=>(e[t]=this.columns[t],e),{})}getRow(e,t){return(t||Object.keys(this.columns)).map(t=>this.columns[t]?.[e])}setColumn(e,t=[],i=0,n){this.setColumns({[e]:t},i,n)}setColumns(e,t,i){let n=this.rowCount;o(e,(e,t)=>{this.columns[t]=e.slice(),n=e.length}),this.applyRowCount(n),i?.silent||(s(this,"afterSetColumns"),this.versionTag=r())}setRow(e,t=this.rowCount,i,a){let{columns:l}=this,c=i?this.rowCount+1:t+1;o(e,(e,s)=>{let o=l[s]||a?.addColumns!==!1&&Array(c);o&&(i?o=n(o,t,0,!0,[e]).array:o[t]=e,l[s]=o)}),c>this.rowCount&&this.applyRowCount(c),a?.silent||(s(this,"afterSetRows"),this.versionTag=r())}}}),i(t,"Data/DataTable.js",[t["Data/ColumnUtils.js"],t["Data/DataTableCore.js"],t["Core/Utilities.js"]],function(e,t,i){let{addEvent:n,defined:s,extend:o,fireEvent:r,isNumber:a,uniqueKey:l}=i;class c extends t{static isNull(e){if(e===c.NULL)return!0;if(e instanceof Array){if(!e.length)return!1;for(let t=0,i=e.length;t<i;++t)if(null!==e[t])return!1}else{let t=Object.keys(e);if(!t.length)return!1;for(let i=0,n=t.length;i<n;++i)if(null!==e[t[i]])return!1}return!0}constructor(e={}){super(e),this.modified=this}clone(e,t){let i={};this.emit({type:"cloneTable",detail:t}),e||(i.columns=this.columns),this.autoId||(i.id=this.id);let n=new c(i);return e||(n.versionTag=this.versionTag,n.originalRowIndexes=this.originalRowIndexes,n.localRowIndexes=this.localRowIndexes),this.emit({type:"afterCloneTable",detail:t,tableClone:n}),n}deleteColumns(e,t){let i=this.columns,n={},s={},o=this.modifier,r=this.rowCount;if((e=e||Object.keys(i)).length){this.emit({type:"deleteColumns",columnNames:e,detail:t});for(let t=0,o=e.length,a,l;t<o;++t)(a=i[l=e[t]])&&(n[l]=a,s[l]=Array(r)),delete i[l];return Object.keys(i).length||(this.rowCount=0,this.deleteRowIndexReferences()),o&&o.modifyColumns(this,s,0,t),this.emit({type:"afterDeleteColumns",columns:n,columnNames:e,detail:t}),n}}deleteRowIndexReferences(){delete this.originalRowIndexes,delete this.localRowIndexes}deleteRows(t,i=1,n){let s=[],o=[],r=this.modifier;if(this.emit({type:"deleteRows",detail:n,rowCount:i,rowIndex:t||0}),void 0===t&&(t=0,i=this.rowCount),i>0&&t<this.rowCount){let n=this.columns,r=Object.keys(n);for(let a=0,l=r.length,c,h,d;a<l;++a){c=n[d=r[a]];let u=e.splice(c,t,i);h=u.removed,n[d]=c=u.array,a||(this.rowCount=c.length);for(let e=0,t=h.length;e<t;++e)s[e]=s[e]||[],s[e][a]=h[e];o.push(Array(l))}}return r&&r.modifyRows(this,o,t||0,n),this.emit({type:"afterDeleteRows",detail:n,rowCount:i,rowIndex:t||0,rows:s}),s}emit(e){["afterDeleteColumns","afterDeleteRows","afterSetCell","afterSetColumns","afterSetRows"].includes(e.type)&&(this.versionTag=l()),r(this,e.type,e)}getCell(e,t){let i=this.columns[e];if(i)return i[t]}getCellAsBoolean(e,t){let i=this.columns[e];return!!(i&&i[t])}getCellAsNumber(e,t,i){let n=this.columns[e],s=n&&n[t];switch(typeof s){case"boolean":return+!!s;case"number":return isNaN(s)&&!i?null:s}return isNaN(s=parseFloat(`${s??""}`))&&!i?null:s}getCellAsString(e,t){let i=this.columns[e];return`${i&&i[t]}`}getColumn(e,t){return this.getColumns([e],t)[e]}getColumnAsNumbers(e,t){let i=this.columns[e],n=[];if(i){let s=i.length;if(t)for(let t=0;t<s;++t)n.push(this.getCellAsNumber(e,t,!0));else{for(let e=0,t;e<s;++e){if("number"==typeof(t=i[e]))return i.slice();if(null!=t)break}for(let t=0;t<s;++t)n.push(this.getCellAsNumber(e,t))}}return n}getColumnNames(){return Object.keys(this.columns)}getColumns(e,t,i){let n=this.columns,s={};e=e||Object.keys(n);for(let o=0,r=e.length,a,l;o<r;++o)(a=n[l=e[o]])&&(t?s[l]=a:i&&!Array.isArray(a)?s[l]=Array.from(a):s[l]=a.slice());return s}getLocalRowIndex(e){let{localRowIndexes:t}=this;return t?t[e]:e}getModifier(){return this.modifier}getOriginalRowIndex(e){let{originalRowIndexes:t}=this;return t?t[e]:e}getRow(e,t){return this.getRows(e,1,t)[0]}getRowCount(){return this.rowCount}getRowIndexBy(e,t,i){let n=this.columns[e];if(n){let e=-1;if(Array.isArray(n)?e=n.indexOf(t,i):a(t)&&(e=n.indexOf(t,i)),-1!==e)return e}}getRowObject(e,t){return this.getRowObjects(e,1,t)[0]}getRowObjects(e=0,t=this.rowCount-e,i){let n=this.columns,s=Array(t);i=i||Object.keys(n);for(let o=e,r=0,a=Math.min(this.rowCount,e+t),l,c;o<a;++o,++r)for(let e of(c=s[r]={},i))l=n[e],c[e]=l?l[o]:void 0;return s}getRows(e=0,t=this.rowCount-e,i){let n=this.columns,s=Array(t);i=i||Object.keys(n);for(let o=e,r=0,a=Math.min(this.rowCount,e+t),l,c;o<a;++o,++r)for(let e of(c=s[r]=[],i))l=n[e],c.push(l?l[o]:void 0);return s}getVersionTag(){return this.versionTag}hasColumns(e){let t=this.columns;for(let i=0,n=e.length;i<n;++i)if(!t[e[i]])return!1;return!0}hasRowWith(e,t){let i=this.columns[e];return Array.isArray(i)?-1!==i.indexOf(t):!!(s(t)&&Number.isFinite(t))&&-1!==i.indexOf(+t)}on(e,t){return n(this,e,t)}renameColumn(e,t){let i=this.columns;return!!i[e]&&(e!==t&&(i[t]=i[e],delete i[e]),!0)}setCell(e,t,i,n){let s=this.columns,o=this.modifier,r=s[e];r&&r[t]===i||(this.emit({type:"setCell",cellValue:i,columnName:e,detail:n,rowIndex:t}),r||(r=s[e]=Array(this.rowCount)),t>=this.rowCount&&(this.rowCount=t+1),r[t]=i,o&&o.modifyCell(this,e,t,i),this.emit({type:"afterSetCell",cellValue:i,columnName:e,detail:n,rowIndex:t}))}setColumns(e,t,i,n){let r=this.columns,a=this.modifier,l=Object.keys(e),c=this.rowCount;if(this.emit({type:"setColumns",columns:e,columnNames:l,detail:i,rowIndex:t}),s(t)||n){for(let i=0,s=l.length,o,a,h,d;i<s;++i){o=e[h=l[i]],d=Object.getPrototypeOf((a=r[h])&&n?a:o).constructor,a?d===Array?Array.isArray(a)||(a=Array.from(a)):a.length<c&&(a=new d(c)).set(r[h]):a=new d(c),r[h]=a;for(let e=t||0,i=o.length;e<i;++e)a[e]=o[e];c=Math.max(c,o.length)}this.applyRowCount(c)}else super.setColumns(e,t,o(i,{silent:!0}));a&&a.modifyColumns(this,e,t||0),this.emit({type:"afterSetColumns",columns:e,columnNames:l,detail:i,rowIndex:t})}setModifier(e,t){let i,n=this;return n.emit({type:"setModifier",detail:t,modifier:e,modified:n.modified}),n.modified=n,n.modifier=e,(e?e.modify(n):Promise.resolve(n)).then(i=>(i.emit({type:"afterSetModifier",detail:t,modifier:e,modified:i.modified}),i)).catch(t=>{throw n.emit({type:"setModifierError",error:t,modifier:e,modified:n.modified}),t})}setOriginalRowIndexes(e,t=!1){if(this.originalRowIndexes=e,t)return;let i=this.localRowIndexes=[];for(let t=0,n=e.length,o;t<n;++t)s(o=e[t])&&(i[o]=t)}setRow(e,t,i,n){this.setRows([e],t,i,n)}setRows(t,i=this.rowCount,n,s){let o=this.columns,r=Object.keys(o),a=this.modifier,l=t.length;this.emit({type:"setRows",detail:s,rowCount:l,rowIndex:i,rows:t});for(let s=0,a=i,h;s<l;++s,++a)if((h=t[s])===c.NULL)for(let t=0,i=r.length;t<i;++t){let i=o[r[t]];n?o[r[t]]=e.splice(i,a,0,!0,[null]).array:i[a]=null}else if(h instanceof Array)for(let e=0,t=r.length;e<t;++e)o[r[e]][a]=h[e];else super.setRow(h,a,void 0,{silent:!0});let h=n?l+t.length:i+l;if(h>this.rowCount){this.rowCount=h;for(let t=0,i=r.length;t<i;++t){let i=r[t];o[i]=e.setLength(o[i],h)}}a&&a.modifyRows(this,t,i),this.emit({type:"afterSetRows",detail:s,rowCount:l,rowIndex:i,rows:t})}}return c.NULL={},c.version="1.0.0",c}),i(t,"Data/Converters/DataConverter.js",[t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t){var i;let{addEvent:n,fireEvent:s,isNumber:o,merge:r}=t;class a{constructor(e){this.dateFormats={"YYYY/mm/dd":{regex:/^(\d{4})([\-\.\/])(\d{1,2})\2(\d{1,2})$/,parser:function(e){return e?Date.UTC(+e[1],e[3]-1,+e[4]):NaN}},"dd/mm/YYYY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{4})$/,parser:function(e){return e?Date.UTC(+e[4],e[3]-1,+e[1]):NaN},alternative:"mm/dd/YYYY"},"mm/dd/YYYY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{4})$/,parser:function(e){return e?Date.UTC(+e[4],e[1]-1,+e[3]):NaN}},"dd/mm/YY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{2})$/,parser:function(e){let t=new Date;if(!e)return NaN;let i=+e[4];return i>t.getFullYear()-2e3?i+=1900:i+=2e3,Date.UTC(i,e[3]-1,+e[1])},alternative:"mm/dd/YY"},"mm/dd/YY":{regex:/^(\d{1,2})([\-\.\/])(\d{1,2})\2(\d{2})$/,parser:function(e){return e?Date.UTC(+e[4]+2e3,e[1]-1,+e[3]):NaN}}};let t=r(a.defaultOptions,e),i=t.decimalPoint;("."===i||","===i)&&(i="."===i?"\\.":",",this.decimalRegExp=RegExp("^(-?[0-9]+)"+i+"([0-9]+)$")),this.options=t}asBoolean(e){return"boolean"==typeof e?e:"string"==typeof e?""!==e&&"0"!==e&&"false"!==e:!!this.asNumber(e)}asDate(e){let t;if("string"==typeof e)t=this.parseDate(e);else if("number"==typeof e)t=e;else{if(e instanceof Date)return e;t=this.parseDate(this.asString(e))}return new Date(t)}asGuessedType(e){return({number:this.asNumber,Date:this.asDate,string:this.asString})[this.guessType(e)].call(this,e)}asNumber(e){if("number"==typeof e)return e;if("boolean"==typeof e)return+!!e;if("string"==typeof e){let t=this.decimalRegExp;if(e.indexOf(" ")>-1&&(e=e.replace(/\s+/g,"")),t){if(!t.test(e))return NaN;e=e.replace(t,"$1.$2")}return parseFloat(e)}return e instanceof Date?e.getDate():e?e.getRowCount():NaN}asString(e){return""+e}deduceDateFormat(e,t,i){let n=[],s=[],o="YYYY/mm/dd",r,a=[],l=0,c=!1,h,d;for((!t||t>e.length)&&(t=e.length);l<t;l++)if(void 0!==e[l]&&e[l]&&e[l].length)for(d=0,r=e[l].trim().replace(/[\-\.\/]/g," ").split(" "),a=["","",""];d<r.length;d++)d<a.length&&(h=parseInt(r[d],10))&&(s[d]=!s[d]||s[d]<h?h:s[d],void 0!==n[d]?n[d]!==h&&(n[d]=!1):n[d]=h,h>31?h<100?a[d]="YY":a[d]="YYYY":h>12&&h<=31?(a[d]="dd",c=!0):a[d].length||(a[d]="mm"));if(c){for(d=0;d<n.length;d++)!1!==n[d]?s[d]>12&&"YY"!==a[d]&&"YYYY"!==a[d]&&(a[d]="YY"):s[d]>12&&"mm"===a[d]&&(a[d]="dd");3===a.length&&"dd"===a[1]&&"dd"===a[2]&&(a[2]="YY"),o=a.join("/")}return i&&(this.options.dateFormat=o),o}emit(e){s(this,e.type,e)}export(e,t){throw this.emit({type:"exportError",columns:[],headers:[]}),Error("Not implemented")}getTable(){throw Error("Not implemented")}guessType(e){let t="string";if("string"==typeof e){let i=this.trim(`${e}`),n=this.decimalRegExp,s=this.trim(i,!0);n&&(s=n.test(s)?s.replace(n,"$1.$2"):"");let r=parseFloat(s);+s===r?e=r:t=o(this.parseDate(e))?"Date":"string"}return"number"==typeof e&&(t=e>31536e6?"Date":"number"),t}on(e,t){return n(this,e,t)}parse(e){throw this.emit({type:"parseError",columns:[],headers:[]}),Error("Not implemented")}parseDate(e,t){let i=this.options,n=t||i.dateFormat,s=NaN,r,a,l;if(i.parseDate)s=i.parseDate(e);else{if(n)(a=this.dateFormats[n])||(a=this.dateFormats["YYYY/mm/dd"]),(l=e.match(a.regex))&&(s=a.parser(l));else for(r in this.dateFormats)if(a=this.dateFormats[r],l=e.match(a.regex)){n=r,s=a.parser(l);break}!l&&("object"==typeof(l=Date.parse(e))&&null!==l&&l.getTime?s=l.getTime()-6e4*l.getTimezoneOffset():o(l)&&(s=l-6e4*new Date(l).getTimezoneOffset(),-1===e.indexOf("2001")&&2001===new Date(s).getFullYear()&&(s=NaN)))}return s}trim(e,t){return"string"==typeof e&&(e=e.replace(/^\s+|\s+$/g,""),t&&/^[\d\s]+$/.test(e)&&(e=e.replace(/\s/g,""))),e}}return a.defaultOptions={dateFormat:"",alternativeFormat:"",startColumn:0,endColumn:Number.MAX_VALUE,startRow:0,endRow:Number.MAX_VALUE,firstRowAsNames:!0,switchRowsAndColumns:!1},(i=a||(a={})).types={},i.registerType=function(e,t){return!!e&&!i.types[e]&&!!(i.types[e]=t)},i.getTableFromColumns=function(t=[],i=[]){let n=new e;for(let e=0,s=Math.max(i.length,t.length);e<s;++e)n.setColumn(i[e]||`${e}`,t[e]);return n},a}),i(t,"Data/Converters/CSVConverter.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i}=t;class n extends e{constructor(e){let t=i(n.defaultOptions,e);super(t),this.columns=[],this.headers=[],this.dataTypes=[],this.options=t}export(e,t=this.options){let{useLocalDecimalPoint:i,lineDelimiter:n}=t,s=!1!==this.options.firstRowAsNames,{decimalPoint:o,itemDelimiter:r}=t;o||(o=","!==r&&i?1.1.toLocaleString()[1]:"."),r||(r=","===o?";":",");let a=e.getSortedColumns(t.usePresentationOrder),l=Object.keys(a),c=[],h=l.length,d=[];s&&c.push(l.map(e=>`"${e}"`).join(r));for(let t=0;t<h;t++){let i,n=l[t],s=a[n],u=s.length,p=e.whatIs(n);p&&(i=p.dataType);for(let e=0;e<u;e++){let n=s[e];if(d[e]||(d[e]=[]),"string"===i?n='"'+n+'"':"number"==typeof n?n=String(n).replace(".",o):"string"==typeof n&&(n=`"${n}"`),d[e][t]=n,t===h-1){let i=t;for(;d[e].length>2&&void 0===d[e][i];)d[e].pop(),i--;c.push(d[e].join(r))}}}return c.join(n)}parse(e,t){let n=this.dataTypes,s=i(this.options,e),{beforeParse:o,lineDelimiter:r,firstRowAsNames:a,itemDelimiter:l}=s,c,h=0,{csv:d,startRow:u,endRow:p}=s,m;if(this.columns=[],this.emit({type:"parse",columns:this.columns,detail:t,headers:this.headers}),d&&o&&(d=o(d)),d){if(c=d.replace(/\r\n|\r/g,"\n").split(r||"\n"),(!u||u<0)&&(u=0),(!p||p>=c.length)&&(p=c.length-1),l||(this.guessedItemDelimiter=this.guessDelimiter(c)),a){let e=c[0].split(l||this.guessedItemDelimiter||",");for(let t=0;t<e.length;t++)e[t]=e[t].trim().replace(/^["']|["']$/g,"");this.headers=e,u++}let e=0;for(h=u;h<=p;h++)"#"===c[h][0]?e++:this.parseCSVRow(c[h],h-u-e);n.length&&n[0].length&&"date"===n[0][1]&&!this.options.dateFormat&&this.deduceDateFormat(this.columns[0],null,!0);for(let e=0,t=this.columns.length;e<t;++e){m=this.columns[e];for(let t=0,i=m.length;t<i;++t)if(m[t]&&"string"==typeof m[t]){let i=this.asGuessedType(m[t]);i instanceof Date&&(i=i.getTime()),this.columns[e][t]=i}}}this.emit({type:"afterParse",columns:this.columns,detail:t,headers:this.headers})}parseCSVRow(e,t){let i=this,n=i.columns||[],s=i.dataTypes,{startColumn:o,endColumn:r}=i.options,a=i.options.itemDelimiter||i.guessedItemDelimiter,{decimalPoint:l}=i.options;l&&l!==a||(l=i.guessedDecimalPoint||".");let c=0,h="",d="",u=0,p=0,m=t=>{h=e[t]},f=e=>{s.length<p+1&&s.push([e]),s[p][s[p].length-1]!==e&&s[p].push(e)},g=()=>{if(o>u||u>r){++u,d="";return}if("string"==typeof d?!isNaN(parseFloat(d))&&isFinite(d)?(d=parseFloat(d),f("number")):isNaN(Date.parse(d))?f("string"):(d=d.replace(/\//g,"-"),f("date")):f("number"),n.length<p+1&&n.push([]),"number"!=typeof d&&"number"!==i.guessType(d)&&l){let e=d;d=d.replace(l,"."),"number"!==i.guessType(d)&&(d=e)}n[p][t]=d,d="",++p,++u};if(e.trim().length&&"#"!==e.trim()[0]){for(;c<e.length;c++){if(m(c),"#"===h&&!/^#[A-F\d]{3,3}|[A-F\d]{6,6}/i.test(e.substring(c)))return void g();if('"'===h)for(m(++c);c<e.length&&'"'!==h;)d+=h,m(++c);else h===a?g():d+=h}g()}}guessDelimiter(e){let t=0,i=0,n,s={",":0,";":0,"	":0},o=e.length;for(let n=0;n<o;n++){let o=!1,r,a,l,c="";if(n>13)break;let h=e[n];for(let e=0;e<h.length&&(r=h[e],a=h[e+1],l=h[e-1],"#"!==r);e++){if('"'===r)if(o){if('"'!==l&&'"'!==a){for(;" "===a&&e<h.length;)a=h[++e];void 0!==s[a]&&s[a]++,o=!1}}else o=!0;else void 0!==s[r]?(isNaN(Date.parse(c=c.trim()))?(isNaN(Number(c))||!isFinite(Number(c)))&&s[r]++:s[r]++,c=""):c+=r;","===r&&i++,"."===r&&t++}}return s[";"]>s[","]?n=";":(s[","]>s[";"],n=","),t>i?this.guessedDecimalPoint=".":this.guessedDecimalPoint=",",n}getTable(){return e.getTableFromColumns(this.columns,this.headers)}}return n.defaultOptions={...e.defaultOptions,lineDelimiter:"\n"},e.registerType("CSV",n),n}),i(t,"Data/Modifiers/DataModifier.js",[t["Core/Utilities.js"]],function(t){var i;let{addEvent:n,fireEvent:s,merge:o}=t;class r{benchmark(t,i){let n=[],s=this,r=()=>{s.modifyTable(t),s.emit({type:"afterBenchmarkIteration"})},{iterations:a}=o({iterations:1},i);s.on("afterBenchmarkIteration",()=>{if(n.length===a)return void s.emit({type:"afterBenchmark",results:n});r()});let l={startTime:0,endTime:0};return s.on("modify",()=>{l.startTime=e.performance.now()}),s.on("afterModify",()=>{l.endTime=e.performance.now(),n.push(l.endTime-l.startTime)}),r(),n}emit(e){s(this,e.type,e)}modify(e,t){let i=this;return new Promise((n,s)=>{e.modified===e&&(e.modified=e.clone(!1,t));try{n(i.modifyTable(e,t))}catch(n){i.emit({type:"error",detail:t,table:e}),s(n)}})}modifyCell(e,t,i,n,s){return this.modifyTable(e)}modifyColumns(e,t,i,n){return this.modifyTable(e)}modifyRows(e,t,i,n){return this.modifyTable(e)}on(e,t){return n(this,e,t)}}return(i=r||(r={})).types={},i.registerType=function(e,t){return!!e&&!i.types[e]&&!!(i.types[e]=t)},r}),i(t,"Data/Connectors/DataConnector.js",[t["Data/Modifiers/DataModifier.js"],t["Data/DataTable.js"],t["Core/Utilities.js"]],function(t,i,n){var s;let{addEvent:o,fireEvent:r,merge:a,pick:l}=n;class c{constructor(e={},t=[]){this.dataTables={},this.loaded=!1,this.metadata=e.metadata||{columns:{}};let n=0;if(t?.length>0)for(let e=0,s=t.length;e<s;++e){let s=t[e],o=s?.key;this.dataTables[o??n]=new i(s),!o&&n++}else this.dataTables[0]=new i(e.dataTable)}get polling(){return!!this._polling}get table(){return this.getTable()}describeColumn(e,t){let i=this.metadata.columns;i[e]=a(i[e]||{},t)}describeColumns(e){let t,i=Object.keys(e);for(;"string"==typeof(t=i.pop());)this.describeColumn(t,e[t])}emit(e){r(this,e.type,e)}getColumnOrder(e){let t=this.metadata.columns,i=Object.keys(t||{});if(i.length)return i.sort((e,i)=>l(t[e].index,0)-l(t[i].index,0))}getTable(e){return e?this.dataTables[e]:Object.values(this.dataTables)[0]}getSortedColumns(e){return this.table.getColumns(this.getColumnOrder(e))}load(){return r(this,"afterLoad",{table:this.table}),Promise.resolve(this)}on(e,t){return o(this,e,t)}save(){return r(this,"saveError",{table:this.table}),Promise.reject(Error("Not implemented"))}setColumnOrder(e){for(let t=0,i=e.length;t<i;++t)this.describeColumn(e[t],{index:t})}async setModifierOptions(e,i){for(let[n,s]of Object.entries(this.dataTables)){let o=i?.find(e=>e.key===n),r=a(o?.dataModifier,e),l=r&&t.types[r.type];await s.setModifier(l?new l(r):void 0)}return this}startPolling(t=1e3){let i=this,n=i.dataTables;this.pollingController=new AbortController,e.clearTimeout(i._polling),i._polling=e.setTimeout(()=>i.load().catch(e=>i.emit({type:"loadError",error:e,tables:n})).then(()=>{i._polling&&i.startPolling(t)}),t)}stopPolling(){this.polling&&(this?.pollingController?.abort(),e.clearTimeout(this._polling),delete this._polling)}whatIs(e){return this.metadata.columns[e]}initConverters(e,t,i){let n=0;for(let[s,o]of Object.entries(this.dataTables)){let r=t(s,o);i(r,e),o.deleteColumns(),o.setColumns(r.getTable().getColumns()),0===n&&(this.converter=r),n++}}}return(s=c||(c={})).types={},s.registerType=function(e,t){return!!e&&!s.types[e]&&!!(s.types[e]=t)},c}),i(t,"Data/Connectors/CSVConnector.js",[t["Data/Converters/CSVConverter.js"],t["Data/Connectors/DataConnector.js"],t["Core/Utilities.js"]],function(e,t,i){let{merge:n,defined:s}=i;class o extends t{constructor(e,t){let i=n(o.defaultOptions,e);super(i,t),this.options=s(t)?n(i,{dataTables:t}):i,i.enablePolling&&this.startPolling(1e3*Math.max(i.dataRefreshRate||0,1))}load(t){let i=this,s=i.dataTables,{csv:o,csvURL:r,dataModifier:a,dataTables:l}=i.options;return i.emit({type:"load",csv:o,detail:t,tables:s}),Promise.resolve(r?fetch(r,{signal:i?.pollingController?.signal}).then(e=>e.text()):o||"").then(t=>(t&&this.initConverters(t,t=>{let i=this.options,s=l?.find(e=>e.key===t),o={dataTableKey:t,firstRowAsNames:s?.firstRowAsNames??i.firstRowAsNames,beforeParse:s?.beforeParse??i.beforeParse};return new e(n(this.options,o))},(e,t)=>{e.parse({csv:t})}),i.setModifierOptions(a,l).then(()=>t))).then(e=>(i.emit({type:"afterLoad",csv:e,detail:t,tables:s}),i)).catch(e=>{throw i.emit({type:"loadError",detail:t,error:e,tables:s}),e})}}return o.defaultOptions={csv:"",csvURL:"",enablePolling:!1,dataRefreshRate:1,firstRowAsNames:!0},t.registerType("CSV",o),o}),i(t,"Data/Converters/GoogleSheetsConverter.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i,uniqueKey:n}=t;class s extends e{constructor(e){let t=i(s.defaultOptions,e);super(t),this.columns=[],this.header=[],this.options=t}parse(e,t){let s,o=i(this.options,e),r=(o.json?.values||[]).map(e=>e.slice());if(0===r.length)return!1;this.header=[],this.columns=[],this.emit({type:"parse",columns:this.columns,detail:t,headers:this.header});let{beforeParse:a,json:l}=o;a&&l&&(r=a(l.values)),this.columns=r;for(let e=0,t=r.length;e<t;e++){s=r[e],this.header[e]=o.firstRowAsNames?`${s.shift()}`:n();for(let t=0,i=s.length;t<i;++t)if(s[t]&&"string"==typeof s[t]){let i=this.asGuessedType(s[t]);i instanceof Date&&(i=i.getTime()),this.columns[e][t]=i}}this.emit({type:"afterParse",columns:this.columns,detail:t,headers:this.header})}getTable(){return e.getTableFromColumns(this.columns,this.header)}}return s.defaultOptions={...e.defaultOptions},e.registerType("GoogleSheets",s),s}),i(t,"Data/Connectors/GoogleSheetsConnector.js",[t["Data/Connectors/DataConnector.js"],t["Data/Converters/GoogleSheetsConverter.js"],t["Core/Utilities.js"]],function(e,t,i){let{merge:n,pick:s,defined:o}=i;class r extends e{constructor(e,t){let i=n(r.defaultOptions,e);super(i,t),this.options=o(t)?n(i,{dataTables:t}):i}load(e){let i=this,s=i.dataTables,{dataModifier:o,dataRefreshRate:a,enablePolling:l,googleAPIKey:c,googleSpreadsheetKey:h,dataTables:d}=i.options,u=r.buildFetchURL(c,h,i.options);if(i.emit({type:"load",detail:e,tables:s,url:u}),!URL.canParse(u))throw Error("Invalid URL: "+u);return fetch(u,{signal:i?.pollingController?.signal}).then(e=>e.json()).then(e=>{if("object"==typeof e&&e&&"object"==typeof e.error&&e.error&&"number"==typeof e.error.code&&"string"==typeof e.error.message&&"string"==typeof e.error.status)throw Error(e.error.message);return this.initConverters(e,e=>{let i=this.options,s=d?.find(t=>t.key===e),o={dataTableKey:e,firstRowAsNames:s?.firstRowAsNames??i.firstRowAsNames,beforeParse:s?.beforeParse??i.beforeParse};return new t(n(this.options,o))},(e,t)=>{e.parse({json:t})}),i.setModifierOptions(o,d)}).then(()=>(i.emit({type:"afterLoad",detail:e,tables:s,url:u}),l&&setTimeout(()=>i.load(),1e3*Math.max(a||0,1)),i)).catch(t=>{throw i.emit({type:"loadError",detail:e,error:t,tables:s}),t})}}r.defaultOptions={googleAPIKey:"",googleSpreadsheetKey:"",enablePolling:!1,dataRefreshRate:2,firstRowAsNames:!0};var a=r||(r={});let l="ABCDEFGHIJKLMNOPQRSTUVWXYZ";function c(e={}){let{endColumn:t,endRow:i,googleSpreadsheetRange:n,startColumn:o,startRow:r}=e;return n||(l[o||0]||"A")+(Math.max(r||0,0)+1)+":"+(l[s(t,25)]||"Z")+(i?Math.max(i,0):"Z")}return a.buildFetchURL=function(e,t,i={}){let n=new URL(`https://sheets.googleapis.com/v4/spreadsheets/${t}/values/`),s=i.onlyColumnNames?"A1:Z1":c(i);n.pathname+=s;let o=n.searchParams;return o.set("alt","json"),i.onlyColumnNames||(o.set("dateTimeRenderOption","FORMATTED_STRING"),o.set("majorDimension","COLUMNS"),o.set("valueRenderOption","UNFORMATTED_VALUE")),o.set("prettyPrint","false"),o.set("key",e),n.href},a.buildQueryRange=c,e.registerType("GoogleSheets",r),r}),i(t,"Data/Converters/HTMLTableConverter.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i}=t;class n extends e{constructor(e){let t=i(n.defaultOptions,e);super(t),this.columns=[],this.headers=[],this.options=t,t.tableElement&&(this.tableElement=t.tableElement,this.tableElementID=t.tableElement.id)}export(e,t=this.options){let i=!1!==t.firstRowAsNames,n=t.useMultiLevelHeaders,s=e.getSortedColumns(t.usePresentationOrder),o=Object.keys(s),r=[],a=o.length,l=[],c="";if(i){let e=[];if(n){for(let t of o){let i=s[t];Array.isArray(i)||(i=Array.from(i));let n=(i.shift()||"").toString();s[t]=i,e.push(n)}c=this.getTableHeaderHTML(o,e,t)}else c=this.getTableHeaderHTML(void 0,o,t)}for(let e=0;e<a;e++){let t=s[o[e]],i=t.length;for(let n=0;n<i;n++){let i=t[n];l[n]||(l[n]=[]),"string"!=typeof i&&"number"!=typeof i&&void 0!==i&&(i=(i||"").toString()),l[n][e]=this.getCellHTMLFromValue(e?"td":"th",null,e?"":'scope="row"',i),e===a-1&&r.push("<tr>"+l[n].join("")+"</tr>")}}let h="";return t.tableCaption&&(h='<caption class="highcharts-table-caption">'+t.tableCaption+"</caption>"),"<table>"+h+c+"<tbody>"+r.join("")+"</tbody></table>"}getCellHTMLFromValue(e,t,i,n,s){let o=n,r="text"+(t?" "+t:"");return"number"==typeof o?(o=o.toString(),","===s&&(o=o.replace(".",s)),r="number"):n||(o="",r="empty"),"<"+e+(i?" "+i:"")+' class="'+r+'">'+o+"</"+e+">"}getTableHeaderHTML(e=[],t=[],i=this.options){let{useMultiLevelHeaders:n,useRowspanHeaders:s}=i,o="<thead>",r=0,a=t&&t.length,l,c=0,h;if(n&&e&&t&&!function(e,t){let i=e.length;if(t.length!==i)return!1;for(;--i;)if(e[i]!==t[i])return!1;return!0}(e,t)){for(o+="<tr>";r<a;++r)(l=e[r])===e[r+1]?++c:c?(o+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col" colspan="'+(c+1)+'"',l),c=0):(l===t[r]?s?(h=2,delete t[r]):(h=1,t[r]=""):h=1,o+=this.getCellHTMLFromValue("th","highcharts-table-topheading",'scope="col"'+(h>1?' valign="top" rowspan="'+h+'"':""),l));o+="</tr>"}if(t){for(o+="<tr>",r=0,a=t.length;r<a;++r)void 0!==t[r]&&(o+=this.getCellHTMLFromValue("th",null,'scope="col"',t[r]));o+="</tr>"}return o+"</thead>"}parse(e,t){let n=[],s=[],o=i(this.options,e),{endRow:r,startColumn:a,endColumn:l,firstRowAsNames:c}=o,h=o.tableElement||this.tableElement;if(!(h instanceof HTMLElement))return void this.emit({type:"parseError",columns:n,detail:t,headers:s,error:"Not a valid HTML Table"});this.tableElement=h,this.tableElementID=h.id,this.emit({type:"parse",columns:this.columns,detail:t,headers:this.headers});let d=h.getElementsByTagName("tr"),u=d.length,p=0,m,{startRow:f}=o;if(c&&u){let e=d[0].children,t=e.length;for(let i=a;i<t&&!(i>l);i++)("TD"===(m=e[i]).tagName||"TH"===m.tagName)&&s.push(m.innerHTML);f++}for(;p<u;){if(p>=f&&p<=r){let e=d[p].children,t=e.length,i=0;for(;i<t;){let t=i-a,s=n[t];if(("TD"===(m=e[i]).tagName||"TH"===m.tagName)&&i>=a&&i<=l){n[t]||(n[t]=[]);let e=this.asGuessedType(m.innerHTML);e instanceof Date&&(e=e.getTime()),n[t][p-f]=e;let i=1;for(;p-f>=i&&void 0===s[p-f-i];)s[p-f-i]=null,i++}i++}}p++}this.columns=n,this.headers=s,this.emit({type:"afterParse",columns:n,detail:t,headers:s})}getTable(){return e.getTableFromColumns(this.columns,this.headers)}}return n.defaultOptions={...e.defaultOptions,useRowspanHeaders:!0,useMultiLevelHeaders:!0},e.registerType("HTMLTable",n),n}),i(t,"Data/Connectors/HTMLTableConnector.js",[t["Data/Connectors/DataConnector.js"],t["Core/Globals.js"],t["Data/Converters/HTMLTableConverter.js"],t["Core/Utilities.js"]],function(e,t,i,n){let{win:s}=t,{merge:o}=n;class r extends e{constructor(e){let t=o(r.defaultOptions,e);super(t),this.converter=new i(t),this.options=t}load(e){let t,i=this,n=i.converter,r=i.table,{dataModifier:a,table:l}=i.options;if(i.emit({type:"load",detail:e,tables:{table:r},tableElement:i.tableElement}),"string"==typeof l?(i.tableID=l,t=s.document.getElementById(l)):i.tableID=(t=l).id,i.tableElement=t||void 0,!i.tableElement){let t="HTML table not provided, or element with ID not found";return i.emit({type:"loadError",detail:e,error:t,tables:{table:r}}),Promise.reject(Error(t))}return n.parse(o({tableElement:i.tableElement},i.options),e),r.deleteColumns(),r.setColumns(n.getTable().getColumns()),i.setModifierOptions(a).then(()=>(i.emit({type:"afterLoad",detail:e,tables:{table:r},tableElement:i.tableElement}),i))}}return r.defaultOptions={table:""},e.registerType("HTMLTable",r),r}),i(t,"Data/Converters/JSONConverter.js",[t["Data/Converters/DataConverter.js"],t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t,i){let{error:n,isArray:s,merge:o,objectEach:r}=i;class a extends e{constructor(e){let i=o(a.defaultOptions,e);super(i),this.columns=[],this.headers=[],this.options=i,this.table=new t}parse(e,t){let{beforeParse:i,orientation:a,firstRowAsNames:l,columnNames:c}=e=o(this.options,e),h=e.data;if(h){if(this.columns=[],this.emit({type:"parse",columns:this.columns,detail:t,headers:this.headers}),i&&(h=i(h)),h=h.slice(),"columns"===a)for(let e=0,t=h.length;e<t;e++){let t=h[e];if(!(t instanceof Array))return;this.headers instanceof Array?(l?this.headers.push(`${t.shift()}`):c&&c instanceof Array&&this.headers.push(c[e]),this.table.setColumn(this.headers[e]||e.toString(),t)):n("JSONConverter: Invalid `columnNames` option.",!1)}else if("rows"===a){l?this.headers=h.shift():c&&(this.headers=c);for(let e=0,t=h.length;e<t;e++){let t=h[e];if(s(t))for(let e=0,i=t.length;e<i;e++)this.columns.length<e+1&&this.columns.push([]),this.columns[e].push(t[e]),this.headers instanceof Array?this.table.setColumn(this.headers[e]||e.toString(),this.columns[e]):n("JSONConverter: Invalid `columnNames` option.",!1);else{let i=this.headers;if(i&&!(i instanceof Array)){let e={};r(i,(i,n)=>{e[n]=i.reduce((e,t)=>e[t],t)}),t=e}this.table.setRows([t],e)}}}this.emit({type:"afterParse",columns:this.columns,detail:t,headers:this.headers})}}getTable(){return this.table}}return a.defaultOptions={...e.defaultOptions,data:[],orientation:"rows"},e.registerType("JSON",a),a}),i(t,"Data/Connectors/JSONConnector.js",[t["Data/Connectors/DataConnector.js"],t["Core/Utilities.js"],t["Data/Converters/JSONConverter.js"]],function(e,t,i){let{merge:n,defined:s}=t;class o extends e{constructor(e,t){let i=n(o.defaultOptions,e);super(i,t),this.options=s(t)?n(i,{dataTables:t}):i,i.enablePolling&&this.startPolling(1e3*Math.max(i.dataRefreshRate||0,1))}load(e){let t=this,s=t.dataTables,{data:o,dataUrl:r,dataModifier:a,dataTables:l}=t.options;return t.emit({type:"load",data:o,detail:e,tables:s}),Promise.resolve(r?fetch(r,{signal:t?.pollingController?.signal}).then(e=>e.json()).catch(i=>{t.emit({type:"loadError",detail:e,error:i,tables:s}),console.warn(`Unable to fetch data from ${r}.`)}):o||[]).then(e=>(e&&this.initConverters(e,e=>{let t=this.options,s=l?.find(t=>t.key===e),o={dataTableKey:e,columnNames:s?.columnNames??t.columnNames,firstRowAsNames:s?.firstRowAsNames??t.firstRowAsNames,orientation:s?.orientation??t.orientation,beforeParse:s?.beforeParse??t.beforeParse};return new i(n(this.options,o))},(e,t)=>{e.parse({data:t})}),t.setModifierOptions(a,l).then(()=>e))).then(i=>(t.emit({type:"afterLoad",data:i,detail:e,tables:s}),t)).catch(i=>{throw t.emit({type:"loadError",detail:e,error:i,tables:s}),i})}}return o.defaultOptions={data:[],enablePolling:!1,dataRefreshRate:0,firstRowAsNames:!0,orientation:"rows"},e.registerType("JSON",o),o}),i(t,"Data/Modifiers/ChainModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i}=t;class n extends e{constructor(t,...s){super(),this.chain=s,this.options=i(n.defaultOptions,t);let o=this.options.chain||[];for(let t=0,i=o.length,n,r;t<i;++t)(n=o[t]).type&&(r=e.types[n.type])&&s.push(new r(n))}add(e,t){this.emit({type:"addModifier",detail:t,modifier:e}),this.chain.push(e),this.emit({type:"addModifier",detail:t,modifier:e})}clear(e){this.emit({type:"clearChain",detail:e}),this.chain.length=0,this.emit({type:"afterClearChain",detail:e})}async modify(e,t){let i=this.options.reverse?this.chain.slice().reverse():this.chain.slice();e.modified===e&&(e.modified=e.clone(!1,t));let n=e;for(let s=0,o=i.length;s<o;++s){try{await i[s].modify(n,t)}catch(i){throw this.emit({type:"error",detail:t,table:e}),i}n=n.modified}return e.modified=n,e}modifyCell(e,t,i,n,s){let o=this.options.reverse?this.chain.reverse():this.chain;if(o.length){let r=e.clone();for(let e=0,a=o.length;e<a;++e)o[e].modifyCell(r,t,i,n,s),r=r.modified;e.modified=r}return e}modifyColumns(e,t,i,n){let s=this.options.reverse?this.chain.reverse():this.chain.slice();if(s.length){let o=e.clone();for(let e=0,r=s.length;e<r;++e)s[e].modifyColumns(o,t,i,n),o=o.modified;e.modified=o}return e}modifyRows(e,t,i,n){let s=this.options.reverse?this.chain.reverse():this.chain.slice();if(s.length){let o=e.clone();for(let e=0,r=s.length;e<r;++e)s[e].modifyRows(o,t,i,n),o=o.modified;e.modified=o}return e}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let i=this.options.reverse?this.chain.reverse():this.chain.slice(),n=e.modified;for(let e=0,s=i.length;e<s;++e)n=i[e].modifyTable(n,t).modified;return e.modified=n,this.emit({type:"afterModify",detail:t,table:e}),e}remove(e,t){let i=this.chain;this.emit({type:"removeModifier",detail:t,modifier:e}),i.splice(i.indexOf(e),1),this.emit({type:"afterRemoveModifier",detail:t,modifier:e})}}return n.defaultOptions={type:"Chain"},e.registerType("Chain",n),n}),i(t,"Data/Modifiers/InvertModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i}=t;class n extends e{constructor(e){super(),this.options=i(n.defaultOptions,e)}modifyCell(e,t,i,n,s){let o=e.modified,r=o.getRowIndexBy("columnNames",t);return void 0===r?o.setColumns(this.modifyTable(e.clone()).getColumns(),void 0,s):o.setCell(`${i}`,r,n,s),e}modifyColumns(e,t,i,n){let s=e.modified,o=s.getColumn("columnNames")||[],r=e.getColumnNames(),a=e.getRowCount()!==o.length;if(!a){for(let e=0,t=r.length;e<t;++e)if(r[e]!==o[e]){a=!0;break}}if(a)return this.modifyTable(e,n);r=Object.keys(t);for(let e=0,o=r.length,a,l,c;e<o;++e){a=t[l=r[e]],c=s.getRowIndexBy("columnNames",l)||s.getRowCount();for(let e=0,t=i,o=a.length;e<o;++e,++t)s.setCell(`${t}`,c,a[e],n)}return e}modifyRows(e,t,i,n){let s=e.getColumnNames(),o=e.modified,r=o.getColumn("columnNames")||[],a=e.getRowCount()!==r.length;if(!a){for(let e=0,t=s.length;e<t;++e)if(s[e]!==r[e]){a=!0;break}}if(a)return this.modifyTable(e,n);for(let e=0,r=i,a=t.length,l;e<a;++e,++r)if((l=t[e])instanceof Array)o.setColumn(`${r}`,l);else for(let e=0,t=s.length;e<t;++e)o.setCell(`${r}`,e,l[s[e]],n);return e}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let i=e.modified;if(e.hasColumns(["columnNames"])){let t=(e.deleteColumns(["columnNames"])||{}).columnNames||[],n={},s=[];for(let e=0,i=t.length;e<i;++e)s.push(""+t[e]);for(let t=0,i=e.getRowCount(),o;t<i;++t)(o=e.getRow(t))&&(n[s[t]]=o);i.deleteColumns(),i.setColumns(n)}else{let t={};for(let i=0,n=e.getRowCount(),s;i<n;++i)(s=e.getRow(i))&&(t[`${i}`]=s);t.columnNames=e.getColumnNames(),i.deleteColumns(),i.setColumns(t)}return this.emit({type:"afterModify",detail:t,table:e}),e}}return n.defaultOptions={type:"Invert"},e.registerType("Invert",n),n}),i(t,"Data/Modifiers/RangeModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i}=t;class n extends e{constructor(e){super(),this.options=i(n.defaultOptions,e)}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let i=[],{additive:n,ranges:s,strict:o}=this.options;if(s.length){let t=e.modified,r=e.getColumns(),a=[];for(let e=0,l=s.length,c,h;e<l;++e)if(c=s[e],!o||typeof c.minValue==typeof c.maxValue){e>0&&!n&&(t.deleteRows(),t.setRows(a),t.setOriginalRowIndexes(i,!0),r=t.getColumns(),a=[],i=[]),h=r[c.column]||[];for(let e=0,t=h.length;e<t;++e)switch(typeof h[e]){default:continue;case"boolean":case"number":case"string":}}t.deleteRows(),t.setRows(a),t.setOriginalRowIndexes(i)}return this.emit({type:"afterModify",detail:t,table:e}),e}}return n.defaultOptions={type:"Range",ranges:[]},e.registerType("Range",n),n}),i(t,"Data/Modifiers/SortModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Data/DataTable.js"],t["Core/Utilities.js"]],function(e,t,i){let{merge:n}=i;class s extends e{static ascending(e,t){return(e||0)<(t||0)?-1:+((e||0)>(t||0))}static descending(e,t){return(t||0)<(e||0)?-1:+((t||0)>(e||0))}static compareFactory(e,t){return t?"desc"===e?(e,i)=>-t(e,i):t:"asc"===e?s.ascending:s.descending}constructor(e){super(),this.options=n(s.defaultOptions,e)}getRowReferences(e){let t=e.getRows(),i=[];for(let e=0,n=t.length;e<n;++e)i.push({index:e,row:t[e]});return i}modifyCell(e,i,n,s,o){let{orderByColumn:r,orderInColumn:a}=this.options;return i===r&&(a?(e.modified.setCell(i,n,s),e.modified.setColumn(a,this.modifyTable(new t({columns:e.getColumns([r,a])})).modified.getColumn(a))):this.modifyTable(e,o)),e}modifyColumns(e,i,n,s){let{orderByColumn:o,orderInColumn:r}=this.options,a=Object.keys(i);return a.indexOf(o)>-1&&(r&&i[a[0]].length?(e.modified.setColumns(i,n),e.modified.setColumn(r,this.modifyTable(new t({columns:e.getColumns([o,r])})).modified.getColumn(r))):this.modifyTable(e,s)),e}modifyRows(e,i,n,s){let{orderByColumn:o,orderInColumn:r}=this.options;return r&&i.length?(e.modified.setRows(i,n),e.modified.setColumn(r,this.modifyTable(new t({columns:e.getColumns([o,r])})).modified.getColumn(r))):this.modifyTable(e,s),e}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let i=e.getColumnNames(),n=e.getRowCount(),o=this.getRowReferences(e),{direction:r,orderByColumn:a,orderInColumn:l,compare:c}=this.options,h=s.compareFactory(r,c),d=i.indexOf(a),u=e.modified;if(-1!==d&&o.sort((e,t)=>h(e.row[d],t.row[d])),l){let e=[];for(let t=0;t<n;++t)e[o[t].index]=t;u.setColumns({[l]:e})}else{let e,t=[],i=[];for(let s=0;s<n;++s)e=o[s],t.push(u.getOriginalRowIndex(e.index)),i.push(e.row);u.setRows(i,0),u.setOriginalRowIndexes(t)}return this.emit({type:"afterModify",detail:t,table:e}),e}}return s.defaultOptions={type:"Sort",direction:"desc",orderByColumn:"y"},e.registerType("Sort",s),s}),i(t,"Data/Modifiers/FilterModifier.js",[t["Data/Modifiers/DataModifier.js"],t["Core/Utilities.js"]],function(e,t){let{isFunction:i,merge:n}=t;class s extends e{static compile(e){if(i(e))return e;let t=e.operator;switch(t){case"and":{let t=e.conditions.map(e=>this.compile(e));return(e,i,n)=>t.every(t=>t(e,i,n))}case"or":{let t=e.conditions.map(e=>this.compile(e));return(e,i,n)=>t.some(t=>t(e,i,n))}case"not":{let t=this.compile(e.condition);return(e,i,n)=>!t(e,i,n)}}let{columnName:n,value:s}=e;switch(t){case"==":return e=>e[n]==s;case"===":return e=>e[n]===s;case"!=":return e=>e[n]!=s;case"!==":return e=>e[n]!==s;case">":return e=>(e[n]||0)>(s||0);case">=":return e=>(e[n]||0)>=(s||0);case"<":return e=>(e[n]||0)<(s||0);case"<=":return e=>(e[n]||0)<=(s||0)}let{ignoreCase:o}=e,r=e=>{let t=""+e;return o??!0?t.toLowerCase():t};return"contains"===t?e=>r(e[n]).includes(r(s)):e=>r(e[n])[t](r(s))}constructor(e){super(),this.options=n(s.defaultOptions,e)}modifyTable(e,t){this.emit({type:"modify",detail:t,table:e});let{condition:i}=this.options;if(!i)return e;let n=s.compile(i),o=e.modified,r=[],a=[];for(let t=0,i=e.getRowCount();t<i;++t){let i=e.getRowObject(t);i&&n(i,e,t)&&(r.push(i),a.push(o.getOriginalRowIndex(t)))}return o.deleteRows(),o.setRows(r),o.setOriginalRowIndexes(a),this.emit({type:"afterModify",detail:t,table:e}),e}}return s.defaultOptions={type:"Filter"},e.registerType("Filter",s),s}),i(t,"Dashboards/Components/ComponentRegistry.js",[],function(){var e,t;return(t=e||(e={})).types={},t.registerComponent=function(e,i){return!!e&&!t.types[e]&&!!(t.types[e]=i)},e}),i(t,"Dashboards/Layout/CellHTML.js",[t["Dashboards/EditMode/EditGlobals.js"],t["Dashboards/Globals.js"],t["Dashboards/Layout/GUIElement.js"]],function(e,t,i){var n;class s extends i{constructor(e){super(),this.type="cell-html",this.options=e,this.id=e.id,this.container=e.container,this.mountedComponent=e.mountedComponent}destroy(){this.mountedComponent?.destroy(),super.destroy()}setHighlight(){this.container.classList.toggle(e.classNames.cellEditHighlight),this.mountedComponent?.board.container.classList.toggle(e.classNames.dashboardCellEditHighlightActive)}setActiveState(){this.container&&this.container.classList.add(t.classNames.cellActive)}}return(n=s||(s={})).isCellHTML=function(e){return e instanceof n},s}),i(t,"Dashboards/Actions/Bindings.js",[t["Dashboards/Components/ComponentRegistry.js"],t["Dashboards/Layout/CellHTML.js"],t["Dashboards/Globals.js"],t["Core/Utilities.js"]],function(e,t,i,n){let{addEvent:s,fireEvent:o}=n;var r,a=r||(r={});function l(e,t){let i;"string"==typeof e&&document.querySelectorAll("#"+e).length>1&&console.warn(`Multiple cells have identical ID %c${e}%c, potentially leading to unexpected behavior. 
Ensure that each cell has a unique ID on the page.`,"font-weight: bold","");let n=t?t.querySelector("#"+e):document.getElementById(e);return null!==n&&o(n,"bindedGUIElement",{},function(e){i=e.guiElement}),i}async function c(n,r,l){let c=n.states,h=n.events,d=n.renderTo||n.cell;if(!d)return void console.error("The%c renderTo%c option is required to render the component.","font-weight: bold","");if(r.mountedComponents.filter(e=>(e.options.renderTo||e.options.cell)===d).length>0)return void console.error(`A component has already been declared in the cell %c${d}%c use a different cell.`,"font-weight: bold","");l=l||a.getCell(d,r.container);let u=l?.container||document.querySelector("#"+d);if(!u||!n.type)return void console.error(`The component is unable to find the HTML cell element %c${d}%c to render the content.`,"font-weight: bold","");let p=e.types[n.type];!p&&(console.error(`The component's type %c${n.type}%c does not exist.`,"font-weight: bold",""),l&&(p=e.types.HTML,n.title={text:r.editMode?.lang.errorMessage||"Something went wrong",className:i.classNamePrefix+"component-title-error "+i.classNamePrefix+"component-title"}));let m=new p(l,n,r),f=m.load().catch(e=>{console.error(e),m.update({connector:{id:""},title:{text:r.editMode?.lang.errorMessage||"Something went wrong",className:i.classNamePrefix+"component-title-error "+i.classNamePrefix+"component-title"}})});return l&&(m.setCell(l),l.mountedComponent=m),r.mountedComponents.push({options:n,component:m,cell:l||new t({id:d,container:u,mountedComponent:m})}),l&&c?.active?.enabled&&c?.active?.isActive&&(l.setActiveState(),m.isActive=!0),o(m,"mount"),s(u,"click",()=>{h&&h.click&&h.click.call(m),l&&m&&u&&c?.active?.enabled&&(l.setActiveState(),m.isActive=!0)}),c?.hover?.enabled&&u.classList.add(i.classNames.cellHover),o(m,"afterLoad"),f}return a.addComponent=c,a.getCell=function(e,t){let i=l(e,t);if(i&&"cell"===i.getType())return i},a.getRow=function(e,t){let i=l(e,t);if(i&&"row"===i.getType())return i},a.getLayout=function(e,t){let i=l(e,t);if(i&&"layout"===i.getType())return i},r}),i(t,"Dashboards/Accessibility/DashboardsAccessibility.js",[],function(){return class{constructor(e){this.board=e,this.addTabIndexToCells()}addTabIndexToCells(){let e,t=this.board.mountedComponents;for(let i=0,n=t.length;i<n;++i)(e=t[i].cell)&&e.container&&e.container.setAttribute("tabindex",-1)}}}),i(t,"Data/DataCursor.js",[],function(){class e{constructor(e={}){this.emittingRegister=[],this.listenerMap={},this.stateMap=e}addListener(e,t,i){let n=this.listenerMap[e]=this.listenerMap[e]||{};return(n[t]=n[t]||[]).push(i),this}buildEmittingTag(e){return("position"===e.cursor.type?[e.table.id,e.cursor.column,e.cursor.row,e.cursor.state,e.cursor.type]:[e.table.id,e.cursor.columns,e.cursor.firstRow,e.cursor.lastRow,e.cursor.state,e.cursor.type]).join("\0")}emitCursor(t,i,n,s){let o=t.id,r=i.state,a=this.listenerMap[o]&&this.listenerMap[o][r];if(a){let r=this.stateMap[o]=this.stateMap[o]??{},l=r[i.state]||[];s&&(l.length||(r[i.state]=l),-1===e.getIndex(i,l)&&l.push(i));let c={cursor:i,cursors:l,table:t};n&&(c.event=n);let h=this.emittingRegister,d=this.buildEmittingTag(c);if(h.indexOf(d)>=0)return this;try{this.emittingRegister.push(d);for(let e=0,t=a.length;e<t;++e)a[e].call(this,c)}finally{let e=this.emittingRegister.indexOf(d);e>=0&&this.emittingRegister.splice(e,1)}}return this}remitCursor(t,i){let n=this.stateMap[t]&&this.stateMap[t][i.state];if(n){let t=e.getIndex(i,n);t>=0&&n.splice(t,1)}return this}removeListener(e,t,i){let n=this.listenerMap[e]&&this.listenerMap[e][t];if(n){let e=n.indexOf(i);e>=0&&n.splice(e,1)}return this}}e.version="1.0.0";var t=e||(e={});function i(e,t){if("range"===e.type)return e;let i={type:"range",firstRow:e.row??(t&&t.firstRow)??0,lastRow:e.row??(t&&t.lastRow)??Number.MAX_VALUE,state:e.state};return void 0!==e.column&&(i.columns=[e.column]),i}return t.getIndex=function(e,t){if("position"===e.type){for(let i,n=0,s=t.length;n<s;++n)if("position"===(i=t[n]).type&&i.state===e.state&&i.column===e.column&&i.row===e.row)return n}else{let i=JSON.stringify(e.columns);for(let n,s=0,o=t.length;s<o;++s)if("range"===(n=t[s]).type&&n.state===e.state&&n.firstRow===e.firstRow&&n.lastRow===e.lastRow&&JSON.stringify(n.columns)===i)return s}return -1},t.isEqual=function(e,t){return"position"===e.type&&"position"===t.type?e.column===t.column&&e.row===t.row&&e.state===t.state:"range"===e.type&&"range"===t.type&&e.firstRow===t.firstRow&&e.lastRow===t.lastRow&&JSON.stringify(e.columns)===JSON.stringify(t.columns)},t.isInRange=function(e,t){"position"===t.type&&(t=i(t)),"position"===e.type&&(e=i(e,t));let n=e.columns,s=t.columns;return e.firstRow>=t.firstRow&&e.lastRow<=t.lastRow&&(!n||!s||n.every(e=>s.indexOf(e)>=0))},t.toPositions=function(e){if("position"===e.type)return[e];let t=e.columns||[],i=[],n=e.state;for(let s=e.firstRow,o=e.lastRow;s<o;++s){if(!t.length){i.push({type:"position",row:s,state:n});continue}for(let e=0,o=t.length;e<o;++e)i.push({type:"position",column:t[e],row:s,state:n})}return i},t.toRange=i,e}),i(t,"Data/DataPoolDefaults.js",[],function(){return{connectors:[]}}),i(t,"Data/DataPool.js",[t["Data/Connectors/DataConnector.js"],t["Data/DataPoolDefaults.js"],t["Core/Utilities.js"]],function(e,t,i){class n{constructor(e=t){e.connectors=e.connectors||[],this.connectors={},this.options=e,this.waiting={}}emit(e){i.fireEvent(this,e.type,e)}getConnector(e){let t=this.connectors[e];if(t?.loaded)return Promise.resolve(t);let i=this.waiting[e];if(!i){i=this.waiting[e]=[];let t=this.getConnectorOptions(e);if(!t)throw Error(`Connector '${e}' not found.`);this.loadConnector(t).then(t=>{delete this.waiting[e];for(let e=0,n=i.length;e<n;++e)i[e][0](t)}).catch(t=>{delete this.waiting[e];for(let e=0,n=i.length;e<n;++e)i[e][1](t)})}return new Promise((e,t)=>{i.push([e,t])})}getConnectorIds(){let e=this.options.connectors,t=[];for(let i=0,n=e.length;i<n;++i)t.push(e[i].id);return t}getConnectorOptions(e){let t=this.options.connectors;for(let i=0,n=t.length;i<n;++i)if(t[i].id===e)return t[i]}getConnectorTable(e){return this.getConnector(e).then(e=>e.table)}isNewConnector(e){return!this.connectors[e]}loadConnector(t){return new Promise((i,n)=>{this.emit({type:"load",options:t});let s=e.types[t.type];if(!s)throw Error(`Connector type not found. (${t.type})`);let o=this.connectors[t.id]=new s(t.options,t.dataTables);o.load().then(({converter:e,dataTables:n})=>{o.dataTables=n,o.converter=e,o.loaded=!0,this.emit({type:"afterLoad",options:t}),i(o)}).catch(n)})}cancelPendingRequests(){let{connectors:e}=this;for(let t of Object.keys(e))e[t].stopPolling()}on(e,t){return i.addEvent(this,e,t)}setConnectorOptions(e){let t=this.options.connectors,i=this.connectors;this.emit({type:"setConnectorOptions",options:e});for(let i=0,n=t.length;i<n;++i)if(t[i].id===e.id){t.splice(i,1);break}i[e.id]&&(i[e.id].stopPolling(),delete i[e.id]),t.push(e),this.emit({type:"afterSetConnectorOptions",options:e})}}return n.version="1.0.0",n}),i(t,"Dashboards/Board.js",[t["Dashboards/Actions/Bindings.js"],t["Dashboards/Components/ComponentRegistry.js"],t["Dashboards/Accessibility/DashboardsAccessibility.js"],t["Data/DataCursor.js"],t["Data/DataPool.js"],t["Dashboards/Globals.js"],t["Dashboards/Components/HTMLComponent/HTMLComponent.js"],t["Core/Utilities.js"]],function(t,i,n,s,o,r,a,l){let{merge:c,addEvent:h,error:d,objectEach:u,uniqueKey:p}=l;class m{static board(e,t,i){return new m(e,t).init(i)}constructor(e,t){this.componentTypes=i.types,this.options=c(m.defaultOptions,t),this.dataPool=new o(t.dataPool),this.id=p(),this.guiEnabled=!!t.gui&&this.options?.gui?.enabled,this.editModeEnabled=!!t.editMode&&this.options?.editMode?.enabled,this.layouts=[],this.mountedComponents=[],this.initContainer(e),this.initEditMode(),this.dataCursor=new s,this.index=r.boards.length,r.boards.push(this),this.a11y=new n(this)}init(e){let t=this.options,i=t.components?this.setComponents(t.components):[];return(this.initEvents(),e)?Promise.all(i).then(()=>(t.events?.mounted?.call(this),this)):(t.events?.mounted?.call(this),this)}initEvents(){let t=this,i=()=>{t.reflow()};if("function"==typeof ResizeObserver)this.resizeObserver=new ResizeObserver(i),this.resizeObserver.observe(t.container);else{let t=h(e,"resize",i);h(this,"destroy",t)}}initContainer(t){"string"==typeof t&&(t=e.document.getElementById(t)),t||d(13,!0),this.container=t}initEditMode(){if(Dashboards.EditMode)this.editMode=new Dashboards.EditMode(this,this.options.editMode);else if(this.editModeEnabled)throw Error("Missing layout.js module")}setComponents(e){let i=[];for(let n=0,s=e.length;n<s;++n)i.push(t.addComponent(e[n],this));return i}destroy(){let e=this;if(this.dataPool.cancelPendingRequests(),this.guiEnabled)for(let t=0,i=e.layouts?.length;t<i;++t)e.layouts[t].destroy();else for(let t of e.mountedComponents)t.component.destroy();this.resizeObserver?.unobserve(e.container),this.guiEnabled&&e.container?.remove(),u(e,function(t,i){delete e[i]}),r.boards[this.index]=void 0}reflow(){if(this.editMode){let e=this.editMode.tools;this.editMode.hideToolbars(["cell","row"]),this.editMode.hideContextPointer(),e.contextMenu&&e.contextMenu.updatePosition(e.contextButtonElement)}}getOptions(){let e={...this.options,components:[]};for(let t=0,i=this.mountedComponents.length;t<i;++t)this.mountedComponents[t].cell&&this.mountedComponents[t].cell.mountedComponent&&e.components?.push(this.mountedComponents[t].component.getOptions());if(this.guiEnabled){e.gui={layouts:[]};for(let t=0,i=this.layouts.length;t<i;++t)e.gui.layouts?.push(this.layouts[t].getOptions())}else delete e.gui;return e}getComponentById(e){return this.mountedComponents.find(t=>t.component.id===e)?.component}getComponentByCellId(e){return this.mountedComponents.find(t=>t.cell.id===e)?.component}}return(m||(m={})).defaultOptions={gui:{enabled:!0,layoutOptions:{rowClassName:void 0,cellClassName:void 0},layouts:[]},components:[]},i.registerComponent("HTML",a),m}),i(t,"Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridExtremesSync.js",[],function(){return{defaultOptions:{},syncPair:{emitter:void 0,handler:function(){if("DataGrid"!==this.type&&"Grid"!==this.type)return;let e=this,t=this.sync.syncConfig.extremes,i=t.group?":"+t.group:"",{board:n}=e,s=t=>{let i=t.cursor;if("position"===i.type&&e.dataGrid&&"number"==typeof i?.row){let{row:t}=i,{viewport:n}=e.dataGrid,s=n?.dataTable?.getLocalRowIndex(t);void 0!==s&&e.dataGrid.viewport?.scrollToRow(s)}};if(n)return(()=>{let{dataCursor:t}=n;if(!t)return;let o=e.connectorHandlers?.[0]?.connector?.table;o&&t.addListener(o.id,"xAxis.extremes.min"+i,s)})(),()=>{let t=e.connectorHandlers?.[0]?.connector?.table,{dataCursor:o}=n;t&&o.removeListener(t.id,"xAxis.extremes.min"+i,s)}}}}}),i(t,"Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridHighlightSync.js",[t["Core/Utilities.js"]],function(e){let{addEvent:t,removeEvent:i}=e;return{defaultOptions:{autoScroll:!1},syncPair:{emitter:function(){if("DataGrid"!==this.type&&"Grid"!==this.type)return;let{grid:e,board:n}=this,s=this.sync.syncConfig.highlight,o=s.group?":"+s.group:"";if(!n||!e||!s?.enabled)return;let{dataCursor:r}=n,a=this.getFirstConnector()?.getTable(this.dataTableKey),l=e=>{if(a){let t=e.target;r.emitCursor(a,{type:"position",row:t.row.id,column:t.column.id,state:"point.mouseOver"+o,sourceId:this.id})}},c=e=>{if(a){let t=e.target;r.emitCursor(a,{type:"position",row:t.row.id,column:t.column.id,state:"point.mouseOut"+o,sourceId:this.id})}};return t(e,"cellMouseOver",l),t(e,"cellMouseOut",c),function(){i(e.container,"cellMouseOver",l),i(e.container,"cellMouseOut",c)}},handler:function(){if("DataGrid"!==this.type&&"Grid"!==this.type)return;let e=this,{board:t}=e,i=e.sync.syncConfig.highlight,n=i.group?":"+i.group:"";if(!i?.enabled)return;let s=e.getFirstConnector()?.getTable(e.dataTableKey),o=t=>{let n=t.cursor;if(n.sourceId===e.id||"position"!==n.type)return;let{row:s,column:o}=n,{grid:r}=e,a=r?.viewport;if(void 0===s||!a)return;let l=a.dataTable.getLocalRowIndex(s);void 0!==l&&(i.autoScroll&&a.scrollToRow(l),r.syncRow(l),r.syncColumn(o))},r=t=>{let{grid:i}=e;i&&t.cursor.sourceId!==e.id&&(i.syncColumn(),i.syncRow())};if(t)return(()=>{let{dataCursor:e}=t;e&&s&&(e.addListener(s.id,"point.mouseOver"+n,o),e.addListener(s.id,"point.mouseOut"+n,r))})(),()=>{if(!s)return;let e=t.dataCursor;e.removeListener(s.id,"point.mouseOver"+n,o),e.removeListener(s.id,"point.mouseOut"+n,r)}}}}}),i(t,"Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridVisibilitySync.js",[],function(){return{defaultOptions:{},syncPair:{emitter:void 0,handler:function(){if("DataGrid"!==this.type&&"Grid"!==this.type)return;let e=this,t=this.sync.syncConfig.visibility,i=t.group?":"+t.group:"",{board:n}=e,s=t=>{let n=t.cursor,s=e.dataGrid;s&&"position"===n.type&&n.column&&s.updateColumn(n.column,{enabled:n.state!=="series.hide"+i})};if(n)return(()=>{let{dataCursor:t}=n;if(!t)return;let o=e.connectorHandlers?.[0]?.connector?.table;o&&(t.addListener(o.id,"series.show"+i,s),t.addListener(o.id,"series.hide"+i,s))})(),()=>{let t=e.connectorHandlers?.[0]?.connector?.table,{dataCursor:o}=n;t&&(o.removeListener(t.id,"series.show"+i,s),o.removeListener(t.id,"series.hide"+i,s))}}}}}),i(t,"Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridSyncs.js",[t["Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridExtremesSync.js"],t["Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridHighlightSync.js"],t["Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridVisibilitySync.js"]],function(e,t,i){return{defaultSyncPairs:{extremes:e.syncPair,highlight:t.syncPair,visibility:i.syncPair},defaultSyncOptions:{extremes:e.defaultOptions,highlight:t.defaultOptions,visibility:i.defaultOptions}}}),i(t,"Dashboards/Components/DataGridComponent/DataGridComponentDefaults.js",[t["Data/Converters/DataConverter.js"],t["Core/Utilities.js"]],function(e,t){let{uniqueKey:i}=t;return{gridClassName:"dataGrid-container",gridID:"dataGrid-"+i(),gridOptions:{},editableOptions:[{name:"connectorName",propertyPath:["connector","id"],type:"select"},{name:"title",propertyPath:["title"],type:"input"},{name:"caption",propertyPath:["caption"],type:"input"},{name:"Grid options",type:"nested",nestedOptions:[{name:"General",options:[{name:"Caption/title",propertyPath:["gridOptions","caption","text"],type:"input"},{name:"Columns resizing mode",propertyPath:["gridOptions","rendering","columns","resizing","mode"],type:"select",selectOptions:[{name:""},{name:"full"},{name:"fixed"},{name:"mixed"}]},{name:"Editable Grid",propertyPath:["gridOptions","columnDefaults","cells","editMode","enabled"],type:"toggle"},{name:"Resizable columns",propertyPath:["gridOptions","rendering","columns","resizing","enabled"],type:"toggle"},{name:"Sortable columns",propertyPath:["gridOptions","columnDefaults","sorting","sortable"],type:"toggle"},{name:"Cell text truncation",propertyPath:["gridOptions","rendering","rows","strictHeights"],type:"toggle"}]}]},{name:"Grid class name",propertyPath:["gridClassName"],type:"input"},{name:"Grid ID",propertyPath:["gridID"],type:"input"}],onUpdate:(t,i)=>{let n=t.target;if(n){let t=n.closest(".highcharts-datagrid-row"),s=n.closest(".highcharts-datagrid-cell");if(t&&t instanceof HTMLElement&&s&&s instanceof HTMLElement){let o=t.dataset.rowIndex,{columnName:r}=s.dataset;if(void 0!==o&&void 0!==r){let t=i.table;if(t){let i=new e().asGuessedType(n.value);i instanceof Date&&(i=i.toString()),t.setCell(r,Number(o),i)}}}}}}}),i(t,"Dashboards/Components/DataGridComponent/DataGridComponent.js",[t["Dashboards/Components/Component.js"],t["Dashboards/Components/DataGridComponent/DataGridSyncs/DataGridSyncs.js"],t["Dashboards/Components/DataGridComponent/DataGridComponentDefaults.js"],t["Core/Utilities.js"],t["Dashboards/Utilities.js"]],function(e,t,i,n,s){let{merge:o,diffObjects:r,getStyle:a}=n,{deepClone:l}=s;class c extends e{static get DataGridNamespace(){return c.GridNamespace}get dataGrid(){return this.grid}constructor(e,t,i){super(e,t=o(c.defaultOptions,t),i),this.options=t,this.type="Grid",this.setOptions()}async update(e){await super.update(e),this.setOptions(),this.grid&&(this.grid.update(o({},e.gridOptions,e.dataGridOptions),!1),this.grid?.viewport?.dataTable?.id!==this.getFirstConnector()?.table?.id&&this.grid.update({dataTable:this.getFirstConnector()?.table?.modified},!1),this.grid.renderViewport()),this.emit({type:"afterUpdate"})}render(){return super.render(),this.grid?this.grid.renderViewport():this.grid=this.constructGrid(),this.grid.initialContainerHeight=a(this.parentElement,"height",!0)||0,this.sync.start(),this.emit({type:"afterRender"}),this}resize(e,t){t?this.contentElement.style.minHeight="0":null===t&&this.contentElement.style.removeProperty("min-height"),this.resizeDynamicContent(e,t),this.grid?.viewport?.reflow()}onTableChanged(){let{grid:e}=this;if(!e)return;let t=this.getFirstConnector()?.getTable(this.dataTableKey);if(!t?.modified)return void e.update({dataTable:void 0});if(!e.options?.header){let i=t.modified.getColumnNames(),{columnOptionsMap:n,enabledColumns:s}=e,o=0;for(let r of i)if(n[r]?.options?.enabled!==!1){if(s?.[o]!==r)return void e.update({dataTable:t.modified});o++}}e.dataTable=t?.modified,e.querying.shouldBeUpdated=!0,e.viewport?.updateRows()}getEditableOptions(){let e=this.options;return l(o({gridOptions:this.grid?.options},e),["editableOptions","dataTable"])}getOptionsOnDrop(e){let t=e.editMode.board.dataPool.getConnectorIds(),i={cell:"",type:"Grid"};return t.length&&(i={...i,connector:{id:t[0]}}),i}getOptions(){let e=o(this.options);return e.connector?.id?delete e.gridOptions?.dataTable:e.gridOptions?.dataTable?.id&&(e.gridOptions.dataTable={columns:e.gridOptions.dataTable.columns}),{...r(e,c.defaultOptions),type:"Grid"}}destroy(){this.sync.stop(),this.grid?.destroy(),super.destroy()}setOptions(){let e=this.options,t=e.gridClassName||e.dataGridClassName,n=e.gridID||e.dataGridID;t&&(this.contentElement.classList.value=i.className+" "+t),n&&(this.contentElement.id=n)}constructGrid(){let e=c.GridNamespace;if(!e)throw Error("Grid not connected.");let t=this.getFirstConnector()?.getTable(this.dataTableKey),i=this.options,n=o({},i.gridOptions,i.dataGridOptions);t&&(n.dataTable=t.modified);let s=new e.Grid(this.contentElement,n);return this.options.gridOptions=s.options,s}}return c.predefinedSyncConfig=t,c.defaultOptions=o(e.defaultOptions,i),c}),i(t,"Dashboards/Plugins/DataGridPlugin.js",[t["Dashboards/Components/DataGridComponent/DataGridComponent.js"]],function(e){function t(t){e.GridNamespace=t}return{custom:{connectDataGrid:function(e){t(e)},connectGrid:t},name:"DataGrid.DashboardsPlugin",onRegister:function(t){let{ComponentRegistry:i}=t;i.registerComponent("DataGrid",e),i.registerComponent("Grid",e)},onUnregister:function(e){}}}),i(t,"Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsExtremesSync.js",[t["Core/Utilities.js"]],function(e){let{addEvent:t,isString:i}=e;return{defaultOptions:{},syncPair:{emitter:function(){if("Highcharts"!==this.type)return;let e=this,n=[],{chart:s,board:o}=e,r=e.connectorHandlers?.[0]?.connector,a=r&&r.table,l=this.sync.syncConfig.extremes,c=l.group?":"+l.group:"",{dataCursor:h}=o;if(a&&s){let o=t=>{let n=!!t.resetSelection;if((!t.trigger||t.trigger&&"dashboards-sync"!==t.trigger)&&!n){let n=t.target,o=Object.keys(e.seriesFromConnector),r=o.length>0?s.get(o[0]):n.series[0];if(r){let s=r.points.filter(e=>e.isInside||!1),l={type:"position",state:`${n.coll}.extremes.min${c}`},d={type:"position",state:`${n.coll}.extremes.max${c}`};if(o.length>0&&"xAxis"===n.coll&&s.length){let t,o=(e.connectorHandlers[0]?.options).columnAssignment;if(o){let e=o.find(e=>e.seriesId===r.options.id);if(e){let n=e.data;t=i(n)?n:Array.isArray(n)?n[n.length-1]:n.y}}t||(t=n.dateTime&&(a.hasColumns(["x"])?"x":r.options.id??r.name)),l.row=s[0].index,l.column=t,d.row=s[s.length-1].index,d.column=t}h.emitCursor(a,l,t,!0).emitCursor(a,d,t,!0)}}},r=()=>s.axes.map(e=>t(e,"afterSetExtremes",o)),l=r(),d=()=>{l.forEach(e=>{e()}),l=[]};n.push(t(s,"selection",e=>{e.resetSelection&&(d(),h.emitCursor(a,{type:"position",state:"chart.zoomOut"+c},e),l.push(...r()))})),n.push(()=>{h.remitCursor(a.id,{type:"position",state:"xAxis.extremes.min"+c}),h.remitCursor(a.id,{type:"position",state:"xAxis.extremes.max"+c}),d()})}return function(){n.forEach(e=>{e()})}},handler:function(){if("Highcharts"!==this.type)return;let e=this,t=this.sync.syncConfig.extremes,i=t.group?":"+t.group:"",{chart:n,board:s}=e;if(n&&s&&n.zooming?.type){let t=n.zooming.type.split("").map(e=>e+"Axis"),o=[];return t.forEach(t=>{let r=e=>{let{cursor:i,event:s}=e;if("position"===i.type){let e=s?.target;if(e&&n){let i=n[t],s=!1;i.forEach(t=>{e.coll===t.coll&&e!==t&&null!==e.min&&null!==e.max&&(t.max!==e.max||t.min!==e.min)&&(t.setExtremes(e.min,e.max,!1,void 0,{trigger:"dashboards-sync"}),s=!0)}),s&&!n.resetZoomButton&&n.showResetZoom(),n.redraw()}}};s&&(()=>{let{dataCursor:a}=s,l=e.connectorHandlers?.[0]?.connector;if(l){let{table:s}=l;a.addListener(s.id,`${t}.extremes.min${i}`,r),a.addListener(s.id,`${t}.extremes.max${i}`,r);let c=()=>{n.zoomOut(),setTimeout(()=>{e.element.querySelectorAll(".highcharts-reset-zoom").forEach(e=>{e.remove()})})};a.addListener(s.id,"chart.zoomOut",c),o.push(()=>{a.removeListener(s.id,`${t}.extremes.min${i}`,r),a.removeListener(s.id,`${t}.extremes.max${i}`,r),a.removeListener(s.id,"chart.zoomOut"+i,c)})}})()}),function(){o.forEach(e=>{e()})}}}}}}),i(t,"Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsHighlightSync.js",[t["Dashboards/Utilities.js"]],function(e){let{error:t}=e;return{defaultOptions:{affectedSeriesId:null,highlightPoint:!0,showTooltip:!0,showCrosshair:!0},syncPair:{emitter:function(){if("Highcharts"!==this.type)return;let e=this,{chart:t,board:i}=e,n=this.sync.syncConfig.highlight,s=n.group?":"+n.group:"";if(!n.enabled||!t)return;let{dataCursor:o}=i;for(let i=0,n=t.series?.length??0;i<n;++i){let n,r=t.series[i],a=r.options.id??"",l=e.seriesFromConnector[a],c=l?.connector?.table;if(!c)continue;let h=c?.modified,d=l.columnAssignment?.find(e=>e.seriesId===a);if(d){let{data:e}=d;n="string"==typeof e?e:Array.isArray(e)?e[1]:e.y??e.value}n||(n=r.name),r.update({point:{events:{mouseOver:function(){o.emitCursor(c,{type:"position",row:h.getOriginalRowIndex(this.index),column:n,state:"point.mouseOver"+s,sourceId:e.id})},mouseOut:function(){o.emitCursor(c,{type:"position",row:h.getOriginalRowIndex(this.index),column:n,state:"point.mouseOut"+s,sourceId:e.id})}}}},!1)}return t.redraw(),function(){t&&t.series&&(t.series.forEach(e=>{e.update({point:{events:{mouseOver:void 0,mouseOut:void 0}}},!1)}),t.redraw())}},handler:function(){if("Highcharts"!==this.type)return;let e=this,i=this.sync.syncConfig.highlight.group?":"+this.sync.syncConfig.highlight.group:"",{chart:n,board:s}=e,o=i=>{let{table:s,cursor:o}=i,r=this.sync.syncConfig.highlight;if(n&&n.series?.length&&"position"===o.type){let i,a=r.affectedSeriesId;if(r.affectedSeriesId){let e=n.get(r.affectedSeriesId);e?.points?i=e:t("No series with ID '"+a+"' found in the chart. Affected series will be selected according to the column assignment.")}if(!i){let t=Object.keys(e.seriesFromConnector);for(let r=0,a=t.length;r<a;++r){let a=t[r],l=e.seriesFromConnector[a];if(l?.connector?.table!==s)continue;let c=l.columnAssignment;if(i=n.get(a),!c)break;let{data:h}=c.find(e=>e.seriesId===a)??{};if(!h||!o.column)break;if("string"==typeof h){if(h===o.column)break}else if(Array.isArray(h)){if(h.includes(o.column))break}else if(Object.keys(h).map(e=>h[e]).includes(o.column))break}}let l=o.row;if(i?.visible&&void 0!==l){let e=s.modified.getLocalRowIndex(l);if(void 0===e)return;let t=i.data[e];if(t?.visible)return t}}},r=t=>{let i=this.sync.syncConfig.highlight;if(!i.enabled||t.cursor.sourceId===e.id)return;let s=o(t);if(!s||!n||!s.isInside&&s.series.isCartesian||s===n.hoverPoint)return;let r=n.tooltip;if(r&&i.showTooltip){let e=r.shared,t=n.hoverPoint,i=t?.series||n.hoverSeries,o=n.pointer?.getHoverData(s,i,n.series,!0,!0);n.tooltip&&o?.hoverPoints.length&&r.refresh(e?o.hoverPoints:s)}i.highlightPoint&&(!r?.shared&&i.showTooltip||!i.showTooltip)&&s.setState("hover"),i.showCrosshair&&(s.series.xAxis?.drawCrosshair(void 0,s),s.series.yAxis?.drawCrosshair(void 0,s))},a=t=>{let i=this.sync.syncConfig.highlight;if(!n||!n.series.length||!i.enabled||t.cursor.sourceId===e.id)return;let s=o(t);if(s&&(!s.isInside&&s.series.isCartesian||s===n.hoverPoint))return;let r=!1,a=()=>{let e=n.series.length;for(let t=0;t<e;t++){let e=n.series[t].points,i=e.length;for(let t=0;t<i;t++)e[t].setState()}},l=n.tooltip;if(l&&i.showTooltip&&(l.hide(),l.shared&&(a(),r=!0)),i.highlightPoint&&!r&&(s?s.setState():a()),i.showCrosshair)if(s)s.series.xAxis?.drawCrosshair(),s.series.yAxis?.drawCrosshair();else{let e=n.xAxis,t=n.yAxis;for(let t=0,i=e.length;t<i;t++)e[t].drawCrosshair();for(let e=0,i=t.length;e<i;e++)t[e].drawCrosshair()}};if(s)return(()=>{let{dataCursor:e}=s,{connectorHandlers:t}=this;if(e)for(let n=0,s=t.length;n<s;++n){let s=t[n]?.connector?.table;s&&(e.addListener(s.id,"point.mouseOver"+i,r),e.addListener(s.id,"point.mouseOut"+i,a))}})(),()=>{let{dataCursor:e}=s,{connectorHandlers:t}=this;if(e)for(let n=0,s=t.length;n<s;++n){let s=t[n]?.connector?.table;s&&(e.removeListener(s.id,"point.mouseOver"+i,r),e.removeListener(s.id,"point.mouseOut"+i,a))}}}}}}),i(t,"Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsVisibilitySync.js",[],function(){return{defaultOptions:{},syncPair:{emitter:function(){if("Highcharts"!==this.type)return;let e=this.sync.syncConfig.visibility,t=e.group?":"+e.group:"",{chart:i,board:n}=this,s=this.getFirstConnector();if(!n||!i)return;let o=s?.table;if(o){let{dataCursor:e}=n,{series:s}=i;s.forEach(i=>{i.update({events:{show:function(){e.emitCursor(o,{type:"position",state:"series.show"+t,column:this.name})},hide:function(){e.emitCursor(o,{type:"position",state:"series.hide"+t,column:this.name})}}},!1)}),i.redraw()}return function(){i&&i.series?.length&&(i.series.forEach(e=>{e.update({events:{show:void 0,hide:void 0}},!1)}),i.redraw())}},handler:function(){if("Highcharts"!==this.type)return;let e=this,t=this.sync.syncConfig.visibility,i=t.group?":"+t.group:"",{board:n}=e,s=(e,t)=>{for(let i of e)if(i.name===t)return i},o=t=>{let i=e.chart;if(i&&i.series?.length&&"position"===t.cursor.type&&void 0!==t.cursor.column){let e=s(i.series,t.cursor.column);e&&e.setVisible(!0,!0)}},r=t=>{let i=e.chart;if(i&&i.series?.length&&"position"===t.cursor.type&&void 0!==t.cursor.column){let e=s(i.series,t.cursor.column);e&&e.setVisible(!1,!0)}};if(n)return(()=>{let{dataCursor:t}=n;if(!t)return;let s=e.connectorHandlers?.[0]?.connector?.table;s&&(t.addListener(s.id,"series.show"+i,o),t.addListener(s.id,"series.hide"+i,r))})(),()=>{let t=e.connectorHandlers?.[0]?.connector?.table;t&&(n.dataCursor.removeListener(t.id,"series.show"+i,o),n.dataCursor.removeListener(t.id,"series.hide"+i,r))}}}}}),i(t,"Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsSyncs.js",[t["Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsExtremesSync.js"],t["Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsHighlightSync.js"],t["Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsVisibilitySync.js"]],function(e,t,i){return{defaultSyncPairs:{extremes:e.syncPair,highlight:t.syncPair,visibility:i.syncPair},defaultSyncOptions:{extremes:e.defaultOptions,highlight:t.defaultOptions,visibility:i.defaultOptions}}}),i(t,"Dashboards/Components/HighchartsComponent/HighchartsComponentDefaults.js",[t["Dashboards/Components/Component.js"],t["Core/Utilities.js"]],function(e,t){let{merge:i,uniqueKey:n}=t;return{allowConnectorUpdate:!0,className:[e.defaultOptions.className,`${e.defaultOptions.className}-highcharts`].join(" "),chartClassName:"chart-container",chartID:"chart-"+n(),chartOptions:{series:[]},chartConstructor:"chart",editableOptions:[{name:"connectorName",propertyPath:["connector","id"],type:"select"},...e.defaultOptions.editableOptions||[],{name:"chartOptions",type:"nested",nestedOptions:[{name:"chart",options:[{name:"title",propertyPath:["chartOptions","title","text"],type:"input"},{name:"subtitle",propertyPath:["chartOptions","subtitle","text"],type:"input"},{name:"type",propertyPath:["chartOptions","chart","type"],type:"select",selectOptions:[{name:"column",iconURL:"series-types/icon-column.svg"},{name:"line",iconURL:"series-types/icon-line.svg"},{name:"scatter",iconURL:"series-types/icon-scatter.svg"},{name:"pie",iconURL:"series-types/icon-pie.svg"}]}]},{name:"xAxis",options:[{name:"title",propertyPath:["chartOptions","xAxis","title","text"],type:"input"},{name:"type",propertyPath:["chartOptions","xAxis","type"],type:"select",selectOptions:[{name:"linear"},{name:"datetime"},{name:"logarithmic"}]}]},{name:"yAxis",options:[{name:"title",propertyPath:["chartOptions","yAxis","title","text"],type:"input"},{name:"type",propertyPath:["chartOptions","yAxis","type"],type:"select",selectOptions:[{name:"linear"},{name:"datetime"},{name:"logarithmic"}]}]},{name:"legend",showToggle:!0,propertyPath:["chartOptions","legend","enabled"],options:[{name:"align",propertyPath:["chartOptions","legend","align"],type:"select",selectOptions:[{name:"left"},{name:"center"},{name:"right"}]}]},{name:"tooltip",showToggle:!0,propertyPath:["chartOptions","tooltip","enabled"],options:[{name:"split",propertyPath:["chartOptions","tooltip","split"],type:"toggle"}]},{name:"dataLabels",propertyPath:["chartOptions","plotOptions","series","dataLabels","enabled"],showToggle:!0,options:[{name:"align",propertyPath:["chartOptions","plotOptions","series","dataLabels","align"],type:"select",selectOptions:[{name:"left"},{name:"center"},{name:"right"}]}]},{name:"credits",showToggle:!0,propertyPath:["chartOptions","credits","enabled"],options:[{name:"name",propertyPath:["chartOptions","credits","text"],type:"input"},{name:"url",propertyPath:["chartOptions","credits","href"],type:"input"}]}]},{name:"chartConfig",propertyPath:["chartOptions"],type:"textarea"},{name:"chartClassName",propertyPath:["chartClassName"],type:"input"},{name:"chartID",propertyPath:["chartID"],type:"input"}],editableOptionsBindings:i(e.defaultOptions.editableOptionsBindings,{skipRedraw:["chartOptions","chartConfig"]})}}),i(t,"Dashboards/Components/HighchartsComponent/HighchartsComponent.js",[t["Dashboards/Components/Component.js"],t["Data/Converters/DataConverter.js"],t["Data/DataTable.js"],t["Dashboards/Globals.js"],t["Dashboards/Components/HighchartsComponent/HighchartsSyncs/HighchartsSyncs.js"],t["Dashboards/Components/HighchartsComponent/HighchartsComponentDefaults.js"],t["Dashboards/Utilities.js"],t["Core/Utilities.js"]],function(e,t,i,n,s,o,r,a){let{createElement:l,diffObjects:c,isString:h,merge:d,splat:u}=a,{deepClone:p}=r;class m extends e{constructor(e,t,i){for(let n of(super(e,t=d(m.defaultOptions,t),i),this.seriesFromConnector={},this.options=t,this.chartConstructor=this.options.chartConstructor||"chart",this.type="Highcharts",this.chartContainer=l("figure",void 0,void 0,this.contentElement,!0),this.setOptions(),this.chartOptions=d(this.options.chartOptions||{chart:{}},{tooltip:{}}),this.connectorHandlers)){let e=n.connector;e&&e.on("afterLoad",t=>{let i,n=t.tables;i=this.dataTableKey?n[this.dataTableKey]:Object.values(n)[0],e.getTable(this.dataTableKey).setColumns(i.getColumns())})}this.innerResizeTimeouts=[]}onTableChanged(){this.updateSeries()}async load(){return this.emit({type:"load"}),await super.load(),this.emit({type:"afterLoad"}),this}render(){return super.render(),this.chart=this.getChart(),this.updateSeries(),this.emit({type:"afterRender"}),this.setupConnectorUpdate(),this.sync.start(),this}resize(e,t){for(this.resizeDynamicContent(e,t);this.innerResizeTimeouts.length;){let e=this.innerResizeTimeouts.pop();e&&clearTimeout(e)}return this.innerResizeTimeouts.push(setTimeout(()=>{if(this.chart&&this.chart.container){let e=this.contentElement.offsetHeight-this.chart?.container.offsetHeight;this.chart.setSize(null,Math.abs(e)>1?this.contentElement.offsetHeight:null,!1)}},33)),this}setupConnectorUpdate(){let{connectorHandlers:e,chart:t}=this;if(!t||!this.options.allowConnectorUpdate)return;let i=t.series.length;for(let n=0,s=e.length;n<s;n++){let s=e[n];for(let e=0;e<i;e++)t.series[e].update({point:{events:{update:e=>{this.onChartUpdate(e.target,s)}}}},!1)}}onChartUpdate(e,i){let n,s=i.connector?.getTable(this.dataTableKey),o=i.columnAssignment,r=e.series.options.id,a=new t().asNumber(e.y);if(s){if(o&&r){let e=o.find(e=>e.seriesId===r)?.data;h(e)?n=e:Array.isArray(e)?n=e[1]:e&&(n=e.y??e.value)}n||(n=r??e.series.name),s.setCell(n,e.index,a)}}setOptions(){this.options.chartClassName&&(this.chartContainer.classList.value=o.className+" "+this.options.chartClassName),this.options.chartID&&(this.chartContainer.id=this.options.chartID)}async update(e,t=!0){await super.update(e,!1),this.setOptions(),this.options.chartConstructor!==this.chartConstructor?(this.chartConstructor=this.options.chartConstructor||"chart",this.chartOptions=this.options.chartOptions||{},this.chart?.destroy(),delete this.chart):this.chart?.update(d(this.options.chartOptions)||{}),this.emit({type:"afterUpdate"}),t&&this.render()}updateSeries(){let{chart:e}=this,t=this.connectorHandlers;if(!e)return;let i=[];for(let e of t){let t=e.options.columnAssignment,n=e.connector,s=this.dataTableKey;if(n&&s&&e.setTable(n.dataTables[s]),!t&&e.presentationTable&&(t=this.getDefaultColumnAssignment(e.presentationTable.getColumnNames(),e.presentationTable)),t)for(let{seriesId:n}of(e.columnAssignment=t,t))n&&i.push(n)}let n=Object.keys(this.seriesFromConnector);for(let t=0,s=n.length;t<s;++t){let s=n[t];if(i.some(e=>e===s))continue;let o=e.get(s);o&&o.destroy()}for(let e of(this.seriesFromConnector={},t))this.updateSeriesFromConnector(e);e.redraw()}updateSeriesFromConnector(e){let t=this.chart;if(!e.connector||!t||!e.presentationTable)return;let n=e.presentationTable.modified,s=e.presentationTable.getModifier()?.options,o=e.columnAssignment??[];for(let r=0,a=o.length;r<a;++r){let a=o[r],l=a.data,c=t.get(a.seriesId),d={},u=e=>{s?.type==="Math"&&s.columnFormulas?.some(t=>e(t.column))&&(d.dragDrop={draggableY:!1})};if(h(l)){let e=n.getColumn(l);e&&(d.data=e.slice()),u(e=>e===l)}else if(Array.isArray(l))d.data=new i({columns:n.getColumns(l)}).getRows(),u(e=>l.some(t=>t===e));else{let e=Object.keys(l),t=[];for(let i=0,n=e.length;i<n;++i)t.push(l[e[i]]);let s=new i({columns:n.getColumns(t)});d.keys=e,d.data=s.getRows(),u(e=>t.some(t=>t===e))}c?c.update(d,!1):t.addSeries({name:a.seriesId,id:a.seriesId,...d},!1),this.seriesFromConnector[a.seriesId]=e}}getChart(){return this.chart||this.createChart()}destroy(){this.chart?.destroy(),super.destroy()}getDefaultColumnAssignment(e=[],t){let i=[],n=t.getColumn(e[0]);if(n&&h(n[0])){for(let t=1,n=e.length;t<n;++t)i.push({seriesId:e[t],data:[e[0],e[t]]});return i}for(let t=0,n=e.length;t<n;++t)i.push({seriesId:e[t],data:e[t]});return i}createChart(){let e=m.charter||n.win.Highcharts;this.chartConstructor||(this.chartConstructor="chart");let t=e[this.chartConstructor];if(t)try{if("chart"===this.chartConstructor)return e.Chart.chart(this.chartContainer,this.chartOptions);return new t(this.chartContainer,this.chartOptions)}catch(e){throw Error(`The Highcharts component in cell '${this.cell.id}' is misconfigured. 
____________
${e}`)}if("function"!=typeof e.chart)throw Error("Chart constructor not found");return this.chart}registerChartEvents(){if(this.chart&&this.chart.options){let e=this.chart.options;["chart","series","yAxis","xAxis","colorAxis","annotations","navigation"].map(t=>{let i=e[t]||{};return!Array.isArray(i)&&i.events&&(i=[i]),i&&"object"==typeof i&&Array.isArray(i)&&i.reduce((e,i,n)=>(i&&i.events&&(e[i.id||`${t}-${n}`]=i.events),e),{})||{}}).forEach(e=>{Object.keys(e).forEach(t=>{let i=e[t];Object.keys(i).forEach(e=>{this.callbackRegistry.addCallback(`${t}-${e}`,{type:"seriesEvent",func:i[e]})})})})}}getOptionsOnDrop(e){let t=e.editMode.board.dataPool.getConnectorIds(),i={cell:"",type:"Highcharts",chartOptions:{chart:{animation:!1,type:"column",zooming:{}}}};return t.length&&(i={...i,connector:{id:t[0]}}),i}getOptions(){return{...c(this.options,m.defaultOptions),type:"Highcharts"}}getEditableOptions(){let e=this.options,t=this.chart,i=t&&t.options,n=i?.chart?.type||"line";return p(d({chartOptions:i},{chartOptions:{yAxis:u(t&&t.yAxis[0].options),xAxis:u(t&&t.xAxis[0].options),plotOptions:{series:(i&&i.plotOptions||{})[n]}}},e),["dataTable","points","series","data","editableOptions"])}getEditableOptionValue(e){if(e)return 1===e.length&&"chartOptions"===e[0]?JSON.stringify(this.options.chartOptions,null,2):super.getEditableOptionValue.call(this,e)}}return m.predefinedSyncConfig=s,m.defaultOptions=d(e.defaultOptions,o),m}),i(t,"Dashboards/Components/KPIComponent/KPISyncs/KPIExtremesSync.js",[t["Core/Utilities.js"]],function(e){let{defined:t}=e;return{defaultOptions:{},syncPair:{emitter:void 0,handler:function(){if("KPI"!==this.type)return;let e=this,i=this.sync.syncConfig.extremes,n=i.group?":"+i.group:"",{board:s}=this,o=i=>{let n=i.cursor;if("position"===n.type&&"number"==typeof n?.row&&t(n.column)&&e.connectorHandlers?.[0]?.connector&&!t(e.options.value)){let t=e.connectorHandlers[0].connector.table.modified.getCellAsString(n.column,n.row);e.setValue(t)}};if(s)return(()=>{let{dataCursor:e}=s;if(!e)return;let t=this.getFirstConnector()?.table;t&&e.addListener(t.id,"xAxis.extremes.max"+n,o)})(),()=>{let e=this.getFirstConnector()?.table,{dataCursor:t}=s;e&&t.removeListener(e.id,"xAxis.extremes.max"+n,o)}}}}}),i(t,"Dashboards/Components/KPIComponent/KPISyncs/KPISyncs.js",[t["Dashboards/Components/KPIComponent/KPISyncs/KPIExtremesSync.js"]],function(e){return{defaultSyncPairs:{extremes:e.syncPair},defaultSyncOptions:{extremes:e.defaultOptions}}}),i(t,"Dashboards/Components/KPIComponent/KPIComponentDefaults.js",[t["Dashboards/Components/Component.js"]],function(e){return{type:"KPI",className:[e.defaultOptions.className,`${e.defaultOptions.className}-kpi`].join(" "),minFontSize:20,thresholdColors:["#f45b5b","#90ed7d"],editableOptions:[{name:"connectorName",propertyPath:["connector","id"],type:"select"},...e.defaultOptions.editableOptions||[],{name:"Value",type:"input",propertyPath:["value"]},{name:"Column name",type:"input",propertyPath:["columnName"]},{name:"Value format",type:"input",propertyPath:["valueFormat"]}],linkedValueTo:{enabled:!0,seriesIndex:0,pointIndex:0}}}),i(t,"Data/Formula/FormulaTypes.js",[],function(){let e=["+","-","*","/","^","=","<","<=",">",">="];return{isFormula:function(e){return e instanceof Array},isFunction:function(e){return"object"==typeof e&&!(e instanceof Array)&&"function"===e.type},isOperator:function(t){return"string"==typeof t&&e.indexOf(t)>=0},isRange:function(e){return"object"==typeof e&&!(e instanceof Array)&&"range"===e.type},isReference:function(e){return"object"==typeof e&&!(e instanceof Array)&&"reference"===e.type},isValue:function(e){return"boolean"==typeof e||"number"==typeof e||"string"==typeof e}}}),i(t,"Data/Formula/FormulaProcessor.js",[t["Data/Formula/FormulaTypes.js"],t["Core/Utilities.js"]],function(e,t){let{isFormula:i,isFunction:n,isOperator:s,isRange:o,isReference:r,isValue:a}=e,{defined:l}=t,c=/ */,h=Number.MAX_VALUE/1.000000000001,d=Number.MAX_VALUE/1.000000000002,u=Number.MAX_VALUE,p={"^":3,"*":2,"/":2,"+":1,"-":1,"=":0,"<":0,"<=":0,">":0,">=":0},m={},f=/^[A-Z][A-Z\.]*$/;function g(e){switch(typeof e){case"boolean":return e?u:h;case"string":return d;case"number":return e;default:return NaN}}function y(e){return"string"==typeof e?e.toLowerCase().replace(c,"\0"):e}function b(e){switch(typeof e){case"boolean":return+!!e;case"string":return parseFloat(e.replace(",","."));case"number":return e;default:return NaN}}function C(e,t){return a(e)?e:o(e)?t&&v(e,t)||[]:n(e)?D(e,t):O(i(e)?e:[e],t)}function v(e,t){let i=t.getColumnNames().slice(e.beginColumn,e.endColumn+1),n=[];for(let s=0,o=i.length,r;s<o;++s){let o=t.getColumn(i[s],!0)||[];for(let l=e.beginRow,c=e.endRow+1;l<c;++l)"string"==typeof(r=o[l])&&"="===r[0]&&t!==t.modified&&(r=t.modified.getCell(i[s],l)),n.push(a(r)?r:NaN)}return n}function w(e,t){let i=t.getColumnNames()[e.column];if(i){let n=t.getCell(i,e.row);if("string"==typeof n&&"="===n[0]&&t!==t.modified){let n=t.modified.getCell(i,e.row);return a(n)?n:NaN}if(a(n))return e.isNegative?-n:n}return NaN}function T(e,t){(e.length<2||t.length<1)&&e.push(NaN);let i=e.pop(),n=e.pop(),s=t.pop();l(i)&&l(n)&&l(s)?e.push(function(e,t,i){let n;switch(e){case"=":return y(t)===y(i);case"<":if(typeof t==typeof i)return y(t)<y(i);return g(t)<g(i);case"<=":if(typeof t==typeof i)return y(t)<=y(i);return g(t)<=g(i);case">":if(typeof t==typeof i)return y(t)>y(i);return g(t)>g(i);case">=":if(typeof t==typeof i)return y(t)>=y(i);return g(t)>=g(i)}switch(t=b(t),i=b(i),e){case"+":n=t+i;break;case"-":n=t-i;break;case"*":n=t*i;break;case"/":n=t/i;break;case"^":n=Math.pow(t,i);break;default:return NaN}return n%1?Math.round(1e9*n)/1e9:n}(s,n,i)):e.push(NaN)}function O(e,t){let o=[],l=[],c=!0;for(let h=0,d=e.length;h<d;++h){let d,u=e[h];if(s(u)){if(c&&"-"===u)o.push(0),l.push("-"),c=!0;else{for(;l.length&&p[l[l.length-1]]>=p[u];)T(o,l);l.push(u),c=!0}continue}if(a(u))d=u;else if(r(u))d=t?w(u,t):NaN;else if(n(u)){let e=D(u,t);d=a(e)?e:NaN}else i(u)&&(d=O(u,t));if(void 0===d)return NaN;o.push(d),c=!1}for(;l.length;)T(o,l);return 1!==o.length?NaN:o[0]}function D(e,t,i){let n=m[e.name];if(n)try{return n(e.args,t)}catch{return NaN}let s=Error(`Function "${e.name}" not found.`);throw s.name="FormulaProcessError",s}return{asNumber:b,getArgumentValue:C,getArgumentsValues:function(e,t){let i=[];for(let n=0,s=e.length;n<s;++n)i.push(C(e[n],t));return i},getRangeValues:v,getReferenceValue:w,processFormula:O,processorFunctions:m,registerProcessorFunction:function(e,t){return f.test(e)&&!m[e]&&!!(m[e]=t)},translateReferences:function e(t,i=0,s=0){for(let a=0,l=t.length,c;a<l;++a)(c=t[a])instanceof Array?e(c,i,s):n(c)?e(c.args,i,s):o(c)?(c.beginColumnRelative&&(c.beginColumn+=i),c.beginRowRelative&&(c.beginRow+=s),c.endColumnRelative&&(c.endColumn+=i),c.endRowRelative&&(c.endRow+=s)):r(c)&&(c.columnRelative&&(c.column+=i),c.rowRelative&&(c.row+=s));return t}}}),i(t,"Data/Formula/Functions/SUM.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(i,n){let s=e.getArgumentsValues(i,n),o=0;for(let e=0,i=s.length,r;e<i;++e)switch(typeof(r=s[e])){case"number":isNaN(r)||(o+=r);break;case"object":o+=t(r,n)}return o}return e.registerProcessorFunction("SUM",t),t}),i(t,"Data/Formula/Functions/AVERAGE.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function i(e,i){let n=t(e,i),s=0,o=0;for(let e=0,t=n.length,i;e<t;++e)switch(typeof(i=n[e])){case"number":isNaN(i)||(++s,o+=i);break;case"object":for(let e=0,t=i.length,n;e<t;++e)"number"!=typeof(n=i[e])||isNaN(n)||(++s,o+=n)}return s?o/s:0}return e.registerProcessorFunction("AVERAGE",i),i}),i(t,"Data/Formula/Functions/MEDIAN.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(t,i){let n=[],s=e.getArgumentsValues(t,i);for(let e=0,t=s.length,i;e<t;++e)switch(typeof(i=s[e])){case"number":isNaN(i)||n.push(i);break;case"object":for(let e=0,t=i.length,s;e<t;++e)"number"!=typeof(s=i[e])||isNaN(s)||n.push(s)}let o=n.length;if(!o)return NaN;let r=Math.floor(o/2);return o%2?n[r]:(n[r-1]+n[r])/2}return e.registerProcessorFunction("MEDIAN",t),t}),i(t,"Data/Formula/Functions/MAX.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function i(e,n){let s=t(e,n),o=Number.NEGATIVE_INFINITY;for(let e=0,t=s.length,n;e<t;++e)switch(typeof(n=s[e])){case"number":n>o&&(o=n);break;case"object":(n=i(n))>o&&(o=n)}return isFinite(o)?o:0}return e.registerProcessorFunction("MAX",i),i}),i(t,"Data/Formula/Functions/MIN.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function i(e,n){let s=t(e,n),o=Number.POSITIVE_INFINITY;for(let e=0,t=s.length,n;e<t;++e)switch(typeof(n=s[e])){case"number":n<o&&(o=n);break;case"object":(n=i(n))<o&&(o=n)}return isFinite(o)?o:0}return e.registerProcessorFunction("MIN",i),i}),i(t,"Data/Formula/Functions/COUNT.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){function t(i,n){let s=e.getArgumentsValues(i,n),o=0;for(let e=0,i=s.length,r;e<i;++e)switch(typeof(r=s[e])){case"number":!isNaN(r)&&++o;break;case"object":o+=t(r,n)}return o}return e.registerProcessorFunction("COUNT",t),t}),i(t,"Data/Formula/Functions/PRODUCT.js",[t["Data/Formula/FormulaProcessor.js"]],function(e){let{getArgumentsValues:t}=e;function i(e,n){let s=t(e,n),o=1,r=!1;for(let e=0,t=s.length,a;e<t;++e)switch(typeof(a=s[e])){case"number":isNaN(a)||(r=!0,o*=a);break;case"object":r=!0,o*=i(a,n)}return r?o:0}return e.registerProcessorFunction("PRODUCT",i),i}),i(t,"Core/Chart/ChartDefaults.js",[],function(){return{alignThresholds:!1,panning:{enabled:!1,type:"x"},styledMode:!1,borderRadius:0,colorCount:10,allowMutatingData:!0,ignoreHiddenSeries:!0,spacing:[10,10,15,10],resetZoomButton:{theme:{},position:{}},reflow:!0,type:"line",zooming:{singleTouch:!1,resetButton:{theme:{zIndex:6},position:{align:"right",x:-10,y:10}}},width:null,height:null,borderColor:"#334eff",backgroundColor:"#ffffff",plotBorderColor:"#cccccc"}}),i(t,"Core/Color/Palettes.js",[],function(){return{colors:["#2caffe","#544fc5","#00e272","#fe6a35","#6b8abc","#d568fb","#2ee0ca","#fa4b42","#feb56a","#91e8e1"]}}),i(t,"Shared/TimeBase.js",[t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t){let{pageLang:i,win:n}=e,{defined:s,error:o,extend:r,isNumber:a,isObject:l,isString:c,merge:h,objectEach:d,pad:u,splat:p,timeUnits:m,ucfirst:f}=t,g=e.isSafari&&n.Intl&&!n.Intl.DateTimeFormat.prototype.formatRange,y=e=>void 0===e.main;return class{constructor(e,t){this.options={timezone:"UTC"},this.variableTimezone=!1,this.Date=n.Date,this.update(e),this.lang=t}update(e={}){this.dTLCache={},this.options=e=h(!0,this.options,e);let{timezoneOffset:t,useUTC:i,locale:o}=e;this.Date=e.Date||n.Date||Date;let r=e.timezone;s(i)&&(r=i?"UTC":void 0),t&&t%60==0&&(r="Etc/GMT"+(t>0?"+":"")+t/60),this.variableTimezone="UTC"!==r&&r?.indexOf("Etc/GMT")!==0,this.timezone=r,this.lang&&o&&(this.lang.locale=o),["months","shortMonths","weekdays","shortWeekdays"].forEach(e=>{let t=/months/i.test(e),i=/short/.test(e),n={timeZone:"UTC"};n[t?"month":"weekday"]=i?"short":"long",this[e]=(t?[0,1,2,3,4,5,6,7,8,9,10,11]:[3,4,5,6,7,8,9]).map(e=>this.dateFormat(n,(t?31:1)*24*36e5*e))})}toParts(e){let[t,i,n,s,o,r,a]=this.dateTimeFormat({weekday:"narrow",day:"numeric",month:"numeric",year:"numeric",hour:"numeric",minute:"numeric",second:"numeric"},e,"es").split(/(?:, | |\/|:)/g);return[s,n-1,i,o,r,a,Math.floor(Number(e)||0)%1e3,"DLMXJVS".indexOf(t)].map(Number)}dateTimeFormat(e,t,n=this.options.locale||i){let s=JSON.stringify(e)+n;c(e)&&(e=this.str2dtf(e));let r=this.dTLCache[s];if(!r){e.timeZone??(e.timeZone=this.timezone);try{r=new Intl.DateTimeFormat(n,e)}catch(t){/Invalid time zone/i.test(t.message)?(o(34),e.timeZone="UTC",r=new Intl.DateTimeFormat(n,e)):o(t.message,!1)}}return this.dTLCache[s]=r,r?.format(t)||""}str2dtf(e,t={}){let i={L:{fractionalSecondDigits:3},S:{second:"2-digit"},M:{minute:"numeric"},H:{hour:"2-digit"},k:{hour:"numeric"},E:{weekday:"narrow"},a:{weekday:"short"},A:{weekday:"long"},d:{day:"2-digit"},e:{day:"numeric"},b:{month:"short"},B:{month:"long"},m:{month:"2-digit"},o:{month:"numeric"},y:{year:"2-digit"},Y:{year:"numeric"}};return Object.keys(i).forEach(n=>{-1!==e.indexOf(n)&&r(t,i[n])}),t}makeTime(e,t,i=1,n=0,s,o,r){let a=this.Date.UTC(e,t,i,n,s||0,o||0,r||0);if("UTC"!==this.timezone){let e=this.getTimezoneOffset(a);if(a+=e,-1!==[2,3,8,9,10,11].indexOf(t)&&(n<5||n>20)){let t=this.getTimezoneOffset(a);e!==t?a+=t-e:e-36e5!==this.getTimezoneOffset(a-36e5)||g||(a-=36e5)}}return a}parse(e){if(!c(e))return e??void 0;let t=(e=e.replace(/\//g,"-").replace(/(GMT|UTC)/,"")).indexOf("Z")>-1||/([+-][0-9]{2}):?[0-9]{2}$/.test(e),i=/^[0-9]{4}-[0-9]{2}(-[0-9]{2}|)$/.test(e);t||i||(e+="Z");let n=Date.parse(e);if(a(n))return n+(!t||i?this.getTimezoneOffset(n):0)}getTimezoneOffset(e){if("UTC"!==this.timezone){let[t,i,n,s,o=0]=this.dateTimeFormat({timeZoneName:"shortOffset"},e,"en").split(/(GMT|:)/).map(Number),r=-(60*(n+o/60)*6e4);if(a(r))return r}return 0}dateFormat(t,i,n){let o=this.lang;if(!s(i)||isNaN(i))return o?.invalidDate||"";if(c(t=t??"%Y-%m-%d %H:%M:%S")){let e,n=/%\[([a-zA-Z]+)\]/g;for(;e=n.exec(t);)t=t.replace(e[0],this.dateTimeFormat(e[1],i,o?.locale))}if(c(t)&&-1!==t.indexOf("%")){let n=this,[s,a,l,h,p,m,f,g]=this.toParts(i),y=o?.weekdays||this.weekdays,b=o?.shortWeekdays||this.shortWeekdays,C=o?.months||this.months,v=o?.shortMonths||this.shortMonths;d(r({a:b?b[g]:y[g].substr(0,3),A:y[g],d:u(l),e:u(l,2," "),w:g,v:o?.weekFrom??"",b:v[a],B:C[a],m:u(a+1),o:a+1,y:s.toString().substr(2,2),Y:s,H:u(h),k:h,I:u(h%12||12),l:h%12||12,M:u(p),p:h<12?"AM":"PM",P:h<12?"am":"pm",S:u(m),L:u(f,3)},e.dateFormats),function(e,s){if(c(t))for(;-1!==t.indexOf("%"+s);)t=t.replace("%"+s,"function"==typeof e?e.call(n,i):e)})}else if(l(t)){let e=(this.getTimezoneOffset(i)||0)/36e5,n=this.timezone||"Etc/GMT"+(e>=0?"+":"")+e,{prefix:s="",suffix:o=""}=t;t=s+this.dateTimeFormat(r({timeZone:n},t),i)+o}return n?f(t):t}resolveDTLFormat(e){return l(e,!0)?l(e,!0)&&y(e)?{main:e}:e:{main:(e=p(e))[0],from:e[1],to:e[2]}}getDateFormat(e,t,i,n){let s=this.dateFormat("%m-%d %H:%M:%S.%L",t),o="01-01 00:00:00.000",r={millisecond:15,second:12,minute:9,hour:6,day:3},a="millisecond",l=a;for(a in m){if(e&&e===m.week&&+this.dateFormat("%w",t)===i&&s.substr(6)===o.substr(6)){a="week";break}if(e&&m[a]>e){a=l;break}if(r[a]&&s.substr(r[a])!==o.substr(r[a]))break;"week"!==a&&(l=a)}return this.resolveDTLFormat(n[a]).main}}}),i(t,"Core/Time.js",[t["Shared/TimeBase.js"],t["Core/Utilities.js"]],function(e,t){let{defined:i,extend:n,timeUnits:s}=t;return class extends e{getTimeTicks(e,t,o,r){let a=this,l=[],c={},{count:h=1,unitRange:d}=e,[u,p,m,f,g,y]=a.toParts(t),b=(t||0)%1e3,C;if(r??(r=1),i(t)){if(b=d>=s.second?0:h*Math.floor(b/h),d>=s.second&&(y=d>=s.minute?0:h*Math.floor(y/h)),d>=s.minute&&(g=d>=s.hour?0:h*Math.floor(g/h)),d>=s.hour&&(f=d>=s.day?0:h*Math.floor(f/h)),d>=s.day&&(m=d>=s.month?1:Math.max(1,h*Math.floor(m/h))),d>=s.month&&(p=d>=s.year?0:h*Math.floor(p/h)),d>=s.year&&(u-=u%h),d===s.week){h&&(t=a.makeTime(u,p,m,f,g,y,b));let e=this.dateTimeFormat({timeZone:this.timezone,weekday:"narrow"},t,"es"),i="DLMXJVS".indexOf(e);m+=-i+r+(i<r?-7:0)}t=a.makeTime(u,p,m,f,g,y,b),a.variableTimezone&&i(o)&&(C=o-t>4*s.month||a.getTimezoneOffset(t)!==a.getTimezoneOffset(o));let e=t,n=1;for(;e<o;)l.push(e),d===s.year?e=a.makeTime(u+n*h,0):d===s.month?e=a.makeTime(u,p+n*h):C&&(d===s.day||d===s.week)?e=a.makeTime(u,p,m+n*h*(d===s.day?1:7)):C&&d===s.hour&&h>1?e=a.makeTime(u,p,m,f+n*h):e+=d*h,n++;l.push(e),d<=s.hour&&l.length<1e4&&l.forEach(e=>{e%18e5==0&&"000000000"===a.dateFormat("%H%M%S%L",e)&&(c[e]="day")})}return l.info=n(e,{higherRanks:c,totalRange:d*h}),l}}}),i(t,"Core/Defaults.js",[t["Core/Chart/ChartDefaults.js"],t["Core/Globals.js"],t["Core/Color/Palettes.js"],t["Core/Time.js"],t["Core/Utilities.js"]],function(e,t,i,n,s){let{isTouchDevice:o}=t,{fireEvent:r,merge:a}=s,l={colors:i.colors,symbols:["circle","diamond","square","triangle","triangle-down"],lang:{weekFrom:"week from",chartTitle:"Chart title",locale:void 0,loading:"Loading...",months:void 0,seriesName:"Series {add index 1}",shortMonths:void 0,weekdays:void 0,numericSymbols:["k","M","G","T","P","E"],pieSliceName:"Slice",resetZoom:"Reset zoom",yAxisTitle:"Values",resetZoomTitle:"Reset zoom level 1:1"},global:{buttonTheme:{fill:"#f7f7f7",padding:8,r:2,stroke:"#cccccc","stroke-width":1,style:{color:"#333333",cursor:"pointer",fontSize:"0.8em",fontWeight:"normal"},states:{hover:{fill:"#e6e6e6"},select:{fill:"#e6e9ff",style:{color:"#000000",fontWeight:"bold"}},disabled:{style:{color:"#cccccc"}}}}},time:{Date:void 0,timezone:"UTC",timezoneOffset:0,useUTC:void 0},chart:e,title:{style:{color:"#333333",fontWeight:"bold"},text:"Chart title",margin:15,minScale:.67},subtitle:{style:{color:"#666666",fontSize:"0.8em"},text:""},caption:{margin:15,style:{color:"#666666",fontSize:"0.8em"},text:"",align:"left",verticalAlign:"bottom"},plotOptions:{},legend:{enabled:!0,align:"center",alignColumns:!0,className:"highcharts-no-tooltip",events:{},layout:"horizontal",itemMarginBottom:2,itemMarginTop:2,labelFormatter:function(){return this.name},borderColor:"#999999",borderRadius:0,navigation:{style:{fontSize:"0.8em"},activeColor:"#0022ff",inactiveColor:"#cccccc"},itemStyle:{color:"#333333",cursor:"pointer",fontSize:"0.8em",textDecoration:"none",textOverflow:"ellipsis"},itemHoverStyle:{color:"#000000"},itemHiddenStyle:{color:"#666666",textDecoration:"line-through"},shadow:!1,itemCheckboxStyle:{position:"absolute",width:"13px",height:"13px"},squareSymbol:!0,symbolPadding:5,verticalAlign:"bottom",x:0,y:0,title:{style:{color:"#333333",fontSize:"0.8em",fontWeight:"bold"}}},loading:{labelStyle:{fontWeight:"bold",position:"relative",top:"45%"},style:{position:"absolute",backgroundColor:"#ffffff",opacity:.5,textAlign:"center"}},tooltip:{enabled:!0,animation:{duration:300,easing:e=>Math.sqrt(1-Math.pow(e-1,2))},borderRadius:3,dateTimeLabelFormats:{millisecond:"%[AebHMSL]",second:"%[AebHMS]",minute:"%[AebHM]",hour:"%[AebHM]",day:"%[AebY]",week:"%v %[AebY]",month:"%[BY]",year:"%Y"},footerFormat:"",headerShape:"callout",hideDelay:500,padding:8,position:{x:0,y:3},shared:!1,snap:o?25:10,headerFormat:'<span style="font-size: 0.8em">{ucfirst point.key}</span><br/>',pointFormat:'<span style="color:{point.color}">●</span> {series.name}: <b>{point.y}</b><br/>',backgroundColor:"#ffffff",borderWidth:void 0,stickOnContact:!1,style:{color:"#333333",cursor:"default",fontSize:"0.8em"},useHTML:!1},credits:{enabled:!0,href:"https://www.highcharts.com?credits",position:{align:"right",x:-10,verticalAlign:"bottom",y:-5},style:{cursor:"pointer",color:"#999999",fontSize:"0.6em"},text:"Highcharts.com"}},c=new n(l.time,l.lang);return{defaultOptions:l,defaultTime:c,getOptions:function(){return l},setOptions:function(e){return r(t,"setOptions",{options:e}),a(!0,l,e),e.time&&c.update(l.time),e.lang&&"locale"in e.lang&&c.update({locale:e.lang.locale}),e.lang?.chartTitle&&(l.title={...l.title,text:e.lang.chartTitle}),l}}}),i(t,"Core/Templating.js",[t["Core/Defaults.js"],t["Core/Globals.js"],t["Core/Utilities.js"]],function(e,t,i){let{defaultOptions:n,defaultTime:s}=e,{pageLang:o}=t,{extend:r,getNestedProperty:a,isArray:l,isNumber:c,isObject:h,isString:d,pick:u,ucfirst:p}=i,m={add:(e,t)=>e+t,divide:(e,t)=>0!==t?e/t:"",eq:(e,t)=>e==t,each:function(e){let t=arguments[arguments.length-1];return!!l(e)&&e.map((i,n)=>y(t.body,r(h(i)?i:{"@this":i},{"@index":n,"@first":0===n,"@last":n===e.length-1}))).join("")},ge:(e,t)=>e>=t,gt:(e,t)=>e>t,if:e=>!!e,le:(e,t)=>e<=t,lt:(e,t)=>e<t,multiply:(e,t)=>e*t,ne:(e,t)=>e!=t,subtract:(e,t)=>e-t,ucfirst:p,unless:e=>!e},f={},g=e=>/^["'].+["']$/.test(e);function y(e="",t,i){let o=/\{([a-zA-Z\u00C0-\u017F\d:\.,;\-\/<>\[\]%_@+"'’= #\(\)]+)\}/g,r=/\(([a-zA-Z\u00C0-\u017F\d:\.,;\-\/<>\[\]%_@+"'= ]+)\)/g,l=[],c=/f$/,h=/\.(\d)/,p=i?.options?.lang||n.lang,f=i?.time||s,C=i?.numberFormatter||b.bind(i),v=(e="")=>{let i;return"true"===e||"false"!==e&&((i=Number(e)).toString()===e?i:g(e)?e.slice(1,-1):a(e,t))},w,T,O=0,D;for(;null!==(w=o.exec(e));){let i=w,n=r.exec(w[1]);n&&(w=n,D=!0),T?.isBlock||(T={ctx:t,expression:w[1],find:w[0],isBlock:"#"===w[1].charAt(0),start:w.index,startInner:w.index+w[0].length,length:w[0].length});let s=(T.isBlock?i:w)[1].split(" ")[0].replace("#","");m[s]&&(T.isBlock&&s===T.fn&&O++,T.fn||(T.fn=s));let o="else"===w[1];if(T.isBlock&&T.fn&&(w[1]===`/${T.fn}`||o))if(O)!o&&O--;else{let t=T.startInner,i=e.substr(t,w.index-t);void 0===T.body?(T.body=i,T.startInner=w.index+w[0].length):T.elseBody=i,T.find+=i+w[0],o||(l.push(T),T=void 0)}else T.isBlock||l.push(T);if(n&&!T?.isBlock)break}return l.forEach(n=>{let s,o,{body:a,elseBody:l,expression:b,fn:w}=n;if(w){let e=[n],r=[],c=b.length,h=0,d;for(o=0;o<=c;o++){let e=b.charAt(o);d||'"'!==e&&"'"!==e?d===e&&(d=""):d=e,d||" "!==e&&o!==c||(r.push(b.substr(h,o-h)),h=o+1)}for(o=m[w].length;o--;)e.unshift(v(r[o+1]));s=m[w].apply(t,e),n.isBlock&&"boolean"==typeof s&&(s=y(s?a:l,t,i))}else{let e=g(b)?[b]:b.split(":"),t=(s=v(e.shift()||""))%1!=0;if("number"==typeof s&&(e.length||t)){let i=e.join(":");if(c.test(i)||t){let e=parseInt((i.match(h)||["","-1"])[1],10);null!==s&&(s=C(s,e,p.decimalPoint,i.indexOf(",")>-1?p.thousandsSep:""))}else s=f.dateFormat(i,s)}r.lastIndex=0,r.test(n.find)&&d(s)&&(s=`"${s}"`)}e=e.replace(n.find,u(s,""))}),D?y(e,t,i):e}function b(e,t,i,s){t*=1;let r,a,[l,h]=(e=+e||0).toString().split("e").map(Number),d=this?.options?.lang||n.lang,u=(e.toString().split(".")[1]||"").split("e")[0].length,p=t,m={};i??(i=d.decimalPoint),s??(s=d.thousandsSep),-1===t?t=Math.min(u,20):c(t)?t&&h<0&&((a=t+h)>=0?(l=+l.toExponential(a).split("e")[0],t=a):(l=Math.floor(l),e=t<20?+(l*Math.pow(10,h)).toFixed(t):0,h=0)):t=2,h&&(t??(t=2),e=l),c(t)&&t>=0&&(m.minimumFractionDigits=t,m.maximumFractionDigits=t),""===s&&(m.useGrouping=!1);let g=s||i,y=g?"en":this?.locale||d.locale||o,b=JSON.stringify(m)+y;return r=(f[b]??(f[b]=new Intl.NumberFormat(y,m))).format(e),g&&(r=r.replace(/([,\.])/g,"_$1").replace(/_\,/g,s??",").replace("_.",i??".")),(t||0!=+r)&&(!(h<0)||p)||(r="0"),h&&0!=+r&&(r+="e"+(h<0?"":"+")+h),r}return{dateFormat:function(e,t,i){return s.dateFormat(e,t,i)},format:y,helpers:m,numberFormat:b}}),i(t,"Dashboards/Components/KPIComponent/KPIComponent.js",[t["Core/Renderer/HTML/AST.js"],t["Dashboards/Components/Component.js"],t["Dashboards/Components/KPIComponent/KPISyncs/KPISyncs.js"],t["Dashboards/Components/KPIComponent/KPIComponentDefaults.js"],t["Data/Formula/Functions/SUM.js"],t["Data/Formula/Functions/AVERAGE.js"],t["Data/Formula/Functions/MEDIAN.js"],t["Data/Formula/Functions/MAX.js"],t["Data/Formula/Functions/MIN.js"],t["Data/Formula/Functions/COUNT.js"],t["Data/Formula/Functions/PRODUCT.js"],t["Core/Templating.js"],t["Core/Utilities.js"]],function(e,t,i,n,s,o,r,a,l,c,h,d,u){let{format:p}=d,{createElement:m,css:f,defined:g,diffObjects:y,isArray:b,isNumber:C,merge:v,isFunction:w}=u;class T extends t{constructor(e,t,i){super(e,t=v(T.defaultOptions,t),i),this.options=t,this.type="KPI",this.value=m("span",{className:`${t.className}-value`},{},this.contentElement),this.subtitle=m("span",{className:this.getSubtitleClassName()},{},this.contentElement)}async load(){return await super.load(),this.linkValueToChart(),this}resize(e,t){return super.resize(e,t),this.chart&&this.chart.container&&this.chart.reflow(),this}render(){super.render(),this.updateElements();let e=T.charter?.Chart;return e&&this.options.chartOptions&&!this.chart?(this.chartContainer||(this.chartContainer=m("div",{className:`${this.options.className}-chart-container`},{padding:"0.1px"},this.contentElement)),this.chart=e.chart(this.chartContainer,v(T.defaultChartOptions,this.options.chartOptions))):this.chart&&!this.options.chartOptions&&"chartOptions"in this.options&&(this.chart.destroy(),this.chart=void 0),this.sync.start(),this.emit({type:"afterRender"}),this}async update(e,t=!0){await super.update(e),e.chartOptions&&this.chart&&this.chart.update(e.chartOptions),t&&this.render()}onTableChanged(){this.setValue()}destroy(){this.chart?.destroy(),super.destroy()}getFormulaValue(){let e=this.options.formula,t=this.getFirstConnector(),i=t?.table.modified,n=i?.getColumn(this.options.columnName);if(!n||!e)return;if(w(e))return e.call(this,n);let s=Array.isArray(n)?n.slice().filter(g):Array.from(n);("MIN"===e||"MAX"===e||"MEDIAN"===e)&&(s=s.filter(e=>""!==e&&!isNaN(Number(e)))),"MEDIAN"===e&&s.sort((e,t)=>Number(e)-Number(t));try{return T.formulaFunctions[e](s)}catch{console.warn("Invalid formula option provided.")}}getValue(){if(g(this.options.value))return this.options.value;let e=this.getFirstConnector();if(e&&this.options.columnName){if(g(this.options.formula))return this.getFormulaValue();let t=e.table.modified,i=t.getColumn(this.options.columnName),n=i?.length||0;return t.getCellAsString(this.options.columnName,n-1)}}setValue(t=this.getValue()){let{valueFormat:i,valueFormatter:n}=this.options;if(g(t)){let s;C(+t)&&(s=+t),n?t=n.call(this,t):i?t=p(i,{value:t}):C(t)&&(t=t.toLocaleString()),e.setElementHTML(this.value,""+t),this.linkValueToChart(s),this.prevValue=s}}linkValueToChart(e=this.getValue()){let t=this.chart,i=this.options.linkedValueTo;if(!t||!i.enabled||!g(e)||!C(+e))return;e*=1;let n=t.series[i.seriesIndex??0],s=n?.points[i.pointIndex??0];if(n)return s?void s.update({y:e}):void n.addPoint({y:e});t.addSeries({data:[{y:e}]})}updateElements(){let{style:t,subtitle:i}=this.options;this.setValue(),e.setElementHTML(this.subtitle,this.getSubtitle()),t&&f(this.element,t),"object"==typeof i&&(i.style&&f(this.subtitle,i.style),this.subtitle.className=this.getSubtitleClassName()),this.chartContainer&&(this.chartContainer.style.flex=this.options.chartOptions?"1":"0"),this.chart&&this.chart.reflow(),this.value.style.color=this.getValueColor()}getSubtitle(){let{subtitle:e,value:t}=this.options;if("string"==typeof e)return e;if(e){if(C(this.prevValue)&&C(t)){let i=t-this.prevValue,n="";if(i>0)n='<span style="color:green">&#9650;</span> +';else{if(!(i<0))return this.subtitle.innerHTML;n='<span style="color:red">&#9660;</span> '}if("diff"===e.type)return n+i.toLocaleString();if("diffpercent"===e.type)return n+p("{v:,.2f}%",{v:i/this.prevValue*100})}return e.text||""}return""}getSubtitleClassName(){let{subtitle:e}=this.options;return`${t.defaultOptions.className}-subtitle`+("object"==typeof e&&e.className||"")}getValueColor(){let{threshold:e,thresholdColors:t,value:i}=this.options;if(t&&e&&C(i)){if(b(e)){for(let n=e.length-1;n>=0;n--)if(i>=e[n]){if(n+1<t.length)return t[n+1];return t[t.length-1]}}else if(i>=e)return t[1];return t[0]}return""}getOptionsOnDrop(e){let t=e.editMode.board.dataPool.getConnectorIds(),i={cell:"",type:"KPI"};return t.length&&(i={...i,connector:{id:t[0]}}),i}getOptions(){return{...y(this.options,T.defaultOptions),type:"KPI"}}}return T.defaultOptions=v(t.defaultOptions,n),T.predefinedSyncConfig=i,T.defaultChartOptions={chart:{type:"spline",zooming:{mouseWheel:{enabled:!1}}},title:{text:void 0},xAxis:{visible:!1},yAxis:{visible:!1,title:{text:null}},legend:{enabled:!1},credits:{enabled:!1},tooltip:{outside:!0},plotOptions:{series:{marker:{enabled:!1}}}},T.formulaFunctions={SUM:s,AVERAGE:o,MEDIAN:r,MAX:a,MIN:l,COUNT:c,PRODUCT:h},T}),i(t,"Dashboards/Components/NavigatorComponent/NavigatorComponentDefaults.js",[t["Dashboards/Components/Component.js"]],function(e){return{type:"Navigator",className:[e.defaultOptions.className,`${e.defaultOptions.className}-navigator`].join(" "),chartOptions:{chart:{animation:!1,height:200,type:"column",zooming:{mouseWheel:{enabled:!1}}},credits:{enabled:!1},legend:{enabled:!1},navigator:{enabled:!0,outlineWidth:0,series:{animation:!1,lineWidth:0,colorIndex:0},xAxis:{endOnTick:!0,gridZIndex:4,labels:{x:1,y:22},opposite:!0,showFirstLabel:!0,showLastLabel:!0,startOnTick:!0,tickPosition:"inside"},yAxis:{maxPadding:.5}},plotOptions:{series:{borderRadius:0,marker:{enabled:!1},states:{hover:{enabled:!1}}}},scrollbar:{enabled:!0},title:{text:""},tooltip:{enabled:!1},xAxis:{visible:!1,minRange:Number.MIN_VALUE},yAxis:{visible:!1}},editableOptions:(e.defaultOptions.editableOptions||[]).concat()}}),i(t,"Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorSyncUtils.js",[],function(){var e,t;return(t=e||(e={})).setRangeOptions=function(e,t,i,n){let s=!1;for(let o=0,r=e.length;o<r;++o)if(e[o].column===t){e[o].maxValue=n,e[o].minValue=i,s=!0;break}s||e.push({column:t,maxValue:n,minValue:i})},t.unsetRangeOptions=function(e,t){for(let i=0,n=e.length;i<n;++i)if(e[i].column===t)return e.splice(i,1)[0]},e}),i(t,"Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorCrossfilterSync.js",[t["Data/Modifiers/DataModifier.js"],t["Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorSyncUtils.js"],t["Core/Utilities.js"]],function(e,t,i){let{Range:n}=e.types,{addEvent:s}=i;return{defaultOptions:{affectNavigator:!1},syncPair:{emitter:function(){let e;if("Navigator"!==this.type)return;let i=this,o=this.sync.syncConfig.crossfilter,r=o.group?":"+o.group:"",a=async e=>{if(i.connectorHandlers?.[0]?.connector){let s=i.connectorHandlers[0].connector.table,o=i.board.dataCursor,a=i.getColumnAssignment()[0],[l,c]=i.getAxisExtremes(),h=s.getModifier();h instanceof n?t.setRangeOptions(h.options.ranges,a,l,c):h=new n({ranges:[{column:a,maxValue:c,minValue:l}]}),await s.setModifier(h),o.emitCursor(s,{type:"position",column:a,row:s.getRowIndexBy(a,l),state:"crossfilter"+r},e),o.emitCursor(s,{type:"position",column:a,row:s.getRowIndexBy(a,c),state:"crossfilter"+r},e)}};return s(i.chart.xAxis[0],"afterSetExtremes",function(t){clearTimeout(e),e=setTimeout(a,50,this,t)})},handler:void 0}}}),i(t,"Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorExtremesSync.js",[t["Data/Modifiers/DataModifier.js"],t["Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorSyncUtils.js"],t["Core/Utilities.js"]],function(e,t,i){let{Range:n}=e.types,{addEvent:s,pick:o,defined:r}=i;return{defaultOptions:{},syncPair:{emitter:function(){let e;if("Navigator"!==this.type)return;let t=this,i=this.sync.syncConfig.extremes,n=i.group?":"+i.group:"",o=e=>{if(t.connectorHandlers?.[0]?.connector){let i=t.connectorHandlers[0].connector.table,s=t.board.dataCursor,o=t.getColumnAssignment()[0],[r,a]=t.getAxisExtremes();s.emitCursor(i,{type:"position",column:o,row:i.getRowIndexBy(o,r),state:"xAxis.extremes.min"+n},e),s.emitCursor(i,{type:"position",column:o,row:i.getRowIndexBy(o,a),state:"xAxis.extremes.max"+n},e)}};return s(t.chart.xAxis[0],"afterSetExtremes",function(t){clearTimeout(e),e=setTimeout(o,50,this,t)})},handler:function(){if("Navigator"!==this.type)return;let e=this,i=this.sync.syncConfig.extremes,s=i.group?":"+i.group:"",a=e.board.dataCursor,l=i=>{let a=i.cursor;if(!e.connectorHandlers?.[0]?.connector)return;let l=e.connectorHandlers[0].connector.table,c=l.getColumnNames()[0],h=l.getRowCount(),d=0;"range"===a.type?(h=a.lastRow,d=a.firstRow,a.columns&&(c=o(a.columns[0],c))):a.state==="xAxis.extremes.max"+s?(c=o(a.column,c),h=o(a.row,h)):(c=o(a.column,c),d=o(a.row,d));let u=l.getModifier();if("string"==typeof c&&u instanceof n){let e=u.options.ranges,i=l.getCell(c,d),n=l.getCell(c,h);r(n)&&r(i)&&(t.unsetRangeOptions(e,c),e.unshift({column:c,maxValue:n,minValue:i}),l.setModifier(u))}},c=e.connectorHandlers?.[0]?.connector?.table;return c&&(a.addListener(c.id,"xAxis.extremes"+s,l),a.addListener(c.id,"xAxis.extremes.max"+s,l),a.addListener(c.id,"xAxis.extremes.min"+s,l)),()=>{let t=e.connectorHandlers?.[0]?.connector?.table;t&&(a.removeListener(t.id,"xAxis.extremes"+s,l),a.removeListener(t.id,"xAxis.extremes.max"+s,l),a.removeListener(t.id,"xAxis.extremes.min"+s,l))}}}}}),i(t,"Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorSyncs.js",[t["Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorCrossfilterSync.js"],t["Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorExtremesSync.js"]],function(e,t){return{defaultSyncPairs:{crossfilter:e.syncPair,extremes:t.syncPair},defaultSyncOptions:{crossfilter:e.defaultOptions,extremes:t.defaultOptions}}}),i(t,"Dashboards/Components/NavigatorComponent/NavigatorComponent.js",[t["Dashboards/Components/Component.js"],t["Dashboards/Globals.js"],t["Dashboards/Components/NavigatorComponent/NavigatorComponentDefaults.js"],t["Dashboards/Components/NavigatorComponent/NavigatorSyncs/NavigatorSyncs.js"],t["Core/Utilities.js"]],function(e,t,i,n,s){let{diffObjects:o,isNumber:r,isString:a,merge:l,pick:c}=s;class h extends e{constructor(e,i){super(e,i),this.type="Navigator",this.options=l(h.defaultOptions,i);let n=h.charter.Chart||t.win.Highcharts;this.chartContainer=t.win.document.createElement("div"),this.chart=n.chart(this.chartContainer,this.options.chartOptions||{}),this.chartContainer.classList.add(t.classNamePrefix+"navigator"),this.sync.syncConfig.crossfilter?.enabled&&this.chart.update(l({navigator:{xAxis:{labels:{format:"{value}"}}}},this.options.chartOptions||{}),!1)}adjustNavigator(){let e=this.chart,t=c(e.chartHeight,this.contentElement.clientHeight),i=this.contentElement.clientWidth,n={};if((e.chartHeight!==t||e.chartWidth!==i)&&(n.chart={height:t,width:i}),e.navigator){let i=e.navigator,s=i.top-e.plotTop+i.height;i.height!==s&&(n.navigator={handles:{height:Math.round(t/4)},height:s}),Object.keys(n).length&&e.update(n,!1),i.series&&i.series[0]&&i.series[0].update({type:e.series[0].type},!1)}else Object.keys(n).length&&e.update(n,!1)}getColumnAssignment(){let e,t=this.options.columnAssignment??this.options.columnAssignments??{};for(let i of Object.keys(t))if(null!==(e=t[i]))return[i,e];let i=this.getFirstConnector();if(i){let e=i.table.getColumnNames();if(e.length)return[e[0],"y"]}return["","y"]}getOptions(){return{...o(this.options,i),type:"Navigator"}}getAxisExtremes(){let e=this.chart.xAxis[0],t=e.getExtremes(),i=r(t.min)?t.min:t.dataMin,n=r(t.max)?t.max:t.dataMax;return this.categories?[this.categories[Math.max(0,Math.ceil(i))],this.categories[Math.min(this.categories.length-1,Math.floor(n))]]:e.hasNames?[e.names[Math.ceil(i)],e.names[Math.floor(n)]]:[i,n]}async load(){return await super.load(),this.contentElement.appendChild(this.chartContainer),this.parentElement.appendChild(this.element),this.adjustNavigator(),this.emit({type:"afterLoad"}),this}onTableChanged(){this.renderNavigator()}redrawNavigator(){let e=this.resizeTimeouts;for(let t=0,i=e.length;t<i;++t)clearTimeout(e[t]);e.length=0,e.push(setTimeout(()=>{this.adjustNavigator(),this.chart.redraw()},33))}render(){return super.render(),this.renderNavigator(),this.sync.start(),this.emit({type:"afterRender"}),this}renderNavigator(){let e=this.chart,t=this.getFirstConnector();if(t){let i,n=t.table,s=this.getColumnAssignment(),o=n.getColumn(s[0],!0)||[];i=this.sync.syncConfig.crossfilter?.enabled?this.generateCrossfilterData():o.slice(),e.series[0]?e.series[0].setData(i,!1):e.addSeries({id:n.id,data:i},!1)}this.redrawNavigator()}generateCrossfilterData(){let e,t=this.sync.syncConfig.crossfilter,i=this.getFirstConnector()?.table,n=i?.getColumn(this.getColumnAssignment()[0],!0)||[];if(!i||n.length<1||!t)return[];let s=[],o=[];for(let e=0,t=n.length;e<t;e++){let t=n[e];if(null!==t){if(r(t)||(t=`${t}`),void 0===this.stringData)this.stringData=a(t);else if(this.stringData!==a(t))throw Error("Mixed data types in crossfilter navigator are not supported.");s.push(t),-1===o.indexOf(t)&&o.push(t)}}o.sort((e,t)=>c(e,NaN)<c(t,NaN)?-1:+(e!==t));let l=i.getModifier()?.options;if(t.affectNavigator&&l){let t=[],n=[],{ranges:o}=l;for(let e=0,s=o.length;e<s;e++)o[e].column!==this.getColumnAssignment()[0]&&(t.push(o[e]),n.push(i.getColumn(o[e].column,!0)||[]));e=[];let r=t.length;for(let i=0,o=s.length;i<o;i++){let o=s[i],a=!0;for(let e=0;e<r;e++){let s=t[e];if(!(n[e][i]>=(s.minValue??-1/0)&&n[e][i]<=(s.maxValue??1/0))){a=!1;break}}a&&e.push(o)}}else e=s;let h=[];if(this.stringData){this.categories=o;for(let e=0,t=o.length;e<t;e++)h.push([e,null])}else for(let e=0,t=o.length;e<t;e++)h.push([o[e],null]);for(let t=0,i=e.length;t<i;t++){let i=o.indexOf(e[t]);h[i][1]=(h[i][1]||0)+1}return h}resize(e,t){return super.resize(e,t),this.redrawNavigator(),this}async update(e,t=!0){let i=this.chart;await super.update(e,!1),e.chartOptions&&i.update(l(this.sync.syncConfig.crossfilter?.enabled?{navigator:{xAxis:{labels:{format:"{value}"}}}}:{},e.chartOptions),!1),this.emit({type:"afterUpdate"}),t&&this.render()}getOptionsOnDrop(){return{}}}return h.defaultOptions=l(e.defaultOptions,i),h.predefinedSyncConfig=n,h}),i(t,"Dashboards/Plugins/HighchartsPlugin.js",[t["Dashboards/Components/HighchartsComponent/HighchartsComponent.js"],t["Dashboards/Components/KPIComponent/KPIComponent.js"],t["Dashboards/Components/NavigatorComponent/NavigatorComponent.js"]],function(e,t,i){return{custom:{connectHighcharts:function(n){e.charter=n,t.charter=n,i.charter=n}},name:"Highcharts.DashboardsPlugin",onRegister:function(n){let{ComponentRegistry:s}=n;s.registerComponent("Highcharts",e),s.registerComponent("KPI",t),s.registerComponent("Navigator",i)},onUnregister:function(e){}}}),i(t,"Dashboards/PluginHandler.js",[t["Dashboards/Board.js"],t["Dashboards/Components/Sync/Sync.js"],t["Dashboards/Components/ComponentRegistry.js"]],function(e,t,i){var n,s;return(s=n||(n={})).registry={},s.revision=0,s.addPlugin=function(n,o=n.name){let{maxRevision:r,minRevision:a,onRegister:l}=n;if(s.registry[o]){if(o!==n.name)throw Error(`Plugin '${o}' already registered.`);return}if("number"==typeof a&&a>s.revision||"number"==typeof r&&r<s.revision)throw Error(`Plugin '${o}' does not support revision ${s.revision}.`);l({Board:e,ComponentRegistry:i,Sync:t,revision:s.revision}),s.registry[o]=n},s.removePlugin=function(n){s.registry[n]&&(s.registry[n].onUnregister({ComponentRegistry:i,Board:e,Sync:t,revision:s.revision}),delete s.registry[n])},n}),i(t,"masters/dashboards.js",[t["Core/Renderer/HTML/AST.js"],t["Data/Connectors/DataConnector.js"],t["Dashboards/Board.js"],t["Dashboards/Components/Component.js"],t["Dashboards/Components/ComponentRegistry.js"],t["Data/DataPool.js"],t["Data/DataCursor.js"],t["Data/Converters/DataConverter.js"],t["Data/Modifiers/DataModifier.js"],t["Data/DataTable.js"],t["Dashboards/Globals.js"],t["Dashboards/Plugins/DataGridPlugin.js"],t["Dashboards/Plugins/HighchartsPlugin.js"],t["Dashboards/PluginHandler.js"],t["Dashboards/Components/Sync/Sync.js"],t["Dashboards/Utilities.js"]],function(e,t,i,n,s,o,r,a,l,c,h,d,u,p,m,f){return h.board=i.board,h.addEvent=f.addEvent,h.error=f.error,h.merge=f.merge,h.removeEvent=f.removeEvent,h.uniqueKey=f.uniqueKey,h.AST=e,h.Board=i,h.Component=n,h.ComponentRegistry=s,h.DataConnector=t,h.DataConverter=a,h.DataCursor=r,h.DataModifier=l,h.DataPool=o,h.DataTable=c,h.DataGridPlugin=d,h.GridPlugin=d,h.HighchartsPlugin=u,h.PluginHandler=p,h.Sync=m,h.win.Dashboards||(h.win.Dashboards=h),h.win.Grid&&(d.custom.connectGrid(h.win.Grid),h.PluginHandler.addPlugin(d)),h.win.Highcharts&&(u.custom.connectHighcharts(h.win.Highcharts),h.PluginHandler.addPlugin(u)),h}),t["masters/dashboards.js"]._modules=t,t["masters/dashboards.js"]});