@mxtommy/kip 4.7.0-beta.8 → 4.7.0-beta.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mxtommy/kip",
3
- "version": "4.7.0-beta.8",
3
+ "version": "4.7.0-beta.9",
4
4
  "description": "An advanced and versatile marine instrumentation package to display Signal K data.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.HistorySeriesService = exports.isKipTemplateSeriesDefinition = exports.isKipSeriesEnabled = exports.isKipConcreteSeriesDefinition = void 0;
4
- const kip_series_contract_1 = require("../../src/app/core/contracts/kip-series-contract");
4
+ const kip_series_contract_1 = require("./kip-series-contract");
5
5
  Object.defineProperty(exports, "isKipConcreteSeriesDefinition", { enumerable: true, get: function () { return kip_series_contract_1.isKipConcreteSeriesDefinition; } });
6
6
  Object.defineProperty(exports, "isKipSeriesEnabled", { enumerable: true, get: function () { return kip_series_contract_1.isKipSeriesEnabled; } });
7
7
  Object.defineProperty(exports, "isKipTemplateSeriesDefinition", { enumerable: true, get: function () { return kip_series_contract_1.isKipTemplateSeriesDefinition; } });
@@ -1,4 +1,4 @@
1
- import{$ as os,A as ns,B as Qa,C as Bi,D as Sl,E as as,F as Fo,G as wl,H as Go,I as Bo,J as Xa,K as Ka,L as _l,M as Ml,N as Ja,O as Uo,P as kl,Q as Su,R as wu,S as _u,T as zn,U as Hn,V as eo,W as vt,X as qn,Y as $n,Z as to,_ as Mu,a as qt,aa as rs,b as oi,ba as ku,c as Di,ca as Tu,d as gu,da as jn,e as vu,ea as ln,f as bu,g as es,h as Au,i as yu,j as xu,k as Cu,l as mt,m as fa,n as Fi,o as Bn,p as ga,q as bn,r as rn,s as sn,t as Gi,u as Un,v as hi,w as ts,x as is,y as Za,z as va}from"./chunk-MQGFFBF4.js";import{a as fu,b as Jr,c as ri}from"./chunk-YY4ZUJFI.js";import{a as Eu,b as Du,c as Pu,d as Iu,e as Nu}from"./chunk-CSIELI2Z.js";import{a as ai,b as on,c as at,e as io,f as no}from"./chunk-4YDVZHMH.js";import{a as lu,b as du,c as cu,d as Ya,e as uu,f as Vt,g as mu,h as hu,k as pu,m as Wo,o as Ae,p as Cl,r as Wt}from"./chunk-M37BLWHF.js";import{b as Qc,e as Xc,f as jr}from"./chunk-WJFXI5PQ.js";import{a as Fn,b as Gn}from"./chunk-HSKVTFFQ.js";import{a as Jc,b as eu,c as tu,d as tn,e as ti,g as iu,h as Mi,i as ki,j as Ti,k as Nn,l as Ht,n as Ct,o as Vn,p as ru,q as Wn,s as su,u as St,v as ii,w as wt,x as ni}from"./chunk-MXUEYEZU.js";import{A as On,B as $a,C as nn,D as ou,E as xl,F as an,G as Xr,H as Kr,I as Ei,J as pt,K as ja,L as Rn,M as Pt,O as Ln,P as It,Q as xt,a as Si,b as yc,d as Ft,e as wi,f as $c,i as $r,j as jc,k as Yc,l as Zc,m as Lt,n as en,o as Yr,p as yt,r as Et,t as dt,u as Dt,v as nu,w as Zr,x as Qr,y as au,z as ct}from"./chunk-2GOHQZH5.js";import{$ as wr,$a as ma,$b as be,$c as Dn,Aa as Ze,Ab as xe,Ac as J,Bb as Ce,Bc as pc,Bd as Ha,Be as Fc,Ca as ei,Cb as O,Cc as fc,Ce as Gc,D as Jd,Da as Be,Db as l,Dc as ut,De as Bc,E as ec,Eb as u,Ec as x,Fa as _,Fb as V,Fc as he,Ga as W,Gb as D,Gd as qa,Ge as Uc,H as ca,Ha as Zi,Hb as N,Hc as Fr,He as zc,I as xr,Ib as Q,J as gi,Jb as Xi,Jc as Ci,Jd as kc,Je as Hc,K as vi,Ka as Ke,Kb as Ki,Lb as Rr,Lc as bt,Mb as Te,Md as Tc,Nb as Li,Nd as pa,Ne as qc,O as tc,Ob as z,Od as Pn,Oe as $e,P as Tn,Pa as Dr,Pb as Ro,Pd as Ec,Pe as _i,Q as Jt,Qa as Pr,Qb as T,Qe as Kc,Ra as ua,Rb as Lr,Rd as yl,Re as Qe,S as ic,Sb as Vr,Sd as zr,Se as et,T as nc,Tb as Wr,Td as Dc,U as Cr,Ub as En,V as Sr,Va as g,Vb as yi,Vc as gc,Vd as Wi,Wb as xi,Wc as vc,Xa as cc,Xc as bc,Xd as Ji,Ya as uc,Yb as _e,Z as ac,Zb as Me,_ as oc,_a as Ir,_b as Nt,_c as Gr,a as oe,aa as _r,ac as st,ae as Pc,b as pe,ba as Ga,bc as Ba,bd as Ua,be as Ic,ca as Mr,cb as Nr,cc as it,ce as Tt,d as Gg,da as kr,dc as c,dd as Ac,de as Hr,e as jd,ea as Tr,ec as X,ee as In,f as Le,fa as rc,fb as q,fc as fe,fe as Nc,g as Fa,ga as sc,gb as Qi,gc as zt,ge as At,hb as Rt,ib as Or,ie as qr,j as vl,ja as Er,jb as mc,jc as mn,jd as xc,je as nt,k as Ut,ka as rt,kb as Oo,kc as hn,kd as Cc,la as Yi,lb as bi,lc as pn,ld as Sc,le as Oc,m as ji,mb as hc,mc as ha,n as Yd,na as un,nc as fn,oc as gn,pa as y,pc as Vi,pd as wc,pe as Rc,q as Zd,qc as Al,qe as Lc,r as Qd,rc as Lo,rd as Br,s as bl,sa as lc,sc as Vo,sd as _c,t as Xd,td as Mc,ua as ne,ub as K,uc as lt,va as ae,vc as kt,vd as za,w as yr,wa as te,wb as R,wc as vn,x as kn,xa as Ge,xb as L,xe as Vc,y as Kd,ya as No,yb as Ne,yd as Ur,z as Zt,za as dc,zb as Ai,zc as B,ze as Wc}from"./chunk-PZ6I6W3H.js";var gd=Gg((BL,Js)=>{(function(n){"use strict";function o(p){if(Array.isArray(p)){for(var h=0,v=Array(p.length);h<p.length;h++)v[h]=p[h];return v}return Array.from(p)}function e(p,h){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?p:h}function t(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(p,h):p.__proto__=h)}function i(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}function a(p,h){if(h||(h=typeof window>"u"?global:window),h[p]!==void 0)return h[p];if(Ar===null){var v=window.getComputedStyle(document.documentElement,"");Ar=(Array.prototype.slice.call(v).join("").match(/-(moz|webkit|ms)-/)||v.OLink===""&&["","o"]||["",""])[1]}if(Ar==="")return null;var S=p.charAt(0).toUpperCase()+p.substr(1),k=h[Ar+S];return k!==void 0?k:null}function r(p,h,v,S,k,P,U){if(typeof S!="function")throw new TypeError("Invalid animation rule:",S);var $=p-v,H=$/k,Y=0;H>1&&(H=1),H!==1&&(Y=S(H),isFinite(Y)&&!isNaN(Y)&&(H=Y)),h&&h(H),$<k?U.frame=Ud(function(ce){return r(ce,h,v,S,k,P,U)}):(P&&P(),U.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function d(p){if(!(p instanceof DOMException&&p.result===2152923147))throw p}function m(p,h){return h.replace(Vg,function(v,S){var k=p[S];return k!==void 0?k:v})}function f(p){return p.majorTicks instanceof Array||(p.majorTicks=p.majorTicks?[p.majorTicks]:[]),p.majorTicks.length||(p.majorTicks.push(we.formatMajorTickNumber(p.minValue,p)),p.majorTicks.push(we.formatMajorTickNumber(p.maxValue,p))),[p.tickSide!=="right",p.tickSide!=="left"]}function b(p,h,v,S,k,P){p.beginPath(),p.moveTo(h+P,v),p.lineTo(h+S-P,v),p.quadraticCurveTo(h+S,v,h+S,v+P),p.lineTo(h+S,v+k-P),p.quadraticCurveTo(h+S,v+k,h+S-P,v+k),p.lineTo(h+P,v+k),p.quadraticCurveTo(h,v+k,h,v+k-P),p.lineTo(h,v+P),p.quadraticCurveTo(h,v,h+P,v),p.closePath()}function A(p,h){var v=h.valueDec,S=h.valueInt,k=0,P=void 0,U=void 0,$=void 0;if(p=parseFloat(p),$=p<0,p=Math.abs(p),v>0){for(U=p.toFixed(v).toString().split("."),P=S-U[0].length;k<P;++k)U[0]="0"+U[0];U=($?"-":"")+U[0]+"."+U[1]}else{for(U=Math.round(p).toString(),P=S-U.length;k<P;++k)U="0"+U;U=($?"-":"")+U}return U}function C(p,h){var v=void 0,S=!1;return v=h.majorTicksDec===0?Math.round(p).toString():p.toFixed(h.majorTicksDec),h.majorTicksInt>1?(S=~v.indexOf("."),~v.indexOf("-")?"-"+[h.majorTicksInt+h.majorTicksDec+2+(S?1:0)-v.length].join("0")+v.replace("-",""):[h.majorTicksInt+h.majorTicksDec+1+(S?1:0)-v.length].join("0")+v):v}function w(p){return p*Math.PI/180}function M(p,h){return{x:-p*Math.sin(h),y:p*Math.cos(h)}}function G(p,h,v,S){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],P=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,U=p.createLinearGradient(k?0:P,k?P:0,k?0:S,k?S:0);return U.addColorStop(0,h),U.addColorStop(1,v),U}function E(p,h){h.needleShadow&&(p.shadowOffsetX=2,p.shadowOffsetY=2,p.shadowBlur=10,p.shadowColor=h.colorNeedleShadowDown)}function F(p,h,v){return p["font"+h+"Style"]+" "+p["font"+h+"Weight"]+" "+p["font"+h+"Size"]*v+"px "+p["font"+h]}function I(p){p.shadowOffsetX=null,p.shadowOffsetY=null,p.shadowBlur=null,p.shadowColor="",p.strokeStyle=null,p.lineWidth=0,p.save()}function Z(p,h,v,S){h.valueTextShadow&&(p.shadowOffsetX=v,p.shadowOffsetY=v,p.shadowBlur=S,p.shadowColor=h.colorValueTextShadow)}function j(p,h,v,S,k,P){if(h.valueBox){I(p);var U=h.valueDec?1+h.valueDec:0,$="9".repeat(Math.max.apply(null,[String(parseInt(v)).length+U].concat(h.majorTicks.map(function(qe){return String(parseInt(qe,10)).length+U})))),H=h.valueText||A(v,h),Y=P/200,ce=P/100,me=.4*ce,Ee=1.2*ce;p.font=F(h,"Value",Y),Z(p,h,me,Ee);var De=p.measureText(h.valueText?H:"-"+A(Number($),h)).width;I(p);var Oe=parseFloat(h.fontValueSize)*Y+me+Ee,Xe=ce*parseFloat(h.valueBoxStroke),Ie=2*P-2*Xe,je=De+10*ce,Ye=1.1*Oe+me+Ee,Je=ce*h.valueBoxBorderRadius,ze=(parseFloat(h.valueBoxWidth)||0)/100*Ie;ze>je&&(je=ze),je>Ie&&(je=Ie);var He=S-je/2,Fe=k-Ye/2,Pe=k-5.75*ce;if(p.beginPath(),Je?b(p,He,Fe,je,Ye,Je):p.rect(He,Fe,je,Ye),Xe){var Re=p.createRadialGradient(S,Pe,10*ce,S,Pe,20*ce);Re.addColorStop(0,h.colorValueBoxRect),Re.addColorStop(1,h.colorValueBoxRectEnd),p.strokeStyle=Re,p.lineWidth=Xe,p.stroke()}h.colorValueBoxShadow&&(p.shadowBlur=1.2*ce,p.shadowColor=h.colorValueBoxShadow),h.colorValueBoxBackground&&(p.fillStyle=h.colorValueBoxBackground,p.fill()),p.closePath(),p.restore(),Z(p,h,me,Ee),p.fillStyle=h.colorValueText,p.textAlign="center",p.textBaseline="alphabetic",p.fillText(H,He+je/2,k+Ye/2-Oe/3),p.restore()}}function ye(p){var h=p.value,v=p.minValue,S=p.maxValue,k=.01*(S-v);return{normal:h<v?v:h>S?S:h,indented:h<v?v-k:h>S?S+k:h}}function ue(p,h,v,S,k){v.beginPath(),v.arc(0,0,Ri(p),0,2*Po,!0),v.lineWidth=h,v.strokeStyle=k?we.linearGradient(v,S,k,p):S,v.stroke(),v.closePath()}function ie(p,h){var v=Oi.pixelRatio;return p.maxRadius||(p.maxRadius=p.max-h.borderShadowWidth-h.borderOuterWidth*v-h.borderMiddleWidth*v-h.borderInnerWidth*v+(h.borderOuterWidth?.5:0)+(h.borderMiddleWidth?.5:0)+(h.borderInnerWidth?.5:0)),p.maxRadius}function re(p,h){function v(me,Ee,De,Oe,Xe,Ie){return Ee&&(!Ie&&h.borderShadowWidth&&(De.save(),De.shadowBlur=h.borderShadowWidth,De.shadowColor=h.colorBorderShadow),ue(me,Ee*S,De,Oe,Xe),!Ie&&h.borderShadowWidth&&(Ie=!0,De.restore())),Ie}var S=Oi.pixelRatio,k=h.borderShadowWidth*S,P=p.max-k-h.borderOuterWidth*S/2,U=P-h.borderOuterWidth*S/2-h.borderMiddleWidth*S/2+.5,$=U-h.borderMiddleWidth*S/2-h.borderInnerWidth*S/2+.5,H=ie(p,h),Y=void 0,ce=!1;p.save(),ce=v(P,h.borderOuterWidth,p,h.colorBorderOuter,h.colorBorderOuterEnd,ce),ce=v(U,h.borderMiddleWidth,p,h.colorBorderMiddle,h.colorBorderMiddleEnd,ce),ce=v($,h.borderInnerWidth,p,h.colorBorderInner,h.colorBorderInnerEnd,ce),!ce&&h.borderShadowWidth&&(p.shadowBlur=h.borderShadowWidth,p.shadowColor=h.colorBorderShadow),p.beginPath(),p.arc(0,0,Ri(H),0,2*Po,!0),h.colorPlateEnd?(Y=p.createRadialGradient(0,0,H/2,0,0,H),Y.addColorStop(0,h.colorPlate),Y.addColorStop(1,h.colorPlateEnd)):Y=h.colorPlate,p.fillStyle=Y,p.fill(),p.closePath(),p.restore()}function de(p,h){if(h.highlights!=="false"&&h.highlights.length&&h.highlightsWidth!==0){var v=p.max*(parseFloat(h.highlightsWidth)||0)/100,S=Ri(ve(p,h)-v/2),k=h.highlights.length,P=(h.maxValue-h.minValue)/h.ticksAngle;p.save();for(var U=0;U<k;U++){var $=h.highlights[U];p.lineWidth=v,p.lineCap=h.highlightsLineCap,p.strokeStyle=$.color,p.beginPath(),p.rotate(gl),p.arc(0,0,S,we.radians(h.startAngle+($.from-h.minValue)/P),we.radians(h.startAngle+($.to-h.minValue)/P),!1),p.stroke(),p.closePath(),p.restore(),p.save()}p.restore()}}function ee(p,h){var v=ve(p,h),S=void 0,k=void 0,P=void 0,U=0,$=Math.abs(h.minorTicks)||0,H=h.ticksAngle/(h.maxValue-h.minValue);h.exactTicks?(k=h.maxValue-h.minValue,S=$?k/$:0,U=($i.mod(h.majorTicks[0],$)||0)*H):S=$*(h.majorTicks.length-1),p.lineWidth=Oi.pixelRatio,p.strokeStyle=h.colorMinorTicks||h.colorStrokeTicks,p.save();for(var Y=0;Y<S;++Y)(P=h.startAngle+U+Y*(h.ticksAngle/S))<=h.ticksAngle+h.startAngle&&(p.rotate(we.radians(P)),p.beginPath(),p.moveTo(0,v),p.lineTo(0,v-.075*p.max),Ue(p));p.restore()}function ve(p,h){var v=p.max/100;return ie(p,h)-5*v-(h.barWidth?2*(parseFloat(h.barStrokeWidth)||0)+((parseFloat(h.barWidth)||0)+5)*v:0)}function le(p,h){we.prepareTicks(h);var v=Ri(ve(p,h)),S=void 0,k=h.majorTicks.length,P=Oi.pixelRatio;p.lineWidth=2*P,S=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(k).fill(h.colorStrokeTicks||h.colorMajorTicks);for(var U=0;U<k;++U)p.save(),p.strokeStyle=S[U],p.rotate(we.radians(ge(h,h.exactTicks?h.majorTicks[U]:U,k))),p.beginPath(),p.moveTo(0,v),p.lineTo(0,v-.15*p.max),p.stroke(),p.closePath(),p.restore();h.strokeTicks&&(p.save(),p.strokeStyle=h.colorStrokeTicks||S[0],p.rotate(gl),p.beginPath(),p.arc(0,0,v,we.radians(h.startAngle),we.radians(h.startAngle+h.ticksAngle),!1),p.stroke(),p.closePath(),p.restore())}function ge(p,h,v){if(p.exactTicks){var S=p.ticksAngle/(p.maxValue-p.minValue);return p.startAngle+S*(h-p.minValue)}return p.startAngle+h*(p.ticksAngle/(v-1))}function Ue(p){p.stroke(),p.restore(),p.closePath(),p.save()}function ot(p,h){var v=ve(p,h)-.15*p.max,S={},k=0,P=h.majorTicks.length,U=h.animationTarget!=="needle",$=h.colorNumbers instanceof Array?h.colorNumbers:new Array(P).fill(h.colorNumbers),H=U?-(h.value-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle:0;for(U&&(p.save(),p.rotate(-we.radians(H))),p.font=we.font(h,"Numbers",p.max/200),p.lineWidth=0,p.textAlign="center",p.textBaseline="middle";k<P;++k){var Y=H+ge(h,h.exactTicks?h.majorTicks[k]:k,P),ce=p.measureText(h.majorTicks[k]).width,me=h.fontNumbersSize,Ee=Math.sqrt(ce*ce+me*me)/2,De=we.radialPoint(v-Ee-h.numbersMargin/100*p.max,we.radians(Y));Y===360&&(Y=0),S[Y]||(S[Y]=!0,p.fillStyle=$[k],p.fillText(h.majorTicks[k],De.x,De.y))}U&&p.restore()}function Mt(p,h){h.title&&(p.save(),p.font=we.font(h,"Title",p.max/200),p.fillStyle=h.colorTitle,p.textAlign="center",p.fillText(h.title,0,-p.max/4.25,.8*p.max),p.restore())}function Yt(p,h){h.units&&(p.save(),p.font=we.font(h,"Units",p.max/200),p.fillStyle=h.colorUnits,p.textAlign="center",p.fillText(we.formatContext(h,h.units),0,p.max/3.25,.8*p.max),p.restore())}function mi(p,h){if(h.needle){var v=h.animationTarget!=="needle",S=h.ticksAngle<360?we.normalizedValue(h).indented:h.value,k=v?h.startAngle:h.startAngle+(S-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle;h.barStartPosition==="right"&&(k=h.startAngle+h.ticksAngle-(S-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle);var P=ie(p,h),U=Ri(P/100*h.needleCircleSize),$=Ri(P/100*h.needleCircleSize*.75),H=Ri(P/100*h.needleEnd),Y=Ri(h.needleStart?P/100*h.needleStart:0),ce=P/100*h.needleWidth,me=P/100*h.needleWidth/2,Ee=Oi.pixelRatio;p.save(),we.drawNeedleShadow(p,h),p.rotate(we.radians(k)),p.fillStyle=we.linearGradient(p,h.colorNeedle,h.colorNeedleEnd,H-Y),h.needleType==="arrow"?(p.beginPath(),p.moveTo(-me,-Y),p.lineTo(-ce,0),p.lineTo(-1*Ee,H),p.lineTo(Ee,H),p.lineTo(ce,0),p.lineTo(me,-Y),p.closePath(),p.fill(),p.beginPath(),p.lineTo(-.5*Ee,H),p.lineTo(-1*Ee,H),p.lineTo(-ce,0),p.lineTo(-me,-Y),p.lineTo(me/2*Ee-2*Ee,-Y),p.closePath(),p.fillStyle=h.colorNeedleShadowUp,p.fill()):(p.beginPath(),p.moveTo(-me,H),p.lineTo(-me,Y),p.lineTo(me,Y),p.lineTo(me,H),p.closePath(),p.fill()),p.restore(),h.needleCircleSize&&(p.save(),we.drawNeedleShadow(p,h),h.needleCircleOuter&&(p.beginPath(),p.arc(0,0,U,0,2*Po,!0),p.fillStyle=we.linearGradient(p,h.colorNeedleCircleOuter,h.colorNeedleCircleOuterEnd,U),p.fill(),p.closePath()),h.needleCircleInner&&(p.beginPath(),p.arc(0,0,$,0,2*Po,!0),p.fillStyle=we.linearGradient(p,h.colorNeedleCircleInner,h.colorNeedleCircleInnerEnd,$),p.fill(),p.closePath()),p.restore())}}function ra(p,h,v){we.drawValueBox(p,h,v,0,p.max-.33*p.max,p.max)}function Ra(p){var h=p.startAngle,v=p.startAngle+p.ticksAngle,S=h,k=h+(we.normalizedValue(p).normal-p.minValue)/(p.maxValue-p.minValue)*p.ticksAngle;if(p.barStartPosition==="middle"){var P=.5*(p.minValue+p.maxValue);p.value<P?(S=180-(P-we.normalizedValue(p).normal)/(p.maxValue-p.minValue)*p.ticksAngle,k=180):(S=180,k=180+(we.normalizedValue(p).normal-P)/(p.maxValue-p.minValue)*p.ticksAngle)}else p.barStartPosition==="right"&&(S=v-k+h,k=v);return{startAngle:S,endAngle:k}}function sa(p,h){var v=p.max/100,S=ie(p,h)-5*v,k=parseFloat(h.barStrokeWidth+"")||0,P=(parseFloat(h.barWidth+"")||0)*v,U=S-2*k-P,$=(S-U)/2,H=U+$,Y=k/H,ce=h.startAngle,me=h.startAngle+h.ticksAngle;if(p.save(),p.rotate(gl),k&&(p.beginPath(),p.arc(0,0,H,we.radians(ce)-Y,we.radians(me)+Y,!1),p.strokeStyle=h.colorBarStroke,p.lineWidth=2*$,p.stroke(),p.closePath()),P&&(p.beginPath(),p.arc(0,0,H,we.radians(ce),we.radians(me),!1),p.strokeStyle=h.colorBar,p.lineWidth=P,p.stroke(),p.closePath(),h.barShadow&&(p.save(),p.beginPath(),p.arc(0,0,S,we.radians(ce),we.radians(me),!1),p.clip(),p.beginPath(),p.strokeStyle=h.colorBar,p.lineWidth=1,p.shadowBlur=h.barShadow,p.shadowColor=h.colorBarShadow,p.shadowOffsetX=0,p.shadowOffsetY=0,p.arc(0,0,S,we.radians(h.startAngle),we.radians(h.startAngle+h.ticksAngle),!1),p.stroke(),p.closePath(),p.restore()),h.barProgress)){var Ee=Ra(h),De=Ee.startAngle,Oe=Ee.endAngle;p.beginPath(),p.arc(0,0,H,we.radians(De),we.radians(Oe),!1),p.strokeStyle=h.colorBarProgress,p.lineWidth=P,p.stroke(),p.closePath()}p.restore()}function La(p){return p.options.animatedValue?p.options.value:p.value}function wo(p,h,v,S,k,P,U,$){p.beginPath(),p.fillStyle=$?we.linearGradient(p,U,$,k>P?k:P,P>k,k>P?v:S):U,h>0?we.roundRect(p,v,S,k,P,h):p.rect(v,S,k,P),p.fill(),p.closePath()}function Ni(p,h,v,S,k,P,U,$,H){p.beginPath(),p.lineWidth=h,p.strokeStyle=H?we.linearGradient(p,$,H,U,!0,k):$,v>0?we.roundRect(p,S,k,P,U,v):p.rect(S,k,P,U),p.stroke(),p.closePath()}function _o(p,h,v,S,k,P){function U(qe,tt,ht,Kt){return qe&&(!Kt&&h.borderShadowWidth&&(p.save(),p.shadowBlur=h.borderShadowWidth,p.shadowColor=h.colorBorderShadow),Ni(p,qe*$,H,v+qe*$/2-Pe,S+qe*$/2-Pe,Y,De,tt,ht),Pe+=.5*$,!Kt&&h.borderShadowWidth&&(Kt=!0,p.restore())),Kt}var $=Oi.pixelRatio,H=h.borderRadius*$,Y=k-h.borderShadowWidth-h.borderOuterWidth*$,ce=Y-h.borderOuterWidth*$-h.borderMiddleWidth*$,me=ce-h.borderMiddleWidth*$-h.borderInnerWidth*$,Ee=me-h.borderInnerWidth*$,De=P-h.borderShadowWidth-h.borderOuterWidth*$,Oe=De-h.borderOuterWidth*$-h.borderMiddleWidth*$,Xe=Oe-h.borderMiddleWidth*$-h.borderInnerWidth*$,Ie=Xe-h.borderInnerWidth*$,je=v-(ce-Y)/2,Ye=je-(me-ce)/2,Je=Ye-(Ee-me)/2,ze=S-(Oe-De)/2,He=ze-(Xe-Oe)/2,Fe=He-(Ie-Xe)/2,Pe=0,Re=!1;return p.save(),Re=U(h.borderOuterWidth,h.colorBorderOuter,h.colorBorderOuterEnd,Re),Re=U(h.borderMiddleWidth,h.colorBorderMiddle,h.colorBorderMiddleEnd,Re),Re=U(h.borderInnerWidth,h.colorBorderInner,h.colorBorderInnerEnd,Re),!Re&&h.borderShadowWidth&&(p.shadowBlur=h.borderShadowWidth,p.shadowColor=h.colorBorderShadow),wo(p,H,Je,Fe,Ee+2*Pe,Ie+2*Pe,h.colorPlate,h.colorPlateEnd),p.restore(),[Je,Fe,Ee,Ie]}function Mo(p,h,v,S,k,P){var U=Oi.pixelRatio,$=P>=k,H=$?.85*k:P,Y=$?P:k;v=$?We(v+(k-H)/2):v;var ce=!!h.title,me=!!h.units,Ee=!!h.valueBox,De=void 0,Oe=void 0,Xe=void 0;$?(Oe=We(.05*Y),De=We(.075*Y),Xe=We(.11*Y),ce&&(Y-=De,S+=De),me&&(Y-=Oe),Ee&&(Y-=Xe)):(Oe=De=We(.15*H),ce&&(H-=De,S+=De),me&&(H-=Oe));var Ie=2*h.barStrokeWidth,je=h.barBeginCircle?We(H*h.barBeginCircle/200-Ie/2):0,Ye=We(H*h.barWidth/100-Ie),Je=We(Y*h.barLength/100-Ie),ze=We((Y-Je)/2),He=We(v+($?H/2:ze+je)),Fe=We(S+($?Y-ze-je+Ie/2:H/2)),Pe=!$||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*H,Re=$||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*H;return p.barDimensions={isVertical:$,width:H,length:Y,barWidth:Ye,barLength:Je,strokeWidth:Ie,barMargin:ze,radius:je,pixelRatio:U,barOffset:null,titleMargin:ce?De:0,unitsMargin:me?Oe:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:v+Pe,Y:S+Re,x0:He+Pe,y0:Fe+Re,baseX:v,baseY:S,ticksPadding:h.ticksPadding/100},p.barDimensions}function Va(p,h,v,S,k,P,U){var $=Mo(p,h,S,k,P,U),H=$.isVertical,Y=$.width,ce=$.barWidth,me=$.barLength,Ee=$.strokeWidth,De=$.barMargin,Oe=$.radius,Xe=$.x0,Ie=$.y0,je=$.X,Ye=$.Y,Je=me;p.save(),p.beginPath();var ze=null;if(h.barBeginCircle){var He=we.radians(H?270:0),Fe=Math.asin(ce/2/Oe),Pe=Math.cos(Fe),Re=Math.sin(Fe),qe=Xe+(H?Oe*Re:Oe*Pe-Ee/2),tt=H?Ie-Oe*Pe:Ie+Oe*Re,ht=Ri(H?tt-Ie:qe-Xe);ze=We(ht+Oe);var Kt=H?We(Xe-Oe*Re):qe,fi=H?tt:We(Ie-Oe*Re);v==="progress"&&(me=ze+(me-ze)*(we.normalizedValue(h).normal-h.minValue)/(h.maxValue-h.minValue));var Io=We(qe+me-ze+Ee/2),da=We(tt-me+ze-Ee/2);p.arc(Xe,Ie,Oe,He+Fe,He-Fe),H?(p.moveTo(qe,fi),p.lineTo(qe,da),p.lineTo(Kt,da),p.lineTo(Kt,fi)):(p.moveTo(qe,fi),p.lineTo(Io,fi),p.lineTo(Io,tt),p.lineTo(qe,tt))}else{var qd=We(H?je+(Y-ce)/2:je+De),$d=We(H?Ye+me+De:Ye+(Y-ce)/2);v==="progress"&&(me*=(h.value-h.minValue)/(h.maxValue-h.minValue)),H?p.rect(qd,$d,ce,-me):p.rect(qd,$d,me,ce)}v!=="progress"&&h.barStrokeWidth&&(p.lineWidth=Ee,p.strokeStyle=h.colorBarStroke,p.stroke()),v!=="progress"&&h.colorBar?(p.fillStyle=h.colorBarEnd?we.linearGradient(p,h.colorBar,h.colorBarEnd,me,H,H?Ye:je):h.colorBar,p.fill()):v==="progress"&&h.colorBarProgress&&(p.fillStyle=h.colorBarProgressEnd?we.linearGradient(p,h.colorBarProgress,h.colorBarProgressEnd,Je,H,H?Ye:je):h.colorBarProgress,p.fill()),p.closePath(),p.restore(),h.barBeginCircle&&(p.barDimensions.radius+=Ee),p.barDimensions.barOffset=ze,p.barDimensions.barWidth+=Ee,p.barDimensions.barLength+=Ee}function ko(p,h,v,S,k,P){Va(p,h,"",v,S,k,P)}function To(p,h){return h.needleSide!==p||h.tickSide!==p||h.numberSide!==p}function gr(p,h,v,S,k,P){h.barProgress&&Va(p,h,"progress",v,S,k,P)}function _g(p,h){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.barWidth,$=v.barOffset,H=v.barMargin,Y=v.X,ce=v.Y,me=v.ticksLength,Ee=v.ticksPadding,De=k*(parseFloat(h.highlightsWidth)||0)/100;if(h.highlights&&De){var Oe=h.tickSide!=="right",Xe=h.tickSide!=="left",Ie=0,je=h.highlights.length,Ye=(k-U)/2,Je=h.maxValue-h.minValue,ze=We(S?Y+Ye:Y+H+$),He=De,Fe=S?ce+P-H-$:ce+Ye,Pe=We((h.ticksWidth/100+Ee)*k)+(De-h.ticksWidth/100*k),Re=We(U+Ee*k);for(p.save();Ie<je;Ie++){var qe=h.highlights[Ie],tt=me*Ri(h.minValue-qe.from)/Je,ht=me*Ri((qe.to-qe.from)/Je);p.beginPath(),p.fillStyle=qe.color,S?(Oe&&p.rect(ze-Pe,Fe-tt,He,-ht),Xe&&p.rect(ze+Re,Fe-tt,He,-ht)):(Oe&&p.rect(ze+tt,Fe-Pe,ht,He),Xe&&p.rect(ze+tt,Fe+Re,ht,He)),p.fill(),p.closePath()}p.restore()}}function vr(p,h,v,S,k){p.beginPath(),p.moveTo(h,v),p.lineTo(S,k),p.stroke(),p.closePath()}function Fd(p,h,v,S,k,P,U,$,H){var Y=p.barDimensions,ce=Y.isVertical,me=Y.length,Ee=Y.barWidth,De=Y.barOffset,Oe=Y.barMargin,Xe=Y.pixelRatio,Ie=Y.width,je=Y.X,Ye=Y.Y,Je=Y.ticksLength,ze=Y.ticksPadding,He=(Ie-Ee)/2,Fe=void 0,Pe=void 0,Re=0,qe=v.length,tt=void 0,ht=H*Ie,Kt=He-ze*Ie,fi=He+Ee+ht+ze*Ie,Io=h instanceof Array?h:new Array(v.length).fill(h);p.save(),p.lineWidth=$*Xe;for(var da=Je/(k-S);Re<qe;Re++)tt=v[Re],p.strokeStyle=Io[Re],ce?(Pe=Ye+me-Oe-De+(S-tt)*da,P&&(Fe=je+Kt,vr(p,Fe,Pe,We(Fe-ht),Pe)),U&&(Fe=je+fi,vr(p,Fe,Pe,We(Fe-ht),Pe))):(Fe=je+Oe+De-(S-tt)*da,P&&(Pe=Ye+Kt,vr(p,Fe,Pe,Fe,We(Pe-ht))),U&&(Pe=Ye+fi,vr(p,Fe,We(Pe),Fe,Pe-ht)));p.restore()}function Mg(p,h){var v=we.prepareTicks(h),S=Bd(v,2),k=S[0],P=S[1],U=2,$=(h.maxValue-h.minValue)/(h.majorTicks.length-1),H=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(h.majorTicks.length).fill(h.colorStrokeTicks||h.colorMajorTicks);if(Fd(p,H,h.exactTicks?h.majorTicks:h.majorTicks.map(function(ht,Kt){return h.minValue+$*Kt}),h.minValue,h.maxValue,k,P,U,h.ticksWidth/100),h.strokeTicks){var Y=p.barDimensions,ce=Y.isVertical,me=Y.length,Ee=Y.width,De=Y.barWidth,Oe=Y.barMargin,Xe=Y.barOffset,Ie=Y.X,je=Y.Y,Ye=Y.ticksLength,Je=Y.pixelRatio,ze=Y.ticksPadding,He=(Ee-De)/2+De+ze*Ee,Fe=(Ee-De)/2-ze*Ee,Pe=void 0,Re=void 0,qe=void 0,tt=void 0;p.strokeStyle=h.colorStrokeTicks||H[0],U*=Je,ce?(Re=je+me-Oe-Xe+U/2,tt=Re-Ye-U,k&&(qe=Pe=We(Ie+Fe),br(p,Pe,Re,qe,tt)),P&&(qe=Pe=We(Ie+He),br(p,Pe,Re,qe,tt))):(Pe=Ie+Oe+Xe-U/2,qe=Pe+Ye+U,k&&(tt=Re=We(je+Fe),br(p,Pe,Re,qe,tt)),P&&(tt=Re=We(je+He),br(p,Pe,Re,qe,tt)))}}function br(p,h,v,S,k){p.beginPath(),p.moveTo(h,v),p.lineTo(S,k),p.stroke(),p.closePath()}function kg(p,h){var v=we.prepareTicks(h),S=Bd(v,2),k=S[0],P=S[1],U=[],$=h.minValue,H=Math.abs(h.minorTicks)||0,Y=H?(h.maxValue-h.minValue)/(H*(h.majorTicks.length-1)):0;if(H)if(h.exactTicks)for(var ce=$i.mod(h.majorTicks[0],H)||0;$<h.maxValue;$+=H)ce+$<h.maxValue&&U.push(ce+$);else for(;$<h.maxValue;$+=Y)U.push($);Fd(p,h.colorMinorTicks||h.colorStrokeTicks,U,h.minValue,h.maxValue,k,P,1,h.ticksWidthMinor/100)}function Tg(p,h){var v=p.barDimensions,S=v.isVertical,k=v.length,P=v.width,U=v.barWidth,$=v.barMargin,H=v.barOffset,Y=v.X,ce=v.Y,me=v.ticksLength,Ee=v.ticksPadding,De=h.maxValue-h.minValue,Oe=De/(h.majorTicks.length-1),Xe=h.exactTicks?h.majorTicks:h.majorTicks.map(function(Io,da){return h.minValue+Oe*da}),Ie=Xe.length,je=h.numberSide!=="right",Ye=h.numberSide!=="left",Je=h.fontNumbersSize*P/200,ze=0,He=(h.ticksWidth/100+2*Ee)*P,Fe=(P-U)/2-He,Pe=(P-U)/2+U+He,Re=void 0,qe=void 0,tt=void 0,ht=void 0,Kt=h.colorNumbers instanceof Array?h.colorNumbers:new Array(Ie).fill(h.colorNumbers),fi=h.numbersMargin/100*P;for(p.font=we.font(h,"Numbers",P/200),p.lineWidth=0,p.textAlign="center";ze<Ie;ze++)p.fillStyle=Kt[ze],ht=h.majorTicks[ze],tt=h.exactTicks?me*((Xe[ze]-h.minValue)/De):ze*me/(Ie-1),S?(qe=ce+k-$-H-tt+Je/3,je&&(p.textAlign="right",p.fillText(ht,Y+Fe-fi,qe)),Ye&&(p.textAlign="left",p.fillText(ht,Y+Pe+fi,qe))):(p.measureText(ht).width,Re=Y+$+H+tt,je&&p.fillText(ht,Re,ce+Fe-fi),Ye&&p.fillText(ht,Re,ce+Pe+Je+fi))}function Eg(p,h){if(h.title){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.baseX,$=v.baseY,H=v.titleMargin,Y=h.fontTitleSize*k/200,ce=We(U+(S?k:P)/2),me=We($+H/2-(S?Y:Y/2)-.025*(S?P:k));p.save(),p.textAlign="center",p.fillStyle=h.colorTitle,p.font=we.font(h,"Title",k/200),p.lineWidth=0,p.fillText(h.title,ce,me,S?k:P),p.restore()}}function Dg(p,h){if(h.units){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.baseX,$=v.baseY,H=v.unitsMargin,Y=h.fontUnitsSize*k/200,ce=We(U+(S?k:P)/2),me=We($+(S?P:k)+H/2-Y/2);p.save(),p.textAlign="center",p.fillStyle=h.colorUnits,p.font=we.font(h,"Units",k/200),p.lineWidth=0,p.fillText(we.formatContext(h,h.units),ce,me,S?k:P),p.restore()}}function Pg(p,h){if(h.needle){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.barWidth,$=v.barOffset,H=v.barMargin,Y=v.ticksLength,ce=v.X,me=v.Y,Ee=v.ticksPadding,De=h.needleSide!=="right",Oe=h.needleSide!=="left",Xe=Y*(we.normalizedValue(h).indented-h.minValue)/(h.maxValue-h.minValue),Ie=(h.ticksWidth/100+Ee)*k,je=U/2+Ie,Ye=je*(h.needleEnd/100),Je=void 0,ze=void 0,He=void 0,Fe=void 0,Pe=h.needleType.toLowerCase()==="arrow"?Ng:Ig,Re=(k-U)/2,qe=je*(h.needleStart/100),tt=Re-Ie-qe,ht=Re+U+Ie+qe;p.save(),we.drawNeedleShadow(p,h),S?(He=We(me+P-H-$-Xe),De&&(Je=We(ce+tt),ze=Je+Ye,Pe(p,h,Je,He,ze,He,Ye)),Oe&&(Je=We(ce+ht),ze=Je-Ye,Pe(p,h,Je,He,ze,He,Ye,!0))):(Je=We(ce+H+$+Xe),De&&(He=We(me+tt),Fe=He+Ye,Pe(p,h,Je,He,Je,Fe,Ye)),Oe&&(He=We(me+ht),Fe=He-Ye,Pe(p,h,Je,He,Je,Fe,Ye,!0))),p.restore()}}function Gd(p,h,v,S){return h.colorNeedleEnd?we.linearGradient(p,S?h.colorNeedleEnd:h.colorNeedle,S?h.colorNeedle:h.colorNeedleEnd,v,!p.barDimensions.isVertical):h.colorNeedle}function Ig(p,h,v,S,k,P,U,$){p.lineWidth=h.needleWidth,p.strokeStyle=Gd(p,h,U,$),p.beginPath(),p.moveTo(v,S),p.lineTo(k,P),p.stroke(),p.closePath()}function Ng(p,h,v,S,k,P,U,$){var H=We(.4*U),Y=U-H,ce=v===k,me=h.needleWidth/2;p.fillStyle=Gd(p,h,U,$),p.beginPath(),ce?(S>P&&(Y*=-1),p.moveTo(v-me,S),p.lineTo(v+me,S),p.lineTo(v+me,S+Y),p.lineTo(v,P),p.lineTo(v-me,S+Y),p.lineTo(v-me,S)):(v>k&&(Y*=-1),p.moveTo(v,S-me),p.lineTo(v,S+me),p.lineTo(v+Y,S+me),p.lineTo(k,S),p.lineTo(v+Y,S-me),p.lineTo(v,S-me)),p.fill(),p.closePath()}function Og(p,h,v,S,k,P,U){var $=(parseFloat(h.fontValueSize)||0)*P/200,H=(.11*U-$)/2;p.barDimensions.isVertical&&we.drawValueBox(p,h,v,S+P/2,k+U-$-H,P)}var Bd=(function(){function p(h,v){var S=[],k=!0,P=!1,U=void 0;try{for(var $,H=h[Symbol.iterator]();!(k=($=H.next()).done)&&(S.push($.value),!v||S.length!==v);k=!0);}catch(Y){P=!0,U=Y}finally{try{!k&&H.return&&H.return()}finally{if(P)throw U}}return S}return function(h,v){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return p(h,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),ml=function p(h,v,S){h===null&&(h=Function.prototype);var k=Object.getOwnPropertyDescriptor(h,v);if(k===void 0){var P=Object.getPrototypeOf(h);return P===null?void 0:p(P,v,S)}if("value"in k)return k.value;var U=k.get;if(U!==void 0)return U.call(S)},Rg=function p(h,v,S,k){var P=Object.getOwnPropertyDescriptor(h,v);if(P===void 0){var U=Object.getPrototypeOf(h);U!==null&&p(U,v,S,k)}else if("value"in P&&P.writable)P.value=S;else{var $=P.set;$!==void 0&&$.call(k,S)}return S},la=(function(){function p(h,v){for(var S=0;S<v.length;S++){var k=v[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(h,k.key,k)}}return function(h,v,S){return v&&p(h.prototype,v),S&&p(h,S),h}})(),Ar=null,Lg=(function(){function p(){i(this,p),this._events={},this.addListener=this.on,this.removeListener=this.off}return la(p,[{key:"emit",value:function(h){if(this._events[h]){for(var v=0,S=this._events[h].length,k=arguments.length,P=Array(k>1?k-1:0),U=1;U<k;U++)P[U-1]=arguments[U];for(;v<S;v++)this._events[h][v]&&this._events[h][v].apply(this,P)}}},{key:"once",value:function(h){for(var v=arguments.length,S=Array(v>1?v-1:0),k=1;k<v;k++)S[k-1]=arguments[k];for(var P=0,U=S.length,$=this;P<U;P++)(function(){var H=S[P],Y=function ce(){$.off(h,ce),H.apply($,arguments)};S[P]=Y})();this.on.apply(this,[h].concat(S))}},{key:"on",value:function(h){this._events[h]||(this._events[h]=[]);for(var v=0,S=arguments.length<=1?0:arguments.length-1;v<S;v++)this._events[h].push(arguments.length<=v+1?void 0:arguments[v+1])}},{key:"off",value:function(h){if(this._events[h])for(var v=0,S=arguments.length<=1?0:arguments.length-1;v<S;v++)for(var k=arguments.length<=v+1?void 0:arguments[v+1],P=void 0;~(P=this._events[h].indexOf(k));)this._events[h].splice(P,1)}},{key:"removeAllListeners",value:function(h){delete this._events[h]}},{key:"listeners",get:function(){return this._events}}]),p})(),Ud=a("requestAnimationFrame")||function(p){return setTimeout(function(){return p(new Date().getTime())},1e3/60)},Eo={linear:function(p){return p},quad:function(p){return Math.pow(p,2)},dequad:function(p){return 1-Eo.quad(1-p)},quint:function(p){return Math.pow(p,5)},dequint:function(p){return 1-Math.pow(1-p,5)},cycle:function(p){return 1-Math.sin(Math.acos(p))},decycle:function(p){return Math.sin(Math.acos(1-p))},bounce:function(p){return 1-Eo.debounce(1-p)},debounce:function(p){for(var h=0,v=1;;h+=v,v/=2)if(p>=(7-4*h)/11)return-Math.pow((11-6*h-11*p)/4,2)+Math.pow(v,2)},elastic:function(p){return 1-Eo.delastic(1-p)},delastic:function(p){return Math.pow(2,10*(p-1))*Math.cos(20*Math.PI*1.5/3*p)}},hl=(function(){function p(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,p),this.duration=v,this.rule=h,this.draw=S,this.end=k,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",S);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",k)}return la(p,[{key:"animate",value:function(h,v){var S=this;this.frame&&this.cancel();var k=window.performance&&window.performance.now?window.performance.now():a("animationStartTime")||Date.now();h=h||this.draw,v=v||this.end,this.draw=h,this.end=v,this.frame=Ud(function(P){return r(P,h,k,Eo[S.rule]||S.rule,S.duration,v,S)})}},{key:"cancel",value:function(){this.frame&&((a("cancelAnimationFrame")||function(h){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),p})();hl.rules=Eo;var Wa=(function(){function p(h,v,S){i(this,p),this.options=h,this.element=v.toLowerCase(),this.type=p.toDashed(S),this.Type=n[S],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||p.domReady(this.traverse.bind(this))}return la(p,[{key:"isValidNode",value:function(h){return!(!h.tagName||h.tagName.toLowerCase()!==this.element||h.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var h=document.getElementsByTagName(this.element),v=0,S=h.length;v<S;v++)this.process(h[v]);this.isObservable&&!this.mutationsObserved&&(new MutationObserver(this.observe.bind(this)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.mutationsObserved=!0)}},{key:"observe",value:function(h){for(var v=0,S=h.length;v<S;v++){var k=h[v];if(k.type==="attributes"&&k.attributeName==="data-type"&&this.isValidNode(k.target)&&k.oldValue!==this.type)setTimeout(this.process.bind(this,k.target));else if(k.addedNodes&&k.addedNodes.length)for(var P=0,U=k.addedNodes.length;P<U;P++)setTimeout(this.process.bind(this,k.addedNodes[P]))}}},{key:"process",value:function(h){var v=this;if(!this.isValidNode(h))return null;var S=void 0,k=JSON.parse(JSON.stringify(this.options)),P=null;for(S in k)if(k.hasOwnProperty(S)){var U=p.toAttributeName(S),$=p.parse(h.getAttribute(U));$!=null&&(k[S]=$)}return k.renderTo=h,P=new this.Type(k),P.draw&&P.draw(),this.isObservable&&(P.observer=new MutationObserver(function(H){H.forEach(function(Y){if(Y.type==="attributes"){var ce=Y.attributeName.toLowerCase(),me=h.getAttribute(ce).toLowerCase();if(ce==="data-type"&&me&&me!==v.type)P.observer.disconnect(),delete P.observer,P.destroy&&P.destroy();else if(ce.substr(0,5)==="data-"){var Ee=ce.substr(5).split("-").map(function(Oe,Xe){return Xe?Oe.charAt(0).toUpperCase()+Oe.substr(1):Oe}).join(""),De={};De[Ee]=p.parse(h.getAttribute(Y.attributeName)),Ee==="value"?P&&(P.value=De[Ee]):P.update&&P.update(De)}}})}),P.observer.observe(h,{attributes:!0})),P}}],[{key:"parse",value:function(h){if(h==="true")return!0;if(h==="false")return!1;if(h!=="undefined"){if(h==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(h))return h.split(",");try{return JSON.parse(h)}catch(v){}return h}}},{key:"toDashed",value:function(h){for(var v=h.split(/(?=[A-Z])/),S=1,k=v.length,P=v[0].toLowerCase();S<k;S++)P+="-"+v[S].toLowerCase();return P}},{key:"toCamelCase",value:function(h){for(var v=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=h.split(/-/),k=0,P=S.length,U="";k<P;k++)U+=k||v?S[k][0].toUpperCase()+S[k].substr(1).toLowerCase():S[k].toLowerCase();return U}},{key:"toAttributeName",value:function(h){return"data-"+p.toDashed(h)}},{key:"domReady",value:function(h){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return h();window.addEventListener?window.addEventListener("DOMContentLoaded",h,!1):window.attachEvent&&window.attachEvent("onload",h)}}]),p})(),Oi=(function(){function p(h,v,S){i(this,p),p.collection.push(this),this.width=v||0,this.height=S||0,this.element=h,this.init()}return la(p,[{key:"init",value:function(){var h=p.pixelRatio;this.element.width=this.width*h,this.element.height=this.height*h,this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.elementClone=this.element.cloneNode(!0),this.context=this.element.getContext("2d"),this.contextClone=this.elementClone.getContext("2d"),this.drawWidth=this.element.width,this.drawHeight=this.element.height,this.drawX=this.drawWidth/2,this.drawY=this.drawHeight/2,this.minSide=this.drawX<this.drawY?this.drawX:this.drawY,this.contextClone.translate(this.drawX,this.drawY),this.elementClone.initialized=!1,this.context.translate(this.drawX,this.drawY),this.context.max=this.contextClone.max=this.minSide,this.context.maxRadius=this.contextClone.maxRadius=null}},{key:"destroy",value:function(){var h=p.collection.indexOf(this);~h&&p.collection.splice(h,1),this.context.clearRect(-this.drawX,-this.drawY,this.drawWidth,this.drawHeight),this.context.max=null,delete this.context.max,this.context.maxRadius=null,delete this.context.maxRadius,this.context=null,this.contextClone=null,this.elementClone=null,this.element=null,this.onRedraw=null}},{key:"commit",value:function(){var h=p.pixelRatio;return h!==1&&this.contextClone.scale(h,h),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var h=0,v=p.collection.length;h<v;h++)p.collection[h].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),p})();Oi.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(Oi.redraw);var pl={renderTo:null,width:0,height:0,minValue:0,maxValue:100,value:0,units:!1,exactTicks:!1,majorTicks:[0,20,40,60,80,100],minorTicks:10,strokeTicks:!0,animatedValue:!1,animateOnInit:!1,title:!1,borders:!0,numbersMargin:1,listeners:null,valueInt:3,valueDec:2,majorTicksInt:1,majorTicksDec:0,animation:!0,animationDuration:500,animationRule:"cycle",colorPlate:"#fff",colorPlateEnd:"",colorMajorTicks:"#444",colorMinorTicks:"#666",colorStrokeTicks:"",colorTitle:"#888",colorUnits:"#888",colorNumbers:"#444",colorNeedle:"rgba(240,128,128,1)",colorNeedleEnd:"rgba(255,160,122,.9)",colorValueText:"#444",colorValueTextShadow:"rgba(0,0,0,0.3)",colorBorderShadow:"rgba(0,0,0,0.5)",colorBorderOuter:"#ddd",colorBorderOuterEnd:"#aaa",colorBorderMiddle:"#eee",colorBorderMiddleEnd:"#f0f0f0",colorBorderInner:"#fafafa",colorBorderInnerEnd:"#ccc",colorValueBoxRect:"#888",colorValueBoxRectEnd:"#666",colorValueBoxBackground:"#babab2",colorValueBoxShadow:"rgba(0,0,0,1)",colorNeedleShadowUp:"rgba(2,255,255,0.2)",colorNeedleShadowDown:"rgba(188,143,143,0.45)",colorBarStroke:"#222",colorBar:"#ccc",colorBarProgress:"#888",colorBarShadow:"#000",fontNumbers:"Arial",fontTitle:"Arial",fontUnits:"Arial",fontValue:"Arial",fontNumbersSize:20,fontTitleSize:24,fontUnitsSize:22,fontValueSize:26,fontNumbersStyle:"normal",fontTitleStyle:"normal",fontUnitsStyle:"normal",fontValueStyle:"normal",fontNumbersWeight:"normal",fontTitleWeight:"normal",fontUnitsWeight:"normal",fontValueWeight:"normal",needle:!0,needleShadow:!0,needleType:"arrow",needleStart:5,needleEnd:85,needleWidth:4,borderOuterWidth:3,borderMiddleWidth:3,borderInnerWidth:3,borderShadowWidth:3,valueBox:!0,valueBoxStroke:5,valueBoxWidth:0,valueText:"",valueTextShadow:!0,valueBoxBorderRadius:2.5,highlights:[{from:20,to:60,color:"#eee"},{from:60,to:80,color:"#ccc"},{from:80,to:100,color:"#999"}],highlightsWidth:15,highlightsLineCap:"butt",barWidth:20,barStrokeWidth:0,barProgress:!0,barShadow:0};s.prototype=Object.create(Array.prototype),s.prototype.constructor=s,s.prototype.get=function(p){if(typeof p=="string")for(var h=0,v=this.length;h<v;h++){var S=this[h].options.renderTo.tagName?this[h].options.renderTo:document.getElementById(this[h].options.renderTo||"");if(S.getAttribute("id")===p)return this[h]}else if(typeof p=="number")return this[p];return null};var fl="2.2.1",We=Math.round,Ri=Math.abs,Do=new s;Do.version=fl;var $i=(function(p){function h(v){i(this,h);var S=e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this)),k=S.constructor.name;if(k==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(Do.push(S),v.listeners&&Object.keys(v.listeners).forEach(function(U){(v.listeners[U]instanceof Array?v.listeners[U]:[v.listeners[U]]).forEach(function($){S.on(U,$)})}),S.version=fl,S.type=n[k]||h,S.initialized=!1,v.minValue=parseFloat(v.minValue),v.maxValue=parseFloat(v.maxValue),v.value=parseFloat(v.value)||0,v.borders||(v.borderInnerWidth=v.borderMiddleWidth=v.borderOuterWidth=0),!v.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var P=v.renderTo.tagName?v.renderTo:document.getElementById(v.renderTo);if(!(P instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return v.width=parseFloat(v.width)||0,v.height=parseFloat(v.height)||0,v.width&&v.height||(v.width||(v.width=P.parentNode?P.parentNode.offsetWidth:P.offsetWidth),v.height||(v.height=P.parentNode?P.parentNode.offsetHeight:P.offsetHeight)),S.options=v||{},S.options.animateOnInit&&(S._value=S.options.value,S.options.value=S.options.minValue),S.canvas=new Oi(P,v.width,v.height),S.canvas.onRedraw=S.draw.bind(S),S.animation=new hl(v.animationRule,v.animationDuration),S}return t(h,p),la(h,[{key:"update",value:function(v){return Object.assign(this.options,this.type.configure(v||{})),this.canvas.width=this.options.width,this.canvas.height=this.options.height,this.animation.rule=this.options.animationRule,this.animation.duration=this.options.animationDuration,this.canvas.redraw(),this}},{key:"destroy",value:function(){var v=Do.indexOf(this);~v&&Do.splice(v,1),this.canvas.destroy(),this.canvas=null,this.animation.destroy(),this.animation=null,this.emit("destroy")}},{key:"draw",value:function(){return this.options.animateOnInit&&!this.initialized&&(this.value=this._value,this.initialized=!0,this.emit("init")),this.emit("render"),this}},{key:"value",set:function(v){var S=this;v=h.ensureValue(v,this.options.minValue);var k=this.options.value;if(v!==k)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===v))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=v),this.emit("animationStart"),this.animation.animate(function(P){var U=k+(v-k)*P;S.options.animatedValue&&S.emit("value",U,S.value),S.options.value=U,S.draw(),S.emit("animate",P,S.options.value)},function(){S._value!==void 0&&(S.emit("value",S._value,S.value),S.options.value=S._value,delete S._value),S.draw(),S.emit("animationEnd"),S.animation.frame=null})}else this.emit("value",v,this.value),this.options.value=v,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(v){return v}},{key:"initialize",value:function(v,S){return new Wa(S,"canvas",v)}},{key:"fromElement",value:function(v){var S=Wa.toCamelCase(v.getAttribute("data-type")),k=v.attributes,P=0,U=k.length,$={};if(S){for(/Gauge$/.test(S)||(S+="Gauge");P<U;P++)$[Wa.toCamelCase(k[P].name.replace(/^data-/,""),!1)]=Wa.parse(k[P].value);new Wa($,v.tagName,S).process(v)}}},{key:"ensureValue",value:function(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return v=parseFloat(v),!isNaN(v)&&isFinite(v)||(v=parseFloat(S)||0),v}},{key:"mod",value:function(v,S){return(v%S+S)%S}},{key:"version",get:function(){return fl}}]),h})(Lg);n!==void 0&&(n.BaseGauge=$i,n.gauges=(window.document||{}).gauges=Do);var Vg=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,we={roundRect:b,padValue:A,formatMajorTickNumber:C,radians:w,radialPoint:M,linearGradient:G,drawNeedleShadow:E,drawValueBox:j,verifyError:d,prepareTicks:f,font:F,normalizedValue:ye,formatContext:m},Po=Math.PI,gl=Po/2,zd=Object.assign({},pl,{ticksAngle:270,startAngle:45,colorNeedleCircleOuter:"#f0f0f0",colorNeedleCircleOuterEnd:"#ccc",colorNeedleCircleInner:"#e8e8e8",colorNeedleCircleInnerEnd:"#f5f5f5",needleCircleSize:10,needleCircleInner:!0,needleCircleOuter:!0,needleStart:20,animationTarget:"needle",useMinPath:!1,barWidth:0,barStartPosition:"left"}),Wg=(function(p){function h(v){return i(this,h),v=Object.assign({},zd,v||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(v)))}return t(h,p),la(h,[{key:"draw",value:function(){try{var v=this.canvas,S=[-v.drawX,-v.drawY,v.drawWidth,v.drawHeight],k=S[0],P=S[1],U=S[2],$=S[3],H=this.options;if(H.animationTarget==="needle"){if(!v.elementClone.initialized){var Y=v.contextClone;Y.clearRect(k,P,U,$),this.emit("beforePlate"),re(Y,H),this.emit("beforeHighlights"),de(Y,H),this.emit("beforeMinorTicks"),ee(Y,H),this.emit("beforeMajorTicks"),le(Y,H),this.emit("beforeNumbers"),ot(Y,H),this.emit("beforeTitle"),Mt(Y,H),this.emit("beforeUnits"),Yt(Y,H),v.elementClone.initialized=!0}this.canvas.commit(),v.context.clearRect(k,P,U,$),v.context.drawImage(v.elementClone,k,P,U,$),this.emit("beforeProgressBar"),sa(v.context,H),this.emit("beforeValueBox"),ra(v.context,H,La(this)),this.emit("beforeNeedle"),mi(v.context,H)}else{var ce=-we.radians((H.value-H.minValue)/(H.maxValue-H.minValue)*H.ticksAngle);if(v.context.clearRect(k,P,U,$),this.emit("beforePlate"),re(v.context,H),v.context.rotate(ce),this.emit("beforeHighlights"),de(v.context,H),this.emit("beforeMinorTicks"),ee(v.context,H),this.emit("beforeMajorTicks"),le(v.context,H),this.emit("beforeNumbers"),ot(v.context,H),this.emit("beforeProgressBar"),sa(v.context,H),v.context.rotate(-ce),!v.elementClone.initialized){var me=v.contextClone;me.clearRect(k,P,U,$),this.emit("beforeTitle"),Mt(me,H),this.emit("beforeUnits"),Yt(me,H),this.emit("beforeNeedle"),mi(me,H),v.elementClone.initialized=!0}v.context.drawImage(v.elementClone,k,P,U,$)}this.emit("beforeValueBox"),ra(v.context,H,La(this)),ml(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(Ee){we.verifyError(Ee)}return this}},{key:"value",set:function(v){v=$i.ensureValue(v,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=v,v=this.options.value+((v-this.options.value)%360+540)%360-180),Rg(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",v,this)},get:function(){return ml(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this)}}],[{key:"configure",value:function(v){return v.barWidth>50&&(v.barWidth=50),isNaN(v.startAngle)&&(v.startAngle=45),isNaN(v.ticksAngle)&&(v.ticksAngle=270),v.ticksAngle>360&&(v.ticksAngle=360),v.ticksAngle<0&&(v.ticksAngle=0),v.startAngle<0&&(v.startAngle=0),v.startAngle>360&&(v.startAngle=360),v}}]),h})($i);n!==void 0&&(n.RadialGauge=Wg),$i.initialize("RadialGauge",zd);var Hd=Object.assign({},pl,{borderRadius:0,barBeginCircle:30,colorBarEnd:"",colorBarProgressEnd:"",needleWidth:6,tickSide:"both",needleSide:"both",numberSide:"both",ticksWidth:10,ticksWidthMinor:5,ticksPadding:5,barLength:85,fontTitleSize:26,highlightsWidth:10}),Fg=(function(p){function h(v){return i(this,h),v=Object.assign({},Hd,v||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(v)))}return t(h,p),la(h,[{key:"draw",value:function(){try{var v=this.canvas,S=[-v.drawX,-v.drawY,v.drawWidth,v.drawHeight],k=S[0],P=S[1],U=S[2],$=S[3],H=this.options;if(!v.elementClone.initialized){var Y=v.contextClone;Y.clearRect(k,P,U,$),this.emit("beforePlate"),this.drawBox=_o(Y,H,k,P,U,$),this.emit("beforeBar"),ko.apply(void 0,[Y,H].concat(o(this.drawBox))),v.contextClone.barDimensions=Y.barDimensions,this.emit("beforeHighlights"),_g(Y,H),this.emit("beforeMinorTicks"),kg(Y,H),this.emit("beforeMajorTicks"),Mg(Y,H),this.emit("beforeNumbers"),Tg(Y,H),this.emit("beforeTitle"),Eg(Y,H),this.emit("beforeUnits"),Dg(Y,H),v.elementClone.initialized=!0}this.canvas.commit(),v.context.clearRect(k,P,U,$),v.context.drawImage(v.elementClone,k,P,U,$),this.emit("beforeProgressBar"),gr.apply(void 0,[v.context,H].concat(o(this.drawBox))),this.emit("beforeNeedle"),Pg(v.context,H),this.emit("beforeValueBox"),Og.apply(void 0,[v.context,H,H.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),ml(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(ce){we.verifyError(ce)}return this}}],[{key:"configure",value:function(v){return v.barStrokeWidth>=v.barWidth&&(v.barStrokeWidth=We(v.barWidth/2)),v.hasLeft=To("right",v),v.hasRight=To("left",v),v.value>v.maxValue&&(v.value=v.maxValue),v.value<v.minValue&&(v.value=v.minValue),$i.configure(v)}}]),h})($i);n!==void 0&&(n.LinearGauge=Fg),$i.initialize("LinearGauge",Hd),typeof Js<"u"&&Object.assign(n,{Collection:s,GenericOptions:pl,Animation:hl,BaseGauge:$i,drawings:we,SmartCanvas:Oi,DomObserver:Wa,vendorize:a})})(typeof Js<"u"?Js.exports:window)});var Ou=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var ft=(()=>{class n{_settings=y(Lt);_router=y(Xc);_destroyRef=y(Ze);dashboards=_([],{equal:wi});activeDashboard=_(null);_widgetAction=new ji(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=_(!0);widgetClipboard=_(null);layoutEditSaved=_(0);layoutEditCanceled=_(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let i=Ou.map(a=>pe(oe({},a),{id:Si.create()}));this.dashboards.set([...i])}else this.dashboards.set(e);this.applyDashboardParam(this.getRouteParam("id"),!1);let t=this._router.events.pipe(vi(i=>i instanceof Qc),wr({bufferSize:1,refCount:!0}),$e(this._destroyRef));t.pipe(Jt(1),Zt(()=>this.getRouteParam("id"))).subscribe(i=>this.applyDashboardParam(i,!0)),t.pipe(_r(1),Zt(()=>this.getRouteParam("id")),Cr()).subscribe(i=>this.applyDashboardParam(i,!1)),W(()=>{let i=this.dashboards();B(()=>{this._settings.saveDashboards(i)})})}getRouteParam(e){let t=this._router.routerState.snapshot.root;for(;t;){if(t.paramMap.has(e))return t.paramMap.get(e);t=t.firstChild??null}return null}applyDashboardParam(e,t){if(e===null||e===""){t&&this.setActiveDashboardIndex(0);return}let i=Number(e);if(Number.isNaN(i)){t&&this.setActiveDashboardIndex(0);return}this.setActiveDashboardIndex(i)}setActiveDashboardIndex(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,i,a){let r=0;return this.dashboards.update(s=>{let d=[...s,{id:Si.create(),name:e,icon:i??"dashboard-dashboard",configuration:t,collapseSplitShell:a??!1}];return r=d.length-1,d}),r}update(e,t,i,a){this.dashboards.update(r=>r.map((s,d)=>d===e?pe(oe({},s),{name:t,icon:i??"dashboard-dashboard",collapseSplitShell:a??!1}):s))}delete(e){this.dashboards.update(t=>t.filter((i,a)=>a!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,i,a){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let r=this.dashboards()[e],s=Ft(r);s.id=Si.create(),s.name=t,s.icon=i||"dashboard-dashboard",s.collapseSplitShell=a??!1,Array.isArray(s.configuration)?s.configuration.forEach(m=>{m&&m.input?.widgetProperties?(m.id=Si.create(),m.input.widgetProperties.uuid=m.id):console.error("Dashboard Service] Widget configuration is missing required properties:",m)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",s.configuration),s.configuration=[]);let d=-1;return this.dashboards.update(m=>{let f=[...m,s];return d=f.length-1,f}),d}updateConfiguration(e,t){let i=Ft(t??[]);this.dashboards.update(a=>a.map((r,s)=>s===e?wi(r.configuration,i)?r:pe(oe({},r),{configuration:i}):r))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}copyWidget(e){this._widgetAction.next({id:e,operation:"copy"})}cutWidget(e){this._widgetAction.next({id:e,operation:"cut"})}setWidgetClipboardFromNode(e){let t=e?.input?.widgetProperties,i=t?.type;i&&this.widgetClipboard.set({w:e.w,h:e.h,selector:e.selector,input:{widgetProperties:{type:i,uuid:"clipboard",config:Ft(t.config)}}})}clearWidgetClipboard(){this.widgetClipboard.set(null)}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ss=(()=>{class n{http=y(Ha);connection=y($r);destroyRef=y(Ze);historyServiceUrl=null;constructor(){this.connection.serverServiceEndpoint$.pipe($e(this.destroyRef)).subscribe(e=>{let t=e?.httpServiceUrl||null;this.historyServiceUrl=t?t.replace("/v1/","/v2/"):null,this.historyServiceUrl||console.warn("[HistoryApiClientService] History API endpoint not available; history service is disabled")})}getPaths(e){return Le(this,null,function*(){try{if(!this.historyServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.historyServiceUrl}history/paths`,i=new Ur;e?.from&&(i=i.set("from",e.from)),e?.to&&(i=i.set("to",e.to)),e?.duration&&(i=i.set("duration",e.duration.toString()));let a=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${a}`);let r=yield kn(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] Retrieved ${r?.length??0} available paths`),r}catch(t){return console.error("[HistoryApiClientService] History API /paths request failed:",t),null}})}getContexts(e){return Le(this,null,function*(){try{if(!this.historyServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.historyServiceUrl}history/contexts`,i=new Ur;e?.from&&(i=i.set("from",e.from)),e?.to&&(i=i.set("to",e.to)),e?.duration&&(i=i.set("duration",e.duration.toString()));let a=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${a}`);let r=yield kn(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] Retrieved ${r?.length??0} available contexts`),r}catch(t){return console.error("[HistoryApiClientService] History API /contexts request failed:",t),null}})}getValues(e){return Le(this,null,function*(){try{if(!this.historyServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.historyServiceUrl}history/values`,i=new Ur;i=i.set("paths",e.paths),e.context&&(i=i.set("context",e.context)),e.from&&(i=i.set("from",e.from)),e.to&&(i=i.set("to",e.to)),e.duration&&(i=i.set("duration",e.duration.toString())),e.resolution!==void 0&&e.resolution!==null&&(i=i.set("resolution",e.resolution.toString()));let a=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${a}`);let r=yield kn(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] History fetch successful, received ${r.data?.length??0} data points`),r}catch(t){return console.error("[HistoryApiClientService] History API request failed:",t),null}})}getProviders(){return Le(this,null,function*(){let e=`${this.historyServiceUrl}history/_providers`;return yield kn(this.http.get(e)),["kip"]})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ls=(()=>{class n{mapValuesToChartDatapoints(e,t){let i=e?.data;if(!i||i.length===0)return[];let a=-1,r=-1;if(e.values&&Array.isArray(e.values)){for(let E=0;E<e.values.length;E++){let F=e.values[E]?.method,I=typeof F=="string"?F.toLowerCase():F;if(!I)continue;let Z=E+1;I==="sma"?a=Z:(I==="avg"||I==="average")&&(r=Z)}r<0&&e.values.length===1&&(r=1)}else i[0]?.length>1&&(r=1);let s=t.unit==="rad",d=s?t.domain==="signed"?this.normalizeToSigned.bind(this):this.normalizeToDirection.bind(this):null,m=[],f=0,b=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,C=0,w=0,M=0,G=[];for(let E of i){if(!Array.isArray(E)||E.length===0)continue;let F=Date.parse(E[0]),I=a>=0?E[a]:null,Z=r>=0?E[r]:null;if(s?(I=Number.isFinite(I)?d(I):null,Z=Number.isFinite(Z)?d(Z):null):(I=Number.isFinite(I)?I:null,Z=Number.isFinite(Z)?Z:null),Number.isFinite(Z)){let j=Z;s?(G.push(j),w+=Math.sin(j),M+=Math.cos(j)):(C++,f+=j,j<b&&(b=j),j>A&&(A=j))}m.push({timestamp:F,data:{value:Z,sma:I,ema:null,doubleEma:null,lastAverage:null,lastMinimum:null,lastMaximum:null}})}if(m.length>0){let E=null,F=null,I=null;if(s&&G.length>0){E=Math.atan2(w/G.length,M/G.length);let{min:Z,max:j}=this.circularMinMaxRad(G);t.domain==="signed"?(E=this.normalizeToSigned(E),F=this.normalizeToSigned(Z),I=this.normalizeToSigned(j)):(E=this.normalizeToDirection(E),F=this.normalizeToDirection(Z),I=this.normalizeToDirection(j))}else!s&&C>0&&(E=f/C,F=b,I=A);if(E!==null&&F!==null&&I!==null){let Z=m[m.length-1];Z.data.lastAverage=E,Z.data.lastMinimum=F,Z.data.lastMaximum=I}}return m}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(r=>(r*180/Math.PI+360)%360).sort((r,s)=>r-s),i=0,a=0;for(let r=0;r<t.length;r++){let s=(r+1)%t.length,d=(t[s]-t[r]+360)%360;d>i&&(i=d,a=s)}return{min:t[a]*Math.PI/180,max:t[(a-1+t.length)%t.length]*Math.PI/180}}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var dn=(()=>{class n{appSettings=y(Lt);data=y(Wt);history=y(ss);historyChartAdapter=y(ls);historyMinSampleTimeMs=1e3;_svcDatasetConfigs=[];_svcDataSource=[];_svcSubjectObserverRegistry=[];_startAllPromise;signedAnglePaths=new Set(["self.navigation.attitude.roll","self.navigation.attitude.pitch","self.navigation.attitude.yaw","self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.steering.rudderAngle"]);constructor(){this._svcDatasetConfigs=this.appSettings.getDataSets(),this.cleanupDatasets(),this._startAllPromise=this.startAll()}cleanupDatasets(){if(this.appSettings.configUpgrade()||this.appSettings.getAppConfig().configVersion<12)return;let t=this.appSettings.getDashboardConfig(),i=new Set;t.forEach(d=>{d.configuration?.length&&d.configuration?.forEach(m=>{m?.id&&i.add(m.id)})});function a(d){let m=d.match(/^(windtrends|speedtrends)-(.+)$/);return m?m[2]:null}let r=[],s=[];for(let d of this._svcDatasetConfigs){let m=d.label||"",f=!1;if(m.startsWith("windtrends-")||m.startsWith("speedtrends-")){let b=a(m);f=!!(b&&i.has(b))}else(m.startsWith("simple-chart-")||(m.match(/\|/g)||[]).length===4)&&(f=i.has(d.uuid));f?s.push(d):r.push(d)}r.length&&(r.forEach(d=>{console.warn(`[DatasetStreamService] Cleaned dataset: uuid=${d.uuid}, label="${d.label}"`)}),this._svcDatasetConfigs=s,this.appSettings.saveDataSets(this._svcDatasetConfigs))}setupServiceSubjectRegistry(e,t){let i=this._svcSubjectObserverRegistry.findIndex(a=>a.datasetUuid==e);i>=0&&(this._svcSubjectObserverRegistry[i].rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(i,1)),this._svcSubjectObserverRegistry.push({datasetUuid:e,rxjsSubject:new Yd(t)})}createDataSourceConfiguration(e){let r={uuid:e.uuid,pathObserverSubscription:null,sampleTime:null,maxDataPoints:null,smoothingPeriod:null,historicalData:[]},s=m(e.timeScaleFormat,e.period),d=s>0?Math.max(100,Math.round(s/120)):1e3;return r.sampleTime=d,r.maxDataPoints=Math.max(1,Math.ceil(s/d)),r.smoothingPeriod=Math.max(1,Math.floor(r.maxDataPoints*.25)),(!r.maxDataPoints||r.maxDataPoints<1)&&(r.maxDataPoints=1),(!r.sampleTime||r.sampleTime<1)&&(r.sampleTime=1),r;function m(f,b){switch(f){case"Last Minute":return 6e4;case"Last 5 Minutes":return 5*6e4;case"Last 30 Minutes":return 30*6e4;case"day":return Math.max(0,b)*24*60*6e4;case"hour":return Math.max(0,b)*60*6e4;case"minute":return Math.max(0,b)*6e4;case"second":return Math.max(0,b)*1e3;default:return 0}}}waitUntilReady(){return Le(this,null,function*(){return this._startAllPromise})}startAll(){return Le(this,null,function*(){console.log("[DatasetStreamService] Auto Starting "+this._svcDatasetConfigs.length.toString()+" Datasets");for(let e of this._svcDatasetConfigs)yield this.start(e.uuid)})}start(e){return Le(this,null,function*(){let t=this._svcDatasetConfigs.find(b=>b.uuid==e);if(!t){console.warn(`[DatasetStreamService] Dataset UUID:${e} not found`);return}let i=this.createDataSourceConfiguration(t);this.setupServiceSubjectRegistry(i.uuid,i.maxDataPoints);let a=this._svcDataSource[this._svcDataSource.push(i)-1];console.log(`[DatasetStreamService] Starting recording process: ${t.path}, Scale: ${t.timeScaleFormat}, Period: ${t.period}, Datapoints: ${i.maxDataPoints}`);let r=this.resolveAngleDomain(t.path,t.baseUnit),s=Math.max(1,Math.round(i.sampleTime/1e3));this.shouldSeedHistory(i.sampleTime)&&(yield this.seedHistoryData(a,t,s,r));let d=this.data.subscribePath(t.path,t.pathSource).pipe(vi(b=>b?.data?.value!==null),wr({bufferSize:1,refCount:!0})),m=d.pipe(Jt(1)),f=ca(i.sampleTime,i.sampleTime).pipe(sc(d,(b,A)=>A));a.pathObserverSubscription=gi(m,f).subscribe(b=>{a.maxDataPoints>0&&a.historicalData.length>=a.maxDataPoints&&a.historicalData.shift(),a.historicalData.push(b.data.value);let A=this.updateDataset(a,t.baseUnit,r);this._svcSubjectObserverRegistry.find(C=>C.datasetUuid===a.uuid).rxjsSubject.next(A)})})}seedHistoryData(e,t,i,a){return Le(this,null,function*(){try{let r=this.buildHistoryPathString(t.path,e.smoothingPeriod),s=(()=>{switch(t.timeScaleFormat){case"Last Minute":return 6e4;case"Last 5 Minutes":return 5*6e4;case"Last 30 Minutes":return 30*6e4;case"day":return Math.max(0,t.period)*24*60*6e4;case"hour":return Math.max(0,t.period)*60*6e4;case"minute":return Math.max(0,t.period)*6e4;case"second":return Math.max(0,t.period)*1e3;default:return 0}})(),d=new Date,m={paths:r,from:new Date(d.getTime()-s).toISOString(),resolution:i},f=yield this.history.getValues(m);if(!f||!f.data||f.data.length===0){console.log(`[DatasetStreamService] No history data available for ${t.path}`);return}let b=this.convertHistoryToDatapoints(f,t.baseUnit,a),A=this._svcSubjectObserverRegistry.find(C=>C.datasetUuid===e.uuid)?.rxjsSubject;if(A&&b.length>0){let C=[];e.historicalData=[],b.forEach(w=>{let M=w.data.value;if(!Number.isFinite(M))return;e.maxDataPoints>0&&e.historicalData.length>=e.maxDataPoints&&e.historicalData.shift(),e.historicalData.push(M);let G=this.updateDataset(e,t.baseUnit,a);G.timestamp=w.timestamp,C.push(G)}),C.forEach(w=>A.next(w)),console.log(`[DatasetStreamService] Seeded ${C.length} history datapoints for ${t.path}`)}}catch(r){console.warn(`[DatasetStreamService] Failed to seed history data for ${t.path}:`,r)}})}stop(e){let t=this._svcDataSource.findIndex(i=>i.uuid==e);console.log(`[DatasetStreamService] Stopping Dataset ${e} data capture`),this._svcDataSource[t].pathObserverSubscription.unsubscribe(),this._svcDataSource.splice(t,1)}list(){return Ft(this._svcDatasetConfigs)}getDatasetConfig(e){return this._svcDatasetConfigs.find(t=>t.uuid===e)}getDataSourceInfo(e){return this._svcDataSource.find(t=>t.uuid===e)}create(e,t,i,a,r,s=!0,d=!0,m){if(!e||!t||!i||!a||!r)return null;let f=m||Si.create(),b={uuid:f,path:e,pathSource:t,baseUnit:this.data.getPathUnitType(e),timeScaleFormat:i,period:a,label:r,editable:d};return console.log(`[DatasetStreamService] Creating ${s?"":"non-"}persistent ${d?"":"hidden "}dataset: ${b.uuid}, Path: ${b.path}, Source: ${b.pathSource} Scale: ${b.timeScaleFormat}, Period: ${b.period}`),this._svcDatasetConfigs.push(b),this.start(f),s===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),f}edit(e,t=!0){let i=this._svcDatasetConfigs.find(a=>a.uuid===e.uuid);return i?JSON.stringify(i)===JSON.stringify(e)?(console.log(`[DatasetStreamService] No changes detected for Dataset ${e.uuid}.`),!1):(this.stop(e.uuid),console.log(`[DatasetStreamService] Updating Dataset: ${e.uuid}`),e.baseUnit=this.data.getPathUnitType(e.path),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(a=>a.uuid===e.uuid),1,e),this.start(e.uuid),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0):!1}remove(e,t=!0){return!e||e===""||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:(this.stop(e),console.log(`[DatasetStreamService] Removing ${t?"":"non-"}persistent Dataset: ${e}`),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(i=>i.uuid===e),1),this._svcSubjectObserverRegistry.find(i=>i.datasetUuid===e).rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(this._svcSubjectObserverRegistry.findIndex(i=>i.datasetUuid===e),1),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0)}getDatasetObservable(e){let t=this._svcSubjectObserverRegistry.find(i=>i.datasetUuid==e);return t?t.rxjsSubject.asObservable():null}getDatasetBatchThenLiveObservable(e){let t=this._svcSubjectObserverRegistry.find(d=>d.datasetUuid==e);if(!t)return null;let i=t.rxjsSubject,a=i._buffer?i._buffer.slice():[],r=Qd([a]),s=i.pipe(_r(a.length));return Jd(r,s)}updateDataset(e,t,i="scalar"){let a=null,r=null,s=null,d=null;if(t==="rad"){a=this.circularMeanRad(e.historicalData);let A=e.historicalData.slice(-e.smoothingPeriod);r=this.circularMeanRad(A);let{min:C,max:w}=this.circularMinMaxRad(e.historicalData);i==="direction"?(a=this.normalizeToDirection(a),r=this.normalizeToDirection(r),s=this.normalizeToDirection(C),d=this.normalizeToDirection(w)):i==="signed"?(a=this.normalizeToSigned(a),r=this.normalizeToSigned(r),s=this.normalizeToSigned(C),d=this.normalizeToSigned(w)):(s=C,d=w)}else a=f(e.historicalData),r=b(e.historicalData,e.smoothingPeriod),s=Math.min(...e.historicalData),d=Math.max(...e.historicalData);return{timestamp:Date.now(),data:{value:t==="rad"?i==="signed"?this.normalizeToSigned(e.historicalData[e.historicalData.length-1]):this.normalizeToDirection(e.historicalData[e.historicalData.length-1]):e.historicalData[e.historicalData.length-1],sma:r,ema:null,doubleEma:null,lastAverage:a,lastMinimum:s,lastMaximum:d}};function f(A){return A.length===0?null:A.reduce((w,M)=>w+M,0)/A.length}function b(A,C){A.length<C&&(C=A.length);let w=0;for(let M=A.length-C;M<A.length;M++)w+=A[M];return w/C}}circularMeanRad(e){if(e.length===0)return 0;let t=e.reduce((a,r)=>a+Math.sin(r),0),i=e.reduce((a,r)=>a+Math.cos(r),0);return Math.atan2(t/e.length,i/e.length)}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(d=>(d*180/Math.PI+360)%360).sort((d,m)=>d-m),i=0,a=0;for(let d=0;d<t.length;d++){let m=(d+1)%t.length,f=(t[m]-t[d]+360)%360;f>i&&(i=f,a=m)}let r=t[a]*Math.PI/180,s=t[(a-1+t.length)%t.length]*Math.PI/180;return{min:r,max:s}}resolveAngleDomain(e,t){if(t!=="rad")return"scalar";let i=this.normalizePathKey(e);for(let a of this.signedAnglePaths)if(i===this.normalizePathKey(a))return"signed";return"direction"}normalizePathKey(e){return e.replace(/^vessels\.self\./,"").replace(/^self\./,"")}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}removeIfExists(e,t=!0){return!e||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:this.remove(e,t)}shouldSeedHistory(e){return e>=this.historyMinSampleTimeMs}buildHistoryPathString(e,t){let i=e.replace(/^(vessels\.)?self\./,"");return[`${i}:sma:${t}`,`${i}:avg`,`${i}:min`,`${i}:max`].join(",")}convertHistoryToDatapoints(e,t,i){return this.historyChartAdapter.mapValuesToChartDatapoints(e,{unit:t,domain:i})}ngOnDestroy(){[...this._svcDataSource].forEach(e=>{try{this.stop(e.uuid)}catch(t){}}),this._svcSubjectObserverRegistry.forEach(e=>e.rxjsSubject.complete()),this._svcSubjectObserverRegistry=[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ru=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new ji(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID===null&&(this.kipTimers[e].timeoutID=setInterval(()=>{this.kipTimers[e].currentValue.next(this.kipTimers[e].currentValue.value+1)},this.kipTimers[e].intervalMS))}stopTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&(this.stopTimer(e),this.kipTimers[e].currentValue.complete(),delete this.kipTimers[e])}isRunning(e){let t=!1;return e in this.kipTimers&&(t=this.kipTimers[e].timeoutID!==null),t}ngOnDestroy(){Object.keys(this.kipTimers).forEach(e=>{this.kipTimers[e].timeoutID&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null),this.kipTimers[e].currentValue.complete()}),this.kipTimers={}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Lu=(()=>{class n{sanitizer=y(qa);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Or({name:"safe",type:n,pure:!0})}return n})();var Bg={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function ao(n){let o=oe(oe({},Bg),n);return`(() => {
1
+ import{$ as os,A as ns,B as Qa,C as Bi,D as Sl,E as as,F as Fo,G as wl,H as Go,I as Bo,J as Xa,K as Ka,L as _l,M as Ml,N as Ja,O as Uo,P as kl,Q as Su,R as wu,S as _u,T as zn,U as Hn,V as eo,W as vt,X as qn,Y as $n,Z as to,_ as Mu,a as qt,aa as rs,b as oi,ba as ku,c as Di,ca as Tu,d as gu,da as jn,e as vu,ea as ln,f as bu,g as es,h as Au,i as yu,j as xu,k as Cu,l as mt,m as fa,n as Fi,o as Bn,p as ga,q as bn,r as rn,s as sn,t as Gi,u as Un,v as hi,w as ts,x as is,y as Za,z as va}from"./chunk-P7YPDCAJ.js";import{a as fu,b as Jr,c as ri}from"./chunk-YY4ZUJFI.js";import{a as Eu,b as Du,c as Pu,d as Iu,e as Nu}from"./chunk-CSIELI2Z.js";import{a as ai,b as on,c as at,e as io,f as no}from"./chunk-4YDVZHMH.js";import{a as lu,b as du,c as cu,d as Ya,e as uu,f as Vt,g as mu,h as hu,k as pu,m as Wo,o as Ae,p as Cl,r as Wt}from"./chunk-M37BLWHF.js";import{b as Qc,e as Xc,f as jr}from"./chunk-WJFXI5PQ.js";import{a as Fn,b as Gn}from"./chunk-HSKVTFFQ.js";import{a as Jc,b as eu,c as tu,d as tn,e as ti,g as iu,h as Mi,i as ki,j as Ti,k as Nn,l as Ht,n as Ct,o as Vn,p as ru,q as Wn,s as su,u as St,v as ii,w as wt,x as ni}from"./chunk-MXUEYEZU.js";import{A as On,B as $a,C as nn,D as ou,E as xl,F as an,G as Xr,H as Kr,I as Ei,J as pt,K as ja,L as Rn,M as Pt,O as Ln,P as It,Q as xt,a as Si,b as yc,d as Ft,e as wi,f as $c,i as $r,j as jc,k as Yc,l as Zc,m as Lt,n as en,o as Yr,p as yt,r as Et,t as dt,u as Dt,v as nu,w as Zr,x as Qr,y as au,z as ct}from"./chunk-2GOHQZH5.js";import{$ as wr,$a as ma,$b as be,$c as Dn,Aa as Ze,Ab as xe,Ac as J,Bb as Ce,Bc as pc,Bd as Ha,Be as Fc,Ca as ei,Cb as O,Cc as fc,Ce as Gc,D as Jd,Da as Be,Db as l,Dc as ut,De as Bc,E as ec,Eb as u,Ec as x,Fa as _,Fb as V,Fc as he,Ga as W,Gb as D,Gd as qa,Ge as Uc,H as ca,Ha as Zi,Hb as N,Hc as Fr,He as zc,I as xr,Ib as Q,J as gi,Jb as Xi,Jc as Ci,Jd as kc,Je as Hc,K as vi,Ka as Ke,Kb as Ki,Lb as Rr,Lc as bt,Mb as Te,Md as Tc,Nb as Li,Nd as pa,Ne as qc,O as tc,Ob as z,Od as Pn,Oe as $e,P as Tn,Pa as Dr,Pb as Ro,Pd as Ec,Pe as _i,Q as Jt,Qa as Pr,Qb as T,Qe as Kc,Ra as ua,Rb as Lr,Rd as yl,Re as Qe,S as ic,Sb as Vr,Sd as zr,Se as et,T as nc,Tb as Wr,Td as Dc,U as Cr,Ub as En,V as Sr,Va as g,Vb as yi,Vc as gc,Vd as Wi,Wb as xi,Wc as vc,Xa as cc,Xc as bc,Xd as Ji,Ya as uc,Yb as _e,Z as ac,Zb as Me,_ as oc,_a as Ir,_b as Nt,_c as Gr,a as oe,aa as _r,ac as st,ae as Pc,b as pe,ba as Ga,bc as Ba,bd as Ua,be as Ic,ca as Mr,cb as Nr,cc as it,ce as Tt,d as Gg,da as kr,dc as c,dd as Ac,de as Hr,e as jd,ea as Tr,ec as X,ee as In,f as Le,fa as rc,fb as q,fc as fe,fe as Nc,g as Fa,ga as sc,gb as Qi,gc as zt,ge as At,hb as Rt,ib as Or,ie as qr,j as vl,ja as Er,jb as mc,jc as mn,jd as xc,je as nt,k as Ut,ka as rt,kb as Oo,kc as hn,kd as Cc,la as Yi,lb as bi,lc as pn,ld as Sc,le as Oc,m as ji,mb as hc,mc as ha,n as Yd,na as un,nc as fn,oc as gn,pa as y,pc as Vi,pd as wc,pe as Rc,q as Zd,qc as Al,qe as Lc,r as Qd,rc as Lo,rd as Br,s as bl,sa as lc,sc as Vo,sd as _c,t as Xd,td as Mc,ua as ne,ub as K,uc as lt,va as ae,vc as kt,vd as za,w as yr,wa as te,wb as R,wc as vn,x as kn,xa as Ge,xb as L,xe as Vc,y as Kd,ya as No,yb as Ne,yd as Ur,z as Zt,za as dc,zb as Ai,zc as B,ze as Wc}from"./chunk-PZ6I6W3H.js";var gd=Gg((BL,Js)=>{(function(n){"use strict";function o(p){if(Array.isArray(p)){for(var h=0,v=Array(p.length);h<p.length;h++)v[h]=p[h];return v}return Array.from(p)}function e(p,h){if(!p)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!h||typeof h!="object"&&typeof h!="function"?p:h}function t(p,h){if(typeof h!="function"&&h!==null)throw new TypeError("Super expression must either be null or a function, not "+typeof h);p.prototype=Object.create(h&&h.prototype,{constructor:{value:p,enumerable:!1,writable:!0,configurable:!0}}),h&&(Object.setPrototypeOf?Object.setPrototypeOf(p,h):p.__proto__=h)}function i(p,h){if(!(p instanceof h))throw new TypeError("Cannot call a class as a function")}function a(p,h){if(h||(h=typeof window>"u"?global:window),h[p]!==void 0)return h[p];if(Ar===null){var v=window.getComputedStyle(document.documentElement,"");Ar=(Array.prototype.slice.call(v).join("").match(/-(moz|webkit|ms)-/)||v.OLink===""&&["","o"]||["",""])[1]}if(Ar==="")return null;var S=p.charAt(0).toUpperCase()+p.substr(1),k=h[Ar+S];return k!==void 0?k:null}function r(p,h,v,S,k,P,U){if(typeof S!="function")throw new TypeError("Invalid animation rule:",S);var $=p-v,H=$/k,Y=0;H>1&&(H=1),H!==1&&(Y=S(H),isFinite(Y)&&!isNaN(Y)&&(H=Y)),h&&h(H),$<k?U.frame=Ud(function(ce){return r(ce,h,v,S,k,P,U)}):(P&&P(),U.inProgress=!1)}function s(){Array.prototype.constructor.apply(this,arguments)}function d(p){if(!(p instanceof DOMException&&p.result===2152923147))throw p}function m(p,h){return h.replace(Vg,function(v,S){var k=p[S];return k!==void 0?k:v})}function f(p){return p.majorTicks instanceof Array||(p.majorTicks=p.majorTicks?[p.majorTicks]:[]),p.majorTicks.length||(p.majorTicks.push(we.formatMajorTickNumber(p.minValue,p)),p.majorTicks.push(we.formatMajorTickNumber(p.maxValue,p))),[p.tickSide!=="right",p.tickSide!=="left"]}function b(p,h,v,S,k,P){p.beginPath(),p.moveTo(h+P,v),p.lineTo(h+S-P,v),p.quadraticCurveTo(h+S,v,h+S,v+P),p.lineTo(h+S,v+k-P),p.quadraticCurveTo(h+S,v+k,h+S-P,v+k),p.lineTo(h+P,v+k),p.quadraticCurveTo(h,v+k,h,v+k-P),p.lineTo(h,v+P),p.quadraticCurveTo(h,v,h+P,v),p.closePath()}function A(p,h){var v=h.valueDec,S=h.valueInt,k=0,P=void 0,U=void 0,$=void 0;if(p=parseFloat(p),$=p<0,p=Math.abs(p),v>0){for(U=p.toFixed(v).toString().split("."),P=S-U[0].length;k<P;++k)U[0]="0"+U[0];U=($?"-":"")+U[0]+"."+U[1]}else{for(U=Math.round(p).toString(),P=S-U.length;k<P;++k)U="0"+U;U=($?"-":"")+U}return U}function C(p,h){var v=void 0,S=!1;return v=h.majorTicksDec===0?Math.round(p).toString():p.toFixed(h.majorTicksDec),h.majorTicksInt>1?(S=~v.indexOf("."),~v.indexOf("-")?"-"+[h.majorTicksInt+h.majorTicksDec+2+(S?1:0)-v.length].join("0")+v.replace("-",""):[h.majorTicksInt+h.majorTicksDec+1+(S?1:0)-v.length].join("0")+v):v}function w(p){return p*Math.PI/180}function M(p,h){return{x:-p*Math.sin(h),y:p*Math.cos(h)}}function G(p,h,v,S){var k=!(arguments.length>4&&arguments[4]!==void 0)||arguments[4],P=arguments.length>5&&arguments[5]!==void 0?arguments[5]:0,U=p.createLinearGradient(k?0:P,k?P:0,k?0:S,k?S:0);return U.addColorStop(0,h),U.addColorStop(1,v),U}function E(p,h){h.needleShadow&&(p.shadowOffsetX=2,p.shadowOffsetY=2,p.shadowBlur=10,p.shadowColor=h.colorNeedleShadowDown)}function F(p,h,v){return p["font"+h+"Style"]+" "+p["font"+h+"Weight"]+" "+p["font"+h+"Size"]*v+"px "+p["font"+h]}function I(p){p.shadowOffsetX=null,p.shadowOffsetY=null,p.shadowBlur=null,p.shadowColor="",p.strokeStyle=null,p.lineWidth=0,p.save()}function Z(p,h,v,S){h.valueTextShadow&&(p.shadowOffsetX=v,p.shadowOffsetY=v,p.shadowBlur=S,p.shadowColor=h.colorValueTextShadow)}function j(p,h,v,S,k,P){if(h.valueBox){I(p);var U=h.valueDec?1+h.valueDec:0,$="9".repeat(Math.max.apply(null,[String(parseInt(v)).length+U].concat(h.majorTicks.map(function(qe){return String(parseInt(qe,10)).length+U})))),H=h.valueText||A(v,h),Y=P/200,ce=P/100,me=.4*ce,Ee=1.2*ce;p.font=F(h,"Value",Y),Z(p,h,me,Ee);var De=p.measureText(h.valueText?H:"-"+A(Number($),h)).width;I(p);var Oe=parseFloat(h.fontValueSize)*Y+me+Ee,Xe=ce*parseFloat(h.valueBoxStroke),Ie=2*P-2*Xe,je=De+10*ce,Ye=1.1*Oe+me+Ee,Je=ce*h.valueBoxBorderRadius,ze=(parseFloat(h.valueBoxWidth)||0)/100*Ie;ze>je&&(je=ze),je>Ie&&(je=Ie);var He=S-je/2,Fe=k-Ye/2,Pe=k-5.75*ce;if(p.beginPath(),Je?b(p,He,Fe,je,Ye,Je):p.rect(He,Fe,je,Ye),Xe){var Re=p.createRadialGradient(S,Pe,10*ce,S,Pe,20*ce);Re.addColorStop(0,h.colorValueBoxRect),Re.addColorStop(1,h.colorValueBoxRectEnd),p.strokeStyle=Re,p.lineWidth=Xe,p.stroke()}h.colorValueBoxShadow&&(p.shadowBlur=1.2*ce,p.shadowColor=h.colorValueBoxShadow),h.colorValueBoxBackground&&(p.fillStyle=h.colorValueBoxBackground,p.fill()),p.closePath(),p.restore(),Z(p,h,me,Ee),p.fillStyle=h.colorValueText,p.textAlign="center",p.textBaseline="alphabetic",p.fillText(H,He+je/2,k+Ye/2-Oe/3),p.restore()}}function ye(p){var h=p.value,v=p.minValue,S=p.maxValue,k=.01*(S-v);return{normal:h<v?v:h>S?S:h,indented:h<v?v-k:h>S?S+k:h}}function ue(p,h,v,S,k){v.beginPath(),v.arc(0,0,Ri(p),0,2*Po,!0),v.lineWidth=h,v.strokeStyle=k?we.linearGradient(v,S,k,p):S,v.stroke(),v.closePath()}function ie(p,h){var v=Oi.pixelRatio;return p.maxRadius||(p.maxRadius=p.max-h.borderShadowWidth-h.borderOuterWidth*v-h.borderMiddleWidth*v-h.borderInnerWidth*v+(h.borderOuterWidth?.5:0)+(h.borderMiddleWidth?.5:0)+(h.borderInnerWidth?.5:0)),p.maxRadius}function re(p,h){function v(me,Ee,De,Oe,Xe,Ie){return Ee&&(!Ie&&h.borderShadowWidth&&(De.save(),De.shadowBlur=h.borderShadowWidth,De.shadowColor=h.colorBorderShadow),ue(me,Ee*S,De,Oe,Xe),!Ie&&h.borderShadowWidth&&(Ie=!0,De.restore())),Ie}var S=Oi.pixelRatio,k=h.borderShadowWidth*S,P=p.max-k-h.borderOuterWidth*S/2,U=P-h.borderOuterWidth*S/2-h.borderMiddleWidth*S/2+.5,$=U-h.borderMiddleWidth*S/2-h.borderInnerWidth*S/2+.5,H=ie(p,h),Y=void 0,ce=!1;p.save(),ce=v(P,h.borderOuterWidth,p,h.colorBorderOuter,h.colorBorderOuterEnd,ce),ce=v(U,h.borderMiddleWidth,p,h.colorBorderMiddle,h.colorBorderMiddleEnd,ce),ce=v($,h.borderInnerWidth,p,h.colorBorderInner,h.colorBorderInnerEnd,ce),!ce&&h.borderShadowWidth&&(p.shadowBlur=h.borderShadowWidth,p.shadowColor=h.colorBorderShadow),p.beginPath(),p.arc(0,0,Ri(H),0,2*Po,!0),h.colorPlateEnd?(Y=p.createRadialGradient(0,0,H/2,0,0,H),Y.addColorStop(0,h.colorPlate),Y.addColorStop(1,h.colorPlateEnd)):Y=h.colorPlate,p.fillStyle=Y,p.fill(),p.closePath(),p.restore()}function de(p,h){if(h.highlights!=="false"&&h.highlights.length&&h.highlightsWidth!==0){var v=p.max*(parseFloat(h.highlightsWidth)||0)/100,S=Ri(ve(p,h)-v/2),k=h.highlights.length,P=(h.maxValue-h.minValue)/h.ticksAngle;p.save();for(var U=0;U<k;U++){var $=h.highlights[U];p.lineWidth=v,p.lineCap=h.highlightsLineCap,p.strokeStyle=$.color,p.beginPath(),p.rotate(gl),p.arc(0,0,S,we.radians(h.startAngle+($.from-h.minValue)/P),we.radians(h.startAngle+($.to-h.minValue)/P),!1),p.stroke(),p.closePath(),p.restore(),p.save()}p.restore()}}function ee(p,h){var v=ve(p,h),S=void 0,k=void 0,P=void 0,U=0,$=Math.abs(h.minorTicks)||0,H=h.ticksAngle/(h.maxValue-h.minValue);h.exactTicks?(k=h.maxValue-h.minValue,S=$?k/$:0,U=($i.mod(h.majorTicks[0],$)||0)*H):S=$*(h.majorTicks.length-1),p.lineWidth=Oi.pixelRatio,p.strokeStyle=h.colorMinorTicks||h.colorStrokeTicks,p.save();for(var Y=0;Y<S;++Y)(P=h.startAngle+U+Y*(h.ticksAngle/S))<=h.ticksAngle+h.startAngle&&(p.rotate(we.radians(P)),p.beginPath(),p.moveTo(0,v),p.lineTo(0,v-.075*p.max),Ue(p));p.restore()}function ve(p,h){var v=p.max/100;return ie(p,h)-5*v-(h.barWidth?2*(parseFloat(h.barStrokeWidth)||0)+((parseFloat(h.barWidth)||0)+5)*v:0)}function le(p,h){we.prepareTicks(h);var v=Ri(ve(p,h)),S=void 0,k=h.majorTicks.length,P=Oi.pixelRatio;p.lineWidth=2*P,S=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(k).fill(h.colorStrokeTicks||h.colorMajorTicks);for(var U=0;U<k;++U)p.save(),p.strokeStyle=S[U],p.rotate(we.radians(ge(h,h.exactTicks?h.majorTicks[U]:U,k))),p.beginPath(),p.moveTo(0,v),p.lineTo(0,v-.15*p.max),p.stroke(),p.closePath(),p.restore();h.strokeTicks&&(p.save(),p.strokeStyle=h.colorStrokeTicks||S[0],p.rotate(gl),p.beginPath(),p.arc(0,0,v,we.radians(h.startAngle),we.radians(h.startAngle+h.ticksAngle),!1),p.stroke(),p.closePath(),p.restore())}function ge(p,h,v){if(p.exactTicks){var S=p.ticksAngle/(p.maxValue-p.minValue);return p.startAngle+S*(h-p.minValue)}return p.startAngle+h*(p.ticksAngle/(v-1))}function Ue(p){p.stroke(),p.restore(),p.closePath(),p.save()}function ot(p,h){var v=ve(p,h)-.15*p.max,S={},k=0,P=h.majorTicks.length,U=h.animationTarget!=="needle",$=h.colorNumbers instanceof Array?h.colorNumbers:new Array(P).fill(h.colorNumbers),H=U?-(h.value-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle:0;for(U&&(p.save(),p.rotate(-we.radians(H))),p.font=we.font(h,"Numbers",p.max/200),p.lineWidth=0,p.textAlign="center",p.textBaseline="middle";k<P;++k){var Y=H+ge(h,h.exactTicks?h.majorTicks[k]:k,P),ce=p.measureText(h.majorTicks[k]).width,me=h.fontNumbersSize,Ee=Math.sqrt(ce*ce+me*me)/2,De=we.radialPoint(v-Ee-h.numbersMargin/100*p.max,we.radians(Y));Y===360&&(Y=0),S[Y]||(S[Y]=!0,p.fillStyle=$[k],p.fillText(h.majorTicks[k],De.x,De.y))}U&&p.restore()}function Mt(p,h){h.title&&(p.save(),p.font=we.font(h,"Title",p.max/200),p.fillStyle=h.colorTitle,p.textAlign="center",p.fillText(h.title,0,-p.max/4.25,.8*p.max),p.restore())}function Yt(p,h){h.units&&(p.save(),p.font=we.font(h,"Units",p.max/200),p.fillStyle=h.colorUnits,p.textAlign="center",p.fillText(we.formatContext(h,h.units),0,p.max/3.25,.8*p.max),p.restore())}function mi(p,h){if(h.needle){var v=h.animationTarget!=="needle",S=h.ticksAngle<360?we.normalizedValue(h).indented:h.value,k=v?h.startAngle:h.startAngle+(S-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle;h.barStartPosition==="right"&&(k=h.startAngle+h.ticksAngle-(S-h.minValue)/(h.maxValue-h.minValue)*h.ticksAngle);var P=ie(p,h),U=Ri(P/100*h.needleCircleSize),$=Ri(P/100*h.needleCircleSize*.75),H=Ri(P/100*h.needleEnd),Y=Ri(h.needleStart?P/100*h.needleStart:0),ce=P/100*h.needleWidth,me=P/100*h.needleWidth/2,Ee=Oi.pixelRatio;p.save(),we.drawNeedleShadow(p,h),p.rotate(we.radians(k)),p.fillStyle=we.linearGradient(p,h.colorNeedle,h.colorNeedleEnd,H-Y),h.needleType==="arrow"?(p.beginPath(),p.moveTo(-me,-Y),p.lineTo(-ce,0),p.lineTo(-1*Ee,H),p.lineTo(Ee,H),p.lineTo(ce,0),p.lineTo(me,-Y),p.closePath(),p.fill(),p.beginPath(),p.lineTo(-.5*Ee,H),p.lineTo(-1*Ee,H),p.lineTo(-ce,0),p.lineTo(-me,-Y),p.lineTo(me/2*Ee-2*Ee,-Y),p.closePath(),p.fillStyle=h.colorNeedleShadowUp,p.fill()):(p.beginPath(),p.moveTo(-me,H),p.lineTo(-me,Y),p.lineTo(me,Y),p.lineTo(me,H),p.closePath(),p.fill()),p.restore(),h.needleCircleSize&&(p.save(),we.drawNeedleShadow(p,h),h.needleCircleOuter&&(p.beginPath(),p.arc(0,0,U,0,2*Po,!0),p.fillStyle=we.linearGradient(p,h.colorNeedleCircleOuter,h.colorNeedleCircleOuterEnd,U),p.fill(),p.closePath()),h.needleCircleInner&&(p.beginPath(),p.arc(0,0,$,0,2*Po,!0),p.fillStyle=we.linearGradient(p,h.colorNeedleCircleInner,h.colorNeedleCircleInnerEnd,$),p.fill(),p.closePath()),p.restore())}}function ra(p,h,v){we.drawValueBox(p,h,v,0,p.max-.33*p.max,p.max)}function Ra(p){var h=p.startAngle,v=p.startAngle+p.ticksAngle,S=h,k=h+(we.normalizedValue(p).normal-p.minValue)/(p.maxValue-p.minValue)*p.ticksAngle;if(p.barStartPosition==="middle"){var P=.5*(p.minValue+p.maxValue);p.value<P?(S=180-(P-we.normalizedValue(p).normal)/(p.maxValue-p.minValue)*p.ticksAngle,k=180):(S=180,k=180+(we.normalizedValue(p).normal-P)/(p.maxValue-p.minValue)*p.ticksAngle)}else p.barStartPosition==="right"&&(S=v-k+h,k=v);return{startAngle:S,endAngle:k}}function sa(p,h){var v=p.max/100,S=ie(p,h)-5*v,k=parseFloat(h.barStrokeWidth+"")||0,P=(parseFloat(h.barWidth+"")||0)*v,U=S-2*k-P,$=(S-U)/2,H=U+$,Y=k/H,ce=h.startAngle,me=h.startAngle+h.ticksAngle;if(p.save(),p.rotate(gl),k&&(p.beginPath(),p.arc(0,0,H,we.radians(ce)-Y,we.radians(me)+Y,!1),p.strokeStyle=h.colorBarStroke,p.lineWidth=2*$,p.stroke(),p.closePath()),P&&(p.beginPath(),p.arc(0,0,H,we.radians(ce),we.radians(me),!1),p.strokeStyle=h.colorBar,p.lineWidth=P,p.stroke(),p.closePath(),h.barShadow&&(p.save(),p.beginPath(),p.arc(0,0,S,we.radians(ce),we.radians(me),!1),p.clip(),p.beginPath(),p.strokeStyle=h.colorBar,p.lineWidth=1,p.shadowBlur=h.barShadow,p.shadowColor=h.colorBarShadow,p.shadowOffsetX=0,p.shadowOffsetY=0,p.arc(0,0,S,we.radians(h.startAngle),we.radians(h.startAngle+h.ticksAngle),!1),p.stroke(),p.closePath(),p.restore()),h.barProgress)){var Ee=Ra(h),De=Ee.startAngle,Oe=Ee.endAngle;p.beginPath(),p.arc(0,0,H,we.radians(De),we.radians(Oe),!1),p.strokeStyle=h.colorBarProgress,p.lineWidth=P,p.stroke(),p.closePath()}p.restore()}function La(p){return p.options.animatedValue?p.options.value:p.value}function wo(p,h,v,S,k,P,U,$){p.beginPath(),p.fillStyle=$?we.linearGradient(p,U,$,k>P?k:P,P>k,k>P?v:S):U,h>0?we.roundRect(p,v,S,k,P,h):p.rect(v,S,k,P),p.fill(),p.closePath()}function Ni(p,h,v,S,k,P,U,$,H){p.beginPath(),p.lineWidth=h,p.strokeStyle=H?we.linearGradient(p,$,H,U,!0,k):$,v>0?we.roundRect(p,S,k,P,U,v):p.rect(S,k,P,U),p.stroke(),p.closePath()}function _o(p,h,v,S,k,P){function U(qe,tt,ht,Kt){return qe&&(!Kt&&h.borderShadowWidth&&(p.save(),p.shadowBlur=h.borderShadowWidth,p.shadowColor=h.colorBorderShadow),Ni(p,qe*$,H,v+qe*$/2-Pe,S+qe*$/2-Pe,Y,De,tt,ht),Pe+=.5*$,!Kt&&h.borderShadowWidth&&(Kt=!0,p.restore())),Kt}var $=Oi.pixelRatio,H=h.borderRadius*$,Y=k-h.borderShadowWidth-h.borderOuterWidth*$,ce=Y-h.borderOuterWidth*$-h.borderMiddleWidth*$,me=ce-h.borderMiddleWidth*$-h.borderInnerWidth*$,Ee=me-h.borderInnerWidth*$,De=P-h.borderShadowWidth-h.borderOuterWidth*$,Oe=De-h.borderOuterWidth*$-h.borderMiddleWidth*$,Xe=Oe-h.borderMiddleWidth*$-h.borderInnerWidth*$,Ie=Xe-h.borderInnerWidth*$,je=v-(ce-Y)/2,Ye=je-(me-ce)/2,Je=Ye-(Ee-me)/2,ze=S-(Oe-De)/2,He=ze-(Xe-Oe)/2,Fe=He-(Ie-Xe)/2,Pe=0,Re=!1;return p.save(),Re=U(h.borderOuterWidth,h.colorBorderOuter,h.colorBorderOuterEnd,Re),Re=U(h.borderMiddleWidth,h.colorBorderMiddle,h.colorBorderMiddleEnd,Re),Re=U(h.borderInnerWidth,h.colorBorderInner,h.colorBorderInnerEnd,Re),!Re&&h.borderShadowWidth&&(p.shadowBlur=h.borderShadowWidth,p.shadowColor=h.colorBorderShadow),wo(p,H,Je,Fe,Ee+2*Pe,Ie+2*Pe,h.colorPlate,h.colorPlateEnd),p.restore(),[Je,Fe,Ee,Ie]}function Mo(p,h,v,S,k,P){var U=Oi.pixelRatio,$=P>=k,H=$?.85*k:P,Y=$?P:k;v=$?We(v+(k-H)/2):v;var ce=!!h.title,me=!!h.units,Ee=!!h.valueBox,De=void 0,Oe=void 0,Xe=void 0;$?(Oe=We(.05*Y),De=We(.075*Y),Xe=We(.11*Y),ce&&(Y-=De,S+=De),me&&(Y-=Oe),Ee&&(Y-=Xe)):(Oe=De=We(.15*H),ce&&(H-=De,S+=De),me&&(H-=Oe));var Ie=2*h.barStrokeWidth,je=h.barBeginCircle?We(H*h.barBeginCircle/200-Ie/2):0,Ye=We(H*h.barWidth/100-Ie),Je=We(Y*h.barLength/100-Ie),ze=We((Y-Je)/2),He=We(v+($?H/2:ze+je)),Fe=We(S+($?Y-ze-je+Ie/2:H/2)),Pe=!$||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*H,Re=$||h.hasLeft&&h.hasRight?0:(h.hasRight?-1:1)*h.ticksWidth/100*H;return p.barDimensions={isVertical:$,width:H,length:Y,barWidth:Ye,barLength:Je,strokeWidth:Ie,barMargin:ze,radius:je,pixelRatio:U,barOffset:null,titleMargin:ce?De:0,unitsMargin:me?Oe:0,get ticksLength(){return this.barLength-this.barOffset-this.strokeWidth},X:v+Pe,Y:S+Re,x0:He+Pe,y0:Fe+Re,baseX:v,baseY:S,ticksPadding:h.ticksPadding/100},p.barDimensions}function Va(p,h,v,S,k,P,U){var $=Mo(p,h,S,k,P,U),H=$.isVertical,Y=$.width,ce=$.barWidth,me=$.barLength,Ee=$.strokeWidth,De=$.barMargin,Oe=$.radius,Xe=$.x0,Ie=$.y0,je=$.X,Ye=$.Y,Je=me;p.save(),p.beginPath();var ze=null;if(h.barBeginCircle){var He=we.radians(H?270:0),Fe=Math.asin(ce/2/Oe),Pe=Math.cos(Fe),Re=Math.sin(Fe),qe=Xe+(H?Oe*Re:Oe*Pe-Ee/2),tt=H?Ie-Oe*Pe:Ie+Oe*Re,ht=Ri(H?tt-Ie:qe-Xe);ze=We(ht+Oe);var Kt=H?We(Xe-Oe*Re):qe,fi=H?tt:We(Ie-Oe*Re);v==="progress"&&(me=ze+(me-ze)*(we.normalizedValue(h).normal-h.minValue)/(h.maxValue-h.minValue));var Io=We(qe+me-ze+Ee/2),da=We(tt-me+ze-Ee/2);p.arc(Xe,Ie,Oe,He+Fe,He-Fe),H?(p.moveTo(qe,fi),p.lineTo(qe,da),p.lineTo(Kt,da),p.lineTo(Kt,fi)):(p.moveTo(qe,fi),p.lineTo(Io,fi),p.lineTo(Io,tt),p.lineTo(qe,tt))}else{var qd=We(H?je+(Y-ce)/2:je+De),$d=We(H?Ye+me+De:Ye+(Y-ce)/2);v==="progress"&&(me*=(h.value-h.minValue)/(h.maxValue-h.minValue)),H?p.rect(qd,$d,ce,-me):p.rect(qd,$d,me,ce)}v!=="progress"&&h.barStrokeWidth&&(p.lineWidth=Ee,p.strokeStyle=h.colorBarStroke,p.stroke()),v!=="progress"&&h.colorBar?(p.fillStyle=h.colorBarEnd?we.linearGradient(p,h.colorBar,h.colorBarEnd,me,H,H?Ye:je):h.colorBar,p.fill()):v==="progress"&&h.colorBarProgress&&(p.fillStyle=h.colorBarProgressEnd?we.linearGradient(p,h.colorBarProgress,h.colorBarProgressEnd,Je,H,H?Ye:je):h.colorBarProgress,p.fill()),p.closePath(),p.restore(),h.barBeginCircle&&(p.barDimensions.radius+=Ee),p.barDimensions.barOffset=ze,p.barDimensions.barWidth+=Ee,p.barDimensions.barLength+=Ee}function ko(p,h,v,S,k,P){Va(p,h,"",v,S,k,P)}function To(p,h){return h.needleSide!==p||h.tickSide!==p||h.numberSide!==p}function gr(p,h,v,S,k,P){h.barProgress&&Va(p,h,"progress",v,S,k,P)}function _g(p,h){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.barWidth,$=v.barOffset,H=v.barMargin,Y=v.X,ce=v.Y,me=v.ticksLength,Ee=v.ticksPadding,De=k*(parseFloat(h.highlightsWidth)||0)/100;if(h.highlights&&De){var Oe=h.tickSide!=="right",Xe=h.tickSide!=="left",Ie=0,je=h.highlights.length,Ye=(k-U)/2,Je=h.maxValue-h.minValue,ze=We(S?Y+Ye:Y+H+$),He=De,Fe=S?ce+P-H-$:ce+Ye,Pe=We((h.ticksWidth/100+Ee)*k)+(De-h.ticksWidth/100*k),Re=We(U+Ee*k);for(p.save();Ie<je;Ie++){var qe=h.highlights[Ie],tt=me*Ri(h.minValue-qe.from)/Je,ht=me*Ri((qe.to-qe.from)/Je);p.beginPath(),p.fillStyle=qe.color,S?(Oe&&p.rect(ze-Pe,Fe-tt,He,-ht),Xe&&p.rect(ze+Re,Fe-tt,He,-ht)):(Oe&&p.rect(ze+tt,Fe-Pe,ht,He),Xe&&p.rect(ze+tt,Fe+Re,ht,He)),p.fill(),p.closePath()}p.restore()}}function vr(p,h,v,S,k){p.beginPath(),p.moveTo(h,v),p.lineTo(S,k),p.stroke(),p.closePath()}function Fd(p,h,v,S,k,P,U,$,H){var Y=p.barDimensions,ce=Y.isVertical,me=Y.length,Ee=Y.barWidth,De=Y.barOffset,Oe=Y.barMargin,Xe=Y.pixelRatio,Ie=Y.width,je=Y.X,Ye=Y.Y,Je=Y.ticksLength,ze=Y.ticksPadding,He=(Ie-Ee)/2,Fe=void 0,Pe=void 0,Re=0,qe=v.length,tt=void 0,ht=H*Ie,Kt=He-ze*Ie,fi=He+Ee+ht+ze*Ie,Io=h instanceof Array?h:new Array(v.length).fill(h);p.save(),p.lineWidth=$*Xe;for(var da=Je/(k-S);Re<qe;Re++)tt=v[Re],p.strokeStyle=Io[Re],ce?(Pe=Ye+me-Oe-De+(S-tt)*da,P&&(Fe=je+Kt,vr(p,Fe,Pe,We(Fe-ht),Pe)),U&&(Fe=je+fi,vr(p,Fe,Pe,We(Fe-ht),Pe))):(Fe=je+Oe+De-(S-tt)*da,P&&(Pe=Ye+Kt,vr(p,Fe,Pe,Fe,We(Pe-ht))),U&&(Pe=Ye+fi,vr(p,Fe,We(Pe),Fe,Pe-ht)));p.restore()}function Mg(p,h){var v=we.prepareTicks(h),S=Bd(v,2),k=S[0],P=S[1],U=2,$=(h.maxValue-h.minValue)/(h.majorTicks.length-1),H=h.colorMajorTicks instanceof Array?h.colorMajorTicks:new Array(h.majorTicks.length).fill(h.colorStrokeTicks||h.colorMajorTicks);if(Fd(p,H,h.exactTicks?h.majorTicks:h.majorTicks.map(function(ht,Kt){return h.minValue+$*Kt}),h.minValue,h.maxValue,k,P,U,h.ticksWidth/100),h.strokeTicks){var Y=p.barDimensions,ce=Y.isVertical,me=Y.length,Ee=Y.width,De=Y.barWidth,Oe=Y.barMargin,Xe=Y.barOffset,Ie=Y.X,je=Y.Y,Ye=Y.ticksLength,Je=Y.pixelRatio,ze=Y.ticksPadding,He=(Ee-De)/2+De+ze*Ee,Fe=(Ee-De)/2-ze*Ee,Pe=void 0,Re=void 0,qe=void 0,tt=void 0;p.strokeStyle=h.colorStrokeTicks||H[0],U*=Je,ce?(Re=je+me-Oe-Xe+U/2,tt=Re-Ye-U,k&&(qe=Pe=We(Ie+Fe),br(p,Pe,Re,qe,tt)),P&&(qe=Pe=We(Ie+He),br(p,Pe,Re,qe,tt))):(Pe=Ie+Oe+Xe-U/2,qe=Pe+Ye+U,k&&(tt=Re=We(je+Fe),br(p,Pe,Re,qe,tt)),P&&(tt=Re=We(je+He),br(p,Pe,Re,qe,tt)))}}function br(p,h,v,S,k){p.beginPath(),p.moveTo(h,v),p.lineTo(S,k),p.stroke(),p.closePath()}function kg(p,h){var v=we.prepareTicks(h),S=Bd(v,2),k=S[0],P=S[1],U=[],$=h.minValue,H=Math.abs(h.minorTicks)||0,Y=H?(h.maxValue-h.minValue)/(H*(h.majorTicks.length-1)):0;if(H)if(h.exactTicks)for(var ce=$i.mod(h.majorTicks[0],H)||0;$<h.maxValue;$+=H)ce+$<h.maxValue&&U.push(ce+$);else for(;$<h.maxValue;$+=Y)U.push($);Fd(p,h.colorMinorTicks||h.colorStrokeTicks,U,h.minValue,h.maxValue,k,P,1,h.ticksWidthMinor/100)}function Tg(p,h){var v=p.barDimensions,S=v.isVertical,k=v.length,P=v.width,U=v.barWidth,$=v.barMargin,H=v.barOffset,Y=v.X,ce=v.Y,me=v.ticksLength,Ee=v.ticksPadding,De=h.maxValue-h.minValue,Oe=De/(h.majorTicks.length-1),Xe=h.exactTicks?h.majorTicks:h.majorTicks.map(function(Io,da){return h.minValue+Oe*da}),Ie=Xe.length,je=h.numberSide!=="right",Ye=h.numberSide!=="left",Je=h.fontNumbersSize*P/200,ze=0,He=(h.ticksWidth/100+2*Ee)*P,Fe=(P-U)/2-He,Pe=(P-U)/2+U+He,Re=void 0,qe=void 0,tt=void 0,ht=void 0,Kt=h.colorNumbers instanceof Array?h.colorNumbers:new Array(Ie).fill(h.colorNumbers),fi=h.numbersMargin/100*P;for(p.font=we.font(h,"Numbers",P/200),p.lineWidth=0,p.textAlign="center";ze<Ie;ze++)p.fillStyle=Kt[ze],ht=h.majorTicks[ze],tt=h.exactTicks?me*((Xe[ze]-h.minValue)/De):ze*me/(Ie-1),S?(qe=ce+k-$-H-tt+Je/3,je&&(p.textAlign="right",p.fillText(ht,Y+Fe-fi,qe)),Ye&&(p.textAlign="left",p.fillText(ht,Y+Pe+fi,qe))):(p.measureText(ht).width,Re=Y+$+H+tt,je&&p.fillText(ht,Re,ce+Fe-fi),Ye&&p.fillText(ht,Re,ce+Pe+Je+fi))}function Eg(p,h){if(h.title){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.baseX,$=v.baseY,H=v.titleMargin,Y=h.fontTitleSize*k/200,ce=We(U+(S?k:P)/2),me=We($+H/2-(S?Y:Y/2)-.025*(S?P:k));p.save(),p.textAlign="center",p.fillStyle=h.colorTitle,p.font=we.font(h,"Title",k/200),p.lineWidth=0,p.fillText(h.title,ce,me,S?k:P),p.restore()}}function Dg(p,h){if(h.units){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.baseX,$=v.baseY,H=v.unitsMargin,Y=h.fontUnitsSize*k/200,ce=We(U+(S?k:P)/2),me=We($+(S?P:k)+H/2-Y/2);p.save(),p.textAlign="center",p.fillStyle=h.colorUnits,p.font=we.font(h,"Units",k/200),p.lineWidth=0,p.fillText(we.formatContext(h,h.units),ce,me,S?k:P),p.restore()}}function Pg(p,h){if(h.needle){var v=p.barDimensions,S=v.isVertical,k=v.width,P=v.length,U=v.barWidth,$=v.barOffset,H=v.barMargin,Y=v.ticksLength,ce=v.X,me=v.Y,Ee=v.ticksPadding,De=h.needleSide!=="right",Oe=h.needleSide!=="left",Xe=Y*(we.normalizedValue(h).indented-h.minValue)/(h.maxValue-h.minValue),Ie=(h.ticksWidth/100+Ee)*k,je=U/2+Ie,Ye=je*(h.needleEnd/100),Je=void 0,ze=void 0,He=void 0,Fe=void 0,Pe=h.needleType.toLowerCase()==="arrow"?Ng:Ig,Re=(k-U)/2,qe=je*(h.needleStart/100),tt=Re-Ie-qe,ht=Re+U+Ie+qe;p.save(),we.drawNeedleShadow(p,h),S?(He=We(me+P-H-$-Xe),De&&(Je=We(ce+tt),ze=Je+Ye,Pe(p,h,Je,He,ze,He,Ye)),Oe&&(Je=We(ce+ht),ze=Je-Ye,Pe(p,h,Je,He,ze,He,Ye,!0))):(Je=We(ce+H+$+Xe),De&&(He=We(me+tt),Fe=He+Ye,Pe(p,h,Je,He,Je,Fe,Ye)),Oe&&(He=We(me+ht),Fe=He-Ye,Pe(p,h,Je,He,Je,Fe,Ye,!0))),p.restore()}}function Gd(p,h,v,S){return h.colorNeedleEnd?we.linearGradient(p,S?h.colorNeedleEnd:h.colorNeedle,S?h.colorNeedle:h.colorNeedleEnd,v,!p.barDimensions.isVertical):h.colorNeedle}function Ig(p,h,v,S,k,P,U,$){p.lineWidth=h.needleWidth,p.strokeStyle=Gd(p,h,U,$),p.beginPath(),p.moveTo(v,S),p.lineTo(k,P),p.stroke(),p.closePath()}function Ng(p,h,v,S,k,P,U,$){var H=We(.4*U),Y=U-H,ce=v===k,me=h.needleWidth/2;p.fillStyle=Gd(p,h,U,$),p.beginPath(),ce?(S>P&&(Y*=-1),p.moveTo(v-me,S),p.lineTo(v+me,S),p.lineTo(v+me,S+Y),p.lineTo(v,P),p.lineTo(v-me,S+Y),p.lineTo(v-me,S)):(v>k&&(Y*=-1),p.moveTo(v,S-me),p.lineTo(v,S+me),p.lineTo(v+Y,S+me),p.lineTo(k,S),p.lineTo(v+Y,S-me),p.lineTo(v,S-me)),p.fill(),p.closePath()}function Og(p,h,v,S,k,P,U){var $=(parseFloat(h.fontValueSize)||0)*P/200,H=(.11*U-$)/2;p.barDimensions.isVertical&&we.drawValueBox(p,h,v,S+P/2,k+U-$-H,P)}var Bd=(function(){function p(h,v){var S=[],k=!0,P=!1,U=void 0;try{for(var $,H=h[Symbol.iterator]();!(k=($=H.next()).done)&&(S.push($.value),!v||S.length!==v);k=!0);}catch(Y){P=!0,U=Y}finally{try{!k&&H.return&&H.return()}finally{if(P)throw U}}return S}return function(h,v){if(Array.isArray(h))return h;if(Symbol.iterator in Object(h))return p(h,v);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),ml=function p(h,v,S){h===null&&(h=Function.prototype);var k=Object.getOwnPropertyDescriptor(h,v);if(k===void 0){var P=Object.getPrototypeOf(h);return P===null?void 0:p(P,v,S)}if("value"in k)return k.value;var U=k.get;if(U!==void 0)return U.call(S)},Rg=function p(h,v,S,k){var P=Object.getOwnPropertyDescriptor(h,v);if(P===void 0){var U=Object.getPrototypeOf(h);U!==null&&p(U,v,S,k)}else if("value"in P&&P.writable)P.value=S;else{var $=P.set;$!==void 0&&$.call(k,S)}return S},la=(function(){function p(h,v){for(var S=0;S<v.length;S++){var k=v[S];k.enumerable=k.enumerable||!1,k.configurable=!0,"value"in k&&(k.writable=!0),Object.defineProperty(h,k.key,k)}}return function(h,v,S){return v&&p(h.prototype,v),S&&p(h,S),h}})(),Ar=null,Lg=(function(){function p(){i(this,p),this._events={},this.addListener=this.on,this.removeListener=this.off}return la(p,[{key:"emit",value:function(h){if(this._events[h]){for(var v=0,S=this._events[h].length,k=arguments.length,P=Array(k>1?k-1:0),U=1;U<k;U++)P[U-1]=arguments[U];for(;v<S;v++)this._events[h][v]&&this._events[h][v].apply(this,P)}}},{key:"once",value:function(h){for(var v=arguments.length,S=Array(v>1?v-1:0),k=1;k<v;k++)S[k-1]=arguments[k];for(var P=0,U=S.length,$=this;P<U;P++)(function(){var H=S[P],Y=function ce(){$.off(h,ce),H.apply($,arguments)};S[P]=Y})();this.on.apply(this,[h].concat(S))}},{key:"on",value:function(h){this._events[h]||(this._events[h]=[]);for(var v=0,S=arguments.length<=1?0:arguments.length-1;v<S;v++)this._events[h].push(arguments.length<=v+1?void 0:arguments[v+1])}},{key:"off",value:function(h){if(this._events[h])for(var v=0,S=arguments.length<=1?0:arguments.length-1;v<S;v++)for(var k=arguments.length<=v+1?void 0:arguments[v+1],P=void 0;~(P=this._events[h].indexOf(k));)this._events[h].splice(P,1)}},{key:"removeAllListeners",value:function(h){delete this._events[h]}},{key:"listeners",get:function(){return this._events}}]),p})(),Ud=a("requestAnimationFrame")||function(p){return setTimeout(function(){return p(new Date().getTime())},1e3/60)},Eo={linear:function(p){return p},quad:function(p){return Math.pow(p,2)},dequad:function(p){return 1-Eo.quad(1-p)},quint:function(p){return Math.pow(p,5)},dequint:function(p){return 1-Math.pow(1-p,5)},cycle:function(p){return 1-Math.sin(Math.acos(p))},decycle:function(p){return Math.sin(Math.acos(1-p))},bounce:function(p){return 1-Eo.debounce(1-p)},debounce:function(p){for(var h=0,v=1;;h+=v,v/=2)if(p>=(7-4*h)/11)return-Math.pow((11-6*h-11*p)/4,2)+Math.pow(v,2)},elastic:function(p){return 1-Eo.delastic(1-p)},delastic:function(p){return Math.pow(2,10*(p-1))*Math.cos(20*Math.PI*1.5/3*p)}},hl=(function(){function p(){var h=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"linear",v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:250,S=arguments.length>2&&arguments[2]!==void 0?arguments[2]:function(){},k=arguments.length>3&&arguments[3]!==void 0?arguments[3]:function(){};if(i(this,p),this.duration=v,this.rule=h,this.draw=S,this.end=k,typeof this.draw!="function")throw new TypeError("Invalid animation draw callback:",S);if(typeof this.end!="function")throw new TypeError("Invalid animation end callback:",k)}return la(p,[{key:"animate",value:function(h,v){var S=this;this.frame&&this.cancel();var k=window.performance&&window.performance.now?window.performance.now():a("animationStartTime")||Date.now();h=h||this.draw,v=v||this.end,this.draw=h,this.end=v,this.frame=Ud(function(P){return r(P,h,k,Eo[S.rule]||S.rule,S.duration,v,S)})}},{key:"cancel",value:function(){this.frame&&((a("cancelAnimationFrame")||function(h){})(this.frame),this.frame=null)}},{key:"destroy",value:function(){this.cancel(),this.draw=null,this.end=null}}]),p})();hl.rules=Eo;var Wa=(function(){function p(h,v,S){i(this,p),this.options=h,this.element=v.toLowerCase(),this.type=p.toDashed(S),this.Type=n[S],this.mutationsObserved=!1,this.isObservable=!!window.MutationObserver,window.GAUGES_NO_AUTO_INIT||p.domReady(this.traverse.bind(this))}return la(p,[{key:"isValidNode",value:function(h){return!(!h.tagName||h.tagName.toLowerCase()!==this.element||h.getAttribute("data-type")!==this.type)}},{key:"traverse",value:function(){for(var h=document.getElementsByTagName(this.element),v=0,S=h.length;v<S;v++)this.process(h[v]);this.isObservable&&!this.mutationsObserved&&(new MutationObserver(this.observe.bind(this)).observe(document.body,{childList:!0,subtree:!0,attributes:!0,characterData:!0,attributeOldValue:!0,characterDataOldValue:!0}),this.mutationsObserved=!0)}},{key:"observe",value:function(h){for(var v=0,S=h.length;v<S;v++){var k=h[v];if(k.type==="attributes"&&k.attributeName==="data-type"&&this.isValidNode(k.target)&&k.oldValue!==this.type)setTimeout(this.process.bind(this,k.target));else if(k.addedNodes&&k.addedNodes.length)for(var P=0,U=k.addedNodes.length;P<U;P++)setTimeout(this.process.bind(this,k.addedNodes[P]))}}},{key:"process",value:function(h){var v=this;if(!this.isValidNode(h))return null;var S=void 0,k=JSON.parse(JSON.stringify(this.options)),P=null;for(S in k)if(k.hasOwnProperty(S)){var U=p.toAttributeName(S),$=p.parse(h.getAttribute(U));$!=null&&(k[S]=$)}return k.renderTo=h,P=new this.Type(k),P.draw&&P.draw(),this.isObservable&&(P.observer=new MutationObserver(function(H){H.forEach(function(Y){if(Y.type==="attributes"){var ce=Y.attributeName.toLowerCase(),me=h.getAttribute(ce).toLowerCase();if(ce==="data-type"&&me&&me!==v.type)P.observer.disconnect(),delete P.observer,P.destroy&&P.destroy();else if(ce.substr(0,5)==="data-"){var Ee=ce.substr(5).split("-").map(function(Oe,Xe){return Xe?Oe.charAt(0).toUpperCase()+Oe.substr(1):Oe}).join(""),De={};De[Ee]=p.parse(h.getAttribute(Y.attributeName)),Ee==="value"?P&&(P.value=De[Ee]):P.update&&P.update(De)}}})}),P.observer.observe(h,{attributes:!0})),P}}],[{key:"parse",value:function(h){if(h==="true")return!0;if(h==="false")return!1;if(h!=="undefined"){if(h==="null")return null;if(/^[-+#.\w\d\s]+(?:,[-+#.\w\d\s]*)+$/.test(h))return h.split(",");try{return JSON.parse(h)}catch(v){}return h}}},{key:"toDashed",value:function(h){for(var v=h.split(/(?=[A-Z])/),S=1,k=v.length,P=v[0].toLowerCase();S<k;S++)P+="-"+v[S].toLowerCase();return P}},{key:"toCamelCase",value:function(h){for(var v=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],S=h.split(/-/),k=0,P=S.length,U="";k<P;k++)U+=k||v?S[k][0].toUpperCase()+S[k].substr(1).toLowerCase():S[k].toLowerCase();return U}},{key:"toAttributeName",value:function(h){return"data-"+p.toDashed(h)}},{key:"domReady",value:function(h){if(/comp|inter|loaded/.test((window.document||{}).readyState+""))return h();window.addEventListener?window.addEventListener("DOMContentLoaded",h,!1):window.attachEvent&&window.attachEvent("onload",h)}}]),p})(),Oi=(function(){function p(h,v,S){i(this,p),p.collection.push(this),this.width=v||0,this.height=S||0,this.element=h,this.init()}return la(p,[{key:"init",value:function(){var h=p.pixelRatio;this.element.width=this.width*h,this.element.height=this.height*h,this.element.style.width=this.width+"px",this.element.style.height=this.height+"px",this.elementClone=this.element.cloneNode(!0),this.context=this.element.getContext("2d"),this.contextClone=this.elementClone.getContext("2d"),this.drawWidth=this.element.width,this.drawHeight=this.element.height,this.drawX=this.drawWidth/2,this.drawY=this.drawHeight/2,this.minSide=this.drawX<this.drawY?this.drawX:this.drawY,this.contextClone.translate(this.drawX,this.drawY),this.elementClone.initialized=!1,this.context.translate(this.drawX,this.drawY),this.context.max=this.contextClone.max=this.minSide,this.context.maxRadius=this.contextClone.maxRadius=null}},{key:"destroy",value:function(){var h=p.collection.indexOf(this);~h&&p.collection.splice(h,1),this.context.clearRect(-this.drawX,-this.drawY,this.drawWidth,this.drawHeight),this.context.max=null,delete this.context.max,this.context.maxRadius=null,delete this.context.maxRadius,this.context=null,this.contextClone=null,this.elementClone=null,this.element=null,this.onRedraw=null}},{key:"commit",value:function(){var h=p.pixelRatio;return h!==1&&this.contextClone.scale(h,h),this}},{key:"redraw",value:function(){return this.init(),this.onRedraw&&this.onRedraw(),this}}],[{key:"redraw",value:function(){for(var h=0,v=p.collection.length;h<v;h++)p.collection[h].redraw()}},{key:"pixelRatio",get:function(){return window.devicePixelRatio||1}}]),p})();Oi.collection=[],window.matchMedia&&window.matchMedia("screen and (min-resolution: 2dppx)").addListener(Oi.redraw);var pl={renderTo:null,width:0,height:0,minValue:0,maxValue:100,value:0,units:!1,exactTicks:!1,majorTicks:[0,20,40,60,80,100],minorTicks:10,strokeTicks:!0,animatedValue:!1,animateOnInit:!1,title:!1,borders:!0,numbersMargin:1,listeners:null,valueInt:3,valueDec:2,majorTicksInt:1,majorTicksDec:0,animation:!0,animationDuration:500,animationRule:"cycle",colorPlate:"#fff",colorPlateEnd:"",colorMajorTicks:"#444",colorMinorTicks:"#666",colorStrokeTicks:"",colorTitle:"#888",colorUnits:"#888",colorNumbers:"#444",colorNeedle:"rgba(240,128,128,1)",colorNeedleEnd:"rgba(255,160,122,.9)",colorValueText:"#444",colorValueTextShadow:"rgba(0,0,0,0.3)",colorBorderShadow:"rgba(0,0,0,0.5)",colorBorderOuter:"#ddd",colorBorderOuterEnd:"#aaa",colorBorderMiddle:"#eee",colorBorderMiddleEnd:"#f0f0f0",colorBorderInner:"#fafafa",colorBorderInnerEnd:"#ccc",colorValueBoxRect:"#888",colorValueBoxRectEnd:"#666",colorValueBoxBackground:"#babab2",colorValueBoxShadow:"rgba(0,0,0,1)",colorNeedleShadowUp:"rgba(2,255,255,0.2)",colorNeedleShadowDown:"rgba(188,143,143,0.45)",colorBarStroke:"#222",colorBar:"#ccc",colorBarProgress:"#888",colorBarShadow:"#000",fontNumbers:"Arial",fontTitle:"Arial",fontUnits:"Arial",fontValue:"Arial",fontNumbersSize:20,fontTitleSize:24,fontUnitsSize:22,fontValueSize:26,fontNumbersStyle:"normal",fontTitleStyle:"normal",fontUnitsStyle:"normal",fontValueStyle:"normal",fontNumbersWeight:"normal",fontTitleWeight:"normal",fontUnitsWeight:"normal",fontValueWeight:"normal",needle:!0,needleShadow:!0,needleType:"arrow",needleStart:5,needleEnd:85,needleWidth:4,borderOuterWidth:3,borderMiddleWidth:3,borderInnerWidth:3,borderShadowWidth:3,valueBox:!0,valueBoxStroke:5,valueBoxWidth:0,valueText:"",valueTextShadow:!0,valueBoxBorderRadius:2.5,highlights:[{from:20,to:60,color:"#eee"},{from:60,to:80,color:"#ccc"},{from:80,to:100,color:"#999"}],highlightsWidth:15,highlightsLineCap:"butt",barWidth:20,barStrokeWidth:0,barProgress:!0,barShadow:0};s.prototype=Object.create(Array.prototype),s.prototype.constructor=s,s.prototype.get=function(p){if(typeof p=="string")for(var h=0,v=this.length;h<v;h++){var S=this[h].options.renderTo.tagName?this[h].options.renderTo:document.getElementById(this[h].options.renderTo||"");if(S.getAttribute("id")===p)return this[h]}else if(typeof p=="number")return this[p];return null};var fl="2.2.1",We=Math.round,Ri=Math.abs,Do=new s;Do.version=fl;var $i=(function(p){function h(v){i(this,h);var S=e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this)),k=S.constructor.name;if(k==="BaseGauge")throw new TypeError("Attempt to instantiate abstract class!");if(Do.push(S),v.listeners&&Object.keys(v.listeners).forEach(function(U){(v.listeners[U]instanceof Array?v.listeners[U]:[v.listeners[U]]).forEach(function($){S.on(U,$)})}),S.version=fl,S.type=n[k]||h,S.initialized=!1,v.minValue=parseFloat(v.minValue),v.maxValue=parseFloat(v.maxValue),v.value=parseFloat(v.value)||0,v.borders||(v.borderInnerWidth=v.borderMiddleWidth=v.borderOuterWidth=0),!v.renderTo)throw TypeError("Canvas element was not specified when creating the Gauge object!");var P=v.renderTo.tagName?v.renderTo:document.getElementById(v.renderTo);if(!(P instanceof HTMLCanvasElement))throw TypeError("Given gauge canvas element is invalid!");return v.width=parseFloat(v.width)||0,v.height=parseFloat(v.height)||0,v.width&&v.height||(v.width||(v.width=P.parentNode?P.parentNode.offsetWidth:P.offsetWidth),v.height||(v.height=P.parentNode?P.parentNode.offsetHeight:P.offsetHeight)),S.options=v||{},S.options.animateOnInit&&(S._value=S.options.value,S.options.value=S.options.minValue),S.canvas=new Oi(P,v.width,v.height),S.canvas.onRedraw=S.draw.bind(S),S.animation=new hl(v.animationRule,v.animationDuration),S}return t(h,p),la(h,[{key:"update",value:function(v){return Object.assign(this.options,this.type.configure(v||{})),this.canvas.width=this.options.width,this.canvas.height=this.options.height,this.animation.rule=this.options.animationRule,this.animation.duration=this.options.animationDuration,this.canvas.redraw(),this}},{key:"destroy",value:function(){var v=Do.indexOf(this);~v&&Do.splice(v,1),this.canvas.destroy(),this.canvas=null,this.animation.destroy(),this.animation=null,this.emit("destroy")}},{key:"draw",value:function(){return this.options.animateOnInit&&!this.initialized&&(this.value=this._value,this.initialized=!0,this.emit("init")),this.emit("render"),this}},{key:"value",set:function(v){var S=this;v=h.ensureValue(v,this.options.minValue);var k=this.options.value;if(v!==k)if(this.options.animation){if(this.animation.frame&&(this.options.value=this._value,this._value===v))return this.animation.cancel(),void delete this._value;this._value===void 0&&(this._value=v),this.emit("animationStart"),this.animation.animate(function(P){var U=k+(v-k)*P;S.options.animatedValue&&S.emit("value",U,S.value),S.options.value=U,S.draw(),S.emit("animate",P,S.options.value)},function(){S._value!==void 0&&(S.emit("value",S._value,S.value),S.options.value=S._value,delete S._value),S.draw(),S.emit("animationEnd"),S.animation.frame=null})}else this.emit("value",v,this.value),this.options.value=v,this.draw()},get:function(){return this._value===void 0?this.options.value:this._value}}],[{key:"configure",value:function(v){return v}},{key:"initialize",value:function(v,S){return new Wa(S,"canvas",v)}},{key:"fromElement",value:function(v){var S=Wa.toCamelCase(v.getAttribute("data-type")),k=v.attributes,P=0,U=k.length,$={};if(S){for(/Gauge$/.test(S)||(S+="Gauge");P<U;P++)$[Wa.toCamelCase(k[P].name.replace(/^data-/,""),!1)]=Wa.parse(k[P].value);new Wa($,v.tagName,S).process(v)}}},{key:"ensureValue",value:function(v){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;return v=parseFloat(v),!isNaN(v)&&isFinite(v)||(v=parseFloat(S)||0),v}},{key:"mod",value:function(v,S){return(v%S+S)%S}},{key:"version",get:function(){return fl}}]),h})(Lg);n!==void 0&&(n.BaseGauge=$i,n.gauges=(window.document||{}).gauges=Do);var Vg=/{([_a-zA-Z]+[_a-zA-Z0-9]*)}/g,we={roundRect:b,padValue:A,formatMajorTickNumber:C,radians:w,radialPoint:M,linearGradient:G,drawNeedleShadow:E,drawValueBox:j,verifyError:d,prepareTicks:f,font:F,normalizedValue:ye,formatContext:m},Po=Math.PI,gl=Po/2,zd=Object.assign({},pl,{ticksAngle:270,startAngle:45,colorNeedleCircleOuter:"#f0f0f0",colorNeedleCircleOuterEnd:"#ccc",colorNeedleCircleInner:"#e8e8e8",colorNeedleCircleInnerEnd:"#f5f5f5",needleCircleSize:10,needleCircleInner:!0,needleCircleOuter:!0,needleStart:20,animationTarget:"needle",useMinPath:!1,barWidth:0,barStartPosition:"left"}),Wg=(function(p){function h(v){return i(this,h),v=Object.assign({},zd,v||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(v)))}return t(h,p),la(h,[{key:"draw",value:function(){try{var v=this.canvas,S=[-v.drawX,-v.drawY,v.drawWidth,v.drawHeight],k=S[0],P=S[1],U=S[2],$=S[3],H=this.options;if(H.animationTarget==="needle"){if(!v.elementClone.initialized){var Y=v.contextClone;Y.clearRect(k,P,U,$),this.emit("beforePlate"),re(Y,H),this.emit("beforeHighlights"),de(Y,H),this.emit("beforeMinorTicks"),ee(Y,H),this.emit("beforeMajorTicks"),le(Y,H),this.emit("beforeNumbers"),ot(Y,H),this.emit("beforeTitle"),Mt(Y,H),this.emit("beforeUnits"),Yt(Y,H),v.elementClone.initialized=!0}this.canvas.commit(),v.context.clearRect(k,P,U,$),v.context.drawImage(v.elementClone,k,P,U,$),this.emit("beforeProgressBar"),sa(v.context,H),this.emit("beforeValueBox"),ra(v.context,H,La(this)),this.emit("beforeNeedle"),mi(v.context,H)}else{var ce=-we.radians((H.value-H.minValue)/(H.maxValue-H.minValue)*H.ticksAngle);if(v.context.clearRect(k,P,U,$),this.emit("beforePlate"),re(v.context,H),v.context.rotate(ce),this.emit("beforeHighlights"),de(v.context,H),this.emit("beforeMinorTicks"),ee(v.context,H),this.emit("beforeMajorTicks"),le(v.context,H),this.emit("beforeNumbers"),ot(v.context,H),this.emit("beforeProgressBar"),sa(v.context,H),v.context.rotate(-ce),!v.elementClone.initialized){var me=v.contextClone;me.clearRect(k,P,U,$),this.emit("beforeTitle"),Mt(me,H),this.emit("beforeUnits"),Yt(me,H),this.emit("beforeNeedle"),mi(me,H),v.elementClone.initialized=!0}v.context.drawImage(v.elementClone,k,P,U,$)}this.emit("beforeValueBox"),ra(v.context,H,La(this)),ml(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(Ee){we.verifyError(Ee)}return this}},{key:"value",set:function(v){v=$i.ensureValue(v,this.options.minValue),this.options.animation&&this.options.ticksAngle===360&&this.options.useMinPath&&(this._value=v,v=this.options.value+((v-this.options.value)%360+540)%360-180),Rg(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",v,this)},get:function(){return ml(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"value",this)}}],[{key:"configure",value:function(v){return v.barWidth>50&&(v.barWidth=50),isNaN(v.startAngle)&&(v.startAngle=45),isNaN(v.ticksAngle)&&(v.ticksAngle=270),v.ticksAngle>360&&(v.ticksAngle=360),v.ticksAngle<0&&(v.ticksAngle=0),v.startAngle<0&&(v.startAngle=0),v.startAngle>360&&(v.startAngle=360),v}}]),h})($i);n!==void 0&&(n.RadialGauge=Wg),$i.initialize("RadialGauge",zd);var Hd=Object.assign({},pl,{borderRadius:0,barBeginCircle:30,colorBarEnd:"",colorBarProgressEnd:"",needleWidth:6,tickSide:"both",needleSide:"both",numberSide:"both",ticksWidth:10,ticksWidthMinor:5,ticksPadding:5,barLength:85,fontTitleSize:26,highlightsWidth:10}),Fg=(function(p){function h(v){return i(this,h),v=Object.assign({},Hd,v||{}),e(this,(h.__proto__||Object.getPrototypeOf(h)).call(this,h.configure(v)))}return t(h,p),la(h,[{key:"draw",value:function(){try{var v=this.canvas,S=[-v.drawX,-v.drawY,v.drawWidth,v.drawHeight],k=S[0],P=S[1],U=S[2],$=S[3],H=this.options;if(!v.elementClone.initialized){var Y=v.contextClone;Y.clearRect(k,P,U,$),this.emit("beforePlate"),this.drawBox=_o(Y,H,k,P,U,$),this.emit("beforeBar"),ko.apply(void 0,[Y,H].concat(o(this.drawBox))),v.contextClone.barDimensions=Y.barDimensions,this.emit("beforeHighlights"),_g(Y,H),this.emit("beforeMinorTicks"),kg(Y,H),this.emit("beforeMajorTicks"),Mg(Y,H),this.emit("beforeNumbers"),Tg(Y,H),this.emit("beforeTitle"),Eg(Y,H),this.emit("beforeUnits"),Dg(Y,H),v.elementClone.initialized=!0}this.canvas.commit(),v.context.clearRect(k,P,U,$),v.context.drawImage(v.elementClone,k,P,U,$),this.emit("beforeProgressBar"),gr.apply(void 0,[v.context,H].concat(o(this.drawBox))),this.emit("beforeNeedle"),Pg(v.context,H),this.emit("beforeValueBox"),Og.apply(void 0,[v.context,H,H.animatedValue?this.options.value:this.value].concat(o(this.drawBox))),ml(h.prototype.__proto__||Object.getPrototypeOf(h.prototype),"draw",this).call(this)}catch(ce){we.verifyError(ce)}return this}}],[{key:"configure",value:function(v){return v.barStrokeWidth>=v.barWidth&&(v.barStrokeWidth=We(v.barWidth/2)),v.hasLeft=To("right",v),v.hasRight=To("left",v),v.value>v.maxValue&&(v.value=v.maxValue),v.value<v.minValue&&(v.value=v.minValue),$i.configure(v)}}]),h})($i);n!==void 0&&(n.LinearGauge=Fg),$i.initialize("LinearGauge",Hd),typeof Js<"u"&&Object.assign(n,{Collection:s,GenericOptions:pl,Animation:hl,BaseGauge:$i,drawings:we,SmartCanvas:Oi,DomObserver:Wa,vendorize:a})})(typeof Js<"u"?Js.exports:window)});var Ou=[{id:null,name:"Dashboard 1",icon:"dashboard-dashboard",configuration:[{w:24,h:24,id:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc",selector:"widget-host2",input:{widgetProperties:{type:"widget-tutorial",uuid:"d1d58e6f-f8b4-4a72-9597-7f92aa6776fc"}},x:0,y:0}],collapseSplitShell:!1}];var ft=(()=>{class n{_settings=y(Lt);_router=y(Xc);_destroyRef=y(Ze);dashboards=_([],{equal:wi});activeDashboard=_(null);_widgetAction=new ji(null);widgetAction$=this._widgetAction.asObservable();isDashboardStatic=_(!0);widgetClipboard=_(null);layoutEditSaved=_(0);layoutEditCanceled=_(0);constructor(){let e=this._settings.getDashboardConfig();if(!e||e.length===0){console.warn("[Dashboard Service] No dashboards found in settings, creating blank dashboard");let i=Ou.map(a=>pe(oe({},a),{id:Si.create()}));this.dashboards.set([...i])}else this.dashboards.set(e);this.applyDashboardParam(this.getRouteParam("id"),!1);let t=this._router.events.pipe(vi(i=>i instanceof Qc),wr({bufferSize:1,refCount:!0}),$e(this._destroyRef));t.pipe(Jt(1),Zt(()=>this.getRouteParam("id"))).subscribe(i=>this.applyDashboardParam(i,!0)),t.pipe(_r(1),Zt(()=>this.getRouteParam("id")),Cr()).subscribe(i=>this.applyDashboardParam(i,!1)),W(()=>{let i=this.dashboards();B(()=>{this._settings.saveDashboards(i)})})}getRouteParam(e){let t=this._router.routerState.snapshot.root;for(;t;){if(t.paramMap.has(e))return t.paramMap.get(e);t=t.firstChild??null}return null}applyDashboardParam(e,t){if(e===null||e===""){t&&this.setActiveDashboardIndex(0);return}let i=Number(e);if(Number.isNaN(i)){t&&this.setActiveDashboardIndex(0);return}this.setActiveDashboardIndex(i)}setActiveDashboardIndex(e){e!==this.activeDashboard()&&(e>=0&&e<this.dashboards().length?this.activeDashboard.set(e):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`))}toggleStaticDashboard(){this.isDashboardStatic.set(!this.isDashboardStatic())}add(e,t,i,a){let r=0;return this.dashboards.update(s=>{let d=[...s,{id:Si.create(),name:e,icon:i??"dashboard-dashboard",configuration:t,collapseSplitShell:a??!1}];return r=d.length-1,d}),r}update(e,t,i,a){this.dashboards.update(r=>r.map((s,d)=>d===e?pe(oe({},s),{name:t,icon:i??"dashboard-dashboard",collapseSplitShell:a??!1}):s))}delete(e){this.dashboards.update(t=>t.filter((i,a)=>a!==e)),this.dashboards().length===0?(this.add("Dashboard "+(this.dashboards().length+1),[]),this.activeDashboard.set(0)):this.activeDashboard()>this.dashboards().length-1&&this.activeDashboard.set(this.dashboards().length-1)}duplicate(e,t,i,a){if(e<0||e>=this.dashboards().length)return console.error(`[Dashboard Service] Invalid itemIndex: ${e}`),-1;let r=this.dashboards()[e],s=Ft(r);s.id=Si.create(),s.name=t,s.icon=i||"dashboard-dashboard",s.collapseSplitShell=a??!1,Array.isArray(s.configuration)?s.configuration.forEach(m=>{m&&m.input?.widgetProperties?(m.id=Si.create(),m.input.widgetProperties.uuid=m.id):console.error("Dashboard Service] Widget configuration is missing required properties:",m)}):(console.error("Dashboard Service] Dashboard configuration is not an array:",s.configuration),s.configuration=[]);let d=-1;return this.dashboards.update(m=>{let f=[...m,s];return d=f.length-1,f}),d}updateConfiguration(e,t){let i=Ft(t??[]);this.dashboards.update(a=>a.map((r,s)=>s===e?wi(r.configuration,i)?r:pe(oe({},r),{configuration:i}):r))}previousDashboard(){this.activeDashboard()+1>this.dashboards().length-1?this.activeDashboard.set(0):this.activeDashboard.set(this.activeDashboard()+1)}nextDashboard(){this.activeDashboard()-1<0?this.activeDashboard.set(this.dashboards().length-1):this.activeDashboard.set(this.activeDashboard()-1)}navigateToActive(){this._router.navigate(["/dashboard",this.activeDashboard()])}navigateTo(e){e>=0&&e<this.dashboards().length?this._router.navigate(["/dashboard",e]):console.error(`[Dashboard Service] Invalid dashboard ID: ${e}`)}navigateToNextDashboard(){let e=null;this.activeDashboard()-1<0?e=this.dashboards().length-1:e=this.activeDashboard()-1,this._router.navigate(["/dashboard",e])}navigateToPreviousDashboard(){let e=null;this.activeDashboard()+1>=this.dashboards().length?e=0:e=this.activeDashboard()+1,this._router.navigate(["/dashboard",e])}deleteWidget(e){this._widgetAction.next({id:e,operation:"delete"})}duplicateWidget(e){this._widgetAction.next({id:e,operation:"duplicate"})}copyWidget(e){this._widgetAction.next({id:e,operation:"copy"})}cutWidget(e){this._widgetAction.next({id:e,operation:"cut"})}setWidgetClipboardFromNode(e){let t=e?.input?.widgetProperties,i=t?.type;i&&this.widgetClipboard.set({w:e.w,h:e.h,selector:e.selector,input:{widgetProperties:{type:i,uuid:"clipboard",config:Ft(t.config)}}})}clearWidgetClipboard(){this.widgetClipboard.set(null)}setStaticDashboard(e){this.isDashboardStatic.set(e)}notifyLayoutEditSaved(){this.layoutEditSaved.update(e=>e+1)}notifyLayoutEditCanceled(){this.layoutEditCanceled.update(e=>e+1)}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ss=(()=>{class n{http=y(Ha);connection=y($r);destroyRef=y(Ze);historyServiceUrl=null;constructor(){this.connection.serverServiceEndpoint$.pipe($e(this.destroyRef)).subscribe(e=>{let t=e?.httpServiceUrl||null;this.historyServiceUrl=t?t.replace("/v1/","/v2/"):null,this.historyServiceUrl||console.warn("[HistoryApiClientService] History API endpoint not available; history service is disabled")})}getPaths(e){return Le(this,null,function*(){try{if(!this.historyServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.historyServiceUrl}history/paths`,i=new Ur;e?.from&&(i=i.set("from",e.from)),e?.to&&(i=i.set("to",e.to)),e?.duration&&(i=i.set("duration",e.duration.toString()));let a=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${a}`);let r=yield kn(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] Retrieved ${r?.length??0} available paths`),r}catch(t){return console.error("[HistoryApiClientService] History API /paths request failed:",t),null}})}getContexts(e){return Le(this,null,function*(){try{if(!this.historyServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.historyServiceUrl}history/contexts`,i=new Ur;e?.from&&(i=i.set("from",e.from)),e?.to&&(i=i.set("to",e.to)),e?.duration&&(i=i.set("duration",e.duration.toString()));let a=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${a}`);let r=yield kn(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] Retrieved ${r?.length??0} available contexts`),r}catch(t){return console.error("[HistoryApiClientService] History API /contexts request failed:",t),null}})}getValues(e){return Le(this,null,function*(){try{if(!this.historyServiceUrl)return console.warn("[HistoryApiClientService] No HTTP service URL available"),null;let t=`${this.historyServiceUrl}history/values`,i=new Ur;i=i.set("paths",e.paths),e.context&&(i=i.set("context",e.context)),e.from&&(i=i.set("from",e.from)),e.to&&(i=i.set("to",e.to)),e.duration&&(i=i.set("duration",e.duration.toString())),e.resolution!==void 0&&e.resolution!==null&&(i=i.set("resolution",e.resolution.toString()));let a=`${t}?${i.toString()}`;console.log(`[HistoryApiClientService] GET ${a}`);let r=yield kn(this.http.get(t,{params:i}));return console.log(`[HistoryApiClientService] History fetch successful, received ${r.data?.length??0} data points`),r}catch(t){return console.error("[HistoryApiClientService] History API request failed:",t),null}})}getProviders(){return Le(this,null,function*(){let e=`${this.historyServiceUrl}history/_providers`;return yield kn(this.http.get(e)),["kip"]})}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var ls=(()=>{class n{mapValuesToChartDatapoints(e,t){let i=e?.data;if(!i||i.length===0)return[];let a=-1,r=-1;if(e.values&&Array.isArray(e.values)){for(let E=0;E<e.values.length;E++){let F=e.values[E]?.method,I=typeof F=="string"?F.toLowerCase():F;if(!I)continue;let Z=E+1;I==="sma"?a=Z:(I==="avg"||I==="average")&&(r=Z)}r<0&&e.values.length===1&&(r=1)}else i[0]?.length>1&&(r=1);let s=t.unit==="rad",d=s?t.domain==="signed"?this.normalizeToSigned.bind(this):this.normalizeToDirection.bind(this):null,m=[],f=0,b=Number.POSITIVE_INFINITY,A=Number.NEGATIVE_INFINITY,C=0,w=0,M=0,G=[];for(let E of i){if(!Array.isArray(E)||E.length===0)continue;let F=Date.parse(E[0]),I=a>=0?E[a]:null,Z=r>=0?E[r]:null;if(s?(I=Number.isFinite(I)?d(I):null,Z=Number.isFinite(Z)?d(Z):null):(I=Number.isFinite(I)?I:null,Z=Number.isFinite(Z)?Z:null),Number.isFinite(Z)){let j=Z;s?(G.push(j),w+=Math.sin(j),M+=Math.cos(j)):(C++,f+=j,j<b&&(b=j),j>A&&(A=j))}m.push({timestamp:F,data:{value:Z,sma:I,ema:null,doubleEma:null,lastAverage:null,lastMinimum:null,lastMaximum:null}})}if(m.length>0){let E=null,F=null,I=null;if(s&&G.length>0){E=Math.atan2(w/G.length,M/G.length);let{min:Z,max:j}=this.circularMinMaxRad(G);t.domain==="signed"?(E=this.normalizeToSigned(E),F=this.normalizeToSigned(Z),I=this.normalizeToSigned(j)):(E=this.normalizeToDirection(E),F=this.normalizeToDirection(Z),I=this.normalizeToDirection(j))}else!s&&C>0&&(E=f/C,F=b,I=A);if(E!==null&&F!==null&&I!==null){let Z=m[m.length-1];Z.data.lastAverage=E,Z.data.lastMinimum=F,Z.data.lastMaximum=I}}return m}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(r=>(r*180/Math.PI+360)%360).sort((r,s)=>r-s),i=0,a=0;for(let r=0;r<t.length;r++){let s=(r+1)%t.length,d=(t[s]-t[r]+360)%360;d>i&&(i=d,a=s)}return{min:t[a]*Math.PI/180,max:t[(a-1+t.length)%t.length]*Math.PI/180}}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var dn=(()=>{class n{appSettings=y(Lt);data=y(Wt);history=y(ss);historyChartAdapter=y(ls);historyMinSampleTimeMs=1e3;_svcDatasetConfigs=[];_svcDataSource=[];_svcSubjectObserverRegistry=[];_startAllPromise;signedAnglePaths=new Set(["self.navigation.attitude.roll","self.navigation.attitude.pitch","self.navigation.attitude.yaw","self.environment.wind.angleApparent","self.environment.wind.angleTrueGround","self.environment.wind.angleTrueWater","self.steering.rudderAngle"]);constructor(){this._svcDatasetConfigs=this.appSettings.getDataSets(),this.cleanupDatasets(),this._startAllPromise=this.startAll()}cleanupDatasets(){if(this.appSettings.configUpgrade()||this.appSettings.getAppConfig().configVersion<12)return;let t=this.appSettings.getDashboardConfig(),i=new Set;t.forEach(d=>{d.configuration?.length&&d.configuration?.forEach(m=>{m?.id&&i.add(m.id)})});function a(d){let m=d.match(/^(windtrends|speedtrends)-(.+)$/);return m?m[2]:null}let r=[],s=[];for(let d of this._svcDatasetConfigs){let m=d.label||"",f=!1;if(m.startsWith("windtrends-")||m.startsWith("speedtrends-")){let b=a(m);f=!!(b&&i.has(b))}else(m.startsWith("simple-chart-")||(m.match(/\|/g)||[]).length===4)&&(f=i.has(d.uuid));f?s.push(d):r.push(d)}r.length&&(r.forEach(d=>{console.warn(`[DatasetStreamService] Cleaned dataset: uuid=${d.uuid}, label="${d.label}"`)}),this._svcDatasetConfigs=s,this.appSettings.saveDataSets(this._svcDatasetConfigs))}setupServiceSubjectRegistry(e,t){let i=this._svcSubjectObserverRegistry.findIndex(a=>a.datasetUuid==e);i>=0&&(this._svcSubjectObserverRegistry[i].rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(i,1)),this._svcSubjectObserverRegistry.push({datasetUuid:e,rxjsSubject:new Yd(t)})}createDataSourceConfiguration(e){let r={uuid:e.uuid,pathObserverSubscription:null,sampleTime:null,maxDataPoints:null,smoothingPeriod:null,historicalData:[]},s=m(e.timeScaleFormat,e.period),d=s>0?Math.max(100,Math.round(s/120)):1e3;return r.sampleTime=d,r.maxDataPoints=Math.max(1,Math.ceil(s/d)),r.smoothingPeriod=Math.max(1,Math.floor(r.maxDataPoints*.25)),(!r.maxDataPoints||r.maxDataPoints<1)&&(r.maxDataPoints=1),(!r.sampleTime||r.sampleTime<1)&&(r.sampleTime=1),r;function m(f,b){switch(f){case"Last Minute":return 6e4;case"Last 5 Minutes":return 5*6e4;case"Last 30 Minutes":return 30*6e4;case"day":return Math.max(0,b)*24*60*6e4;case"hour":return Math.max(0,b)*60*6e4;case"minute":return Math.max(0,b)*6e4;case"second":return Math.max(0,b)*1e3;default:return 0}}}waitUntilReady(){return Le(this,null,function*(){return this._startAllPromise})}startAll(){return Le(this,null,function*(){console.log("[DatasetStreamService] Auto Starting "+this._svcDatasetConfigs.length.toString()+" Datasets");for(let e of this._svcDatasetConfigs)yield this.start(e.uuid)})}start(e){return Le(this,null,function*(){let t=this._svcDatasetConfigs.find(b=>b.uuid==e);if(!t){console.warn(`[DatasetStreamService] Dataset UUID:${e} not found`);return}let i=this.createDataSourceConfiguration(t);this.setupServiceSubjectRegistry(i.uuid,i.maxDataPoints);let a=this._svcDataSource[this._svcDataSource.push(i)-1];console.log(`[DatasetStreamService] Starting recording process: ${t.path}, Scale: ${t.timeScaleFormat}, Period: ${t.period}, Datapoints: ${i.maxDataPoints}`);let r=this.resolveAngleDomain(t.path,t.baseUnit),s=Math.max(1,Math.round(i.sampleTime/1e3));this.shouldSeedHistory(i.sampleTime)&&(yield this.seedHistoryData(a,t,s,r));let d=this.data.subscribePath(t.path,t.pathSource).pipe(vi(b=>b?.data?.value!==null),wr({bufferSize:1,refCount:!0})),m=d.pipe(Jt(1)),f=ca(i.sampleTime,i.sampleTime).pipe(sc(d,(b,A)=>A));a.pathObserverSubscription=gi(m,f).subscribe(b=>{a.maxDataPoints>0&&a.historicalData.length>=a.maxDataPoints&&a.historicalData.shift(),a.historicalData.push(b.data.value);let A=this.updateDataset(a,t.baseUnit,r);this._svcSubjectObserverRegistry.find(C=>C.datasetUuid===a.uuid).rxjsSubject.next(A)})})}seedHistoryData(e,t,i,a){return Le(this,null,function*(){try{let r=this.buildHistoryPathString(t.path,e.smoothingPeriod),s=(()=>{switch(t.timeScaleFormat){case"Last Minute":return 6e4;case"Last 5 Minutes":return 5*6e4;case"Last 30 Minutes":return 30*6e4;case"day":return Math.max(0,t.period)*24*60*6e4;case"hour":return Math.max(0,t.period)*60*6e4;case"minute":return Math.max(0,t.period)*6e4;case"second":return Math.max(0,t.period)*1e3;default:return 0}})(),d=new Date,m={paths:r,from:new Date(d.getTime()-s).toISOString(),resolution:i},f=yield this.history.getValues(m);if(!f||!f.data||f.data.length===0){console.log(`[DatasetStreamService] No history data available for ${t.path}`);return}let b=this.convertHistoryToDatapoints(f,t.baseUnit,a),A=this._svcSubjectObserverRegistry.find(C=>C.datasetUuid===e.uuid)?.rxjsSubject;if(A&&b.length>0){let C=[];e.historicalData=[],b.forEach(w=>{let M=w.data.value;if(!Number.isFinite(M))return;e.maxDataPoints>0&&e.historicalData.length>=e.maxDataPoints&&e.historicalData.shift(),e.historicalData.push(M);let G=this.updateDataset(e,t.baseUnit,a);G.timestamp=w.timestamp,C.push(G)}),C.forEach(w=>A.next(w)),console.log(`[DatasetStreamService] Seeded ${C.length} history datapoints for ${t.path}`)}}catch(r){console.warn(`[DatasetStreamService] Failed to seed history data for ${t.path}:`,r)}})}stop(e){let t=this._svcDataSource.findIndex(i=>i.uuid==e);console.log(`[DatasetStreamService] Stopping Dataset ${e} data capture`),this._svcDataSource[t].pathObserverSubscription.unsubscribe(),this._svcDataSource.splice(t,1)}list(){return Ft(this._svcDatasetConfigs)}getDatasetConfig(e){return this._svcDatasetConfigs.find(t=>t.uuid===e)}getDataSourceInfo(e){return this._svcDataSource.find(t=>t.uuid===e)}create(e,t,i,a,r,s=!0,d=!0,m){if(!e||!t||!i||!a||!r)return null;let f=m||Si.create(),b={uuid:f,path:e,pathSource:t,baseUnit:this.data.getPathUnitType(e),timeScaleFormat:i,period:a,label:r,editable:d};return console.log(`[DatasetStreamService] Creating ${s?"":"non-"}persistent ${d?"":"hidden "}dataset: ${b.uuid}, Path: ${b.path}, Source: ${b.pathSource} Scale: ${b.timeScaleFormat}, Period: ${b.period}`),this._svcDatasetConfigs.push(b),this.start(f),s===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),f}edit(e,t=!0){let i=this._svcDatasetConfigs.find(a=>a.uuid===e.uuid);return i?JSON.stringify(i)===JSON.stringify(e)?(console.log(`[DatasetStreamService] No changes detected for Dataset ${e.uuid}.`),!1):(this.stop(e.uuid),console.log(`[DatasetStreamService] Updating Dataset: ${e.uuid}`),e.baseUnit=this.data.getPathUnitType(e.path),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(a=>a.uuid===e.uuid),1,e),this.start(e.uuid),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0):!1}remove(e,t=!0){return!e||e===""||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:(this.stop(e),console.log(`[DatasetStreamService] Removing ${t?"":"non-"}persistent Dataset: ${e}`),this._svcDatasetConfigs.splice(this._svcDatasetConfigs.findIndex(i=>i.uuid===e),1),this._svcSubjectObserverRegistry.find(i=>i.datasetUuid===e).rxjsSubject.complete(),this._svcSubjectObserverRegistry.splice(this._svcSubjectObserverRegistry.findIndex(i=>i.datasetUuid===e),1),t===!0&&this.appSettings.saveDataSets(this._svcDatasetConfigs),!0)}getDatasetObservable(e){let t=this._svcSubjectObserverRegistry.find(i=>i.datasetUuid==e);return t?t.rxjsSubject.asObservable():null}getDatasetBatchThenLiveObservable(e){let t=this._svcSubjectObserverRegistry.find(d=>d.datasetUuid==e);if(!t)return null;let i=t.rxjsSubject,a=i._buffer?i._buffer.slice():[],r=Qd([a]),s=i.pipe(_r(a.length));return Jd(r,s)}updateDataset(e,t,i="scalar"){let a=null,r=null,s=null,d=null;if(t==="rad"){a=this.circularMeanRad(e.historicalData);let A=e.historicalData.slice(-e.smoothingPeriod);r=this.circularMeanRad(A);let{min:C,max:w}=this.circularMinMaxRad(e.historicalData);i==="direction"?(a=this.normalizeToDirection(a),r=this.normalizeToDirection(r),s=this.normalizeToDirection(C),d=this.normalizeToDirection(w)):i==="signed"?(a=this.normalizeToSigned(a),r=this.normalizeToSigned(r),s=this.normalizeToSigned(C),d=this.normalizeToSigned(w)):(s=C,d=w)}else a=f(e.historicalData),r=b(e.historicalData,e.smoothingPeriod),s=Math.min(...e.historicalData),d=Math.max(...e.historicalData);return{timestamp:Date.now(),data:{value:t==="rad"?i==="signed"?this.normalizeToSigned(e.historicalData[e.historicalData.length-1]):this.normalizeToDirection(e.historicalData[e.historicalData.length-1]):e.historicalData[e.historicalData.length-1],sma:r,ema:null,doubleEma:null,lastAverage:a,lastMinimum:s,lastMaximum:d}};function f(A){return A.length===0?null:A.reduce((w,M)=>w+M,0)/A.length}function b(A,C){A.length<C&&(C=A.length);let w=0;for(let M=A.length-C;M<A.length;M++)w+=A[M];return w/C}}circularMeanRad(e){if(e.length===0)return 0;let t=e.reduce((a,r)=>a+Math.sin(r),0),i=e.reduce((a,r)=>a+Math.cos(r),0);return Math.atan2(t/e.length,i/e.length)}circularMinMaxRad(e){if(e.length===0)return{min:0,max:0};let t=e.map(d=>(d*180/Math.PI+360)%360).sort((d,m)=>d-m),i=0,a=0;for(let d=0;d<t.length;d++){let m=(d+1)%t.length,f=(t[m]-t[d]+360)%360;f>i&&(i=f,a=m)}let r=t[a]*Math.PI/180,s=t[(a-1+t.length)%t.length]*Math.PI/180;return{min:r,max:s}}resolveAngleDomain(e,t){if(t!=="rad")return"scalar";let i=this.normalizePathKey(e);for(let a of this.signedAnglePaths)if(i===this.normalizePathKey(a))return"signed";return"direction"}normalizePathKey(e){return e.replace(/^vessels\.self\./,"").replace(/^self\./,"")}mod(e,t){return(e%t+t)%t}normalizeToDirection(e){let t=2*Math.PI;return this.mod(e,t)}normalizeToSigned(e){let t=2*Math.PI;return this.mod(e+Math.PI,t)-Math.PI}removeIfExists(e,t=!0){return!e||this._svcDatasetConfigs.findIndex(i=>i.uuid===e)===-1?!1:this.remove(e,t)}shouldSeedHistory(e){return e>=this.historyMinSampleTimeMs}buildHistoryPathString(e,t){let i=e.replace(/^(vessels\.)?self\./,"");return[`${i}:sma:${t}`,`${i}:avg`,`${i}:min`,`${i}:max`].join(",")}convertHistoryToDatapoints(e,t,i){return this.historyChartAdapter.mapValuesToChartDatapoints(e,{unit:t,domain:i})}ngOnDestroy(){[...this._svcDataSource].forEach(e=>{try{this.stop(e.uuid)}catch(t){}}),this._svcSubjectObserverRegistry.forEach(e=>e.rxjsSubject.complete()),this._svcSubjectObserverRegistry=[]}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Ru=(()=>{class n{kipTimers={};constructor(){}createTimer(e,t,i){return e in this.kipTimers?this.kipTimers[e].currentValue.asObservable():(this.kipTimers[e]={currentValue:new ji(t),timeoutID:null,intervalMS:i},this.kipTimers[e].currentValue.asObservable())}startTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID===null&&(this.kipTimers[e].timeoutID=setInterval(()=>{this.kipTimers[e].currentValue.next(this.kipTimers[e].currentValue.value+1)},this.kipTimers[e].intervalMS))}stopTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].timeoutID!==null&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null)}setTimer(e,t){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&this.kipTimers[e].currentValue.next(t)}deleteTimer(e){Object.prototype.hasOwnProperty.call(this.kipTimers,e)&&(this.stopTimer(e),this.kipTimers[e].currentValue.complete(),delete this.kipTimers[e])}isRunning(e){let t=!1;return e in this.kipTimers&&(t=this.kipTimers[e].timeoutID!==null),t}ngOnDestroy(){Object.keys(this.kipTimers).forEach(e=>{this.kipTimers[e].timeoutID&&(clearInterval(this.kipTimers[e].timeoutID),this.kipTimers[e].timeoutID=null),this.kipTimers[e].currentValue.complete()}),this.kipTimers={}}static \u0275fac=function(t){return new(t||n)};static \u0275prov=rt({token:n,factory:n.\u0275fac,providedIn:"root"})}return n})();var Lu=(()=>{class n{sanitizer=y(qa);transform(e){return this.sanitizer.bypassSecurityTrustResourceUrl(e)}static \u0275fac=function(t){return new(t||n)};static \u0275pipe=Or({name:"safe",type:n,pure:!0})}return n})();var Bg={minDist:230,maxDur:550,minVelocity:1.5,axisDominance:1.8,deadzoneMs:160,purityRatio:.8,lockThreshold:28,directionLockAngle:25,reversalPrimaryThreshold:34};function ao(n){let o=oe(oe({},Bg),n);return`(() => {
2
2
  if (window.__kipSwipeInit) return; window.__kipSwipeInit = true;
3
3
  const instanceId='${o.instanceId}';
4
4
  let pointerId=null; let startX=0; let startY=0; let startT=0; let peakPrimary=0; let peakCross=0; let cancelled=false;