@mxtommy/kip 4.7.0-beta.3 → 4.7.0-beta.4
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 +1 -1
- package/plugin/index.js +1 -1
- package/plugin/kip-plugin/src/index.js +1 -1
- package/public/{chunk-QV7OHVD5.js → chunk-ETXVA6Z3.js} +1 -1
- package/public/{chunk-CRJ2S7XQ.js → chunk-GYJAOUYL.js} +1 -1
- package/public/{chunk-OXKOGBYN.js → chunk-H2I7BMAK.js} +1 -1
- package/public/{chunk-SDPSUOCJ.js → chunk-LWHL6XXC.js} +1 -1
- package/public/{chunk-7ZZK5KBC.js → chunk-NOZ6S7A5.js} +1 -1
- package/public/{chunk-AB34PRGT.js → chunk-TABZLTIT.js} +1 -1
- package/public/index.html +1 -1
- package/public/{main-5HQ6OYM7.js → main-IECWDNBW.js} +1 -1
|
@@ -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-QV7OHVD5.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-ETXVA6Z3.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;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{a as et,b as gt,p as ft,q as vt,r as Dt,s as bt,t as wt,u as St}from"./chunk-
|
|
1
|
+
import{a as et,b as gt,p as ft,q as vt,r as Dt,s as bt,t as wt,u as St}from"./chunk-H2I7BMAK.js";import{c as ut}from"./chunk-ETXVA6Z3.js";import{a as Ct}from"./chunk-IENESD5Q.js";import{e as Pt,f as yt,h as xt,j as Et}from"./chunk-YY4ZUJFI.js";import"./chunk-CSIELI2Z.js";import"./chunk-4YDVZHMH.js";import"./chunk-M37BLWHF.js";import{e as _t}from"./chunk-WJFXI5PQ.js";import{b as mt}from"./chunk-HSKVTFFQ.js";import"./chunk-MXUEYEZU.js";import"./chunk-2GOHQZH5.js";import{$b as Je,Ab as Ye,Ac as ge,Bb as Xe,Ca as S,Cb as R,Da as F,Db as p,Eb as g,Fa as re,Fb as j,Gd as rt,Ha as We,I as Be,J as W,Jc as me,Ka as ae,Lc as O,Mb as q,Mc as Qe,Nd as at,Ob as m,Pe as be,Q as ze,Qb as P,Re as M,Se as L,Ua as le,Va as b,Vd as fe,Xa as Ue,Za as de,_a as Ze,ac as he,ae as lt,ba as se,ca as Ve,cb as je,cc as H,ce as dt,da as N,dc as f,de as ve,ea as Ge,ec as pe,fb as I,fe as ct,g as T,gd as tt,hb as ce,hd as it,he as ht,id as K,j as ne,je as Y,k as _,ka as $e,kd as B,m as Ne,md as ue,na as k,od as C,p as Fe,pa as c,rc as _e,rd as nt,td as st,ua as y,ub as Z,va as x,vd as ot,ve as pt,wb as qe,xb as Ke,xe as De,ya as oe,z as He,za as U}from"./chunk-PZ6I6W3H.js";function Pe(o){let t=o.cloneNode(!0),e=t.querySelectorAll("[id]"),i=o.nodeName.toLowerCase();t.removeAttribute("id");for(let n=0;n<e.length;n++)e[n].removeAttribute("id");return i==="canvas"?Tt(o,t):(i==="input"||i==="select"||i==="textarea")&&Rt(o,t),It("canvas",o,t,Tt),It("input, textarea, select",o,t,Rt),t}function It(o,t,e,i){let n=t.querySelectorAll(o);if(n.length){let s=e.querySelectorAll(o);for(let r=0;r<n.length;r++)i(n[r],s[r])}}var si=0;function Rt(o,t){t.type!=="file"&&(t.value=o.value),t.type==="radio"&&t.name&&(t.name=`mat-clone-${t.name}-${si++}`)}function Tt(o,t){let e=t.getContext("2d");if(e)try{e.drawImage(o,0,0)}catch(i){}}function Te(o){let t=o.getBoundingClientRect();return{top:t.top,right:t.right,bottom:t.bottom,left:t.left,width:t.width,height:t.height,x:t.x,y:t.y}}function ye(o,t,e){let{top:i,bottom:n,left:s,right:r}=o;return e>=i&&e<=n&&t>=s&&t<=r}function oi(o,t){let e=t.left<o.left,i=t.left+t.width>o.right,n=t.top<o.top,s=t.top+t.height>o.bottom;return e||i||n||s}function G(o,t,e){o.top+=t,o.bottom=o.top+o.height,o.left+=e,o.right=o.left+o.width}function kt(o,t,e,i){let{top:n,right:s,bottom:r,left:a,width:l,height:d}=o,h=l*t,v=d*t;return i>n-v&&i<r+v&&e>a-h&&e<s+h}var X=class{_document;positions=new Map;constructor(t){this._document=t}clear(){this.positions.clear()}cache(t){this.clear(),this.positions.set(this._document,{scrollPosition:this.getViewportScrollPosition()}),t.forEach(e=>{this.positions.set(e,{scrollPosition:{top:e.scrollTop,left:e.scrollLeft},clientRect:Te(e)})})}handleScroll(t){let e=B(t),i=this.positions.get(e);if(!i)return null;let n=i.scrollPosition,s,r;if(e===this._document){let d=this.getViewportScrollPosition();s=d.top,r=d.left}else s=e.scrollTop,r=e.scrollLeft;let a=n.top-s,l=n.left-r;return this.positions.forEach((d,h)=>{d.clientRect&&e!==h&&e.contains(h)&&G(d.clientRect,a,l)}),n.top=s,n.left=r,{top:a,left:l}}getViewportScrollPosition(){return{top:window.scrollY,left:window.scrollX}}};function Wt(o,t){let e=o.rootNodes;if(e.length===1&&e[0].nodeType===t.ELEMENT_NODE)return e[0];let i=t.createElement("div");return e.forEach(n=>i.appendChild(n)),i}function ke(o,t,e){for(let i in t)if(t.hasOwnProperty(i)){let n=t[i];n?o.setProperty(i,n,e?.has(i)?"important":""):o.removeProperty(i)}return o}function A(o,t){let e=t?"":"none";ke(o.style,{"touch-action":t?"":"none","-webkit-user-drag":t?"":"none","-webkit-tap-highlight-color":t?"":"transparent","user-select":e,"-ms-user-select":e,"-webkit-user-select":e,"-moz-user-select":e})}function Ot(o,t,e){ke(o.style,{position:t?"":"fixed",top:t?"":"0",opacity:t?"":"0",left:t?"":"-999em"},e)}function J(o,t){return t&&t!="none"?o+" "+t:o}function Mt(o,t){o.style.width=`${t.width}px`,o.style.height=`${t.height}px`,o.style.transform=$(t.left,t.top)}function $(o,t){return`translate3d(${Math.round(o)}px, ${Math.round(t)}px, 0)`}var z={capture:!0},we={passive:!1,capture:!0},ri=(()=>{class o{static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["ng-component"]],hostAttrs:["cdk-drag-resets-container",""],decls:0,vars:0,template:function(i,n){},styles:[`@layer cdk-resets{.cdk-drag-preview{background:none;border:none;padding:0;color:inherit;inset:auto}}.cdk-drag-placeholder *,.cdk-drag-preview *{pointer-events:none !important}
|
|
2
2
|
`],encapsulation:2,changeDetection:0})}return o})(),Oe=(()=>{class o{_ngZone=c(F);_document=c(U);_styleLoader=c(nt);_renderer=c(de).createRenderer(null,null);_cleanupDocumentTouchmove;_scroll=new _;_dropInstances=new Set;_dragInstances=new Set;_activeDragInstances=re([]);_globalListeners;_draggingPredicate=e=>e.isDragging();_domNodesToDirectives=null;pointerMove=new _;pointerUp=new _;constructor(){}registerDropContainer(e){this._dropInstances.has(e)||this._dropInstances.add(e)}registerDragItem(e){this._dragInstances.add(e),this._dragInstances.size===1&&this._ngZone.runOutsideAngular(()=>{this._cleanupDocumentTouchmove?.(),this._cleanupDocumentTouchmove=this._renderer.listen(this._document,"touchmove",this._persistentTouchmoveListener,we)})}removeDropContainer(e){this._dropInstances.delete(e)}removeDragItem(e){this._dragInstances.delete(e),this.stopDragging(e),this._dragInstances.size===0&&this._cleanupDocumentTouchmove?.()}startDragging(e,i){if(!(this._activeDragInstances().indexOf(e)>-1)&&(this._styleLoader.load(ri),this._activeDragInstances.update(n=>[...n,e]),this._activeDragInstances().length===1)){let n=i.type.startsWith("touch"),s=a=>this.pointerUp.next(a),r=[["scroll",a=>this._scroll.next(a),z],["selectstart",this._preventDefaultWhileDragging,we]];n?r.push(["touchend",s,z],["touchcancel",s,z]):r.push(["mouseup",s,z]),n||r.push(["mousemove",a=>this.pointerMove.next(a),we]),this._ngZone.runOutsideAngular(()=>{this._globalListeners=r.map(([a,l,d])=>this._renderer.listen(this._document,a,l,d))})}}stopDragging(e){this._activeDragInstances.update(i=>{let n=i.indexOf(e);return n>-1?(i.splice(n,1),[...i]):i}),this._activeDragInstances().length===0&&this._clearGlobalListeners()}isDragging(e){return this._activeDragInstances().indexOf(e)>-1}scrolled(e){let i=[this._scroll];return e&&e!==this._document&&i.push(new ne(n=>this._ngZone.runOutsideAngular(()=>{let s=this._renderer.listen(e,"scroll",r=>{this._activeDragInstances().length&&n.next(r)},z);return()=>{s()}}))),W(...i)}registerDirectiveNode(e,i){this._domNodesToDirectives??=new WeakMap,this._domNodesToDirectives.set(e,i)}removeDirectiveNode(e){this._domNodesToDirectives?.delete(e)}getDragDirectiveForNode(e){return this._domNodesToDirectives?.get(e)||null}ngOnDestroy(){this._dragInstances.forEach(e=>this.removeDragItem(e)),this._dropInstances.forEach(e=>this.removeDropContainer(e)),this._domNodesToDirectives=null,this._clearGlobalListeners(),this.pointerMove.complete(),this.pointerUp.complete()}_preventDefaultWhileDragging=e=>{this._activeDragInstances().length>0&&e.preventDefault()};_persistentTouchmoveListener=e=>{this._activeDragInstances().length>0&&(this._activeDragInstances().some(this._draggingPredicate)&&e.preventDefault(),this.pointerMove.next(e))};_clearGlobalListeners(){this._globalListeners?.forEach(e=>e()),this._globalListeners=void 0}static \u0275fac=function(i){return new(i||o)};static \u0275prov=$e({token:o,factory:o.\u0275fac,providedIn:"root"})}return o})();function Lt(o){let t=o.toLowerCase().indexOf("ms")>-1?1:1e3;return parseFloat(o)*t}function ai(o){let t=getComputedStyle(o),e=Se(t,"transition-property"),i=e.find(a=>a==="transform"||a==="all");if(!i)return 0;let n=e.indexOf(i),s=Se(t,"transition-duration"),r=Se(t,"transition-delay");return Lt(s[n])+Lt(r[n])}function Se(o,t){return o.getPropertyValue(t).split(",").map(i=>i.trim())}var li=new Set(["position"]),xe=class{_document;_rootElement;_direction;_initialDomRect;_previewTemplate;_previewClass;_pickupPositionOnPage;_initialTransform;_zIndex;_renderer;_previewEmbeddedView=null;_preview;get element(){return this._preview}constructor(t,e,i,n,s,r,a,l,d,h){this._document=t,this._rootElement=e,this._direction=i,this._initialDomRect=n,this._previewTemplate=s,this._previewClass=r,this._pickupPositionOnPage=a,this._initialTransform=l,this._zIndex=d,this._renderer=h}attach(t){this._preview=this._createPreview(),t.appendChild(this._preview),At(this._preview)&&this._preview.showPopover()}destroy(){this._preview.remove(),this._previewEmbeddedView?.destroy(),this._preview=this._previewEmbeddedView=null}setTransform(t){this._preview.style.transform=t}getBoundingClientRect(){return this._preview.getBoundingClientRect()}addClass(t){this._preview.classList.add(t)}getTransitionDuration(){return ai(this._preview)}addEventListener(t,e){return this._renderer.listen(this._preview,t,e)}_createPreview(){let t=this._previewTemplate,e=this._previewClass,i=t?t.template:null,n;if(i&&t){let s=t.matchSize?this._initialDomRect:null,r=t.viewContainer.createEmbeddedView(i,t.context);r.detectChanges(),n=Wt(r,this._document),this._previewEmbeddedView=r,t.matchSize?Mt(n,s):n.style.transform=$(this._pickupPositionOnPage.x,this._pickupPositionOnPage.y)}else n=Pe(this._rootElement),Mt(n,this._initialDomRect),this._initialTransform&&(n.style.transform=this._initialTransform);return ke(n.style,{"pointer-events":"none",margin:At(n)?"0 auto 0 0":"0",position:"fixed",top:"0",left:"0","z-index":this._zIndex+""},li),A(n,!1),n.classList.add("cdk-drag-preview"),n.setAttribute("popover","manual"),n.setAttribute("dir",this._direction),e&&(Array.isArray(e)?e.forEach(s=>n.classList.add(s)):n.classList.add(e)),n}};function At(o){return"showPopover"in o}var di={passive:!0},Nt={passive:!1},ci={passive:!1,capture:!0},hi=800,Ft="cdk-drag-placeholder",Ht=new Set(["position"]);function pi(o,t,e={dragStartThreshold:5,pointerDirectionChangeThreshold:5}){let i=o.get(Ze,null,{optional:!0})||o.get(de).createRenderer(null,null);return new Ee(t,e,o.get(U),o.get(F),o.get(De),o.get(Oe),i)}var Ee=class{_config;_document;_ngZone;_viewportRuler;_dragDropRegistry;_renderer;_rootElementCleanups;_cleanupShadowRootSelectStart;_preview=null;_previewContainer;_placeholderRef=null;_placeholder;_pickupPositionInElement;_pickupPositionOnPage;_marker;_anchor=null;_passiveTransform={x:0,y:0};_activeTransform={x:0,y:0};_initialTransform;_hasStartedDragging=re(!1);_hasMoved=!1;_initialContainer;_initialIndex;_parentPositions;_moveEvents=new _;_pointerDirectionDelta;_pointerPositionAtLastDirectionChange;_lastKnownPointerPosition;_rootElement;_ownerSVGElement=null;_rootElementTapHighlight;_pointerMoveSubscription=T.EMPTY;_pointerUpSubscription=T.EMPTY;_scrollSubscription=T.EMPTY;_resizeSubscription=T.EMPTY;_lastTouchEventTime;_dragStartTime;_boundaryElement=null;_nativeInteractionsEnabled=!0;_initialDomRect;_previewRect;_boundaryRect;_previewTemplate;_placeholderTemplate;_handles=[];_disabledHandles=new Set;_dropContainer;_direction="ltr";_parentDragRef=null;_cachedShadowRoot;lockAxis=null;dragStartDelay=0;previewClass;scale=1;get disabled(){return this._disabled||!!(this._dropContainer&&this._dropContainer.disabled)}set disabled(t){t!==this._disabled&&(this._disabled=t,this._toggleNativeDragInteractions(),this._handles.forEach(e=>A(e,t)))}_disabled=!1;beforeStarted=new _;started=new _;released=new _;ended=new _;entered=new _;exited=new _;dropped=new _;moved=this._moveEvents;data;constrainPosition;constructor(t,e,i,n,s,r,a){this._config=e,this._document=i,this._ngZone=n,this._viewportRuler=s,this._dragDropRegistry=r,this._renderer=a,this.withRootElement(t).withParent(e.parentDragRef||null),this._parentPositions=new X(i),r.registerDragItem(this)}getPlaceholderElement(){return this._placeholder}getRootElement(){return this._rootElement}getVisibleElement(){return this.isDragging()?this.getPlaceholderElement():this.getRootElement()}withHandles(t){this._handles=t.map(i=>C(i)),this._handles.forEach(i=>A(i,this.disabled)),this._toggleNativeDragInteractions();let e=new Set;return this._disabledHandles.forEach(i=>{this._handles.indexOf(i)>-1&&e.add(i)}),this._disabledHandles=e,this}withPreviewTemplate(t){return this._previewTemplate=t,this}withPlaceholderTemplate(t){return this._placeholderTemplate=t,this}withRootElement(t){let e=C(t);if(e!==this._rootElement){this._removeRootElementListeners();let i=this._renderer;this._rootElementCleanups=this._ngZone.runOutsideAngular(()=>[i.listen(e,"mousedown",this._pointerDown,Nt),i.listen(e,"touchstart",this._pointerDown,di),i.listen(e,"dragstart",this._nativeDragStart,Nt)]),this._initialTransform=void 0,this._rootElement=e}return typeof SVGElement<"u"&&this._rootElement instanceof SVGElement&&(this._ownerSVGElement=this._rootElement.ownerSVGElement),this}withBoundaryElement(t){return this._boundaryElement=t?C(t):null,this._resizeSubscription.unsubscribe(),t&&(this._resizeSubscription=this._viewportRuler.change(10).subscribe(()=>this._containInsideBoundaryOnResize())),this}withParent(t){return this._parentDragRef=t,this}dispose(){this._removeRootElementListeners(),this.isDragging()&&this._rootElement?.remove(),this._marker?.remove(),this._destroyPreview(),this._destroyPlaceholder(),this._dragDropRegistry.removeDragItem(this),this._removeListeners(),this.beforeStarted.complete(),this.started.complete(),this.released.complete(),this.ended.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this._moveEvents.complete(),this._handles=[],this._disabledHandles.clear(),this._dropContainer=void 0,this._resizeSubscription.unsubscribe(),this._parentPositions.clear(),this._boundaryElement=this._rootElement=this._ownerSVGElement=this._placeholderTemplate=this._previewTemplate=this._marker=this._parentDragRef=null}isDragging(){return this._hasStartedDragging()&&this._dragDropRegistry.isDragging(this)}reset(){this._rootElement.style.transform=this._initialTransform||"",this._activeTransform={x:0,y:0},this._passiveTransform={x:0,y:0}}resetToBoundary(){if(this._boundaryElement&&this._rootElement&&oi(this._boundaryElement.getBoundingClientRect(),this._rootElement.getBoundingClientRect())){let t=this._boundaryElement.getBoundingClientRect(),e=this._rootElement.getBoundingClientRect(),i=0,n=0;e.left<t.left?i=t.left-e.left:e.right>t.right&&(i=t.right-e.right),e.top<t.top?n=t.top-e.top:e.bottom>t.bottom&&(n=t.bottom-e.bottom);let s=this._activeTransform.x,r=this._activeTransform.y,a=s+i,l=r+n;this._rootElement.style.transform=$(a,l),this._activeTransform={x:a,y:l},this._passiveTransform={x:a,y:l}}}disableHandle(t){!this._disabledHandles.has(t)&&this._handles.indexOf(t)>-1&&(this._disabledHandles.add(t),A(t,!0))}enableHandle(t){this._disabledHandles.has(t)&&(this._disabledHandles.delete(t),A(t,this.disabled))}withDirection(t){return this._direction=t,this}_withDropContainer(t){this._dropContainer=t}getFreeDragPosition(){let t=this.isDragging()?this._activeTransform:this._passiveTransform;return{x:t.x,y:t.y}}setFreeDragPosition(t){return this._activeTransform={x:0,y:0},this._passiveTransform.x=t.x,this._passiveTransform.y=t.y,this._dropContainer||this._applyRootElementTransform(t.x,t.y),this}withPreviewContainer(t){return this._previewContainer=t,this}_sortFromLastPointerPosition(){let t=this._lastKnownPointerPosition;t&&this._dropContainer&&this._updateActiveDropContainer(this._getConstrainedPointerPosition(t),t)}_removeListeners(){this._pointerMoveSubscription.unsubscribe(),this._pointerUpSubscription.unsubscribe(),this._scrollSubscription.unsubscribe(),this._cleanupShadowRootSelectStart?.(),this._cleanupShadowRootSelectStart=void 0}_destroyPreview(){this._preview?.destroy(),this._preview=null}_destroyPlaceholder(){this._anchor?.remove(),this._placeholder?.remove(),this._placeholderRef?.destroy(),this._placeholder=this._anchor=this._placeholderRef=null}_pointerDown=t=>{if(this.beforeStarted.next(),this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&this._initializeDragSequence(e,t)}else this.disabled||this._initializeDragSequence(this._rootElement,t)};_pointerMove=t=>{let e=this._getPointerPositionOnPage(t);if(!this._hasStartedDragging()){let n=Math.abs(e.x-this._pickupPositionOnPage.x),s=Math.abs(e.y-this._pickupPositionOnPage.y);if(n+s>=this._config.dragStartThreshold){let a=Date.now()>=this._dragStartTime+this._getDragStartDelay(t),l=this._dropContainer;if(!a){this._endDragSequence(t);return}(!l||!l.isDragging()&&!l.isReceiving())&&(t.cancelable&&t.preventDefault(),this._hasStartedDragging.set(!0),this._ngZone.run(()=>this._startDragSequence(t)))}return}t.cancelable&&t.preventDefault();let i=this._getConstrainedPointerPosition(e);if(this._hasMoved=!0,this._lastKnownPointerPosition=e,this._updatePointerDirectionDelta(i),this._dropContainer)this._updateActiveDropContainer(i,e);else{let n=this.constrainPosition?this._initialDomRect:this._pickupPositionOnPage,s=this._activeTransform;s.x=i.x-n.x+this._passiveTransform.x,s.y=i.y-n.y+this._passiveTransform.y,this._applyRootElementTransform(s.x,s.y)}this._moveEvents.observers.length&&this._ngZone.run(()=>{this._moveEvents.next({source:this,pointerPosition:i,event:t,distance:this._getDragDistance(i),delta:this._pointerDirectionDelta})})};_pointerUp=t=>{this._endDragSequence(t)};_endDragSequence(t){if(this._dragDropRegistry.isDragging(this)&&(this._removeListeners(),this._dragDropRegistry.stopDragging(this),this._toggleNativeDragInteractions(),this._handles&&(this._rootElement.style.webkitTapHighlightColor=this._rootElementTapHighlight),!!this._hasStartedDragging()))if(this.released.next({source:this,event:t}),this._dropContainer)this._dropContainer._stopScrolling(),this._animatePreviewToPlaceholder().then(()=>{this._cleanupDragArtifacts(t),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)});else{this._passiveTransform.x=this._activeTransform.x;let e=this._getPointerPositionOnPage(t);this._passiveTransform.y=this._activeTransform.y,this._ngZone.run(()=>{this.ended.next({source:this,distance:this._getDragDistance(e),dropPoint:e,event:t})}),this._cleanupCachedDimensions(),this._dragDropRegistry.stopDragging(this)}}_startDragSequence(t){V(t)&&(this._lastTouchEventTime=Date.now()),this._toggleNativeDragInteractions();let e=this._getShadowRoot(),i=this._dropContainer;if(e&&this._ngZone.runOutsideAngular(()=>{this._cleanupShadowRootSelectStart=this._renderer.listen(e,"selectstart",_i,ci)}),i){let n=this._rootElement,s=n.parentNode,r=this._placeholder=this._createPlaceholderElement(),a=this._marker=this._marker||this._document.createComment("");s.insertBefore(a,n),this._initialTransform=n.style.transform||"",this._preview=new xe(this._document,this._rootElement,this._direction,this._initialDomRect,this._previewTemplate||null,this.previewClass||null,this._pickupPositionOnPage,this._initialTransform,this._config.zIndex||1e3,this._renderer),this._preview.attach(this._getPreviewInsertionPoint(s,e)),Ot(n,!1,Ht),this._document.body.appendChild(s.replaceChild(r,n)),this.started.next({source:this,event:t}),i.start(),this._initialContainer=i,this._initialIndex=i.getItemIndex(this)}else this.started.next({source:this,event:t}),this._initialContainer=this._initialIndex=void 0;this._parentPositions.cache(i?i.getScrollableParents():[])}_initializeDragSequence(t,e){this._parentDragRef&&e.stopPropagation();let i=this.isDragging(),n=V(e),s=!n&&e.button!==0,r=this._rootElement,a=B(e),l=!n&&this._lastTouchEventTime&&this._lastTouchEventTime+hi>Date.now(),d=n?it(e):tt(e);if(a&&a.draggable&&e.type==="mousedown"&&e.preventDefault(),i||s||l||d)return;if(this._handles.length){let E=r.style;this._rootElementTapHighlight=E.webkitTapHighlightColor||"",E.webkitTapHighlightColor="transparent"}this._hasMoved=!1,this._hasStartedDragging.set(this._hasMoved),this._removeListeners(),this._initialDomRect=this._rootElement.getBoundingClientRect(),this._pointerMoveSubscription=this._dragDropRegistry.pointerMove.subscribe(this._pointerMove),this._pointerUpSubscription=this._dragDropRegistry.pointerUp.subscribe(this._pointerUp),this._scrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(E=>this._updateOnScroll(E)),this._boundaryElement&&(this._boundaryRect=Te(this._boundaryElement));let h=this._previewTemplate;this._pickupPositionInElement=h&&h.template&&!h.matchSize?{x:0,y:0}:this._getPointerPositionInElement(this._initialDomRect,t,e);let v=this._pickupPositionOnPage=this._lastKnownPointerPosition=this._getPointerPositionOnPage(e);this._pointerDirectionDelta={x:0,y:0},this._pointerPositionAtLastDirectionChange={x:v.x,y:v.y},this._dragStartTime=Date.now(),this._dragDropRegistry.startDragging(this,e)}_cleanupDragArtifacts(t){Ot(this._rootElement,!0,Ht),this._marker.parentNode.replaceChild(this._rootElement,this._marker),this._destroyPreview(),this._destroyPlaceholder(),this._initialDomRect=this._boundaryRect=this._previewRect=this._initialTransform=void 0,this._ngZone.run(()=>{let e=this._dropContainer,i=e.getItemIndex(this),n=this._getPointerPositionOnPage(t),s=this._getDragDistance(n),r=e._isOverContainer(n.x,n.y);this.ended.next({source:this,distance:s,dropPoint:n,event:t}),this.dropped.next({item:this,currentIndex:i,previousIndex:this._initialIndex,container:e,previousContainer:this._initialContainer,isPointerOverContainer:r,distance:s,dropPoint:n,event:t}),e.drop(this,i,this._initialIndex,this._initialContainer,r,s,n,t),this._dropContainer=this._initialContainer})}_updateActiveDropContainer({x:t,y:e},{x:i,y:n}){let s=this._initialContainer._getSiblingContainerFromPosition(this,t,e);!s&&this._dropContainer!==this._initialContainer&&this._initialContainer._isOverContainer(t,e)&&(s=this._initialContainer),s&&s!==this._dropContainer&&this._ngZone.run(()=>{let r=this._dropContainer.getItemIndex(this),a=this._dropContainer.getItemAtIndex(r+1)?.getVisibleElement()||null;this.exited.next({item:this,container:this._dropContainer}),this._dropContainer.exit(this),this._conditionallyInsertAnchor(s,this._dropContainer,a),this._dropContainer=s,this._dropContainer.enter(this,t,e,s===this._initialContainer&&s.sortingDisabled?this._initialIndex:void 0),this.entered.next({item:this,container:s,currentIndex:s.getItemIndex(this)})}),this.isDragging()&&(this._dropContainer._startScrollingIfNecessary(i,n),this._dropContainer._sortItem(this,t,e,this._pointerDirectionDelta),this.constrainPosition?this._applyPreviewTransform(t,e):this._applyPreviewTransform(t-this._pickupPositionInElement.x,e-this._pickupPositionInElement.y))}_animatePreviewToPlaceholder(){if(!this._hasMoved)return Promise.resolve();let t=this._placeholder.getBoundingClientRect();this._preview.addClass("cdk-drag-animating"),this._applyPreviewTransform(t.left,t.top);let e=this._preview.getTransitionDuration();return e===0?Promise.resolve():this._ngZone.runOutsideAngular(()=>new Promise(i=>{let n=a=>{(!a||this._preview&&B(a)===this._preview.element&&a.propertyName==="transform")&&(r(),i(),clearTimeout(s))},s=setTimeout(n,e*1.5),r=this._preview.addEventListener("transitionend",n)}))}_createPlaceholderElement(){let t=this._placeholderTemplate,e=t?t.template:null,i;return e?(this._placeholderRef=t.viewContainer.createEmbeddedView(e,t.context),this._placeholderRef.detectChanges(),i=Wt(this._placeholderRef,this._document)):i=Pe(this._rootElement),i.style.pointerEvents="none",i.classList.add(Ft),i}_getPointerPositionInElement(t,e,i){let n=e===this._rootElement?null:e,s=n?n.getBoundingClientRect():t,r=V(i)?i.targetTouches[0]:i,a=this._getViewportScrollPosition(),l=r.pageX-s.left-a.left,d=r.pageY-s.top-a.top;return{x:s.left-t.left+l,y:s.top-t.top+d}}_getPointerPositionOnPage(t){let e=this._getViewportScrollPosition(),i=V(t)?t.touches[0]||t.changedTouches[0]||{pageX:0,pageY:0}:t,n=i.pageX-e.left,s=i.pageY-e.top;if(this._ownerSVGElement){let r=this._ownerSVGElement.getScreenCTM();if(r){let a=this._ownerSVGElement.createSVGPoint();return a.x=n,a.y=s,a.matrixTransform(r.inverse())}}return{x:n,y:s}}_getConstrainedPointerPosition(t){let e=this._dropContainer?this._dropContainer.lockAxis:null,{x:i,y:n}=this.constrainPosition?this.constrainPosition(t,this,this._initialDomRect,this._pickupPositionInElement):t;if(this.lockAxis==="x"||e==="x"?n=this._pickupPositionOnPage.y-(this.constrainPosition?this._pickupPositionInElement.y:0):(this.lockAxis==="y"||e==="y")&&(i=this._pickupPositionOnPage.x-(this.constrainPosition?this._pickupPositionInElement.x:0)),this._boundaryRect){let{x:s,y:r}=this.constrainPosition?{x:0,y:0}:this._pickupPositionInElement,a=this._boundaryRect,{width:l,height:d}=this._getPreviewRect(),h=a.top+r,v=a.bottom-(d-r),E=a.left+s,te=a.right-(l-s);i=Bt(i,E,te),n=Bt(n,h,v)}return{x:i,y:n}}_updatePointerDirectionDelta(t){let{x:e,y:i}=t,n=this._pointerDirectionDelta,s=this._pointerPositionAtLastDirectionChange,r=Math.abs(e-s.x),a=Math.abs(i-s.y);return r>this._config.pointerDirectionChangeThreshold&&(n.x=e>s.x?1:-1,s.x=e),a>this._config.pointerDirectionChangeThreshold&&(n.y=i>s.y?1:-1,s.y=i),n}_toggleNativeDragInteractions(){if(!this._rootElement||!this._handles)return;let t=this._handles.length>0||!this.isDragging();t!==this._nativeInteractionsEnabled&&(this._nativeInteractionsEnabled=t,A(this._rootElement,t))}_removeRootElementListeners(){this._rootElementCleanups?.forEach(t=>t()),this._rootElementCleanups=void 0}_applyRootElementTransform(t,e){let i=1/this.scale,n=$(t*i,e*i),s=this._rootElement.style;this._initialTransform==null&&(this._initialTransform=s.transform&&s.transform!="none"?s.transform:""),s.transform=J(n,this._initialTransform)}_applyPreviewTransform(t,e){let i=this._previewTemplate?.template?void 0:this._initialTransform,n=$(t,e);this._preview.setTransform(J(n,i))}_getDragDistance(t){let e=this._pickupPositionOnPage;return e?{x:t.x-e.x,y:t.y-e.y}:{x:0,y:0}}_cleanupCachedDimensions(){this._boundaryRect=this._previewRect=void 0,this._parentPositions.clear()}_containInsideBoundaryOnResize(){let{x:t,y:e}=this._passiveTransform;if(t===0&&e===0||this.isDragging()||!this._boundaryElement)return;let i=this._rootElement.getBoundingClientRect(),n=this._boundaryElement.getBoundingClientRect();if(n.width===0&&n.height===0||i.width===0&&i.height===0)return;let s=n.left-i.left,r=i.right-n.right,a=n.top-i.top,l=i.bottom-n.bottom;n.width>i.width?(s>0&&(t+=s),r>0&&(t-=r)):t=0,n.height>i.height?(a>0&&(e+=a),l>0&&(e-=l)):e=0,(t!==this._passiveTransform.x||e!==this._passiveTransform.y)&&this.setFreeDragPosition({y:e,x:t})}_getDragStartDelay(t){let e=this.dragStartDelay;return typeof e=="number"?e:V(t)?e.touch:e?e.mouse:0}_updateOnScroll(t){let e=this._parentPositions.handleScroll(t);if(e){let i=B(t);this._boundaryRect&&i!==this._boundaryElement&&i.contains(this._boundaryElement)&&G(this._boundaryRect,e.top,e.left),this._pickupPositionOnPage.x+=e.left,this._pickupPositionOnPage.y+=e.top,this._dropContainer||(this._activeTransform.x-=e.left,this._activeTransform.y-=e.top,this._applyRootElementTransform(this._activeTransform.x,this._activeTransform.y))}}_getViewportScrollPosition(){return this._parentPositions.positions.get(this._document)?.scrollPosition||this._parentPositions.getViewportScrollPosition()}_getShadowRoot(){return this._cachedShadowRoot===void 0&&(this._cachedShadowRoot=K(this._rootElement)),this._cachedShadowRoot}_getPreviewInsertionPoint(t,e){let i=this._previewContainer||"global";if(i==="parent")return t;if(i==="global"){let n=this._document;return e||n.fullscreenElement||n.webkitFullscreenElement||n.mozFullScreenElement||n.msFullscreenElement||n.body}return C(i)}_getPreviewRect(){return(!this._previewRect||!this._previewRect.width&&!this._previewRect.height)&&(this._previewRect=this._preview?this._preview.getBoundingClientRect():this._initialDomRect),this._previewRect}_nativeDragStart=t=>{if(this._handles.length){let e=this._getTargetHandle(t);e&&!this._disabledHandles.has(e)&&!this.disabled&&t.preventDefault()}else this.disabled||t.preventDefault()};_getTargetHandle(t){return this._handles.find(e=>t.target&&(t.target===e||e.contains(t.target)))}_conditionallyInsertAnchor(t,e,i){if(t===this._initialContainer)this._anchor?.remove(),this._anchor=null;else if(e===this._initialContainer&&e.hasAnchor){let n=this._anchor??=Pe(this._placeholder);n.classList.remove(Ft),n.classList.add("cdk-drag-anchor"),n.style.transform="",i?i.before(n):C(e.element).appendChild(n)}}};function Bt(o,t,e){return Math.max(t,Math.min(e,o))}function V(o){return o.type[0]==="t"}function _i(o){o.preventDefault()}function ee(o,t,e){let i=zt(t,o.length-1),n=zt(e,o.length-1);if(i===n)return;let s=o[i],r=n<i?-1:1;for(let a=i;a!==n;a+=r)o[a]=o[a+r];o[n]=s}function zt(o,t){return Math.max(0,Math.min(t,o))}var Q=class{_dragDropRegistry;_element;_sortPredicate;_itemPositions=[];_activeDraggables;orientation="vertical";direction="ltr";constructor(t){this._dragDropRegistry=t}_previousSwap={drag:null,delta:0,overlaps:!1};start(t){this.withItems(t)}sort(t,e,i,n){let s=this._itemPositions,r=this._getItemIndexFromPointerPosition(t,e,i,n);if(r===-1&&s.length>0)return null;let a=this.orientation==="horizontal",l=s.findIndex(D=>D.drag===t),d=s[r],h=s[l].clientRect,v=d.clientRect,E=l>r?1:-1,te=this._getItemOffsetPx(h,v,E),ti=this._getSiblingOffsetPx(l,s,E),ii=s.slice();return ee(s,l,r),s.forEach((D,ni)=>{if(ii[ni]===D)return;let Me=D.drag===t,ie=Me?te:ti,Le=Me?t.getPlaceholderElement():D.drag.getRootElement();D.offset+=ie;let Ae=Math.round(D.offset*(1/D.drag.scale));a?(Le.style.transform=J(`translate3d(${Ae}px, 0, 0)`,D.initialTransform),G(D.clientRect,0,ie)):(Le.style.transform=J(`translate3d(0, ${Ae}px, 0)`,D.initialTransform),G(D.clientRect,ie,0))}),this._previousSwap.overlaps=ye(v,e,i),this._previousSwap.drag=d.drag,this._previousSwap.delta=a?n.x:n.y,{previousIndex:l,currentIndex:r}}enter(t,e,i,n){let s=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n,r=this._activeDraggables,a=r.indexOf(t),l=t.getPlaceholderElement(),d=r[s];if(d===t&&(d=r[s+1]),!d&&(s==null||s===-1||s<r.length-1)&&this._shouldEnterAsFirstChild(e,i)&&(d=r[0]),a>-1&&r.splice(a,1),d&&!this._dragDropRegistry.isDragging(d)){let h=d.getRootElement();h.parentElement.insertBefore(l,h),r.splice(s,0,t)}else this._element.appendChild(l),r.push(t);l.style.transform="",this._cacheItemPositions()}withItems(t){this._activeDraggables=t.slice(),this._cacheItemPositions()}withSortPredicate(t){this._sortPredicate=t}reset(){this._activeDraggables?.forEach(t=>{let e=t.getRootElement();if(e){let i=this._itemPositions.find(n=>n.drag===t)?.initialTransform;e.style.transform=i||""}}),this._itemPositions=[],this._activeDraggables=[],this._previousSwap.drag=null,this._previousSwap.delta=0,this._previousSwap.overlaps=!1}getActiveItemsSnapshot(){return this._activeDraggables}getItemIndex(t){return this._getVisualItemPositions().findIndex(e=>e.drag===t)}getItemAtIndex(t){return this._getVisualItemPositions()[t]?.drag||null}updateOnScroll(t,e){this._itemPositions.forEach(({clientRect:i})=>{G(i,t,e)}),this._itemPositions.forEach(({drag:i})=>{this._dragDropRegistry.isDragging(i)&&i._sortFromLastPointerPosition()})}withElementContainer(t){this._element=t}_cacheItemPositions(){let t=this.orientation==="horizontal";this._itemPositions=this._activeDraggables.map(e=>{let i=e.getVisibleElement();return{drag:e,offset:0,initialTransform:i.style.transform||"",clientRect:Te(i)}}).sort((e,i)=>t?e.clientRect.left-i.clientRect.left:e.clientRect.top-i.clientRect.top)}_getVisualItemPositions(){return this.orientation==="horizontal"&&this.direction==="rtl"?this._itemPositions.slice().reverse():this._itemPositions}_getItemOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=n?e.left-t.left:e.top-t.top;return i===-1&&(s+=n?e.width-t.width:e.height-t.height),s}_getSiblingOffsetPx(t,e,i){let n=this.orientation==="horizontal",s=e[t].clientRect,r=e[t+i*-1],a=s[n?"width":"height"]*i;if(r){let l=n?"left":"top",d=n?"right":"bottom";i===-1?a-=r.clientRect[l]-s[d]:a+=s[l]-r.clientRect[d]}return a}_shouldEnterAsFirstChild(t,e){if(!this._activeDraggables.length)return!1;let i=this._itemPositions,n=this.orientation==="horizontal";if(i[0].drag!==this._activeDraggables[0]){let r=i[i.length-1].clientRect;return n?t>=r.right:e>=r.bottom}else{let r=i[0].clientRect;return n?t<=r.left:e<=r.top}}_getItemIndexFromPointerPosition(t,e,i,n){let s=this.orientation==="horizontal",r=this._itemPositions.findIndex(({drag:a,clientRect:l})=>{if(a===t)return!1;if(n){let d=s?n.x:n.y;if(a===this._previousSwap.drag&&this._previousSwap.overlaps&&d===this._previousSwap.delta)return!1}return s?e>=Math.floor(l.left)&&e<Math.floor(l.right):i>=Math.floor(l.top)&&i<Math.floor(l.bottom)});return r===-1||!this._sortPredicate(r,t)?-1:r}},Ce=class{_document;_dragDropRegistry;_element;_sortPredicate;_rootNode;_activeItems;_previousSwap={drag:null,deltaX:0,deltaY:0,overlaps:!1};_relatedNodes=[];constructor(t,e){this._document=t,this._dragDropRegistry=e}start(t){let e=this._element.childNodes;this._relatedNodes=[];for(let i=0;i<e.length;i++){let n=e[i];this._relatedNodes.push([n,n.nextSibling])}this.withItems(t)}sort(t,e,i,n){let s=this._getItemIndexFromPointerPosition(t,e,i),r=this._previousSwap;if(s===-1||this._activeItems[s]===t)return null;let a=this._activeItems[s];if(r.drag===a&&r.overlaps&&r.deltaX===n.x&&r.deltaY===n.y)return null;let l=this.getItemIndex(t),d=t.getPlaceholderElement(),h=a.getRootElement();s>l?h.after(d):h.before(d),ee(this._activeItems,l,s);let v=this._getRootNode().elementFromPoint(e,i);return r.deltaX=n.x,r.deltaY=n.y,r.drag=a,r.overlaps=h===v||h.contains(v),{previousIndex:l,currentIndex:s}}enter(t,e,i,n){let s=this._activeItems.indexOf(t);s>-1&&this._activeItems.splice(s,1);let r=n==null||n<0?this._getItemIndexFromPointerPosition(t,e,i):n;r===-1&&(r=this._getClosestItemIndexToPointer(t,e,i));let a=this._activeItems[r];a&&!this._dragDropRegistry.isDragging(a)?(this._activeItems.splice(r,0,t),a.getRootElement().before(t.getPlaceholderElement())):(this._activeItems.push(t),this._element.appendChild(t.getPlaceholderElement()))}withItems(t){this._activeItems=t.slice()}withSortPredicate(t){this._sortPredicate=t}reset(){let t=this._element,e=this._previousSwap;for(let i=this._relatedNodes.length-1;i>-1;i--){let[n,s]=this._relatedNodes[i];n.parentNode===t&&n.nextSibling!==s&&(s===null?t.appendChild(n):s.parentNode===t&&t.insertBefore(n,s))}this._relatedNodes=[],this._activeItems=[],e.drag=null,e.deltaX=e.deltaY=0,e.overlaps=!1}getActiveItemsSnapshot(){return this._activeItems}getItemIndex(t){return this._activeItems.indexOf(t)}getItemAtIndex(t){return this._activeItems[t]||null}updateOnScroll(){this._activeItems.forEach(t=>{this._dragDropRegistry.isDragging(t)&&t._sortFromLastPointerPosition()})}withElementContainer(t){t!==this._element&&(this._element=t,this._rootNode=void 0)}_getItemIndexFromPointerPosition(t,e,i){let n=this._getRootNode().elementFromPoint(Math.floor(e),Math.floor(i)),s=n?this._activeItems.findIndex(r=>{let a=r.getRootElement();return n===a||a.contains(n)}):-1;return s===-1||!this._sortPredicate(s,t)?-1:s}_getRootNode(){return this._rootNode||(this._rootNode=K(this._element)||this._document),this._rootNode}_getClosestItemIndexToPointer(t,e,i){if(this._activeItems.length===0)return-1;if(this._activeItems.length===1)return 0;let n=1/0,s=-1;for(let r=0;r<this._activeItems.length;r++){let a=this._activeItems[r];if(a!==t){let{x:l,y:d}=a.getRootElement().getBoundingClientRect(),h=Math.hypot(e-l,i-d);h<n&&(n=h,s=r)}}return s}},Vt=.05,Ut=.05,w=(function(o){return o[o.NONE=0]="NONE",o[o.UP=1]="UP",o[o.DOWN=2]="DOWN",o})(w||{}),u=(function(o){return o[o.NONE=0]="NONE",o[o.LEFT=1]="LEFT",o[o.RIGHT=2]="RIGHT",o})(u||{});function gi(o,t){return new Ie(t,o.get(Oe),o.get(U),o.get(F),o.get(De))}var Ie=class{_dragDropRegistry;_ngZone;_viewportRuler;element;disabled=!1;sortingDisabled=!1;lockAxis=null;autoScrollDisabled=!1;autoScrollStep=2;hasAnchor=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;beforeStarted=new _;entered=new _;exited=new _;dropped=new _;sorted=new _;receivingStarted=new _;receivingStopped=new _;data;_container;_isDragging=!1;_parentPositions;_sortStrategy;_domRect;_draggables=[];_siblings=[];_activeSiblings=new Set;_viewportScrollSubscription=T.EMPTY;_verticalScrollDirection=w.NONE;_horizontalScrollDirection=u.NONE;_scrollNode;_stopScrollTimers=new _;_cachedShadowRoot=null;_document;_scrollableElements=[];_initialScrollSnap;_direction="ltr";constructor(t,e,i,n,s){this._dragDropRegistry=e,this._ngZone=n,this._viewportRuler=s;let r=this.element=C(t);this._document=i,this.withOrientation("vertical").withElementContainer(r),e.registerDropContainer(this),this._parentPositions=new X(i)}dispose(){this._stopScrolling(),this._stopScrollTimers.complete(),this._viewportScrollSubscription.unsubscribe(),this.beforeStarted.complete(),this.entered.complete(),this.exited.complete(),this.dropped.complete(),this.sorted.complete(),this.receivingStarted.complete(),this.receivingStopped.complete(),this._activeSiblings.clear(),this._scrollNode=null,this._parentPositions.clear(),this._dragDropRegistry.removeDropContainer(this)}isDragging(){return this._isDragging}start(){this._draggingStarted(),this._notifyReceivingSiblings()}enter(t,e,i,n){this._draggingStarted(),n==null&&this.sortingDisabled&&(n=this._draggables.indexOf(t)),this._sortStrategy.enter(t,e,i,n),this._cacheParentPositions(),this._notifyReceivingSiblings(),this.entered.next({item:t,container:this,currentIndex:this.getItemIndex(t)})}exit(t){this._reset(),this.exited.next({item:t,container:this})}drop(t,e,i,n,s,r,a,l={}){this._reset(),this.dropped.next({item:t,currentIndex:e,previousIndex:i,container:this,previousContainer:n,isPointerOverContainer:s,distance:r,dropPoint:a,event:l})}withItems(t){let e=this._draggables;return this._draggables=t,t.forEach(i=>i._withDropContainer(this)),this.isDragging()&&(e.filter(n=>n.isDragging()).every(n=>t.indexOf(n)===-1)?this._reset():this._sortStrategy.withItems(this._draggables)),this}withDirection(t){return this._direction=t,this._sortStrategy instanceof Q&&(this._sortStrategy.direction=t),this}connectedTo(t){return this._siblings=t.slice(),this}withOrientation(t){if(t==="mixed")this._sortStrategy=new Ce(this._document,this._dragDropRegistry);else{let e=new Q(this._dragDropRegistry);e.direction=this._direction,e.orientation=t,this._sortStrategy=e}return this._sortStrategy.withElementContainer(this._container),this._sortStrategy.withSortPredicate((e,i)=>this.sortPredicate(e,i,this)),this}withScrollableParents(t){let e=this._container;return this._scrollableElements=t.indexOf(e)===-1?[e,...t]:t.slice(),this}withElementContainer(t){if(t===this._container)return this;let e=C(this.element),i=this._scrollableElements.indexOf(this._container),n=this._scrollableElements.indexOf(t);return i>-1&&this._scrollableElements.splice(i,1),n>-1&&this._scrollableElements.splice(n,1),this._sortStrategy&&this._sortStrategy.withElementContainer(t),this._cachedShadowRoot=null,this._scrollableElements.unshift(t),this._container=t,this}getScrollableParents(){return this._scrollableElements}getItemIndex(t){return this._isDragging?this._sortStrategy.getItemIndex(t):this._draggables.indexOf(t)}getItemAtIndex(t){return this._isDragging?this._sortStrategy.getItemAtIndex(t):this._draggables[t]||null}isReceiving(){return this._activeSiblings.size>0}_sortItem(t,e,i,n){if(this.sortingDisabled||!this._domRect||!kt(this._domRect,Vt,e,i))return;let s=this._sortStrategy.sort(t,e,i,n);s&&this.sorted.next({previousIndex:s.previousIndex,currentIndex:s.currentIndex,container:this,item:t})}_startScrollingIfNecessary(t,e){if(this.autoScrollDisabled)return;let i,n=w.NONE,s=u.NONE;if(this._parentPositions.positions.forEach((r,a)=>{a===this._document||!r.clientRect||i||kt(r.clientRect,Vt,t,e)&&([n,s]=mi(a,r.clientRect,this._direction,t,e),(n||s)&&(i=a))}),!n&&!s){let{width:r,height:a}=this._viewportRuler.getViewportSize(),l={width:r,height:a,top:0,right:r,bottom:a,left:0};n=Zt(l,e),s=jt(l,t),i=window}i&&(n!==this._verticalScrollDirection||s!==this._horizontalScrollDirection||i!==this._scrollNode)&&(this._verticalScrollDirection=n,this._horizontalScrollDirection=s,this._scrollNode=i,(n||s)&&i?this._ngZone.runOutsideAngular(this._startScrollInterval):this._stopScrolling())}_stopScrolling(){this._stopScrollTimers.next()}_draggingStarted(){let t=this._container.style;this.beforeStarted.next(),this._isDragging=!0,this._initialScrollSnap=t.msScrollSnapType||t.scrollSnapType||"",t.scrollSnapType=t.msScrollSnapType="none",this._sortStrategy.start(this._draggables),this._cacheParentPositions(),this._viewportScrollSubscription.unsubscribe(),this._listenToScrollEvents()}_cacheParentPositions(){this._parentPositions.cache(this._scrollableElements),this._domRect=this._parentPositions.positions.get(this._container).clientRect}_reset(){this._isDragging=!1;let t=this._container.style;t.scrollSnapType=t.msScrollSnapType=this._initialScrollSnap,this._siblings.forEach(e=>e._stopReceiving(this)),this._sortStrategy.reset(),this._stopScrolling(),this._viewportScrollSubscription.unsubscribe(),this._parentPositions.clear()}_startScrollInterval=()=>{this._stopScrolling(),Be(0,Fe).pipe(N(this._stopScrollTimers)).subscribe(()=>{let t=this._scrollNode,e=this.autoScrollStep;this._verticalScrollDirection===w.UP?t.scrollBy(0,-e):this._verticalScrollDirection===w.DOWN&&t.scrollBy(0,e),this._horizontalScrollDirection===u.LEFT?t.scrollBy(-e,0):this._horizontalScrollDirection===u.RIGHT&&t.scrollBy(e,0)})};_isOverContainer(t,e){return this._domRect!=null&&ye(this._domRect,t,e)}_getSiblingContainerFromPosition(t,e,i){return this._siblings.find(n=>n._canReceive(t,e,i))}_canReceive(t,e,i){if(!this._domRect||!ye(this._domRect,e,i)||!this.enterPredicate(t,this))return!1;let n=this._getShadowRoot().elementFromPoint(e,i);return n?n===this._container||this._container.contains(n):!1}_startReceiving(t,e){let i=this._activeSiblings;!i.has(t)&&e.every(n=>this.enterPredicate(n,this)||this._draggables.indexOf(n)>-1)&&(i.add(t),this._cacheParentPositions(),this._listenToScrollEvents(),this.receivingStarted.next({initiator:t,receiver:this,items:e}))}_stopReceiving(t){this._activeSiblings.delete(t),this._viewportScrollSubscription.unsubscribe(),this.receivingStopped.next({initiator:t,receiver:this})}_listenToScrollEvents(){this._viewportScrollSubscription=this._dragDropRegistry.scrolled(this._getShadowRoot()).subscribe(t=>{if(this.isDragging()){let e=this._parentPositions.handleScroll(t);e&&this._sortStrategy.updateOnScroll(e.top,e.left)}else this.isReceiving()&&this._cacheParentPositions()})}_getShadowRoot(){if(!this._cachedShadowRoot){let t=K(this._container);this._cachedShadowRoot=t||this._document}return this._cachedShadowRoot}_notifyReceivingSiblings(){let t=this._sortStrategy.getActiveItemsSnapshot().filter(e=>e.isDragging());this._siblings.forEach(e=>e._startReceiving(this,t))}};function Zt(o,t){let{top:e,bottom:i,height:n}=o,s=n*Ut;return t>=e-s&&t<=e+s?w.UP:t>=i-s&&t<=i+s?w.DOWN:w.NONE}function jt(o,t){let{left:e,right:i,width:n}=o,s=n*Ut;return t>=e-s&&t<=e+s?u.LEFT:t>=i-s&&t<=i+s?u.RIGHT:u.NONE}function mi(o,t,e,i,n){let s=Zt(t,n),r=jt(t,i),a=w.NONE,l=u.NONE;if(s){let d=o.scrollTop;s===w.UP?d>0&&(a=w.UP):o.scrollHeight-d>o.clientHeight&&(a=w.DOWN)}if(r){let d=o.scrollLeft;e==="rtl"?r===u.RIGHT?d<0&&(l=u.RIGHT):o.scrollWidth+d>o.clientWidth&&(l=u.LEFT):r===u.LEFT?d>0&&(l=u.LEFT):o.scrollWidth-d>o.clientWidth&&(l=u.RIGHT)}return[a,l]}var Gt=new k("CDK_DRAG_PARENT");var ui=new k("CdkDragHandle");var qt=new k("CDK_DRAG_CONFIG"),Kt=new k("CdkDropList"),Yt=(()=>{class o{element=c(ae);dropContainer=c(Kt,{optional:!0,skipSelf:!0});_ngZone=c(F);_viewContainerRef=c(je);_dir=c(ve,{optional:!0});_changeDetectorRef=c(me);_selfHandle=c(ui,{optional:!0,self:!0});_parentDrag=c(Gt,{optional:!0,skipSelf:!0});_dragDropRegistry=c(Oe);_destroyed=new _;_handles=new Ne([]);_previewTemplate=null;_placeholderTemplate=null;_dragRef;data;lockAxis=null;rootElementSelector;boundaryElement;dragStartDelay;freeDragPosition;get disabled(){return this._disabled||!!(this.dropContainer&&this.dropContainer.disabled)}set disabled(e){this._disabled=e,this._dragRef.disabled=this._disabled}_disabled=!1;constrainPosition;previewClass;previewContainer;scale=1;started=new S;released=new S;ended=new S;entered=new S;exited=new S;dropped=new S;moved=new ne(e=>{let i=this._dragRef.moved.pipe(He(n=>({source:this,pointerPosition:n.pointerPosition,event:n.event,delta:n.delta,distance:n.distance}))).subscribe(e);return()=>{i.unsubscribe()}});_injector=c(oe);constructor(){let e=this.dropContainer,i=c(qt,{optional:!0});this._dragRef=pi(this._injector,this.element,{dragStartThreshold:i&&i.dragStartThreshold!=null?i.dragStartThreshold:5,pointerDirectionChangeThreshold:i&&i.pointerDirectionChangeThreshold!=null?i.pointerDirectionChangeThreshold:5,zIndex:i?.zIndex}),this._dragRef.data=this,this._dragDropRegistry.registerDirectiveNode(this.element.nativeElement,this),i&&this._assignDefaults(i),e&&(e.addItem(this),e._dropListRef.beforeStarted.pipe(N(this._destroyed)).subscribe(()=>{this._dragRef.scale=this.scale})),this._syncInputs(this._dragRef),this._handleEvents(this._dragRef)}getPlaceholderElement(){return this._dragRef.getPlaceholderElement()}getRootElement(){return this._dragRef.getRootElement()}reset(){this._dragRef.reset()}resetToBoundary(){this._dragRef.resetToBoundary()}getFreeDragPosition(){return this._dragRef.getFreeDragPosition()}setFreeDragPosition(e){this._dragRef.setFreeDragPosition(e)}ngAfterViewInit(){Ue(()=>{this._updateRootElement(),this._setupHandlesListener(),this._dragRef.scale=this.scale,this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)},{injector:this._injector})}ngOnChanges(e){let i=e.rootElementSelector,n=e.freeDragPosition;i&&!i.firstChange&&this._updateRootElement(),this._dragRef.scale=this.scale,n&&!n.firstChange&&this.freeDragPosition&&this._dragRef.setFreeDragPosition(this.freeDragPosition)}ngOnDestroy(){this.dropContainer&&this.dropContainer.removeItem(this),this._dragDropRegistry.removeDirectiveNode(this.element.nativeElement),this._ngZone.runOutsideAngular(()=>{this._handles.complete(),this._destroyed.next(),this._destroyed.complete(),this._dragRef.dispose()})}_addHandle(e){let i=this._handles.getValue();i.push(e),this._handles.next(i)}_removeHandle(e){let i=this._handles.getValue(),n=i.indexOf(e);n>-1&&(i.splice(n,1),this._handles.next(i))}_setPreviewTemplate(e){this._previewTemplate=e}_resetPreviewTemplate(e){e===this._previewTemplate&&(this._previewTemplate=null)}_setPlaceholderTemplate(e){this._placeholderTemplate=e}_resetPlaceholderTemplate(e){e===this._placeholderTemplate&&(this._placeholderTemplate=null)}_updateRootElement(){let e=this.element.nativeElement,i=e;this.rootElementSelector&&(i=e.closest!==void 0?e.closest(this.rootElementSelector):e.parentElement?.closest(this.rootElementSelector)),this._dragRef.withRootElement(i||e)}_getBoundaryElement(){let e=this.boundaryElement;return e?typeof e=="string"?this.element.nativeElement.closest(e):C(e):null}_syncInputs(e){e.beforeStarted.subscribe(()=>{if(!e.isDragging()){let i=this._dir,n=this.dragStartDelay,s=this._placeholderTemplate?{template:this._placeholderTemplate.templateRef,context:this._placeholderTemplate.data,viewContainer:this._viewContainerRef}:null,r=this._previewTemplate?{template:this._previewTemplate.templateRef,context:this._previewTemplate.data,matchSize:this._previewTemplate.matchSize,viewContainer:this._viewContainerRef}:null;e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.scale=this.scale,e.dragStartDelay=typeof n=="object"&&n?n:ue(n),e.constrainPosition=this.constrainPosition,e.previewClass=this.previewClass,e.withBoundaryElement(this._getBoundaryElement()).withPlaceholderTemplate(s).withPreviewTemplate(r).withPreviewContainer(this.previewContainer||"global"),i&&e.withDirection(i.value)}}),e.beforeStarted.pipe(ze(1)).subscribe(()=>{if(this._parentDrag){e.withParent(this._parentDrag._dragRef);return}let i=this.element.nativeElement.parentElement;for(;i;){let n=this._dragDropRegistry.getDragDirectiveForNode(i);if(n){e.withParent(n._dragRef);break}i=i.parentElement}})}_handleEvents(e){e.started.subscribe(i=>{this.started.emit({source:this,event:i.event}),this._changeDetectorRef.markForCheck()}),e.released.subscribe(i=>{this.released.emit({source:this,event:i.event})}),e.ended.subscribe(i=>{this.ended.emit({source:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:i.container.data,item:this,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:i.container.data,item:this})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,isPointerOverContainer:i.isPointerOverContainer,item:this,distance:i.distance,dropPoint:i.dropPoint,event:i.event})})}_assignDefaults(e){let{lockAxis:i,dragStartDelay:n,constrainPosition:s,previewClass:r,boundaryElement:a,draggingDisabled:l,rootElementSelector:d,previewContainer:h}=e;this.disabled=l??!1,this.dragStartDelay=n||0,this.lockAxis=i||null,s&&(this.constrainPosition=s),r&&(this.previewClass=r),a&&(this.boundaryElement=a),d&&(this.rootElementSelector=d),h&&(this.previewContainer=h)}_setupHandlesListener(){this._handles.pipe(Ge(e=>{let i=e.map(n=>n.element);this._selfHandle&&this.rootElementSelector&&i.push(this.element),this._dragRef.withHandles(i)}),Ve(e=>W(...e.map(i=>i._stateChanges.pipe(se(i))))),N(this._destroyed)).subscribe(e=>{let i=this._dragRef,n=e.element.nativeElement;e.disabled?i.disableHandle(n):i.enableHandle(n)})}static \u0275fac=function(i){return new(i||o)};static \u0275dir=ce({type:o,selectors:[["","cdkDrag",""]],hostAttrs:[1,"cdk-drag"],hostVars:4,hostBindings:function(i,n){i&2&&he("cdk-drag-disabled",n.disabled)("cdk-drag-dragging",n._dragRef.isDragging())},inputs:{data:[0,"cdkDragData","data"],lockAxis:[0,"cdkDragLockAxis","lockAxis"],rootElementSelector:[0,"cdkDragRootElement","rootElementSelector"],boundaryElement:[0,"cdkDragBoundary","boundaryElement"],dragStartDelay:[0,"cdkDragStartDelay","dragStartDelay"],freeDragPosition:[0,"cdkDragFreeDragPosition","freeDragPosition"],disabled:[2,"cdkDragDisabled","disabled",O],constrainPosition:[0,"cdkDragConstrainPosition","constrainPosition"],previewClass:[0,"cdkDragPreviewClass","previewClass"],previewContainer:[0,"cdkDragPreviewContainer","previewContainer"],scale:[2,"cdkDragScale","scale",Qe]},outputs:{started:"cdkDragStarted",released:"cdkDragReleased",ended:"cdkDragEnded",entered:"cdkDragEntered",exited:"cdkDragExited",dropped:"cdkDragDropped",moved:"cdkDragMoved"},exportAs:["cdkDrag"],features:[_e([{provide:Gt,useExisting:o}]),We]})}return o})(),$t=new k("CdkDropListGroup");var Xt=(()=>{class o{element=c(ae);_changeDetectorRef=c(me);_scrollDispatcher=c(pt);_dir=c(ve,{optional:!0});_group=c($t,{optional:!0,skipSelf:!0});_latestSortedRefs;_destroyed=new _;_scrollableParentsResolved=!1;static _dropLists=[];_dropListRef;connectedTo=[];data;orientation="vertical";id=c(at).getId("cdk-drop-list-");lockAxis=null;get disabled(){return this._disabled||!!this._group&&this._group.disabled}set disabled(e){this._dropListRef.disabled=this._disabled=e}_disabled=!1;sortingDisabled=!1;enterPredicate=()=>!0;sortPredicate=()=>!0;autoScrollDisabled=!1;autoScrollStep;elementContainerSelector=null;hasAnchor=!1;dropped=new S;entered=new S;exited=new S;sorted=new S;_unsortedItems=new Set;constructor(){let e=c(qt,{optional:!0}),i=c(oe);this._dropListRef=gi(i,this.element),this._dropListRef.data=this,e&&this._assignDefaults(e),this._dropListRef.enterPredicate=(n,s)=>this.enterPredicate(n.data,s.data),this._dropListRef.sortPredicate=(n,s,r)=>this.sortPredicate(n,s.data,r.data),this._setupInputSyncSubscription(this._dropListRef),this._handleEvents(this._dropListRef),o._dropLists.push(this),this._group&&this._group._items.add(this)}addItem(e){this._unsortedItems.add(e),e._dragRef._withDropContainer(this._dropListRef),this._dropListRef.isDragging()&&this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef))}removeItem(e){if(this._unsortedItems.delete(e),this._latestSortedRefs){let i=this._latestSortedRefs.indexOf(e._dragRef);i>-1&&(this._latestSortedRefs.splice(i,1),this._syncItemsWithRef(this._latestSortedRefs))}}getSortedItems(){return Array.from(this._unsortedItems).sort((e,i)=>e._dragRef.getVisibleElement().compareDocumentPosition(i._dragRef.getVisibleElement())&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}ngOnDestroy(){let e=o._dropLists.indexOf(this);e>-1&&o._dropLists.splice(e,1),this._group&&this._group._items.delete(this),this._latestSortedRefs=void 0,this._unsortedItems.clear(),this._dropListRef.dispose(),this._destroyed.next(),this._destroyed.complete()}_setupInputSyncSubscription(e){this._dir&&this._dir.change.pipe(se(this._dir.value),N(this._destroyed)).subscribe(i=>e.withDirection(i)),e.beforeStarted.subscribe(()=>{let i=st(this.connectedTo).map(n=>{if(typeof n=="string"){let s=o._dropLists.find(r=>r.id===n);return s}return n});if(this._group&&this._group._items.forEach(n=>{i.indexOf(n)===-1&&i.push(n)}),!this._scrollableParentsResolved){let n=this._scrollDispatcher.getAncestorScrollContainers(this.element).map(s=>s.getElementRef().nativeElement);this._dropListRef.withScrollableParents(n),this._scrollableParentsResolved=!0}if(this.elementContainerSelector){let n=this.element.nativeElement.querySelector(this.elementContainerSelector);e.withElementContainer(n)}e.disabled=this.disabled,e.lockAxis=this.lockAxis,e.sortingDisabled=this.sortingDisabled,e.autoScrollDisabled=this.autoScrollDisabled,e.autoScrollStep=ue(this.autoScrollStep,2),e.hasAnchor=this.hasAnchor,e.connectedTo(i.filter(n=>n&&n!==this).map(n=>n._dropListRef)).withOrientation(this.orientation)})}_handleEvents(e){e.beforeStarted.subscribe(()=>{this._syncItemsWithRef(this.getSortedItems().map(i=>i._dragRef)),this._changeDetectorRef.markForCheck()}),e.entered.subscribe(i=>{this.entered.emit({container:this,item:i.item.data,currentIndex:i.currentIndex})}),e.exited.subscribe(i=>{this.exited.emit({container:this,item:i.item.data}),this._changeDetectorRef.markForCheck()}),e.sorted.subscribe(i=>{this.sorted.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,container:this,item:i.item.data})}),e.dropped.subscribe(i=>{this.dropped.emit({previousIndex:i.previousIndex,currentIndex:i.currentIndex,previousContainer:i.previousContainer.data,container:i.container.data,item:i.item.data,isPointerOverContainer:i.isPointerOverContainer,distance:i.distance,dropPoint:i.dropPoint,event:i.event}),this._changeDetectorRef.markForCheck()}),W(e.receivingStarted,e.receivingStopped).subscribe(()=>this._changeDetectorRef.markForCheck())}_assignDefaults(e){let{lockAxis:i,draggingDisabled:n,sortingDisabled:s,listAutoScrollDisabled:r,listOrientation:a}=e;this.disabled=n??!1,this.sortingDisabled=s??!1,this.autoScrollDisabled=r??!1,this.orientation=a||"vertical",this.lockAxis=i||null}_syncItemsWithRef(e){this._latestSortedRefs=e,this._dropListRef.withItems(e)}static \u0275fac=function(i){return new(i||o)};static \u0275dir=ce({type:o,selectors:[["","cdkDropList",""],["cdk-drop-list"]],hostAttrs:[1,"cdk-drop-list"],hostVars:7,hostBindings:function(i,n){i&2&&(Z("id",n.id),he("cdk-drop-list-disabled",n.disabled)("cdk-drop-list-dragging",n._dropListRef.isDragging())("cdk-drop-list-receiving",n._dropListRef.isReceiving()))},inputs:{connectedTo:[0,"cdkDropListConnectedTo","connectedTo"],data:[0,"cdkDropListData","data"],orientation:[0,"cdkDropListOrientation","orientation"],id:"id",lockAxis:[0,"cdkDropListLockAxis","lockAxis"],disabled:[2,"cdkDropListDisabled","disabled",O],sortingDisabled:[2,"cdkDropListSortingDisabled","sortingDisabled",O],enterPredicate:[0,"cdkDropListEnterPredicate","enterPredicate"],sortPredicate:[0,"cdkDropListSortPredicate","sortPredicate"],autoScrollDisabled:[2,"cdkDropListAutoScrollDisabled","autoScrollDisabled",O],autoScrollStep:[0,"cdkDropListAutoScrollStep","autoScrollStep"],elementContainerSelector:[0,"cdkDropListElementContainer","elementContainerSelector"],hasAnchor:[2,"cdkDropListHasAnchor","hasAnchor",O]},outputs:{dropped:"cdkDropListDropped",entered:"cdkDropListEntered",exited:"cdkDropListExited",sorted:"cdkDropListSorted"},exportAs:["cdkDropList"],features:[_e([{provide:$t,useValue:void 0},{provide:Kt,useExisting:o}])]})}return o})();function fi(o,t){if(o&1){let e=q();p(0,"button",0),m("click",function(){y(e);let n=P();return x(n.clickAction("cancel"))}),p(1,"mat-icon",1),f(2,"close"),g(),p(3,"span"),f(4,"Close"),g()()}}var Qt=(()=>{class o{_bottomSheetRef=c(Dt);data=c(vt);showCancel=!!(this.data&&this.data.showCancel);clickAction(e){this._bottomSheetRef.dismiss(e)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["dashboards-bottom-sheet"]],decls:12,vars:1,consts:[["mat-list-item","",3,"click"],["matListItemIcon",""],["mat-list-item",""]],template:function(i,n){i&1&&(p(0,"mat-action-list")(1,"button",0),m("click",function(){return n.clickAction("duplicate")}),p(2,"mat-icon",1),f(3,"content_copy"),g(),p(4,"span"),f(5,"Duplicate"),g()(),p(6,"button",0),m("click",function(){return n.clickAction("delete")}),p(7,"mat-icon",1),f(8,"delete_forever"),g(),p(9,"span"),f(10,"Delete"),g()(),qe(11,fi,5,0,"button",2),g()),i&2&&(b(11),Ke(n.showCancel?11:-1))},dependencies:[Et,yt,xt,Pt,L,M],encapsulation:2})}return o})();var Di=(o,t)=>t.id;function bi(o,t){if(o&1){let e=q();p(0,"div",5),m("cdkDragStarted",function(){y(e);let n=P();return x(n.dragStart())})("cdkDragMoved",function(n){y(e);let s=P();return x(s.onDragMoved(n))})("cdkDragEnded",function(){y(e);let n=P();return x(n.dragEnd())})("press",function(){let n=y(e).$index,s=P();return x(s.onPress(n))})("doubletap",function(){let n=y(e).$index,s=P();return x(s.editDashboard(n))})("keydown.enter",function(){let n=y(e).$index,s=P();return x(s.editDashboard(n))})("keydown.space",function(){let n=y(e).$index,s=P();return x(s.onPress(n))}),p(1,"div",6),f(2),g(),p(3,"div"),j(4,"mat-icon",7),g(),p(5,"p",8),f(6),g()()}if(o&2){let e=t.$implicit,i=t.$index,n=P();R("mode","editor")("disableGestures",n._sheetOpen||n.suppressDrag)("cdkDragDisabled",n._sheetOpen||n.suppressDrag),Z("aria-label",e.name),b(2),pe(i+1),b(2),Je("width",72,"px")("height",72,"px"),R("svgIcon",e.icon||"dashboard"),b(2),pe(e.name)}}var ei=(()=>{class o{pageTitle="Dashboards";_bottomSheet=c(bt);_dashboard=c(gt);_uiEvent=c(St);_dialog=c(ft);_sanitizer=c(rt);_sheetOpen=!1;suppressDrag=!1;_dragActive=!1;_dragMoved=!1;_dragSuppressThresholdPx=4;addDashboard(){this._dialog.openDashboardPageEditorDialog({title:"New Dashboard",name:`Dashboard ${this._dashboard.dashboards().length+1}`,icon:"dashboard-dashboard",confirmBtnText:"Create",cancelBtnText:"Cancel"}).afterClosed().subscribe(e=>{e&&this._dashboard.add(e.name,[],e.icon,e.collapseSplitShell)})}openBottomSheet(e){if(this._sheetOpen)return;this._sheetOpen=!0;let i=typeof navigator<"u"&&/Linux/.test(navigator.platform)&&/Firefox/.test(navigator.userAgent);this._bottomSheet.open(Qt,i?{disableClose:!0,data:{showCancel:!0}}:{}).afterDismissed().subscribe(s=>{switch(this._sheetOpen=!1,s){case"delete":this.deleteDashboard(e);break;case"duplicate":this.duplicateDashboard(e,`${this._dashboard.dashboards()[e].name}`);break;default:break}})}editDashboard(e){let i=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Dashboard Options",name:i.name,icon:i.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:i.collapseSplitShell??!1}).afterClosed().subscribe(n=>{n&&this._dashboard.update(e,n.name,n.icon,n.collapseSplitShell)})}deleteDashboard(e){this._dashboard.delete(e)}duplicateDashboard(e,i){let n=this._dashboard.dashboards()[e];this._dialog.openDashboardPageEditorDialog({title:"Duplicate Dashboard",name:`${i} copy`,icon:n.icon||"dashboard-dashboard",confirmBtnText:"Save",cancelBtnText:"Cancel",collapseSplitShell:n.collapseSplitShell??!1}).afterClosed().subscribe(s=>{s&&this._dashboard.duplicate(e,s.name,s.icon,s.collapseSplitShell)})}drop(e){this._dashboard.dashboards.update(i=>{let n=[...i];ee(n,e.previousIndex,e.currentIndex);let s=this._dashboard.activeDashboard();return s===e.previousIndex?this._dashboard.activeDashboard.set(e.currentIndex):s>e.previousIndex&&s<=e.currentIndex?this._dashboard.activeDashboard.set(s-1):s<e.previousIndex&&s>=e.currentIndex&&this._dashboard.activeDashboard.set(s+1),n})}dragStart(){this._sheetOpen||this.suppressDrag||(this._uiEvent.isDragging.set(!0),this._dragActive=!0,this._dragMoved=!1)}dragEnd(){this._uiEvent.isDragging.set(!1),this._dragActive=!1,setTimeout(()=>{this._dragMoved=!1},60)}onDragMoved(e){if(!this._dragActive||this._dragMoved)return;Math.hypot(e.distance.x,e.distance.y)>this._dragSuppressThresholdPx&&(this._dragMoved=!0)}onPress(e){this._sheetOpen||this._dragMoved||(this.cancelPointerSequence(),this.openBottomSheet(e))}cancelPointerSequence(){this.suppressDrag=!0,this._dragActive=!1,this._dragMoved=!1,["pointerup","mouseup","touchend"].forEach(e=>{document.dispatchEvent(new Event(e,{bubbles:!0}))})}onPointerRelease(){this._sheetOpen||(this.suppressDrag=!1)}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["dashboards-editor"]],hostBindings:function(i,n){i&1&&m("mouseup",function(){return n.onPointerRelease()},le)("touchend",function(){return n.onPointerRelease()},le)},decls:10,vars:0,consts:[["cdkDropList","","cdkDropListOrientation","mixed",1,"dashboard-manage",3,"cdkDropListDropped"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"mode","disableGestures","cdkDragDisabled"],["tabindex","0",1,"dashboard-card","dashboard-item-add","dashboard-add-btn",3,"click","keydown"],["mat-fab",""],[2,"margin-top","10px"],["kipGestures","","matRipple","","cdkDrag","","cdkDragBoundary",".dashboard-manage","tabindex","0",1,"dashboard-card","dashboard-item",3,"cdkDragStarted","cdkDragMoved","cdkDragEnded","press","doubletap","keydown.enter","keydown.space","mode","disableGestures","cdkDragDisabled"],[1,"item-index"],["aria-hidden","false",1,"dashboard-icon",3,"svgIcon"],[1,"dashboard-name"]],template:function(i,n){i&1&&(p(0,"div",0),m("cdkDropListDropped",function(r){return n.drop(r)}),Ye(1,bi,7,11,"div",1,Di),p(3,"div",2),m("click",function(){return n.addDashboard()})("keydown",function(){return n.addDashboard()}),p(4,"button",3)(5,"mat-icon"),f(6,"add_box"),g()(),p(7,"p",4)(8,"i"),f(9,"Add Dashboard"),g()()()()),i&2&&(b(),Xe(n._dashboard.dashboards()))},dependencies:[wt,Y,ht,L,M,Xt,Yt,ct,lt,et],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%;overflow-y:auto;scroll-behavior:smooth}.dashboard-manage[_ngcontent-%COMP%]{box-sizing:border-box;padding:0 60px;width:100%;height:100%;display:flex;flex-wrap:wrap;align-items:flex-start;justify-content:space-around;overflow-y:auto;scroll-behavior:smooth}.dashboard-card[_ngcontent-%COMP%]{position:relative;height:200px;width:300px;margin:10px;border-radius:15px;padding:10px;align-content:center;text-align:center;border:2px solid transparent}@media(max-width:600px)and (orientation:portrait){.dashboard-manage[_ngcontent-%COMP%]{padding:0 70px}.dashboard-card[_ngcontent-%COMP%]{height:175px}}.dashboard-item[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container-highest);cursor:pointer}.dashboard-item[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-item-add[_ngcontent-%COMP%]{background-color:var(--mat-sys-surface-container);cursor:pointer}.dashboard-item-add[_ngcontent-%COMP%]:hover{border:2px solid var(--mat-sys-outline)}.dashboard-add-btn[_ngcontent-%COMP%]{align-content:center;text-align:center;border:dashed 1px var(--mat-sys-outline)}.item-index[_ngcontent-%COMP%]{position:absolute;top:20px;left:20px;display:inline-flex;flex-wrap:wrap;height:42px;width:42px;background-color:var(--kip-contrast-dim-color);color:var(--mat-sys-surface-bright);border-radius:25%;align-content:center;align-items:center;justify-content:center;font-weight:700;font-size:1.25em;z-index:1}.dashboard-icon[_ngcontent-%COMP%]{opacity:.5}.dashboard-name[_ngcontent-%COMP%]{margin-top:10px;margin-bottom:0;font-size:1.1em}.cdk-drag-preview[_ngcontent-%COMP%]{box-sizing:border-box;border-radius:4px;box-shadow:0 5px 5px -3px var(--mat-sys-on-primary-container),0 8px 10px 1px var(--mat-sys-on-primary-container),0 3px 14px 2px var(--mat-sys-on-primary-container)}.cdk-drag-placeholder[_ngcontent-%COMP%]{opacity:0}.cdk-drag-animating[_ngcontent-%COMP%]{transition:transform .25s cubic-bezier(0,0,.2,1)}"]})}return o})();var xn=(()=>{class o{_router=c(_t);app=c(ut);_responsive=c(ot);_isPhonePortrait=be(this._responsive.observe(fe.HandsetPortrait));_isPhoneLandscape=be(this._responsive.observe(fe.HandsetLandscape));isPhonePortrait=ge(()=>this._isPhonePortrait().matches);isPhoneLandscape=ge(()=>this._isPhoneLandscape().matches);closePage(){this._router.navigate(["/dashboard"])}onActionItem(e){switch(e){case"help":this._router.navigate(["/help"]);break;case"datainspector":this._router.navigate(["/data"]);break;case"remotecontrol":this._router.navigate(["/remote"]);break;case"options":this._router.navigate(["/options"]);break;default:break}}static \u0275fac=function(i){return new(i||o)};static \u0275cmp=I({type:o,selectors:[["settings"]],decls:11,vars:20,consts:[[1,"home-container"],[1,"actions-header-container"],[1,"actions-buttons-container"],["svgIcon","settings","label","Options",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","troubleshoot","label","Data Inspector",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","remote-control","label","Remote Control",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["svgIcon","help-center","label","Help",3,"click","keydown.enter","keydown.space","iconOnly","compact","iconSize"],["mat-icon-button","",1,"dialog-close-icon",3,"click"],[1,"dashboards-editor"]],template:function(i,n){i&1&&(p(0,"div",0)(1,"div",1)(2,"div",2)(3,"tile-large-icon",3),m("click",function(){return n.onActionItem("options")})("keydown.enter",function(){return n.onActionItem("options")})("keydown.space",function(){return n.onActionItem("options")}),g(),p(4,"tile-large-icon",4),m("click",function(){return n.onActionItem("datainspector")})("keydown.enter",function(){return n.onActionItem("datainspector")})("keydown.space",function(){return n.onActionItem("datainspector")}),g(),p(5,"tile-large-icon",5),m("click",function(){return n.onActionItem("remotecontrol")})("keydown.enter",function(){return n.onActionItem("remotecontrol")})("keydown.space",function(){return n.onActionItem("remotecontrol")}),g(),p(6,"tile-large-icon",6),m("click",function(){return n.onActionItem("help")})("keydown.enter",function(){return n.onActionItem("help")})("keydown.space",function(){return n.onActionItem("help ")}),g()(),p(7,"button",7),m("click",function(){return n.closePage()}),p(8,"mat-icon"),f(9,"close"),g()()(),j(10,"dashboards-editor",8),g()),i&2&&(b(3),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48),b(),H(`${n.isPhonePortrait()?"no-label":"with-label"}`),R("iconOnly",n.isPhonePortrait())("compact",!0)("iconSize",48))},dependencies:[L,M,Y,dt,Ct,mt,ei],styles:["[_nghost-%COMP%]{display:block;width:100%;height:100%}.home-container[_ngcontent-%COMP%]{display:flex;flex-direction:column;height:100%}.actions-header-container[_ngcontent-%COMP%]{display:flex;justify-content:space-between;align-items:flex-start;width:100%;padding:5px 0 5px 10px}.with-label[_ngcontent-%COMP%]{height:80px;width:100px}.no-label[_ngcontent-%COMP%]{height:58px;width:63px}.dashboard-editor[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:auto}.actions-buttons-container[_ngcontent-%COMP%]{display:flex;flex-direction:row;flex-wrap:nowrap;gap:5px}.dialog-close-icon[_ngcontent-%COMP%]{margin-right:15px;margin-top:6px}.mat-mdc-dialog-content[_ngcontent-%COMP%]{max-height:max-content}"]})}return o})();export{xn as SettingsComponent};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as B}from"./chunk-
|
|
1
|
+
import{b as B}from"./chunk-GYJAOUYL.js";import{b as U,j as q}from"./chunk-H2I7BMAK.js";import"./chunk-ETXVA6Z3.js";import"./chunk-YY4ZUJFI.js";import"./chunk-CSIELI2Z.js";import"./chunk-4YDVZHMH.js";import"./chunk-M37BLWHF.js";import"./chunk-WJFXI5PQ.js";import"./chunk-HSKVTFFQ.js";import"./chunk-MXUEYEZU.js";import{m as F}from"./chunk-2GOHQZH5.js";import{$b as m,Ac as u,Cb as w,Da as x,Db as s,Eb as c,Fa as r,Fb as h,Fc as D,Ga as l,Mb as y,Ob as O,Pe as S,Qb as g,Re as V,Se as Z,Va as d,Vd as I,Wc as T,Yb as z,Zb as E,ac as R,dd as N,fb as W,ie as X,je as L,pa as a,tc as k,ua as v,va as C,vd as A,wb as b,xb as P}from"./chunk-PZ6I6W3H.js";var G=["panel"],Q=(i,f)=>[i,f];function j(i,f){if(i&1&&h(0,"div",7),i&2){let t=g();m("transform",t.ghostTransform())}}function H(i,f){if(i&1){let t=y();s(0,"div",8),O("pointerdown",function(e){v(t);let o=g();return C(o.startResize(e))}),s(1,"button",9),O("pointerdown",function(e){v(t);let o=g();return C(o.startResize(e))}),h(2,"mat-icon",10),c()()}}var ct=(()=>{class i{panelEl=D.required("panel");_settings=a(F);_dashboard=a(U);breakpointObserver=a(A);ngZone=a(x);side=r(this._settings.getSplitShellSide());panelRatio=r(this._settings.getSplitShellWidth());originalPanelRatio=null;panelWidth=r(0);panelCollapsed=u(()=>!!this._dashboard.dashboards()[this._dashboard.activeDashboard()]?.collapseSplitShell);fskShellSwipeDisabled=S(this._settings.getSplitShellSwipeDisabledAsO());handset$=this.breakpointObserver.observe(I.HandsetPortrait);handset=S(this.handset$,{initialValue:{matches:!1,breakpoints:{}}});freeboardWidgetStub={uuid:"persistent-freeboard-shell",type:"widget-freeboardsk",config:{}};chartplotterModeInPortrait=u(()=>this.handset().matches&&!this.panelCollapsed());canResize=u(()=>!this._dashboard.isDashboardStatic()&&!this.panelCollapsed());resizing=!1;startX=0;startW=0;boundMove=t=>this.onMove(t);boundUp=()=>this.onUp();static MIN_DELTA_PX=1;ghostActive=r(!1);ghostTransform=r("");ghostWidth=0;recomputeWidth=()=>{let t=this.panelEl()?.nativeElement.parentElement;if(!t)return;let n=t.clientWidth;this.panelWidth.set(Math.round(n*this.panelRatio()))};constructor(){window.addEventListener("resize",this.recomputeWidth,{passive:!0}),queueMicrotask(this.recomputeWidth),l(()=>{this.chartplotterModeInPortrait(),this.panelRatio(),this.recomputeWidth(),setTimeout(()=>window.dispatchEvent(new Event("resize")),0)}),l(()=>{let t=this._dashboard.isDashboardStatic();t||this.originalPanelRatio===null&&(this.originalPanelRatio=this.panelRatio()),t&&this.originalPanelRatio}),l(()=>{if(this._dashboard.layoutEditSaved(),this.originalPanelRatio!==null){let t=this.panelRatio();this._settings.setSplitShellWidth(t),this.originalPanelRatio=null}}),l(()=>{if(this._dashboard.layoutEditCanceled(),this.originalPanelRatio!==null){let t=this.originalPanelRatio;this.panelRatio.set(t),queueMicrotask(()=>this.recomputeWidth()),this.originalPanelRatio=null}})}startResize(t){this.canResize()&&(this.resizing=!0,this.startX=t.clientX,this.startW=this.panelWidth(),this.ghostWidth=this.startW,this.ghostActive.set(!0),this.updateGhostTransform(this.startW),t.target.setPointerCapture(t.pointerId),this.ngZone.runOutsideAngular(()=>{window.addEventListener("pointermove",this.boundMove,{passive:!0}),window.addEventListener("pointerup",this.boundUp,{passive:!0})}))}onMove(t){if(!this.resizing)return;let n=this.side()==="left"?t.clientX-this.startX:this.startX-t.clientX,o=this.panelEl()?.nativeElement.parentElement?.clientWidth??1,p=this.startW+n,_=o*.1,$=o*.9,M=Math.min($,Math.max(_,p));Math.abs(M-this.ghostWidth)<i.MIN_DELTA_PX||(this.ghostWidth=M,this.ngZone.runOutsideAngular(()=>this.updateGhostTransform(M)))}onUp(){if(!this.resizing)return;this.resizing=!1,window.removeEventListener("pointermove",this.boundMove),window.removeEventListener("pointerup",this.boundUp);let t=this.ghostWidth;this.ghostActive.set(!1);let n=this.panelEl();n&&!this.panelCollapsed()&&(n.nativeElement.style.width=t+"px"),this.ngZone.run(()=>{this.panelWidth.set(t);let o=this.panelEl()?.nativeElement.parentElement?.clientWidth??t,p=o?t/o:.3,_=this.panelRatio();Math.abs(p-_)>5e-4&&this.panelRatio.set(p)})}updateGhostTransform(t){this.side()==="left"?this.ghostTransform.set(`translateX(${t}px)`):this.ghostTransform.set(`translateX(-${t}px)`)}ngOnDestroy(){window.removeEventListener("resize",this.recomputeWidth),this.resizing&&(window.removeEventListener("pointermove",this.boundMove),window.removeEventListener("pointerup",this.boundUp))}static \u0275fac=function(n){return new(n||i)};static \u0275cmp=W({type:i,selectors:[["split-shell"]],viewQuery:function(n,e){n&1&&z(e.panelEl,G,5),n&2&&E()},decls:8,vars:18,consts:[["panel",""],[1,"split-root",3,"ngClass"],[1,"resize-ghost",3,"transform"],[1,"fsk-shell"],["role","separator","aria-label","Resize Freeboard chartplotter panel","aria-orientation","vertical",1,"drag-handle"],[1,"fsk-iframe",3,"type","id","swipeDisabled","disableWidgetShell"],[1,"dash-container"],[1,"resize-ghost"],["role","separator","aria-label","Resize Freeboard chartplotter panel","aria-orientation","vertical",1,"drag-handle",3,"pointerdown"],["mat-mini-fab","","tabindex","-1","aria-hidden","true",1,"drag-fab",3,"pointerdown"],["fontIcon","drag_indicator"]],template:function(n,e){n&1&&(s(0,"div",1),b(1,j,1,2,"div",2),s(2,"div",3,0),b(4,H,3,0,"div",4),h(5,"widget-freeboardsk",5),c(),s(6,"div",6),h(7,"dashboard"),c()()),n&2&&(m("--panel-ratio",e.panelRatio()),w("ngClass",k(15,Q,e.side()==="left"?"side-left":"side-right",e.chartplotterModeInPortrait()?"portrait-column":"")),d(),P(e.ghostActive()?1:-1),d(),m("width",e.chartplotterModeInPortrait()?null:e.panelWidth(),"px"),R("collapsed",e.panelCollapsed())("drag-disabled",!e.canResize()),d(2),P(e.canResize()?4:-1),d(),w("type",e.freeboardWidgetStub.type)("id",e.freeboardWidgetStub.uuid)("swipeDisabled",e.fskShellSwipeDisabled())("disableWidgetShell",!0))},dependencies:[N,T,q,B,L,X,Z,V],styles:[".split-root[_ngcontent-%COMP%]{position:relative;width:100%;height:100%;display:flex;overflow:hidden}.split-root.side-left[_ngcontent-%COMP%]{flex-direction:row}.split-root.side-right[_ngcontent-%COMP%]{flex-direction:row-reverse}.split-root.portrait-column[_ngcontent-%COMP%]{flex-direction:column}.split-root.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%], .split-root.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{width:100%!important;min-height:0}.split-root.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%]{flex:0 0 calc(var(--panel-ratio, .3) * 100%)}.split-root.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{flex:1 1 auto;min-height:0;overflow:hidden}.split-root.side-left.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{order:2}.split-root.side-left.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%]{order:1}.split-root.side-right.portrait-column[_ngcontent-%COMP%] .fsk-shell[_ngcontent-%COMP%]{order:2}.split-root.side-right.portrait-column[_ngcontent-%COMP%] .dash-container[_ngcontent-%COMP%]{order:1}.split-root.portrait-column[_ngcontent-%COMP%] .fsk-shell.collapsed[_ngcontent-%COMP%]{flex:0 0 0!important}.split-root.portrait-column[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%], .split-root.portrait-column[_ngcontent-%COMP%] .resize-ghost[_ngcontent-%COMP%]{display:none}.fsk-shell[_ngcontent-%COMP%]{position:relative;height:100%;display:flex;flex-direction:column;background:var(--mat-sys-surface-container, #111);transition:width .2s ease}.fsk-shell.collapsed[_ngcontent-%COMP%]{width:1px!important;visibility:hidden;opacity:0;pointer-events:none}.fsk-iframe[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0}.dash-container[_ngcontent-%COMP%]{flex:1 1 auto;min-width:0;height:100%}.drag-handle[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;width:3px;cursor:col-resize;background:var(--mat-sys-inverse-primary);z-index:5}.drag-handle[_ngcontent-%COMP%] .drag-fab[_ngcontent-%COMP%]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);width:28px;height:28px;min-width:28px;cursor:col-resize;pointer-events:auto}.drag-handle[_ngcontent-%COMP%] .drag-fab[_ngcontent-%COMP%] mat-icon[_ngcontent-%COMP%]{font-size:20px;width:20px;height:20px;line-height:20px}.side-left[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{right:-2px}.side-right[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{left:-2px}.drag-handle[_ngcontent-%COMP%]:hover{background:var(--mat-sys-error-container)}.side-left[_ngcontent-%COMP%] .collapse-toggle[_ngcontent-%COMP%]{left:.25rem}.side-right[_ngcontent-%COMP%] .collapse-toggle[_ngcontent-%COMP%]{right:.25rem}.fsk-shell.drag-disabled[_ngcontent-%COMP%] .drag-handle[_ngcontent-%COMP%]{cursor:not-allowed;opacity:.4}.resize-ghost[_ngcontent-%COMP%]{position:absolute;top:0;bottom:0;width:2px;background:var(--mat-sys-error-container);opacity:.9;pointer-events:none;z-index:30;will-change:transform;transition:none}.side-left[_ngcontent-%COMP%] .resize-ghost[_ngcontent-%COMP%]{left:0}.side-right[_ngcontent-%COMP%] .resize-ghost[_ngcontent-%COMP%]{right:0}"]})}return i})();export{ct as SplitShellComponent};
|