vendor: 15,794 bytes, lines 1-3
1import{i as D,l as z,o as F,s as G,t as A}from"./chunk-CKVc5S_5.js";import{t as Oi$1}from"./chunk-N8zXOawx.js";import{i as R}from"./chunk-EUX0Ujs9.js";import{$ as Fc$1,$i as bt$1,$r as Xn,Ar as V8e,Ci as _$1,Co as ko,En as Ot$1,Fn as QF,Ft as Jpe,Hi as az,I as DB,Ir as Vl$1,Is as s,Ko as nw,Lo as mo,Ni as _t$1,Oi as _me,Qa as hi,Qt as Lue,Ss as qg,T as CH,Tr as Ug,Ts as qo$1,Tt as Ie,Wo as nme,Wr as We$1,Xn as S,Xr as XF,Y as Et$1,Ys as uH,_i as Ze,ac as uu,an as Mo,dc as vme,di as Yr$1,ga as dt$1,gs as pz,h as AH,hs as pv,ic as ut,io as ime,ja as fe,jc as xS,jo as lw,ks as rM,l as $g,la as cv,ma as dn$1,mi as ZH,mo as k,ms as pu,mt as H,n as $2,nt as Fo,qc as z2,qo as nz,qs as u,r as $A,si as Ye$1,u as $k,xr as UH}from"./chunk-CQ9iCpfE.js";import{t as o}from"./chunk-CvlEnKog.js";var ks=D((Ru,vi)=>{"use strict";(function(e,n,t,i){"use strict";var s=[``,`webkit`,`Moz`,`MS`,`ms`,`o`],r=n.createElement(`div`),o=`function`,a=Math.round,c=Math.abs,h=Date.now;function f(l,u,d){return setTimeout(N(l,d),u)}function m(l,u,d){return Array.isArray(l)?(p(l,d[u],d),!0):!1}function p(l,u,d){var g;if(l)if(l.forEach)l.forEach(u,d);else if(l.length!==i)for(g=0;g<l.length;)u.call(d,l[g],g,l),g++;else for(g in l)l.hasOwnProperty(g)&&u.call(d,l[g],g,l)}function v(l,u,d){var g=`DEPRECATED METHOD: `+u+` 2`+d+` AT 3`;return function(){var S=new Error(`get-stack-trace`),C=S&&S.stack?S.stack.replace(/^[^\(]+?[\n$]/gm,``).replace(/^\s+at\s+/gm,``).replace(/^Object.<anonymous>\s*\(/gm,`{anonymous}()@`):`Unknown Stack Trace`,P=e.console&&(e.console.warn||e.console.log);return P&&P.call(e.console,g,C),l.apply(this,arguments)}}var b;typeof Object.assign!=`function`?b=function(u){if(u===i||u===null)throw new TypeError(`Cannot convert undefined or null to object`);for(var d=Object(u),g=1;g<arguments.length;g++){var S=arguments[g];if(S!==i&&S!==null)for(var C in S)S.hasOwnProperty(C)&&(d[C]=S[C])}return d}:b=Object.assign;var T=v(function(u,d,g){for(var S=Object.keys(d),C=0;C<S.length;)(!g||g&&u[S[C]]===i)&&(u[S[C]]=d[S[C]]),C++;return u},`extend`,"Use `assign`."),k=v(function(u,d){return T(u,d,!0)},`merge`,"Use `assign`.");function I(l,u,d){var g=u.prototype,S=l.prototype=Object.create(g);S.constructor=l,S._super=g,d&&b(S,d)}function N(l,u){return function(){return l.apply(u,arguments)}}function M(l,u){return typeof l==o?l.apply(u&&u[0]||i,u):l}function O(l,u){return l===i?u:l}function F(l,u,d){p(Ze(u),function(g){l.addEventListener(g,d,!1)})}function Ve(l,u,d){p(Ze(u),function(g){l.removeEventListener(g,d,!1)})}function Z(l,u){for(;l;){if(l==u)return!0;l=l.parentNode}return!1}function $(l,u){return l.indexOf(u)>-1}function Ze(l){return l.trim().split(/\s+/g)}function st(l,u,d){if(l.indexOf&&!d)return l.indexOf(u);for(var g=0;g<l.length;){if(d&&l[g][d]==u||!d&&l[g]===u)return g;g++}return-1}function Yt(l){return Array.prototype.slice.call(l,0)}function Pn(l,u,d){for(var g=[],S=[],C=0;C<l.length;){var P=u?l[C][u]:l[C];st(S,P)<0&&g.push(l[C]),S[C]=P,C++}return d&&(u?g=g.sort(function(z,G){return z[u]>G[u]}):g=g.sort()),g}function Vt(l,u){for(var d,g,S=u[0].toUpperCase()+u.slice(1),C=0;C<s.length;){if(d=s[C],g=d?d+S:u,g in l)return g;C++}return i}var no=1;function so(){return no++}function Mn(l){var u=l.ownerDocument||l;return u.defaultView||u.parentWindow||e}var ro=/mobile|tablet|ip(ad|hone|od)|android/i,En=`ontouchstart`in e,oo=Vt(e,`PointerEvent`)!==i,ao=En&&ro.test(navigator.userAgent),St=`touch`,co=`pen`,_i=`mouse`,lo=`kinect`,uo=25,q=1,$e=2,R=4,J=8,Zt=1,yt=2,Tt=4,kt=8,Ct=16,pe=yt|Tt,Ke=kt|Ct,Nn=pe|Ke,On=[`x`,`y`],$t=[`clientX`,`clientY`];function oe(l,u){var d=this;this.manager=l,this.callback=u,this.element=l.element,this.target=l.options.inputTarget,this.domHandler=function(g){M(l.options.enable,[l])&&d.handler(g)},this.init()}oe.prototype={handler:function(){},init:function(){this.evEl&&F(this.element,this.evEl,this.domHandler),this.evTarget&&F(this.target,this.evTarget,this.domHandler),this.evWin&&F(Mn(this.element),this.evWin,this.domHandler)},destroy:function(){this.evEl&&Ve(this.element,this.evEl,this.domHandler),this.evTarget&&Ve(this.target,this.evTarget,this.domHandler),this.evWin&&Ve(Mn(this.element),this.evWin,this.domHandler)}};function ho(l){var u,d=l.options.inputClass;return d?u=d:oo?u=ji:ao?u=qt:En?u=Ri:u=Xt,new u(l,fo)}function fo(l,u,d){var g=d.pointers.length,S=d.changedPointers.length,C=u&q&&g-S===0,P=u&(R|J)&&g-S===0;d.isFirst=!!C,d.isFinal=!!P,C&&(l.session={}),d.eventType=u,mo(l,d),l.emit(`hammer.input`,d),l.recognize(d),l.session.prevInput=d}function mo(l,u){var d=l.session,g=u.pointers,S=g.length;d.firstInput||(d.firstInput=_n(u)),S>1&&!d.firstMultiple?d.firstMultiple=_n(u):S===1&&(d.firstMultiple=!1);var C=d.firstInput,P=d.firstMultiple,H=P?P.center:C.center,z=u.center=Ln(g);u.timeStamp=h(),u.deltaTime=u.timeStamp-C.timeStamp,u.angle=Li(H,z),u.distance=Kt(H,z),go(d,u),u.offsetDirection=Rn(u.deltaX,u.deltaY);var G=jn(u.deltaTime,u.deltaX,u.deltaY);u.overallVelocityX=G.x,u.overallVelocityY=G.y,u.overallVelocity=c(G.x)>c(G.y)?G.x:G.y,u.scale=P?bo(P.pointers,g):1,u.rotation=P?vo(P.pointers,g):0,u.maxPointers=d.prevInput?u.pointers.length>d.prevInput.maxPointers?u.pointers.length:d.prevInput.maxPointers:u.pointers.length,po(d,u);var be=l.element;Z(u.srcEvent.target,be)&&(be=u.srcEvent.target),u.target=be}function go(l,u){var d=u.center,g=l.offsetDelta||{},S=l.prevDelta||{},C=l.prevInput||{};(u.eventType===q||C.eventType===R)&&(S=l.prevDelta={x:C.deltaX||0,y:C.deltaY||0},g=l.offsetDelta={x:d.x,y:d.y}),u.deltaX=S.x+(d.x-g.x),u.deltaY=S.y+(d.y-g.y)}function po(l,u){var d=l.lastInterval||u,g=u.timeStamp-d.timeStamp,S,C,P,H;if(u.eventType!=J&&(g>uo||d.velocity===i)){var z=u.deltaX-d.deltaX,G=u.deltaY-d.deltaY,be=jn(g,z,G);C=be.x,P=be.y,S=c(be.x)>c(be.y)?be.x:be.y,H=Rn(z,G),l.lastInterval=u}else S=d.velocity,C=d.velocityX,P=d.velocityY,H=d.direction;u.velocity=S,u.velocityX=C,u.velocityY=P,u.direction=H}function _n(l){for(var u=[],d=0;d<l.pointers.length;)u[d]={clientX:a(l.pointers[d].clientX),clientY:a(l.pointers[d].clientY)},d++;return{timeStamp:h(),pointers:u,center:Ln(u),deltaX:l.deltaX,deltaY:l.deltaY}}function Ln(l){var u=l.length;if(u===1)return{x:a(l[0].clientX),y:a(l[0].clientY)};for(var d=0,g=0,S=0;S<u;)d+=l[S].clientX,g+=l[S].clientY,S++;return{x:a(d/u),y:a(g/u)}}function jn(l,u,d){return{x:u/l||0,y:d/l||0}}function Rn(l,u){return l===u?Zt:c(l)>=c(u)?l<0?yt:Tt:u<0?kt:Ct}function Kt(l,u,d){d||(d=On);var g=u[d[0]]-l[d[0]],S=u[d[1]]-l[d[1]];return Math.sqrt(g*g+S*S)}function Li(l,u,d){d||(d=On);var g=u[d[0]]-l[d[0]],S=u[d[1]]-l[d[1]];return Math.atan2(S,g)*180/Math.PI}function vo(l,u){return Li(u[1],u[0],$t)+Li(l[1],l[0],$t)}function bo(l,u){return Kt(u[0],u[1],$t)/Kt(l[0],l[1],$t)}var So={mousedown:q,mousemove:$e,mouseup:R},yo=`mousedown`,To=`mousemove mouseup`;function Xt(){this.evEl=yo,this.evWin=To,this.pressed=!1,oe.apply(this,arguments)}I(Xt,oe,{handler:function(u){var d=So[u.type];d&q&&u.button===0&&(this.pressed=!0),d&$e&&u.which!==1&&(d=R),this.pressed&&(d&R&&(this.pressed=!1),this.callback(this.manager,d,{pointers:[u],changedPointers:[u],pointerType:_i,srcEvent:u}))}});var ko={pointerdown:q,pointermove:$e,pointerup:R,pointercancel:J,pointerout:J},Co={2:St,3:co,4:_i,5:lo},Fn=`pointerdown`,Un=`pointermove pointerup pointercancel`;e.MSPointerEvent&&!e.PointerEvent&&(Fn=`MSPointerDown`,Un=`MSPointerMove MSPointerUp MSPointerCancel`);function ji(){this.evEl=Fn,this.evWin=Un,oe.apply(this,arguments),this.store=this.manager.session.pointerEvents=[]}I(ji,oe,{handler:function(u){var d=this.store,g=!1,C=ko[u.type.toLowerCase().replace(`ms`,``)],P=Co[u.pointerType]||u.pointerType,H=P==St,z=st(d,u.pointerId,`pointerId`);C&q&&(u.button===0||H)?z<0&&(d.push(u),z=d.length-1):C&(R|J)&&(g=!0),!(z<0)&&(d[z]=u,this.callback(this.manager,C,{pointers:d,changedPointers:[u],pointerType:P,srcEvent:u}),g&&d.splice(z,1))}});var Io={touchstart:q,touchmove:$e,touchend:R,touchcancel:J},wo=`touchstart`,Do=`touchstart touchmove touchend touchcancel`;function Wn(){this.evTarget=wo,this.evWin=Do,this.started=!1,oe.apply(this,arguments)}I(Wn,oe,{handler:function(u){var d=Io[u.type];if(d===q&&(this.started=!0),!!this.started){var g=Ao.call(this,u,d);d&(R|J)&&g[0].length-g[1].length===0&&(this.started=!1),this.callback(this.manager,d,{pointers:g[0],changedPointers:g[1],pointerType:St,srcEvent:u})}}});function Ao(l,u){var d=Yt(l.touches),g=Yt(l.changedTouches);return u&(R|J)&&(d=Pn(d.concat(g),`identifier`,!0)),[d,g]}var xo={touchstart:q,touchmove:$e,touchend:R,touchcancel:J},Po=`touchstart touchmove touchend touchcancel`;function qt(){this.evTarget=Po,this.targetIds={},oe.apply(this,arguments)}I(qt,oe,{handler:function(u){var d=xo[u.type],g=Mo.call(this,u,d);g&&this.callback(this.manager,d,{pointers:g[0],changedPointers:g[1],pointerType:St,srcEvent:u})}});function Mo(l,u){var d=Yt(l.touches),g=this.targetIds;if(u&(q|$e)&&d.length===1)return g[d[0].identifier]=!0,[d,d];var S,C,P=Yt(l.changedTouches),H=[],z=this.target;if(C=d.filter(function(G){return Z(G.target,z)}),u===q)for(S=0;S<C.length;)g[C[S].identifier]=!0,S++;for(S=0;S<P.length;)g[P[S].identifier]&&H.push(P[S]),u&(R|J)&&delete g[P[S].identifier],S++;if(H.length)return[Pn(C.concat(H),`identifier`,!0),H]}var Eo=2500,Bn=25;function Ri(){oe.apply(this,arguments);var l=N(this.handler,this);this.touch=new qt(this.manager,l),this.mouse=new Xt(this.manager,l),this.primaryTouch=null,this.lastTouches=[]}I(Ri,oe,{handler:function(u,d,g){var S=g.pointerType==St,C=g.pointerType==_i;if(!(C&&g.sourceCapabilities&&g.sourceCapabilities.firesTouchEvents)){if(S)No.call(this,d,g);else if(C&&Oo.call(this,g))return;this.callback(u,d,g)}},destroy:function(){this.touch.destroy(),this.mouse.destroy()}});function No(l,u){l&q?(this.primaryTouch=u.changedPointers[0].identifier,Hn.call(this,u)):l&(R|J)&&Hn.call(this,u)}function Hn(l){var u=l.changedPointers[0];if(u.identifier===this.primaryTouch){var d={x:u.clientX,y:u.clientY};this.lastTouches.push(d);var g=this.lastTouches,S=function(){var C=g.indexOf(d);C>-1&&g.splice(C,1)};setTimeout(S,Eo)}}function Oo(l){for(var u=l.srcEvent.clientX,d=l.srcEvent.clientY,g=0;g<this.lastTouches.length;g++){var S=this.lastTouches[g],C=Math.abs(u-S.x),P=Math.abs(d-S.y);if(C<=Bn&&P<=Bn)return!0}return!1}var zn=Vt(r.style,`touchAction`),Yn=zn!==i,Vn=`compute`,Zn=`auto`,Fi=`manipulation`,Xe=`none`,It=`pan-x`,wt=`pan-y`,Gt=Lo();function Ui(l,u){this.manager=l,this.set(u)}Ui.prototype={set:function(l){l==Vn&&(l=this.compute()),Yn&&this.manager.element.style&&Gt[l]&&(this.manager.element.style[zn]=l),this.actions=l.toLowerCase().trim()},update:function(){this.set(this.manager.options.touchAction)},compute:function(){var l=[];return p(this.manager.recognizers,function(u){M(u.options.enable,[u])&&(l=l.concat(u.getTouchAction()))}),_o(l.join(` `))},preventDefaults:function(l){var u=l.srcEvent,d=l.offsetDirection;if(this.manager.session.prevented){u.preventDefault();return}var g=this.actions,S=$(g,Xe)&&!Gt[Xe],C=$(g,wt)&&!Gt[wt],P=$(g,It)&&!Gt[It];if(S){var H=l.pointers.length===1,z=l.distance<2,G=l.deltaTime<250;if(H&&z&&G)return}if(!(P&&C)&&(S||C&&d&pe||P&&d&Ke))return this.preventSrc(u)},preventSrc:function(l){this.manager.session.prevented=!0,l.preventDefault()}};function _o(l){if($(l,Xe))return Xe;var u=$(l,It),d=$(l,wt);return u&&d?Xe:u||d?u?It:wt:$(l,Fi)?Fi:Zn}function Lo(){if(!Yn)return!1;var l={},u=e.CSS&&e.CSS.supports;return[`auto`,`manipulation`,`pan-y`,`pan-x`,`pan-x pan-y`,`none`].forEach(function(d){l[d]=u?e.CSS.supports(`touch-action`,d):!0}),l}var Qt=1,ae=2,rt=4,Ee=8,Ce=Ee,Dt=16,ve=32;function Ie(l){this.options=b({},this.defaults,l||{}),this.id=so(),this.manager=null,this.options.enable=O(this.options.enable,!0),this.state=Qt,this.simultaneous={},this.requireFail=[]}Ie.prototype={defaults:{},set:function(l){return b(this.options,l),this.manager&&this.manager.touchAction.update(),this},recognizeWith:function(l){if(m(l,`recognizeWith`,this))return this;var u=this.simultaneous;return l=Jt(l,this),u[l.id]||(u[l.id]=l,l.recognizeWith(this)),this},dropRecognizeWith:function(l){return m(l,`dropRecognizeWith`,this)?this:(l=Jt(l,this),delete this.simultaneous[l.id],this)},requireFailure:function(l){if(m(l,`requireFailure`,this))return this;var u=this.requireFail;return l=Jt(l,this),st(u,l)===-1&&(u.push(l),l.requireFailure(this)),this},dropRequireFailure:function(l){if(m(l,`dropRequireFailure`,this))return this;l=Jt(l,this);var u=st(this.requireFail,l);return u>-1&&this.requireFail.splice(u,1),this},hasRequireFailures:function(){return this.requireFail.length>0},canRecognizeWith:function(l){return!!this.simultaneous[l.id]},emit:function(l){var u=this,d=this.state;function g(S){u.manager.emit(S,l)}d<Ee&&g(u.options.event+$n(d)),g(u.options.event),l.additionalEvent&&g(l.additionalEvent),d>=Ee&&g(u.options.event+$n(d))},tryEmit:function(l){if(this.canEmit())return this.emit(l);this.state=ve},canEmit:function(){for(var l=0;l<this.requireFail.length;){if(!(this.requireFail[l].state&(ve|Qt)))return!1;l++}return!0},recognize:function(l){var u=b({},l);if(!M(this.options.enable,[this,u])){this.reset(),this.state=ve;return}this.state&(Ce|Dt|ve)&&(this.state=Qt),this.state=this.process(u),this.state&(ae|rt|Ee|Dt)&&this.tryEmit(u)},process:function(l){},getTouchAction:function(){},reset:function(){}};function $n(l){return l&Dt?`cancel`:l&Ee?`end`:l&rt?`move`:l&ae?`start`:``}function Kn(l){return l==Ct?`down`:l==kt?`up`:l==yt?`left`:l==Tt?`right`:``}function Jt(l,u){var d=u.manager;return d?d.get(l):l}function fe(){Ie.apply(this,arguments)}I(fe,Ie,{defaults:{pointers:1},attrTest:function(l){var u=this.options.pointers;return u===0||l.pointers.length===u},process:function(l){var u=this.state,d=l.eventType,g=u&(ae|rt),S=this.attrTest(l);return g&&(d&J||!S)?u|Dt:g||S?d&R?u|Ee:u&ae?u|rt:ae:ve}});function ei(){fe.apply(this,arguments),this.pX=null,this.pY=null}I(ei,fe,{defaults:{event:`pan`,threshold:10,pointers:1,direction:Nn},getTouchAction:function(){var l=this.options.direction,u=[];return l&pe&&u.push(wt),l&Ke&&u.push(It),u},directionTest:function(l){var u=this.options,d=!0,g=l.distance,S=l.direction,C=l.deltaX,P=l.deltaY;return S&u.direction||(u.direction&pe?(S=C===0?Zt:C<0?yt:Tt,d=C!=this.pX,g=Math.abs(l.deltaX)):(S=P===0?Zt:P<0?kt:Ct,d=P!=this.pY,g=Math.abs(l.deltaY))),l.direction=S,d&&g>u.threshold&&S&u.direction},attrTest:function(l){return fe.prototype.attrTest.call(this,l)&&(this.state&ae||!(this.state&ae)&&this.directionTest(l))},emit:function(l){this.pX=l.deltaX,this.pY=l.deltaY;var u=Kn(l.direction);u&&(l.additionalEvent=this.options.event+u),this._super.emit.call(this,l)}});function Wi(){fe.apply(this,arguments)}I(Wi,fe,{defaults:{event:`pinch`,threshold:0,pointers:2},getTouchAction:function(){return[Xe]},attrTest:function(l){return this._super.attrTest.call(this,l)&&(Math.abs(l.scale-1)>this.options.threshold||this.state&ae)},emit:function(l){if(l.scale!==1){var u=l.scale<1?`in`:`out`;l.additionalEvent=this.options.event+u}this._super.emit.call(this,l)}});function Bi(){Ie.apply(this,arguments),this._timer=null,this._input=null}I(Bi,Ie,{defaults:{event:`press`,pointers:1,time:251,threshold:9},getTouchAction:function(){return[Zn]},process:function(l){var u=this.options,d=l.pointers.length===u.pointers,g=l.distance<u.threshold,S=l.deltaTime>u.time;if(this._input=l,!g||!d||l.eventType&(R|J)&&!S)this.reset();else if(l.eventType&q)this.reset(),this._timer=f(function(){this.state=Ce,this.tryEmit()},u.time,this);else if(l.eventType&R)return Ce;return ve},reset:function(){clearTimeout(this._timer)},emit:function(l){this.state===Ce&&(l&&l.eventType&R?this.manager.emit(this.options.event+`up`,l):(this._input.timeStamp=h(),this.manager.emit(this.options.event,this._input)))}});function Hi(){fe.apply(this,arguments)}I(Hi,fe,{defaults:{event:`rotate`,threshold:0,pointers:2}
3,getTouchAction:function(){return[Xe]},attrTest:function(l){return this._super.attrTest.call(this,l)&&(Math.abs(l.rotation)>this.options.threshold||this.state&ae)}});function zi(){fe.apply(this,arguments)}I(zi,fe,{defaults:{event:`swipe`,threshold:10,velocity:.3,direction:pe|Ke,pointers:1},getTouchAction:function(){return ei.prototype.getTouchAction.call(this)},attrTest:function(l){var u=this.options.direction,d;return u&(pe|Ke)?d=l.overallVelocity:u&pe?d=l.overallVelocityX:u&Ke&&(d=l.overallVelocityY),this._super.attrTest.call(this,l)&&u&l.offsetDirection&&l.distance>this.options.threshold&&l.maxPointers==this.options.pointers&&c(d)>this.options.velocity&&l.eventType&R},emit:function(l){var u=Kn(l.offsetDirection);u&&this.manager.emit(this.options.event+u,l),this.manager.emit(this.options.event,l)}});function ti(){Ie.apply(this,arguments),this.pTime=!1,this.pCenter=!1,this._timer=null,this._input=null,this.count=0}I(ti,Ie,{defaults:{event:`tap`,pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},getTouchAction:function(){return[Fi]},process:function(l){var u=this.options,d=l.pointers.length===u.pointers,g=l.distance<u.threshold,S=l.deltaTime<u.time;if(this.reset(),l.eventType&q&&this.count===0)return this.failTimeout();if(g&&S&&d){if(l.eventType!=R)return this.failTimeout();var C=this.pTime?l.timeStamp-this.pTime<u.interval:!0,P=!this.pCenter||Kt(this.pCenter,l.center)<u.posThreshold;this.pTime=l.timeStamp,this.pCenter=l.center,!P||!C?this.count=1:this.count+=1,this._input=l;if(this.count%u.taps===0)return this.hasRequireFailures()?(this._timer=f(function(){this.state=Ce,this.tryEmit()},u.interval,this),ae):Ce}return ve},failTimeout:function(){return this._timer=f(function(){this.state=ve},this.options.interval,this),ve},reset:function(){clearTimeout(this._timer)},emit:function(){this.state==Ce&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))}});function we(l,u){return u=u||{},u.recognizers=O(u.recognizers,we.defaults.preset),new Yi(l,u)}we.VERSION=`2.0.7`,we.defaults={domEvents:!1,touchAction:Vn,enable:!0,inputTarget:null,inputClass:null,preset:[[Hi,{enable:!1}],[Wi,{enable:!1},[`rotate`]],[zi,{direction:pe}],[ei,{direction:pe},[`swipe`]],[ti],[ti,{event:`doubletap`,taps:2},[`tap`]],[Bi]],cssProps:{userSelect:`none`,touchSelect:`none`,touchCallout:`none`,contentZooming:`none`,userDrag:`none`,tapHighlightColor:`rgba(0,0,0,0)`}};var jo=1,Xn=2;function Yi(l,u){this.options=b({},we.defaults,u||{}),this.options.inputTarget=this.options.inputTarget||l,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=l,this.input=ho(this),this.touchAction=new Ui(this,this.options.touchAction),qn(this,!0),p(this.options.recognizers,function(d){var g=this.add(new d[0](d[1]));d[2]&&g.recognizeWith(d[2]),d[3]&&g.requireFailure(d[3])},this)}Yi.prototype={set:function(l){return b(this.options,l),l.touchAction&&this.touchAction.update(),l.inputTarget&&(this.input.destroy(),this.input.target=l.inputTarget,this.input.init()),this},stop:function(l){this.session.stopped=l?Xn:jo},recognize:function(l){var u=this.session;if(!u.stopped){this.touchAction.preventDefaults(l);var d,g=this.recognizers,S=u.curRecognizer;(!S||S&&S.state&Ce)&&(S=u.curRecognizer=null);for(var C=0;C<g.length;)d=g[C],u.stopped!==Xn&&(!S||d==S||d.canRecognizeWith(S))?d.recognize(l):d.reset(),!S&&d.state&(ae|rt|Ee)&&(S=u.curRecognizer=d),C++}},get:function(l){if(l instanceof Ie)return l;for(var u=this.recognizers,d=0;d<u.length;d++)if(u[d].options.event==l)return u[d];return null},add:function(l){if(m(l,`add`,this))return this;var u=this.get(l.options.event);return u&&this.remove(u),this.recognizers.push(l),l.manager=this,this.touchAction.update(),l},remove:function(l){if(m(l,`remove`,this))return this;if(l=this.get(l),l){var u=this.recognizers,d=st(u,l);d!==-1&&(u.splice(d,1),this.touchAction.update())}return this},on:function(l,u){if(l!==i&&u!==i){var d=this.handlers;return p(Ze(l),function(g){d[g]=d[g]||[],d[g].push(u)}),this}},off:function(l,u){if(l!==i){var d=this.handlers;return p(Ze(l),function(g){u?d[g]&&d[g].splice(st(d[g],u),1):delete d[g]}),this}},emit:function(l,u){this.options.domEvents&&Ro(l,u);var d=this.handlers[l]&&this.handlers[l].slice();if(!(!d||!d.length)){u.type=l,u.preventDefault=function(){u.srcEvent.preventDefault()};for(var g=0;g<d.length;)d[g](u),g++}},destroy:function(){this.element&&qn(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null}};function qn(l,u){var d=l.element;if(d.style){var g;p(l.options.cssProps,function(S,C){g=Vt(d.style,C),u?(l.oldCssProps[g]=d.style[g],d.style[g]=S):d.style[g]=l.oldCssProps[g]||``}),u||(l.oldCssProps={})}}function Ro(l,u){var d=n.createEvent(`Event`);d.initEvent(l,!0,!0),d.gesture=u,u.target.dispatchEvent(d)}b(we,{INPUT_START:q,INPUT_MOVE:$e,INPUT_END:R,INPUT_CANCEL:J,STATE_POSSIBLE:Qt,STATE_BEGAN:ae,STATE_CHANGED:rt,STATE_ENDED:Ee,STATE_RECOGNIZED:Ce,STATE_CANCELLED:Dt,STATE_FAILED:ve,DIRECTION_NONE:Zt,DIRECTION_LEFT:yt,DIRECTION_RIGHT:Tt,DIRECTION_UP:kt,DIRECTION_DOWN:Ct,DIRECTION_HORIZONTAL:pe,DIRECTION_VERTICAL:Ke,DIRECTION_ALL:Nn,Manager:Yi,Input:oe,TouchAction:Ui,TouchInput:qt,MouseInput:Xt,PointerEventInput:ji,TouchMouseInput:Ri,SingleTouchInput:Wn,Recognizer:Ie,AttrRecognizer:fe,Tap:ti,Pan:ei,Swipe:zi,Pinch:Wi,Rotate:Hi,Press:Bi,on:F,off:Ve,each:p,merge:k,extend:T,assign:b,inherit:I,bindFn:N,prefixed:Vt});var Fo=typeof e<`u`?e:typeof self<`u`?self:{};Fo.Hammer=we,typeof define==`function`&&define.amd?define(function(){return we}):typeof vi<`u`&&vi.exports?vi.exports=we:e[t]=we})(window,document,`Hammer`)});var di=(()=>{class e{constructor(){}getCurrentUserEmail(t){return this.parseJwt(t).upn}getCurrentUserCustomerId(t){let i=this.parseJwt(t).subjectId;return i&&!Array.isArray(i)&&(i=i.split(`,`)),i}getDefaultSubjectId(t){return this.parseJwt(t).defaultSubjectId}parseJwt(t){if(!t)return{subjectId:``,defaultSubjectId:``,role:[],upn:``};let s=t.split(`.`)[1].replace(/-/g,`+`).replace(/_/g,`/`);return JSON.parse(window.atob(s))}getCurrentUserRoles(t){return this.parseJwt(t).role}getCiid(t){return this.parseJwt(t).ciid}getOrganisationUnits(t){let s=this.parseJwt(t).OUUser;return s?Array.isArray(s)?s:[s]:[]}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac})}}return e})();var Y=(function(e){return e.EvulutionAdmin=`CP_EvulutionAdmin`,e.ServiceDesk=`CP_ServiceDesk`,e.RestrictedAdminGUI=`CP_AdminGUIEditor`,e.UserPrivacyAcceptedAdmin=`CP_UserPrivacyAcceptedAdmin`,e.UserAdmin=`CP_UserAdmin`,e.UserGroupAdmin=`CP_UserGroupAdmin`,e.NotificationAdmin=`CP_NotificationAdmin`,e.TranslationAdmin=`CP_TranslationAdmin`,e.TranslationDefaultAdmin=`CP_TranslationDefaultAdmin`,e.QuizAdmin=`CP_QuizAdmin`,e.MeterDataAdmin=`CP_MeterDataAdmin`,e.LogAdmin=`CP_LogAdmin`,e.CustomerDeleteAdmin=`CP_CustomerDeleteAdmin`,e.ThemeAdmin=`CP_ThemeAdmin`,e.LiveDataPrivacyEditor=`CP_LiveDataPrivacyEditor`,e.DelegatesUser=`CP_DelegatesUser`,e.DelegatesAdmin=`CP_DelegatesAdmin`,e.IdentityUsersAdmin=`CP_IdentityUsersAdmin`,e.TwoFactor=`TwoFactor`,e})(Y||{});var X=(function(e){return e.AllActive=`AllActive`,e.AllPast=`AllPast`,e.ActiveTenant=`ActiveTenant`,e.ActiveOwner=`ActiveOwner`,e.ActiveCaretaker=`ActiveCaretaker`,e.PastTenant=`PastTenant`,e.PastOwner=`PastOwner`,e.PastCaretaker=`PastCaretaker`,e.All=`All`,e})(X||{});(function(e){function n(o){return match(o).pipe(mWhen(e.All,()=>!0),mWhen(e.AllActive,()=>!0),mWhen(e.ActiveTenant,()=>!0),mWhen(e.ActiveOwner,()=>!1),mWhen(e.ActiveCaretaker,()=>!1),mWhen(e.AllPast,()=>!1),mWhen(e.PastTenant,()=>!0),mWhen(e.PastOwner,()=>!1),mWhen(e.PastCaretaker,()=>!1),mExhaustive)}e.canShowActiveTenantObjects=n;function t(o){return match(o).pipe(mWhen(e.All,()=>!0),mWhen(e.AllActive,()=>!0),mWhen(e.ActiveTenant,()=>!1),mWhen(e.ActiveOwner,()=>!0),mWhen(e.ActiveCaretaker,()=>!1),mWhen(e.AllPast,()=>!1),mWhen(e.PastTenant,()=>!1),mWhen(e.PastOwner,()=>!0),mWhen(e.PastCaretaker,()=>!1),mExhaustive)}e.canShowActiveOwnerObjects=t;function i(o){return match(o).pipe(mWhen(e.All,()=>!0),mWhen(e.AllActive,()=>!0),mWhen(e.ActiveTenant,()=>!1),mWhen(e.ActiveOwner,()=>!1),mWhen(e.ActiveCaretaker,()=>!0),mWhen(e.AllPast,()=>!1),mWhen(e.PastTenant,()=>!1),mWhen(e.PastOwner,()=>!1),mWhen(e.PastCaretaker,()=>!0),mExhaustive)}e.canShowActiveCaretakerObjects=i;function s(o){return match(o).pipe(mWhen(e.All,()=>!0),mWhen(e.AllPast,()=>!0),mWhen(e.PastTenant,()=>!0),mWhen(e.PastOwner,()=>!1),mWhen(e.PastCaretaker,()=>!1),mWhen(e.AllActive,()=>!1),mWhen(e.ActiveTenant,()=>!1),mWhen(e.ActiveOwner,()=>!1),mWhen(e.ActiveCaretaker,()=>!1),mExhaustive)}e.canShowPastTenantObjects=s;function r(o){return match(o).pipe(mWhen(e.All,()=>!0),mWhen(e.AllPast,()=>!0),mWhen(e.PastCaretaker,()=>!0),mWhen(e.PastTenant,()=>!1),mWhen(e.PastOwner,()=>!1),mWhen(e.AllActive,()=>!1),mWhen(e.ActiveTenant,()=>!1),mWhen(e.ActiveOwner,()=>!1),mWhen(e.ActiveCaretaker,()=>!1),mExhaustive)}e.canShowPastCaretakerObjects=r})(X||(X={}));var Ss=(()=>{class e{constructor(){this.tenantService=_$1(cv),this.isApiUnreachable=S(!1),DB(500).subscribe(()=>{this.isApiUnreachable()&&this.tenantService.getLayout().subscribe(()=>{this.isApiUnreachable.set(!1),window.location.reload()})})}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var qi=R(`KeepAwake`,{web:()=>import(`./chunk-oc2LCU-i2.js`).then(e=>new e.KeepAwakeWeb)});var mi=(()=>{class e{constructor(){this.logoutTimeout=null,this.environment=_$1(`environmentEnergyboard`),this.logoutDelay=this.environment.nativeBackgroun
3dLogoutDelayMs,this.platformService=_$1(nz),this.appIsActive=S(!0),this.logoutTriggered=S(!1),this.platformService.isNativePlatform()&&this.initAppListeners()}initAppListeners(){o.addListener(`appStateChange`,t=>G(this,null,function*(){t.isActive?(this.appIsActive.set(!0),yield qi.keepAwake(),this.clearLogoutTimeout()):(this.appIsActive.set(!1),yield qi.keepAwake(),this.scheduleLogout())}))}scheduleLogout(){this.clearLogoutTimeout(),this.logoutTimeout=setTimeout(()=>{this.appIsActive()||this.logoutTriggered.set(!0)},this.logoutDelay)}clearLogoutTimeout(){this.logoutTimeout&&(clearTimeout(this.logoutTimeout),this.logoutTimeout=null)}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var Re=R(`SecureStorage`,{web:()=>G(null,null,function*(){return new(yield import(`./chunk-DfXNvwCD2.js`)).SecureStorageWeb}),ios:()=>G(null,null,function*(){return new(yield import(`./chunk-Dwp9FnPN.js`)).SecureStorageNative(Re)}),android:()=>G(null,null,function*(){return new(yield import(`./chunk-Dwp9FnPN.js`)).SecureStorageNative(Re)})});var ys=(()=>{class e{setItem(t,i){return G(this,null,function*(){try{if(!t||!i)throw new Error(`Key and value must not be empty.`);yield Re.setItem(t,i)}catch(s){console.error(`SecureStorage: Error setting item`,t,s)}})}getItem(t){return G(this,null,function*(){try{return(yield Re.getItem(t))??null}catch(i){return console.error(`SecureStorage: Error reading item`,t,i),null}})}removeItem(t){return G(this,null,function*(){try{return yield Re.removeItem(t),!0}catch(i){return console.error(`SecureStorage: Error removing item`,t,i),!1}})}clearAll(){return G(this,null,function*(){try{yield Re.clear()}catch(t){throw console.error(`SecureStorage: Error clearing all items`,t),t}})}keys(){return G(this,null,function*(){try{return yield Re.keys()}catch(t){throw console.error(`SecureStorage: Error reading keys`,t),t}})}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var gi=(()=>{class e{constructor(){this.accessTokenService=_$1(QF),this.logService=_$1(xS),this.logger=this.logService.getLogger(this.constructor.name),this.nativeSecureStorageService=_$1(ys)}getRefreshToken(){return G(this,null,function*(){return this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.refreshToken)})}hasOfflineRefreshToken(t){return G(this,null,function*(){let[i,s,r]=yield Promise.all([this.getRefreshToken(),this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.offlineRefreshToken),this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.offlineRefreshTokenOwner)]);return i!==null&&s===`true`&&r===this.serializeOfflineTokenOwner(t)})}clearOfflineRefreshTokenForDifferentOwner(t){return G(this,null,function*(){let[i,s,r]=yield Promise.all([this.getRefreshToken(),this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.offlineRefreshToken),this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.offlineRefreshTokenOwner)]),o=r===this.serializeOfflineTokenOwner(t);return i===null||s!==`true`||o?!0:this.clearRefreshToken()})}storeRefreshToken(t,i,s,r){return G(this,null,function*(){if(s&&isUndefined(r))return this.logger.error(`Missing offline refresh token owner`),!1;let[o,a,c]=yield Promise.all([this.getRefreshToken(),this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.offlineRefreshToken),this.nativeSecureStorageService.getItem(this.accessTokenService.localStorageKeys.offlineRefreshTokenOwner)]),h=isDefined(r)?this.serializeOfflineTokenOwner(r):void 0,f=isUndefined(h)||c===h;if(isDefined(o)&&a===`true`&&!s&&f)return!0;let{refreshToken:m,refreshTokenExpired:p}=this.accessTokenService.localStorageKeys;yield this.nativeSecureStorageService.setItem(m,t);let{offlineRefreshToken:v,offlineRefreshTokenOwner:b}=this.accessTokenService.localStorageKeys;yield this.nativeSecureStorageService.setItem(v,s.toString()),s?yield this.nativeSecureStorageService.removeItem(p):isDefined(i)?yield this.nativeSecureStorageService.setItem(p,i.toString()):yield this.nativeSecureStorageService.removeItem(p);let T=s?h:void 0;isDefined(T)?yield this.nativeSecureStorageService.setItem(b,T):yield this.nativeSecureStorageService.removeItem(b);let[k,I,N]=yield Promise.all([this.getRefreshToken(),this.nativeSecureStorageService.getItem(v),this.nativeSecureStorageService.getItem(b)]),M=s?T:null,O=k===t&&I===s.toString()&&N===M;return O||this.logger.error(`Failed to persist native refresh token`),O})}clearRefreshToken(){return G(this,null,function*(){let{refreshToken:t,refreshTokenExpired:i,offlineRefreshToken:s,offlineRefreshTokenOwner:r}=this.accessTokenService.localStorageKeys;return(yield Promise.all([this.nativeSecureStorageService.removeItem(t),this.nativeSecureStorageService.removeItem(i),this.nativeSecureStorageService.removeItem(s),this.nativeSecureStorageService.removeItem(r)])).every(Boolean)})}storeOfflineRefreshTokenResponse(t,i){return G(this,null,function*(){let s=this.getOfflineRefreshToken(t);return s===null?!1:this.storeRefreshToken(s,void 0,!0,i)})}getOfflineRefreshToken(t){try{let i=JSON.parse(t);return typeof i.refresh_token!=`string`||i.refresh_token.trim().length===0||i.refresh_expires_in!==0?null:i.refresh_token}catch(i){return null}}serializeOfflineTokenOwner(t){return JSON.stringify({tenant:t.tenant,username:t.username.trim().toLowerCase()})}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();
3var Gi=(function(e){return e.liveDataDetails={key:`liveDataHub`,path:`LiveDataHub`},e.spDevicesBriefDetails={key:`switchData2`,path:`SwitchDataHub`},e.spDevicesFullDetails={key:`switchData1`,path:`SwitchDataHub`},e.allDetails=[e.liveDataDetails,e.spDevicesBriefDetails,e.spDevicesFullDetails],e})(Gi||{});var me=F(Oi$1(),1);var pi=class{constructor(){this.data=[],this.label=``,this.unit=``,this.spanGaps=!1}};var Fe=class extends pi{constructor(){super(...arguments),this.directionVariant=AH.RegularConsumption,this.fill=``,this.fillBetweenSet=0,this.fillBetweenColor=``}};var Ts=(()=>{class e{constructor(){this.layoutConfigService=_$1(az),this.dataSubject=new Ze,this.data$=this.dataSubject.asObservable(),this.connectionActive=S(!1),this.connectionState=S(0),this.isSiloveda=H(()=>this.layoutConfigService.layoutConfig().liveDataProvider===qg.Siloveda),this.isSmartPower=H(()=>this.layoutConfigService.layoutConfig().liveDataProvider===qg.Siloveda)}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var pt=F(ks());function Mt(e){return e+.5|0}var Ue=(e,n,t)=>Math.max(Math.min(e,t),n);function xt(e){return Ue(Mt(e*2.55),0,255)}function We(e){return Ue(Mt(e*255),0,255)}function xe(e){return Ue(Mt(e/2.55)/100,0,1)}function Cs(e){return Ue(Mt(e*100),0,100)}var ue={0:0,1:1,2:2,3:3,4:4,5:5,6:6,7:7,8:8,9:9,A:10,B:11,C:12,D:13,E:14,F:15,a:10,b:11,c:12,d:13,e:14,f:15};var Ji=[...`0123456789ABCDEF`];var Wo=e=>Ji[e&15];var Bo=e=>Ji[(e&240)>>4]+Ji[e&15];var bi=e=>(e&240)>>4===(e&15);var Ho=e=>bi(e.r)&&bi(e.g)&&bi(e.b)&&bi(e.a);function zo(e){var n=e.length,t;return e[0]===`#`&&(n===4||n===5?t={r:255&ue[e[1]]*17,g:255&ue[e[2]]*17,b:255&ue[e[3]]*17,a:n===5?ue[e[4]]*17:255}:(n===7||n===9)&&(t={r:ue[e[1]]<<4|ue[e[2]],g:ue[e[3]]<<4|ue[e[4]],b:ue[e[5]]<<4|ue[e[6]],a:n===9?ue[e[7]]<<4|ue[e[8]]:255})),t}var Yo=(e,n)=>e<255?n(e):``;function Vo(e){var n=Ho(e)?Wo:Bo;return e?`#`+n(e.r)+n(e.g)+n(e.b)+Yo(e.a,n):void 0}var Zo=/^(hsla?|hwb|hsv)\(\s*([-+.e\d]+)(?:deg)?[\s,]+([-+.e\d]+)%[\s,]+([-+.e\d]+)%(?:[\s,]+([-+.e\d]+)(%)?)?\s*\)$/;function As(e,n,t){let i=n*Math.min(t,1-t),s=(r,o=(r+e/30)%12)=>t-i*Math.max(Math.min(o-3,9-o,1),-1);return[s(0),s(8),s(4)]}function $o(e,n,t){let i=(s,r=(s+e/60)%6)=>t-t*n*Math.max(Math.min(r,4-r,1),0);return[i(5),i(3),i(1)]}function Ko(e,n,t){let i=As(e,1,.5),s;for(n+t>1&&(s=1/(n+t),n*=s,t*=s),s=0;s<3;s++)i[s]*=1-n-t,i[s]+=n;return i}function Xo(e,n,t,i,s){return e===s?(n-t)/i+(n<t?6:0):n===s?(t-e)/i+2:(e-n)/i+4}function en(e){let t=e.r/255,i=e.g/255,s=e.b/255,r=Math.max(t,i,s),o=Math.min(t,i,s),a=(r+o)/2,c,h,f;return r!==o&&(f=r-o,h=a>.5?f/(2-r-o):f/(r+o),c=Xo(t,i,s,f,r),c=c*60+.5),[c|0,h||0,a]}function tn(e,n,t,i){return(Array.isArray(n)?e(n[0],n[1],n[2]):e(n,t,i)).map(We)}function nn(e,n,t){return tn(As,e,n,t)}function qo(e,n,t){return tn(Ko,e,n,t)}function Go(e,n,t){return tn($o,e,n,t)}function xs(e){return(e%360+360)%360}function Qo(e){let n=Zo.exec(e),t=255,i;if(!n)return;n[5]!==i&&(t=n[6]?xt(+n[5]):We(+n[5]));let s=xs(+n[2]),r=+n[3]/100,o=+n[4]/100;return n[1]===`hwb`?i=qo(s,r,o):n[1]===`hsv`?i=Go(s,r,o):i=nn(s,r,o),{r:i[0],g:i[1],b:i[2],a:t}}function Jo(e,n){var t=en(e);t[0]=xs(t[0]+n),t=nn(t),e.r=t[0],e.g=t[1],e.b=t[2]}function ea(e){if(!e)return;let n=en(e),t=n[0],i=Cs(n[1]),s=Cs(n[2]);return e.a<255?`hsla(${t}, ${i}%, ${s}%, ${xe(e.a)})`:`hsl(${t}, ${i}%, ${s}%)`}var Is={x:`dark`,Z:`light`,Y:`re`,X:`blu`,W:`gr`,V:`medium`,U:`slate`,A:`ee`,T:`ol`,S:`or`,B:`ra`,C:`lateg`,D:`ights`,R:`in`,Q:`turquois`,E:`hi`,P:`ro`,O:`al`,N:`le`,M:`de`,L:`yello`,F:`en`,K:`ch`,G:`arks`,H:`ea`,I:`ightg`,J:`wh`};var ws={OiceXe:`f0f8ff`,antiquewEte:`faebd7`,aqua:`ffff`,aquamarRe:`7fffd4`,azuY:`f0ffff`,beige:`f5f5dc`,bisque:`ffe4c4`,black:`0`,blanKedOmond:`ffebcd`,Xe:`ff`,XeviTet:`8a2be2`,bPwn:`a52a2a`,burlywood:`deb887`,caMtXe:`5f9ea0`,KartYuse:`7fff00`,KocTate:`d2691e`,cSO:`ff7f50`,cSnflowerXe:`6495ed`,cSnsilk:`fff8dc`,crimson:`dc143c`,cyan:`ffff`,xXe:`8b`,xcyan:`8b8b`,xgTMnPd:`b8860b`,xWay:`a9a9a9`,xgYF:`6400`,xgYy:`a9a9a9`,xkhaki:`bdb76b`,xmagFta:`8b008b`,xTivegYF:`556b2f`,xSange:`ff8c00`,xScEd:`9932cc`,xYd:`8b0000`,xsOmon:`e9967a`,xsHgYF:`8fbc8f`,xUXe:`483d8b`,xUWay:`2f4f4f`,xUgYy:`2f4f4f`,xQe:`ced1`,xviTet:`9400d3`,dAppRk:`ff1493`,dApskyXe:`bfff`,dimWay:`696969`,dimgYy:`696969`,dodgerXe:`1e90ff`,fiYbrick:`b22222`,flSOwEte:`fffaf0`,foYstWAn:`228b22`,fuKsia:`ff00ff`,gaRsbSo:`dcdcdc`,ghostwEte:`f8f8ff`,gTd:`ffd700`,gTMnPd:`daa520`,Way:`808080`,gYF:`8000`,gYFLw:`adff2f`,gYy:`808080`,honeyMw:`f0fff0`,hotpRk:`ff69b4`,RdianYd:`cd5c5c`,Rdigo:`4b0082`,ivSy:`fffff0`,khaki:`f0e68c`,lavFMr:`e6e6fa`,lavFMrXsh:`fff0f5`,lawngYF:`7cfc00`,NmoncEffon:`fffacd`,ZXe:`add8e6`,ZcSO:`f08080`,Zcyan:`e0ffff`,ZgTMnPdLw:`fafad2`,ZWay:`d3d3d3`,ZgYF:`90ee90`,ZgYy:`d3d3d3`,ZpRk:`ffb6c1`,ZsOmon:`ffa07a`,ZsHgYF:`20b2aa`,ZskyXe:`87cefa`,ZUWay:`778899`,ZUgYy:`778899`,ZstAlXe:`b0c4de`,ZLw:`ffffe0`,lime:`ff00`,limegYF:`32cd32`,lRF:`faf0e6`,magFta:`ff00ff`,maPon:`800000`,VaquamarRe:`66cdaa`,VXe:`cd`,VScEd:`ba55d3`,VpurpN:`9370db`,VsHgYF:`3cb371`,VUXe:`7b68ee`,VsprRggYF:`fa9a`,VQe:`48d1cc`,VviTetYd:`c71585`,midnightXe:`191970`,mRtcYam:`f5fffa`,mistyPse:`ffe4e1`,moccasR:`ffe4b5`,navajowEte:`ffdead`,navy:`80`,Tdlace:`fdf5e6`,Tive:`808000`,TivedBb:`6b8e23`,Sange:`ffa500`,SangeYd:`ff4500`,ScEd:`da70d6`,pOegTMnPd:`eee8aa`,pOegYF:`98fb98`,pOeQe:`afeeee`,pOeviTetYd:`db7093`,papayawEp:`ffefd5`,pHKpuff:`ffdab9`,peru:`cd853f`,pRk:`ffc0cb`,plum:`dda0dd`,powMrXe:`b0e0e6`,purpN:`800080`,YbeccapurpN:`663399`,Yd:`ff0000`,Psybrown:`bc8f8f`,PyOXe:`4169e1`,saddNbPwn:`8b4513`,sOmon:`fa8072`,sandybPwn:`f4a460`,sHgYF:`2e8b57`,sHshell:`fff5ee`,siFna:`a0522d`,silver:`c0c0c0`,skyXe:`87ceeb`,UXe:`6a5acd`,UWay:`708090`,UgYy:`708090`,snow:`fffafa`,sprRggYF:`ff7f`,stAlXe:`4682b4`,tan:`d2b48c`,teO:`8080`,tEstN:`d8bfd8`,tomato:`ff6347`,Qe:`40e0d0`,viTet:`ee82ee`,JHt:`f5deb3`,wEte:`ffffff`,wEtesmoke:`f5f5f5`,Lw:`ffff00`,LwgYF:`9acd32`};function ta(){let e={},n=Object.keys(ws),t=Object.keys(Is),i,s,r,o,a;for(i=0;i<n.length;i++){for(o=a=n[i],s=0;s<t.length;s++)r=t[s],a=a.replace(r,Is[r]);r=parseInt(ws[o],16),e[a]=[r>>16&255,r>>8&255,r&255]}return e}var Si;function ia(e){Si||(Si=ta(),Si.transparent=[0,0,0,0]);let n=Si[e.toLowerCase()];return n&&{r:n[0],g:n[1],b:n[2],a:n.length===4?n[3]:255}}var na=/^rgba?\(\s*([-+.\d]+)(%)?[\s,]+([-+.e\d]+)(%)?[\s,]+([-+.e\d]+)(%)?(?:[\s,/]+([-+.e\d]+)(%)?)?\s*\)$/;function sa(e){let n=na.exec(e),t=255,i,s,r;if(n){if(n[7]!==i){let o=+n[7];t=n[8]?xt(o):Ue(o*255,0,255)}
vendor: 5,657 bytes, line 3
3return i=+n[1],s=+n[3],r=+n[5],i=255&(n[2]?xt(i):Ue(i,0,255)),s=255&(n[4]?xt(s):Ue(s,0,255)),r=255&(n[6]?xt(r):Ue(r,0,255)),{r:i,g:s,b:r,a:t}}}function ra(e){return e&&(e.a<255?`rgba(${e.r}, ${e.g}, ${e.b}, ${xe(e.a)})`:`rgb(${e.r}, ${e.g}, ${e.b})`)}var Qi=e=>e<=.0031308?e*12.92:Math.pow(e,1/2.4)*1.055-.055;var ft=e=>e<=.04045?e/12.92:Math.pow((e+.055)/1.055,2.4);function oa(e,n,t){let i=ft(xe(e.r)),s=ft(xe(e.g)),r=ft(xe(e.b));return{r:We(Qi(i+t*(ft(xe(n.r))-i))),g:We(Qi(s+t*(ft(xe(n.g))-s))),b:We(Qi(r+t*(ft(xe(n.b))-r))),a:e.a+t*(n.a-e.a)}}function yi(e,n,t){if(e){let i=en(e);i[n]=Math.max(0,Math.min(i[n]+i[n]*t,n===0?360:1)),i=nn(i),e.r=i[0],e.g=i[1],e.b=i[2]}}function Ps(e,n){return e&&Object.assign(n||{},e)}function Ds(e){var n={r:0,g:0,b:0,a:255};return Array.isArray(e)?e.length>=3&&(n={r:e[0],g:e[1],b:e[2],a:255},e.length>3&&(n.a=We(e[3]))):(n=Ps(e,{r:0,g:0,b:0,a:1}),n.a=We(n.a)),n}function aa(e){return e.charAt(0)===`r`?sa(e):Qo(e)}var Pt=class e{constructor(n){if(n instanceof e)return n;let t=typeof n,i;t===`object`?i=Ds(n):t===`string`&&(i=zo(n)||ia(n)||aa(n)),this._rgb=i,this._valid=!!i}get valid(){return this._valid}get rgb(){var n=Ps(this._rgb);return n&&(n.a=xe(n.a)),n}set rgb(n){this._rgb=Ds(n)}rgbString(){return this._valid?ra(this._rgb):void 0}hexString(){return this._valid?Vo(this._rgb):void 0}hslString(){return this._valid?ea(this._rgb):void 0}mix(n,t){if(n){let i=this.rgb,s=n.rgb,r,o=t===r?.5:t,a=2*o-1,c=i.a-s.a,h=((a*c===-1?a:(a+c)/(1+a*c))+1)/2;r=1-h,i.r=255&h*i.r+r*s.r+.5,i.g=255&h*i.g+r*s.g+.5,i.b=255&h*i.b+r*s.b+.5,i.a=o*i.a+(1-o)*s.a,this.rgb=i}return this}interpolate(n,t){return n&&(this._rgb=oa(this._rgb,n._rgb,t)),this}clone(){return new e(this.rgb)}alpha(n){return this._rgb.a=We(n),this}clearer(n){let t=this._rgb;return t.a*=1-n,this}greyscale(){let n=this._rgb;return n.r=n.g=n.b=Mt(n.r*.3+n.g*.59+n.b*.11),this}opaquer(n){let t=this._rgb;return t.a*=1+n,this}negate(){let n=this._rgb;return n.r=255-n.r,n.g=255-n.g,n.b=255-n.b,this}lighten(n){return yi(this._rgb,2,n),this}darken(n){return yi(this._rgb,2,-n),this}saturate(n){return yi(this._rgb,1,n),this}desaturate(n){return yi(this._rgb,1,-n),this}rotate(n){return Jo(this._rgb,n),this}};function ca(){}var la=(()=>{let e=0;return()=>e++})();function Je(e){return e==null}function he(e){if(Array.isArray&&Array.isArray(e))return!0;let n=Object.prototype.toString.call(e);return n.slice(0,7)===`[object`&&n.slice(-6)===`Array]`}function Q(e){return e!==null&&Object.prototype.toString.call(e)===`[object Object]`}function ln(e){return(typeof e==`number`||e instanceof Number)&&isFinite(+e)}function ua(e,n){return ln(e)?e:n}function se(e,n){return typeof e>`u`?n:e}var ha=(e,n)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100:+e/n;var Us=(e,n)=>typeof e==`string`&&e.endsWith(`%`)?parseFloat(e)/100*n:+e;function _(e,n,t){if(e&&typeof e.call==`function`)return e.apply(t,n)}function Te(e,n,t,i){let s,r,o;if(he(e))if(r=e.length,i)for(s=r-1;s>=0;s--)n.call(t,e[s],s);else for(s=0;s<r;s++)n.call(t,e[s],s);else if(Q(e))for(o=Object.keys(e),r=o.length,s=0;s<r;s++)n.call(t,e[o[s]],o[s])}function fa(e,n){let t,i,s,r;if(!e||!n||e.length!==n.length)return!1;for(t=0,i=e.length;t<i;++t)if(s=e[t],r=n[t],s.datasetIndex!==r.datasetIndex||s.index!==r.index)return!1;return!0}function Ot(e){if(he(e))return e.map(Ot);if(Q(e)){let n=Object.create(null),t=Object.keys(e),i=t.length,s=0;for(;s<i;++s)n[t[s]]=Ot(e[t[s]]);return n}return e}function Ws(e){return[`__proto__`,`prototype`,`constructor`].indexOf(e)===-1}function Bs(e,n,t,i){if(!Ws(e))return;let s=n[e],r=t[e];Q(s)&&Q(r)?_t(s,r,i):n[e]=Ot(r)}function _t(e,n,t){let i=he(n)?n:[n],s=i.length;if(!Q(e))return e;t=t||{};let r=t.merger||Bs,o;for(let a=0;a<s;++a){if(o=i[a],!Q(o))continue;let c=Object.keys(o);for(let h=0,f=c.length;h<f;++h)r(c[h],e,o,t)}return e}function Hs(e,n){return _t(e,n,{merger:zs})}function zs(e,n,t){if(!Ws(e))return;let i=n[e],s=t[e];Q(i)&&Q(s)?Hs(i,s):Object.prototype.hasOwnProperty.call(n,e)||(n[e]=Ot(s))}var Ms={"":e=>e,x:e=>e.x,y:e=>e.y};function Ys(e){let n=e.split(`.`),t=[],i=``;for(let s of n)i+=s,i.endsWith(`\\`)?i=i.slice(0,-1)+`.`:(t.push(i),i=``);return t}function da(e){let n=Ys(e);return t=>{for(let i of n){if(i===``)break;t=t&&t[i]}return t}}function un(e,n){return(Ms[n]||(Ms[n]=da(n)))(e)}function hn(e){return e.charAt(0).toUpperCase()+e.slice(1)}var ma=e=>typeof e<`u`;var Lt=e=>typeof e==`function`;var ga=(e,n)=>{if(e.size!==n.size)return!1;for(let t of e)if(!n.has(t))return!1;return!0};function pa(e){return e.type===`mouseup`||e.type===`click`||e.type===`contextmenu`}var V=Math.PI;var de=2*V;var Vs=de+V;var jt=Number.POSITIVE_INFINITY;var Zs=V/180;var ye=V/2;var Be=V/4;var rn=V*2/3;var Ai=Math.log10;var dt=Math.sign;function gt(e,n,t){return Math.abs(e-n)<t}function va(e){let n=Math.round(e);e=gt(e,n,e/1e3)?n:e;let t=Math.pow(10,Math.floor(Ai(e))),i=e/t;return(i<=1?1:i<=2?2:i<=5?5:10)*t}function ba(e){let n=[],t=Math.sqrt(e),i;for(i=1;i<t;i++)e%i===0&&(n.push(i),n.push(e/i));return t===(t|0)&&n.push(t),n.sort((s,r)=>s-r).pop(),n}function Sa(e){return typeof e==`symbol`||typeof e==`object`&&e!==null&&!(Symbol.toPrimitive in e||`toString`in e||`valueOf`in e)}function ya(e){return!Sa(e)&&!isNaN(parseFloat(e))&&isFinite(e)}function Ta(e,n){let t=Math.round(e);return t-n<=e&&t+n>=e}function ka(e,n,t){let i,s,r;for(i=0,s=e.length;i<s;i++)r=e[i][t],isNaN(r)||(n.min=Math.min(n.min,r),n.max=Math.max(n.max,r))}function Ca(e){return e*(V/180)}function Ia(e){return e*(180/V)}function wa(e){if(!ln(e))return;let n=1,t=0;for(;Math.round(e*n)/n!==e;)n*=10,t++;return t}function Da(e,n){let t=n.x-e.x,i=n.y-e.y,s=Math.sqrt(t*t+i*i),r=M
3ath.atan2(i,t);return r<-.5*V&&(r+=de),{angle:r,distance:s}}function on(e,n){return Math.sqrt(Math.pow(n.x-e.x,2)+Math.pow(n.y-e.y,2))}function $s(e,n){return(e-n+Vs)%de-V}function Pe(e){return(e%de+de)%de}function Ks(e,n,t,i){let s=Pe(e),r=Pe(n),o=Pe(t),a=Pe(r-s),c=Pe(o-s),h=Pe(s-r),f=Pe(s-o);return s===r||s===o||i&&r===o||a>c&&h<f}function xi(e,n,t){return Math.max(n,Math.min(t,e))}function Aa(e){return xi(e,-32768,32767)}function Xs(e,n,t,i=1e-6){return e>=Math.min(n,t)-i&&e<=Math.max(n,t)+i}function fn(e,n,t){t=t||(o=>e[o]<n);let i=e.length-1,s=0,r;for(;i-s>1;)r=s+i>>1,t(r)?s=r:i=r;return{lo:s,hi:i}}var Et=(e,n,t,i)=>fn(e,t,i?s=>{let r=e[s][n];return r<t||r===t&&e[s+1][n]===t}:s=>e[s][n]<t);var xa=(e,n,t)=>fn(e,t,i=>e[i][n]>=t);function Pa(e,n,t){let i=0,s=e.length;for(;i<s&&e[i]<n;)i++;for(;s>i&&e[s-1]>t;)s--;return i>0||s<e.length?e.slice(i,s):e}var qs=[`push`,`pop`,`shift`,`splice`,`unshift`];function Ma(e,n){if(e._chartjs){e._chartjs.listeners.push(n);return}Object.defineProperty(e,"_chartjs",{configurable:!0,enumerable:!1,value:{listeners:[n]}}),qs.forEach(t=>{let i=`_onData`+hn(t),s=e[t];Object.defineProperty(e,t,{configurable:!0,enumerable:!1,value(...r){let o=s.apply(this,r);return e._chartjs.listeners.forEach(a=>{typeof a[i]==`function`&&a[i](...r)}),o}})})}function Ea(e,n){let t=e._chartjs;if(!t)return;let i=t.listeners,s=i.indexOf(n);s!==-1&&i.splice(s,1),!(i.length>0)&&(qs.forEach(r=>{delete e[r]}),delete e._chartjs)}function Na(e){let n=new Set(e);return n.size===e.length?e:Array.from(n)}var Gs=(function(){return typeof window>`u`?function(e){return e()}:window.requestAnimationFrame})();function Oa(e,n){let t=[],i=!1;return function(...s){t=s,i||(i=!0,Gs.call(window,()=>{i=!1,e.apply(n,t)}))}}function _a(e,n){let t;return function(...i){return n?(clearTimeout(t),t=setTimeout(e,n,i)):e.apply(this,i),n}}var La=e=>e===`start`?`left`:e===`end`?`right`:`center`;var ja=(e,n,t)=>e===`start`?n:e===`end`?t:(n+t)/2;var Ra=(e,n,t,i)=>e===(i?`left`:`right`)?t:e===`center`?(n+t)/2:n;function Fa(e,n,t){let i=n.length,s=0,r=i;if(e._sorted){let{iScale:o,vScale:a,_parsed:c}=e,h=e.dataset&&e.dataset.options?e.dataset.options.spanGaps:null,f=o.axis,{min:m,max:p,minDefined:v,maxDefined:b}=o.getUserBounds();if(v){if(s=Math.min(Et(c,f,m).lo,t?i:Et(n,f,o.getPixelForValue(m)).lo),h){let T=c.slice(0,s+1).reverse().findIndex(k=>!Je(k[a.axis]));s-=Math.max(0,T)}s=xi(s,0,i-1)}if(b){let T=Math.max(Et(c,o.axis,p,!0).hi+1,t?0:Et(n,f,o.getPixelForValue(p),!0).hi+1);if(h){let k=c.slice(T-1).findIndex(I=>!Je(I[a.axis]));T+=Math.max(0,k)}r=xi(T,s,i)-s}else r=i-s}return{start:s,count:r}}function Ua(e){let{xScale:n,yScale:t,_scaleRanges:i}=e,s={xmin:n.min,xmax:n.max,ymin:t.min,ymax:t.max};if(!i)return e._scaleRanges=s,!0;let r=i.xmin!==n.min||i.xmax!==n.max||i.ymin!==t.min||i.ymax!==t.max;return Object.assign(i,s),r}var Ti=e=>e===0||e===1;var Es=(e,n,t)=>-(Math.pow(2,10*(e-=1))*Math.sin((e-n)*de/t));var Ns=(e,n,t)=>Math.pow(2,-10*e)*Math.sin((e-n)*de/t)+1;var wi={linear:e=>e,easeInQuad:e=>e*e,easeOutQuad:e=>-e*(e-2),easeInOutQuad:e=>(e/=.5)<1?.5*e*e:-.5*(--e*(e-2)-1),easeInCubic:e=>e*e*e,easeOutCubic:e=>(e-=1)*e*e+1,easeInOutCubic:e=>(e/=.5)<1?.5*e*e*e:.5*((e-=2)*e*e+2),easeInQuart:e=>e*e*e*e,easeOutQuart:e=>-((e-=1)*e*e*e-1),easeInOutQuart:e=>(e/=.5)<1?.5*e*e*e*e:-.5*((e-=2)*e*e*e-2),easeInQuint:e=>e*e*e*e*e,easeOutQuint:e=>(e-=1)*e*e*e*e+1,easeInOutQuint:e=>(e/=.5)<1?.5*e*e*e*e*e:.5*((e-=2)*e*e*e*e+2),easeInSine:e=>-Math.cos(e*ye)+1,easeOutSine:e=>Math.sin(e*ye),easeInOutSine:e=>-.5*(Math.cos(V*e)-1),easeInExpo:e=>e===0?0:Math.pow(2,10*(e-1)),easeOutExpo:e=>e===1?1:-Math.pow(2,-10*e)+1,easeInOutExpo:e=>Ti(e)?e:e<.5?.5*Math.pow(2,10*(e*2-1)):.5*(-Math.pow(2,-10*(e*2-1))+2),easeInCirc:e=>e>=1?e:-(Math.sqrt(1-e*e)-1),easeOutCirc:e=>Math.sqrt(1-(e-=1)*e),easeInOutCirc:e=>(e/=.5)<1?-.5*(Math.sqrt(1-e*e)-1):.5*(Math.sqrt(1-(e-=2)*e)+1),easeInElastic:e=>Ti(e)?e:Es(e,.075,.3),easeOutElastic:e=>Ti(e)?e:Ns(e,.075,.3),easeInOutElastic(e){return Ti(e)?e:e<.5?.5*Es(e*2,.1125,.45):.5+.5*Ns(e*2-1,.1125,.45)},easeInBack(e){return e*e*(2.70158*e-1.70158)},easeOutBack(e){return(e-=1)*e*(2.70158*e+1.70158)+1},easeInOutBack(e){let n=1.70158;return(e/=.5)<1?.5*(e*e*(((n*=1.525)+1)*e-n)):.5*((e-=2)*e*(((n*=1.525)+1)*e+n)+2)},easeInBounce:e=>1-wi.easeOutBounce(1-e),easeOutBounce(e){return e<1/2.75?7.5625*e*e:e<2/2.75?7.5625*(e-=1.5/2.75)*e+.75:e<2.5/2.75?7.5625*(e-=2.25/2.75)*e+.9375:7.5625*(e-=2.625/2.75)*e+.984375},easeInOutBounce:e=>e<.5?wi.easeInBounce(e*2)*.5:wi.easeOutBounce(e*2-1)*.5+.5};function Mi(e){if(e&&typeof e==`object`){let n=e.toString();return n===`[object CanvasPattern]`||n===`[object CanvasGradient]`}return!1}function Wa(e){return Mi(e)?e:new Pt(e)}function Di(e){return Mi(e)?e:new Pt(e).saturate(.5).darken(.1).hexString()}var Ba=[`x`,`y`,`borderWidth`,`radius`,`tension`];var Ha=[`color`,`borderColor`,`backgroundColor`];function za(e){e.set(`animation`,{delay:void 0,duration:1e3,easing:`easeOutQuart`,fn:void 0,from:void 0,loop:void 0,to:void 0,type:void 0}),e.describe(`animation`,{_fallback:!1,_indexable:!1,_scriptable:n=>n!==`onProgress`&&n!==`onComplete`&&n!==`fn`}
vendor: 3,750 bytes, line 3
3),e.set(`animations`,{colors:{type:`color`,properties:Ha},numbers:{type:`number`,properties:Ba}}),e.describe(`animations`,{_fallback:`animation`}),e.set(`transitions`,{active:{animation:{duration:400}},resize:{animation:{duration:0}},show:{animations:{colors:{from:`transparent`},visible:{type:`boolean`,duration:0}}},hide:{animations:{colors:{to:`transparent`},visible:{type:`boolean`,easing:`linear`,fn:n=>n|0}}}})}function Ya(e){e.set(`layout`,{autoPadding:!0,padding:{top:0,right:0,bottom:0,left:0}})}var Os=new Map;function Va(e,n){n=n||{};let t=e+JSON.stringify(n),i=Os.get(t);return i||(i=new Intl.NumberFormat(e,n),Os.set(t,i)),i}function Qs(e,n,t){return Va(n,t).format(e)}var Js={values(e){return he(e)?e:``+e},numeric(e,n,t){if(e===0)return`0`;let i=this.chart.options.locale,s,r=e;if(t.length>1){let h=Math.max(Math.abs(t[0].value),Math.abs(t[t.length-1].value));(h<1e-4||h>0x38d7ea4c68000)&&(s=`scientific`),r=Za(e,t)}let o=Ai(Math.abs(r)),a=isNaN(o)?1:Math.max(Math.min(-1*Math.floor(o),20),0),c={notation:s,minimumFractionDigits:a,maximumFractionDigits:a};return Object.assign(c,this.options.ticks.format),Qs(e,i,c)},logarithmic(e,n,t){if(e===0)return`0`;let i=t[n].significand||e/Math.pow(10,Math.floor(Ai(e)));return[1,2,3,5,10,15].includes(i)||n>.8*t.length?Js.numeric.call(this,e,n,t):``}};function Za(e,n){let t=n.length>3?n[2].value-n[1].value:n[1].value-n[0].value;return Math.abs(t)>=1&&e!==Math.floor(e)&&(t=e-Math.floor(e)),t}var $a={formatters:Js};function Ka(e){e.set(`scale`,{display:!0,offset:!1,reverse:!1,beginAtZero:!1,bounds:`ticks`,clip:!0,grace:0,grid:{display:!0,lineWidth:1,drawOnChartArea:!0,drawTicks:!0,tickLength:8,tickWidth:(n,t)=>t.lineWidth,tickColor:(n,t)=>t.color,offset:!1},border:{display:!0,dash:[],dashOffset:0,width:1},title:{display:!1,text:``,padding:{top:4,bottom:4}},ticks:{minRotation:0,maxRotation:50,mirror:!1,textStrokeWidth:0,textStrokeColor:``,padding:3,display:!0,autoSkip:!0,autoSkipPadding:3,labelOffset:0,callback:$a.formatters.values,minor:{},major:{},align:`center`,crossAlign:`near`,showLabelBackdrop:!1,backdropColor:`rgba(255, 255, 255, 0.75)`,backdropPadding:2}}),e.route(`scale.ticks`,`color`,``,`color`),e.route(`scale.grid`,`color`,``,`borderColor`),e.route(`scale.border`,`color`,``,`borderColor`),e.route(`scale.title`,`color`,``,`color`),e.describe(`scale`,{_fallback:!1,_scriptable:n=>!n.startsWith(`before`)&&!n.startsWith(`after`)&&n!==`callback`&&n!==`parser`,_indexable:n=>n!==`borderDash`&&n!==`tickBorderDash`&&n!==`dash`}),e.describe(`scales`,{_fallback:`scale`}),e.describe(`scale.ticks`,{_scriptable:n=>n!==`backdropPadding`&&n!==`callback`,_indexable:n=>n!==`backdropPadding`})}var Xa=Object.create(null);var qa=Object.create(null);function Nt(e,n){if(!n)return e;let t=n.split(`.`);for(let i=0,s=t.length;i<s;++i){let r=t[i];e=e[r]||(e[r]=Object.create(null))}return e}function sn(e,n,t){return typeof n==`string`?_t(Nt(e,n),t):_t(Nt(e,``),n)}var an=class{constructor(n,t){this.animation=void 0,this.backgroundColor=`rgba(0,0,0,0.1)`,this.borderColor=`rgba(0,0,0,0.1)`,this.color=`#666`,this.datasets={},this.devicePixelRatio=i=>i.chart.platform.getDevicePixelRatio(),this.elements={},this.events=[`mousemove`,`mouseout`,`click`,`touchstart`,`touchmove`],this.font={family:`'Helvetica Neue', 'Helvetica', 'Arial', sans-serif`,size:12,style:`normal`,lineHeight:1.2,weight:null},this.hover={},this.hoverBackgroundColor=(i,s)=>Di(s.backgroundColor),this.hoverBorderColor=(i,s)=>Di(s.borderColor),this.hoverColor=(i,s)=>Di(s.color),this.indexAxis=`x`,this.interaction={mode:`nearest`,intersect:!0,includeInvisible:!1},this.maintainAspectRatio=!0,this.onHover=null,this.onClick=null,this.parsing=!0,this.plugins={},this.responsive=!0,this.scale=void 0,this.scales={}
vendor: 4,460 bytes, line 3
3,this.showLine=!0,this.drawActiveElementsOnTop=!0,this.describe(n),this.apply(t)}set(n,t){return sn(this,n,t)}get(n){return Nt(this,n)}describe(n,t){return sn(qa,n,t)}override(n,t){return sn(Xa,n,t)}route(n,t,i,s){let r=Nt(this,n),o=Nt(this,i),a=`_`+t;Object.defineProperties(r,{[a]:{value:r[t],writable:!0},[t]:{enumerable:!0,get(){let c=this[a],h=o[s];return Q(c)?Object.assign({},h,c):se(c,h)},set(c){this[a]=c}}})}apply(n){n.forEach(t=>t(this))}};var Ga=new an({_scriptable:e=>!e.startsWith(`on`),_indexable:e=>e!==`events`,hover:{_fallback:`interaction`},interaction:{_scriptable:!1,_indexable:!1}},[za,Ya,Ka]);function er(e){return!e||Je(e.size)||Je(e.family)?null:(e.style?e.style+` `:``)+(e.weight?e.weight+` `:``)+e.size+`px `+e.family}function cn(e,n,t,i,s){let r=n[s];return r||(r=n[s]=e.measureText(s).width,t.push(s)),r>i&&(i=r),i}function Qa(e,n,t,i){i=i||{};let s=i.data=i.data||{},r=i.garbageCollect=i.garbageCollect||[];i.font!==n&&(s=i.data={},r=i.garbageCollect=[],i.font=n),e.save(),e.font=n;let o=0,a=t.length,c,h,f,m,p;for(c=0;c<a;c++)if(m=t[c],m!=null&&!he(m))o=cn(e,s,r,o,m);else if(he(m))for(h=0,f=m.length;h<f;h++)p=m[h],p!=null&&!he(p)&&(o=cn(e,s,r,o,p));e.restore();let v=r.length/2;if(v>t.length){for(c=0;c<v;c++)delete s[r[c]];r.splice(0,v)}return o}function Ja(e,n,t){let i=e.currentDevicePixelRatio,s=t!==0?Math.max(t/2,.5):0;return Math.round((n-s)*i)/i+s}function ec(e,n){!n&&!e||(n=n||e.getContext(`2d`),n.save(),n.resetTransform(),n.clearRect(0,0,e.width,e.height),n.restore())}function tc(e,n,t,i){tr(e,n,t,i,null)}function tr(e,n,t,i,s){let r,o,a,c,h,f,m,p,v=n.pointStyle,b=n.rotation,T=n.radius,k=(b||0)*Zs;if(v&&typeof v==`object`&&(r=v.toString(),r===`[object HTMLImageElement]`||r===`[object HTMLCanvasElement]`)){e.save(),e.translate(t,i),e.rotate(k),e.drawImage(v,-v.width/2,-v.height/2,v.width,v.height),e.restore();return}if(!(isNaN(T)||T<=0)){switch(e.beginPath(),v){default:s?e.ellipse(t,i,s/2,T,0,0,de):e.arc(t,i,T,0,de),e.closePath();break;case`triangle`:f=s?s/2:T,e.moveTo(t+Math.sin(k)*f,i-Math.cos(k)*T),k+=rn,e.lineTo(t+Math.sin(k)*f,i-Math.cos(k)*T),k+=rn,e.lineTo(t+Math.sin(k)*f,i-Math.cos(k)*T),e.closePath();break;case`rectRounded`:h=T*.516,c=T-h,o=Math.cos(k+Be)*c,m=Math.cos(k+Be)*(s?s/2-h:c),a=Math.sin(k+Be)*c,p=Math.sin(k+Be)*(s?s/2-h:c),e.arc(t-m,i-a,h,k-V,k-ye),e.arc(t+p,i-o,h,k-ye,k),e.arc(t+m,i+a,h,k,k+ye),e.arc(t-p,i+o,h,k+ye,k+V),e.closePath();break;case`rect`:if(!b){c=Math.SQRT1_2*T,f=s?s/2:c,e.rect(t-f,i-c,2*f,2*c);break}k+=Be;case`rectRot`:m=Math.cos(k)*(s?s/2:T),o=Math.cos(k)*T,a=Math.sin(k)*T,p=Math.sin(k)*(s?s/2:T),e.moveTo(t-m,i-a),e.lineTo(t+p,i-o),e.lineTo(t+m,i+a),e.lineTo(t-p,i+o),e.closePath();break;case`crossRot`:k+=Be;case`cross`:m=Math.cos(k)*(s?s/2:T),o=Math.cos(k)*T,a=Math.sin(k)*T,p=Math.sin(k)*(s?s/2:T),e.moveTo(t-m,i-a),e.lineTo(t+m,i+a),e.moveTo(t+p,i-o),e.lineTo(t-p,i+o);break;case`star`:m=Math.cos(k)*(s?s/2:T),o=Math.cos(k)*T,a=Math.sin(k)*T,p=Math.sin(k)*(s?s/2:T),e.moveTo(t-m,i-a),e.lineTo(t+m,i+a),e.moveTo(t+p,i-o),e.lineTo(t-p,i+o),k+=Be,m=Math.cos(k)*(s?s/2:T),o=Math.cos(k)*T,a=Math.sin(k)*T,p=Math.sin(k)*(s?s/2:T),e.moveTo(t-m,i-a),e.lineTo(t+m,i+a),e.moveTo(t+p,i-o),e.lineTo(t-p,i+o);break;case`line`:o=s?s/2:Math.cos(k)*T,a=Math.sin(k)*T,e.moveTo(t-o,i-a),e.lineTo(t+o,i+a);break;case`dash`:e.moveTo(t,i),e.lineTo(t+Math.cos(k)*(s?s/2:T),i+Math.sin(k)*T);break;case!1:e.closePath();break}e.fill(),n.borderWidth>0&&e.stroke()}}function Rt(e,n,t){return t=t||.5,!n||e&&e.x>n.left-t&&e.x<n.right+t&&e.y>n.top-t&&e.y<n.bottom+t}function ic(e,n){e.save(),e.beginPath(),e.rect(n.left,n.top,n.right-n.left,n.bottom-n.top),e.clip()}function nc(e){e.restore()}function sc(e,n,t,i,s){if(!n)return e.lineTo(t.x,t.y);if(s===`middle`){let r=(n.x+t.x)/2;e.lineTo(r,n.y),e.lineTo(r,t.y)}else s===`after`!=!!i?e.lineTo(n.x,t.y):e.lineTo(t.x,n.y);e.lineTo(t.x,t.y)}function rc(e,n,t,i){if(!n)return e.lineTo(t.x,t.y);e.bezierCurveTo(i?n.cp1x:n.cp2x,i?n.cp1y:n.cp2y,i?t.cp2x:t.cp1x,i?t.cp2y:t.cp1y,t.x,t.y)}function oc(e,n){n.translation&&e.translate(n.translation[0],n.translation[1]),Je(n.rotation)||e.rotate(n.rotation),n.color&&(e.fillStyle=n.color),n.textAlign&&(e.textAlign=n.textAlign),n.textBaseline&&(e.textBaseline=n.textBaseline)}function ac(e,n,t,i,s){if(s.strikethrough||s.underline){let r=e.measureText(i),o=n-r.actualBoundingBoxLeft,a=n+r.actualBoundingBoxRight,c=t-r.actualBoundingBoxAscent,h=t+r.actualBoundingBoxDescent,f=s.strikethrough?(c+h
vendor: 5,525 bytes, line 3
3)/2:h;e.strokeStyle=e.fillStyle,e.beginPath(),e.lineWidth=s.decorationWidth||2,e.moveTo(o,f),e.lineTo(a,f),e.stroke()}}function cc(e,n){let t=e.fillStyle;e.fillStyle=n.color,e.fillRect(n.left,n.top,n.width,n.height),e.fillStyle=t}function lc(e,n,t,i,s,r={}){let o=he(n)?n:[n],a=r.strokeWidth>0&&r.strokeColor!==``,c,h;for(e.save(),e.font=s.string,oc(e,r),c=0;c<o.length;++c)h=o[c],r.backdrop&&cc(e,r.backdrop),a&&(r.strokeColor&&(e.strokeStyle=r.strokeColor),Je(r.strokeWidth)||(e.lineWidth=r.strokeWidth),e.strokeText(h,t,i,r.maxWidth)),e.fillText(h,t,i,r.maxWidth),ac(e,t,i,h,r),i+=Number(s.lineHeight);e.restore()}function uc(e,n){let{x:t,y:i,w:s,h:r,radius:o}=n;e.arc(t+o.topLeft,i+o.topLeft,o.topLeft,1.5*V,V,!0),e.lineTo(t,i+r-o.bottomLeft),e.arc(t+o.bottomLeft,i+r-o.bottomLeft,o.bottomLeft,V,ye,!0),e.lineTo(t+s-o.bottomRight,i+r),e.arc(t+s-o.bottomRight,i+r-o.bottomRight,o.bottomRight,ye,0,!0),e.lineTo(t+s,i+o.topRight),e.arc(t+s-o.topRight,i+o.topRight,o.topRight,0,-ye,!0),e.lineTo(t+o.topLeft,i)}var hc=/^(normal|(\d+(?:\.\d+)?)(px|em|%)?)$/;var fc=/^(normal|italic|initial|inherit|unset|(oblique( -?[0-9]?[0-9]deg)?))$/;function ir(e,n){let t=(``+e).match(hc);if(!t||t[1]===`normal`)return n*1.2;switch(e=+t[2],t[3]){case`px`:return e;case`%`:e/=100;break}return n*e}var dc=e=>+e||0;function dn(e,n){let t={},i=Q(n),s=i?Object.keys(n):n,r=Q(e)?i?o=>se(e[o],e[n[o]]):o=>e[o]:()=>e;for(let o of s)t[o]=dc(r(o));return t}function nr(e){return dn(e,{top:`y`,right:`x`,bottom:`y`,left:`x`})}function mc(e){return dn(e,[`topLeft`,`topRight`,`bottomLeft`,`bottomRight`])}function gc(e){let n=nr(e);return n.width=n.left+n.right,n.height=n.top+n.bottom,n}function pc(e,n){e=e||{},n=n||Ga.font;let t=se(e.size,n.size);typeof t==`string`&&(t=parseInt(t,10));let i=se(e.style,n.style);i&&!(``+i).match(fc)&&(console.warn(`Invalid font style specified: "`+i+`"`),i=void 0);let s={family:se(e.family,n.family),lineHeight:ir(se(e.lineHeight,n.lineHeight),t),size:t,style:i,weight:se(e.weight,n.weight),string:``};return s.string=er(s),s}function vc(e,n,t,i){let s=!0,r,o,a;for(r=0,o=e.length;r<o;++r)if(a=e[r],a!==void 0&&(n!==void 0&&typeof a==`function`&&(a=a(n),s=!1),t!==void 0&&he(a)&&(a=a[t%a.length],s=!1),a!==void 0))return i&&!s&&(i.cacheable=!1),a}function bc(e,n,t){let{min:i,max:s}=e,r=Us(n,(s-i)/2),o=(a,c)=>t&&a===0?0:a+c;return{min:o(i,-Math.abs(r)),max:o(s,r)}}function sr(e,n){return Object.assign(Object.create(e),n)}function mn(e,n=[``],t,i,s=()=>e[0]){let r=t||e;typeof i>`u`&&(i=cr(`_fallback`,e));return new Proxy({[Symbol.toStringTag]:`Object`,_cacheable:!0,_scopes:e,_rootScopes:r,_fallback:i,_getTarget:s,override:a=>mn([a,...e],n,r,i)},{deleteProperty(a,c){return delete a[c],delete a._keys,delete e[0][c],!0},get(a,c){return or(a,c,()=>Dc(c,n,e,a))},getOwnPropertyDescriptor(a,c){return Reflect.getOwnPropertyDescriptor(a._scopes[0],c)},getPrototypeOf(){return Reflect.getPrototypeOf(e[0])},has(a,c){return Ls(a).includes(c)},ownKeys(a){return Ls(a)},set(a,c,h){let f=a._storage||(a._storage=s());return a[c]=f[c]=h,delete a._keys,!0}})}function Ft(e,n,t,i){let s={_cacheable:!1,_proxy:e,_context:n,_subProxy:t,_stack:new Set,_descriptors:rr(e,i),setContext:r=>Ft(e,r,t,i),override:r=>Ft(e.override(r),n,t,i)};return new Proxy(s,{deleteProperty(r,o){return delete r[o],delete e[o],!0},get(r,o,a){return or(r,o,()=>yc(r,o,a))},getOwnPropertyDescriptor(r,o){return r._descriptors.allKeys?Reflect.has(e,o)?{enumerable:!0,configurable:!0}:void 0:Reflect.getOwnPropertyDescriptor(e,o)},getPrototypeOf(){return Reflect.getPrototypeOf(e)},has(r,o){return Reflect.has(e,o)},ownKeys(){return Reflect.ownKeys(e)},set(r,o,a){return e[o]=a,delete r[o],!0}})}function rr(e,n={scriptable:!0,indexable:!0}){let{_scriptable:t=n.scriptable,_indexable:i=n.indexable,_allKeys:s=n.allKeys}=e;return{allKeys:s,scriptable:t,indexable:i,isScriptable:Lt(t)?t:()=>t,isIndexable:Lt(i)?i:()=>i}}var Sc=(e,n)=>e?e+hn(n):n;var gn=(e,n)=>Q(n)&&e!==`adapters`&&(Object.getPrototypeOf(n)===null||n.constructor===Object);function or(e,n,t){if(Object.prototype.hasOwnProperty.call(e,n)||n===`constructor`)return e[n];let i=t();return e[n]=i,i}function yc(e,n,t){let{_proxy:i,_context:s,_subProxy:r,_descriptors:o}=e,a=i[n];return Lt(a)&&o.isScriptable(n)&&(a=Tc(n,a,e,t)),he(a)&&a.length&&(a=kc(n,a,e,o.isIndexable)),gn(n,a)&&(a=Ft(a,s,r&&r[n],o)),a}function Tc(e,n,t,i){let{_proxy:s,_context:r,_subProxy:o,_stack:a}=t;if(a.has(e))throw new Error(`Recursion detected: `+Array.from(a).join(`->`)+`->`+e);a.add(e);let c=n(r,o||i);return a.delete(e),gn(e,c)&&(c=pn(s._scopes,s,e,c)),c}function kc(e,n,t,i){let{_proxy:s,_context:r,_subProxy:o,_descriptors:a}=t;if(typeof r.index<`u`&&i(e))return n[r.index%n.length];if(Q(n[0])){let c=n,h=s._scopes.filter(f=>f!==c);n=[];for(let f of c){let m=pn(h,s,e,f);n.push(Ft(m,r,o&&o[e],a))}}return n}function ar(e,n,t){return Lt(e)?e(n,t):e}var Cc=(e,n)=>e===!0?n:typeof e==`string`?un(n,e):void 0;function Ic(e,n,t,i,s){for(let r of n){let o=Cc(t,r);if(o){e.add(o);let a=ar(o._fallback,t,s);if(typeof a<`u`&&a!==t&&a!==i)return a}else if(o===!1&&typeof i<`u`&&t!==i)return null}return!1}function pn(e,n,t,i){let s=n._rootScopes,r=ar(n._fallback,t,i),o=[...e,...s],a=new Set;a.add(i);let c=_s(a,o,t,r||t,i);return c===null||typeof r<`u`&&r!==t&&(c=_s(a,o,r,c,i),c===null)?!1:mn(Array.from(a),[``],s,r,()=>wc(n,t,i))}function _s(e,n,t,i,s){for(;t;)t=Ic(e,n,t,i,s);return t}function wc(e,n,t){let i=e._getTarget();n in i||(i[n]={});let s=i[n];return he(s)&&Q(t)?t:s||{}}function Dc(e,n,t,i){let s;
3for(let r of n)if(s=cr(Sc(r,e),t),typeof s<`u`)return gn(e,s)?pn(t,i,e,s):s}function cr(e,n){for(let t of n){if(!t)continue;let i=t[e];if(typeof i<`u`)return i}}function Ls(e){let n=e._keys;return n||(n=e._keys=Ac(e._scopes)),n}function Ac(e){let n=new Set;for(let t of e)for(let i of Object.keys(t).filter(s=>!s.startsWith(`_`)))n.add(i);return Array.from(n)}function xc(e,n,t,i){let{iScale:s}=e,{key:r=`r`}=this._parsing,o=new Array(i),a,c,h,f;for(a=0,c=i;a<c;++a)h=a+t,f=n[h],o[a]={r:s.parse(un(f,r),h)};return o}var Pc=Number.EPSILON||1e-14;var mt=(e,n)=>n<e.length&&!e[n].skip&&e[n];var lr=e=>e===`x`?`y`:`x`;function ur(e,n,t,i){let s=e.skip?n:e,r=n,o=t.skip?n:t,a=on(r,s),c=on(o,r),h=a/(a+c),f=c/(a+c);h=isNaN(h)?0:h,f=isNaN(f)?0:f;let m=i*h,p=i*f;return{previous:{x:r.x-m*(o.x-s.x),y:r.y-m*(o.y-s.y)},next:{x:r.x+p*(o.x-s.x),y:r.y+p*(o.y-s.y)}}}function Mc(e,n,t){let i=e.length,s,r,o,a,c,h=mt(e,0);for(let f=0;f<i-1;++f)if(c=h,h=mt(e,f+1),!(!c||!h)){if(gt(n[f],0,Pc)){t[f]=t[f+1]=0;continue}s=t[f]/n[f],r=t[f+1]/n[f],a=Math.pow(s,2)+Math.pow(r,2),!(a<=9)&&(o=3/Math.sqrt(a),t[f]=s*o*n[f],t[f+1]=r*o*n[f])}}function Ec(e,n,t=`x`){let i=lr(t),s=e.length,r,o,a,c=mt(e,0);for(let h=0;h<s;++h){if(o=a,a=c,c=mt(e,h+1),!a)continue;let f=a[t],m=a[i];o&&(r=(f-o[t])/3,a[`cp1${t}`]=f-r,a[`cp1${i}`]=m-r*n[h]),c&&(r=(c[t]-f)/3,a[`cp2${t}`]=f+r,a[`cp2${i}`]=m+r*n[h])}}function hr(e,n=`x`){let t=lr(n),i=e.length,s=Array(i).fill(0),r=Array(i),o,a,c,h=mt(e,0);for(o=0;o<i;++o)if(a=c,c=h,h=mt(e,o+1),!!c){if(h){let f=h[n]-c[n];s[o]=f!==0?(h[t]-c[t])/f:0}r[o]=a?h?dt(s[o-1])!==dt(s[o])?0:(s[o-1]+s[o])/2:s[o-1]:s[o]}Mc(e,s,r),Ec(e,r,n)}function ki(e,n,t){return Math.max(Math.min(e,t),n)}function Nc(e,n){let t,i,s,r,o,a=Rt(e[0],n);for(t=0,i=e.length;t<i;++t)o=r,r=a,a=t<i-1&&Rt(e[t+1],n),r&&(s=e[t],o&&(s.cp1x=ki(s.cp1x,n.left,n.right),s.cp1y=ki(s.cp1y,n.top,n.bottom)),a&&(s.cp2x=ki(s.cp2x,n.left,n.right),s.cp2y=ki(s.cp2y,n.top,n.bottom)))}function Oc(e,n,t,i,s){let r,o,a,c;if(n.spanGaps&&(e=e.filter(h=>!h.skip)),n.cubicInterpolationMode===`monotone`)hr(e,s);else{let h=i?e[e.length-1]:e[0];for(r=0,o=e.length;r<o;++r)a=e[r],c=ur(h,a,e[Math.min(r+1,o-(i?0:1))%o],n.tension),a.cp1x=c.previous.x,a.cp1y=c.previous.y,a.cp2x=c.next.x,a.cp2y=c.next.y,h=a}n.capBezierPoints&&Nc(e,t)}function fr(){return typeof window<`u`&&typeof document<`u`}function dr(e){let n=e.parentNode;return n&&n.toString()===`[object ShadowRoot]`&&(n=n.host),n}function Pi(e,n,t){let i;return typeof e==`string`?(i=parseInt(e,10),e.indexOf(`%`)!==-1&&(i=i/100*n.parentNode[t])):i=e,i}var Ei=e=>e.ownerDocument.defaultView.getComputedStyle(e,null);function mr(e,n){return Ei(e).getPropertyValue(n)}var _c=[`top`,`right`,`bottom`,`left`];function Qe(e,n,t){let i={};t=t?`-`+t:``;for(let s=0;s<4;s++){let r=_c[s];i[r]=parseFloat(e[n+`-`+r+t])||0}return i.width=i.left+i.right,i.height=i.top+i.bottom,i}var Lc=(e,n,t)=>(e>0||n>0)&&(!t||!t.shadowRoot);function jc(e,n){let t=e.touches,i=t&&t.length?t[0]:e,{offsetX:s,offsetY:r}=i,o=!1,a,c;if(Lc(s,r,e.target))a=s,c=r;else{let h=n.getBoundingClientRect();a=i.clientX-h.left,c=i.clientY-h.top,o=!0}return{x:a,y:c,box:o}}function Ut(e,n){if(`native`in e)return e;let{canvas:t,currentDevicePixelRatio:i}=n,s=Ei(t),r=s.boxSizing===`border-box`,o=Qe(s,`padding`),a=Qe(s,`border`,`width`),{x:c,y:h,box:f}=jc(e,t),m=o.left+(f&&a.left),p=o.top+(f&&a.top),{width:v,height:b}=n;return r&&(v-=o.width+a.width,b-=o.height+a.height),{x:Math.round((c-m)/v*t.width/i),y:Math.round((h-p)/b*t.height/i)}}function Rc(e,n,t){let i,s;if(n===void 0||t===void 0){let r=e&&dr(e);if(!r)n=e.clientWidth,t=e.clientHeight;else{let o=r.getBoundingClientRect(),a=Ei(r),c=Qe(a,`border`,`width`),h=Qe(a,`padding`);n=o.width-h.width-c.width,t=o.height-h.height-c.height,i=Pi(a.maxWidth,r,`clientWidth`),s=Pi(a.maxHeight,r,`clientHeight`)}}return{width:n,height:t,maxWidth:i||jt,maxHeight:s||jt}}var Ci=e=>Math.round(e*10)/10;function Fc(e,n,t,i){let s=Ei(e),r=Qe(s,`margin`),o=Pi(s.maxWidth,e,`clientWidth`)||jt,a=Pi(s.maxHeight,e,`clientHeight`)||jt,c=Rc(e,n,t),{width:h,height:f}=c;if(s.boxSizing===`content-box`){let p=Qe(s,`border`,`width`),v=Qe(s,`padding`);h-=v.width+p.width,f-=v.height+p.height}return h=Math.max(0,h-r.width),f=Math.max(0,i?h/i:f-r.height),h=Ci(Math.min(h,o,c.maxWidth)),f=Ci(Math.min(f,a,c.maxHeight)),h&&!f&&(f=Ci(h/2)),(n!==void 0||t!==void 0)&&i&&c.height&&f>c.height&&(f=c.height,h=Ci(Math.floor(f*i))),{width:h,height:f}}function Uc(e,n,t){let i=n||1,s=Math.floor(e.height*i),r=Math.floor(e.width*i);e.height=Math.floor(e.height),e.width=Math.floor(e.width);let o=e.canvas;return o.style&&(t||!o.style.height&&!o.style.width)&&(o.style.height=`${e.height}px`,o.style.width=`${e.width}px`),e.currentDevicePixelRatio!==i||o.height!==s||o.width!==r?(e.currentDevicePixelRatio=i,o.height=s,o.width=r,e.ctx.setTransform(i,0,0,i,0,0),!0):!1}var Wc=(function(){let e=!1;
vendor: 4,116 bytes, line 3
3try{let n={get passive(){return e=!0,!1}};fr()&&(window.addEventListener(`test`,null,n),window.removeEventListener(`test`,null,n))}catch(n){}return e})();function Bc(e,n){let t=mr(e,n),i=t&&t.match(/^(\d+)(\.\d+)?px$/);return i?+i[1]:void 0}function Ge(e,n,t,i){return{x:e.x+t*(n.x-e.x),y:e.y+t*(n.y-e.y)}}function Hc(e,n,t,i){return{x:e.x+t*(n.x-e.x),y:i===`middle`?t<.5?e.y:n.y:i===`after`?t<1?e.y:n.y:t>0?n.y:e.y}}function zc(e,n,t,i){let s={x:e.cp2x,y:e.cp2y},r={x:n.cp1x,y:n.cp1y},o=Ge(e,s,t),a=Ge(s,r,t),c=Ge(r,n,t);return Ge(Ge(o,a,t),Ge(a,c,t),t)}var Yc=function(e,n){return{x(t){return e+e+n-t},setWidth(t){n=t},textAlign(t){return t===`center`?t:t===`right`?`left`:`right`},xPlus(t,i){return t-i},leftForLtr(t,i){return t-i}}};var Vc=function(){return{x(e){return e},setWidth(e){},textAlign(e){return e},xPlus(e,n){return e+n},leftForLtr(e,n){return e}}};function Zc(e,n,t){return e?Yc(n,t):Vc()}function $c(e,n){let t,i;(n===`ltr`||n===`rtl`)&&(t=e.canvas.style,i=[t.getPropertyValue(`direction`),t.getPropertyPriority(`direction`)],t.setProperty(`direction`,n,`important`),e.prevTextDirection=i)}function Kc(e,n){n!==void 0&&(delete e.prevTextDirection,e.canvas.style.setProperty(`direction`,n[0],n[1]))}function gr(e){return e===`angle`?{between:Ks,compare:$s,normalize:Pe}:{between:Xs,compare:(n,t)=>n-t,normalize:n=>n}}function js({start:e,end:n,count:t,loop:i,style:s}){return{start:e%t,end:n%t,loop:i&&(n-e+1)%t===0,style:s}}function Xc(e,n,t){let{property:i,start:s,end:r}=t,{between:o,normalize:a}=gr(i),c=n.length,{start:h,end:f,loop:m}=e,p,v;if(m){for(h+=c,f+=c,p=0,v=c;p<v&&o(a(n[h%c][i]),s,r);++p)h--,f--;h%=c,f%=c}return f<h&&(f+=c),{start:h,end:f,loop:m,style:e.style}}function pr(e,n,t){if(!t)return[e];let{property:i,start:s,end:r}=t,o=n.length,{compare:a,between:c,normalize:h}=gr(i),{start:f,end:m,loop:p,style:v}=Xc(e,n,t),b=[],T=!1,k=null,I,N,M,O=()=>c(s,M,I)&&a(s,M)!==0,F=()=>a(r,I)===0||c(r,M,I),Ve=()=>T||O(),Z=()=>!T||F();for(let $=f,Ze=f;$<=m;++$)N=n[$%o],!N.skip&&(I=h(N[i]),I!==M&&(T=c(I,s,r),k===null&&Ve()&&(k=a(I,s)===0?$:Ze),k!==null&&Z()&&(b.push(js({start:k,end:$,loop:p,count:o,style:v})),k=null),Ze=$,M=I));return k!==null&&b.push(js({start:k,end:m,loop:p,count:o,style:v})),b}function qc(e,n){let t=[],i=e.segments;for(let s=0;s<i.length;s++){let r=pr(i[s],e.points,n);r.length&&t.push(...r)}return t}function Gc(e,n,t,i){let s=0,r=n-1;if(t&&!i)for(;s<n&&!e[s].skip;)s++;for(;s<n&&e[s].skip;)s++;for(s%=n,t&&(r+=s);r>s&&e[r%n].skip;)r--;return r%=n,{start:s,end:r}}function Qc(e,n,t,i){let s=e.length,r=[],o=n,a=e[n],c;for(c=n+1;c<=t;++c){let h=e[c%s];h.skip||h.stop?a.skip||(i=!1,r.push({start:n%s,end:(c-1)%s,loop:i}),n=o=h.stop?c:null):(o=c,a.skip&&(n=c)),a=h}return o!==null&&r.push({start:n%s,end:o%s,loop:i}),r}function Jc(e,n){let t=e.points,i=e.options.spanGaps,s=t.length;if(!s)return[];let r=!!e._loop,{start:o,end:a}=Gc(t,s,r,i);if(i===!0)return Rs(e,[{start:o,end:a,loop:r}],t,n);return Rs(e,Qc(t,o,a<o?a+s:a,!!e._fullLoop&&o===0&&a===s-1),t,n)}function Rs(e,n,t,i){return!i||!i.setContext||!t?n:el(e,n,t,i)}function el(e,n,t,i){let s=e._chart.getContext(),r=Fs(e.options),{_datasetIndex:o,options:{spanGaps:a}}=e,c=t.length,h=[],f=r,m=n[0].start,p=m;function v(b,T,k,I){let N=a?-1:1;if(b!==T){for(b+=c;t[b%c].skip;)b-=N;for(;t[T%c].skip;)T+=N;b%c!==T%c&&(h.push({start:b%c,end:T%c,loop:k,style:I}),f=I,m=T%c)}}for(let b of n){m=a?m:b.start;let T=t[m%c],k;for(p=m+1;p<=b.end;p++){let I=t[p%c];k=Fs(i.setContext(sr(s,{type:`segment`,p0:T,p1:I,p0DataIndex:(p-1)%c,p1DataIndex:p%c,datasetIndex:o}))),tl(k,f)&&v(m,p-1,b.loop,f),T=I,f=k}m<p-1&&v(m,p-1,b.loop,f)}return h}function Fs(e){return{backgroundColor:e.backgroundColor,borderCapStyle:e.borderCapStyle,borderDash:e.borderDash,borderDashOffset:e.borderDashOffset,borderJoinStyle:e.borderJoinStyle,borderWidth:e.borderWidth,borderColor:e.borderColor}}function tl(e,n){if(!n)return!1;let t=[],i=function(s,r){return Mi(r)?(t.includes(r)||t.push(r),t.indexOf(r)):r};return JSON.stringify(e,i)!==JSON.stringify(n,i)}function Ii(e,n,t){return e.options.clip?e[t]:n[t]}function il(e,n){let{xScale:t,yScale:i}=e;
3return t&&i?{left:Ii(t,n,`left`),right:Ii(t,n,`right`),top:Ii(i,n,`top`),bottom:Ii(i,n,`bottom`)}:n}function nl(e,n){let t=n._clip;if(t.disabled)return!1;let i=il(n,e.chartArea);return{left:t.left===!1?0:i.left-(t.left===!0?0:t.left),right:t.right===!1?e.width:i.right+(t.right===!0?0:t.right),top:t.top===!1?0:i.top-(t.top===!0?0:t.top),bottom:t.bottom===!1?e.height:i.bottom+(t.bottom===!0?0:t.bottom)}}var Bt=e=>e&&e.enabled&&e.modifierKey;var Pr=(e,n)=>e&&n[e+`Key`];var In=(e,n)=>e&&!n[e+`Key`];function He(e,n,t){return e===void 0?!0:typeof e==`string`?e.indexOf(n)!==-1:typeof e==`function`?e({chart:t}).indexOf(n)!==-1:!1}function vn(e,n){return typeof e==`function`&&(e=e({chart:n})),typeof e==`string`?{x:e.indexOf(`x`)!==-1,y:e.indexOf(`y`)!==-1}:{x:!1,y:!1}}function sl(e,n){let t;return function(){return clearTimeout(t),t=setTimeout(e,n),n}}function rl({x:e,y:n},t){let i=t.scales,s=Object.keys(i);for(let r=0;r<s.length;r++){let o=i[s[r]];if(n>=o.top&&n<=o.bottom&&e>=o.left&&e<=o.right)return o}return null}function Mr(e,n,t){let{mode:i=`xy`,scaleMode:s,overScaleMode:r}=e||{},o=rl(n,t),a=vn(i,t),c=vn(s,t);if(r){let f=vn(r,t);for(let m of[`x`,`y`])f[m]&&(c[m]=a[m],a[m]=!1)}if(o&&c[o.axis])return[o];let h=[];return Te(t.scales,function(f){a[f.axis]&&h.push(f)}),h}var bn=new WeakMap;function L(e){let n=bn.get(e);return n||(n={originalScaleLimits:{},updatedScaleLimits:{},handlers:{},panDelta:{},dragging:!1,panning:!1},bn.set(e,n)),n}function ol(e){bn.delete(e)}function Er(e,n,t,i){let s=Math.max(0,Math.min(1,(e-n)/t||0)),r=1-s;return{min:i*s,max:i*r}}function Nr(e,n){let t=e.isHorizontal()?n.x:n.y;return e.getValueForPixel(t)}function Or(e,n,t){let i=e.max-e.min,s=i*(n-1);return Er(Nr(e,t),e.min,i,s)}function al(e,n,t){let i=Nr(e,t);if(i===void 0)return{min:e.min,max:e.max};let s=Math.log10(e.min),r=Math.log10(e.max),o=Math.log10(i),a=r-s,h=Er(o,s,a,a*(n-1));return{min:Math.pow(10,s+h.min),max:Math.pow(10,r-h.max)}}function cl(e,n){return n&&(n[e.id]||n[e.axis])||{}}function vr(e,n,t,i,s){let r=t[i];if(r===`original`){let o=e.originalScaleLimits[n.id][i];r=se(o.options,o.scale)}return se(r,s)}function ll(e,n,t){let i=e.getValueForPixel(n),s=e.getValueForPixel(t);return{min:Math.min(i,s),max:Math.max(i,s)}}function ul(e,{min:n,max:t,minLimit:i,maxLimit:s},r){let o=(e-t+n)/2;n-=o,t+=o;let a=r.min.options??r.min.scale,c=r.max.options??r.max.scale,h=e/1e6;return gt(n,a,h)&&(n=a),gt(t,c,h)&&(t=c),n<i?(n=i,t=Math.min(i+e,s)):t>s&&(t=s,n=Math.max(s-e,i)),{min:n,max:t}}function et(e,{min:n,max:t},i,s=!1){let r=L(e.chart),{options:o}=e,a=cl(e,i),{minRange:c=0}=a,h=vr(r,e,a,`min`,-Infinity),f=vr(r,e,a,`max`,Infinity);if(s===`pan`&&(n<h||t>f))return!0;let m=e.max-e.min,p=s?Math.max(t-n,c):m;if(s&&p===c&&m<=c)return!0;let v=ul(p,{min:n,max:t,minLimit:h,maxLimit:f},r.originalScaleLimits[e.id]);return o.min=v.min,o.max=v.max,r.updatedScaleLimits[e.id]=v,e.parse(v.min)!==e.min||e.parse(v.max)!==e.max}function hl(e,n,t,i){let s=Or(e,n,t);return et(e,{min:e.min+s.min,max:e.max-s.max},i,!0)}function fl(e,n,t,i){return et(e,al(e,n,t),i,!0)}function dl(e,n,t,i){et(e,ll(e,n,t),i,!0)}var br=e=>e===0||isNaN(e)?0:e<0?Math.min(Math.round(e),-1):Math.max(Math.round(e),1);function ml(e){let t=e.getLabels().length-1;e.min>0&&(e.min-=1),e.max<t&&(e.max+=1)}function gl(e,n,t,i){let s=Or(e,n,t);e.min===e.max&&n<1&&ml(e);return et(e,{min:e.min+br(s.min),max:e.max-br(s.max)},i,!0)}function pl(e){return e.isHorizontal()?e.width:e.height}function vl(e,n,t){let s=e.getLabels().length-1,{min:r,max:o}=e,a=Math.max(o-r,1),c=Math.round(pl(e)/Math.max(a,10)),h=Math.round(Math.abs(n/c)),f;return n<-c?(o=Math.min(o+h,s),r=a===1?o:o-a,f=o===s):n>c&&(r=Math.max(0,r-h),o=a===1?r:r+a,f=r===0),et(e,{min:r,max:o},t)||f}var bl={second:500,minute:30*1e3,hour:1800*1e3,day:720*60*1e3,week:3.5*24*60*60*1e3,month:360*60*60*1e3,quarter:1440*60*60*1e3,year:4368*60*60*1e3};function _r(e,n,t,i=!1){let{min:s,max:r,options:o}=e,c=bl[o.time&&o.time.round]||0,h=e.getValueForPixel(e.getPixelForValue(s+c)-n),f=e.getValueForPixel(e.getPixelForValue(r+c)-n);return isNaN(h)||isNaN(f)?!0:et(e,{min:h,max:f},t,i?`pan`:!1)}function Sr(e,n,t){return _r(e,n,t,!0)}var Sn={category:gl,default:hl,logarithmic:fl};var yn={default:dl};var Tn={category:vl,default:_r,logarithmic:Sr,timeseries:Sr};function Sl(e,n,t){let{id:i,options:{min:s,max:r}}=e;if(!n[i]||!t[i])return!0;let o=t[i];return o.min!==s||o.max!==r}function yr(e,n){Te(e,(t,i)=>{n[i]||delete e[i]})}function vt(e,n){let{scales:t}=e,{originalScaleLimits:i,updatedScaleLimits:s}=n;return Te(t,function(r){Sl(r,i,s)&&(i[r.id]={min:{scale:r.min,options:r.options.min},max:{scale:r.max,options:r.options.max}})}),yr(i,t),yr(s,t),i}function Tr(e,n,t,i){_(Sn[e.type]||Sn.default,[e,n,t,i])}function kr(e,n,t,i){_(yn[e.type]||yn.default,[e,n,t,i])}function yl(e){let n=e.chartArea;return{x:(n.left+n.right)/2,y:(n.top+n.bottom)/2}}function wn(e,n,t=`none`,i=`api`){let{x:s=1,y:r=1,focalPoint:o=yl(e)}
3=typeof n==`number`?{x:n,y:n}:n,a=L(e),{options:{limits:c,zoom:h}}=a;vt(e,a);let f=s!==1,m=r!==1;Te(Mr(h,o,e)||e.scales,function(v){v.isHorizontal()&&f?Tr(v,s,o,c):!v.isHorizontal()&&m&&Tr(v,r,o,c)}),e.update(t),_(h.onZoom,[{chart:e,trigger:i}])}function Lr(e,n,t,i=`none`,s=`api`){let r=L(e),{options:{limits:o,zoom:a}}=r,{mode:c=`xy`}=a;vt(e,r);let h=He(c,`x`,e),f=He(c,`y`,e);Te(e.scales,function(m){m.isHorizontal()&&h?kr(m,n.x,t.x,o):!m.isHorizontal()&&f&&kr(m,n.y,t.y,o)}),e.update(i),_(a.onZoom,[{chart:e,trigger:s}])}function Tl(e,n,t,i=`none`,s=`api`){let r=L(e);vt(e,r);let o=e.scales[n];et(o,t,void 0,!0),e.update(i),_(r.options.zoom?.onZoom,[{chart:e,trigger:s}])}function kl(e,n=`default`){let t=L(e),i=vt(e,t);Te(e.scales,function(s){let r=s.options;i[s.id]?(r.min=i[s.id].min.options,r.max=i[s.id].max.options):(delete r.min,delete r.max),delete t.updatedScaleLimits[s.id]}),e.update(n),_(t.options.zoom.onZoomComplete,[{chart:e}])}function Cl(e,n){let t=e.originalScaleLimits[n];if(!t)return;let{min:i,max:s}=t;return se(s.options,s.scale)-se(i.options,i.scale)}function Il(e){let n=L(e),t=1,i=1;return Te(e.scales,function(s){let r=Cl(n,s.id);if(r){let o=Math.round(r/(s.max-s.min)*100)/100;t=Math.min(t,o),i=Math.max(i,o)}}),t<1?t:i}function Cr(e,n,t,i){let{panDelta:s}=i,r=s[e.id]||0;dt(r)===dt(n)&&(n+=r);_(Tn[e.type]||Tn.default,[e,n,t])?s[e.id]=0:s[e.id]=n}function jr(e,n,t,i=`none`){let{x:s=0,y:r=0}=typeof n==`number`?{x:n,y:n}:n,o=L(e),{options:{pan:a,limits:c}}=o,{onPan:h}=a||{};vt(e,o);let f=s!==0,m=r!==0;Te(t||e.scales,function(p){p.isHorizontal()&&f?Cr(p,s,c,o):!p.isHorizontal()&&m&&Cr(p,r,c,o)}),e.update(i),_(h,[{chart:e}])}function Rr(e){let n=L(e);vt(e,n);let t={};for(let i of Object.keys(e.scales)){let{min:s,max:r}=n.originalScaleLimits[i]||{min:{},max:{}};t[i]={min:s.scale,max:r.scale}}return t}function wl(e){let n=L(e),t={};for(let i of Object.keys(e.scales))t[i]=n.updatedScaleLimits[i];return t}function Dl(e){let n=Rr(e);for(let t of Object.keys(e.scales)){let{min:i,max:s}=n[t];if(i!==void 0&&e.scales[t].min!==i||s!==void 0&&e.scales[t].max!==s)return!0}return!1}function Ir(e){let n=L(e);return n.panning||n.dragging}var wr=(e,n,t)=>Math.min(t,Math.max(n,e));function te(e,n){let{handlers:t}=L(e),i=t[n];i&&i.target&&(i.target.removeEventListener(n,i),delete t[n])}function Wt(e,n,t,i){let{handlers:s,options:r}=L(e),o=s[t];if(o&&o.target===n)return;te(e,t),s[t]=c=>i(e,c,r),s[t].target=n;let a=t===`wheel`?!1:void 0;n.addEventListener(t,s[t],{passive:a})}function Al(e,n){let t=L(e);t.dragStart&&(t.dragging=!0,t.dragEnd=n,e.update(`none`))}function xl(e,n){let t=L(e);!t.dragStart||n.key!==`Escape`||(te(e,`keydown`),t.dragging=!1,t.dragStart=t.dragEnd=null,e.update(`none`))}function kn(e,n){if(e.target!==n.canvas){let t=n.canvas.getBoundingClientRect();return{x:e.clientX-t.left,y:e.clientY-t.top}}return Ut(e,n)}function Fr(e,n,t){let{onZoomStart:i,onZoomRejected:s}=t;if(i){if(_(i,[{chart:e,event:n,point:kn(n,e)}])===!1)return _(s,[{chart:e,event:n}]),!1}}function Pl(e,n){if(e.legend){if(Rt(Ut(n,e),e.legend))return}let t=L(e),{pan:i,zoom:s={}}=t.options;if(n.button!==0||Pr(Bt(i),n)||In(Bt(s.drag),n))return _(s.onZoomRejected,[{chart:e,event:n}]);Fr(e,n,s)!==!1&&(t.dragStart=n,Wt(e,e.canvas.ownerDocument,`mousemove`,Al),Wt(e,window.document,`keydown`,xl))}function Ml({begin:e,end:n},t){let i=n.x-e.x,s=n.y-e.y,r=Math.abs(i/s);r>t?i=Math.sign(i)*Math.abs(s*t):r<t&&(s=Math.sign(s)*Math.abs(i/t)),n.x=e.x+i,n.y=e.y+s}function Dr(e,n,t,{min:i,max:s,prop:r}){e[i]=wr(Math.min(t.begin[r],t.end[r]),n[i],n[s]),e[s]=wr(Math.max(t.begin[r],t.end[r]),n[i],n[s])}function El(e,n,t){let i={begin:kn(n.dragStart,e),end:kn(n.dragEnd,e)};if(t)Ml(i,e.chartArea.width/e.chartArea.height);return i}function Ur(e,n,t,i){let s=He(n,`x`,e),r=He(n,`y`,e),{top:o,left:a,right:c,bottom:h,width:f,height:m}=e.chartArea,p={top:o,left:a,right:c,bottom:h},v=El(e,t,i&&s&&r);s&&Dr(p,e.chartArea,v,{min:`left`,max:`right`,prop:`x`}),r&&Dr(p,e.chartArea,v,{min:`top`,max:`bottom`,prop:`y`});let b=p.right-p.left,T=p.bottom-p.top;return A(z({},p),{width:b,height:T,zoomX:s&&b?1+(f-b)/f:1,zoomY:r&&T?1+(m-T)/m:1})}function Nl(e,n){let t=L(e);if(!t.dragStart)return;te(e,`mousemove`);let{mode:i,onZoomComplete:s,drag:{threshold:r=0,maintainAspectRatio:o}}=t.options.zoom,a=Ur(e,i,{dragStart:t.dragStart,dragEnd:n},o),c=He(i,`x`,e)?a.width:0,h=He(i,`y`,e)?a.height:0,f=Math.sqrt(c*c+h*h);if(t.dragStart=t.dragEnd=null,f<=r){t.dragging=!1,e.update(`none`);return}Lr(e,{x:a.left,y:a.top},{x:a.right,y:a.bottom},`zoom`,`drag`),t.dragging=!1,t.filterNextClick=!0,_(s,[{chart:e}])}function Ol(e,n,t){if(In(Bt(t.wheel),n)){_(t.onZoomRejected,[{chart:e,event:n}]);return}if(Fr(e,n,t)!==!1&&(n.cancelable&&n.preventDefault(),n.deltaY!==void 0))return!0}function _l(e,n){let{handlers:{onZoomComplete:t},options:{zoom:i}}=L(e);if(!Ol(e,n,i))return;let s=n.target.getBoundingClientRect(),r=i.wheel.speed,o=n.deltaY>=0?2-1/(1-r):1+r;
3wn(e,{x:o,y:o,focalPoint:{x:n.clientX-s.left,y:n.clientY-s.top}},`zoom`,`wheel`),_(t,[{chart:e}])}function Ll(e,n,t,i){t&&(L(e).handlers[n]=sl(()=>_(t,[{chart:e}]),i))}function jl(e,n){let t=e.canvas,{wheel:i,drag:s,onZoomComplete:r}=n.zoom;i.enabled?(Wt(e,t,`wheel`,_l),Ll(e,`onZoomComplete`,r,250)):te(e,`wheel`),s.enabled?(Wt(e,t,`mousedown`,Pl),Wt(e,t.ownerDocument,`mouseup`,Nl)):(te(e,`mousedown`),te(e,`mousemove`),te(e,`mouseup`),te(e,`keydown`))}function Rl(e){te(e,`mousedown`),te(e,`mousemove`),te(e,`mouseup`),te(e,`wheel`),te(e,`click`),te(e,`keydown`)}function Fl(e,n){return function(t,i){let{pan:s,zoom:r={}}=n.options;if(!s||!s.enabled)return!1;let o=i&&i.srcEvent;return o&&!n.panning&&i.pointerType===`mouse`&&(In(Bt(s),o)||Pr(Bt(r.drag),o))?(_(s.onPanRejected,[{chart:e,event:i}]),!1):!0}}function Ul(e,n){let t=Math.abs(e.clientX-n.clientX),i=Math.abs(e.clientY-n.clientY),s=t/i,r,o;return s>.3&&s<1.7?r=o=!0:t>i?r=!0:o=!0,{x:r,y:o}}function Wr(e,n,t){if(n.scale){let{center:i,pointers:s}=t,r=1/n.scale*t.scale,o=t.target.getBoundingClientRect(),a=Ul(s[0],s[1]),c=n.options.zoom.mode;wn(e,{x:a.x&&He(c,`x`,e)?r:1,y:a.y&&He(c,`y`,e)?r:1,focalPoint:{x:i.x-o.left,y:i.y-o.top}},`zoom`,`pinch`),n.scale=t.scale}}function Wl(e,n,t){if(n.options.zoom.pinch.enabled){let i=Ut(t,e);_(n.options.zoom.onZoomStart,[{chart:e,event:t,point:i}])===!1?(n.scale=null,_(n.options.zoom.onZoomRejected,[{chart:e,event:t}])):n.scale=1}}function Bl(e,n,t){n.scale&&(Wr(e,n,t),n.scale=null,_(n.options.zoom.onZoomComplete,[{chart:e}]))}function Br(e,n,t){let i=n.delta;i&&(n.panning=!0,jr(e,{x:t.deltaX-i.x,y:t.deltaY-i.y},n.panScales),n.delta={x:t.deltaX,y:t.deltaY})}function Hl(e,n,t){let{enabled:i,onPanStart:s,onPanRejected:r}=n.options.pan;if(!i)return;let o=t.target.getBoundingClientRect(),a={x:t.center.x-o.left,y:t.center.y-o.top};if(_(s,[{chart:e,event:t,point:a}])===!1)return _(r,[{chart:e,event:t}]);n.panScales=Mr(n.options.pan,a,e),n.delta={x:0,y:0},Br(e,n,t)}function zl(e,n){n.delta=null,n.panning&&(n.panning=!1,n.filterNextClick=!0,_(n.options.pan.onPanComplete,[{chart:e}]))}var Cn=new WeakMap;function Ar(e,n){let t=L(e),i=e.canvas,{pan:s,zoom:r}=n,o=new pt.default.Manager(i);r&&r.pinch.enabled&&(o.add(new pt.default.Pinch),o.on(`pinchstart`,a=>Wl(e,t,a)),o.on(`pinch`,a=>Wr(e,t,a)),o.on(`pinchend`,a=>Bl(e,t,a))),s&&s.enabled&&(o.add(new pt.default.Pan({threshold:s.threshold,enable:Fl(e,t)})),o.on(`panstart`,a=>Hl(e,t,a)),o.on(`panmove`,a=>Br(e,t,a)),o.on(`panend`,()=>zl(e,t))),Cn.set(e,o)}function xr(e){let n=Cn.get(e);n&&(n.remove(`pinchstart`),n.remove(`pinch`),n.remove(`pinchend`),n.remove(`panstart`),n.remove(`pan`),n.remove(`panend`),n.destroy(),Cn.delete(e))}function Yl(e,n){let{pan:t,zoom:i}=e,{pan:s,zoom:r}=n;return i?.zoom?.pinch?.enabled!==r?.zoom?.pinch?.enabled||t?.enabled!==s?.enabled||t?.threshold!==s?.threshold}var Vl=`2.2.0`;function Ni(e,n,t){let i=t.zoom.drag,{dragStart:s,dragEnd:r}=L(e);if(i.drawTime!==n||!r)return;let{left:o,top:a,width:c,height:h}=Ur(e,t.zoom.mode,{dragStart:s,dragEnd:r},i.maintainAspectRatio),f=e.ctx;f.save(),f.beginPath(),f.fillStyle=i.backgroundColor||`rgba(225,225,225,0.3)`,f.fillRect(o,a,c,h),i.borderWidth>0&&(f.lineWidth=i.borderWidth,f.strokeStyle=i.borderColor||`rgba(225,225,225)`,f.strokeRect(o,a,c,h)),f.restore()}var Ku={id:`zoom`,version:Vl,defaults:{pan:{enabled:!1,mode:`xy`,threshold:10,modifierKey:null},zoom:{wheel:{enabled:!1,speed:.1,modifierKey:null},drag:{enabled:!1,drawTime:`beforeDatasetsDraw`,modifierKey:null},pinch:{enabled:!1},mode:`xy`}},start:function(e,n,t){let i=L(e);i.options=t,Object.prototype.hasOwnProperty.call(t.zoom,`enabled`)&&console.warn("The option `zoom.enabled` is no longer supported. Please use `zoom.wheel.enabled`, `zoom.drag.enabled`, or `zoom.pinch.enabled`."),(Object.prototype.hasOwnProperty.call(t.zoom,`overScaleMode`)||Object.prototype.hasOwnProperty.call(t.pan,`overScaleMode`))&&console.warn("The option `overScaleMode` is deprecated. Please use `scaleMode` instead (and update `mode` as desired)."),pt.default&&Ar(e,t),e.pan=(s,r,o)=>jr(e,s,r,o),e.zoom=(s,r)=>wn(e,s,r),e.zoomRect=(s,r,o)=>Lr(e,s,r,o),e.zoomScale=(s,r,o)=>Tl(e,s,r,o),e.resetZoom=s=>kl(e,s),e.getZoomLevel=()=>Il(e),e.getInitialScaleBounds=()=>Rr(e),e.getZoomedScaleBounds=()=>wl(e),e.isZoomedOrPanned=()=>Dl(e),e.isZoomingOrPanning=()=>Ir(e)},beforeEvent(e,{event:n}){if(Ir(e))return!1;if(n.type===`click`||n.type===`mouseup`){let t=L(e);if(t.filterNextClick)return t.filterNextClick=!1,!1}},beforeUpdate:function(e,n,t){let i=L(e),s=i.options;i.options=t,Yl(s,t)&&(xr(e),Ar(e,t)),jl(e,t)},beforeDatasetsDraw(e,n,t){Ni(e,`beforeDatasetsDraw`,t)},afterDatasetsDraw(e,n,t){Ni(e,`afterDatasetsDraw`,t)},beforeDraw(e,n,t){Ni(e,`beforeDraw`,t)},afterDraw(e,n,t){Ni(e,`afterDraw`,t)},stop:function(e){Rl(e),pt.default&&xr(e),ol(e)},panFunctions:Tn,zoomFunctions:Sn,zoomRectFunctions:yn};var tt;(function(e){function n(s,r,o,a,c){let h=document.getElementById(`chartjs-tooltip`);h||(h=document.createElement(`div`),h.id=`chartjs-tooltip`,document.body.appendChild(h));let f=s.tooltip;if(f.opacity===0){h.style.opacity=`0`;return}if(h.classList.remove(`above`,`below`,`no-transform`),f.yAlign?h.classList.add(f.yAlign):h.classList.add(`no-transform`),f.body){let m=f.dataPoints.map(r),p=``;m.forEach((v,b)=>{let k=`background:`+f.labelColors[b].backgroundColor;k+=`; display: inline-block; height:`+a+`; width:`+a+`; margin-right:`+a;let I=`<span style="`+k+`"></span>`,M=`<span style="`+(`color:`+o)+`">`+v+`</span>`;p+=`<p>`+I+M+`</p>`}),h.innerHTML=p}h.style.opacity=`1`,c||(s.chart.canvas.addEventListener(`mousemove`,m=>{let p=s.chart.canvas.getBoundingClientRect(),v=m.clientX-p.left,b=m.clientY-p.top;h.style.left=p.left+v+`px`,h.style.top=p.top+b-h.clientHeight+`px`}),s.chart.canvas.addEventListener(`mouseleave`,()=>{h.style.opacity=`0`}))}e.mkTooltip=n;function t(){return window.innerWidth<=$k.maxMobileSize}e.chartIsMobile=t;function i(){return window.innerWidth<=$k.maxTabletSize}e.chartIsTabletOrSmaller=i,e.overridePosition=(s,r,o)=>{let a=s.chart.chartArea.top+s.chart.chartArea.height,f=1/s.chart.scales.y.max*r*s.chart.chartArea.height;return Math.abs(f)>a?`center`:o}})(tt||(tt={}));var ze;(function(e){function n(c){c.classList.remove(`chart-tooltip-visible`)}function t(c,h){return Ot$1.formatLocale(c,h,{maximumFractionDigits:2,minimumFractionDigits:2}).replace(/(\d)(?=(\d{3})+\.)/g,`$1,`)}function i(c,h,f){let m=c.data.datasets[h].data[f];
3if(m===null||isUndefined(m))return;let p=Number(typeof m==`object`&&`y`in m?m.y:m);return Number.isNaN(p)?void 0:p}function s(c){return c.data.datasets.map((h,f)=>f).filter(h=>c.isDatasetVisible(h)).toReversed()}e.visibleDatasetIndexes=s;function r(c,h,f,m,p,v){let T=(v.getValue??i)(c,f,m);if(isUndefined(T))return 0;let k=document.createElement(`div`);k.className=`chart-tooltip-row`,f===p&&k.classList.add(`chart-tooltip-row-active`);let I=document.createElement(`span`);I.className=`chart-tooltip-marker`,I.style.setProperty(`--evu-chart-tooltip-marker-bg`,c.getDatasetMeta(f).controller.getStyle(m,!1).backgroundColor.toString());let N=v.getDatasetLabel?.(c,f)??c.data.datasets[f].label?.split(`-`)[0]?.trim()??``,M=v.getDatasetUnit?.(c,f)??``,O=document.createElement(`span`);return O.textContent=N+`: `+t(T,v.language)+` `+M,k.append(I,O),h.appendChild(k),T}function o(c,h,f,m,p){let v=c.canvas.parentElement;if(isUndefined(v))return;let b=v.querySelector(`.chart-tooltip`);if(isUndefined(b)){b=document.createElement(`div`),b.className=`chart-tooltip`,v.appendChild(b);let Z=b;c.canvas.addEventListener(`mouseleave`,()=>{n(Z)})}let T=h.index,k=h.datasetIndex,I=document.createDocumentFragment(),N=p.getTitle?.(c,T)??c.data.labels?.[T]?.toString();if(isDefined(N)){let Z=document.createElement(`div`);Z.className=`chart-tooltip-title`,Z.textContent=N,I.appendChild(Z)}let M=s(c).reduce((Z,$)=>Z+r(c,I,$,T,k,p),0);if(p.showTotal??!0){let Z=document.createElement(`div`);Z.className=`chart-tooltip-footer`,Z.textContent=`Total: `+t(M,p.language)+` `+(p.getTotalUnit?.(c,k)??p.getDatasetUnit?.(c,k)??``),I.appendChild(Z)}let O=document.createElement(`span`);O.className=`chart-tooltip-arrow`,b.replaceChildren(O,I),c.canvas.getBoundingClientRect().left+f+20+b.offsetWidth<=window.innerWidth?b.style.setProperty(`--evu-chart-tooltip-left`,c.canvas.offsetLeft+f+20+`px`):(O.classList.add(`chart-tooltip-arrow-right`),b.style.setProperty(`--evu-chart-tooltip-left`,c.canvas.offsetLeft+f-b.offsetWidth-20+`px`)),b.style.setProperty(`--evu-chart-tooltip-top`,c.canvas.offsetTop+m-11+`px`),b.classList.add(`chart-tooltip-visible`)}e.render=o;function a(c){let h=c.canvas.parentElement?.querySelector(`.chart-tooltip`);isDefined(h)&&n(h)}e.hide=a})(ze||(ze={}));var bt;(function(e){function n(i){return i?.scales?.x?.ticks?.map(r=>({index:r.$context.index,value:r.value,label:r.label}))}function t(i,s,r,o,a){let c=s.chart.getSortedVisibleDatasetMetas(),h=s.dataset.stack,f=s.dataIndex,m=0,p=0,v=-1,b=-1;c.forEach(M=>{let O=s.chart.data.datasets[M.index],F=O.data[f];O.stack===h&&(F>=0?(m+=F,(v===-1||M.index>v)&&(v=M.index)):(p+=F,(b===-1||M.index<b)&&(b=M.index)))});let T=s.dataset.data.length,I=n(s.chart)?.filter(M=>+M.value==+s.dataIndex).length>0;if(!(r&&T<=12&&I))return``;if(o){if(s.datasetIndex===v&&m>0)return Ot$1.formatLocale(m,i,{maximumFractionDigits:a,minimumFractionDigits:a});if(s.datasetIndex===b&&p<0)return Ot$1.formatLocale(p,i,{maximumFractionDigits:a,minimumFractionDigits:a})}else if(s.datasetIndex===v){let M=m+p;return Ot$1.formatLocale(M,i,{maximumFractionDigits:a,minimumFractionDigits:a})}return``}e.barChartOptions=(i,s)=>r=>({color:a=>s.getPropertyValue(`--evu-chart`),backgroundColor:a=>s.getPropertyValue(`--evu-chart-bg`),borderColor:a=>s.getPropertyValue(`--evu-chart-line`),responsive:!0,maintainAspectRatio:!1,interaction:{mode:`point`,intersect:!0},onHover:(a,c,h)=>{let f=c[0];f&&isDefined(a.x)&&isDefined(a.y)?ze.render(h,f,a.x,a.y,{language:r,getDatasetUnit:()=>i.unit}):ze.hide(h)},onResize:(a,c)=>{let h=c.width<480,f=h?10:14,m=i.splitChartLabels,p=h?c.width>=440?5:c.width>=400?4:3:Number.POSITIVE_INFINITY;a.options.scales&&a.options.scales.y&&(a.options.scales.y=A(z({},a.options.scales.y),{grid:{color:v=>s.getPropertyValue(`--evu-chart-line`)},ticks:A(z({},a.options.scales.y.ticks),{color:s.getPropertyValue(`--evu-chart-tick`),maxTicksLimit:h?5:Number.POSITIVE_INFINITY,font:{size:f},callback(v){let b=+v,T=Ot$1.formatLocale(b,r,{maximumFractionDigits:2,minimumFractionDigits:2});return h?T:T+` `+i.unit}})})),a.options.scales&&a.options.scales.x&&(a.options.scales.x.ticks=A(z({},a.options.scales.x.ticks),{color:s.getPropertyValue(`--evu-chart-tick`),padding:h||!m?0:20,maxTicksLimit:p,font:{size:f}})),a.options.plugins&&a.options.plugins.datalabels&&(a.options.plugins.datalabels.formatter=(v,b)=>b.chart.getDatasetMeta(b.datasetIndex).data[b.dataIndex].width<i.barLabelMinWidth?``:t(r,b,i.selectedObjects,m,2),a.options.plugins.datalabels.clamp=!0,a.options.plugins.datalabels.display=`true`,a.options.plugins.datalabels.align=v=>{let b=v.dataset.data[v.dataIndex],T=m?b>=0?`top`:`bottom`:`top`;return tt.overridePosition(v,b,T)},a.options.plugins.datalabels.anchor=v=>{let b=v.dataset.data[v.dataIndex],T=m?b>=0?`end`:`start`:`end`;return tt.overridePosition(v,b,T)}),a.update()},scales:{x:{stacked:!0,grid:{color:a=>s.getPropertyValue(`--evu-chart-line`)},ticks:{color:a=>s.getPropertyValue(`--evu-chart-tick`)}},y:{stacked:!0,grid:{color:a=>s.getPropertyValue(`--evu-chart-line`)},ticks:{color:a=>s.getPropertyValue(`--evu-chart-tick`),callback:(a,c,h)=>{let f=+a;return Ot$1.formatLocale(f,r,{maximumFractionDigits:2,minimumFractionDigits:2})+` `+i.unit}}}},plugins:{tooltip:{enabled:!1}
3,legend:{display:!1},datalabels:{color:s.getPropertyValue(`--evu-chart`),clamp:!0,anchor:a=>{let c=a.dataset.data[a.dataIndex],h=i.splitChartLabels?c>=0?`end`:`start`:`end`;return tt.overridePosition(a,c,h)},align:a=>{let c=a.dataset.data[a.dataIndex],h=i.splitChartLabels?c>=0?`top`:`bottom`:`top`;return tt.overridePosition(a,c,h)},formatter:(a,c)=>c.chart.getDatasetMeta(c.datasetIndex).data[c.dataIndex].width<i.barLabelMinWidth?``:t(r,c,i.selectedObjects,i.splitChartLabels,2)},zoom:{pan:{enabled:!0,mode:`x`,threshold:10},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:`x`}}},layout:{padding:{top:30,bottom:20}}})})(bt||(bt={}));var Hr=class{constructor(){this.selectedObjects=0,this.splitChartLabels=!1,this.digits=2,this.unit=`KWh`,this.barLabelMinWidth=50,this.showChartLegend=!0,this.chartType=`bar`,this.dataSets=S([]),this.dataLoaded=!1,this.noDataAvailable=!1,this.labels=new Array,this.chartColors=[],this.style=getComputedStyle(document.body),this.barChartOptions=()=>bt.barChartOptions({selectedObjects:this.selectedObjects,splitChartLabels:this.splitChartLabels,digits:this.digits,unit:this.unit,barLabelMinWidth:this.barLabelMinWidth},this.style)}};var zr=class{constructor(){this.selectedObjects=0,this.splitChartLabels=!1,this.digits=1,this.unit=`CHF`,this.barLabelMinWidth=50,this.showChartLegend=!0,this.chartType=`bar`,this.dataSets=S([]),this.showYAxes=!0,this.dataLoaded=!1,this.noDataAvailable=!1,this.labels=new Array,this.chartColors=[],this.style=getComputedStyle(document.body),this.barChartOptions=()=>bt.barChartOptions({selectedObjects:this.selectedObjects,splitChartLabels:this.splitChartLabels,digits:this.digits,unit:this.unit,barLabelMinWidth:this.barLabelMinWidth},this.style)}};var j=(function(e){return e.Live=`Live`,e.Day=`Day`,e.Week=`Week`,e.Month=`Month`,e.Year=`Year`,e.Custom=`Custom`,e})(j||{});var it=F(Oi$1(),1);var Me;(function(e){function n(t){return match(t).pipe(mWhen(uH.Live,()=>0),mWhen(uH.QuarterHourly,()=>1),mWhen(uH.Hourly,()=>2),mWhen(uH.Daily,()=>3),mWhen(uH.Monthly,()=>4),mWhen(uH.BiMonthly,()=>5),mWhen(uH.Quarterly,()=>6),mWhen(uH.Semesterly,()=>7),mWhen(uH.Yearly,()=>8),mWhen(uH.Default,()=>9),mExhaustive)}e.getOrder=n})(Me||(Me={}));var Yr=class{constructor(n,t){this.limitColors=t,this.showChartLegend=!0,this.chartType=`line`,this.selectedObjects=2,this.dataSets=new Array,this.showYAxes=!0,this.language=Ot$1.defaultLanguage,this.labels=new Array,this.chartColors=[],this.dataLoaded=!1,this.noDataAvailable=!1,this.scaleSelectionService=null,this.initialShowPastMinutes=20,this.initialShowNextMinutes=20,this.style=getComputedStyle(document.body),this.chartOptions=i=>({color:()=>this.style.getPropertyValue(`--evu-chart`),backgroundColor:()=>this.style.getPropertyValue(`--evu-chart-bg`),borderColor:()=>this.style.getPropertyValue(`--evu-chart-line`),responsive:!0,maintainAspectRatio:!1,onResize:(r,o)=>{let a=o.width<480;r.isMobile=a;let c=a?10:14,h=a?o.width>=440?5:o.width>=400?4:3:Number.POSITIVE_INFINITY;r.options.scales&&r.options.scales.y&&(r.options.scales.y=A(z({},r.options.scales.y),{grid:{color:()=>this.style.getPropertyValue(`--evu-chart-line`)},ticks:A(z({},r.options.scales.y.ticks),{color:()=>this.style.getPropertyValue(`--evu-chart-tick`),maxTicksLimit:a?5:Number.POSITIVE_INFINITY,font:{size:c},callback(f){let m=+f,p=Ot$1.formatLocale(m,i);return a?p:p+` `+r.unit}})})),r.options.scales&&r.options.scales.x&&(r.options.scales.x.ticks=A(z({},r.options.scales.x.ticks),{color:()=>this.style.getPropertyValue(`--evu-chart-tick`),maxTicksLimit:h,font:{size:c}})),r.options.plugins&&r.options.plugins.datalabels&&(r.options.plugins.datalabels.formatter=(f,m)=>{if(a)return``;{let p=$A(f.y,Ot$1.toMomentLocale(i),`1.0-0`)+` %`;return m.dataset.unit===`%`?p:``}}),r.update()},interaction:{intersect:!1,mode:`index`},onHover:(r,o,a)=>{let c=o[0];c&&isDefined(r.x)&&isDefined(r.y)?ze.render(a,c,r.x,r.y,{language:i,getDatasetLabel:(h,f)=>h.data.datasets[f].label??``,getDatasetUnit:(h,f)=>h.data.datasets[f].unit??``,getTitle:(h,f)=>{let m=h.data.labels?.[f];return m instanceof Date?(0,it.default)(m).format(dt$1.DMY):m?.toString()}}):ze.hide(a)},scales:{y:{beginAtZero:!0,stacked:!0,grid:{color:()=>this.style.getPropertyValue(`--evu-chart-line`)},ticks:{color:()=>this.style.getPropertyValue(`--evu-chart-tick`),callback(r){let o=+r;return Ot$1.formatLocale(o,i)+` `+this.chart.unit}}},y1:{type:`linear`,display:!1,position:`right`,beginAtZero:!0,grid:{drawOnChartArea:!1,color:()=>this.style.getPropertyValue(`--evu-chart-line`)},ticks:{color:()=>this.style.getPropertyValue(`--evu-chart-tick`),callback(r){let o=+r;return Ot$1.formatLocale(o,i)+` `+this.chart.unit2}}},x:{type:`time`,ticks:{color:()=>this.style.getPropertyValue(`--evu-chart-tick`)},grid:{color:()=>this.style.getPropertyValue(`--evu-chart-line`)},time:{unit:`day`,tooltipFormat:`DD.MM.YYYY HH:mm`,displayFormats:{minute:`DD.MM.YY HH:mm`,hour:`DD.MM.YY HH:00`,day:`DD. MMM YY`,month:`MMMM YYYY`,year:`YYYY`}}}},animation:{duration:0}
3,plugins:{legend:{display:!1},filler:{drawTime:`beforeDatasetDraw`,propagate:!1},tooltip:{enabled:!1},zoom:{limits:{x:{min:`original`,max:`original`},y:{min:`original`,max:`original`}},pan:{enabled:!0,mode:`x`,threshold:10,onPan(){let r=window.scope;r&&(r.showLive=!1)}},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:`x`,onZoom(){let r=window.scope;r&&(r.showLive=!1)}}},datalabels:{color:this.style.getPropertyValue(`--evu-chart`),formatter:(r,o)=>{let a=$A(r.y,Ot$1.toMomentLocale(i),`1.0-0`)+` %`;return o.dataset.unit===`%`?a:``},anchor:`end`,align:`end`}},layout:{padding:{top:20,bottom:20}},elements:{point:{radius:0}},onClick(r,o){if(o.length>0){let a=o[0].index,c=this.data.labels[a],h=(0,it.default)(c).month()+1,f=(0,it.default)(c).year(),m=`01.01.`+f,p=`days`,v=window.consSidebar,b=v.scale,T=v.model.consumptionFilter;switch(v.scale){case j.Week:p=`days`,m=v.dpModelPerformFromDate.date,b=j.Day;break;case j.Month:p=`days`,m=`01.`+h+`.`+f,b=j.Day;break;case j.Year:p=`months`,m=`01.01.`+f,b=j.Month,Me.getOrder(T)<Me.getOrder(uH.Monthly)&&(p=`days`,m=`01.`+h+`.`+f,b=j.Day);break;case j.Custom:p=`days`,m=`01.`+h+`.`+f,b=j.Day,Me.getOrder(T)>Me.getOrder(uH.Daily)&&(b=j.Month);break}let k=(0,it.default)(c).diff((0,it.default)(m,dt$1.DMY),p);Me.getOrder(T)>Me.getOrder(uH.QuarterHourly)&&v.setDatesBasedOnRange(b,!0,k)}}}),this.redColorLimit={backgroundColor:this.limitColors.background,borderColor:this.limitColors.border,borderWidth:.8,stepped:`after`,fill:!1},this.redColorLimitBar={backgroundColor:this.limitColors.background,borderColor:this.limitColors.border,borderWidth:.8,stepped:`after`},this.highestLine={id:`highestLine`,resize:Vr,afterDatasetDraw:Vr},this.modelColors=[],this.language=n,it.default.locale(Ot$1.toMomentLocale(n))}};function Vr(e){if(!e.chartArea)return;let{ctx:n}=e,t=e.data.datasets,i=e.chartArea.top+e.chartArea.height,s=e.scales.x.min,r=e.scales.x.max,o=e.scales.y.max;o!==0&&t.forEach((a,c)=>{if(!e.isDatasetVisible(c))return;let h=e.getDatasetMeta(c),f=h.type?h.type:`line`,m=0,p=null;if(a.data.forEach(M=>{if(M&&typeof M==`object`){let O=M.y,F=M.x;O<o&&O>=m&&F<=r&&F>=s&&(m=O,p=F)}}),m===0||p===null)return;let v=1,T=1/o*m*e.chartArea.height,k=i-T,I=e.scales.x.getPixelForValue(p),N=a.borderColor?a.borderColor.toString():`black`;f===`line`&&(n.save(),n.beginPath(),n.strokeStyle=N,n.fillStyle=N,n.lineWidth=v,n.arc(I,k,4,0,2*Math.PI),n.fill(),n.stroke()),n.save(),n.beginPath(),n.strokeStyle=N,n.lineWidth=v,n.moveTo(e.chartArea.left,k),n.lineTo(e.chartArea.right,k),n.stroke()})}var Ht=class{constructor(n){this.language=Ot$1.defaultLanguage,this.showChartLegend=!0,this.chartType=`line`,this.selectedObjects=2,this.dataSets=new Array,this.showYAxes=!0,this.labels=new Array,this.chartColors=[],this.dataLoaded=!1,this.noDataAvailable=!1,this.scaleSelectionService=null,this.style=getComputedStyle(document.body),this.lineChartOptions=()=>{let t=this;return{color:()=>this.style.getPropertyValue(`--evu-chart`),backgroundColor:()=>this.style.getPropertyValue(`--evu-chart-bg`),borderColor:()=>this.style.getPropertyValue(`--evu-chart-border`),responsive:!0,maintainAspectRatio:!1,interaction:{intersect:!1,mode:`point`},onResize:(s,r)=>{let o=r.width<480;s?.options?.scales?.y&&(s.options.scales.y={grid:{color:()=>this.style.getPropertyValue(`--evu-chart-line`)},ticks:{color:()=>this.style.getPropertyValue(`--evu-chart-tick`),minRotation:o?45:0,callback(a){return a+` kW`}}})},scales:{y:{grid:{color:()=>this.style.getPropertyValue(`--evu-chart-line`)},beginAtZero:!0,stacked:!1,ticks:{color:()=>this.style.getPropertyValue(`--evu-chart-tick`),callback:s=>s+` kW`}},x:{type:`time`,ticks:{color:()=>this.style.getPropertyValue(`--evu-chart-tick`)},grid:{color:()=>this.style.getPropertyValue(`--evu-chart-line`)},time:{unit:fe.Second,tooltipFormat:`DD.MM.YYYY HH:mm:ss`,displayFormats:{second:`DD.MM.YY HH:mm:ss`,minute:`DD.MM.YY HH:mm`,day:`DD. MMM YY`,month:`MMMM YYYY`,year:`YYYY`}}}},animation:{duration:0},plugins:{tooltip:{intersect:!1,callbacks:{label(s){let r=this.chart.data.datasets[s.datasetIndex].label,o=this.chart.data.datasets[s.datasetIndex].data[s.dataIndex],a=0;return o!=null&&(a=o.y!==null&&o.y!==void 0?o.y:o),[r?.trim(),Ot$1.formatLocale(a,t.language,{maximumFractionDigits:3,minimumFractionDigits:3}).replace(/(\d)(?=(\d{3})+\.)/g,`$1,`)+` kW`].join(`: `)}}},zoom:{limits:{},pan:{enabled:!0,mode:`x`,threshold:10,onPan(s){let r=window.scope;r&&r.setZooming(s.chart.isZoomedOrPanned(),!0)}},zoom:{wheel:{enabled:!0},pinch:{enabled:!0},mode:`x`,onZoom(s){let r=window.scope;r&&r.setZooming(s.chart.isZoomedOrPanned())},onZoomComplete(s){let r=s.chart,o=r.getInitialScaleBounds();if(r.scales.x.ticks.length>1){let c=r.scales.x.min,h=r.scales.x.max;if(c<=(o.x.min??0)&&h>=(o.x.max??0)-1e4){let f=window.scope;f&&f.setZooming(!1)}}}}}
3,legend:{display:!1,position:`bottom`,onClick(s,r){let o=window.scope,a=r.datasetIndex??0,c=this.chart,h=c.getDatasetMeta(a),f=h.hidden===null||h.hidden===void 0?!c.data.datasets[a].hidden:!h.hidden;o&&(f=!o.lastHidden[r.text],o.lastHidden[r.text]=f,o.updateTicks(c)),h.hidden=f,c.update()}},datalabels:{display:!1}},layout:{padding:{top:20,bottom:20}},elements:{point:{radius:0}},onClick(s,r){if(r.length>0){let o=r[0].index,a=window.consSidebar,c=a.scale,h=a.model.consumptionFilter;switch(a.scale){case j.Week:case j.Month:c=j.Day;break;case j.Year:c=j.Month,h<uH.Monthly&&(c=j.Day);break;case j.Custom:c=j.Day,h>uH.Daily&&(c=j.Month);break}h>uH.Live&&a.setDatesBasedOnRange(c,!0,o)}}}},this.primConsumptionColors=[{backgroundColor:`rgba(0,129,171, 0.275)`,borderColor:`#0081ab`,pointBackgroundColor:`#0081ab`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#0081ab`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0},{backgroundColor:`rgba(255,70,60,0.275)`,borderColor:`#ff463c`,pointBackgroundColor:`#ff463c`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#ff463c`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0},{backgroundColor:`rgba(90,88,90, 0.275)`,borderColor:`#5a585a`,pointBackgroun
3dColor:`#5a585a`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#5a585a`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0},{backgroundColor:`rgba(149,81,158, 0.275)`,borderColor:`#95519e`,pointBackgroundColor:`#95519e`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#95519e`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0}],this.secReturnColors=[{backgroundColor:`rgba(255,182,15, 0.275)`,borderColor:`#ffb60f`,pointBackgroundColor:`#ffb60f`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#ffb60f`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0},{backgroundColor:`rgba(162,173,0, 0.2)`,borderColor:`#a2ad00`,pointBackgroundColor:`#a2ad00`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#a2ad00`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0},{backgroundColor:`#cb8f42`,borderColor:`#cb8f42`,pointBackgroundColor:`#cb8f42`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#cb8f42`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0},{backgroundColor:`rgba(235,204,221, 0.8)`,borderColor:`#9b0254`,pointBackgroun
3dColor:`#9b0254`,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:`#9b0254`,borderWidth:.8,stepped:!1,fill:!0,lineTension:0}],this.modelColors=[this.primConsumptionColors,this.secReturnColors],this.language=n}};var Zr=(()=>{class e{constructor(){this.objectSelectionService=_$1(Oi),this.logService=_$1(xS),this.repowerConfigService=_$1(Et$1),this.translationService=_$1(pz),this.liveDataProvider=_$1(Ts),this.isSiloveda=this.liveDataProvider.isSiloveda,this.logger=this.logService.getLogger(this.constructor.name),this.webSocketStarted=!1,this.hasProduction=S(!1),this.hasConsumption=S(!1),this.hasLoadLimit=S(!1),this.showLiveDataError=S(!1),this.isLoading=S(!0),this.currentValueConsumption=S(0),this.currentValueProduction=S(0),this.tick=S(void 0),this.liveDataConsumptions={},this.liveDataProductions={},this.isZooming=!1,this.lastFrom=null,this.lastUntil=null,this.lastHidden={},this.lastZoom=30,this.model=new Ht(this.repowerConfigService.currentLanguage()),this.toChartScaleValue=t=>{if(t!=null)return me.default.isMoment(t)?t.valueOf():t},this.toZoomScaleValue=t=>{if(t==null)return;if(me.default.isMoment(t))return t.valueOf();let i=Number(t);if(Number.isFinite(i))return i},this.getZoomOptions=t=>t.plugins?.zoom,this.getXScale=t=>{let i=t.scales?.x;if(i&&!(i.type!==void 0&&i.type!==`time`&&i.type!==`timeseries`))return i},this.getYScale=t=>{let i=t.scales?.y;if(i&&!(i.type!==void 0&&i.type!==`linear`))return i},this.onLiveData=t=>{if(!t||t.length===0){this.logger?.debug?.(`onLiveData empty`);return}this.logger?.debug?.(`onLiveData`,t.length,`values, siloveda:`,this.isSiloveda());let i=t;this.isSiloveda()&&(t=t.map(s=>(s.unit===3&&(s.value=s.value/1e3),s))),this.tick.set(!1),this.updateTickValue(i)},this.updateTickValue=t=>{let i=this.objectSelectionService.getSelectedDevices();if(i.length===0)return;let s=i[0],r=t.filter(f=>f.meteringPoint===s);if(!r||r.length===0){this.logger.debug(`updateTickValue skip empty`);return}let o=60,a=r;r.length>o&&(this.logger.debug(`updateTickValue truncating`,t.length,`to`,o),a=r.slice(-60)),this.logger.debug(`updateTickValue`,a.length),this.webSocketStarted=!0;let c=a.filter(f=>f.direction===0),h=a.filter(f=>f.direction===1);this.showLiveDataError.set(!1),this.liveDataErrorTimer&&(clearTimeout(this.liveDataErrorTimer),this.liveDataErrorTimer=void 0),this.transformData(c,0),this.transformData(h,1),this.isLoading.set(!1),this.isLoading.set(!1),c.length>0&&this.hasConsumption.set(!0),h.length>0&&this.hasProduction.set(!0),this.lastUntil||(this.lastFrom=this.lastUntil=null),this.isZooming||this.zoom(this.lastZoom,this.lastFrom,this.lastUntil),this.tick.set(!0)},this.sortValues=(t,i)=>{let s={};i===1?s=this.liveDataProductions:s=this.liveDataConsumptions;let r=this.objectSelectionService.getSelectedDevices();if(r.length===0)return;let o=r[0];if(s[o]||(s[o]=[]),Array.isArray(t))t.forEach(a=>{let c=(0,me.default)(a.timeStamp).valueOf(),h=parseFloat(a.value);if(isNaN(h)||!isFinite(h)){this.logger.debug(`sortValues skip invalid value`,a.value);return}let f=s[o].filter(m=>m[0]===c);!f||f.length===0?s[o].push([c,h]):f[0][1]=h});else{let a=(0,me.default)(t.timeStamp).valueOf(),c=parseFloat(t.value);if(isNaN(c)||!isFinite(c)){this.logger.debug(`sortValues skip invalid single value`,t.value);return}let h=s[o].filter(f=>f[0]===a);!h||h.length===0?s[o].push([a,c]):h[0][1]=c}s[o].sort((a,c)=>a[0]-c[0])},this.transformData=(t,i)=>{this.sortValues(t,i);let s=this.lastZoom<30?fe.Second:fe.Minute,r=new Ht(this.repowerConfigService.currentLanguage()),o=r.lineChartOptions(),a=this.getXScale(o);a?.time&&(a.time.unit=s),r.chartType=`line`,r.dataSets=new Array;let c=this.getLabels(),h=this.getDatas(0,c);if(h.length>0){let m=new Fe;m.label=this.translationService.translate()(`pages.overview.liveDataUsage`)+` `+this.translationService.translate()(`smartpower.common.powerUnit`),m.data=h,m.stack=`liveDataUsage0`,m.directionVariant=AH.RegularConsumption,m.spanGaps=!0,r.dataSets.push(m),this.lastHidden[m.label]||(this.lastHidden[m.label]=!1),this.model.primConsumptionColors[0].hidden=this.lastHidden[m.label]}let f=this.getDatas(1,c);if(f.length>0){let m=new Fe;m.label=this.translationService.translate()(`pages.overview.liveDataProduction`)+` `+this.translationService.translate()(`smartpower.common.powerUnit`),m.data=f,m.stack=`liveDataUsage1`,m.directionVariant=AH.RegularInjection,m.spanGaps=!0,r.dataSets.push(m),this.lastHidden[m.label]||(this.lastHidden[m.label]=!1),this.model.secReturnColors[0].hidden=this.lastHidden[m.label]}if(r.labels=c,this.pricingModel?.loadLimit??!1){let m=[],p=[],v=new Date;v.setDate(v.getDate()-1),p.push(v.getTime()),v.setDate(v.getDate()+1),p.push(v.getTime()),p.forEach(T=>{let k={x:T,y:this.pricingModel?.loadLimit};m.push(k)});let b=new Fe;b.label=`${this.translationService.translate()(`repowerWebpartConsumption.stackLabels.limitSmall`)} ${this.pricingModel?.loadLimitName} (${this.pricingModel?.loadLimit} ${this.translationService.translate()(`smartpower.common.powerUnit`)})`,b.data=m,b.stack=this.pricingModel?.loadLimitName,b.directionVariant=AH.RegularConsumption,b.spanGaps=!0,r.dataSets.push(b),this.hasLoadLimit.set(!0),this.lastHidden[b.label]!==!1&&this.lastHidden[b.label]!==!0&&(this.lastHidden[b.label]=!0),this.model.primConsumptionColors[1].fill=!1,this.model.primConsumptionColors[1].hidden=this.lastHidden[b.label]}o.plugins&&o.plugins.legend&&(o.plugins.legend.display=!0),this.updateModel(r),this.isLoading.set(!1)},this.getLabels=()=>{let t=this.objectSelectionService.getSelectedDevices();if(t.length===0)return[];let i=t[0],s=(0,me.default)().subtract(32,fe.Minute).valueOf(),r=this.isSiloveda(),o=this.liveDataConsumptions[i]??[],a=this.liveDataProductions[i]??[],c=[...o,...a].flatMap(h=>h[0]).filter(h=>s<h||r).sort((h,f)=>h-f);return Array.from(new Set(c))},this.getMaxValue=t=>t.length===0?0:t.sort((s,r)=>r.y-s.y)[0].y,this.getDatas=(t,i)=>{let s=this.objectSelectionService.getSelectedDevices();if(s.length===0)return[];let r=s[0],o={};t===1?o=this.liveDataProductions:o=this.liveDataConsumptions;let a=o[r]??[],c=[];
3i.forEach(m=>{a.filter(v=>v[0]===m).forEach(v=>{let T={x:m,y:v[1]};c.push(T)})});let h=i[i.length-1],f=c[c.length-1];return this.currentTime=(0,me.default)(h).format(`HH:mm:ss`),f&&(t===0?this.currentValueConsumption.set(+parseFloat(f.y)):this.currentValueProduction.set(+parseFloat(f.y))),c},this.updateModel=t=>{t.selectedObjects=this.objectSelectionService.getSelectedObjects()?this.objectSelectionService.getSelectedObjects().length:0,this.model.dataSets&&this.model.dataSets.length>0&&this.model.dataSets.forEach(o=>{o.data.splice(0,o.data.length)}),this.model.dataSets.splice(0,this.model.dataSets.length),this.model.labels.splice(0,this.model.labels.length),this.model.chartColors.splice(0,this.model.chartColors.length),this.model.lineChartOptions=t.lineChartOptions,this.model.chartType=t.chartType,this.model.showChartLegend=t.showChartLegend;let s=-1,r=-1;if(t.dataSets&&t.dataSets.length>0){for(let o=0;o<t.dataSets.length;o++){let a=t.dataSets[o],c=this.model.dataSets[o]=new Fe;c.data=[],a.data.forEach(f=>{c.data.push(f)}),c.label=a.label,c.color=a.color,c.stack=a.stack,this.model.dataSets[o]=c;let h;a.directionVariant===AH.RegularConsumption?s++:r++,h=a.directionVariant===AH.RegularConsumption?this.model.primConsumptionColors[s]:this.model.secReturnColors[r],this.model.chartColors.push(h)}t.labels.forEach(o=>{this.model.labels.push(o)})}else{this.liveDataErrorTimer||(this.isLoading.set(!0),this.liveDataErrorTimer=setTimeout(()=>{this.liveDataErrorTimer=void 0,this.isLoading.set(!1),this.showLiveDataError.set(!0)},1e4));let o=this.model.dataSets[0]=new Fe;o.data=[],o.label=this.translationService.translate()(`common.noDataForSelection`)}this.model.dataSets.length===0&&(this.model.dataSets=[]);for(let o=0;o<this.model.dataSets.length;o++)Object.assign(this.model.dataSets[o],this.model.chartColors[o]);this.model.dataLoaded=!0,this.renderChart()},this.getChartConfig=()=>({type:`line`,data:{labels:this.model.labels,datasets:this.model.dataSets},options:this.model.lineChartOptions()}),this.renderChart=()=>{let t=this.chart;if(!t)return;let i=this.getChartConfig();t.data.datasets=i.data.datasets,t.data.labels=i.data.labels,t.update(`none`)},this.zoom=(t,i=null,s=null,r=!1)=>{if(!this.chart)return;let o=this.chart;r&&(this.isZooming=!1),i!=null&&this.lastFrom!==null&&this.lastFrom!==void 0&&!this.lastFrom.isSame(i)&&(i=this.lastFrom),s!=null&&this.lastUntil!==null&&this.lastUntil!==void 0&&this.lastUntil!==s&&(s=this.lastUntil);let a=this.getLabels(),c=a[a.length-1],h=(0,me.default)(c).add(-t,fe.Minute);if(i==null)for(let p=a.length-2;p>=0;p--){let v=a[p];if(i=(0,me.default)(v),h.isAfter(i))break}this.lastZoom=t,this.lastFrom=i,this.lastUntil=s;let f=t<30?fe.Second:fe.Minute,m=this.getXScale(o.options);m?.time&&(m.time.unit=f),this.updateTicks(),this.chart.update(`none`)},this.updateTicks=()=>{if(isUndefined(this.chart))return;let t=this.chart,i=this.getXScale(t.options);if(!i)return;let s=this.toChartScaleValue(this.lastFrom),r=this.toChartScaleValue(this.lastUntil);i.min=s,i.max=r,i.minRotation=45;let o=this.model.lineChartOptions(),a=this.getXScale(o);a&&(a.min=s,a.max=r);let c=this.getXScale(t.options);c&&(c.min=s,c.max=r);let h=this.getLabels(),f=this.lastFrom,m=this.lastUntil;m??=(0,me.default)(h[h.length-1]).format(`HH:mm:ss`),f??=(0,me.default)(h[0]);let p=this.toZoomScaleValue(f),v=this.toZoomScaleValue(m),b=this.getZoomOptions(t.options);if(b&&p!==void 0&&v!==void 0)b.limits=A(z({},b.limits??{}),{x:A(z({},b.limits?.x??{}),{min:p,max:v})});let T=this.getYScale(o);T&&(T.grace=`10%`,T.beginAtZero=!0);let k=this.getYScale(t.options);k&&(k.grace=`10%`,k.beginAtZero=!0)}}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var $r=(()=>{class e{constructor(){this.objectSelectionService=_$1(Oi),this.userSelectionService=_$1(ke),this.websocketService=_$1(Lue),this.liveDataTickService=_$1(Zr),this.ngZone=_$1(_t$1),this.accessTokenService=_$1(QF),this.currentlySubscribed=S(mkNone()),this.activeConnections=new Map,this.resetSubscription=t=>{if(!this.hasActiveConnection(t.key))return;let i=this.objectSelectionService.getSelectedDevices(),s=this.userSelectionService.tryGetSubjektId(),r=this.currentlySubscribed();if(r.isSome()&&(this.liveDataTickService.isLoading.set(!0),this.websocketService.unsubscribe(t.key,r.value)),i.length>0&&s.isSome()){let o=i[0];this.websocketService.subscribe(t.key,s.value.toString(),o),this.currentlySubscribed.set(mkSome(o))}},this.objectSelectionService.objektDevicesChanged.subscribe(this.resetSubscription)}hasActiveConnection(t){return this.activeConnections.has(t)}startConnection(t,i){return G(this,null,function*(){if(this.hasActiveConnection(t.key))return;let s=this.accessTokenService.adalAccessTokenKey();if(isUndefined(s))return;let r=yield this.websocketService.openConnection(t.path,s,t.key);
3isUndefined(r)||(this.activeConnections.set(t.key,r),i.forEach(o=>{r.on(o.name,a=>queueMicrotask(()=>this.ngZone.run(()=>o.func(a))))}),this.resetSubscription(t))})}closeConnection(t){this.hasActiveConnection(t.key)&&(this.activeConnections.delete(t.key),this.websocketService.closeHubConnectionById(t.key))}refreshToken(t,i){this.hasActiveConnection(t.key)&&this.websocketService.refreshToken(t.key,i)}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var Dn=(function(e){return e.defaultOptions={notifications:!0,name:!0,layout:!0,css:!0,chartColors:!0,config:!1,customers:!1,translations:!0,files:!0,favicon:!0,subscriptions:!0},e.allOptions={notifications:!0,name:!0,layout:!0,css:!0,chartColors:!0,config:!0,customers:!0,translations:!0,files:!0,favicon:!0,subscriptions:!0},e})(Dn||{});var Kr=(()=>{class e{constructor(){this.tenantService=_$1(cv),this.tenantNameService=_$1(rM),this.themeService=_$1($2),this.layoutConfigService=_$1(az),this.storageService=_$1($g),this.logService=_$1(xS),this.logger=this.logService.getLogger(this.constructor.name),this.cssRequestId=0,this.listenersInitialized=!1,this.observedVariant=pv.System,this.isLoading=S(!1),this.tenantCss=S(null),this.variant=S(pv.System),this.devThemeName=S(null),this.variantChanges=Xn(this.variant),this.themeChanges=Xn(this.themeService.customThemes),this.storedTheme=this.storageService.localSignal(pv.themeLocalStorageKey)}initListeners(){this.listenersInitialized||(this.listenersInitialized=!0,this.listenToBrowserChanges(),this.listenToVariantChanges())}setThemeExplicitly(t){this.variant.set(t.variant),this.observedVariant=t.variant,t.isDevCustom||this.devThemeName.set(null),this.persistTheme(),t.isDevCustom||this.reloadCss(!0)}restoreStoredTheme(t){return G(this,null,function*(){try{this.variant.set(t.variant),t.devThemeName?(this.invalidateCssRequest(),this.devThemeName.set(t.devThemeName),this.themeChanges.pipe(u(i=>i.size>0),hi(1)).subscribe(i=>{if(this.devThemeName()!==t.devThemeName)return;let s=Array.from(i).find(r=>r.name===t.devThemeName);s?(this.invalidateCssRequest(),this.themeService.setTheme(s)):(this.devThemeName.set(null),this.reloadCss())})):yield this.reloadCss()}catch(i){console.error(`Error loading dev theme`,i),this.storedTheme.set(null),yield this.reloadCss()}})}persistTheme(){let t={variant:this.variant(),devThemeName:this.devThemeName()};this.storedTheme.set(t)}storeVariant(t){this.variant.set(t),this.persistTheme()}storeDevTheme(t){t&&this.invalidateCssRequest(),this.devThemeName.set(t),this.persistTheme()}mkVariantSetting(){return this.devThemeName()?UH.BaseTheme:this.variant()===pv.Dark?UH.BaseThemeDark:UH.BaseTheme}mkVariantStr(){if(this.devThemeName())return``;let t=this.variant();return match(t).pipe(mWhen(pv.Light,()=>``),mWhen(pv.Dark,()=>pv.Dark),mWhen(pv.System,()=>window.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).matches?pv.Dark:``),mExhaustive)}reloadCss(t=!1,i){return G(this,null,function*(){let s=++this.cssRequestId,r=i??this.tenantNameService.tenant();this.isLoading.set(!0);try{let o=this.layoutConfigService.isDarkThemeAllowed()||t?this.mkVariantStr():``,a=yield nw(this.tenantService.getSettingAsCss({key:`BaseTheme-BaseCss`,tenantId:r,tenant:r,variant:o}));if(s!==this.cssRequestId)return;let c=a??``;this.applyTheme(c,o),this.tenantCss.set(c)}catch(o){s===this.cssRequestId&&this.logger.error(`Failed to load tenant CSS: ${String(o)}`)}finally{s===this.cssRequestId&&this.isLoading.set(!1)}})}setTheme(t,i=!1){if(isUndefined(t))return;this.invalidateCssRequest();let s=this.layoutConfigService.isDarkThemeAllowed()||i?this.mkVariantStr():``;this.applyTheme(t,s)}applyTheme(t,i){this.themeService.setTheme({name:UH.BaseTheme.toString()+i,isDark:i===pv.Dark,css:t})}invalidateCssRequest(){this.cssRequestId+=1,this.isLoading.set(!1)}listenToVariantChanges(){this.observedVariant=this.variant(),this.variantChanges.subscribe(t=>{t!==this.observedVariant&&(this.observedVariant=t,this.devThemeName()||(this.reloadCss(),this.persistTheme()))})}listenToBrowserChanges(){window?.matchMedia&&window.matchMedia(`(prefers-color-scheme: dark)`).addEventListener(`change`,i=>{this.variant()===pv.System&&!this.devThemeName()&&this.reloadCss()})}reapplyDevThemeIfActive(){let t=this.devThemeName();if(!t)return;this.invalidateCssRequest();let s=Array.from(this.themeService.customThemes()).find(r=>r.name===t);s&&this.themeService.setTheme(s)}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var ge=(function(e){return e.positive=`positive`,e.negative=`negative`,e})(ge||{});var re={hsl:{h:0,s:0,l:.7019607843137254,a:1}
3,hex:`#b3b3b3`,rgb:{r:179,g:179,b:179,a:1},hsv:{h:0,s:0,v:.7019607843137254,a:1},oldHue:0,source:`hex`};var Xr=(()=>{class e{constructor(){this.tenantService=_$1(cv),this.tenantNameService=_$1(rM),this.energyboardConfigService=_$1(ZH),this.colorThemeConfig=new qo$1(null),this.configKey=UH.ColorTheme,this.isLoading=S(!1),this.branches=[`energy`,`costs`,`measurementData`,`measurementPerformanceData`],this.segments=[];let t=this.tenantNameService.tenant();this.loadSegments(),this.reloadColorThemeConfig(t)}loadSegments(){let t=this.energyboardConfigService.config().chartGroups??[];this.segments=t.map(i=>i.id)}reloadColorThemeConfig(t){this.isLoading.set(!0),this.tenantService.getTenantSettingByKey({key:this.configKey,tenant:t}).subscribe({next:i=>{if(i){let s=JSON.parse(i);s=this.fixConfigObject(s),this.colorThemeConfig.next(s)}else this.loadDefaultColorThemeConfig();this.isLoading.set(!1)},error:()=>{this.loadDefaultColorThemeConfig(),this.isLoading.set(!1)}})}fixConfigObject(t){let i=this.getDefaultConfig();return this.branches.forEach(s=>{t[s]||(t[s]={}),this.segments.forEach(r=>{t[s][r]||(t[s][r]=[],i&&i[s]&&i[s][r]&&(t[s][r]=i[s][r])),t[s][r].forEach(o=>{let a=t[s][r][0],c=0;o.elements.forEach(h=>{h.direction=a.elements[c].direction,c++})})})}),t}loadDefaultColorThemeConfig(){this.colorThemeConfig.next(this.getDefaultConfig())}saveColorThemeConfig(t){return G(this,null,function*(){this.tenantService.updateTenantSettings({body:{colorTheme:JSON.stringify(t)}}).subscribe(i=>(this.colorThemeConfig.next(t),i))})}getColorArrayFromThemeConfig(t,i,s,r=ge.positive,o=`hex`,a=!1,c=!0,h=1){let f=this.colorThemeConfig.getValue();if(!f||f[t][i].length<s+1)return[];let m=t,p=i,k=f[m][p][s].elements.filter(I=>I.direction===r).map(I=>{let N=o===`hex`?this.rgbaToHex(this.hexToRGB(I.value.hex,.5),!1):this.convertToChartRgba(I.value.rgb,`0.08`),M=o===`hex`?I.value.hex:this.convertToChartRgba(I.value.rgb),O=o===`hex`?I.value.hex:this.convertToChartRgbaNoAlpha(I.value.rgb),F={hoverBackgroundColor:N,backgroundColor:M,borderColor:O,pointBackgroun
3dColor:O,pointBorderColor:`#fff`,pointHoverBackgroundColor:`#fff`,pointHoverBorderColor:O,fill:!0,tension:0,stepped:!1};return c&&(F.stepped=`after`),F.borderWidth=h,F});return a?k.reverse():k}rgbaToHex(t,i=!1){return`#`+t.replace(/^rgba?\(|\s+|\)$/g,``).split(`,`).filter((s,r)=>!i||r!==3).map(s=>parseFloat(s)).map((s,r)=>r===3?Math.round(s*255):s).map(s=>s.toString(16)).map(s=>s.length===1?`0`+s:s).join(``)}hexToRGB(t,i){var s=parseInt(t.slice(1,3),16),r=parseInt(t.slice(3,5),16),o=parseInt(t.slice(5,7),16);return i?`rgba(`+s+`, `+r+`, `+o+`, `+i+`)`:`rgb(`+s+`, `+r+`, `+o+`)`}hslToRgba(t,i,s){i/=100,s/=100;let r=c=>(c+t/30)%12,o=i*Math.min(s,1-s),a=c=>s-o*Math.max(-1,Math.min(r(c)-3,Math.min(9-r(c),1)));return{r:Math.round(255*a(0)),g:Math.round(255*a(8)),b:Math.round(255*a(4)),a:1}}rgbToHex(t,i,s){return`#`+[t,i,s].map(r=>{let o=r.toString(16);return o.length===1?`0`+o:o}).join(``)}convertToChartRgba(t,i=`0.275`){return`rgba(${t.r}, ${t.g}, ${t.b}, ${i})`}convertToChartRgbaNoAlpha(t){return`rgba(${t.r}, ${t.g}, ${t.b}, 1)`}getDefaultConfig(){let t={mainColor:re,footerColor:re,linkColor:re,linkHoverColor:re};for(let i of this.branches){t[i]={};for(let s of this.segments)if(t[i][s]=[],i===`measurementData`||i===`measurementPerformanceData`)for(let r=1;r<5;r++)t[i][s].push({name:`Balken `+r,position:r-1,elements:[{direction:ge.positive,value:re},{direction:ge.negative,value:re}]});else for(let r=1;r<5;r++)t[i][s].push({name:`Balken `+r,position:r-1,elements:[{direction:ge.positive,value:re},{direction:ge.positive,value:re},{direction:ge.positive,value:re},{direction:ge.negative,value:re},{direction:ge.negative,value:re},{direction:ge.negative,value:re}]})}return JSON.parse(JSON.stringify(t))}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var qr=(()=>{class e{constructor(){this.notificationEventService=_$1(_me),this.notificationEvents=S([]),this.reloadTriggered=new We$1}loadData(t){return this.notificationEventService.getCurrentNotificationEvents({tenant:t}).pipe(lw(1),Vl$1(s=>uu(()=>s)))}reset(){this.reloadTriggered.emit()}onRegisterNotificationEvent(t){return this.notificationEventService.registerNotificationEvent(t)}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac})}}return e})();var An=(function(e){return e.TXT=`text/plain`,e.CSV=`text/csv`,e.JSON=`application/json`,e.PDF=`application/pdf`,e.XLSX=`application/vnd.openxmlformats-officedocument.spreadsheetml.sheet`,e.PNG=`image/png`,e.JPEG=`image/jpeg`,e.SVG=`image/svg+xml`,e.OCTET_STREAM=`application/octet-stream`,e})(An||{});var Gr=(()=>{class e{constructor(){this.logService=_$1(xS),this.dmsService=_$1(ime),this.authService=_$1(Ye),this.logger=this.logService.getLogger(this.constructor.name),this.MimeType=An,this._useDms=new qo$1(!1),this.useDms$=this._useDms.asObservable(),this.pdfFiles=S([]),this.imageFiles=S([]),this.isLoadingPdfFiles=S(!1),this.isLoadingImageFiles=S(!1)}init(){this.dmsService.hasDms().pipe(Yr$1(t=>{this._useDms.next(t)}),Vl$1(t=>(this.logger.error(`Error checking DMS availability:`,t),this._useDms.next(!1),Ie(!1)))).subscribe(),this.useDms$.pipe(Yr$1(t=>{this.loadFiles(`pdf`,t),this.loadFiles(`images`,t)})).subscribe()}reloadAllFiles(){if(!this.authService.isLoggedIn()){this.logger.error(`Didn't get files due to logged out state`);return}let t=this._useDms.getValue();this.loadFiles(`pdf`,t),this.loadFiles(`images`,t)}loadFiles(t,i){i===void 0&&(i=this._useDms.getValue()),i?this.loadFilesFromDms(t):console.warn(`No DMS found, static files are unavailable`)}loadFilesFromDms(t){let i={folder:t};t===`pdf`?this.isLoadingPdfFiles.set(!0):this.isLoadingImageFiles.set(!0),this.dmsService.getFileStructure(i).subscribe({next:s=>{let r=s.map(o=>({href:o.href,type:t===`pdf`?this.MimeType.PDF:`image/*`})).filter(o=>o.href.length>0);t===`pdf`?(this.pdfFiles.set(r),this.isLoadingPdfFiles.set(!1)):(this.imageFiles.set(r),this.isLoadingImageFiles.set(!1))},error:s=>{this.logger.error(`Error fetching ${t} files from DMS`,s),t===`pdf`?this.isLoadingPdfFiles.set(!1):this.isLoadingImageFiles.set(!1)}})}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();
3var Zl=[`pdf`];var Qr=(()=>{class e{constructor(){this.tenantNameService=_$1(rM),this.imageBasePath=H(()=>this.tenantNameService.subtenantImageAssetString()),this.staticImageBasePath=this.tenantNameService.subtenantStaticAssetString,this.genericBasePath=H(()=>this.tenantNameService.subtenantGenericAssetString()),this.pdfBasePath=H(()=>this.tenantNameService.subtenantPdfAssetString())}extractFilename(t){return t?t.startsWith(`http://`)||t.startsWith(`https://`)?t:t.substring(t.lastIndexOf(`/`)+1):``}isExternalUrl(t){return t?.startsWith(`http://`)||t?.startsWith(`https://`)}getExtension(t){let i=this.extractFilename(t),s=i.lastIndexOf(`.`);return s>=0?i.substring(s+1).toLowerCase():``}detectAssetType(t){let i=this.getExtension(t);return Zl.includes(i)?`pdf`:`image`}buildPath(t){if(!t)return``;if(this.isExternalUrl(t))return t;let i=this.extractFilename(t);return i?`${this.detectAssetType(i)===`image`?this.imageBasePath():this.pdfBasePath()}${i}`:``}buildImagePath(t){if(!t)return``;if(this.isExternalUrl(t))return t;let i=this.extractFilename(t);return i?`${this.imageBasePath()}${i}`:``}buildStaticPath(t){if(!t)return``;let i=this.extractFilename(t);return i?`${this.staticImageBasePath}${i}`:``}buildImagePathForTenant(t,i){if(!t)return``;if(this.isExternalUrl(t))return t;let s=this.extractFilename(t);return s?`${this.tenantNameService.imageAssetStringForTenant(i)}${s}`:``}buildGenericPath(t){if(!t)return``;if(this.isExternalUrl(t))return t;let i=this.extractFilename(t);return i?`${this.genericBasePath()}${i}`:``}buildPdfPath(t){if(!t)return``;if(this.isExternalUrl(t))return t;let i=this.extractFilename(t);return i?`${this.pdfBasePath()}${i}`:``}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var Jr=(()=>{class e{constructor(){this.assetPathService=_$1(Qr)}reloadFavicon(){let t=document.querySelector(`link[rel*='icon']`);if(t)t.href=this.assetPathService.buildGenericPath(`favicon.ico`)+`?v=`+new Date().getTime()}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var eo={[UH.Layout]:!1,[UH.ConfigDto]:!1,[UH.BaseCss]:!1,[UH.BaseTheme]:!1,[UH.BaseThemeDark]:!1,[UH.ColorTheme]:!1,[UH.ContractsEnabled]:!1,[UH.CustomerReports]:!1,[UH.CustomerServiceEnabled]:!1,[UH.ContractRangeInYears]:!1,[UH.CustomerReportsEnabled]:!1,[UH.DocumentsEnabled]:!1,[UH.EnergyBenEnabled]:!1,[UH.EnergyQuizEnabled]:!1,[UH.EnergyQuickCheck]:!1,[UH.EnergyDetailCheck]:!1,[UH.ProductsEnabled]:!1,[UH.MobileAppEnabled]:!1,[UH.MobileAppLiveDataEnabled]:!1,[UH.MoostEnabled]:!1,[UH.NewLayoutEnabled]:!1,[UH.NotificationEnabled]:!1,[UH.NotificationPushEnabled]:!1,[UH.NotificationPushSettingsEnabled]:!1,[UH.OstralEnabled]:!1,[UH.OnlineCounter]:!1,[UH.DelegatesPage]:!1,[UH.ProductConfiguratorEnabled]:!1,[UH.QuizSupportMail]:!1,[UH.ShowAttachments]:!1,[UH.ShowConsultant]:!1,[UH.ShowEv]:!1,[UH.ShowZev]:!1,[UH.ShowLeg]:!1,[UH.UpdatePasswordActionEnabled]:!1,[UH.WebAppLiveDataEnabled]:!1,[UH.KeycloakPolicyEnabled]:!1,[UH.PermissionsEnabled]:!1,[UH.TwoFactorAuthChangable]:!1,[UH.TwoFactorAuthEnabled]:!1,[UH.ActivityAttachmentReceiver]:!1,[UH.ActivityReceiver]:!1,[UH.NotificationGroupsEmail]:!1,[UH.NotificationGroups]:!1,[UH.ProductSupportMail]:!1,[UH.ControlSmartMeterDevices]:!1,[UH.FaqPageEnabled]:!1,[UH.AvailableLegMembers]:!1,[UH.DynamicTariff]:!1};var to=(()=>{class e{constructor(){this.tenantService=_$1(cv),this.subscriptionsState=S(eo),this.loadOnceByKey=new Map,this.subscriptions=this.subscriptionsState.asReadonly()}loadSubscriptions(t=!1,i,s$1){let r=this.getCacheKey(i,s$1);if(t||!this.loadOnceByKey.has(r)){let o=this.tenantService.getSubscriptions({tenant:i,backoffice:s$1}).pipe(s(a=>this.normalizeSubscriptions(a)),Yr$1(a=>{isUndefined(i)&&(isUndefined(s$1)||s$1===!1)&&this.subscriptionsState.set(a)}),lw({bufferSize:1,refCount:!1}),Vl$1(a=>(this.loadOnceByKey.delete(r),uu(()=>a))));this.loadOnceByKey.set(r,o)}return this.loadOnceByKey.get(r)}refreshSubscriptions(t,i){return this.loadSubscriptions(!0,t,i)}initSubscriptions(){this.refreshSubscriptions().subscribe()}getSetting(t,i,s$2){return this.loadSubscriptions(!1,i,s$2).pipe(s(r=>r[t]??!1))}
3getSettingAsString(t,i,s$3){return this.getSetting(t,i,s$3).pipe(s(r=>String(r)))}getSettings(t,i,s$4){return this.loadSubscriptions(!1,i,s$4).pipe(s(r=>Object.fromEntries(t.map(o=>[o,r[o]??!1]))))}getCacheKey(t,i){return`${t??`__default__`}|${String(i??!1)}`}normalizeSubscriptions(t){return Object.fromEntries(Object.entries(t).map(([i,s])=>[i,this.normalizeBool(s)]))}normalizeBool(t){return typeof t==`boolean`?t:String(t).toLowerCase()===`true`}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var io=(()=>{class e{constructor(){this.translationService=_$1(pz),this.tenantNameService=_$1(rM),this.tenantChartColorService=_$1(Xr),this.tenantCssService=_$1(Kr),this.tenantSubscriptionsService=_$1(to),this.layoutConfigService=_$1(az),this.energyboardConfigService=_$1(ZH),this.authService=_$1(Ye),this.userSelectionService=_$1(ke),this.notificationsDataService=_$1(qr),this.fileService=_$1(Gr),this.faviconService=_$1(Jr),this.environment=_$1(`environmentEnergyboard`)}setTenant(t,i){let s=this.tenantNameService.tenant(),r=s!==i,o=this.environment.devMultiTenant&&t.name&&mo.getSuperTenantOrSelf(s)!==mo.getSuperTenantOrSelf(i),a=this.tenantNameService.setTenantName(i.toString(),o);if(o){this.authService.clearTenantSession(),this.userSelectionService.setSubjekt(null);let f=this.tenantNameService.tenantToken();a&&isDefined(f)&&this.authService.restoreTenantSession(f,!1)}let c=this.authService.sessionReady(),h=this.authService.hasRoleInSet(new Set([Y.EvulutionAdmin,Y.ServiceDesk]));if(o&&h&&r&&this.changeLastSubject(),t.layout&&this.layoutConfigService.reloadLayout(),t.css&&(!!this.tenantCssService.devThemeName()?this.tenantCssService.reapplyDevThemeIfActive():this.tenantCssService.reloadCss(!1,i)),t.chartColors&&this.tenantChartColorService.reloadColorThemeConfig(i),t.notifications&&this.notificationsDataService.reset(),t.config&&c&&this.energyboardConfigService.reloadConfig(),!o&&!h&&t.customers&&this.authService.isLoggedIn()){let f=this.userSelectionService.tryGetSubjektId();isDefined(f)&&this.userSelectionService.subjektIdChanged.emit(f.value)}t.translations&&this.translationService.reloadTranslations(),t.favicon&&this.faviconService.reloadFavicon(),t.name||this.tenantNameService.setTenantName(s,!1),t.files&&this.fileService.reloadAllFiles(),t.subscriptions&&this.tenantSubscriptionsService.refreshSubscriptions()}changeLastSubject(){let t=this.tenantNameService.tryFetchLastSubjectPerTenant();isDefined(t)?this.userSelectionService.lastSubject.set(t.value):this.userSelectionService.lastSubject.set(null),this.userSelectionService.usePreviousSubject()}backToSuperTenant(t){this.setTenant({notifications:!0,name:!0,layout:!0,css:!0,chartColors:!1,config:!1,customers:!1,translations:!0,files:!0,favicon:!0,subscriptions:!0},mo.getSuperTenantOrSelf(t))}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac,providedIn:`root`})}}return e})();var zt=(()=>{class e{constructor(){this.loginService=_$1(vme),this.router=_$1(Mo),this.liveDataService=_$1($r),this.tenantNameService=_$1(rM),this.injector=_$1(bt$1),this.platformService=_$1(nz),this.nativeKeepAwakeService=_$1(mi),this.nativeTokenStorageService=_$1(gi),this.accessTokenService=_$1(QF),this.pageService=_$1(Ug),this.environment=_$1(`environmentEnergyboard`)}signout(t=!1,i=!1){return G(this,null,function*(){this.tenantNameService.isLoggedIn.set(!1),this.resetSessionState();let s=yield this.tryGetStoredRefreshToken();if(!i&&isDefined(s)){let a={refreshToken:s.value};this.loginService.logout({body:a}).subscribe()}if(this.platformService.isNativePlatform()&&!i&&!this.nativeKeepAwakeService.logoutTriggered()&&(yield this.nativeTokenStorageService.clearRefreshToken()),i)this.accessTokenService.accessToken.set(null),this.accessTokenService.adalAccessTokenKey.set(null),this.accessTokenService.idToken.set(null);else{let a=this.tenantNameService.tenantToken();this.environment.devMultiTenant&&isDefined(a)?a===this.accessTokenService.accessToken()&&(this.accessTokenService.clearTokens(),this.tenantNameService.clearCurrentTenantAccessToken()):(this.accessTokenService.clearTokens(),this.tenantNameService.clearCurrentTenantAccessToken())}t&&this.accessTokenService.isTimeout.set(!0),this.injector.get(Ye).clearTenantSession();let r=yield this.router.navigate([`login`]),o=this.tenantNameService.tenant();r&&mo.hasSuperTenant(o)&&this.resetSubtenant(o)})}resetSubtenant(t){this.injector.get(io).setTenant(Dn.defaultOptions,mo.getSuperTenantOrSelf(t))}resetSessionState(){this.pageService.menuLevel.set(ut.MenuLevel.None),this.injector.get(ke).sessionReset$.next(),Gi.allDetails.forEac
3h(t=>this.liveDataService.closeConnection(t))}tryGetStoredRefreshToken(){return G(this,null,function*(){if(this.platformService.isNativePlatform()){let i=yield this.nativeTokenStorageService.getRefreshToken();return isDefined(i?.trim())?mkSome(i):mkNone()}let t=this.accessTokenService.refreshToken();return t?.trim()?mkSome(t):mkNone()})}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=Ye$1({token:e,factory:e.ɵfac})}}return e})();var Ye=(()=>{class e{constructor(){this.tokenHelperService=_$1(di),this.loginService=_$1(vme),this.repowerConfigService=_$1(Et$1),this.tenantNameService=_$1(rM),this.logService=_$1(xS),this.appStatusService=_$1(Ss),this.platformService=_$1(nz),this.nativeKeepAwakeService=_$1(mi),this.nativeTokenStorageService=_$1(gi),this.accessTokenService=_$1(QF),this.injector=_$1(bt$1),this.decodedIdToken=S(null),this.decodedAccessToken=S(null),this.decodedAccessTokenObs=Xn(this.decodedAccessToken),this.logger=this.logService.getLogger(this.constructor.name),this.loggedIn=S(this.getInitialLoggedInState()),this.loggedIn$=Xn(this.loggedIn),this.initializedAccessToken=S(mkNone()),this.sessionReady=H(()=>{let t=this.initializedAccessToken();return this.loggedIn()&&isSome(t)&&t.value===this.accessTokenService.accessToken()}),this.sessionReady$=Xn(this.sessionReady),this.jwtHelper=new XF,this.tenantNameServiceLogin=Xn(this.tenantNameService.isLoggedIn),this.isNative=!1,this.tokenData=S({}),this.isLoggedIn=H(()=>this.loggedIn()),this.tokenWillNotExpire=H(()=>{let t=this.accessTokenService.expiresAt();return!(t==null||t&&parseInt(t,10)<new Date().getTime()+3e5)}),this.getToken=H(()=>this.accessTokenService.accessToken()),this.getIdToken=H(()=>this.accessTokenService.idToken()),this.getCurrentUserEmail=H(()=>this.decodedIdToken()?.upn),this.getCurrentUserId=H(()=>this.decodedIdToken()?.sub),this.getCurrentPhoneNumber=H(()=>this.decodedIdToken()?.phone),this.getTwoFactorMethod=H(()=>{let t=this.decodedIdToken()?.twoFactorAuthMethod;return isUndefined(t)||t===``?null:t.toLowerCase()}),this.getCurrentUserCustomerIdsUnmapped=H(()=>{let t=this.decodedAccessToken();if(t===null)return null;let i=t.subjectId;return i&&!Array.isArray(i)&&(i=i.split(`,`)),i||(i=[]),i}),this.getCurrentUserRoles=H(()=>this.decodedAccessToken()?.role),this.getCiid=H(()=>this.decodedAccessToken()?.ciid),this.isTokenExpired=H(()=>new XF().isTokenExpired(this.accessTokenService.accessToken())),this.isNative=this.platformService.isNativePlatform(),this.isNative&&this.clearRegularRefreshToken(),this.loggedIn$.subscribe(t=>{this.tenantNameService.isLoggedIn.set(t),this.repowerConfigService.isLoggedIn.set(this.isLoggedIn())}),this.tenantNameServiceLogin.subscribe(t=>{this.loggedIn.set(t)}),this.isNative&&Xn(this.nativeKeepAwakeService.logoutTriggered).subscribe(t=>{t&&this.isLoggedIn()?(this.injector.get(zt).signout(!1,!0),this.nativeKeepAwakeService.logoutTriggered.set(!1)):t&&!this.isLoggedIn()&&this.nativeKeepAwakeService.logoutTriggered.set(!1)}),Xn(this.accessTokenService.idToken).subscribe(t=>{if(isDefined(t)){let i=this.tokenHelperService.parseJwt(t);this.decodedIdToken.set(i);return}this.decodedIdToken.set(null)}),Xn(this.accessTokenService.accessToken).subscribe(t=>{if(isDefined(t)&&!this.jwtHelper.isTokenExpired(t)){this.sessionReady()||this.restoreTenantSession(t);return}this.clearTenantSession()}),Xn(this.accessTokenService.accessToken).subscribe(()=>{this.repowerConfigService.isLoggedIn.set(this.isLoggedIn())})}requireAuthentication(){return t=>pu(()=>this.isLoggedIn()?t:ko)}hasRefreshToken(){return G(this,null,function*(){return isDefined(yield this.tryGetStoredRefreshToken())})}startAuthentication(){this.initializedAccessToken.set(mkNone()),this.loggedIn.set(!1)}refreshToken(){return dn$1(this.tryGetStoredRefreshToken()).pipe(Fo(t=>{if(isUndefined(t))return uu(()=>new Error(`No refresh token is available`));let i={refreshToken:t.value};return this.handleRefreshToken(this.loginService.refreshToken({body:i}))}))}SetToken(t){return G(this,null,function*(){let i;if(typeof t==`string`){if(!t||t.trim()===``||!t.startsWith(`{`)&&!t.startsWith(`[`))return;i=JSON.parse(t)}else i=t;if(i.access_token!==null&&i.access_token!==void 0){let r=!this.sessionReady();this.accessTokenService.adalAccessTokenKey.set(i.access_token),i.id_token!==null&&i.id_token!==void 0&&(this.accessTokenService.idToken.set(i.id_token),this.decodedIdToken.set(this.tokenHelperService.parseJwt(i.id_token))),this.accessTokenService.accessToken.set(i.access_token),this.accessTokenService.expiresAt.set(``+(Date.now()+i.expires_in*1e3)),this.accessTokenService.idTokenExpiresAt.set(``+(Date.now()+i.expires_in*1e3)),this.accessTokenService.accessTokenStoredAt.set(``+Date.now()),this.restoreTenantSession(i.access_token,!1,r),this.tenantNameService.storeAccessToken()}i.language!==null&&i.language!==void 0&&this.repowerConfigService.languageChanged.emit(i.language),this.tokenData.set(i),yield this.setRefreshToken(i)})}setRefreshToken(t){return G(this,null,function*(){if(isUndefined(t.refresh_token))return;if(this.isNative){this.clearRegularRefreshToken();return}let s=this.jwtHelper.decodeToken(t.refresh_token)?.exp;if(this.accessTokenService.refreshToken.set(t.refresh_token),s&&this.accessTokenService.refreshTokenExpired.set(s.toString()),this.refreshTokenTimeoutId&&clearTimeout(this.refreshTokenTimeoutId),s){let r=1e3*s-Date.now();r>0&&(this.refreshTokenTimeoutId=setTimeout(()=>{this.injector.get(zt).signout(!0)},r))}})}restoreTenantSession(t,i=!0,s=!0){s&&this.initializedAccessToken.set(mkNone()),this.decodedAccessToken.set(this.tokenHelperService.parseJwt(t)),s&&(this.resolveSessionTenant(i),this.injector.get(ke).initializeSession(i)),this.initializedAccessToken.set(mkSome(t)),this.loggedIn.set(!0)}resolveSessionTenant(t){let i=this.tenantNameService.tenant();if(t&&mo.hasSuperTenant(i))return;let r=(this.getCurrentUserCustomerIdsUnmapped()?.[0]??``).split(`-`)[1]??``;if(!r)return;let o=mo.tenantFromString(r);mo.hasSuperTenant(o)&&mo.getSuperTenantOrSelf(o)===mo.getSuperTenantOrSelf(i)&&this.tenantNameService.setTenantName(o,!1)}clearTenantSession(){this.initializedAccessToken.set(mkNone()),this.decodedAccessToken.set(null),this.loggedIn.set(!1)}getCurrentUserCustomerIds(){let t=this.getCurrentUserCustomerIdsUnmapped();return t==null?[]:t.filter(s=>s!==``).map(s=>+this.mapSubjectId(s))}getCurrentUserCustomerId(){let t=this.getCurrentUserCustomerIds(),i=0;return t.length===i?mkNone():mkSome(t[i])}hasRoleInSet(t){let i=!1,s=this.getCurrentUserRoles();return isUndefined(s)||(typeof s==`string`?i=t.has(s):i=s.filter(o=>o!==void 0).map(o=>o).some(o=>t.has(o))),i}addHeader(t){let i=this.repowerConfigService.currentLanguage(),s=this.accessTokenService.accessToken(),r=t.headers.has(`Tenant`)?t.headers.get(`Tenant`)??this.tenantNameService.tenant():this.tenantNameService.tenant();return t=t.clone({setHeaders:{Accept:`application/json`,Authorization:s?`Bearer `+s:``,Tenant:r,"Cache-Control":`no-cache`,Pragma:`no-cache`,Expires:`Sat, 01 Jan 2000 00:00:00 GMT`,Language:``+i}}),t}mapSubjectId(t){if(t.indexOf(`-`)>=0){let i=t.split(`-`),s=mo.tenantFromString(i[1]);return mo.getSuperTenantOrSelf(s)===mo.getSuperTenantOrSelf(this.tenantNameService.tenant())?i[0]:``}else return t}ngOnDestroy(){this.refreshTokenTimeoutId&&clearTimeout(this.refreshTokenTimeoutId)}handleRefreshToken(t){return t.pipe(Fc$1(i=>G(this,null,function*(){return yield this.SetToken(i),i})),Vl$1(i=>(this.logger.error(`API Error`,i),i.status===0&&this.appStatusService.isApiUnreachable.set(!0),uu(()=>i))))}tryGetStoredRefreshToken(){return G(this,null,function*(){if(this.isNative){let i=yield this.nativeTokenStorageService.getRefreshToken();return isDefined(i?.trim())?mkSome(i):mkNone()}let t=this.accessTokenService.refreshToken();return t?.trim()?mkSome(t):mkNone()})}clearRegularRefreshToken(){this.accessTokenService.refreshToken.set(null),this.accessTokenService.refreshTokenExpired.set(null)}getInitialLoggedInState(){let t=this.accessTokenService.accessToken();if(isUndefined(t))return!1;try{return!new XF().isTokenExpired(t)}catch(i){return!1}}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac})}}return e})();var $l=`evulution.lastSubjekt`;var nt=(function(e){return e[e.None=0]=`None`,e[e.Specific=1]=`Specific`,e[e.Unset=2]=`Unset`,e})(nt||{});var ke=(()=>{class e{constructor(){this.customerService=_$1(nme),this.customerImportService=_$1(Jpe),this.router=_$1(Mo),this.tokenHelperService=_$1(di),this.authService=_$1(Ye),this.tenantNameService=_$1(rM),this.storageService=_$1($g),this.injector=_$1(bt$1),this.subjektIdChanged=new We$1,this.subjektCleared=new We$1,this.sessionReset$=new Ze,this.hasSmartpower=!1,this.userSubjektIdStorageKey=`usersubjektId`,this.subjectId=this.storageService.sessionSignal(this.userSubjektIdStorageKey),this.selectedSubjektState=S({variant:nt.None}),this.lastSubject=this.storageService.localSignal($l),this.lastModifiedDate=new qo$1(new Date),this.isUpdating=S(!1),this.oldSubjektId=null,this.signout=()=>G(this,null,function*(){yield this.injector.get(zt).signout()}),this.getCurrentUserEmail=this.authService.getCurrentUserEmail}tryGetSubjektId(){if(!this.authService.isLoggedIn())return mkNone();let t=this.selectedSubjektState();if(t.variant===nt.Specific)return mkSome(t.subjektId);if(t.variant===nt.Unset)return mkNone();let i=this.subjectId()??0;if(!i||i===0){let o=this.authService.getCurrentUserCustomerId();isSome(o)&&(i=+o.value.toString().split(`,`)[0])}let s=this.getLoggedInUser(),r=mkSome(i);return(!i||i===0&&s.hasAnyAdminRole()||i===-1)&&(r=mkNone()),r}initializeSession(t){let i=this.getLoggedInUser(),s=this.subjectId()??0;if(t&&s>0&&(i.hasAnyAdminRole()||i.subjectIds.includes(s))){this.setSubjekt(s);return}let r=Number(i.defaultSubjectId??``);if(Number.isInteger(r)&&r>0&&(i.hasAnyAdminRole()||i.subjectIds.includes(r))){this.setSubjekt(r);return}if(i.hasAnyAdminRole()){let a=this.tenantNameService.tryFetchLastSubjectPerTenant();this.lastSubject.set(isSome(a)?a.value:null),isSome(a)&&a.value>0?this.setSubjekt(a.value):this.clearSubjekt();return}let o=i.subjectIds[0]??0;this.setSubjekt(o)}setSubjekt(t){let i=this.subjectId();this.oldSubjektId=i,isDefined(t)&&t>0?(this.subjectId.set(t),this.selectedSubjektState.set({variant:nt.Specific,subjektId:t}),this.subjektIdChanged.next(t)):t==null?(this.subjectId.set(null),this.selectedSubjektState.set({variant:nt.None}),this.subjektCleared.next()):this.clearSubjekt()}clearSubjekt(){this.oldSubjektId=this.subjectId(),this.subjectId.set(null),this.selectedSubjektState.set({variant:nt.Unset}),this.subjektCleared.next()}getCiid(){return this.authService.getCiid()}getLoggedInUser(){let t=new xn;t.subjektId=this.authService.getCurrentUserCustomerId(),t.hasServiceDeskRole=!1;let i=this.authService.getCurrentUserCustomerIds(),s=Array.isArray(i)&&i.length>1;t.hasEvulutionAdmin=this.hasRole(Y.EvulutionAdmin),t.hasServiceDeskRole=this.hasRole(Y.ServiceDesk),t.hasRestrictedServiceDeskAccess=this.hasRole(Y.UserPrivacyAcceptedAdmin),t.hasUserAdminRole=this.hasRole(Y.UserAdmin),t.hasUserGroupAdminRole=this.hasRole(Y.UserGroupAdmin),t.hasNotificationAdminRole=this.hasRole(Y.NotificationAdmin),t.hasTranslationAdmin=this.hasRole(Y.TranslationAdmin),t.hasQuizAdminRole=this.hasRole(Y.QuizAdmin),t.hasMeterDataAdminRole=this.hasRole(Y.MeterDataAdmin),t.hasLogAdminRole=this.hasRole(Y.LogAdmin),t.hasCu
3stomerDeleteAdminRole=this.hasRole(Y.CustomerDeleteAdmin),t.hasThemeAdminRole=this.hasRole(Y.ThemeAdmin),t.hasMultipleSubjectIds=s,t.subjectIds=i,t.hasCiid=!!this.getCiid();let r=this.authService.getToken()??``;return t.defaultSubjectId=this.tokenHelperService.getDefaultSubjectId(r),t}hasRole(t){let i=this.authService.getCurrentUserRoles(),s=Array.isArray(i),r=!1;return s?i.forEach(o=>{o.toLowerCase()===t.toLowerCase()&&(r=!0)}):r=i!==void 0&&i.toLowerCase()===t.toLowerCase(),r}checkLoadingState(t){let i={subjektId:t};this.customerService.getCustomer(i).subscribe(s=>G(this,null,function*(){s&&s.importCustomerQueue?.status!==CH.Pending?(this.subjectId.set(null),this.lastModifiedDate.next(new Date(s.importCustomerQueue?.modifiedDate??``)),this.isUpdating.set(!1),yield this.delay(1e3),this.setSubjekt(t)):(yield this.delay(5e3),this.checkLoadingState(t))}))}refreshData(t,i){this.lastModifiedDate.next(new Date);let s={subjektId:t,userId:i};this.customerImportService.refreshCustomerData(s).subscribe(r=>G(this,null,function*(){this.lastModifiedDate.next(new Date(r.modifiedDate??``)),this.isUpdating.set(r.status===CH.Pending),r&&r.status!==CH.Pending?(this.subjectId.set(null),yield this.delay(1e3),this.setSubjekt(t)):(yield this.delay(4e3),this.checkLoadingState(t))}))}delay(t){return new Promise(i=>{setTimeout(()=>{i(null)},t)})}getAvailableSubjektIds(){let t=this.getLoggedInUser(),i=this.tryGetSubjektId(),s$5=r=>{let o=r.filter(h=>h.id!==null&&h.id!==void 0).map(h=>({id:h.id?.toString()??null,name:h.fullname??null,path:``})),a=r.filter(h=>h.id!==null&&h.id!==void 0).map(h=>h.tenantId??this.tenantNameService.tenant()),c;return isSome(i)&&(c=o.find(h=>h.id&&h.id===i.value.toString())),{tenants:a,customers:o,selectedCustomer:c?[c]:[]}};return t.hasMultipleSubjectIds?this.customerService.getRelatedCustomers().pipe(s(r=>s$5(r))):t.hasServiceDeskRole?this.customerService.getAllCustomers().pipe(this.authService.requireAuthentication(),s(r=>s$5(r))):Ie({tenants:[],customers:[],selectedCustomer:[]})}usePreviousSubject(){let t=this.lastSubject();if(isDefined(t)&&t>0)this.customerService.getCustomer({subjektId:t},V8e(()=>z2.silent())).subscribe(i=>{isUndefined(i)||(this.setSubjekt(t),this.router.navigate([``]))});else{let i=this.tenantNameService.tenant();this.getAvailableSubjektIds().pipe(hi(1)).subscribe(({tenants:s,customers:r})=>{let o=s.findIndex(a=>a===i);if(o>=0&&r[o]?.id){let a=parseInt(r[o].id,10);this.setSubjekt(a),this.router.navigate([``])}else if(r.length>0&&r[0].id){let a=parseInt(r[0].id,10);this.setSubjekt(a),this.router.navigate([``])}else this.router.navigate([`admin/dashboard`])})}}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac})}}return e})();var xn=class{constructor(){this.subjektId=mkNone(),this.hasServiceDeskRole=!1,this.hasRestrictedServiceDeskAccess=!1,this.hasUserAdminRole=!1,this.hasUserGroupAdminRole=!1,this.hasNotificationAdminRole=!1,this.hasTranslationAdmin=!1,this.hasQuizAdminRole=!1,this.hasMeterDataAdminRole=!1,this.hasLogAdminRole=!1,this.hasCustomerDeleteAdminRole=!1,this.hasThemeAdminRole=!1,this.hasEvulutionAdmin=!1,this.hasMultipleSubjectIds=!1,this.subjectIds=[],this.hasCiid=!1}hasAnyAdminRole(){return this.hasEvulutionAdmin||this.hasServiceDeskRole||this.hasUserAdminRole||this.hasTranslationAdmin||this.hasQuizAdminRole||this.hasNotificationAdminRole||this.hasMeterDataAdminRole||this.hasLogAdminRole||this.hasCustomerDeleteAdminRole||this.hasUserGroupAdminRole||this.hasThemeAdminRole}};var Oi=(()=>{class e{constructor(){this.userSelectionService=_$1(ke),this.energyboardConfigService=_$1(ZH),this.storageService=_$1($g),this.objektDevicesChanged=new We$1,this.objektIdsChanged=new We$1,this.displayDeviceSelector=new We$1,this.storageKeyObjects=`userObjects`,this.storageKeySelectedObjects=`selectedUserObjects`,this.storageKeySelectedDevices=`selectedUserDevices`,this.sessionStorage=sessionStorage,this.storageObjects=this.storageService.sessionSignal(this.storageKeyObjects,[]),this.selectedObjects=this.storageService.sessionSignal(this.storageKeySelectedObjects,[]),this.selectedDevices=this.storageService.sessionSignal(this.storageKeySelectedDevices,[]),this.deepCompareObjects=(t,i)=>t.objectId===i.objectId&&t.subjectId===i.subjectId&&t.ownerSubjectId===i.ownerSubjectId&&t.caretakerSubjectId===i.caretakerSubjectId&&t.sourceTenantId===i.sourceTenantId,this.getObjects=H(()=>{let t=this.storageObjects();return isUndefined(t)?[]:t}),this.getActiveObjectsInternal=()=>{let t=this.storageObjects();return isUndefined(t)?[]:t.filter(this.isActive)},this.isActive=t=>t.isActive===!0,this.getRuleFilter=t=>match(t).pipe(mWhen(X.All,()=>()=>!0),mWhen(X.AllActive,()=>i=>this.isActive(i)),mWhen(X.ActiveCaretaker,()=>(i,s)=>this.isActive(i)&&i.caretakerSubjectId===s),mWhen(X.ActiveOwner,()=>(i,s)=>this.isActive(i)&&i.ownerSubjectId===s),mWhen(X.ActiveTenant,()=>(i,s)=>this.isActive(i)&&i.subjectId===s),mWhen(X.AllPast,()=>i=>!this.isActive(i)),mWhen(X.PastCaretaker,()=>(i,s)=>!this.isActive(i)&&i.caretakerSubjectId===s),mWhen(X.PastOwner,()=>(i,s)=>!this.isActive(i)&&i.ownerSubjectId===s),mWhen(X.PastTenant,()=>(i,s)=>!this.isActive(i)&&i.subjectId===s),mExhaustive),this.filterByRules=(t,i,s)=>t.length===0?!0:t.some(r=>this.getRuleFilter(r)(i,s)),this.getByRulesInternal=t=>{let i=this.userSelectionService.tryGetSubjektId();if(isUndefined(i))return[];let s=this.storageObjects();return isUndefined(s)?[]:s.filter(r=>this.filterByRules(t,r,i.value))},this.getByRules=H(()=>t=>this.getByRulesInternal(t)),this.getActiveTenantObjects=H(()=>this.getByRulesInternal([X.ActiveTenant])),this.getActiveCaretakerObjects=H(()=>this.getByRulesInternal([X.ActiveCaretaker])),this.getActiveOwnerObjects=H(()=>this.getByRulesInternal([X.ActiveOwner])),this.getActiveObjects=H(this.getActiveObjectsInternal),this.get
3SelectedObjects=H(()=>{let t=this.selectedObjects();return isUndefined(t)?[]:t}),this.getSelectedObject=H(()=>{let t=this.selectedObjects();return isUndefined(t)||t.length===0?null:t[0]}),this.getSelectedObjectIdsSubjectIds=H(()=>{let t=this.selectedObjects();if(isUndefined(t))return[[],[]];let i=this.userSelectionService.tryGetSubjektId(),s=[],r=[];return t?.forEach(o=>{isDefined(o.subjectId)&&o.objectId&&isSome(i)&&(i.value===o.caretakerSubjectId||i.value===o.ownerSubjectId||i.value===o.subjectId)&&(s.push(o.objectId),r.push(o.subjectId))}),[s,r]}),this.getSelectedDevices=H(()=>{let t=this.selectedDevices();return isUndefined(t)?[]:t})}saveObjects(t){this.storageObjects.set(t);let i=this.userSelectionService.tryGetSubjektId();if(isNone(i))return;let s=i.value,r=this.getSelectedObjects();if(r.length>0){let c=r.filter(h=>t.some(f=>this.deepCompareObjects(h,f)));if(c.length>0){this.setSelectedObjects(c);return}}let o=[],a=t.find(c=>c.isActive&&c.subjectId===s);a||(a=t.find(c=>c.isActive&&c.caretakerSubjectId===s)),a||(a=t.find(c=>!c.isActive&&c.subjectId===s)),a&&o.push(a),this.setSelectedObjects(o)}getObjectNameOnly(t){return this.getObjectName(t,!1)}checkTooMany(t){let i=this.getSelectedObjects();if(t.length>0){let s=t[0].chartGroup;i=i.filter(r=>r.devices.some(o=>o.measurementPoints?.some(a=>a.meteringCode?.startsWith(`CH${s}`))))}return i?.length>10}setSelectedObjects(t){let i=t.filter(o=>isDefined(o)),r=this.selectedObjects()?.filter(o=>o!==void 0).map(o=>o.objectId).filter(o=>o!==void 0).sort((o,a)=>o-a)??[];if(i.length>0){this.selectedObjects.set(i);let o=[];i.forEach(m=>{m.devices?.forEach(p=>{p.measurementPoints?.forEach(v=>{v.meteringCode&&o.push(v.meteringCode)})})});let a=Array.from(new Set(o));this.setSelectedDevices(a);let c=i.map(m=>m.objectId).filter(m=>m!==void 0),h=[...c].sort((m,p)=>m-p);(r.length!==h.length||r.some((m,p)=>m!==h[p]))&&this.objektIdsChanged.emit(c)}else this.selectedObjects.set([]),this.setSelectedDevices([]),r.length>0&&this.objektIdsChanged.emit([])}setSelectedDevices(t){t.length>0?(this.selectedDevices.set(t),this.objektDevicesChanged.emit(t)):(this.selectedDevices.set([]),this.objektDevicesChanged.emit([]))}setDisplayDeviceSelector(t){this.displayDeviceSelector.emit(t)}getObjectName(t,i){let s=`${t.objectId}${i?` (${t.subjectId})`:``} - ${t.objectName}, ${t.street}, ${t.city}`;return this.energyboardConfigService.config().displayObjectnameOnly&&(s=`${t.objectId}${i?` (${t.subjectId})`:``} - ${t.objectName}`),s}getDeviceName(t,i){let s=i,r=t.devices?.filter(o=>o.measurementPoints?.some(a=>a.meteringCode===i))??[];return r.length>0&&r[0].measurementDescription&&(s=`${i.substring(0,3)}...${i.substring(i.length-5)} - ${r[0].measurementDescription}`),`${t.objectId} - ${s}`}selectFirstActiveObject(){let t=this.getActiveObjects();if(t.length>0){this.setSelectedObjects([t[0]]);return}this.setSelectedObjects([])}static{this.ɵfac=function(i){return new(i||e)}}static{this.ɵprov=k({token:e,factory:e.ɵfac})}}return e})();export{Ua as $,nl as $t,Kr as A,ya as An,fr as At,Oi as B,io as Bt,Hs as C,vc as Cn,di as Ct,Je as D,xc as Dn,ec as Dt,Jc as E,xa as En,dt as Et,Ma as F,zt as Fn,gt as Ft,Qr as G,la as Gt,Pe as H,ja as Ht,Me as I,ha as It,Rt as J,ma as Jt,Qs as K,lc as Kt,Na as L,he as Lt,Ku as M,ys as Mn,gc as Mt,La as N,zc as Nn,ge as Nt,Jr as O,xi as On,fa as Ot,Lt as P,zr as Pn,gi as Pt,Ts as Q,nc as Qt,Oa as R,hn as Rt,Hr as S,va as Sn,de as St,Ja as T,wi as Tn,dr as Tt,Q as U,ka as Ut,Pa as V,j as Vt,Qa as W,ke as Wt,Ta as X,mi as Xt,Ss as Y,mc as Yt,Te as Z,mn as Zt,Ge as _,tr as _n,_t,Ai as a,pr as an,Wc as at,Gs as b,uc as bn,ca as bt,Ca as c,qr as cn,Xr as ct,Ea as d,rr as dn,Ye as dt,nr as en,Uc as et,Et as f,sc as fn,Yr as ft,Ga as g,to as gn,_a as gt,Ft as h,tc as hn,_ as ht,Aa as i,pi as in,Wa as it,Ks as j,ye as jn,ga as jt,Kc as k,xn as kn,fn as kt,Da as l,rc as ln,Xs as lt,Fc as m,sr as mn,Zr as mt,$c as n,pa as nn,Ut as nt,An as o,qa as on,X as ot,Fa as p,se as pn,Zc as pt,Ra as q,ln as qt,$r as r,pc as rn,V as rt,Bc as s,qc as sn,Xa as st,$a as t,on as tn,Us as tt,Dn as u,re as un,Y as ut,Gi as v,tt as vn,ba as vt,Ia as w,wa as wn,dn as wt,Hc as x,un as xn,cn as xt,Gr as y,ua as yn,bc as yt,Oc as z,ic as zt};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.