Home-AssistantConfig/config/www/community/frigate-hass-card/timeline-6aa9e747.js

183 lines
626 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import{dt as t,du as e,d8 as n,dv as o,dw as s,ca as r,dx as a,bl as l,bn as h,s as d,dn as c,y as u,bk as p,cP as m,cS as f,d1 as g,bj as v,cO as y,bm as b,dy as w,c2 as _,l as x,cp as k,cq as D,b$ as C,dz as S,cU as T,dA as E,d5 as M,cc as O,cd as I,dB as A,d7 as P,d4 as N,c5 as F,bQ as R,cn as L,c0 as j,dC as Y,cM as H}from"./card-555679fd.js";import{s as z}from"./index-52dee8bb.js";import{c as B}from"./_commonjsHelpers-1789f0cf.js";var W={exports:{}};!function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}W.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((i=n[o])===e||i.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){n=0;for(var o=(i=i.slice(0)).length;n<o;++n)i[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}();var G=W.exports;
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */function V(){return V=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},V.apply(this,arguments)}function U(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function $(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var q,X="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign,K=["","webkit","Moz","MS","ms","o"],Z="undefined"==typeof document?{style:{}}:document.createElement("div"),Q="function",J=Math.round,tt=Math.abs,et=Date.now;function it(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<K.length;){if((n=(i=K[s])?i+o:e)in t)return n;s++}}q="undefined"==typeof window?{}:window;var nt=it(Z.style,"touchAction"),ot=void 0!==nt;var st="compute",rt="auto",at="manipulation",lt="none",ht="pan-x",dt="pan-y",ct=function(){if(!ot)return!1;var t={},e=q.CSS&&q.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){return t[i]=!e||q.CSS.supports("touch-action",i)})),t}(),ut="ontouchstart"in q,pt=void 0!==it(q,"PointerEvent"),mt=ut&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),ft="touch",gt="mouse",vt=25,yt=1,bt=2,wt=4,_t=8,xt=1,kt=2,Dt=4,Ct=8,St=16,Tt=kt|Dt,Et=Ct|St,Mt=Tt|Et,Ot=["x","y"],It=["clientX","clientY"];function At(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function Pt(t,e){return typeof t===Q?t.apply(e&&e[0]||void 0,e):t}function Nt(t,e){return t.indexOf(e)>-1}var Ft=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===st&&(t=this.compute()),ot&&this.manager.element.style&&ct[t]&&(this.manager.element.style[nt]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return At(this.manager.recognizers,(function(e){Pt(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(Nt(t,lt))return lt;var e=Nt(t,ht),i=Nt(t,dt);return e&&i?lt:e||i?e?ht:dt:Nt(t,at)?at:rt}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=Nt(n,lt)&&!ct[lt],s=Nt(n,dt)&&!ct[dt],r=Nt(n,ht)&&!ct[ht];if(o){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!r||!s)return o||s&&i&Tt||r&&i&Et?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function Rt(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function Lt(t){var e=t.length;if(1===e)return{x:J(t[0].clientX),y:J(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:J(i/e),y:J(n/e)}}function jt(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:J(t.pointers[i].clientX),clientY:J(t.pointers[i].clientY)},i++;return{timeStamp:et(),pointers:e,center:Lt(e),deltaX:t.deltaX,deltaY:t.deltaY}}function Yt(t,e,i){i||(i=Ot);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function Ht(t,e,i){i||(i=Ot);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function zt(t,e){return t===e?xt:tt(t)>=tt(e)?t<0?kt:Dt:e<0?Ct:St}function Bt(t,e,i){return{x:e/t||0,y:i/t||0}}function Wt(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=jt(e)),o>1&&!i.firstMultiple?i.firstMultiple=jt(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=Lt(n);e.timeStamp=et(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=Ht(a,l),e.distance=Yt(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};e.eventType!==yt&&s.eventType!==wt||(o=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=zt(e.deltaX,e.deltaY);var h,d,c=Bt(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=tt(c.x)>tt(c.y)?c.x:c.y,e.scale=r?(h=r.pointers,Yt((d=n)[0],d[1],It)/Yt(h[0],h[1],It)):1,e.rotation=r?function(t,e){return Ht(e[1],e[0],It)+Ht(t[1],t[0],It)}(r.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,r=t.lastInterval||e,a=e.timeStamp-r.timeStamp;if(e.eventType!==_t&&(a>vt||void 0===r.velocity)){var l=e.deltaX-r.deltaX,h=e.deltaY-r.deltaY,d=Bt(a,l,h);n=d.x,o=d.y,i=tt(d.x)>tt(d.y)?d.x:d.y,s=zt(l,h),t.lastInterval=e}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var u,p=t.element,m=e.srcEvent;Rt(u=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=u),e.target=p}function Gt(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=e&yt&&n-o==0,r=e&(wt|_t)&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,Wt(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function Vt(t){return t.trim().split(/\s+/g)}function Ut(t,e,i){At(Vt(e),(function(e){t.addEventListener(e,i,!1)}))}function $t(t,e,i){At(Vt(e),(function(e){t.removeEventListener(e,i,!1)}))}function qt(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var Xt=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){Pt(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&Ut(this.element,this.evEl,this.domHandler),this.evTarget&&Ut(this.target,this.evTarget,this.domHandler),this.evWin&&Ut(qt(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&$t(this.element,this.evEl,this.domHandler),this.evTarget&&$t(this.target,this.evTarget,this.domHandler),this.evWin&&$t(qt(this.element),this.evWin,this.domHandler)},t}();function Kt(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}var Zt={pointerdown:yt,pointermove:bt,pointerup:wt,pointercancel:_t,pointerout:_t},Qt={2:ft,3:"pen",4:gt,5:"kinect"},Jt="pointerdown",te="pointermove pointerup pointercancel";q.MSPointerEvent&&!q.PointerEvent&&(Jt="MSPointerDown",te="MSPointerMove MSPointerUp MSPointerCancel");var ee=function(t){function e(){var i,n=e.prototype;return n.evEl=Jt,n.evWin=te,(i=t.apply(this,arguments)||this).store=i.manager.session.pointerEvents=[],i}return U(e,t),e.prototype.handler=function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),o=Zt[n],s=Qt[t.pointerType]||t.pointerType,r=s===ft,a=Kt(e,t.pointerId,"pointerId");o&yt&&(0===t.button||r)?a<0&&(e.push(t),a=e.length-1):o&(wt|_t)&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))},e}(Xt);function ie(t){return Array.prototype.slice.call(t,0)}function ne(t,e,i){for(var n=[],o=[],s=0;s<t.length;){var r=e?t[s][e]:t[s];Kt(o,r)<0&&n.push(t[s]),o[s]=r,s++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}var oe={touchstart:yt,touchmove:bt,touchend:wt,touchcancel:_t},se="touchstart touchmove touchend touchcancel",re=function(t){function e(){var i;return e.prototype.evTarget=se,(i=t.apply(this,arguments)||this).targetIds={},i}return U(e,t),e.prototype.handler=function(t){var e=oe[t.type],i=ae.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:ft,srcEvent:t})},e}(Xt);function ae(t,e){var i,n,o=ie(t.touches),s=this.targetIds;if(e&(yt|bt)&&1===o.length)return s[o[0].identifier]=!0,[o,o];var r=ie(t.changedTouches),a=[],l=this.target;if(n=o.filter((function(t){return Rt(t.target,l)})),e===yt)for(i=0;i<n.length;)s[n[i].identifier]=!0,i++;for(i=0;i<r.length;)s[r[i].identifier]&&a.push(r[i]),e&(wt|_t)&&delete s[r[i].identifier],i++;return a.length?[ne(n.concat(a),"identifier",!0),a]:void 0}var le={mousedown:yt,mousemove:bt,mouseup:wt},he="mousedown",de="mousemove mouseup",ce=function(t){function e(){var i,n=e.prototype;return n.evEl=he,n.evWin=de,(i=t.apply(this,arguments)||this).pressed=!1,i}return U(e,t),e.prototype.handler=function(t){var e=le[t.type];e&yt&&0===t.button&&(this.pressed=!0),e&bt&&1!==t.which&&(e=wt),this.pressed&&(e&wt&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:gt,srcEvent:t}))},e}(Xt),ue=2500,pe=25;function me(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY},n=this.lastTouches;this.lastTouches.push(i);setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),ue)}}function fe(t,e){t&yt?(this.primaryTouch=e.changedPointers[0].identifier,me.call(this,e)):t&(wt|_t)&&me.call(this,e)}function ge(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],s=Math.abs(e-o.x),r=Math.abs(i-o.y);if(s<=pe&&r<=pe)return!0}return!1}var ve=function(){return function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).handler=function(t,e,i){var o=i.pointerType===ft,s=i.pointerType===gt;if(!(s&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)fe.call($($(n)),e,i);else if(s&&ge.call($($(n)),i))return;n.callback(t,e,i)}},n.touch=new re(n.manager,n.handler),n.mouse=new ce(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}return U(e,t),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(Xt)}();function ye(t,e,i){return!!Array.isArray(t)&&(At(t,i[e],i),!0)}var be=1,we=2,_e=4,xe=8,ke=xe,De=16,Ce=32,Se=1;function Te(t,e){var i=e.manager;return i?i.get(t):t}function Ee(t){return t&De?"cancel":t&xe?"end":t&_e?"move":t&we?"start":""}var Me=function(){function t(t){void 0===t&&(t={}),this.options=V({enable:!0},t),this.id=Se++,this.manager=null,this.state=be,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return X(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(ye(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Te(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return ye(t,"dropRecognizeWith",this)||(t=Te(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(ye(t,"requireFailure",this))return this;var e=this.requireFail;return-1===Kt(e,t=Te(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(ye(t,"dropRequireFailure",this))return this;t=Te(t,this);var e=Kt(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<xe&&n(e.options.event+Ee(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=xe&&n(e.options.event+Ee(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=Ce},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(this.requireFail[t].state&(Ce|be)))return!1;t++}return!0},e.recognize=function(t){var e=X({},t);if(!Pt(this.options.enable,[this,e]))return this.reset(),void(this.state=Ce);this.state&(ke|De|Ce)&&(this.state=be),this.state=this.process(e),this.state&(we|_e|xe|De)&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),Oe=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,V({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e))||this).pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[at]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,s=t.deltaTime<i.time;if(this.reset(),t.eventType&yt&&0===this.count)return this.failTimeout();if(o&&s&&n){if(t.eventType!==wt)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<i.interval,a=!this.pCenter||Yt(this.pCenter,t.center)<i.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&r?this.count+=1:this.count=1,this._input=t,0===this.count%i.taps)return this.hasRequireFailures()?(this._timer=setTimeout((function(){e.state=ke,e.tryEmit()}),i.interval),we):ke}return Ce},i.failTimeout=function(){var t=this;return this._timer=setTimeout((function(){t.state=Ce}),this.options.interval),Ce},i.reset=function(){clearTimeout(this._timer)},i.emit=function(){this.state===ke&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Me),Ie=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({pointers:1},e))||this}U(e,t);var i=e.prototype;return i.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},i.process=function(t){var e=this.state,i=t.eventType,n=e&(we|_e),o=this.attrTest(t);return n&&(i&_t||!o)?e|De:n||o?i&wt?e|xe:e&we?e|_e:we:Ce},e}(Me);function Ae(t){return t===St?"down":t===Ct?"up":t===kt?"left":t===Dt?"right":""}var Pe=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,V({event:"pan",threshold:10,pointers:1,direction:Mt},e))||this).pX=null,i.pY=null,i}U(e,t);var i=e.prototype;return i.getTouchAction=function(){var t=this.options.direction,e=[];return t&Tt&&e.push(dt),t&Et&&e.push(ht),e},i.directionTest=function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,s=t.deltaX,r=t.deltaY;return o&e.direction||(e.direction&Tt?(o=0===s?xt:s<0?kt:Dt,i=s!==this.pX,n=Math.abs(t.deltaX)):(o=0===r?xt:r<0?Ct:St,i=r!==this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},i.attrTest=function(t){return Ie.prototype.attrTest.call(this,t)&&(this.state&we||!(this.state&we)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=Ae(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(Ie),Ne=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({event:"swipe",threshold:10,velocity:.3,direction:Tt|Et,pointers:1},e))||this}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return Pe.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return n&(Tt|Et)?i=e.overallVelocity:n&Tt?i=e.overallVelocityX:n&Et&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&tt(i)>this.options.velocity&&e.eventType&wt},i.emit=function(t){var e=Ae(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(Ie),Fe=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({event:"pinch",threshold:0,pointers:2},e))||this}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[lt]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||this.state&we)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(Ie),Re=function(t){function e(e){return void 0===e&&(e={}),t.call(this,V({event:"rotate",threshold:0,pointers:2},e))||this}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[lt]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||this.state&we)},e}(Ie),Le=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,V({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}U(e,t);var i=e.prototype;return i.getTouchAction=function(){return[rt]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,s=t.deltaTime>i.time;if(this._input=t,!o||!n||t.eventType&(wt|_t)&&!s)this.reset();else if(t.eventType&yt)this.reset(),this._timer=setTimeout((function(){e.state=ke,e.tryEmit()}),i.time);else if(t.eventType&wt)return ke;return Ce},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){this.state===ke&&(t&&t.eventType&wt?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=et(),this.manager.emit(this.options.event,this._input)))},e}(Me),je={domEvents:!1,touchAction:st,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},Ye=[[Re,{enable:!1}],[Fe,{enable:!1},["rotate"]],[Ne,{direction:Tt}],[Pe,{direction:Tt},["swipe"]],[Oe],[Oe,{event:"doubletap",taps:2},["tap"]],[Le]];function He(t,e){var i,n=t.element;n.style&&(At(t.options.cssProps,(function(o,s){i=it(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var ze=function(){function t(t,e){var i,n=this;this.options=X({},je,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(pt?ee:mt?re:ut?ve:ce))(i,Gt),this.touchAction=new Ft(this,this.options.touchAction),He(this,!0),At(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return X(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&o.state&ke)&&(e.curRecognizer=null,o=null);for(var s=0;s<n.length;)i=n[s],2===e.stopped||o&&i!==o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&i.state&(we|_e|xe)&&(e.curRecognizer=i,o=i),s++}},e.get=function(t){if(t instanceof Me)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event===t)return e[i];return null},e.add=function(t){if(ye(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(ye(t,"remove",this))return this;var e=this.get(t);if(t){var i=this.recognizers,n=Kt(i,e);-1!==n&&(i.splice(n,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var i=this.handlers;return At(Vt(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this},e.off=function(t,e){if(void 0===t)return this;var i=this.handlers;return At(Vt(t),(function(t){e?i[t]&&i[t].splice(Kt(i[t],e),1):delete i[t]})),this},e.emit=function(t,e){this.options.domEvents&&function(t,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},e.destroy=function(){this.element&&He(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),Be={touchstart:yt,touchmove:bt,touchend:wt,touchcancel:_t},We="touchstart",Ge="touchstart touchmove touchend touchcancel",Ve=function(t){function e(){var i,n=e.prototype;return n.evTarget=We,n.evWin=Ge,(i=t.apply(this,arguments)||this).started=!1,i}return U(e,t),e.prototype.handler=function(t){var e=Be[t.type];if(e===yt&&(this.started=!0),this.started){var i=Ue.call(this,t,e);e&(wt|_t)&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:ft,srcEvent:t})}},e}(Xt);function Ue(t,e){var i=ie(t.touches),n=ie(t.changedTouches);return e&(wt|_t)&&(i=ne(i.concat(n),"identifier",!0)),[i,n]}function $e(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var qe=$e((function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&void 0===t[n[o]])&&(t[n[o]]=e[n[o]]),o++;return t}),"extend","Use `assign`."),Xe=$e((function(t,e){return qe(t,e,!0)}),"merge","Use `assign`.");function Ke(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&X(n,i)}function Ze(t,e){return function(){return t.apply(e,arguments)}}var Qe=function(){var t=function(t,e){return void 0===e&&(e={}),new ze(t,V({recognizers:Ye.concat()},e))};return t.VERSION="2.0.17-rc",t.DIRECTION_ALL=Mt,t.DIRECTION_DOWN=St,t.DIRECTION_LEFT=kt,t.DIRECTION_RIGHT=Dt,t.DIRECTION_UP=Ct,t.DIRECTION_HORIZONTAL=Tt,t.DIRECTION_VERTICAL=Et,t.DIRECTION_NONE=xt,t.DIRECTION_DOWN=St,t.INPUT_START=yt,t.INPUT_MOVE=bt,t.INPUT_END=wt,t.INPUT_CANCEL=_t,t.STATE_POSSIBLE=be,t.STATE_BEGAN=we,t.STATE_CHANGED=_e,t.STATE_ENDED=xe,t.STATE_RECOGNIZED=ke,t.STATE_CANCELLED=De,t.STATE_FAILED=Ce,t.Manager=ze,t.Input=Xt,t.TouchAction=Ft,t.TouchInput=re,t.MouseInput=ce,t.PointerEventInput=ee,t.TouchMouseInput=ve,t.SingleTouchInput=Ve,t.Recognizer=Me,t.AttrRecognizer=Ie,t.Tap=Oe,t.Pan=Pe,t.Swipe=Ne,t.Pinch=Fe,t.Rotate=Re,t.Press=Le,t.on=Ut,t.off=$t,t.each=At,t.merge=Xe,t.extend=qe,t.bindFn=Ze,t.assign=X,t.inherit=Ke,t.bindFn=Ze,t.prefixed=it,t.toArray=ie,t.inArray=Kt,t.uniqueArray=ne,t.splitStr=Vt,t.boolOrFn=Pt,t.hasParent=Rt,t.addEventListeners=Ut,t.removeEventListeners=$t,t.defaults=X({},je,{preset:Ye}),t}();Qe.defaults;
/**
* vis-util
* https://github.com/visjs/vis-util
*
* utilitie collection for visjs
*
* @version 5.0.3
* @date 2022-03-04T18:53:16.725Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
const Je=Symbol("DELETE");function ti(t,...e){return ei({},t,...e)}function ei(...t){const e=ii(...t);return oi(e),e}function ii(...t){if(t.length<2)return t[0];if(t.length>2)return ii(ei(t[0],t[1]),...t.slice(2));const e=t[0],i=t[1];for(const t of Reflect.ownKeys(i))Object.prototype.propertyIsEnumerable.call(i,t)&&(i[t]===Je?delete e[t]:null===e[t]||null===i[t]||"object"!=typeof e[t]||"object"!=typeof i[t]||Array.isArray(e[t])||Array.isArray(i[t])?e[t]=ni(i[t]):e[t]=ii(e[t],i[t]));return e}function ni(t){return Array.isArray(t)?t.map((t=>ni(t))):"object"==typeof t&&null!==t?ii({},t):t}function oi(t){for(const e of Object.keys(t))t[e]===Je?delete t[e]:"object"==typeof t[e]&&null!==t[e]&&oi(t[e])}const si="undefined"!=typeof window?window.Hammer||Qe:function(){return function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:()=>({set:t})}}()};function ri(t){this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((()=>{this._dom.overlay.parentNode.removeChild(this._dom.overlay)}));const e=si(this._dom.overlay);e.on("tap",this._onTapOverlay.bind(this)),this._cleanupQueue.push((()=>{e.destroy()}));["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{e.on(t,(t=>{t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=e=>{(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||this.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((()=>{document.body.removeEventListener("click",this._onClick)}))),this._escListener=t=>{("key"in t?"Escape"===t.key:27===t.keyCode)&&this.deactivate()}}G(ri.prototype),ri.current=null,ri.prototype.destroy=function(){this.deactivate();for(const t of this._cleanupQueue.splice(0).reverse())t()},ri.prototype.activate=function(){ri.current&&ri.current.deactivate(),ri.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},ri.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},ri.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};const ai=/^\/?Date\((-?\d+)/i,li=/^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,hi=/^#?([a-f\d])([a-f\d])([a-f\d])$/i,di=/^rgb\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *\)$/i,ci=/^rgba\( *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *(1?\d{1,2}|2[0-4]\d|25[0-5]) *, *([01]|0?\.\d+) *\)$/i;function ui(t){return t instanceof Number||"number"==typeof t}function pi(t){return t instanceof String||"string"==typeof t}function mi(t){return"object"==typeof t&&null!==t}function fi(t,e,i,n){let o=!1;!0===n&&(o=null===e[i]&&void 0!==t[i]),o?delete t[i]:t[i]=e[i]}const gi=Object.assign;function vi(t,e,i=!1,n=!1){for(const o in e)(Object.prototype.hasOwnProperty.call(e,o)||!0===i)&&("object"==typeof e[o]&&null!==e[o]&&Object.getPrototypeOf(e[o])===Object.prototype?void 0===t[o]?t[o]=vi({},e[o],i):"object"==typeof t[o]&&null!==t[o]&&Object.getPrototypeOf(t[o])===Object.prototype?vi(t[o],e[o],i):fi(t,e,o,n):Array.isArray(e[o])?t[o]=e[o].slice():fi(t,e,o,n));return t}function yi(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"Boolean":t instanceof Number?"Number":t instanceof String?"String":Array.isArray(t)?"Array":t instanceof Date?"Date":"Object":"number"===e?"Number":"boolean"===e?"Boolean":"string"===e?"String":void 0===e?"undefined":e}function bi(t,e){return[...t,e]}function wi(t){return t.slice()}const _i=Object.values;const xi={asBoolean:(t,e)=>("function"==typeof t&&(t=t()),null!=t?0!=t:e||null),asNumber:(t,e)=>("function"==typeof t&&(t=t()),null!=t?Number(t)||e||null:e||null),asString:(t,e)=>("function"==typeof t&&(t=t()),null!=t?String(t):e||null),asSize:(t,e)=>("function"==typeof t&&(t=t()),pi(t)?t:ui(t)?t+"px":e||null),asElement:(t,e)=>("function"==typeof t&&(t=t()),t||e||null)};function ki(t){let e;switch(t.length){case 3:case 4:return e=hi.exec(t),e?{r:parseInt(e[1]+e[1],16),g:parseInt(e[2]+e[2],16),b:parseInt(e[3]+e[3],16)}:null;case 6:case 7:return e=li.exec(t),e?{r:parseInt(e[1],16),g:parseInt(e[2],16),b:parseInt(e[3],16)}:null;default:return null}}function Di(t,e,i){return"#"+((1<<24)+(t<<16)+(e<<8)+i).toString(16).slice(1)}function Ci(t,e,i){t/=255,e/=255,i/=255;const n=Math.min(t,Math.min(e,i)),o=Math.max(t,Math.max(e,i));if(n===o)return{h:0,s:0,v:n};return{h:60*((t===n?3:i===n?1:5)-(t===n?e-i:i===n?t-e:i-t)/(o-n))/360,s:(o-n)/o,v:o}}const Si={split(t){const e={};return t.split(";").forEach((t=>{if(""!=t.trim()){const i=t.split(":"),n=i[0].trim(),o=i[1].trim();e[n]=o}})),e},join:t=>Object.keys(t).map((function(e){return e+": "+t[e]})).join("; ")};function Ti(t,e,i){let n,o,s;const r=Math.floor(6*t),a=6*t-r,l=i*(1-e),h=i*(1-a*e),d=i*(1-(1-a)*e);switch(r%6){case 0:n=i,o=d,s=l;break;case 1:n=h,o=i,s=l;break;case 2:n=l,o=i,s=d;break;case 3:n=l,o=h,s=i;break;case 4:n=d,o=l,s=i;break;case 5:n=i,o=l,s=h}return{r:Math.floor(255*n),g:Math.floor(255*o),b:Math.floor(255*s)}}function Ei(t,e,i){const n=Ti(t,e,i);return Di(n.r,n.g,n.b)}function Mi(t){const e=ki(t);if(!e)throw new TypeError(`'${t}' is not a valid color.`);return Ci(e.r,e.g,e.b)}function Oi(t){return/(^#[0-9A-F]{6}$)|(^#[0-9A-F]{3}$)/i.test(t)}function Ii(t){return di.test(t)}function Ai(t){return ci.test(t)}function Pi(t){if(null===t||"object"!=typeof t)return null;if(t instanceof Element)return t;const e=Object.create(t);for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&"object"==typeof t[i]&&(e[i]=Pi(t[i]));return e}const Ni={linear:t=>t,easeInQuad:t=>t*t,easeOutQuad:t=>t*(2-t),easeInOutQuad:t=>t<.5?2*t*t:(4-2*t)*t-1,easeInCubic:t=>t*t*t,easeOutCubic:t=>--t*t*t+1,easeInOutCubic:t=>t<.5?4*t*t*t:(t-1)*(2*t-2)*(2*t-2)+1,easeInQuart:t=>t*t*t*t,easeOutQuart:t=>1- --t*t*t*t,easeInOutQuart:t=>t<.5?8*t*t*t*t:1-8*--t*t*t*t,easeInQuint:t=>t*t*t*t*t,easeOutQuint:t=>1+--t*t*t*t*t,easeInOutQuint:t=>t<.5?16*t*t*t*t*t:1+16*--t*t*t*t*t};const Fi={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};class Ri{constructor(t=1){this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return Fi[t]}setColor(t,e=!0){if("none"===t)return;let i;const n=this._isColorString(t);if(void 0!==n&&(t=n),!0===pi(t)){if(!0===Ii(t)){const e=t.substr(4).substr(0,t.length-5).split(",");i={r:e[0],g:e[1],b:e[2],a:1}}else if(!0===Ai(t)){const e=t.substr(5).substr(0,t.length-6).split(",");i={r:e[0],g:e[1],b:e[2],a:e[3]}}else if(!0===Oi(t)){const e=ki(t);i={r:e.r,g:e.g,b:e.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){const e=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:e}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(t));this._setColor(i,e)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(t=!0){!0===t&&(this.previousColor=Object.assign({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t,e=!0){!0===e&&(this.initialColor=Object.assign({},t)),this.color=t;const i=Ci(t.r,t.g,t.b),n=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(n*i.h),r=this.centerCoordinates.y+o*Math.cos(n*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){const e=Ci(this.color.r,this.color.g,this.color.b);e.v=t/100;const i=Ti(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(t=this.color){const e=Ci(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){const t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{const t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerText="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);const t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerText="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerText="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerText="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerText="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerText="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerText="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerText="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerText="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new si(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),this.hammer.on("hammer.input",(t=>{t.isFirst&&this._moveSelector(t)})),this.hammer.on("tap",(t=>{this._moveSelector(t)})),this.hammer.on("panstart",(t=>{this._moveSelector(t)})),this.hammer.on("panmove",(t=>{this._moveSelector(t)})),this.hammer.on("panend",(t=>{this._moveSelector(t)}))}_generateHueCircle(){if(!1===this.generated){const t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);const e=this.colorPickerCanvas.clientWidth,i=this.colorPickerCanvas.clientHeight;let n,o,s,r;t.clearRect(0,0,e,i),this.centerCoordinates={x:.5*e,y:.5*i},this.r=.49*e;const a=2*Math.PI/360,l=1/360,h=1/this.r;let d;for(s=0;s<360;s++)for(r=0;r<this.r;r++)n=this.centerCoordinates.x+r*Math.sin(a*s),o=this.centerCoordinates.y+r*Math.cos(a*s),d=Ti(s*l,r*h,1),t.fillStyle="rgb("+d.r+","+d.g+","+d.b+")",t.fillRect(n-.5,o-.5,2,2);t.strokeStyle="rgba(0,0,0,1)",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),t.stroke(),this.hueCircle=t.getImageData(0,0,e,i)}this.generated=!0}_moveSelector(t){const e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,n=t.center.y-e.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,a=n-o,l=Math.atan2(r,a),h=.98*Math.min(Math.sqrt(r*r+a*a),s),d=Math.cos(l)*h+o,c=Math.sin(l)*h+s;this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=c-.5*this.colorPickerSelector.clientWidth+"px";let u=l/(2*Math.PI);u=u<0?u+1:u;const p=h/this.r,m=Ci(this.color.r,this.color.g,this.color.b);m.h=u,m.s=p;const f=Ti(m.h,m.s,m.v);f.a=this.color.a,this.color=f,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}function Li(...t){if(t.length<1)throw new TypeError("Invalid arguments.");if(1===t.length)return document.createTextNode(t[0]);{const e=document.createElement(t[0]);return e.appendChild(Li(...t.slice(1))),e}}let ji,Yi=!1;const Hi="background: #FFeeee; color: #dd0000";class zi{static validate(t,e,i){Yi=!1,ji=e;let n=e;return void 0!==i&&(n=e[i]),zi.parse(t,n,[]),Yi}static parse(t,e,i){for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&zi.check(n,t,e,i)}static check(t,e,i,n){if(void 0===i[t]&&void 0===i.__any__)return void zi.getSuggestion(t,i,n);let o=t,s=!0;void 0===i[t]&&void 0!==i.__any__&&(o="__any__",s="object"===zi.getType(e[t]));let r=i[o];s&&void 0!==r.__type__&&(r=r.__type__),zi.checkFields(t,e,i,o,r,n)}static checkFields(t,e,i,n,o,s){const r=function(e){console.error("%c"+e+zi.printLocation(s,t),Hi)},a=zi.getType(e[t]),l=o[a];void 0!==l?"array"===zi.getType(l)&&-1===l.indexOf(e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+zi.print(l)+' not "'+e[t]+'". '),Yi=!0):"object"===a&&"__any__"!==n&&(s=bi(s,t),zi.parse(e[t],i[n],s)):void 0===o.any&&(r('Invalid type received for "'+t+'". Expected: '+zi.print(Object.keys(o))+". Received ["+a+'] "'+e[t]+'"'),Yi=!0)}static getType(t){const e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){const n=zi.findInOptions(t,e,i,!1),o=zi.findInOptions(t,ji,[],!0);let s;s=void 0!==n.indexMatch?" in "+zi.printLocation(n.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+n.indexMatch+'"?\n\n':o.distance<=4&&n.distance>o.distance?" in "+zi.printLocation(n.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+zi.printLocation(o.path,o.closestMatch,""):n.distance<=8?'. Did you mean "'+n.closestMatch+'"?'+zi.printLocation(n.path,t):". Did you mean one of these: "+zi.print(Object.keys(e))+zi.printLocation(i,t),console.error('%cUnknown option detected: "'+t+'"'+s,Hi),Yi=!0}static findInOptions(t,e,i,n=!1){let o=1e9,s="",r=[];const a=t.toLowerCase();let l;for(const h in e){let d;if(void 0!==e[h].__type__&&!0===n){const n=zi.findInOptions(t,e[h],bi(i,h));o>n.distance&&(s=n.closestMatch,r=n.path,o=n.distance,l=n.indexMatch)}else-1!==h.toLowerCase().indexOf(a)&&(l=h),d=zi.levenshteinDistance(t,h),o>d&&(s=h,r=wi(i),o=d)}return{closestMatch:s,path:r,distance:o,indexMatch:l}}static printLocation(t,e,i="Problem value found at: \n"){let n="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)n+=" ";n+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)n+=" ";n+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)n+=" ";n+="}\n"}return n+"\n\n"}static print(t){return JSON.stringify(t).replace(/(")|(\[)|(\])|(,"__type__")/g,"").replace(/(,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;const i=[];let n,o;for(n=0;n<=e.length;n++)i[n]=[n];for(o=0;o<=t.length;o++)i[0][o]=o;for(n=1;n<=e.length;n++)for(o=1;o<=t.length;o++)e.charAt(n-1)==t.charAt(o-1)?i[n][o]=i[n-1][o-1]:i[n][o]=Math.min(i[n-1][o-1]+1,Math.min(i[n][o-1]+1,i[n-1][o]+1));return i[e.length][t.length]}}const Bi=ri,Wi=Ri,Gi=class{constructor(t,e,i,n=1,o=(()=>!1)){this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.hideOption=o,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Object.assign(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new Ri(n),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(Array.isArray(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===this.options.filter&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];const t=this.options.filter;let e=0,i=!1;for(const n in this.configureOptions)Object.prototype.hasOwnProperty.call(this.configureOptions,n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(n,[]),i=i||this._handleObject(this.configureOptions[n],[n],!0)):!0!==t&&-1===t.indexOf(n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(let t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}_clean(){for(let t=0;t<this.domElements.length;t++)this.wrapper.removeChild(this.domElements[t]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(t){let e=this.moduleOptions;for(let i=0;i<t.length;i++){if(void 0===e[t[i]]){e=void 0;break}e=e[t[i]]}return e}_makeItem(t,...e){if(!0===this.allowCreation){const i=document.createElement("div");return i.className="vis-configuration vis-config-item vis-config-s"+t.length,e.forEach((t=>{i.appendChild(t)})),this.domElements.push(i),this.domElements.length}return 0}_makeHeader(t){const e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerText=t,this._makeItem([],e)}_makeLabel(t,e,i=!1){const n=document.createElement("div");if(n.className="vis-configuration vis-config-label vis-config-s"+e.length,!0===i){for(;n.firstChild;)n.removeChild(n.firstChild);n.appendChild(Li("i","b",t))}else n.innerText=t+":";return n}_makeDropdown(t,e,i){const n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==t.indexOf(e)&&(o=t.indexOf(e));for(let e=0;e<t.length;e++){const i=document.createElement("option");i.value=t[e],e===o&&(i.selected="selected"),i.innerText=t[e],n.appendChild(i)}const s=this;n.onchange=function(){s._update(this.value,i)};const r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}_makeRange(t,e,i){const n=t[0],o=t[1],s=t[2],r=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=o,a.max=s}catch(t){}a.step=r;let l="",h=0;if(void 0!==e){const t=1.2;e<0&&e*t<o?(a.min=Math.ceil(e*t),h=a.min,l="range increased"):e/t<o&&(a.min=Math.ceil(e/t),h=a.min,l="range increased"),e*t>s&&1!==s&&(a.max=Math.ceil(e*t),h=a.max,l="range increased"),a.value=e}else a.value=n;const d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=a.value;const c=this;a.onchange=function(){d.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){d.value=this.value};const u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,d);""!==l&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){const t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerText="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){const i=document.createElement("div");i.id="vis-configuration-popup",i.className="vis-configuration-popup",i.innerText=t,i.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){const t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((()=>{this._removePopup()}),1800)}}_makeCheckbox(t,e,i){const n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));const o=this;n.onchange=function(){o._update(this.checked,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeTextInput(t,e,i){const n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});const o=this;n.onchange=function(){o._update(this.value,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeColorField(t,e,i){const n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};const s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((t=>{const n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)})),this.colorPicker.setCloseCallback((()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}}))}_handleObject(t,e=[],i=!1){let n=!1;const o=this.options.filter;let s=!1;for(const r in t)if(Object.prototype.hasOwnProperty.call(t,r)){n=!0;const a=t[r],l=bi(e,r);if("function"==typeof o&&(n=o(r,e),!1===n&&!Array.isArray(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==n){s=!0;const t=this._getValue(l);if(Array.isArray(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){if(!this.hideOption(e,r,this.moduleOptions))if(void 0!==a.enabled){const t=bi(l,"enabled"),e=this._getValue(t);if(!0===e){const t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}else this._makeCheckbox(a,e,l)}else{const t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}}else console.error("dont know how to handle",a,r,l)}}return s}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){const i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e,i={}){let n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;i<e.length;i++)"global"!==e[i]&&(void 0===n[e[i]]&&(n[e[i]]={}),i!==e.length-1?n=n[e[i]]:n[e[i]]=t);return i}_printOptions(){const t=this.getOptions();for(;this.optionsContainer.firstChild;)this.optionsContainer.removeChild(this.optionsContainer.firstChild);this.optionsContainer.appendChild(Li("pre","const options = "+JSON.stringify(t,null,2)))}getOptions(){const t={};for(let e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}},Vi=si,Ui=class{constructor(t,e){this.container=t,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(t,e){this.x=parseInt(t),this.y=parseInt(e)}setText(t){if(t instanceof Element){for(;this.frame.firstChild;)this.frame.removeChild(this.frame.firstChild);this.frame.appendChild(t)}else this.frame.innerText=t}show(t){if(void 0===t&&(t=!0),!0===t){const t=this.frame.clientHeight,e=this.frame.clientWidth,i=this.frame.parentNode.clientHeight,n=this.frame.parentNode.clientWidth;let o=0,s=0;if("flip"==this.overflowMethod){let i=!1,r=!0;this.y-t<this.padding&&(r=!1),this.x+e>n-this.padding&&(i=!0),o=i?this.x-e:this.x,s=r?this.y-t:this.y}else s=this.y-t,s+t+this.padding>i&&(s=i-t-this.padding),s<this.padding&&(s=this.padding),o=this.x,o+e+this.padding>n&&(o=n-e-this.padding),o<this.padding&&(o=this.padding);this.frame.style.left=o+"px",this.frame.style.top=s+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}},$i=Hi,qi=zi;var Xi,Ki=Object.freeze({__proto__:null,Activator:Bi,Alea:function(...t){return function(t){let[e,i,n]=function(...t){const e=function(){let t=4022871197;return function(e){const i=e.toString();for(let e=0;e<i.length;e++){t+=i.charCodeAt(e);let n=.02519603282416938*t;t=n>>>0,n-=t,n*=t,t=n>>>0,n-=t,t+=4294967296*n}return 2.3283064365386963e-10*(t>>>0)}}();let i=e(" "),n=e(" "),o=e(" ");for(let s=0;s<t.length;s++)i-=e(t[s]),i<0&&(i+=1),n-=e(t[s]),n<0&&(n+=1),o-=e(t[s]),o<0&&(o+=1);return[i,n,o]}(t),o=1;const s=()=>{const t=2091639*e+2.3283064365386963e-10*o;return e=i,i=n,n=t-(o=0|t)};return s.uint32=()=>4294967296*s(),s.fract53=()=>s()+11102230246251565e-32*(2097152*s()|0),s.algorithm="Alea",s.seed=t,s.version="0.9",s}(t.length?t:[Date.now()])},ColorPicker:Wi,Configurator:Gi,DELETE:Je,HSVToHex:Ei,HSVToRGB:Ti,Hammer:Vi,Popup:Ui,RGBToHSV:Ci,RGBToHex:Di,VALIDATOR_PRINT_STYLE:$i,Validator:qi,addClassName:function(t,e){let i=t.className.split(" ");const n=e.split(" ");i=i.concat(n.filter((function(t){return!i.includes(t)}))),t.className=i.join(" ")},addCssText:function(t,e){const i={...Si.split(t.style.cssText),...Si.split(e)};t.style.cssText=Si.join(i)},addEventListener:function(t,e,i,n){t.addEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.addEventListener(e,i,n)):t.attachEvent("on"+e,i)},binarySearchCustom:function(t,e,i,n){let o=0,s=0,r=t.length-1;for(;s<=r&&o<1e4;){const a=Math.floor((s+r)/2),l=t[a],h=e(void 0===n?l[i]:l[i][n]);if(0==h)return a;-1==h?s=a+1:r=a-1,o++}return-1},binarySearchValue:function(t,e,i,n,o){let s,r,a,l,h=0,d=0,c=t.length-1;for(o=null!=o?o:function(t,e){return t==e?0:t<e?-1:1};d<=c&&h<1e4;){if(l=Math.floor(.5*(c+d)),s=t[Math.max(0,l-1)][i],r=t[l][i],a=t[Math.min(t.length-1,l+1)][i],0==o(r,e))return l;if(o(s,e)<0&&o(r,e)>0)return"before"==n?Math.max(0,l-1):l;if(o(r,e)<0&&o(a,e)>0)return"before"==n?l:Math.min(t.length-1,l+1);o(r,e)<0?d=l+1:c=l-1,h++}return-1},bridgeObject:Pi,copyAndExtendArray:bi,copyArray:wi,deepExtend:vi,deepObjectAssign:ei,easingFunctions:Ni,equalArray:function(t,e){if(t.length!==e.length)return!1;for(let i=0,n=t.length;i<n;i++)if(t[i]!=e[i])return!1;return!0},extend:gi,fillIfDefined:function t(e,i,n=!1){for(const o in e)if(void 0!==i[o])if(null===i[o]||"object"!=typeof i[o])fi(e,i,o,n);else{const s=e[o],r=i[o];mi(s)&&mi(r)&&t(s,r,n)}},forEach:function(t,e){if(Array.isArray(t)){const i=t.length;for(let n=0;n<i;n++)e(t[n],n,t)}else for(const i in t)Object.prototype.hasOwnProperty.call(t,i)&&e(t[i],i,t)},getAbsoluteLeft:function(t){return t.getBoundingClientRect().left},getAbsoluteRight:function(t){return t.getBoundingClientRect().right},getAbsoluteTop:function(t){return t.getBoundingClientRect().top},getScrollBarWidth:function(){const t=document.createElement("p");t.style.width="100%",t.style.height="200px";const e=document.createElement("div");e.style.position="absolute",e.style.top="0px",e.style.left="0px",e.style.visibility="hidden",e.style.width="200px",e.style.height="150px",e.style.overflow="hidden",e.appendChild(t),document.body.appendChild(e);const i=t.offsetWidth;e.style.overflow="scroll";let n=t.offsetWidth;return i==n&&(n=e.clientWidth),document.body.removeChild(e),i-n},getTarget:function(t=window.event){let e=null;return t&&(t.target?e=t.target:t.srcElement&&(e=t.srcElement)),e instanceof Element&&(null==e.nodeType||3!=e.nodeType||(e=e.parentNode,e instanceof Element))?e:null},getType:yi,hasParent:function(t,e){let i=t;for(;i;){if(i===e)return!0;if(!i.parentNode)return!1;i=i.parentNode}return!1},hexToHSV:Mi,hexToRGB:ki,insertSort:function(t,e){for(let i=0;i<t.length;i++){const n=t[i];let o;for(o=i;o>0&&e(n,t[o-1])<0;o--)t[o]=t[o-1];t[o]=n}return t},isDate:function(t){if(t instanceof Date)return!0;if(pi(t)){if(ai.exec(t))return!0;if(!isNaN(Date.parse(t)))return!0}return!1},isNumber:ui,isObject:mi,isString:pi,isValidHex:Oi,isValidRGB:Ii,isValidRGBA:Ai,mergeOptions:function(t,e,i,n={}){const o=function(t){return null!=t},s=function(t){return null!==t&&"object"==typeof t};if(!s(t))throw new Error("Parameter mergeTarget must be an object");if(!s(e))throw new Error("Parameter options must be an object");if(!o(i))throw new Error("Parameter option must have a value");if(!s(n))throw new Error("Parameter globalOptions must be an object");const r=e[i],a=s(n)&&!function(t){for(const e in t)if(Object.prototype.hasOwnProperty.call(t,e))return!1;return!0}(n)?n[i]:void 0,l=a?a.enabled:void 0;if(void 0===r)return;if("boolean"==typeof r)return s(t[i])||(t[i]={}),void(t[i].enabled=r);if(null===r&&!s(t[i])){if(!o(a))return;t[i]=Object.create(a)}if(!s(r))return;let h=!0;void 0!==r.enabled?h=r.enabled:void 0!==l&&(h=a.enabled),function(t,e,i){s(t[i])||(t[i]={});const n=e[i],o=t[i];for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&(o[t]=n[t])}(t,e,i),t[i].enabled=h},option:xi,overrideOpacity:function(t,e){if(t.includes("rgba"))return t;if(t.includes("rgb")){const i=t.substr(t.indexOf("(")+1).replace(")","").split(",");return"rgba("+i[0]+","+i[1]+","+i[2]+","+e+")"}{const i=ki(t);return null==i?t:"rgba("+i.r+","+i.g+","+i.b+","+e+")"}},parseColor:function(t,e){if(pi(t)){let e=t;if(Ii(e)){const t=e.substr(4).substr(0,e.length-5).split(",").map((function(t){return parseInt(t)}));e=Di(t[0],t[1],t[2])}if(!0===Oi(e)){const t=Mi(e),i={h:t.h,s:.8*t.s,v:Math.min(1,1.02*t.v)},n={h:t.h,s:Math.min(1,1.25*t.s),v:.8*t.v},o=Ei(n.h,n.s,n.v),s=Ei(i.h,i.s,i.v);return{background:e,border:o,highlight:{background:s,border:o},hover:{background:s,border:o}}}return{background:e,border:e,highlight:{background:e,border:e},hover:{background:e,border:e}}}if(e){return{background:t.background||e.background,border:t.border||e.border,highlight:pi(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||e.highlight.background,border:t.highlight&&t.highlight.border||e.highlight.border},hover:pi(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||e.hover.border,background:t.hover&&t.hover.background||e.hover.background}}}return{background:t.background||void 0,border:t.border||void 0,highlight:pi(t.highlight)?{border:t.highlight,background:t.highlight}:{background:t.highlight&&t.highlight.background||void 0,border:t.highlight&&t.highlight.border||void 0},hover:pi(t.hover)?{border:t.hover,background:t.hover}:{border:t.hover&&t.hover.border||void 0,background:t.hover&&t.hover.background||void 0}}},preventDefault:function(t){t||(t=window.event),t&&(t.preventDefault?t.preventDefault():t.returnValue=!1)},pureDeepObjectAssign:ti,recursiveDOMDelete:function t(e){if(e)for(;!0===e.hasChildNodes();){const i=e.firstChild;i&&(t(i),e.removeChild(i))}},removeClassName:function(t,e){let i=t.className.split(" ");const n=e.split(" ");i=i.filter((function(t){return!n.includes(t)})),t.className=i.join(" ")},removeCssText:function(t,e){const i=Si.split(t.style.cssText),n=Si.split(e);for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&delete i[t];t.style.cssText=Si.join(i)},removeEventListener:function(t,e,i,n){t.removeEventListener?(void 0===n&&(n=!1),"mousewheel"===e&&navigator.userAgent.includes("Firefox")&&(e="DOMMouseScroll"),t.removeEventListener(e,i,n)):t.detachEvent("on"+e,i)},selectiveBridgeObject:function(t,e){if(null!==e&&"object"==typeof e){const i=Object.create(e);for(let n=0;n<t.length;n++)Object.prototype.hasOwnProperty.call(e,t[n])&&"object"==typeof e[t[n]]&&(i[t[n]]=Pi(e[t[n]]));return i}return null},selectiveDeepExtend:function(t,e,i,n=!1){if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(let o=0;o<t.length;o++){const s=t[o];if(Object.prototype.hasOwnProperty.call(i,s))if(i[s]&&i[s].constructor===Object)void 0===e[s]&&(e[s]={}),e[s].constructor===Object?vi(e[s],i[s],!1,n):fi(e,i,s,n);else{if(Array.isArray(i[s]))throw new TypeError("Arrays are not supported by deepExtend");fi(e,i,s,n)}}return e},selectiveExtend:function(t,e,...i){if(!Array.isArray(t))throw new Error("Array with property names expected as first argument");for(const n of i)for(let i=0;i<t.length;i++){const o=t[i];n&&Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},selectiveNotDeepExtend:function(t,e,i,n=!1){if(Array.isArray(i))throw new TypeError("Arrays are not supported by deepExtend");for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)&&!t.includes(o))if(i[o]&&i[o].constructor===Object)void 0===e[o]&&(e[o]={}),e[o].constructor===Object?vi(e[o],i[o]):fi(e,i,o,n);else if(Array.isArray(i[o])){e[o]=[];for(let t=0;t<i[o].length;t++)e[o].push(i[o][t])}else fi(e,i,o,n);return e},throttle:function(t){let e=!1;return()=>{e||(e=!0,requestAnimationFrame((()=>{e=!1,t()})))}},toArray:_i,topMost:function(t,e){let i;Array.isArray(e)||(e=[e]);for(const n of t)if(n){i=n[e[0]];for(let t=1;t<e.length;t++)i&&(i=i[e[t]]);if(void 0!==i)break}return i},updateProperty:function(t,e,i){return t[e]!==i&&(t[e]=i,!0)}}),Zi=new Uint8Array(16);function Qi(){if(!Xi&&!(Xi="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Xi(Zi)}var Ji=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function tn(t){return"string"==typeof t&&Ji.test(t)}for(var en=[],nn=0;nn<256;++nn)en.push((nn+256).toString(16).substr(1));function on(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(en[t[e+0]]+en[t[e+1]]+en[t[e+2]]+en[t[e+3]]+"-"+en[t[e+4]]+en[t[e+5]]+"-"+en[t[e+6]]+en[t[e+7]]+"-"+en[t[e+8]]+en[t[e+9]]+"-"+en[t[e+10]]+en[t[e+11]]+en[t[e+12]]+en[t[e+13]]+en[t[e+14]]+en[t[e+15]]).toLowerCase();if(!tn(i))throw TypeError("Stringified UUID is invalid");return i}var sn="6ba7b810-9dad-11d1-80b4-00c04fd430c8",rn="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function an(t,e,i){function n(t,n,o,s){if("string"==typeof t&&(t=function(t){t=unescape(encodeURIComponent(t));for(var e=[],i=0;i<t.length;++i)e.push(t.charCodeAt(i));return e}(t)),"string"==typeof n&&(n=function(t){if(!tn(t))throw TypeError("Invalid UUID");var e,i=new Uint8Array(16);return i[0]=(e=parseInt(t.slice(0,8),16))>>>24,i[1]=e>>>16&255,i[2]=e>>>8&255,i[3]=255&e,i[4]=(e=parseInt(t.slice(9,13),16))>>>8,i[5]=255&e,i[6]=(e=parseInt(t.slice(14,18),16))>>>8,i[7]=255&e,i[8]=(e=parseInt(t.slice(19,23),16))>>>8,i[9]=255&e,i[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,i[11]=e/4294967296&255,i[12]=e>>>24&255,i[13]=e>>>16&255,i[14]=e>>>8&255,i[15]=255&e,i}(n)),16!==n.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");var r=new Uint8Array(16+t.length);if(r.set(n),r.set(t,n.length),(r=i(r))[6]=15&r[6]|e,r[8]=63&r[8]|128,o){s=s||0;for(var a=0;a<16;++a)o[s+a]=r[a];return o}return on(r)}try{n.name=t}catch(t){}return n.DNS=sn,n.URL=rn,n}function ln(t){return 14+(t+64>>>9<<4)+1}function hn(t,e){var i=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(i>>16)<<16|65535&i}function dn(t,e,i,n,o,s){return hn((r=hn(hn(e,t),hn(n,s)))<<(a=o)|r>>>32-a,i);var r,a}function cn(t,e,i,n,o,s,r){return dn(e&i|~e&n,t,e,o,s,r)}function un(t,e,i,n,o,s,r){return dn(e&n|i&~n,t,e,o,s,r)}function pn(t,e,i,n,o,s,r){return dn(e^i^n,t,e,o,s,r)}function mn(t,e,i,n,o,s,r){return dn(i^(e|~n),t,e,o,s,r)}function fn(t,e,i){var n=(t=t||{}).random||(t.rng||Qi)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var o=0;o<16;++o)e[i+o]=n[o];return e}return on(n)}function gn(t,e,i,n){switch(t){case 0:return e&i^~e&n;case 1:case 3:return e^i^n;case 2:return e&i^e&n^i&n}}function vn(t,e){return t<<e|t>>>32-e}an("v3",48,(function(t){if("string"==typeof t){var e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(var i=0;i<e.length;++i)t[i]=e.charCodeAt(i)}return function(t){for(var e=[],i=32*t.length,n="0123456789abcdef",o=0;o<i;o+=8){var s=t[o>>5]>>>o%32&255,r=parseInt(n.charAt(s>>>4&15)+n.charAt(15&s),16);e.push(r)}return e}(function(t,e){t[e>>5]|=128<<e%32,t[ln(e)-1]=e;for(var i=1732584193,n=-271733879,o=-1732584194,s=271733878,r=0;r<t.length;r+=16){var a=i,l=n,h=o,d=s;i=cn(i,n,o,s,t[r],7,-680876936),s=cn(s,i,n,o,t[r+1],12,-389564586),o=cn(o,s,i,n,t[r+2],17,606105819),n=cn(n,o,s,i,t[r+3],22,-1044525330),i=cn(i,n,o,s,t[r+4],7,-176418897),s=cn(s,i,n,o,t[r+5],12,1200080426),o=cn(o,s,i,n,t[r+6],17,-1473231341),n=cn(n,o,s,i,t[r+7],22,-45705983),i=cn(i,n,o,s,t[r+8],7,1770035416),s=cn(s,i,n,o,t[r+9],12,-1958414417),o=cn(o,s,i,n,t[r+10],17,-42063),n=cn(n,o,s,i,t[r+11],22,-1990404162),i=cn(i,n,o,s,t[r+12],7,1804603682),s=cn(s,i,n,o,t[r+13],12,-40341101),o=cn(o,s,i,n,t[r+14],17,-1502002290),i=un(i,n=cn(n,o,s,i,t[r+15],22,1236535329),o,s,t[r+1],5,-165796510),s=un(s,i,n,o,t[r+6],9,-1069501632),o=un(o,s,i,n,t[r+11],14,643717713),n=un(n,o,s,i,t[r],20,-373897302),i=un(i,n,o,s,t[r+5],5,-701558691),s=un(s,i,n,o,t[r+10],9,38016083),o=un(o,s,i,n,t[r+15],14,-660478335),n=un(n,o,s,i,t[r+4],20,-405537848),i=un(i,n,o,s,t[r+9],5,568446438),s=un(s,i,n,o,t[r+14],9,-1019803690),o=un(o,s,i,n,t[r+3],14,-187363961),n=un(n,o,s,i,t[r+8],20,1163531501),i=un(i,n,o,s,t[r+13],5,-1444681467),s=un(s,i,n,o,t[r+2],9,-51403784),o=un(o,s,i,n,t[r+7],14,1735328473),i=pn(i,n=un(n,o,s,i,t[r+12],20,-1926607734),o,s,t[r+5],4,-378558),s=pn(s,i,n,o,t[r+8],11,-2022574463),o=pn(o,s,i,n,t[r+11],16,1839030562),n=pn(n,o,s,i,t[r+14],23,-35309556),i=pn(i,n,o,s,t[r+1],4,-1530992060),s=pn(s,i,n,o,t[r+4],11,1272893353),o=pn(o,s,i,n,t[r+7],16,-155497632),n=pn(n,o,s,i,t[r+10],23,-1094730640),i=pn(i,n,o,s,t[r+13],4,681279174),s=pn(s,i,n,o,t[r],11,-358537222),o=pn(o,s,i,n,t[r+3],16,-722521979),n=pn(n,o,s,i,t[r+6],23,76029189),i=pn(i,n,o,s,t[r+9],4,-640364487),s=pn(s,i,n,o,t[r+12],11,-421815835),o=pn(o,s,i,n,t[r+15],16,530742520),i=mn(i,n=pn(n,o,s,i,t[r+2],23,-995338651),o,s,t[r],6,-198630844),s=mn(s,i,n,o,t[r+7],10,1126891415),o=mn(o,s,i,n,t[r+14],15,-1416354905),n=mn(n,o,s,i,t[r+5],21,-57434055),i=mn(i,n,o,s,t[r+12],6,1700485571),s=mn(s,i,n,o,t[r+3],10,-1894986606),o=mn(o,s,i,n,t[r+10],15,-1051523),n=mn(n,o,s,i,t[r+1],21,-2054922799),i=mn(i,n,o,s,t[r+8],6,1873313359),s=mn(s,i,n,o,t[r+15],10,-30611744),o=mn(o,s,i,n,t[r+6],15,-1560198380),n=mn(n,o,s,i,t[r+13],21,1309151649),i=mn(i,n,o,s,t[r+4],6,-145523070),s=mn(s,i,n,o,t[r+11],10,-1120210379),o=mn(o,s,i,n,t[r+2],15,718787259),n=mn(n,o,s,i,t[r+9],21,-343485551),i=hn(i,a),n=hn(n,l),o=hn(o,h),s=hn(s,d)}return[i,n,o,s]}(function(t){if(0===t.length)return[];for(var e=8*t.length,i=new Uint32Array(ln(e)),n=0;n<e;n+=8)i[n>>5]|=(255&t[n/8])<<n%32;return i}(t),8*t.length))})),an("v5",80,(function(t){var e=[1518500249,1859775393,2400959708,3395469782],i=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o<n.length;++o)t.push(n.charCodeAt(o))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);for(var s=t.length/4+2,r=Math.ceil(s/16),a=new Array(r),l=0;l<r;++l){for(var h=new Uint32Array(16),d=0;d<16;++d)h[d]=t[64*l+4*d]<<24|t[64*l+4*d+1]<<16|t[64*l+4*d+2]<<8|t[64*l+4*d+3];a[l]=h}a[r-1][14]=8*(t.length-1)/Math.pow(2,32),a[r-1][14]=Math.floor(a[r-1][14]),a[r-1][15]=8*(t.length-1)&4294967295;for(var c=0;c<r;++c){for(var u=new Uint32Array(80),p=0;p<16;++p)u[p]=a[c][p];for(var m=16;m<80;++m)u[m]=vn(u[m-3]^u[m-8]^u[m-14]^u[m-16],1);for(var f=i[0],g=i[1],v=i[2],y=i[3],b=i[4],w=0;w<80;++w){var _=Math.floor(w/20),x=vn(f,5)+gn(_,g,v,y)+b+e[_]+u[w]>>>0;b=y,y=v,v=vn(g,30)>>>0,g=f,f=x}i[0]=i[0]+f>>>0,i[1]=i[1]+g>>>0,i[2]=i[2]+v>>>0,i[3]=i[3]+y>>>0,i[4]=i[4]+b>>>0}return[i[0]>>24&255,i[0]>>16&255,i[0]>>8&255,255&i[0],i[1]>>24&255,i[1]>>16&255,i[1]>>8&255,255&i[1],i[2]>>24&255,i[2]>>16&255,i[2]>>8&255,255&i[2],i[3]>>24&255,i[3]>>16&255,i[3]>>8&255,255&i[3],i[4]>>24&255,i[4]>>16&255,i[4]>>8&255,255&i[4]]}));class yn{_source;_transformers;_target;_listeners={add:this._add.bind(this),remove:this._remove.bind(this),update:this._update.bind(this)};constructor(t,e,i){this._source=t,this._transformers=e,this._target=i}all(){return this._target.update(this._transformItems(this._source.get())),this}start(){return this._source.on("add",this._listeners.add),this._source.on("remove",this._listeners.remove),this._source.on("update",this._listeners.update),this}stop(){return this._source.off("add",this._listeners.add),this._source.off("remove",this._listeners.remove),this._source.off("update",this._listeners.update),this}_transformItems(t){return this._transformers.reduce(((t,e)=>e(t)),t)}_add(t,e){null!=e&&this._target.add(this._transformItems(this._source.get(e.items)))}_update(t,e){null!=e&&this._target.update(this._transformItems(this._source.get(e.items)))}_remove(t,e){null!=e&&this._target.remove(this._transformItems(e.oldData))}}class bn{_source;_transformers=[];constructor(t){this._source=t}filter(t){return this._transformers.push((e=>e.filter(t))),this}map(t){return this._transformers.push((e=>e.map(t))),this}flatMap(t){return this._transformers.push((e=>e.flatMap(t))),this}to(t){return new yn(this._source,this._transformers,t)}}function wn(t){return"string"==typeof t||"number"==typeof t}class _n{delay;max;_queue=[];_timeout=null;_extended=null;constructor(t){this.delay=null,this.max=1/0,this.setOptions(t)}setOptions(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}static extend(t,e){const i=new _n(e);if(void 0!==t.flush)throw new Error("Target object already has a property flush");t.flush=()=>{i.flush()};const n=[{name:"flush",original:void 0}];if(e&&e.replace)for(let o=0;o<e.replace.length;o++){const s=e.replace[o];n.push({name:s,original:t[s]}),i.replace(t,s)}return i._extended={object:t,methods:n},i}destroy(){if(this.flush(),this._extended){const t=this._extended.object,e=this._extended.methods;for(let i=0;i<e.length;i++){const n=e[i];n.original?t[n.name]=n.original:delete t[n.name]}this._extended=null}}replace(t,e){const i=this,n=t[e];if(!n)throw new Error("Method "+e+" undefined");t[e]=function(...t){i.queue({args:t,fn:n,context:this})}}queue(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}_flushIfNeeded(){this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=setTimeout((()=>{this.flush()}),this.delay))}flush(){this._queue.splice(0).forEach((t=>{t.fn.apply(t.context||t.fn,t.args||[])}))}}class xn{_subscribers={"*":[],add:[],remove:[],update:[]};_trigger(t,e,i){if("*"===t)throw new Error("Cannot trigger event *");[...this._subscribers[t],...this._subscribers["*"]].forEach((n=>{n(t,e,null!=i?i:null)}))}on(t,e){"function"==typeof e&&this._subscribers[t].push(e)}off(t,e){this._subscribers[t]=this._subscribers[t].filter((t=>t!==e))}subscribe=xn.prototype.on;unsubscribe=xn.prototype.off}class kn{_pairs;constructor(t){this._pairs=t}*[Symbol.iterator](){for(const[t,e]of this._pairs)yield[t,e]}*entries(){for(const[t,e]of this._pairs)yield[t,e]}*keys(){for(const[t]of this._pairs)yield t}*values(){for(const[,t]of this._pairs)yield t}toIdArray(){return[...this._pairs].map((t=>t[0]))}toItemArray(){return[...this._pairs].map((t=>t[1]))}toEntryArray(){return[...this._pairs]}toObjectMap(){const t=Object.create(null);for(const[e,i]of this._pairs)t[e]=i;return t}toMap(){return new Map(this._pairs)}toIdSet(){return new Set(this.toIdArray())}toItemSet(){return new Set(this.toItemArray())}cache(){return new kn([...this._pairs])}distinct(t){const e=new Set;for(const[i,n]of this._pairs)e.add(t(n,i));return e}filter(t){const e=this._pairs;return new kn({*[Symbol.iterator](){for(const[i,n]of e)t(n,i)&&(yield[i,n])}})}forEach(t){for(const[e,i]of this._pairs)t(i,e)}map(t){const e=this._pairs;return new kn({*[Symbol.iterator](){for(const[i,n]of e)yield[i,t(n,i)]}})}max(t){const e=this._pairs[Symbol.iterator]();let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,s]=i.value,r=t(s,e);r>o&&(o=r,n=s)}return n}min(t){const e=this._pairs[Symbol.iterator]();let i=e.next();if(i.done)return null;let n=i.value[1],o=t(i.value[1],i.value[0]);for(;!(i=e.next()).done;){const[e,s]=i.value,r=t(s,e);r<o&&(o=r,n=s)}return n}reduce(t,e){for(const[i,n]of this._pairs)e=t(e,n,i);return e}sort(t){return new kn({[Symbol.iterator]:()=>[...this._pairs].sort((([e,i],[n,o])=>t(i,o,e,n)))[Symbol.iterator]()})}}class Dn extends xn{flush;length;get idProp(){return this._idProp}_options;_data;_idProp;_queue=null;constructor(t,e){super(),t&&!Array.isArray(t)&&(e=t,t=[]),this._options=e||{},this._data=new Map,this.length=0,this._idProp=this._options.fieldId||"id",t&&t.length&&this.add(t),this.setOptions(e)}setOptions(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=_n.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"==typeof t.queue&&this._queue.setOptions(t.queue)))}add(t,e){const i=[];let n;if(Array.isArray(t)){if(t.map((t=>t[this._idProp])).some((t=>this._data.has(t))))throw new Error("A duplicate id was found in the parameter array.");for(let e=0,o=t.length;e<o;e++)n=this._addItem(t[e]),i.push(n)}else{if(!t||"object"!=typeof t)throw new Error("Unknown dataType");n=this._addItem(t),i.push(n)}return i.length&&this._trigger("add",{items:i},e),i}update(t,e){const i=[],n=[],o=[],s=[],r=this._idProp,a=t=>{const e=t[r];if(null!=e&&this._data.has(e)){const i=t,r=Object.assign({},this._data.get(e)),a=this._updateItem(i);n.push(a),s.push(i),o.push(r)}else{const e=this._addItem(t);i.push(e)}};if(Array.isArray(t))for(let e=0,i=t.length;e<i;e++)t[e]&&"object"==typeof t[e]?a(t[e]):console.warn("Ignoring input item, which is not an object at index "+e);else{if(!t||"object"!=typeof t)throw new Error("Unknown dataType");a(t)}if(i.length&&this._trigger("add",{items:i},e),n.length){const t={items:n,oldData:o,data:s};this._trigger("update",t,e)}return i.concat(n)}updateOnly(t,e){Array.isArray(t)||(t=[t]);const i=t.map((t=>{const e=this._data.get(t[this._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}})).map((({oldData:t,update:e})=>{const i=t[this._idProp],n=ti(t,e);return this._data.set(i,n),{id:i,oldData:t,updatedData:n}}));if(i.length){const t={items:i.map((t=>t.id)),oldData:i.map((t=>t.oldData)),data:i.map((t=>t.updatedData))};return this._trigger("update",t,e),t.items}return[]}get(t,e){let i,n,o;wn(t)?(i=t,o=e):Array.isArray(t)?(n=t,o=e):o=t;const s=o&&"Object"===o.returnType?"Object":"Array",r=o&&o.filter,a=[];let l,h,d;if(null!=i)l=this._data.get(i),l&&r&&!r(l)&&(l=void 0);else if(null!=n)for(let t=0,e=n.length;t<e;t++)l=this._data.get(n[t]),null==l||r&&!r(l)||a.push(l);else{h=[...this._data.keys()];for(let t=0,e=h.length;t<e;t++)d=h[t],l=this._data.get(d),null==l||r&&!r(l)||a.push(l)}if(o&&o.order&&null==i&&this._sort(a,o.order),o&&o.fields){const t=o.fields;if(null!=i&&null!=l)l=this._filterFields(l,t);else for(let e=0,i=a.length;e<i;e++)a[e]=this._filterFields(a[e],t)}if("Object"==s){const t={};for(let e=0,i=a.length;e<i;e++){const i=a[e];t[i[this._idProp]]=i}return t}return null!=i?l??null:a}getIds(t){const e=this._data,i=t&&t.filter,n=t&&t.order,o=[...e.keys()],s=[];if(i)if(n){const t=[];for(let e=0,n=o.length;e<n;e++){const n=o[e],s=this._data.get(n);null!=s&&i(s)&&t.push(s)}this._sort(t,n);for(let e=0,i=t.length;e<i;e++)s.push(t[e][this._idProp])}else for(let t=0,e=o.length;t<e;t++){const e=o[t],n=this._data.get(e);null!=n&&i(n)&&s.push(n[this._idProp])}else if(n){const t=[];for(let i=0,n=o.length;i<n;i++){const n=o[i];t.push(e.get(n))}this._sort(t,n);for(let e=0,i=t.length;e<i;e++)s.push(t[e][this._idProp])}else for(let t=0,i=o.length;t<i;t++){const i=o[t],n=e.get(i);null!=n&&s.push(n[this._idProp])}return s}getDataSet(){return this}forEach(t,e){const i=e&&e.filter,n=[...this._data.keys()];if(e&&e.order){const i=this.get(e);for(let e=0,n=i.length;e<n;e++){const n=i[e];t(n,n[this._idProp])}}else for(let e=0,o=n.length;e<o;e++){const o=n[e],s=this._data.get(o);null==s||i&&!i(s)||t(s,o)}}map(t,e){const i=e&&e.filter,n=[],o=[...this._data.keys()];for(let e=0,s=o.length;e<s;e++){const s=o[e],r=this._data.get(s);null==r||i&&!i(r)||n.push(t(r,s))}return e&&e.order&&this._sort(n,e.order),n}_filterFields(t,e){return t?(Array.isArray(e)?e:Object.keys(e)).reduce(((e,i)=>(e[i]=t[i],e)),{}):t}_sort(t,e){if("string"==typeof e){const i=e;t.sort(((t,e)=>{const n=t[i],o=e[i];return n>o?1:n<o?-1:0}))}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");t.sort(e)}}remove(t,e){const i=[],n=[],o=Array.isArray(t)?t:[t];for(let t=0,e=o.length;t<e;t++){const e=this._remove(o[t]);if(e){const t=e[this._idProp];null!=t&&(i.push(t),n.push(e))}}return i.length&&this._trigger("remove",{items:i,oldData:n},e),i}_remove(t){let e;if(wn(t)?e=t:t&&"object"==typeof t&&(e=t[this._idProp]),null!=e&&this._data.has(e)){const t=this._data.get(e)||null;return this._data.delete(e),--this.length,t}return null}clear(t){const e=[...this._data.keys()],i=[];for(let t=0,n=e.length;t<n;t++)i.push(this._data.get(e[t]));return this._data.clear(),this.length=0,this._trigger("remove",{items:e,oldData:i},t),e}max(t){let e=null,i=null;for(const n of this._data.values()){const o=n[t];"number"==typeof o&&(null==i||o>i)&&(e=n,i=o)}return e||null}min(t){let e=null,i=null;for(const n of this._data.values()){const o=n[t];"number"==typeof o&&(null==i||o<i)&&(e=n,i=o)}return e||null}distinct(t){const e=this._data,i=[...e.keys()],n=[];let o=0;for(let s=0,r=i.length;s<r;s++){const r=i[s],a=e.get(r)[t];let l=!1;for(let t=0;t<o;t++)if(n[t]==a){l=!0;break}l||void 0===a||(n[o]=a,o++)}return n}_addItem(t){const e=function(t,e){return null==t[e]&&(t[e]=fn()),t}(t,this._idProp),i=e[this._idProp];if(this._data.has(i))throw new Error("Cannot add item: item with id "+i+" already exists");return this._data.set(i,e),++this.length,i}_updateItem(t){const e=t[this._idProp];if(null==e)throw new Error("Cannot update item: item has no id (item: "+JSON.stringify(t)+")");const i=this._data.get(e);if(!i)throw new Error("Cannot update item: no item with id "+e+" found");return this._data.set(e,{...i,...t}),e}stream(t){if(t){const e=this._data;return new kn({*[Symbol.iterator](){for(const i of t){const t=e.get(i);null!=t&&(yield[i,t])}}})}return new kn({[Symbol.iterator]:this._data.entries.bind(this._data)})}}class Cn extends xn{length=0;get idProp(){return this.getDataSet().idProp}_listener;_data;_ids=new Set;_options;constructor(t,e){super(),this._options=e||{},this._listener=this._onEvent.bind(this),this.setData(t)}setData(t){if(this._data){this._data.off&&this._data.off("*",this._listener);const t=this._data.getIds({filter:this._options.filter}),e=this._data.get(t);this._ids.clear(),this.length=0,this._trigger("remove",{items:t,oldData:e})}if(null!=t){this._data=t;const e=this._data.getIds({filter:this._options.filter});for(let t=0,i=e.length;t<i;t++){const i=e[t];this._ids.add(i)}this.length=e.length,this._trigger("add",{items:e})}else this._data=new Dn;this._data.on&&this._data.on("*",this._listener)}refresh(){const t=this._data.getIds({filter:this._options.filter}),e=[...this._ids],i={},n=[],o=[],s=[];for(let e=0,o=t.length;e<o;e++){const o=t[e];i[o]=!0,this._ids.has(o)||(n.push(o),this._ids.add(o))}for(let t=0,n=e.length;t<n;t++){const n=e[t],r=this._data.get(n);null==r?console.error("If you see this, report it please."):i[n]||(o.push(n),s.push(r),this._ids.delete(n))}this.length+=n.length-o.length,n.length&&this._trigger("add",{items:n}),o.length&&this._trigger("remove",{items:o,oldData:s})}get(t,e){if(null==this._data)return null;let i,n=null;wn(t)||Array.isArray(t)?(n=t,i=e):i=t;const o=Object.assign({},this._options,i),s=this._options.filter,r=i&&i.filter;return s&&r&&(o.filter=t=>s(t)&&r(t)),null==n?this._data.get(o):this._data.get(n,o)}getIds(t){if(this._data.length){const e=this._options.filter,i=null!=t?t.filter:null;let n;return n=i?e?t=>e(t)&&i(t):i:e,this._data.getIds({filter:n,order:t&&t.order})}return[]}forEach(t,e){if(this._data){const i=this._options.filter,n=e&&e.filter;let o;o=n?i?function(t){return i(t)&&n(t)}:n:i,this._data.forEach(t,{filter:o,order:e&&e.order})}}map(t,e){if(this._data){const i=this._options.filter,n=e&&e.filter;let o;return o=n?i?t=>i(t)&&n(t):n:i,this._data.map(t,{filter:o,order:e&&e.order})}return[]}getDataSet(){return this._data.getDataSet()}stream(t){return this._data.stream(t||{[Symbol.iterator]:this._ids.keys.bind(this._ids)})}dispose(){this._data?.off&&this._data.off("*",this._listener);const t="This data view has already been disposed of.",e={get:()=>{throw new Error(t)},set:()=>{throw new Error(t)},configurable:!1};for(const t of Reflect.ownKeys(Cn.prototype))Object.defineProperty(this,t,e)}_onEvent(t,e,i){if(!e||!e.items||!this._data)return;const n=e.items,o=[],s=[],r=[],a=[],l=[],h=[];switch(t){case"add":for(let t=0,e=n.length;t<e;t++){const e=n[t];this.get(e)&&(this._ids.add(e),o.push(e))}break;case"update":for(let t=0,i=n.length;t<i;t++){const i=n[t];this.get(i)?this._ids.has(i)?(s.push(i),l.push(e.data[t]),a.push(e.oldData[t])):(this._ids.add(i),o.push(i)):this._ids.has(i)&&(this._ids.delete(i),r.push(i),h.push(e.oldData[t]))}break;case"remove":for(let t=0,i=n.length;t<i;t++){const i=n[t];this._ids.has(i)&&(this._ids.delete(i),r.push(i),h.push(e.oldData[t]))}}this.length+=o.length-r.length,o.length&&this._trigger("add",{items:o},i),s.length&&this._trigger("update",{items:s,oldData:a,data:l},i),r.length&&this._trigger("remove",{items:r,oldData:h},i)}}function Sn(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Tn,En={exports:{}};(Tn=En).exports=function(){var t,e;function i(){return t.apply(null,arguments)}function n(e){t=e}function o(t){return t instanceof Array||"[object Array]"===Object.prototype.toString.call(t)}function s(t){return null!=t&&"[object Object]"===Object.prototype.toString.call(t)}function r(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function a(t){if(Object.getOwnPropertyNames)return 0===Object.getOwnPropertyNames(t).length;var e;for(e in t)if(r(t,e))return!1;return!0}function l(t){return void 0===t}function h(t){return"number"==typeof t||"[object Number]"===Object.prototype.toString.call(t)}function d(t){return t instanceof Date||"[object Date]"===Object.prototype.toString.call(t)}function c(t,e){var i,n=[],o=t.length;for(i=0;i<o;++i)n.push(e(t[i],i));return n}function u(t,e){for(var i in e)r(e,i)&&(t[i]=e[i]);return r(e,"toString")&&(t.toString=e.toString),r(e,"valueOf")&&(t.valueOf=e.valueOf),t}function p(t,e,i,n){return Ui(t,e,i,n,!0).utc()}function m(){return{empty:!1,unusedTokens:[],unusedInput:[],overflow:-2,charsLeftOver:0,nullInput:!1,invalidEra:null,invalidMonth:null,invalidFormat:!1,userInvalidated:!1,iso:!1,parsedDateParts:[],era:null,meridiem:null,rfc2822:!1,weekdayMismatch:!1}}function f(t){return null==t._pf&&(t._pf=m()),t._pf}function g(t){if(null==t._isValid){var i=f(t),n=e.call(i.parsedDateParts,(function(t){return null!=t})),o=!isNaN(t._d.getTime())&&i.overflow<0&&!i.empty&&!i.invalidEra&&!i.invalidMonth&&!i.invalidWeekday&&!i.weekdayMismatch&&!i.nullInput&&!i.invalidFormat&&!i.userInvalidated&&(!i.meridiem||i.meridiem&&n);if(t._strict&&(o=o&&0===i.charsLeftOver&&0===i.unusedTokens.length&&void 0===i.bigHour),null!=Object.isFrozen&&Object.isFrozen(t))return o;t._isValid=o}return t._isValid}function v(t){var e=p(NaN);return null!=t?u(f(e),t):f(e).userInvalidated=!0,e}e=Array.prototype.some?Array.prototype.some:function(t){var e,i=Object(this),n=i.length>>>0;for(e=0;e<n;e++)if(e in i&&t.call(this,i[e],e,i))return!0;return!1};var y=i.momentProperties=[],b=!1;function w(t,e){var i,n,o,s=y.length;if(l(e._isAMomentObject)||(t._isAMomentObject=e._isAMomentObject),l(e._i)||(t._i=e._i),l(e._f)||(t._f=e._f),l(e._l)||(t._l=e._l),l(e._strict)||(t._strict=e._strict),l(e._tzm)||(t._tzm=e._tzm),l(e._isUTC)||(t._isUTC=e._isUTC),l(e._offset)||(t._offset=e._offset),l(e._pf)||(t._pf=f(e)),l(e._locale)||(t._locale=e._locale),s>0)for(i=0;i<s;i++)l(o=e[n=y[i]])||(t[n]=o);return t}function _(t){w(this,t),this._d=new Date(null!=t._d?t._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===b&&(b=!0,i.updateOffset(this),b=!1)}function x(t){return t instanceof _||null!=t&&null!=t._isAMomentObject}function k(t){!1===i.suppressDeprecationWarnings&&"undefined"!=typeof console&&console.warn&&console.warn("Deprecation warning: "+t)}function D(t,e){var n=!0;return u((function(){if(null!=i.deprecationHandler&&i.deprecationHandler(null,t),n){var o,s,a,l=[],h=arguments.length;for(s=0;s<h;s++){if(o="","object"==typeof arguments[s]){for(a in o+="\n["+s+"] ",arguments[0])r(arguments[0],a)&&(o+=a+": "+arguments[0][a]+", ");o=o.slice(0,-2)}else o=arguments[s];l.push(o)}k(t+"\nArguments: "+Array.prototype.slice.call(l).join("")+"\n"+(new Error).stack),n=!1}return e.apply(this,arguments)}),e)}var C,S={};function T(t,e){null!=i.deprecationHandler&&i.deprecationHandler(t,e),S[t]||(k(e),S[t]=!0)}function E(t){return"undefined"!=typeof Function&&t instanceof Function||"[object Function]"===Object.prototype.toString.call(t)}function M(t){var e,i;for(i in t)r(t,i)&&(E(e=t[i])?this[i]=e:this["_"+i]=e);this._config=t,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)}function O(t,e){var i,n=u({},t);for(i in e)r(e,i)&&(s(t[i])&&s(e[i])?(n[i]={},u(n[i],t[i]),u(n[i],e[i])):null!=e[i]?n[i]=e[i]:delete n[i]);for(i in t)r(t,i)&&!r(e,i)&&s(t[i])&&(n[i]=u({},n[i]));return n}function I(t){null!=t&&this.set(t)}i.suppressDeprecationWarnings=!1,i.deprecationHandler=null,C=Object.keys?Object.keys:function(t){var e,i=[];for(e in t)r(t,e)&&i.push(e);return i};var A={sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"};function P(t,e,i){var n=this._calendar[t]||this._calendar.sameElse;return E(n)?n.call(e,i):n}function N(t,e,i){var n=""+Math.abs(t),o=e-n.length;return(t>=0?i?"+":"":"-")+Math.pow(10,Math.max(0,o)).toString().substr(1)+n}var F=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,R=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,L={},j={};function Y(t,e,i,n){var o=n;"string"==typeof n&&(o=function(){return this[n]()}),t&&(j[t]=o),e&&(j[e[0]]=function(){return N(o.apply(this,arguments),e[1],e[2])}),i&&(j[i]=function(){return this.localeData().ordinal(o.apply(this,arguments),t)})}function H(t){return t.match(/\[[\s\S]/)?t.replace(/^\[|\]$/g,""):t.replace(/\\/g,"")}function z(t){var e,i,n=t.match(F);for(e=0,i=n.length;e<i;e++)j[n[e]]?n[e]=j[n[e]]:n[e]=H(n[e]);return function(e){var o,s="";for(o=0;o<i;o++)s+=E(n[o])?n[o].call(e,t):n[o];return s}}function B(t,e){return t.isValid()?(e=W(e,t.localeData()),L[e]=L[e]||z(e),L[e](t)):t.localeData().invalidDate()}function W(t,e){var i=5;function n(t){return e.longDateFormat(t)||t}for(R.lastIndex=0;i>=0&&R.test(t);)t=t.replace(R,n),R.lastIndex=0,i-=1;return t}var G={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function V(t){var e=this._longDateFormat[t],i=this._longDateFormat[t.toUpperCase()];return e||!i?e:(this._longDateFormat[t]=i.match(F).map((function(t){return"MMMM"===t||"MM"===t||"DD"===t||"dddd"===t?t.slice(1):t})).join(""),this._longDateFormat[t])}var U="Invalid date";function $(){return this._invalidDate}var q="%d",X=/\d{1,2}/;function K(t){return this._ordinal.replace("%d",t)}var Z={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Q(t,e,i,n){var o=this._relativeTime[i];return E(o)?o(t,e,i,n):o.replace(/%d/i,t)}function J(t,e){var i=this._relativeTime[t>0?"future":"past"];return E(i)?i(e):i.replace(/%s/i,e)}var tt={};function et(t,e){var i=t.toLowerCase();tt[i]=tt[i+"s"]=tt[e]=t}function it(t){return"string"==typeof t?tt[t]||tt[t.toLowerCase()]:void 0}function nt(t){var e,i,n={};for(i in t)r(t,i)&&(e=it(i))&&(n[e]=t[i]);return n}var ot={};function st(t,e){ot[t]=e}function rt(t){var e,i=[];for(e in t)r(t,e)&&i.push({unit:e,priority:ot[e]});return i.sort((function(t,e){return t.priority-e.priority})),i}function at(t){return t%4==0&&t%100!=0||t%400==0}function lt(t){return t<0?Math.ceil(t)||0:Math.floor(t)}function ht(t){var e=+t,i=0;return 0!==e&&isFinite(e)&&(i=lt(e)),i}function dt(t,e){return function(n){return null!=n?(ut(this,t,n),i.updateOffset(this,e),this):ct(this,t)}}function ct(t,e){return t.isValid()?t._d["get"+(t._isUTC?"UTC":"")+e]():NaN}function ut(t,e,i){t.isValid()&&!isNaN(i)&&("FullYear"===e&&at(t.year())&&1===t.month()&&29===t.date()?(i=ht(i),t._d["set"+(t._isUTC?"UTC":"")+e](i,t.month(),Qt(i,t.month()))):t._d["set"+(t._isUTC?"UTC":"")+e](i))}function pt(t){return E(this[t=it(t)])?this[t]():this}function mt(t,e){if("object"==typeof t){var i,n=rt(t=nt(t)),o=n.length;for(i=0;i<o;i++)this[n[i].unit](t[n[i].unit])}else if(E(this[t=it(t)]))return this[t](e);return this}var ft,gt=/\d/,vt=/\d\d/,yt=/\d{3}/,bt=/\d{4}/,wt=/[+-]?\d{6}/,_t=/\d\d?/,xt=/\d\d\d\d?/,kt=/\d\d\d\d\d\d?/,Dt=/\d{1,3}/,Ct=/\d{1,4}/,St=/[+-]?\d{1,6}/,Tt=/\d+/,Et=/[+-]?\d+/,Mt=/Z|[+-]\d\d:?\d\d/gi,Ot=/Z|[+-]\d\d(?::?\d\d)?/gi,It=/[+-]?\d+(\.\d{1,3})?/,At=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i;function Pt(t,e,i){ft[t]=E(e)?e:function(t,n){return t&&i?i:e}}function Nt(t,e){return r(ft,t)?ft[t](e._strict,e._locale):new RegExp(Ft(t))}function Ft(t){return Rt(t.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,(function(t,e,i,n,o){return e||i||n||o})))}function Rt(t){return t.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}ft={};var Lt={};function jt(t,e){var i,n,o=e;for("string"==typeof t&&(t=[t]),h(e)&&(o=function(t,i){i[e]=ht(t)}),n=t.length,i=0;i<n;i++)Lt[t[i]]=o}function Yt(t,e){jt(t,(function(t,i,n,o){n._w=n._w||{},e(t,n._w,n,o)}))}function Ht(t,e,i){null!=e&&r(Lt,t)&&Lt[t](e,i._a,i,t)}var zt,Bt=0,Wt=1,Gt=2,Vt=3,Ut=4,$t=5,qt=6,Xt=7,Kt=8;function Zt(t,e){return(t%e+e)%e}function Qt(t,e){if(isNaN(t)||isNaN(e))return NaN;var i=Zt(e,12);return t+=(e-i)/12,1===i?at(t)?29:28:31-i%7%2}zt=Array.prototype.indexOf?Array.prototype.indexOf:function(t){var e;for(e=0;e<this.length;++e)if(this[e]===t)return e;return-1},Y("M",["MM",2],"Mo",(function(){return this.month()+1})),Y("MMM",0,0,(function(t){return this.localeData().monthsShort(this,t)})),Y("MMMM",0,0,(function(t){return this.localeData().months(this,t)})),et("month","M"),st("month",8),Pt("M",_t),Pt("MM",_t,vt),Pt("MMM",(function(t,e){return e.monthsShortRegex(t)})),Pt("MMMM",(function(t,e){return e.monthsRegex(t)})),jt(["M","MM"],(function(t,e){e[Wt]=ht(t)-1})),jt(["MMM","MMMM"],(function(t,e,i,n){var o=i._locale.monthsParse(t,n,i._strict);null!=o?e[Wt]=o:f(i).invalidMonth=t}));var Jt="January_February_March_April_May_June_July_August_September_October_November_December".split("_"),te="Jan_Feb_Mar_Apr_May_Jun_Jul_Aug_Sep_Oct_Nov_Dec".split("_"),ee=/D[oD]?(\[[^\[\]]*\]|\s)+MMMM?/,ie=At,ne=At;function oe(t,e){return t?o(this._months)?this._months[t.month()]:this._months[(this._months.isFormat||ee).test(e)?"format":"standalone"][t.month()]:o(this._months)?this._months:this._months.standalone}function se(t,e){return t?o(this._monthsShort)?this._monthsShort[t.month()]:this._monthsShort[ee.test(e)?"format":"standalone"][t.month()]:o(this._monthsShort)?this._monthsShort:this._monthsShort.standalone}function re(t,e,i){var n,o,s,r=t.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],n=0;n<12;++n)s=p([2e3,n]),this._shortMonthsParse[n]=this.monthsShort(s,"").toLocaleLowerCase(),this._longMonthsParse[n]=this.months(s,"").toLocaleLowerCase();return i?"MMM"===e?-1!==(o=zt.call(this._shortMonthsParse,r))?o:null:-1!==(o=zt.call(this._longMonthsParse,r))?o:null:"MMM"===e?-1!==(o=zt.call(this._shortMonthsParse,r))||-1!==(o=zt.call(this._longMonthsParse,r))?o:null:-1!==(o=zt.call(this._longMonthsParse,r))||-1!==(o=zt.call(this._shortMonthsParse,r))?o:null}function ae(t,e,i){var n,o,s;if(this._monthsParseExact)return re.call(this,t,e,i);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),n=0;n<12;n++){if(o=p([2e3,n]),i&&!this._longMonthsParse[n]&&(this._longMonthsParse[n]=new RegExp("^"+this.months(o,"").replace(".","")+"$","i"),this._shortMonthsParse[n]=new RegExp("^"+this.monthsShort(o,"").replace(".","")+"$","i")),i||this._monthsParse[n]||(s="^"+this.months(o,"")+"|^"+this.monthsShort(o,""),this._monthsParse[n]=new RegExp(s.replace(".",""),"i")),i&&"MMMM"===e&&this._longMonthsParse[n].test(t))return n;if(i&&"MMM"===e&&this._shortMonthsParse[n].test(t))return n;if(!i&&this._monthsParse[n].test(t))return n}}function le(t,e){var i;if(!t.isValid())return t;if("string"==typeof e)if(/^\d+$/.test(e))e=ht(e);else if(!h(e=t.localeData().monthsParse(e)))return t;return i=Math.min(t.date(),Qt(t.year(),e)),t._d["set"+(t._isUTC?"UTC":"")+"Month"](e,i),t}function he(t){return null!=t?(le(this,t),i.updateOffset(this,!0),this):ct(this,"Month")}function de(){return Qt(this.year(),this.month())}function ce(t){return this._monthsParseExact?(r(this,"_monthsRegex")||pe.call(this),t?this._monthsShortStrictRegex:this._monthsShortRegex):(r(this,"_monthsShortRegex")||(this._monthsShortRegex=ie),this._monthsShortStrictRegex&&t?this._monthsShortStrictRegex:this._monthsShortRegex)}function ue(t){return this._monthsParseExact?(r(this,"_monthsRegex")||pe.call(this),t?this._monthsStrictRegex:this._monthsRegex):(r(this,"_monthsRegex")||(this._monthsRegex=ne),this._monthsStrictRegex&&t?this._monthsStrictRegex:this._monthsRegex)}function pe(){function t(t,e){return e.length-t.length}var e,i,n=[],o=[],s=[];for(e=0;e<12;e++)i=p([2e3,e]),n.push(this.monthsShort(i,"")),o.push(this.months(i,"")),s.push(this.months(i,"")),s.push(this.monthsShort(i,""));for(n.sort(t),o.sort(t),s.sort(t),e=0;e<12;e++)n[e]=Rt(n[e]),o[e]=Rt(o[e]);for(e=0;e<24;e++)s[e]=Rt(s[e]);this._monthsRegex=new RegExp("^("+s.join("|")+")","i"),this._monthsShortRegex=this._monthsRegex,this._monthsStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._monthsShortStrictRegex=new RegExp("^("+n.join("|")+")","i")}function me(t){return at(t)?366:365}Y("Y",0,0,(function(){var t=this.year();return t<=9999?N(t,4):"+"+t})),Y(0,["YY",2],0,(function(){return this.year()%100})),Y(0,["YYYY",4],0,"year"),Y(0,["YYYYY",5],0,"year"),Y(0,["YYYYYY",6,!0],0,"year"),et("year","y"),st("year",1),Pt("Y",Et),Pt("YY",_t,vt),Pt("YYYY",Ct,bt),Pt("YYYYY",St,wt),Pt("YYYYYY",St,wt),jt(["YYYYY","YYYYYY"],Bt),jt("YYYY",(function(t,e){e[Bt]=2===t.length?i.parseTwoDigitYear(t):ht(t)})),jt("YY",(function(t,e){e[Bt]=i.parseTwoDigitYear(t)})),jt("Y",(function(t,e){e[Bt]=parseInt(t,10)})),i.parseTwoDigitYear=function(t){return ht(t)+(ht(t)>68?1900:2e3)};var fe=dt("FullYear",!0);function ge(){return at(this.year())}function ve(t,e,i,n,o,s,r){var a;return t<100&&t>=0?(a=new Date(t+400,e,i,n,o,s,r),isFinite(a.getFullYear())&&a.setFullYear(t)):a=new Date(t,e,i,n,o,s,r),a}function ye(t){var e,i;return t<100&&t>=0?((i=Array.prototype.slice.call(arguments))[0]=t+400,e=new Date(Date.UTC.apply(null,i)),isFinite(e.getUTCFullYear())&&e.setUTCFullYear(t)):e=new Date(Date.UTC.apply(null,arguments)),e}function be(t,e,i){var n=7+e-i;return-(7+ye(t,0,n).getUTCDay()-e)%7+n-1}function we(t,e,i,n,o){var s,r,a=1+7*(e-1)+(7+i-n)%7+be(t,n,o);return a<=0?r=me(s=t-1)+a:a>me(t)?(s=t+1,r=a-me(t)):(s=t,r=a),{year:s,dayOfYear:r}}function _e(t,e,i){var n,o,s=be(t.year(),e,i),r=Math.floor((t.dayOfYear()-s-1)/7)+1;return r<1?n=r+xe(o=t.year()-1,e,i):r>xe(t.year(),e,i)?(n=r-xe(t.year(),e,i),o=t.year()+1):(o=t.year(),n=r),{week:n,year:o}}function xe(t,e,i){var n=be(t,e,i),o=be(t+1,e,i);return(me(t)-n+o)/7}function ke(t){return _e(t,this._week.dow,this._week.doy).week}Y("w",["ww",2],"wo","week"),Y("W",["WW",2],"Wo","isoWeek"),et("week","w"),et("isoWeek","W"),st("week",5),st("isoWeek",5),Pt("w",_t),Pt("ww",_t,vt),Pt("W",_t),Pt("WW",_t,vt),Yt(["w","ww","W","WW"],(function(t,e,i,n){e[n.substr(0,1)]=ht(t)}));var De={dow:0,doy:6};function Ce(){return this._week.dow}function Se(){return this._week.doy}function Te(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function Ee(t){var e=_e(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function Me(t,e){return"string"!=typeof t?t:isNaN(t)?"number"==typeof(t=e.weekdaysParse(t))?t:null:parseInt(t,10)}function Oe(t,e){return"string"==typeof t?e.weekdaysParse(t)%7||7:isNaN(t)?null:t}function Ie(t,e){return t.slice(e,7).concat(t.slice(0,e))}Y("d",0,"do","day"),Y("dd",0,0,(function(t){return this.localeData().weekdaysMin(this,t)})),Y("ddd",0,0,(function(t){return this.localeData().weekdaysShort(this,t)})),Y("dddd",0,0,(function(t){return this.localeData().weekdays(this,t)})),Y("e",0,0,"weekday"),Y("E",0,0,"isoWeekday"),et("day","d"),et("weekday","e"),et("isoWeekday","E"),st("day",11),st("weekday",11),st("isoWeekday",11),Pt("d",_t),Pt("e",_t),Pt("E",_t),Pt("dd",(function(t,e){return e.weekdaysMinRegex(t)})),Pt("ddd",(function(t,e){return e.weekdaysShortRegex(t)})),Pt("dddd",(function(t,e){return e.weekdaysRegex(t)})),Yt(["dd","ddd","dddd"],(function(t,e,i,n){var o=i._locale.weekdaysParse(t,n,i._strict);null!=o?e.d=o:f(i).invalidWeekday=t})),Yt(["d","e","E"],(function(t,e,i,n){e[n]=ht(t)}));var Ae="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Pe="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Ne="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Fe=At,Re=At,Le=At;function je(t,e){var i=o(this._weekdays)?this._weekdays:this._weekdays[t&&!0!==t&&this._weekdays.isFormat.test(e)?"format":"standalone"];return!0===t?Ie(i,this._week.dow):t?i[t.day()]:i}function Ye(t){return!0===t?Ie(this._weekdaysShort,this._week.dow):t?this._weekdaysShort[t.day()]:this._weekdaysShort}function He(t){return!0===t?Ie(this._weekdaysMin,this._week.dow):t?this._weekdaysMin[t.day()]:this._weekdaysMin}function ze(t,e,i){var n,o,s,r=t.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],n=0;n<7;++n)s=p([2e3,1]).day(n),this._minWeekdaysParse[n]=this.weekdaysMin(s,"").toLocaleLowerCase(),this._shortWeekdaysParse[n]=this.weekdaysShort(s,"").toLocaleLowerCase(),this._weekdaysParse[n]=this.weekdays(s,"").toLocaleLowerCase();return i?"dddd"===e?-1!==(o=zt.call(this._weekdaysParse,r))?o:null:"ddd"===e?-1!==(o=zt.call(this._shortWeekdaysParse,r))?o:null:-1!==(o=zt.call(this._minWeekdaysParse,r))?o:null:"dddd"===e?-1!==(o=zt.call(this._weekdaysParse,r))||-1!==(o=zt.call(this._shortWeekdaysParse,r))||-1!==(o=zt.call(this._minWeekdaysParse,r))?o:null:"ddd"===e?-1!==(o=zt.call(this._shortWeekdaysParse,r))||-1!==(o=zt.call(this._weekdaysParse,r))||-1!==(o=zt.call(this._minWeekdaysParse,r))?o:null:-1!==(o=zt.call(this._minWeekdaysParse,r))||-1!==(o=zt.call(this._weekdaysParse,r))||-1!==(o=zt.call(this._shortWeekdaysParse,r))?o:null}function Be(t,e,i){var n,o,s;if(this._weekdaysParseExact)return ze.call(this,t,e,i);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),n=0;n<7;n++){if(o=p([2e3,1]).day(n),i&&!this._fullWeekdaysParse[n]&&(this._fullWeekdaysParse[n]=new RegExp("^"+this.weekdays(o,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[n]=new RegExp("^"+this.weekdaysShort(o,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[n]=new RegExp("^"+this.weekdaysMin(o,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[n]||(s="^"+this.weekdays(o,"")+"|^"+this.weekdaysShort(o,"")+"|^"+this.weekdaysMin(o,""),this._weekdaysParse[n]=new RegExp(s.replace(".",""),"i")),i&&"dddd"===e&&this._fullWeekdaysParse[n].test(t))return n;if(i&&"ddd"===e&&this._shortWeekdaysParse[n].test(t))return n;if(i&&"dd"===e&&this._minWeekdaysParse[n].test(t))return n;if(!i&&this._weekdaysParse[n].test(t))return n}}function We(t){if(!this.isValid())return null!=t?this:NaN;var e=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=t?(t=Me(t,this.localeData()),this.add(t-e,"d")):e}function Ge(t){if(!this.isValid())return null!=t?this:NaN;var e=(this.day()+7-this.localeData()._week.dow)%7;return null==t?e:this.add(t-e,"d")}function Ve(t){if(!this.isValid())return null!=t?this:NaN;if(null!=t){var e=Oe(t,this.localeData());return this.day(this.day()%7?e:e-7)}return this.day()||7}function Ue(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysStrictRegex:this._weekdaysRegex):(r(this,"_weekdaysRegex")||(this._weekdaysRegex=Fe),this._weekdaysStrictRegex&&t?this._weekdaysStrictRegex:this._weekdaysRegex)}function $e(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(r(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Re),this._weekdaysShortStrictRegex&&t?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function qe(t){return this._weekdaysParseExact?(r(this,"_weekdaysRegex")||Xe.call(this),t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(r(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Le),this._weekdaysMinStrictRegex&&t?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function Xe(){function t(t,e){return e.length-t.length}var e,i,n,o,s,r=[],a=[],l=[],h=[];for(e=0;e<7;e++)i=p([2e3,1]).day(e),n=Rt(this.weekdaysMin(i,"")),o=Rt(this.weekdaysShort(i,"")),s=Rt(this.weekdays(i,"")),r.push(n),a.push(o),l.push(s),h.push(n),h.push(o),h.push(s);r.sort(t),a.sort(t),l.sort(t),h.sort(t),this._weekdaysRegex=new RegExp("^("+h.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+a.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+r.join("|")+")","i")}function Ke(){return this.hours()%12||12}function Ze(){return this.hours()||24}function Qe(t,e){Y(t,0,0,(function(){return this.localeData().meridiem(this.hours(),this.minutes(),e)}))}function Je(t,e){return e._meridiemParse}function ti(t){return"p"===(t+"").toLowerCase().charAt(0)}Y("H",["HH",2],0,"hour"),Y("h",["hh",2],0,Ke),Y("k",["kk",2],0,Ze),Y("hmm",0,0,(function(){return""+Ke.apply(this)+N(this.minutes(),2)})),Y("hmmss",0,0,(function(){return""+Ke.apply(this)+N(this.minutes(),2)+N(this.seconds(),2)})),Y("Hmm",0,0,(function(){return""+this.hours()+N(this.minutes(),2)})),Y("Hmmss",0,0,(function(){return""+this.hours()+N(this.minutes(),2)+N(this.seconds(),2)})),Qe("a",!0),Qe("A",!1),et("hour","h"),st("hour",13),Pt("a",Je),Pt("A",Je),Pt("H",_t),Pt("h",_t),Pt("k",_t),Pt("HH",_t,vt),Pt("hh",_t,vt),Pt("kk",_t,vt),Pt("hmm",xt),Pt("hmmss",kt),Pt("Hmm",xt),Pt("Hmmss",kt),jt(["H","HH"],Vt),jt(["k","kk"],(function(t,e,i){var n=ht(t);e[Vt]=24===n?0:n})),jt(["a","A"],(function(t,e,i){i._isPm=i._locale.isPM(t),i._meridiem=t})),jt(["h","hh"],(function(t,e,i){e[Vt]=ht(t),f(i).bigHour=!0})),jt("hmm",(function(t,e,i){var n=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n)),f(i).bigHour=!0})),jt("hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n,2)),e[$t]=ht(t.substr(o)),f(i).bigHour=!0})),jt("Hmm",(function(t,e,i){var n=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n))})),jt("Hmmss",(function(t,e,i){var n=t.length-4,o=t.length-2;e[Vt]=ht(t.substr(0,n)),e[Ut]=ht(t.substr(n,2)),e[$t]=ht(t.substr(o))}));var ei=/[ap]\.?m?\.?/i,ii=dt("Hours",!0);function ni(t,e,i){return t>11?i?"pm":"PM":i?"am":"AM"}var oi,si={calendar:A,longDateFormat:G,invalidDate:U,ordinal:q,dayOfMonthOrdinalParse:X,relativeTime:Z,months:Jt,monthsShort:te,week:De,weekdays:Ae,weekdaysMin:Ne,weekdaysShort:Pe,meridiemParse:ei},ri={},ai={};function li(t,e){var i,n=Math.min(t.length,e.length);for(i=0;i<n;i+=1)if(t[i]!==e[i])return i;return n}function hi(t){return t?t.toLowerCase().replace("_","-"):t}function di(t){for(var e,i,n,o,s=0;s<t.length;){for(e=(o=hi(t[s]).split("-")).length,i=(i=hi(t[s+1]))?i.split("-"):null;e>0;){if(n=ui(o.slice(0,e).join("-")))return n;if(i&&i.length>=e&&li(o,i)>=e-1)break;e--}s++}return oi}function ci(t){return null!=t.match("^[^/\\\\]*$")}function ui(t){var e=null;if(void 0===ri[t]&&Tn&&Tn.exports&&ci(t))try{e=oi._abbr,Sn("./locale/"+t),pi(e)}catch(e){ri[t]=null}return ri[t]}function pi(t,e){var i;return t&&((i=l(e)?gi(t):mi(t,e))?oi=i:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+t+" not found. Did you forget to load it?")),oi._abbr}function mi(t,e){if(null!==e){var i,n=si;if(e.abbr=t,null!=ri[t])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),n=ri[t]._config;else if(null!=e.parentLocale)if(null!=ri[e.parentLocale])n=ri[e.parentLocale]._config;else{if(null==(i=ui(e.parentLocale)))return ai[e.parentLocale]||(ai[e.parentLocale]=[]),ai[e.parentLocale].push({name:t,config:e}),null;n=i._config}return ri[t]=new I(O(n,e)),ai[t]&&ai[t].forEach((function(t){mi(t.name,t.config)})),pi(t),ri[t]}return delete ri[t],null}function fi(t,e){if(null!=e){var i,n,o=si;null!=ri[t]&&null!=ri[t].parentLocale?ri[t].set(O(ri[t]._config,e)):(null!=(n=ui(t))&&(o=n._config),e=O(o,e),null==n&&(e.abbr=t),(i=new I(e)).parentLocale=ri[t],ri[t]=i),pi(t)}else null!=ri[t]&&(null!=ri[t].parentLocale?(ri[t]=ri[t].parentLocale,t===pi()&&pi(t)):null!=ri[t]&&delete ri[t]);return ri[t]}function gi(t){var e;if(t&&t._locale&&t._locale._abbr&&(t=t._locale._abbr),!t)return oi;if(!o(t)){if(e=ui(t))return e;t=[t]}return di(t)}function vi(){return C(ri)}function yi(t){var e,i=t._a;return i&&-2===f(t).overflow&&(e=i[Wt]<0||i[Wt]>11?Wt:i[Gt]<1||i[Gt]>Qt(i[Bt],i[Wt])?Gt:i[Vt]<0||i[Vt]>24||24===i[Vt]&&(0!==i[Ut]||0!==i[$t]||0!==i[qt])?Vt:i[Ut]<0||i[Ut]>59?Ut:i[$t]<0||i[$t]>59?$t:i[qt]<0||i[qt]>999?qt:-1,f(t)._overflowDayOfYear&&(e<Bt||e>Gt)&&(e=Gt),f(t)._overflowWeeks&&-1===e&&(e=Xt),f(t)._overflowWeekday&&-1===e&&(e=Kt),f(t).overflow=e),t}var bi=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,wi=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,_i=/Z|[+-]\d\d(?::?\d\d)?/,xi=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],ki=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],Di=/^\/?Date\((-?\d+)/i,Ci=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,Si={UT:0,GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Ti(t){var e,i,n,o,s,r,a=t._i,l=bi.exec(a)||wi.exec(a),h=xi.length,d=ki.length;if(l){for(f(t).iso=!0,e=0,i=h;e<i;e++)if(xi[e][1].exec(l[1])){o=xi[e][0],n=!1!==xi[e][2];break}if(null==o)return void(t._isValid=!1);if(l[3]){for(e=0,i=d;e<i;e++)if(ki[e][1].exec(l[3])){s=(l[2]||" ")+ki[e][0];break}if(null==s)return void(t._isValid=!1)}if(!n&&null!=s)return void(t._isValid=!1);if(l[4]){if(!_i.exec(l[4]))return void(t._isValid=!1);r="Z"}t._f=o+(s||"")+(r||""),Yi(t)}else t._isValid=!1}function Ei(t,e,i,n,o,s){var r=[Mi(t),te.indexOf(e),parseInt(i,10),parseInt(n,10),parseInt(o,10)];return s&&r.push(parseInt(s,10)),r}function Mi(t){var e=parseInt(t,10);return e<=49?2e3+e:e<=999?1900+e:e}function Oi(t){return t.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").replace(/^\s\s*/,"").replace(/\s\s*$/,"")}function Ii(t,e,i){return!t||Pe.indexOf(t)===new Date(e[0],e[1],e[2]).getDay()||(f(i).weekdayMismatch=!0,i._isValid=!1,!1)}function Ai(t,e,i){if(t)return Si[t];if(e)return 0;var n=parseInt(i,10),o=n%100;return(n-o)/100*60+o}function Pi(t){var e,i=Ci.exec(Oi(t._i));if(i){if(e=Ei(i[4],i[3],i[2],i[5],i[6],i[7]),!Ii(i[1],e,t))return;t._a=e,t._tzm=Ai(i[8],i[9],i[10]),t._d=ye.apply(null,t._a),t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),f(t).rfc2822=!0}else t._isValid=!1}function Ni(t){var e=Di.exec(t._i);null===e?(Ti(t),!1===t._isValid&&(delete t._isValid,Pi(t),!1===t._isValid&&(delete t._isValid,t._strict?t._isValid=!1:i.createFromInputFallback(t)))):t._d=new Date(+e[1])}function Fi(t,e,i){return null!=t?t:null!=e?e:i}function Ri(t){var e=new Date(i.now());return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function Li(t){var e,i,n,o,s,r=[];if(!t._d){for(n=Ri(t),t._w&&null==t._a[Gt]&&null==t._a[Wt]&&ji(t),null!=t._dayOfYear&&(s=Fi(t._a[Bt],n[Bt]),(t._dayOfYear>me(s)||0===t._dayOfYear)&&(f(t)._overflowDayOfYear=!0),i=ye(s,0,t._dayOfYear),t._a[Wt]=i.getUTCMonth(),t._a[Gt]=i.getUTCDate()),e=0;e<3&&null==t._a[e];++e)t._a[e]=r[e]=n[e];for(;e<7;e++)t._a[e]=r[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[Vt]&&0===t._a[Ut]&&0===t._a[$t]&&0===t._a[qt]&&(t._nextDay=!0,t._a[Vt]=0),t._d=(t._useUTC?ye:ve).apply(null,r),o=t._useUTC?t._d.getUTCDay():t._d.getDay(),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[Vt]=24),t._w&&void 0!==t._w.d&&t._w.d!==o&&(f(t).weekdayMismatch=!0)}}function ji(t){var e,i,n,o,s,r,a,l,h;null!=(e=t._w).GG||null!=e.W||null!=e.E?(s=1,r=4,i=Fi(e.GG,t._a[Bt],_e($i(),1,4).year),n=Fi(e.W,1),((o=Fi(e.E,1))<1||o>7)&&(l=!0)):(s=t._locale._week.dow,r=t._locale._week.doy,h=_e($i(),s,r),i=Fi(e.gg,t._a[Bt],h.year),n=Fi(e.w,h.week),null!=e.d?((o=e.d)<0||o>6)&&(l=!0):null!=e.e?(o=e.e+s,(e.e<0||e.e>6)&&(l=!0)):o=s),n<1||n>xe(i,s,r)?f(t)._overflowWeeks=!0:null!=l?f(t)._overflowWeekday=!0:(a=we(i,n,o,s,r),t._a[Bt]=a.year,t._dayOfYear=a.dayOfYear)}function Yi(t){if(t._f!==i.ISO_8601)if(t._f!==i.RFC_2822){t._a=[],f(t).empty=!0;var e,n,o,s,r,a,l,h=""+t._i,d=h.length,c=0;for(l=(o=W(t._f,t._locale).match(F)||[]).length,e=0;e<l;e++)s=o[e],(n=(h.match(Nt(s,t))||[])[0])&&((r=h.substr(0,h.indexOf(n))).length>0&&f(t).unusedInput.push(r),h=h.slice(h.indexOf(n)+n.length),c+=n.length),j[s]?(n?f(t).empty=!1:f(t).unusedTokens.push(s),Ht(s,n,t)):t._strict&&!n&&f(t).unusedTokens.push(s);f(t).charsLeftOver=d-c,h.length>0&&f(t).unusedInput.push(h),t._a[Vt]<=12&&!0===f(t).bigHour&&t._a[Vt]>0&&(f(t).bigHour=void 0),f(t).parsedDateParts=t._a.slice(0),f(t).meridiem=t._meridiem,t._a[Vt]=Hi(t._locale,t._a[Vt],t._meridiem),null!==(a=f(t).era)&&(t._a[Bt]=t._locale.erasConvertYear(a,t._a[Bt])),Li(t),yi(t)}else Pi(t);else Ti(t)}function Hi(t,e,i){var n;return null==i?e:null!=t.meridiemHour?t.meridiemHour(e,i):null!=t.isPM?((n=t.isPM(i))&&e<12&&(e+=12),n||12!==e||(e=0),e):e}function zi(t){var e,i,n,o,s,r,a=!1,l=t._f.length;if(0===l)return f(t).invalidFormat=!0,void(t._d=new Date(NaN));for(o=0;o<l;o++)s=0,r=!1,e=w({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[o],Yi(e),g(e)&&(r=!0),s+=f(e).charsLeftOver,s+=10*f(e).unusedTokens.length,f(e).score=s,a?s<n&&(n=s,i=e):(null==n||s<n||r)&&(n=s,i=e,r&&(a=!0));u(t,i||e)}function Bi(t){if(!t._d){var e=nt(t._i),i=void 0===e.day?e.date:e.day;t._a=c([e.year,e.month,i,e.hour,e.minute,e.second,e.millisecond],(function(t){return t&&parseInt(t,10)})),Li(t)}}function Wi(t){var e=new _(yi(Gi(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Gi(t){var e=t._i,i=t._f;return t._locale=t._locale||gi(t._l),null===e||void 0===i&&""===e?v({nullInput:!0}):("string"==typeof e&&(t._i=e=t._locale.preparse(e)),x(e)?new _(yi(e)):(d(e)?t._d=e:o(i)?zi(t):i?Yi(t):Vi(t),g(t)||(t._d=null),t))}function Vi(t){var e=t._i;l(e)?t._d=new Date(i.now()):d(e)?t._d=new Date(e.valueOf()):"string"==typeof e?Ni(t):o(e)?(t._a=c(e.slice(0),(function(t){return parseInt(t,10)})),Li(t)):s(e)?Bi(t):h(e)?t._d=new Date(e):i.createFromInputFallback(t)}function Ui(t,e,i,n,r){var l={};return!0!==e&&!1!==e||(n=e,e=void 0),!0!==i&&!1!==i||(n=i,i=void 0),(s(t)&&a(t)||o(t)&&0===t.length)&&(t=void 0),l._isAMomentObject=!0,l._useUTC=l._isUTC=r,l._l=i,l._i=t,l._f=e,l._strict=n,Wi(l)}function $i(t,e,i,n){return Ui(t,e,i,n,!1)}i.createFromInputFallback=D("value provided is not in a recognized RFC2822 or ISO format. moment construction falls back to js Date(), which is not reliable across all browsers and versions. Non RFC2822/ISO date formats are discouraged. Please refer to http://momentjs.com/guides/#/warnings/js-date/ for more info.",(function(t){t._d=new Date(t._i+(t._useUTC?" UTC":""))})),i.ISO_8601=function(){},i.RFC_2822=function(){};var qi=D("moment().min is deprecated, use moment.max instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=$i.apply(null,arguments);return this.isValid()&&t.isValid()?t<this?this:t:v()})),Xi=D("moment().max is deprecated, use moment.min instead. http://momentjs.com/guides/#/warnings/min-max/",(function(){var t=$i.apply(null,arguments);return this.isValid()&&t.isValid()?t>this?this:t:v()}));function Ki(t,e){var i,n;if(1===e.length&&o(e[0])&&(e=e[0]),!e.length)return $i();for(i=e[0],n=1;n<e.length;++n)e[n].isValid()&&!e[n][t](i)||(i=e[n]);return i}function Zi(){return Ki("isBefore",[].slice.call(arguments,0))}function Qi(){return Ki("isAfter",[].slice.call(arguments,0))}var Ji=function(){return Date.now?Date.now():+new Date},tn=["year","quarter","month","week","day","hour","minute","second","millisecond"];function en(t){var e,i,n=!1,o=tn.length;for(e in t)if(r(t,e)&&(-1===zt.call(tn,e)||null!=t[e]&&isNaN(t[e])))return!1;for(i=0;i<o;++i)if(t[tn[i]]){if(n)return!1;parseFloat(t[tn[i]])!==ht(t[tn[i]])&&(n=!0)}return!0}function nn(){return this._isValid}function on(){return Mn(NaN)}function sn(t){var e=nt(t),i=e.year||0,n=e.quarter||0,o=e.month||0,s=e.week||e.isoWeek||0,r=e.day||0,a=e.hour||0,l=e.minute||0,h=e.second||0,d=e.millisecond||0;this._isValid=en(e),this._milliseconds=+d+1e3*h+6e4*l+1e3*a*60*60,this._days=+r+7*s,this._months=+o+3*n+12*i,this._data={},this._locale=gi(),this._bubble()}function rn(t){return t instanceof sn}function an(t){return t<0?-1*Math.round(-1*t):Math.round(t)}function ln(t,e,i){var n,o=Math.min(t.length,e.length),s=Math.abs(t.length-e.length),r=0;for(n=0;n<o;n++)(i&&t[n]!==e[n]||!i&&ht(t[n])!==ht(e[n]))&&r++;return r+s}function hn(t,e){Y(t,0,0,(function(){var t=this.utcOffset(),i="+";return t<0&&(t=-t,i="-"),i+N(~~(t/60),2)+e+N(~~t%60,2)}))}hn("Z",":"),hn("ZZ",""),Pt("Z",Ot),Pt("ZZ",Ot),jt(["Z","ZZ"],(function(t,e,i){i._useUTC=!0,i._tzm=cn(Ot,t)}));var dn=/([\+\-]|\d\d)/gi;function cn(t,e){var i,n,o=(e||"").match(t);return null===o?null:0===(n=60*(i=((o[o.length-1]||[])+"").match(dn)||["-",0,0])[1]+ht(i[2]))?0:"+"===i[0]?n:-n}function un(t,e){var n,o;return e._isUTC?(n=e.clone(),o=(x(t)||d(t)?t.valueOf():$i(t).valueOf())-n.valueOf(),n._d.setTime(n._d.valueOf()+o),i.updateOffset(n,!1),n):$i(t).local()}function pn(t){return-Math.round(t._d.getTimezoneOffset())}function mn(t,e,n){var o,s=this._offset||0;if(!this.isValid())return null!=t?this:NaN;if(null!=t){if("string"==typeof t){if(null===(t=cn(Ot,t)))return this}else Math.abs(t)<16&&!n&&(t*=60);return!this._isUTC&&e&&(o=pn(this)),this._offset=t,this._isUTC=!0,null!=o&&this.add(o,"m"),s!==t&&(!e||this._changeInProgress?Nn(this,Mn(t-s,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?s:pn(this)}function fn(t,e){return null!=t?("string"!=typeof t&&(t=-t),this.utcOffset(t,e),this):-this.utcOffset()}function gn(t){return this.utcOffset(0,t)}function vn(t){return this._isUTC&&(this.utcOffset(0,t),this._isUTC=!1,t&&this.subtract(pn(this),"m")),this}function yn(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var t=cn(Mt,this._i);null!=t?this.utcOffset(t):this.utcOffset(0,!0)}return this}function bn(t){return!!this.isValid()&&(t=t?$i(t).utcOffset():0,(this.utcOffset()-t)%60==0)}function wn(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function _n(){if(!l(this._isDSTShifted))return this._isDSTShifted;var t,e={};return w(e,this),(e=Gi(e))._a?(t=e._isUTC?p(e._a):$i(e._a),this._isDSTShifted=this.isValid()&&ln(e._a,t.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function xn(){return!!this.isValid()&&!this._isUTC}function kn(){return!!this.isValid()&&this._isUTC}function Dn(){return!!this.isValid()&&this._isUTC&&0===this._offset}i.updateOffset=function(){};var Cn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,En=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function Mn(t,e){var i,n,o,s=t,a=null;return rn(t)?s={ms:t._milliseconds,d:t._days,M:t._months}:h(t)||!isNaN(+t)?(s={},e?s[e]=+t:s.milliseconds=+t):(a=Cn.exec(t))?(i="-"===a[1]?-1:1,s={y:0,d:ht(a[Gt])*i,h:ht(a[Vt])*i,m:ht(a[Ut])*i,s:ht(a[$t])*i,ms:ht(an(1e3*a[qt]))*i}):(a=En.exec(t))?(i="-"===a[1]?-1:1,s={y:On(a[2],i),M:On(a[3],i),w:On(a[4],i),d:On(a[5],i),h:On(a[6],i),m:On(a[7],i),s:On(a[8],i)}):null==s?s={}:"object"==typeof s&&("from"in s||"to"in s)&&(o=An($i(s.from),$i(s.to)),(s={}).ms=o.milliseconds,s.M=o.months),n=new sn(s),rn(t)&&r(t,"_locale")&&(n._locale=t._locale),rn(t)&&r(t,"_isValid")&&(n._isValid=t._isValid),n}function On(t,e){var i=t&&parseFloat(t.replace(",","."));return(isNaN(i)?0:i)*e}function In(t,e){var i={};return i.months=e.month()-t.month()+12*(e.year()-t.year()),t.clone().add(i.months,"M").isAfter(e)&&--i.months,i.milliseconds=+e-+t.clone().add(i.months,"M"),i}function An(t,e){var i;return t.isValid()&&e.isValid()?(e=un(e,t),t.isBefore(e)?i=In(t,e):((i=In(e,t)).milliseconds=-i.milliseconds,i.months=-i.months),i):{milliseconds:0,months:0}}function Pn(t,e){return function(i,n){var o;return null===n||isNaN(+n)||(T(e,"moment()."+e+"(period, number) is deprecated. Please use moment()."+e+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),o=i,i=n,n=o),Nn(this,Mn(i,n),t),this}}function Nn(t,e,n,o){var s=e._milliseconds,r=an(e._days),a=an(e._months);t.isValid()&&(o=null==o||o,a&&le(t,ct(t,"Month")+a*n),r&&ut(t,"Date",ct(t,"Date")+r*n),s&&t._d.setTime(t._d.valueOf()+s*n),o&&i.updateOffset(t,r||a))}Mn.fn=sn.prototype,Mn.invalid=on;var Fn=Pn(1,"add"),Rn=Pn(-1,"subtract");function Ln(t){return"string"==typeof t||t instanceof String}function jn(t){return x(t)||d(t)||Ln(t)||h(t)||Hn(t)||Yn(t)||null==t}function Yn(t){var e,i,n=s(t)&&!a(t),o=!1,l=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],h=l.length;for(e=0;e<h;e+=1)i=l[e],o=o||r(t,i);return n&&o}function Hn(t){var e=o(t),i=!1;return e&&(i=0===t.filter((function(e){return!h(e)&&Ln(t)})).length),e&&i}function zn(t){var e,i,n=s(t)&&!a(t),o=!1,l=["sameDay","nextDay","lastDay","nextWeek","lastWeek","sameElse"];for(e=0;e<l.length;e+=1)i=l[e],o=o||r(t,i);return n&&o}function Bn(t,e){var i=t.diff(e,"days",!0);return i<-6?"sameElse":i<-1?"lastWeek":i<0?"lastDay":i<1?"sameDay":i<2?"nextDay":i<7?"nextWeek":"sameElse"}function Wn(t,e){1===arguments.length&&(arguments[0]?jn(arguments[0])?(t=arguments[0],e=void 0):zn(arguments[0])&&(e=arguments[0],t=void 0):(t=void 0,e=void 0));var n=t||$i(),o=un(n,this).startOf("day"),s=i.calendarFormat(this,o)||"sameElse",r=e&&(E(e[s])?e[s].call(this,n):e[s]);return this.format(r||this.localeData().calendar(s,this,$i(n)))}function Gn(){return new _(this)}function Vn(t,e){var i=x(t)?t:$i(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=it(e)||"millisecond")?this.valueOf()>i.valueOf():i.valueOf()<this.clone().startOf(e).valueOf())}function Un(t,e){var i=x(t)?t:$i(t);return!(!this.isValid()||!i.isValid())&&("millisecond"===(e=it(e)||"millisecond")?this.valueOf()<i.valueOf():this.clone().endOf(e).valueOf()<i.valueOf())}function $n(t,e,i,n){var o=x(t)?t:$i(t),s=x(e)?e:$i(e);return!!(this.isValid()&&o.isValid()&&s.isValid())&&("("===(n=n||"()")[0]?this.isAfter(o,i):!this.isBefore(o,i))&&(")"===n[1]?this.isBefore(s,i):!this.isAfter(s,i))}function qn(t,e){var i,n=x(t)?t:$i(t);return!(!this.isValid()||!n.isValid())&&("millisecond"===(e=it(e)||"millisecond")?this.valueOf()===n.valueOf():(i=n.valueOf(),this.clone().startOf(e).valueOf()<=i&&i<=this.clone().endOf(e).valueOf()))}function Xn(t,e){return this.isSame(t,e)||this.isAfter(t,e)}function Kn(t,e){return this.isSame(t,e)||this.isBefore(t,e)}function Zn(t,e,i){var n,o,s;if(!this.isValid())return NaN;if(!(n=un(t,this)).isValid())return NaN;switch(o=6e4*(n.utcOffset()-this.utcOffset()),e=it(e)){case"year":s=Qn(this,n)/12;break;case"month":s=Qn(this,n);break;case"quarter":s=Qn(this,n)/3;break;case"second":s=(this-n)/1e3;break;case"minute":s=(this-n)/6e4;break;case"hour":s=(this-n)/36e5;break;case"day":s=(this-n-o)/864e5;break;case"week":s=(this-n-o)/6048e5;break;default:s=this-n}return i?s:lt(s)}function Qn(t,e){if(t.date()<e.date())return-Qn(e,t);var i=12*(e.year()-t.year())+(e.month()-t.month()),n=t.clone().add(i,"months");return-(i+(e-n<0?(e-n)/(n-t.clone().add(i-1,"months")):(e-n)/(t.clone().add(i+1,"months")-n)))||0}function Jn(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")}function to(t){if(!this.isValid())return null;var e=!0!==t,i=e?this.clone().utc():this;return i.year()<0||i.year()>9999?B(i,e?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):E(Date.prototype.toISOString)?e?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",B(i,"Z")):B(i,e?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function eo(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var t,e,i,n,o="moment",s="";return this.isLocal()||(o=0===this.utcOffset()?"moment.utc":"moment.parseZone",s="Z"),t="["+o+'("]',e=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i="-MM-DD[T]HH:mm:ss.SSS",n=s+'[")]',this.format(t+e+i+n)}function io(t){t||(t=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var e=B(this,t);return this.localeData().postformat(e)}function no(t,e){return this.isValid()&&(x(t)&&t.isValid()||$i(t).isValid())?Mn({to:this,from:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function oo(t){return this.from($i(),t)}function so(t,e){return this.isValid()&&(x(t)&&t.isValid()||$i(t).isValid())?Mn({from:this,to:t}).locale(this.locale()).humanize(!e):this.localeData().invalidDate()}function ro(t){return this.to($i(),t)}function ao(t){var e;return void 0===t?this._locale._abbr:(null!=(e=gi(t))&&(this._locale=e),this)}i.defaultFormat="YYYY-MM-DDTHH:mm:ssZ",i.defaultFormatUtc="YYYY-MM-DDTHH:mm:ss[Z]";var lo=D("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",(function(t){return void 0===t?this.localeData():this.locale(t)}));function ho(){return this._locale}var co=1e3,uo=60*co,po=60*uo,mo=3506328*po;function fo(t,e){return(t%e+e)%e}function go(t,e,i){return t<100&&t>=0?new Date(t+400,e,i)-mo:new Date(t,e,i).valueOf()}function vo(t,e,i){return t<100&&t>=0?Date.UTC(t+400,e,i)-mo:Date.UTC(t,e,i)}function yo(t){var e,n;if(void 0===(t=it(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?vo:go,t){case"year":e=n(this.year(),0,1);break;case"quarter":e=n(this.year(),this.month()-this.month()%3,1);break;case"month":e=n(this.year(),this.month(),1);break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":e=n(this.year(),this.month(),this.date());break;case"hour":e=this._d.valueOf(),e-=fo(e+(this._isUTC?0:this.utcOffset()*uo),po);break;case"minute":e=this._d.valueOf(),e-=fo(e,uo);break;case"second":e=this._d.valueOf(),e-=fo(e,co)}return this._d.setTime(e),i.updateOffset(this,!0),this}function bo(t){var e,n;if(void 0===(t=it(t))||"millisecond"===t||!this.isValid())return this;switch(n=this._isUTC?vo:go,t){case"year":e=n(this.year()+1,0,1)-1;break;case"quarter":e=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":e=n(this.year(),this.month()+1,1)-1;break;case"week":e=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":e=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":e=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":e=this._d.valueOf(),e+=po-fo(e+(this._isUTC?0:this.utcOffset()*uo),po)-1;break;case"minute":e=this._d.valueOf(),e+=uo-fo(e,uo)-1;break;case"second":e=this._d.valueOf(),e+=co-fo(e,co)-1}return this._d.setTime(e),i.updateOffset(this,!0),this}function wo(){return this._d.valueOf()-6e4*(this._offset||0)}function _o(){return Math.floor(this.valueOf()/1e3)}function xo(){return new Date(this.valueOf())}function ko(){var t=this;return[t.year(),t.month(),t.date(),t.hour(),t.minute(),t.second(),t.millisecond()]}function Do(){var t=this;return{years:t.year(),months:t.month(),date:t.date(),hours:t.hours(),minutes:t.minutes(),seconds:t.seconds(),milliseconds:t.milliseconds()}}function Co(){return this.isValid()?this.toISOString():null}function So(){return g(this)}function To(){return u({},f(this))}function Eo(){return f(this).overflow}function Mo(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}function Oo(t,e){var n,o,s,r=this._eras||gi("en")._eras;for(n=0,o=r.length;n<o;++n)switch("string"==typeof r[n].since&&(s=i(r[n].since).startOf("day"),r[n].since=s.valueOf()),typeof r[n].until){case"undefined":r[n].until=1/0;break;case"string":s=i(r[n].until).startOf("day").valueOf(),r[n].until=s.valueOf()}return r}function Io(t,e,i){var n,o,s,r,a,l=this.eras();for(t=t.toUpperCase(),n=0,o=l.length;n<o;++n)if(s=l[n].name.toUpperCase(),r=l[n].abbr.toUpperCase(),a=l[n].narrow.toUpperCase(),i)switch(e){case"N":case"NN":case"NNN":if(r===t)return l[n];break;case"NNNN":if(s===t)return l[n];break;case"NNNNN":if(a===t)return l[n]}else if([s,r,a].indexOf(t)>=0)return l[n]}function Ao(t,e){var n=t.since<=t.until?1:-1;return void 0===e?i(t.since).year():i(t.since).year()+(e-t.offset)*n}function Po(){var t,e,i,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(i=this.clone().startOf("day").valueOf(),n[t].since<=i&&i<=n[t].until)return n[t].name;if(n[t].until<=i&&i<=n[t].since)return n[t].name}return""}function No(){var t,e,i,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(i=this.clone().startOf("day").valueOf(),n[t].since<=i&&i<=n[t].until)return n[t].narrow;if(n[t].until<=i&&i<=n[t].since)return n[t].narrow}return""}function Fo(){var t,e,i,n=this.localeData().eras();for(t=0,e=n.length;t<e;++t){if(i=this.clone().startOf("day").valueOf(),n[t].since<=i&&i<=n[t].until)return n[t].abbr;if(n[t].until<=i&&i<=n[t].since)return n[t].abbr}return""}function Ro(){var t,e,n,o,s=this.localeData().eras();for(t=0,e=s.length;t<e;++t)if(n=s[t].since<=s[t].until?1:-1,o=this.clone().startOf("day").valueOf(),s[t].since<=o&&o<=s[t].until||s[t].until<=o&&o<=s[t].since)return(this.year()-i(s[t].since).year())*n+s[t].offset;return this.year()}function Lo(t){return r(this,"_erasNameRegex")||Go.call(this),t?this._erasNameRegex:this._erasRegex}function jo(t){return r(this,"_erasAbbrRegex")||Go.call(this),t?this._erasAbbrRegex:this._erasRegex}function Yo(t){return r(this,"_erasNarrowRegex")||Go.call(this),t?this._erasNarrowRegex:this._erasRegex}function Ho(t,e){return e.erasAbbrRegex(t)}function zo(t,e){return e.erasNameRegex(t)}function Bo(t,e){return e.erasNarrowRegex(t)}function Wo(t,e){return e._eraYearOrdinalRegex||Tt}function Go(){var t,e,i=[],n=[],o=[],s=[],r=this.eras();for(t=0,e=r.length;t<e;++t)n.push(Rt(r[t].name)),i.push(Rt(r[t].abbr)),o.push(Rt(r[t].narrow)),s.push(Rt(r[t].name)),s.push(Rt(r[t].abbr)),s.push(Rt(r[t].narrow));this._erasRegex=new RegExp("^("+s.join("|")+")","i"),this._erasNameRegex=new RegExp("^("+n.join("|")+")","i"),this._erasAbbrRegex=new RegExp("^("+i.join("|")+")","i"),this._erasNarrowRegex=new RegExp("^("+o.join("|")+")","i")}function Vo(t,e){Y(0,[t,t.length],0,e)}function Uo(t){return Qo.call(this,t,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)}function $o(t){return Qo.call(this,t,this.isoWeek(),this.isoWeekday(),1,4)}function qo(){return xe(this.year(),1,4)}function Xo(){return xe(this.isoWeekYear(),1,4)}function Ko(){var t=this.localeData()._week;return xe(this.year(),t.dow,t.doy)}function Zo(){var t=this.localeData()._week;return xe(this.weekYear(),t.dow,t.doy)}function Qo(t,e,i,n,o){var s;return null==t?_e(this,n,o).year:(e>(s=xe(t,n,o))&&(e=s),Jo.call(this,t,e,i,n,o))}function Jo(t,e,i,n,o){var s=we(t,e,i,n,o),r=ye(s.year,0,s.dayOfYear);return this.year(r.getUTCFullYear()),this.month(r.getUTCMonth()),this.date(r.getUTCDate()),this}function ts(t){return null==t?Math.ceil((this.month()+1)/3):this.month(3*(t-1)+this.month()%3)}Y("N",0,0,"eraAbbr"),Y("NN",0,0,"eraAbbr"),Y("NNN",0,0,"eraAbbr"),Y("NNNN",0,0,"eraName"),Y("NNNNN",0,0,"eraNarrow"),Y("y",["y",1],"yo","eraYear"),Y("y",["yy",2],0,"eraYear"),Y("y",["yyy",3],0,"eraYear"),Y("y",["yyyy",4],0,"eraYear"),Pt("N",Ho),Pt("NN",Ho),Pt("NNN",Ho),Pt("NNNN",zo),Pt("NNNNN",Bo),jt(["N","NN","NNN","NNNN","NNNNN"],(function(t,e,i,n){var o=i._locale.erasParse(t,n,i._strict);o?f(i).era=o:f(i).invalidEra=t})),Pt("y",Tt),Pt("yy",Tt),Pt("yyy",Tt),Pt("yyyy",Tt),Pt("yo",Wo),jt(["y","yy","yyy","yyyy"],Bt),jt(["yo"],(function(t,e,i,n){var o;i._locale._eraYearOrdinalRegex&&(o=t.match(i._locale._eraYearOrdinalRegex)),i._locale.eraYearOrdinalParse?e[Bt]=i._locale.eraYearOrdinalParse(t,o):e[Bt]=parseInt(t,10)})),Y(0,["gg",2],0,(function(){return this.weekYear()%100})),Y(0,["GG",2],0,(function(){return this.isoWeekYear()%100})),Vo("gggg","weekYear"),Vo("ggggg","weekYear"),Vo("GGGG","isoWeekYear"),Vo("GGGGG","isoWeekYear"),et("weekYear","gg"),et("isoWeekYear","GG"),st("weekYear",1),st("isoWeekYear",1),Pt("G",Et),Pt("g",Et),Pt("GG",_t,vt),Pt("gg",_t,vt),Pt("GGGG",Ct,bt),Pt("gggg",Ct,bt),Pt("GGGGG",St,wt),Pt("ggggg",St,wt),Yt(["gggg","ggggg","GGGG","GGGGG"],(function(t,e,i,n){e[n.substr(0,2)]=ht(t)})),Yt(["gg","GG"],(function(t,e,n,o){e[o]=i.parseTwoDigitYear(t)})),Y("Q",0,"Qo","quarter"),et("quarter","Q"),st("quarter",7),Pt("Q",gt),jt("Q",(function(t,e){e[Wt]=3*(ht(t)-1)})),Y("D",["DD",2],"Do","date"),et("date","D"),st("date",9),Pt("D",_t),Pt("DD",_t,vt),Pt("Do",(function(t,e){return t?e._dayOfMonthOrdinalParse||e._ordinalParse:e._dayOfMonthOrdinalParseLenient})),jt(["D","DD"],Gt),jt("Do",(function(t,e){e[Gt]=ht(t.match(_t)[0])}));var es=dt("Date",!0);function is(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}Y("DDD",["DDDD",3],"DDDo","dayOfYear"),et("dayOfYear","DDD"),st("dayOfYear",4),Pt("DDD",Dt),Pt("DDDD",yt),jt(["DDD","DDDD"],(function(t,e,i){i._dayOfYear=ht(t)})),Y("m",["mm",2],0,"minute"),et("minute","m"),st("minute",14),Pt("m",_t),Pt("mm",_t,vt),jt(["m","mm"],Ut);var ns=dt("Minutes",!1);Y("s",["ss",2],0,"second"),et("second","s"),st("second",15),Pt("s",_t),Pt("ss",_t,vt),jt(["s","ss"],$t);var os,ss,rs=dt("Seconds",!1);for(Y("S",0,0,(function(){return~~(this.millisecond()/100)})),Y(0,["SS",2],0,(function(){return~~(this.millisecond()/10)})),Y(0,["SSS",3],0,"millisecond"),Y(0,["SSSS",4],0,(function(){return 10*this.millisecond()})),Y(0,["SSSSS",5],0,(function(){return 100*this.millisecond()})),Y(0,["SSSSSS",6],0,(function(){return 1e3*this.millisecond()})),Y(0,["SSSSSSS",7],0,(function(){return 1e4*this.millisecond()})),Y(0,["SSSSSSSS",8],0,(function(){return 1e5*this.millisecond()})),Y(0,["SSSSSSSSS",9],0,(function(){return 1e6*this.millisecond()})),et("millisecond","ms"),st("millisecond",16),Pt("S",Dt,gt),Pt("SS",Dt,vt),Pt("SSS",Dt,yt),os="SSSS";os.length<=9;os+="S")Pt(os,Tt);function as(t,e){e[qt]=ht(1e3*("0."+t))}for(os="S";os.length<=9;os+="S")jt(os,as);function ls(){return this._isUTC?"UTC":""}function hs(){return this._isUTC?"Coordinated Universal Time":""}ss=dt("Milliseconds",!1),Y("z",0,0,"zoneAbbr"),Y("zz",0,0,"zoneName");var ds=_.prototype;function cs(t){return $i(1e3*t)}function us(){return $i.apply(null,arguments).parseZone()}function ps(t){return t}ds.add=Fn,ds.calendar=Wn,ds.clone=Gn,ds.diff=Zn,ds.endOf=bo,ds.format=io,ds.from=no,ds.fromNow=oo,ds.to=so,ds.toNow=ro,ds.get=pt,ds.invalidAt=Eo,ds.isAfter=Vn,ds.isBefore=Un,ds.isBetween=$n,ds.isSame=qn,ds.isSameOrAfter=Xn,ds.isSameOrBefore=Kn,ds.isValid=So,ds.lang=lo,ds.locale=ao,ds.localeData=ho,ds.max=Xi,ds.min=qi,ds.parsingFlags=To,ds.set=mt,ds.startOf=yo,ds.subtract=Rn,ds.toArray=ko,ds.toObject=Do,ds.toDate=xo,ds.toISOString=to,ds.inspect=eo,"undefined"!=typeof Symbol&&null!=Symbol.for&&(ds[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),ds.toJSON=Co,ds.toString=Jn,ds.unix=_o,ds.valueOf=wo,ds.creationData=Mo,ds.eraName=Po,ds.eraNarrow=No,ds.eraAbbr=Fo,ds.eraYear=Ro,ds.year=fe,ds.isLeapYear=ge,ds.weekYear=Uo,ds.isoWeekYear=$o,ds.quarter=ds.quarters=ts,ds.month=he,ds.daysInMonth=de,ds.week=ds.weeks=Te,ds.isoWeek=ds.isoWeeks=Ee,ds.weeksInYear=Ko,ds.weeksInWeekYear=Zo,ds.isoWeeksInYear=qo,ds.isoWeeksInISOWeekYear=Xo,ds.date=es,ds.day=ds.days=We,ds.weekday=Ge,ds.isoWeekday=Ve,ds.dayOfYear=is,ds.hour=ds.hours=ii,ds.minute=ds.minutes=ns,ds.second=ds.seconds=rs,ds.millisecond=ds.milliseconds=ss,ds.utcOffset=mn,ds.utc=gn,ds.local=vn,ds.parseZone=yn,ds.hasAlignedHourOffset=bn,ds.isDST=wn,ds.isLocal=xn,ds.isUtcOffset=kn,ds.isUtc=Dn,ds.isUTC=Dn,ds.zoneAbbr=ls,ds.zoneName=hs,ds.dates=D("dates accessor is deprecated. Use date instead.",es),ds.months=D("months accessor is deprecated. Use month instead",he),ds.years=D("years accessor is deprecated. Use year instead",fe),ds.zone=D("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",fn),ds.isDSTShifted=D("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",_n);var ms=I.prototype;function fs(t,e,i,n){var o=gi(),s=p().set(n,e);return o[i](s,t)}function gs(t,e,i){if(h(t)&&(e=t,t=void 0),t=t||"",null!=e)return fs(t,e,i,"month");var n,o=[];for(n=0;n<12;n++)o[n]=fs(t,n,i,"month");return o}function vs(t,e,i,n){"boolean"==typeof t?(h(e)&&(i=e,e=void 0),e=e||""):(i=e=t,t=!1,h(e)&&(i=e,e=void 0),e=e||"");var o,s=gi(),r=t?s._week.dow:0,a=[];if(null!=i)return fs(e,(i+r)%7,n,"day");for(o=0;o<7;o++)a[o]=fs(e,(o+r)%7,n,"day");return a}function ys(t,e){return gs(t,e,"months")}function bs(t,e){return gs(t,e,"monthsShort")}function ws(t,e,i){return vs(t,e,i,"weekdays")}function _s(t,e,i){return vs(t,e,i,"weekdaysShort")}function xs(t,e,i){return vs(t,e,i,"weekdaysMin")}ms.calendar=P,ms.longDateFormat=V,ms.invalidDate=$,ms.ordinal=K,ms.preparse=ps,ms.postformat=ps,ms.relativeTime=Q,ms.pastFuture=J,ms.set=M,ms.eras=Oo,ms.erasParse=Io,ms.erasConvertYear=Ao,ms.erasAbbrRegex=jo,ms.erasNameRegex=Lo,ms.erasNarrowRegex=Yo,ms.months=oe,ms.monthsShort=se,ms.monthsParse=ae,ms.monthsRegex=ue,ms.monthsShortRegex=ce,ms.week=ke,ms.firstDayOfYear=Se,ms.firstDayOfWeek=Ce,ms.weekdays=je,ms.weekdaysMin=He,ms.weekdaysShort=Ye,ms.weekdaysParse=Be,ms.weekdaysRegex=Ue,ms.weekdaysShortRegex=$e,ms.weekdaysMinRegex=qe,ms.isPM=ti,ms.meridiem=ni,pi("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(t){var e=t%10;return t+(1===ht(t%100/10)?"th":1===e?"st":2===e?"nd":3===e?"rd":"th")}}),i.lang=D("moment.lang is deprecated. Use moment.locale instead.",pi),i.langData=D("moment.langData is deprecated. Use moment.localeData instead.",gi);var ks=Math.abs;function Ds(){var t=this._data;return this._milliseconds=ks(this._milliseconds),this._days=ks(this._days),this._months=ks(this._months),t.milliseconds=ks(t.milliseconds),t.seconds=ks(t.seconds),t.minutes=ks(t.minutes),t.hours=ks(t.hours),t.months=ks(t.months),t.years=ks(t.years),this}function Cs(t,e,i,n){var o=Mn(e,i);return t._milliseconds+=n*o._milliseconds,t._days+=n*o._days,t._months+=n*o._months,t._bubble()}function Ss(t,e){return Cs(this,t,e,1)}function Ts(t,e){return Cs(this,t,e,-1)}function Es(t){return t<0?Math.floor(t):Math.ceil(t)}function Ms(){var t,e,i,n,o,s=this._milliseconds,r=this._days,a=this._months,l=this._data;return s>=0&&r>=0&&a>=0||s<=0&&r<=0&&a<=0||(s+=864e5*Es(Is(a)+r),r=0,a=0),l.milliseconds=s%1e3,t=lt(s/1e3),l.seconds=t%60,e=lt(t/60),l.minutes=e%60,i=lt(e/60),l.hours=i%24,r+=lt(i/24),a+=o=lt(Os(r)),r-=Es(Is(o)),n=lt(a/12),a%=12,l.days=r,l.months=a,l.years=n,this}function Os(t){return 4800*t/146097}function Is(t){return 146097*t/4800}function As(t){if(!this.isValid())return NaN;var e,i,n=this._milliseconds;if("month"===(t=it(t))||"quarter"===t||"year"===t)switch(e=this._days+n/864e5,i=this._months+Os(e),t){case"month":return i;case"quarter":return i/3;case"year":return i/12}else switch(e=this._days+Math.round(Is(this._months)),t){case"week":return e/7+n/6048e5;case"day":return e+n/864e5;case"hour":return 24*e+n/36e5;case"minute":return 1440*e+n/6e4;case"second":return 86400*e+n/1e3;case"millisecond":return Math.floor(864e5*e)+n;default:throw new Error("Unknown unit "+t)}}function Ps(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*ht(this._months/12):NaN}function Ns(t){return function(){return this.as(t)}}var Fs=Ns("ms"),Rs=Ns("s"),Ls=Ns("m"),js=Ns("h"),Ys=Ns("d"),Hs=Ns("w"),zs=Ns("M"),Bs=Ns("Q"),Ws=Ns("y");function Gs(){return Mn(this)}function Vs(t){return t=it(t),this.isValid()?this[t+"s"]():NaN}function Us(t){return function(){return this.isValid()?this._data[t]:NaN}}var $s=Us("milliseconds"),qs=Us("seconds"),Xs=Us("minutes"),Ks=Us("hours"),Zs=Us("days"),Qs=Us("months"),Js=Us("years");function tr(){return lt(this.days()/7)}var er=Math.round,ir={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function nr(t,e,i,n,o){return o.relativeTime(e||1,!!i,t,n)}function or(t,e,i,n){var o=Mn(t).abs(),s=er(o.as("s")),r=er(o.as("m")),a=er(o.as("h")),l=er(o.as("d")),h=er(o.as("M")),d=er(o.as("w")),c=er(o.as("y")),u=s<=i.ss&&["s",s]||s<i.s&&["ss",s]||r<=1&&["m"]||r<i.m&&["mm",r]||a<=1&&["h"]||a<i.h&&["hh",a]||l<=1&&["d"]||l<i.d&&["dd",l];return null!=i.w&&(u=u||d<=1&&["w"]||d<i.w&&["ww",d]),(u=u||h<=1&&["M"]||h<i.M&&["MM",h]||c<=1&&["y"]||["yy",c])[2]=e,u[3]=+t>0,u[4]=n,nr.apply(null,u)}function sr(t){return void 0===t?er:"function"==typeof t&&(er=t,!0)}function rr(t,e){return void 0!==ir[t]&&(void 0===e?ir[t]:(ir[t]=e,"s"===t&&(ir.ss=e-1),!0))}function ar(t,e){if(!this.isValid())return this.localeData().invalidDate();var i,n,o=!1,s=ir;return"object"==typeof t&&(e=t,t=!1),"boolean"==typeof t&&(o=t),"object"==typeof e&&(s=Object.assign({},ir,e),null!=e.s&&null==e.ss&&(s.ss=e.s-1)),n=or(this,!o,s,i=this.localeData()),o&&(n=i.pastFuture(+this,n)),i.postformat(n)}var lr=Math.abs;function hr(t){return(t>0)-(t<0)||+t}function dr(){if(!this.isValid())return this.localeData().invalidDate();var t,e,i,n,o,s,r,a,l=lr(this._milliseconds)/1e3,h=lr(this._days),d=lr(this._months),c=this.asSeconds();return c?(t=lt(l/60),e=lt(t/60),l%=60,t%=60,i=lt(d/12),d%=12,n=l?l.toFixed(3).replace(/\.?0+$/,""):"",o=c<0?"-":"",s=hr(this._months)!==hr(c)?"-":"",r=hr(this._days)!==hr(c)?"-":"",a=hr(this._milliseconds)!==hr(c)?"-":"",o+"P"+(i?s+i+"Y":"")+(d?s+d+"M":"")+(h?r+h+"D":"")+(e||t||l?"T":"")+(e?a+e+"H":"")+(t?a+t+"M":"")+(l?a+n+"S":"")):"P0D"}var cr=sn.prototype;return cr.isValid=nn,cr.abs=Ds,cr.add=Ss,cr.subtract=Ts,cr.as=As,cr.asMilliseconds=Fs,cr.asSeconds=Rs,cr.asMinutes=Ls,cr.asHours=js,cr.asDays=Ys,cr.asWeeks=Hs,cr.asMonths=zs,cr.asQuarters=Bs,cr.asYears=Ws,cr.valueOf=Ps,cr._bubble=Ms,cr.clone=Gs,cr.get=Vs,cr.milliseconds=$s,cr.seconds=qs,cr.minutes=Xs,cr.hours=Ks,cr.days=Zs,cr.weeks=tr,cr.months=Qs,cr.years=Js,cr.humanize=ar,cr.toISOString=dr,cr.toString=dr,cr.toJSON=dr,cr.locale=ao,cr.localeData=ho,cr.toIsoString=D("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",dr),cr.lang=lo,Y("X",0,0,"unix"),Y("x",0,0,"valueOf"),Pt("x",Et),Pt("X",It),jt("X",(function(t,e,i){i._d=new Date(1e3*parseFloat(t))})),jt("x",(function(t,e,i){i._d=new Date(ht(t))})),
//! moment.js
i.version="2.29.4",n($i),i.fn=ds,i.min=Zi,i.max=Qi,i.now=Ji,i.utc=p,i.unix=cs,i.months=ys,i.isDate=d,i.locale=pi,i.invalid=v,i.duration=Mn,i.isMoment=x,i.weekdays=ws,i.parseZone=us,i.localeData=gi,i.isDuration=rn,i.monthsShort=bs,i.weekdaysMin=xs,i.defineLocale=mi,i.updateLocale=fi,i.locales=vi,i.weekdaysShort=_s,i.normalizeUnits=it,i.relativeTimeRounding=sr,i.relativeTimeThreshold=rr,i.calendarFormat=Bn,i.prototype=ds,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}();var Mn=En.exports,On={exports:{}},In={},An={exports:{}},Pn={};function Nn(){var t={"align-content":!1,"align-items":!1,"align-self":!1,"alignment-adjust":!1,"alignment-baseline":!1,all:!1,"anchor-point":!1,animation:!1,"animation-delay":!1,"animation-direction":!1,"animation-duration":!1,"animation-fill-mode":!1,"animation-iteration-count":!1,"animation-name":!1,"animation-play-state":!1,"animation-timing-function":!1,azimuth:!1,"backface-visibility":!1,background:!0,"background-attachment":!0,"background-clip":!0,"background-color":!0,"background-image":!0,"background-origin":!0,"background-position":!0,"background-repeat":!0,"background-size":!0,"baseline-shift":!1,binding:!1,bleed:!1,"bookmark-label":!1,"bookmark-level":!1,"bookmark-state":!1,border:!0,"border-bottom":!0,"border-bottom-color":!0,"border-bottom-left-radius":!0,"border-bottom-right-radius":!0,"border-bottom-style":!0,"border-bottom-width":!0,"border-collapse":!0,"border-color":!0,"border-image":!0,"border-image-outset":!0,"border-image-repeat":!0,"border-image-slice":!0,"border-image-source":!0,"border-image-width":!0,"border-left":!0,"border-left-color":!0,"border-left-style":!0,"border-left-width":!0,"border-radius":!0,"border-right":!0,"border-right-color":!0,"border-right-style":!0,"border-right-width":!0,"border-spacing":!0,"border-style":!0,"border-top":!0,"border-top-color":!0,"border-top-left-radius":!0,"border-top-right-radius":!0,"border-top-style":!0,"border-top-width":!0,"border-width":!0,bottom:!1,"box-decoration-break":!0,"box-shadow":!0,"box-sizing":!0,"box-snap":!0,"box-suppress":!0,"break-after":!0,"break-before":!0,"break-inside":!0,"caption-side":!1,chains:!1,clear:!0,clip:!1,"clip-path":!1,"clip-rule":!1,color:!0,"color-interpolation-filters":!0,"column-count":!1,"column-fill":!1,"column-gap":!1,"column-rule":!1,"column-rule-color":!1,"column-rule-style":!1,"column-rule-width":!1,"column-span":!1,"column-width":!1,columns:!1,contain:!1,content:!1,"counter-increment":!1,"counter-reset":!1,"counter-set":!1,crop:!1,cue:!1,"cue-after":!1,"cue-before":!1,cursor:!1,direction:!1,display:!0,"display-inside":!0,"display-list":!0,"display-outside":!0,"dominant-baseline":!1,elevation:!1,"empty-cells":!1,filter:!1,flex:!1,"flex-basis":!1,"flex-direction":!1,"flex-flow":!1,"flex-grow":!1,"flex-shrink":!1,"flex-wrap":!1,float:!1,"float-offset":!1,"flood-color":!1,"flood-opacity":!1,"flow-from":!1,"flow-into":!1,font:!0,"font-family":!0,"font-feature-settings":!0,"font-kerning":!0,"font-language-override":!0,"font-size":!0,"font-size-adjust":!0,"font-stretch":!0,"font-style":!0,"font-synthesis":!0,"font-variant":!0,"font-variant-alternates":!0,"font-variant-caps":!0,"font-variant-east-asian":!0,"font-variant-ligatures":!0,"font-variant-numeric":!0,"font-variant-position":!0,"font-weight":!0,grid:!1,"grid-area":!1,"grid-auto-columns":!1,"grid-auto-flow":!1,"grid-auto-rows":!1,"grid-column":!1,"grid-column-end":!1,"grid-column-start":!1,"grid-row":!1,"grid-row-end":!1,"grid-row-start":!1,"grid-template":!1,"grid-template-areas":!1,"grid-template-columns":!1,"grid-template-rows":!1,"hanging-punctuation":!1,height:!0,hyphens:!1,icon:!1,"image-orientation":!1,"image-resolution":!1,"ime-mode":!1,"initial-letters":!1,"inline-box-align":!1,"justify-content":!1,"justify-items":!1,"justify-self":!1,left:!1,"letter-spacing":!0,"lighting-color":!0,"line-box-contain":!1,"line-break":!1,"line-grid":!1,"line-height":!1,"line-snap":!1,"line-stacking":!1,"line-stacking-ruby":!1,"line-stacking-shift":!1,"line-stacking-strategy":!1,"list-style":!0,"list-style-image":!0,"list-style-position":!0,"list-style-type":!0,margin:!0,"margin-bottom":!0,"margin-left":!0,"margin-right":!0,"margin-top":!0,"marker-offset":!1,"marker-side":!1,marks:!1,mask:!1,"mask-box":!1,"mask-box-outset":!1,"mask-box-repeat":!1,"mask-box-slice":!1,"mask-box-source":!1,"mask-box-width":!1,"mask-clip":!1,"mask-image":!1,"mask-origin":!1,"mask-position":!1,"mask-repeat":!1,"mask-size":!1,"mask-source-type":!1,"mask-type":!1,"max-height":!0,"max-lines":!1,"max-width":!0,"min-height":!0,"min-width":!0,"move-to":!1,"nav-down":!1,"nav-index":!1,"nav-left":!1,"nav-right":!1,"nav-up":!1,"object-fit":!1,"object-position":!1,opacity:!1,order:!1,orphans:!1,outline:!1,"outline-color":!1,"outline-offset":!1,"outline-style":!1,"outline-width":!1,overflow:!1,"overflow-wrap":!1,"overflow-x":!1,"overflow-y":!1,padding:!0,"padding-bottom":!0,"padding-left":!0,"padding-right":!0,"padding-top":!0,page:!1,"page-break-after":!1,"page-break-before":!1,"page-break-inside":!1,"page-policy":!1,pause:!1,"pause-after":!1,"pause-before":!1,perspective:!1,"perspective-origin":!1,pitch:!1,"pitch-range":!1,"play-during":!1,position:!1,"presentation-level":!1,quotes:!1,"region-fragment":!1,resize:!1,rest:!1,"rest-after":!1,"rest-before":!1,richness:!1,right:!1,rotation:!1,"rotation-point":!1,"ruby-align":!1,"ruby-merge":!1,"ruby-position":!1,"shape-image-threshold":!1,"shape-outside":!1,"shape-margin":!1,size:!1,speak:!1,"speak-as":!1,"speak-header":!1,"speak-numeral":!1,"speak-punctuation":!1,"speech-rate":!1,stress:!1,"string-set":!1,"tab-size":!1,"table-layout":!1,"text-align":!0,"text-align-last":!0,"text-combine-upright":!0,"text-decoration":!0,"text-decoration-color":!0,"text-decoration-line":!0,"text-decoration-skip":!0,"text-decoration-style":!0,"text-emphasis":!0,"text-emphasis-color":!0,"text-emphasis-position":!0,"text-emphasis-style":!0,"text-height":!0,"text-indent":!0,"text-justify":!0,"text-orientation":!0,"text-overflow":!0,"text-shadow":!0,"text-space-collapse":!0,"text-transform":!0,"text-underline-position":!0,"text-wrap":!0,top:!1,transform:!1,"transform-origin":!1,"transform-style":!1,transition:!1,"transition-delay":!1,"transition-duration":!1,"transition-property":!1,"transition-timing-function":!1,"unicode-bidi":!1,"vertical-align":!1,visibility:!1,"voice-balance":!1,"voice-duration":!1,"voice-family":!1,"voice-pitch":!1,"voice-range":!1,"voice-rate":!1,"voice-stress":!1,"voice-volume":!1,volume:!1,"white-space":!1,widows:!1,width:!0,"will-change":!1,"word-break":!0,"word-spacing":!0,"word-wrap":!0,"wrap-flow":!1,"wrap-through":!1,"writing-mode":!1,"z-index":!1};return t}var Fn=/javascript\s*\:/gim;Pn.whiteList=Nn(),Pn.getDefaultWhiteList=Nn,Pn.onAttr=function(t,e,i){},Pn.onIgnoreAttr=function(t,e,i){},Pn.safeAttrValue=function(t,e){return Fn.test(e)?"":e};var Rn={indexOf:function(t,e){var i,n;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},forEach:function(t,e,i){var n,o;if(Array.prototype.forEach)return t.forEach(e,i);for(n=0,o=t.length;n<o;n++)e.call(i,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},trimRight:function(t){return String.prototype.trimRight?t.trimRight():t.replace(/(\s*$)/g,"")}};var Ln=function(t,e){";"!==(t=Rn.trimRight(t))[t.length-1]&&(t+=";");var i=t.length,n=!1,o=0,s=0,r="";function a(){if(!n){var i=Rn.trim(t.slice(o,s)),a=i.indexOf(":");if(-1!==a){var l=Rn.trim(i.slice(0,a)),h=Rn.trim(i.slice(a+1));if(l){var d=e(o,r.length,l,h,i);d&&(r+=d+"; ")}}}o=s+1}for(;s<i;s++){var l=t[s];if("/"===l&&"*"===t[s+1]){var h=t.indexOf("*/",s+2);if(-1===h)break;o=(s=h+1)+1,n=!1}else"("===l?n=!0:")"===l?n=!1:";"===l?n||a():"\n"===l&&a()}return Rn.trim(r)},jn=Pn,Yn=Ln;function Hn(t){return null==t}function zn(t){(t=function(t){var e={};for(var i in t)e[i]=t[i];return e}(t||{})).whiteList=t.whiteList||jn.whiteList,t.onAttr=t.onAttr||jn.onAttr,t.onIgnoreAttr=t.onIgnoreAttr||jn.onIgnoreAttr,t.safeAttrValue=t.safeAttrValue||jn.safeAttrValue,this.options=t}zn.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,i=e.whiteList,n=e.onAttr,o=e.onIgnoreAttr,s=e.safeAttrValue;return Yn(t,(function(t,e,r,a,l){var h=i[r],d=!1;if(!0===h?d=h:"function"==typeof h?d=h(a):h instanceof RegExp&&(d=h.test(a)),!0!==d&&(d=!1),a=s(r,a)){var c,u={position:e,sourcePosition:t,source:l,isWhite:d};return d?Hn(c=n(r,a,u))?r+":"+a:c:Hn(c=o(r,a,u))?void 0:c}}))};var Bn=zn;!function(t,e){var i=Pn,n=Bn;for(var o in(e=t.exports=function(t,e){return new n(e).process(t)}).FilterCSS=n,i)e[o]=i[o];"undefined"!=typeof window&&(window.filterCSS=t.exports)}(An,An.exports);var Wn={indexOf:function(t,e){var i,n;if(Array.prototype.indexOf)return t.indexOf(e);for(i=0,n=t.length;i<n;i++)if(t[i]===e)return i;return-1},forEach:function(t,e,i){var n,o;if(Array.prototype.forEach)return t.forEach(e,i);for(n=0,o=t.length;n<o;n++)e.call(i,t[n],n,t)},trim:function(t){return String.prototype.trim?t.trim():t.replace(/(^\s*)|(\s*$)/g,"")},spaceIndex:function(t){var e=/\s|\n|\t/.exec(t);return e?e.index:-1}},Gn=An.exports.FilterCSS,Vn=An.exports.getDefaultWhiteList,Un=Wn;function $n(){return{a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]}}var qn=new Gn;function Xn(t){return t.replace(Kn,"&lt;").replace(Zn,"&gt;")}var Kn=/</g,Zn=/>/g,Qn=/"/g,Jn=/&quot;/g,to=/&#([a-zA-Z0-9]*);?/gim,eo=/&colon;?/gim,io=/&newline;?/gim,no=/((j\s*a\s*v\s*a|v\s*b|l\s*i\s*v\s*e)\s*s\s*c\s*r\s*i\s*p\s*t\s*|m\s*o\s*c\s*h\s*a):/gi,oo=/e\s*x\s*p\s*r\s*e\s*s\s*s\s*i\s*o\s*n\s*\(.*/gi,so=/u\s*r\s*l\s*\(.*/gi;function ro(t){return t.replace(Qn,"&quot;")}function ao(t){return t.replace(Jn,'"')}function lo(t){return t.replace(to,(function(t,e){return"x"===e[0]||"X"===e[0]?String.fromCharCode(parseInt(e.substr(1),16)):String.fromCharCode(parseInt(e,10))}))}function ho(t){return t.replace(eo,":").replace(io," ")}function co(t){for(var e="",i=0,n=t.length;i<n;i++)e+=t.charCodeAt(i)<32?" ":t.charAt(i);return Un.trim(e)}function uo(t){return t=co(t=ho(t=lo(t=ao(t))))}function po(t){return t=Xn(t=ro(t))}In.whiteList={a:["target","href","title"],abbr:["title"],address:[],area:["shape","coords","href","alt"],article:[],aside:[],audio:["autoplay","controls","crossorigin","loop","muted","preload","src"],b:[],bdi:["dir"],bdo:["dir"],big:[],blockquote:["cite"],br:[],caption:[],center:[],cite:[],code:[],col:["align","valign","span","width"],colgroup:["align","valign","span","width"],dd:[],del:["datetime"],details:["open"],div:[],dl:[],dt:[],em:[],figcaption:[],figure:[],font:["color","size","face"],footer:[],h1:[],h2:[],h3:[],h4:[],h5:[],h6:[],header:[],hr:[],i:[],img:["src","alt","title","width","height"],ins:["datetime"],li:[],mark:[],nav:[],ol:[],p:[],pre:[],s:[],section:[],small:[],span:[],sub:[],summary:[],sup:[],strong:[],strike:[],table:["width","border","align","valign"],tbody:["align","valign"],td:["width","rowspan","colspan","align","valign"],tfoot:["align","valign"],th:["width","rowspan","colspan","align","valign"],thead:["align","valign"],tr:["rowspan","align","valign"],tt:[],u:[],ul:[],video:["autoplay","controls","crossorigin","loop","muted","playsinline","poster","preload","src","height","width"]},In.getDefaultWhiteList=$n,In.onTag=function(t,e,i){},In.onIgnoreTag=function(t,e,i){},In.onTagAttr=function(t,e,i){},In.onIgnoreTagAttr=function(t,e,i){},In.safeAttrValue=function(t,e,i,n){if(i=uo(i),"href"===e||"src"===e){if("#"===(i=Un.trim(i)))return"#";if("http://"!==i.substr(0,7)&&"https://"!==i.substr(0,8)&&"mailto:"!==i.substr(0,7)&&"tel:"!==i.substr(0,4)&&"data:image/"!==i.substr(0,11)&&"ftp://"!==i.substr(0,6)&&"./"!==i.substr(0,2)&&"../"!==i.substr(0,3)&&"#"!==i[0]&&"/"!==i[0])return""}else if("background"===e){if(no.lastIndex=0,no.test(i))return""}else if("style"===e){if(oo.lastIndex=0,oo.test(i))return"";if(so.lastIndex=0,so.test(i)&&(no.lastIndex=0,no.test(i)))return"";!1!==n&&(i=(n=n||qn).process(i))}return i=po(i)},In.escapeHtml=Xn,In.escapeQuote=ro,In.unescapeQuote=ao,In.escapeHtmlEntities=lo,In.escapeDangerHtml5Entities=ho,In.clearNonPrintableCharacter=co,In.friendlyAttrValue=uo,In.escapeAttrValue=po,In.onIgnoreTagStripAll=function(){return""},In.StripTagBody=function(t,e){"function"!=typeof e&&(e=function(){});var i=!Array.isArray(t),n=[],o=!1;return{onIgnoreTag:function(s,r,a){if(function(e){return!!i||-1!==Un.indexOf(t,e)}(s)){if(a.isClosing){var l="[/removed]",h=a.position+l.length;return n.push([!1!==o?o:a.position,h]),o=!1,l}return o||(o=a.position),"[removed]"}return e(s,r,a)},remove:function(t){var e="",i=0;return Un.forEach(n,(function(n){e+=t.slice(i,n[0]),i=n[1]})),e+=t.slice(i)}}},In.stripCommentTag=function(t){for(var e="",i=0;i<t.length;){var n=t.indexOf("\x3c!--",i);if(-1===n){e+=t.slice(i);break}e+=t.slice(i,n);var o=t.indexOf("--\x3e",n);if(-1===o)break;i=o+3}return e},In.stripBlankChar=function(t){var e=t.split("");return(e=e.filter((function(t){var e=t.charCodeAt(0);return 127!==e&&(!(e<=31)||(10===e||13===e))}))).join("")},In.cssFilter=qn,In.getDefaultCSSWhiteList=Vn;var mo={},fo=Wn;function go(t){var e,i=fo.spaceIndex(t);return e=-1===i?t.slice(1,-1):t.slice(1,i+1),"/"===(e=fo.trim(e).toLowerCase()).slice(0,1)&&(e=e.slice(1)),"/"===e.slice(-1)&&(e=e.slice(0,-1)),e}function vo(t){return"</"===t.slice(0,2)}var yo=/[^a-zA-Z0-9\\_:.-]/gim;function bo(t,e){for(;e<t.length;e++){var i=t[e];if(" "!==i)return"="===i?e:-1}}function wo(t,e){for(;e<t.length;e++){var i=t[e];if(" "!==i)return"'"===i||'"'===i?e:-1}}function _o(t,e){for(;e>0;e--){var i=t[e];if(" "!==i)return"="===i?e:-1}}function xo(t){return function(t){return'"'===t[0]&&'"'===t[t.length-1]||"'"===t[0]&&"'"===t[t.length-1]}(t)?t.substr(1,t.length-2):t}mo.parseTag=function(t,e,i){var n="",o=0,s=!1,r=!1,a=0,l=t.length,h="",d="";t:for(a=0;a<l;a++){var c=t.charAt(a);if(!1===s){if("<"===c){s=a;continue}}else if(!1===r){if("<"===c){n+=i(t.slice(o,a)),s=a,o=a;continue}if(">"===c||a===l-1){n+=i(t.slice(o,s)),h=go(d=t.slice(s,a+1)),n+=e(s,n.length,h,d,vo(d)),o=a+1,s=!1;continue}if('"'===c||"'"===c)for(var u=1,p=t.charAt(a-u);""===p.trim()||"="===p;){if("="===p){r=c;continue t}p=t.charAt(a-++u)}}else if(c===r){r=!1;continue}}return o<l&&(n+=i(t.substr(o))),n},mo.parseAttr=function(t,e){var i=0,n=0,o=[],s=!1,r=t.length;function a(t,i){if(!((t=(t=fo.trim(t)).replace(yo,"").toLowerCase()).length<1)){var n=e(t,i||"");n&&o.push(n)}}for(var l=0;l<r;l++){var h,d=t.charAt(l);if(!1!==s||"="!==d)if(!1===s||l!==n)if(/\s|\n|\t/.test(d)){if(t=t.replace(/\s|\n|\t/g," "),!1===s){if(-1===(h=bo(t,l))){a(fo.trim(t.slice(i,l))),s=!1,i=l+1;continue}l=h-1;continue}if(-1===(h=_o(t,l-1))){a(s,xo(fo.trim(t.slice(i,l)))),s=!1,i=l+1;continue}}else;else{if(-1===(h=t.indexOf(d,l+1)))break;a(s,fo.trim(t.slice(n+1,h))),s=!1,i=(l=h)+1}else s=t.slice(i,l),i=l+1,n='"'===t.charAt(i)||"'"===t.charAt(i)?i:wo(t,l+1)}return i<t.length&&(!1===s?a(t.slice(i)):a(s,xo(fo.trim(t.slice(i))))),fo.trim(o.join(" "))};var ko=An.exports.FilterCSS,Do=In,Co=mo,So=Co.parseTag,To=Co.parseAttr,Eo=Wn;function Mo(t){return null==t}function Oo(t){(t=function(t){var e={};for(var i in t)e[i]=t[i];return e}(t||{})).stripIgnoreTag&&(t.onIgnoreTag&&console.error('Notes: cannot use these two options "stripIgnoreTag" and "onIgnoreTag" at the same time'),t.onIgnoreTag=Do.onIgnoreTagStripAll),t.whiteList||t.allowList?t.whiteList=function(t){var e={};for(var i in t)Array.isArray(t[i])?e[i.toLowerCase()]=t[i].map((function(t){return t.toLowerCase()})):e[i.toLowerCase()]=t[i];return e}(t.whiteList||t.allowList):t.whiteList=Do.whiteList,t.onTag=t.onTag||Do.onTag,t.onTagAttr=t.onTagAttr||Do.onTagAttr,t.onIgnoreTag=t.onIgnoreTag||Do.onIgnoreTag,t.onIgnoreTagAttr=t.onIgnoreTagAttr||Do.onIgnoreTagAttr,t.safeAttrValue=t.safeAttrValue||Do.safeAttrValue,t.escapeHtml=t.escapeHtml||Do.escapeHtml,this.options=t,!1===t.css?this.cssFilter=!1:(t.css=t.css||{},this.cssFilter=new ko(t.css))}Oo.prototype.process=function(t){if(!(t=(t=t||"").toString()))return"";var e=this.options,i=e.whiteList,n=e.onTag,o=e.onIgnoreTag,s=e.onTagAttr,r=e.onIgnoreTagAttr,a=e.safeAttrValue,l=e.escapeHtml,h=this.cssFilter;e.stripBlankChar&&(t=Do.stripBlankChar(t)),e.allowCommentTag||(t=Do.stripCommentTag(t));var d=!1;e.stripIgnoreTagBody&&(d=Do.StripTagBody(e.stripIgnoreTagBody,o),o=d.onIgnoreTag);var c=So(t,(function(t,e,d,c,u){var p={sourcePosition:t,position:e,isClosing:u,isWhite:Object.prototype.hasOwnProperty.call(i,d)},m=n(d,c,p);if(!Mo(m))return m;if(p.isWhite){if(p.isClosing)return"</"+d+">";var f=function(t){var e=Eo.spaceIndex(t);if(-1===e)return{html:"",closing:"/"===t[t.length-2]};var i="/"===(t=Eo.trim(t.slice(e+1,-1)))[t.length-1];return i&&(t=Eo.trim(t.slice(0,-1))),{html:t,closing:i}}(c),g=i[d],v=To(f.html,(function(t,e){var i=-1!==Eo.indexOf(g,t),n=s(d,t,e,i);return Mo(n)?i?(e=a(d,t,e,h))?t+'="'+e+'"':t:Mo(n=r(d,t,e,i))?void 0:n:n}));return c="<"+d,v&&(c+=" "+v),f.closing&&(c+=" /"),c+=">"}return Mo(m=o(d,c,p))?l(c):m}),l);return d&&(c=d.remove(c)),c};var Io=Oo;!function(t,e){var i=In,n=mo,o=Io;function s(t,e){return new o(e).process(t)}(e=t.exports=s).filterXSS=s,e.FilterXSS=o,function(){for(var t in i)e[t]=i[t];for(var o in n)e[o]=n[o]}(),"undefined"!=typeof window&&(window.filterXSS=t.exports),"undefined"!=typeof self&&"undefined"!=typeof DedicatedWorkerGlobalScope&&self instanceof DedicatedWorkerGlobalScope&&(self.filterXSS=t.exports)}(On,On.exports);var Ao=On.exports,Po=null;
/**
* vis-timeline and vis-graph2d
* https://visjs.github.io/vis-timeline/
*
* Create a fully customizable, interactive timeline with items and ranges.
*
* @version 7.7.0
* @date 2022-07-10T21:34:08.601Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
var No="undefined"!=typeof window&&window.moment||Mn;function Fo(t){if(!t)return!1;let e=t.idProp??t._idProp;return!!e&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.forEach&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof e.map&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.stream&&function(t,e){return"object"==typeof e&&null!==e&&t===e.idProp&&"function"==typeof e.add&&"function"==typeof e.clear&&"function"==typeof e.distinct&&"function"==typeof e.forEach&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof e.map&&"function"==typeof e.max&&"function"==typeof e.min&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.remove&&"function"==typeof e.setOptions&&"function"==typeof e.stream&&"function"==typeof e.update&&"function"==typeof e.updateOnly}(t,e.getDataSet())}(e,t)}const Ro=/^\/?Date\((-?\d+)/i,Lo=/^\d+$/;function jo(t,e){let i;if(void 0!==t){if(null===t)return null;if(!e)return t;if("string"!=typeof e&&!(e instanceof String))throw new Error("Type must be a string");switch(e){case"boolean":case"Boolean":return Boolean(t);case"number":case"Number":return pi(t)&&!isNaN(Date.parse(t))?Mn(t).valueOf():Number(t.valueOf());case"string":case"String":return String(t);case"Date":try{return jo(t,"Moment").toDate()}catch(i){throw i instanceof TypeError?new TypeError("Cannot convert object of type "+yi(t)+" to type "+e):i}case"Moment":if(ui(t))return Mn(t);if(t instanceof Date)return Mn(t.valueOf());if(Mn.isMoment(t))return Mn(t);if(pi(t))return i=Ro.exec(t),i?Mn(Number(i[1])):(i=Lo.exec(t),Mn(i?Number(t):t));throw new TypeError("Cannot convert object of type "+yi(t)+" to type "+e);case"ISODate":if(ui(t))return new Date(t);if(t instanceof Date)return t.toISOString();if(Mn.isMoment(t))return t.toDate().toISOString();if(pi(t))return i=Ro.exec(t),i?new Date(Number(i[1])).toISOString():Mn(t).format();throw new Error("Cannot convert object of type "+yi(t)+" to type ISODate");case"ASPDate":if(ui(t))return"/Date("+t+")/";if(t instanceof Date||Mn.isMoment(t))return"/Date("+t.valueOf()+")/";if(pi(t)){let e;return i=Ro.exec(t),e=i?new Date(Number(i[1])).valueOf():new Date(t).valueOf(),"/Date("+e+")/"}throw new Error("Cannot convert object of type "+yi(t)+" to type ASPDate");default:throw new Error(`Unknown type ${e}`)}}}function Yo(t,e={start:"Date",end:"Date"}){const i=t._idProp,n=new Dn({fieldId:i}),o=(s=t,new bn(s)).map((t=>Object.keys(t).reduce(((i,n)=>(i[n]=jo(t[n],e[n]),i)),{}))).to(n);
/**
* vis-data
* http://visjs.org/
*
* Manage unstructured data using DataSet. Add, update, and remove data, and listen for changes in the data.
*
* @version 7.1.4
* @date 2022-03-15T15:23:59.245Z
*
* @copyright (c) 2011-2017 Almende B.V, http://almende.com
* @copyright (c) 2017-2019 visjs contributors, https://github.com/visjs
*
* @license
* vis.js is dual licensed under both
*
* 1. The Apache 2.0 License
* http://www.apache.org/licenses/LICENSE-2.0
*
* and
*
* 2. The MIT License
* http://opensource.org/licenses/MIT
*
* vis.js may be distributed under either license.
*/
var s;return o.all().start(),{add:(...e)=>t.getDataSet().add(...e),remove:(...e)=>t.getDataSet().remove(...e),update:(...e)=>t.getDataSet().update(...e),updateOnly:(...e)=>t.getDataSet().updateOnly(...e),clear:(...e)=>t.getDataSet().clear(...e),forEach:n.forEach.bind(n),get:n.get.bind(n),getIds:n.getIds.bind(n),off:n.off.bind(n),on:n.on.bind(n),get length(){return n.length},idProp:i,type:e,rawDS:t,coercedDS:n,dispose:()=>o.stop()}}const Ho=t=>{const e=new Ao.FilterXSS(t);return t=>e.process(t)},zo=t=>t;let Bo=Ho();const Wo={...Ki,convert:jo,setupXSSProtection:t=>{t&&(!0===t.disabled?(Bo=zo,console.warn("You disabled XSS protection for vis-Timeline. I sure hope you know what you're doing!")):t.filterOptions&&(Bo=Ho(t.filterOptions)))}};Object.defineProperty(Wo,"xss",{get:function(){return Bo}});class Go{constructor(t,e){this.options=null,this.props=null}setOptions(t){t&&Wo.extend(this.options,t)}redraw(){return!1}destroy(){}_isResized(){const t=this.props._previousWidth!==this.props.width||this.props._previousHeight!==this.props.height;return this.props._previousWidth=this.props.width,this.props._previousHeight=this.props.height,t}}function Vo(t,e,i){if(i&&!Array.isArray(i))return Vo(t,e,[i]);if(e.hiddenDates=[],i&&1==Array.isArray(i)){for(let n=0;n<i.length;n++)if(void 0===i[n].repeat){const o={};o.start=t(i[n].start).toDate().valueOf(),o.end=t(i[n].end).toDate().valueOf(),e.hiddenDates.push(o)}e.hiddenDates.sort(((t,e)=>t.start-e.start))}}function Uo(t,e,i){if(i&&!Array.isArray(i))return Uo(t,e,[i]);if(i&&void 0!==e.domProps.centerContainer.width){Vo(t,e,i);const n=t(e.range.start),o=t(e.range.end),s=(e.range.end-e.range.start)/e.domProps.centerContainer.width;for(let r=0;r<i.length;r++)if(void 0!==i[r].repeat){const a=t(i[r].start);let l=t(i[r].end);if("Invalid Date"==a._d)throw new Error(`Supplied start date is not valid: ${i[r].start}`);if("Invalid Date"==l._d)throw new Error(`Supplied end date is not valid: ${i[r].end}`);if(l-a>=4*s){let t=0;const s=o.clone();switch(i[r].repeat){case"daily":a.day()!=l.day()&&(t=1),a.dayOfYear(n.dayOfYear()),a.year(n.year()),a.subtract(7,"days"),l.dayOfYear(n.dayOfYear()),l.year(n.year()),l.subtract(7-t,"days"),s.add(1,"weeks");break;case"weekly":{const t=l.diff(a,"days"),e=a.day();a.date(n.date()),a.month(n.month()),a.year(n.year()),l=a.clone(),a.day(e),l.day(e),l.add(t,"days"),a.subtract(1,"weeks"),l.subtract(1,"weeks"),s.add(1,"weeks");break}case"monthly":a.month()!=l.month()&&(t=1),a.month(n.month()),a.year(n.year()),a.subtract(1,"months"),l.month(n.month()),l.year(n.year()),l.subtract(1,"months"),l.add(t,"months"),s.add(1,"months");break;case"yearly":a.year()!=l.year()&&(t=1),a.year(n.year()),a.subtract(1,"years"),l.year(n.year()),l.subtract(1,"years"),l.add(t,"years"),s.add(1,"years");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[r].repeat)}for(;a<s;)switch(e.hiddenDates.push({start:a.valueOf(),end:l.valueOf()}),i[r].repeat){case"daily":a.add(1,"days"),l.add(1,"days");break;case"weekly":a.add(1,"weeks"),l.add(1,"weeks");break;case"monthly":a.add(1,"months"),l.add(1,"months");break;case"yearly":a.add(1,"y"),l.add(1,"y");break;default:return void console.log("Wrong repeat format, allowed are: daily, weekly, monthly, yearly. Given:",i[r].repeat)}e.hiddenDates.push({start:a.valueOf(),end:l.valueOf()})}}!function(t){const e=t.hiddenDates,i=[];for(var n=0;n<e.length;n++)for(let t=0;t<e.length;t++)n!=t&&1!=e[t].remove&&1!=e[n].remove&&(e[t].start>=e[n].start&&e[t].end<=e[n].end?e[t].remove=!0:e[t].start>=e[n].start&&e[t].start<=e[n].end?(e[n].end=e[t].end,e[t].remove=!0):e[t].end>=e[n].start&&e[t].end<=e[n].end&&(e[n].start=e[t].start,e[t].remove=!0));for(n=0;n<e.length;n++)!0!==e[n].remove&&i.push(e[n]);t.hiddenDates=i,t.hiddenDates.sort(((t,e)=>t.start-e.start))}(e);const r=Jo(e.range.start,e.hiddenDates),a=Jo(e.range.end,e.hiddenDates);let l=e.range.start,h=e.range.end;1==r.hidden&&(l=1==e.range.startToFront?r.startDate-1:r.endDate+1),1==a.hidden&&(h=1==e.range.endToFront?a.startDate-1:a.endDate+1),1!=r.hidden&&1!=a.hidden||e.range._applyRange(l,h)}}function $o(t,e,i){let n;if(0==t.body.hiddenDates.length)return n=t.range.conversion(i),(e.valueOf()-n.offset)*n.scale;{const o=Jo(e,t.body.hiddenDates);1==o.hidden&&(e=o.startDate);const s=Xo(t.body.hiddenDates,t.range.start,t.range.end);if(e<t.range.start){n=t.range.conversion(i,s);const o=function(t,e,i){let n=0;for(let o=0;o<t.length;o++){const s=t[o].start,r=t[o].end;s>=e&&r<=i&&(n+=r-s)}return n}(t.body.hiddenDates,e,n.offset);return e=t.options.moment(e).toDate().valueOf(),e+=o,-(n.offset-e.valueOf())*n.scale}if(e>t.range.end){const o={start:t.range.start,end:e};return e=Ko(t.options.moment,t.body.hiddenDates,o,e),n=t.range.conversion(i,s),(e.valueOf()-n.offset)*n.scale}return e=Ko(t.options.moment,t.body.hiddenDates,t.range,e),n=t.range.conversion(i,s),(e.valueOf()-n.offset)*n.scale}}function qo(t,e,i){if(0==t.body.hiddenDates.length){const n=t.range.conversion(i);return new Date(e/n.scale+n.offset)}{const n=Xo(t.body.hiddenDates,t.range.start,t.range.end),o=(t.range.end-t.range.start-n)*e/i,s=function(t,e,i){let n=0,o=0,s=e.start;for(let r=0;r<t.length;r++){const a=t[r].start,l=t[r].end;if(a>=e.start&&l<e.end){if(o+=a-s,s=l,o>=i)break;n+=l-a}}return n}(t.body.hiddenDates,t.range,o);return new Date(s+o+t.range.start)}}function Xo(t,e,i){let n=0;for(let o=0;o<t.length;o++){const s=t[o].start,r=t[o].end;s>=e&&r<i&&(n+=r-s)}return n}function Ko(t,e,i,n){return n=t(n).toDate().valueOf(),n-=Zo(t,e,i,n)}function Zo(t,e,i,n){let o=0;n=t(n).toDate().valueOf();for(let t=0;t<e.length;t++){const s=e[t].start,r=e[t].end;s>=i.start&&r<i.end&&n>=r&&(o+=r-s)}return o}function Qo(t,e,i,n){const o=Jo(e,t);return 1==o.hidden?i<0?1==n?o.startDate-(o.endDate-e)-1:o.startDate-1:1==n?o.endDate+(e-o.startDate)+1:o.endDate+1:e}function Jo(t,e){for(let o=0;o<e.length;o++){var i=e[o].start,n=e[o].end;if(t>=i&&t<n)return{hidden:!0,startDate:i,endDate:n}}return{hidden:!1,startDate:i,endDate:n}}class ts extends Go{constructor(t,e){super();const i=No().hours(0).minutes(0).seconds(0).milliseconds(0),n=i.clone().add(-3,"days").valueOf(),o=i.clone().add(3,"days").valueOf();this.millisecondsPerPixelCache=void 0,void 0===e?(this.start=n,this.end=o):(this.start=e.start||n,this.end=e.end||o),this.rolling=!1,this.body=t,this.deltaDifference=0,this.scaleOffset=0,this.startToFront=!1,this.endToFront=!0,this.defaultOptions={rtl:!1,start:null,end:null,moment:No,direction:"horizontal",moveable:!0,zoomable:!0,min:null,max:null,zoomMin:10,zoomMax:31536e10,rollingMode:{follow:!1,offset:.5}},this.options=Wo.extend({},this.defaultOptions),this.props={touch:{}},this.animationTimer=null,this.body.emitter.on("panstart",this._onDragStart.bind(this)),this.body.emitter.on("panmove",this._onDrag.bind(this)),this.body.emitter.on("panend",this._onDragEnd.bind(this)),this.body.emitter.on("mousewheel",this._onMouseWheel.bind(this)),this.body.emitter.on("touch",this._onTouch.bind(this)),this.body.emitter.on("pinch",this._onPinch.bind(this)),this.body.dom.rollingModeBtn.addEventListener("click",this.startRolling.bind(this)),this.setOptions(e)}setOptions(t){if(t){const e=["animation","direction","min","max","zoomMin","zoomMax","moveable","zoomable","moment","activate","hiddenDates","zoomKey","zoomFriction","rtl","showCurrentTime","rollingMode","horizontalScroll"];Wo.selectiveExtend(e,this.options,t),t.rollingMode&&t.rollingMode.follow&&this.startRolling(),("start"in t||"end"in t)&&this.setRange(t.start,t.end)}}startRolling(){const t=this;!function e(){t.stopRolling(),t.rolling=!0;let i=t.end-t.start;const n=Wo.convert(new Date,"Date").valueOf(),o=t.options.rollingMode&&t.options.rollingMode.offset||.5,s=n-i*o,r=n+i*(1-o);t.setRange(s,r,{animation:!1}),i=1/t.conversion(t.body.domProps.center.width).scale/10,i<30&&(i=30),i>1e3&&(i=1e3),t.body.dom.rollingModeBtn.style.visibility="hidden",t.currentTimeTimer=setTimeout(e,i)}()}stopRolling(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),this.rolling=!1,this.body.dom.rollingModeBtn.style.visibility="visible")}setRange(t,e,i,n,o){i||(i={}),!0!==i.byUser&&(i.byUser=!1);const s=this,r=null!=t?Wo.convert(t,"Date").valueOf():null,a=null!=e?Wo.convert(e,"Date").valueOf():null;if(this._cancelAnimation(),this.millisecondsPerPixelCache=void 0,i.animation){const t=this.start,e=this.end,h="object"==typeof i.animation&&"duration"in i.animation?i.animation.duration:500,d="object"==typeof i.animation&&"easingFunction"in i.animation?i.animation.easingFunction:"easeInOutQuad",c=Wo.easingFunctions[d];if(!c)throw new Error(`Unknown easing function ${JSON.stringify(d)}. Choose from: ${Object.keys(Wo.easingFunctions).join(", ")}`);const u=Date.now();let p=!1;const m=()=>{if(!s.props.touch.dragging){const d=Date.now()-u,f=c(d/h),g=d>h,v=g||null===r?r:t+(r-t)*f,y=g||null===a?a:e+(a-e)*f;l=s._applyRange(v,y),Uo(s.options.moment,s.body,s.options.hiddenDates),p=p||l;const b={start:new Date(s.start),end:new Date(s.end),byUser:i.byUser,event:i.event};if(o&&o(f,l,g),l&&s.body.emitter.emit("rangechange",b),g){if(p&&(s.body.emitter.emit("rangechanged",b),n))return n()}else s.animationTimer=setTimeout(m,20)}};return m()}var l=this._applyRange(r,a);if(Uo(this.options.moment,this.body,this.options.hiddenDates),l){const t={start:new Date(this.start),end:new Date(this.end),byUser:i.byUser,event:i.event};if(this.body.emitter.emit("rangechange",t),clearTimeout(s.timeoutID),s.timeoutID=setTimeout((()=>{s.body.emitter.emit("rangechanged",t)}),200),n)return n()}}getMillisecondsPerPixel(){return void 0===this.millisecondsPerPixelCache&&(this.millisecondsPerPixelCache=(this.end-this.start)/this.body.dom.center.clientWidth),this.millisecondsPerPixelCache}_cancelAnimation(){this.animationTimer&&(clearTimeout(this.animationTimer),this.animationTimer=null)}_applyRange(t,e){let i=null!=t?Wo.convert(t,"Date").valueOf():this.start,n=null!=e?Wo.convert(e,"Date").valueOf():this.end;const o=null!=this.options.max?Wo.convert(this.options.max,"Date").valueOf():null,s=null!=this.options.min?Wo.convert(this.options.min,"Date").valueOf():null;let r;if(isNaN(i)||null===i)throw new Error(`Invalid start "${t}"`);if(isNaN(n)||null===n)throw new Error(`Invalid end "${e}"`);if(n<i&&(n=i),null!==s&&i<s&&(r=s-i,i+=r,n+=r,null!=o&&n>o&&(n=o)),null!==o&&n>o&&(r=n-o,i-=r,n-=r,null!=s&&i<s&&(i=s)),null!==this.options.zoomMin){let t=parseFloat(this.options.zoomMin);if(t<0&&(t=0),n-i<t){const e=.5;this.end-this.start===t&&i>=this.start-e&&n<=this.end?(i=this.start,n=this.end):(r=t-(n-i),i-=r/2,n+=r/2)}}if(null!==this.options.zoomMax){let t=parseFloat(this.options.zoomMax);t<0&&(t=0),n-i>t&&(this.end-this.start===t&&i<this.start&&n>this.end?(i=this.start,n=this.end):(r=n-i-t,i+=r/2,n-=r/2))}const a=this.start!=i||this.end!=n;return i>=this.start&&i<=this.end||n>=this.start&&n<=this.end||this.start>=i&&this.start<=n||this.end>=i&&this.end<=n||this.body.emitter.emit("checkRangedItems"),this.start=i,this.end=n,a}getRange(){return{start:this.start,end:this.end}}conversion(t,e){return ts.conversion(this.start,this.end,t,e)}static conversion(t,e,i,n){return void 0===n&&(n=0),0!=i&&e-t!=0?{offset:t,scale:i/(e-t-n)}:{offset:0,scale:1}}_onDragStart(t){this.deltaDifference=0,this.previousDelta=0,this.options.moveable&&this._isInsideRange(t)&&this.props.touch.allowDragging&&(this.stopRolling(),this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.dragging=!0,this.body.dom.root&&(this.body.dom.root.style.cursor="move"))}_onDrag(t){if(!t)return;if(!this.props.touch.dragging)return;if(!this.options.moveable)return;if(!this.props.touch.allowDragging)return;const e=this.options.direction;es(e);let i="horizontal"==e?t.deltaX:t.deltaY;i-=this.deltaDifference;let n=this.props.touch.end-this.props.touch.start;n-=Xo(this.body.hiddenDates,this.start,this.end);const o="horizontal"==e?this.body.domProps.center.width:this.body.domProps.center.height;let s;s=this.options.rtl?i/o*n:-i/o*n;const r=this.props.touch.start+s,a=this.props.touch.end+s,l=Qo(this.body.hiddenDates,r,this.previousDelta-i,!0),h=Qo(this.body.hiddenDates,a,this.previousDelta-i,!0);if(l!=r||h!=a)return this.deltaDifference+=i,this.props.touch.start=l,this.props.touch.end=h,void this._onDrag(t);this.previousDelta=i,this._applyRange(r,a);const d=new Date(this.start),c=new Date(this.end);this.body.emitter.emit("rangechange",{start:d,end:c,byUser:!0,event:t}),this.body.emitter.emit("panmove")}_onDragEnd(t){this.props.touch.dragging&&this.options.moveable&&this.props.touch.allowDragging&&(this.props.touch.dragging=!1,this.body.dom.root&&(this.body.dom.root.style.cursor="auto"),this.body.emitter.emit("rangechanged",{start:new Date(this.start),end:new Date(this.end),byUser:!0,event:t}))}_onMouseWheel(t){let e=0;if(t.wheelDelta?e=t.wheelDelta/120:t.detail?e=-t.detail/3:t.deltaY&&(e=-t.deltaY/3),!(this.options.zoomKey&&!t[this.options.zoomKey]&&this.options.zoomable||!this.options.zoomable&&this.options.moveable)&&this.options.zoomable&&this.options.moveable&&this._isInsideRange(t)&&e){const i=this.options.zoomFriction||5;let n,o;if(n=e<0?1-e/i:1/(1+e/i),this.rolling){const t=this.options.rollingMode&&this.options.rollingMode.offset||.5;o=this.start+(this.end-this.start)*t}else{const e=this.getPointer({x:t.clientX,y:t.clientY},this.body.dom.center);o=this._pointerToDate(e)}this.zoom(n,o,e,t),t.preventDefault()}}_onTouch(t){this.props.touch.start=this.start,this.props.touch.end=this.end,this.props.touch.allowDragging=!0,this.props.touch.center=null,this.props.touch.centerDate=null,this.scaleOffset=0,this.deltaDifference=0,Wo.preventDefault(t)}_onPinch(t){if(!this.options.zoomable||!this.options.moveable)return;Wo.preventDefault(t),this.props.touch.allowDragging=!1,this.props.touch.center||(this.props.touch.center=this.getPointer(t.center,this.body.dom.center),this.props.touch.centerDate=this._pointerToDate(this.props.touch.center)),this.stopRolling();const e=1/(t.scale+this.scaleOffset),i=this.props.touch.centerDate,n=Xo(this.body.hiddenDates,this.start,this.end),o=Zo(this.options.moment,this.body.hiddenDates,this,i),s=n-o;let r=i-o+(this.props.touch.start-(i-o))*e,a=i+s+(this.props.touch.end-(i+s))*e;this.startToFront=1-e<=0,this.endToFront=e-1<=0;const l=Qo(this.body.hiddenDates,r,1-e,!0),h=Qo(this.body.hiddenDates,a,e-1,!0);l==r&&h==a||(this.props.touch.start=l,this.props.touch.end=h,this.scaleOffset=1-t.scale,r=l,a=h);const d={animation:!1,byUser:!0,event:t};this.setRange(r,a,d),this.startToFront=!1,this.endToFront=!0}_isInsideRange(t){const e=t.center?t.center.x:t.clientX,i=this.body.dom.centerContainer.getBoundingClientRect(),n=this.options.rtl?e-i.left:i.right-e,o=this.body.util.toTime(n);return o>=this.start&&o<=this.end}_pointerToDate(t){let e;const i=this.options.direction;if(es(i),"horizontal"==i)return this.body.util.toTime(t.x).valueOf();{const i=this.body.domProps.center.height;return e=this.conversion(i),t.y/e.scale+e.offset}}getPointer(t,e){const i=e.getBoundingClientRect();return this.options.rtl?{x:i.right-t.x,y:t.y-i.top}:{x:t.x-i.left,y:t.y-i.top}}zoom(t,e,i,n){null==e&&(e=(this.start+this.end)/2);const o=Xo(this.body.hiddenDates,this.start,this.end),s=Zo(this.options.moment,this.body.hiddenDates,this,e),r=o-s;let a=e-s+(this.start-(e-s))*t,l=e+r+(this.end-(e+r))*t;this.startToFront=!(i>0),this.endToFront=!(-i>0);const h=Qo(this.body.hiddenDates,a,i,!0),d=Qo(this.body.hiddenDates,l,-i,!0);h==a&&d==l||(a=h,l=d);const c={animation:!1,byUser:!0,event:n};this.setRange(a,l,c),this.startToFront=!1,this.endToFront=!0}move(t){const e=this.end-this.start,i=this.start+e*t,n=this.end+e*t;this.start=i,this.end=n}moveTo(t){const e=(this.start+this.end)/2-t,i=this.start-e,n=this.end-e;this.setRange(i,n,{animation:!1,byUser:!0,event:null})}}function es(t){if("horizontal"!=t&&"vertical"!=t)throw new TypeError(`Unknown direction "${t}". Choose "horizontal" or "vertical".`)}let is;if("undefined"!=typeof window){is=function t(e,i){var n=i||{preventDefault:!1};if(e.Manager){var o=e,s=function(e,i){var s=Object.create(n);return i&&o.assign(s,i),t(new o(e,s),s)};return o.assign(s,o),s.Manager=function(e,i){var s=Object.create(n);return i&&o.assign(s,i),t(new o.Manager(e,s),s)},s}var r=Object.create(e),a=e.element;function l(t){return t.match(/[^ ]+/g)}function h(t){if("hammer.input"!==t.type){if(t.srcEvent._handled||(t.srcEvent._handled={}),t.srcEvent._handled[t.type])return;t.srcEvent._handled[t.type]=!0}var e=!1;t.stopPropagation=function(){e=!0};var i=t.srcEvent.stopPropagation.bind(t.srcEvent);"function"==typeof i&&(t.srcEvent.stopPropagation=function(){i(),t.stopPropagation()}),t.firstTarget=Po;for(var n=Po;n&&!e;){var o=n.hammer;if(o)for(var s,r=0;r<o.length;r++)if(s=o[r]._handlers[t.type])for(var a=0;a<s.length&&!e;a++)s[a](t);n=n.parentNode}}return a.hammer||(a.hammer=[]),a.hammer.push(r),e.on("hammer.input",(function(t){!0!==n.preventDefault&&n.preventDefault!==t.pointerType||t.preventDefault(),t.isFirst&&(Po=t.target)})),r._handlers={},r.on=function(t,i){return l(t).forEach((function(t){var n=r._handlers[t];n||(r._handlers[t]=n=[],e.on(t,h)),n.push(i)})),r},r.off=function(t,i){return l(t).forEach((function(t){var n=r._handlers[t];n&&((n=i?n.filter((function(t){return t!==i})):[]).length>0?r._handlers[t]=n:(e.off(t,h),delete r._handlers[t]))})),r},r.emit=function(t,i){Po=i.target,e.emit(t,i)},r.destroy=function(){var t=e.element.hammer,i=t.indexOf(r);-1!==i&&t.splice(i,1),t.length||delete e.element.hammer,r._handlers={},e.destroy()},r}(window.Hammer||Qe,{preventDefault:"mouse"})}else is=()=>function(){const t=()=>{};return{on:t,off:t,destroy:t,emit:t,get:e=>({set:t})}}();var ns=is;function os(t,e){e.inputHandler=function(t){t.isFirst&&e(t)},t.on("hammer.input",e.inputHandler)}class ss{constructor(t,e,i,n,o){this.moment=o&&o.moment||No,this.options=o||{},this.current=this.moment(),this._start=this.moment(),this._end=this.moment(),this.autoScale=!0,this.scale="day",this.step=1,this.setRange(t,e,i),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,Array.isArray(n)?this.hiddenDates=n:this.hiddenDates=null!=n?[n]:[],this.format=ss.FORMAT}setMoment(t){this.moment=t,this.current=this.moment(this.current.valueOf()),this._start=this.moment(this._start.valueOf()),this._end=this.moment(this._end.valueOf())}setFormat(t){const e=Wo.deepExtend({},ss.FORMAT);this.format=Wo.deepExtend(e,t)}setRange(t,e,i){if(!(t instanceof Date&&e instanceof Date))throw"No legal start or end date in method setRange";this._start=null!=t?this.moment(t.valueOf()):Date.now(),this._end=null!=e?this.moment(e.valueOf()):Date.now(),this.autoScale&&this.setMinimumStep(i)}start(){this.current=this._start.clone(),this.roundToMinor()}roundToMinor(){switch("week"==this.scale&&this.current.weekday(0),this.scale){case"year":this.current.year(this.step*Math.floor(this.current.year()/this.step)),this.current.month(0);case"month":this.current.date(1);case"week":case"day":case"weekday":this.current.hours(0);case"hour":this.current.minutes(0);case"minute":this.current.seconds(0);case"second":this.current.milliseconds(0)}if(1!=this.step){let t=this.current.clone();switch(this.scale){case"millisecond":this.current.subtract(this.current.milliseconds()%this.step,"milliseconds");break;case"second":this.current.subtract(this.current.seconds()%this.step,"seconds");break;case"minute":this.current.subtract(this.current.minutes()%this.step,"minutes");break;case"hour":this.current.subtract(this.current.hours()%this.step,"hours");break;case"weekday":case"day":this.current.subtract((this.current.date()-1)%this.step,"day");break;case"week":this.current.subtract(this.current.week()%this.step,"week");break;case"month":this.current.subtract(this.current.month()%this.step,"month");break;case"year":this.current.subtract(this.current.year()%this.step,"year")}t.isSame(this.current)||(this.current=this.moment(Qo(this.hiddenDates,this.current.valueOf(),-1,!0)))}}hasNext(){return this.current.valueOf()<=this._end.valueOf()}next(){const t=this.current.valueOf();switch(this.scale){case"millisecond":this.current.add(this.step,"millisecond");break;case"second":this.current.add(this.step,"second");break;case"minute":this.current.add(this.step,"minute");break;case"hour":this.current.add(this.step,"hour"),this.current.month()<6?this.current.subtract(this.current.hours()%this.step,"hour"):this.current.hours()%this.step!=0&&this.current.add(this.step-this.current.hours()%this.step,"hour");break;case"weekday":case"day":this.current.add(this.step,"day");break;case"week":if(0!==this.current.weekday())this.current.weekday(0),this.current.add(this.step,"week");else if(!1===this.options.showMajorLabels)this.current.add(this.step,"week");else{const t=this.current.clone();t.add(1,"week"),t.isSame(this.current,"month")?this.current.add(this.step,"week"):(this.current.add(this.step,"week"),this.current.date(1))}break;case"month":this.current.add(this.step,"month");break;case"year":this.current.add(this.step,"year")}if(1!=this.step)switch(this.scale){case"millisecond":this.current.milliseconds()>0&&this.current.milliseconds()<this.step&&this.current.milliseconds(0);break;case"second":this.current.seconds()>0&&this.current.seconds()<this.step&&this.current.seconds(0);break;case"minute":this.current.minutes()>0&&this.current.minutes()<this.step&&this.current.minutes(0);break;case"hour":this.current.hours()>0&&this.current.hours()<this.step&&this.current.hours(0);break;case"weekday":case"day":this.current.date()<this.step+1&&this.current.date(1);break;case"week":this.current.week()<this.step&&this.current.week(1);break;case"month":this.current.month()<this.step&&this.current.month(0)}this.current.valueOf()==t&&(this.current=this._end.clone()),this.switchedDay=!1,this.switchedMonth=!1,this.switchedYear=!1,function(t,e,i){let n=!1;const o=e.current.valueOf();for(let t=0;t<e.hiddenDates.length;t++){const i=e.hiddenDates[t].start;var s=e.hiddenDates[t].end;if(o>=i&&o<s){n=!0;break}}if(1==n&&o<e._end.valueOf()&&o!=i){const n=t(i),o=t(s);n.year()!=o.year()?e.switchedYear=!0:n.month()!=o.month()?e.switchedMonth=!0:n.dayOfYear()!=o.dayOfYear()&&(e.switchedDay=!0),e.current=o}}(this.moment,this,t)}getCurrent(){return this.current.clone()}setScale(t){t&&"string"==typeof t.scale&&(this.scale=t.scale,this.step=t.step>0?t.step:1,this.autoScale=!1)}setAutoScale(t){this.autoScale=t}setMinimumStep(t){if(null==t)return;const e=31104e6,i=2592e6,n=864e5,o=36e5,s=6e4,r=1e3;1e3*e>t&&(this.scale="year",this.step=1e3),500*e>t&&(this.scale="year",this.step=500),100*e>t&&(this.scale="year",this.step=100),50*e>t&&(this.scale="year",this.step=50),10*e>t&&(this.scale="year",this.step=10),5*e>t&&(this.scale="year",this.step=5),e>t&&(this.scale="year",this.step=1),7776e6>t&&(this.scale="month",this.step=3),i>t&&(this.scale="month",this.step=1),6048e5>t&&this.options.showWeekScale&&(this.scale="week",this.step=1),1728e5>t&&(this.scale="day",this.step=2),n>t&&(this.scale="day",this.step=1),432e5>t&&(this.scale="weekday",this.step=1),144e5>t&&(this.scale="hour",this.step=4),o>t&&(this.scale="hour",this.step=1),9e5>t&&(this.scale="minute",this.step=15),6e5>t&&(this.scale="minute",this.step=10),3e5>t&&(this.scale="minute",this.step=5),s>t&&(this.scale="minute",this.step=1),15e3>t&&(this.scale="second",this.step=15),1e4>t&&(this.scale="second",this.step=10),5e3>t&&(this.scale="second",this.step=5),r>t&&(this.scale="second",this.step=1),200>t&&(this.scale="millisecond",this.step=200),100>t&&(this.scale="millisecond",this.step=100),50>t&&(this.scale="millisecond",this.step=50),10>t&&(this.scale="millisecond",this.step=10),5>t&&(this.scale="millisecond",this.step=5),1>t&&(this.scale="millisecond",this.step=1)}static snap(t,e,i){const n=No(t);if("year"==e){const t=n.year()+Math.round(n.month()/12);n.year(Math.round(t/i)*i),n.month(0),n.date(0),n.hours(0),n.minutes(0),n.seconds(0),n.milliseconds(0)}else if("month"==e)n.date()>15?(n.date(1),n.add(1,"month")):n.date(1),n.hours(0),n.minutes(0),n.seconds(0),n.milliseconds(0);else if("week"==e)n.weekday()>2?(n.weekday(0),n.add(1,"week")):n.weekday(0),n.hours(0),n.minutes(0),n.seconds(0),n.milliseconds(0);else if("day"==e){switch(i){case 5:case 2:n.hours(24*Math.round(n.hours()/24));break;default:n.hours(12*Math.round(n.hours()/12))}n.minutes(0),n.seconds(0),n.milliseconds(0)}else if("weekday"==e){switch(i){case 5:case 2:n.hours(12*Math.round(n.hours()/12));break;default:n.hours(6*Math.round(n.hours()/6))}n.minutes(0),n.seconds(0),n.milliseconds(0)}else if("hour"==e){if(4===i)n.minutes(60*Math.round(n.minutes()/60));else n.minutes(30*Math.round(n.minutes()/30));n.seconds(0),n.milliseconds(0)}else if("minute"==e){switch(i){case 15:case 10:n.minutes(5*Math.round(n.minutes()/5)),n.seconds(0);break;case 5:n.seconds(60*Math.round(n.seconds()/60));break;default:n.seconds(30*Math.round(n.seconds()/30))}n.milliseconds(0)}else if("second"==e)switch(i){case 15:case 10:n.seconds(5*Math.round(n.seconds()/5)),n.milliseconds(0);break;case 5:n.milliseconds(1e3*Math.round(n.milliseconds()/1e3));break;default:n.milliseconds(500*Math.round(n.milliseconds()/500))}else if("millisecond"==e){const t=i>5?i/2:1;n.milliseconds(Math.round(n.milliseconds()/t)*t)}return n}isMajor(){if(1==this.switchedYear)switch(this.scale){case"year":case"month":case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedMonth)switch(this.scale){case"week":case"weekday":case"day":case"hour":case"minute":case"second":case"millisecond":return!0;default:return!1}else if(1==this.switchedDay)switch(this.scale){case"millisecond":case"second":case"minute":case"hour":return!0;default:return!1}const t=this.moment(this.current);switch(this.scale){case"millisecond":return 0==t.milliseconds();case"second":return 0==t.seconds();case"minute":return 0==t.hours()&&0==t.minutes();case"hour":return 0==t.hours();case"weekday":case"day":return this.options.showWeekScale?1==t.isoWeekday():1==t.date();case"week":return 1==t.date();case"month":return 0==t.month();default:return!1}}getLabelMinor(t){if(null==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.minorLabels)return this.format.minorLabels(t,this.scale,this.step);const e=this.format.minorLabels[this.scale];return"week"===this.scale&&1===t.date()&&0!==t.weekday()?"":e&&e.length>0?this.moment(t).format(e):""}getLabelMajor(t){if(null==t&&(t=this.current),t instanceof Date&&(t=this.moment(t)),"function"==typeof this.format.majorLabels)return this.format.majorLabels(t,this.scale,this.step);const e=this.format.majorLabels[this.scale];return e&&e.length>0?this.moment(t).format(e):""}getClassName(){const t=this.moment,e=this.moment(this.current),i=e.locale?e.locale("en"):e.lang("en"),n=this.step,o=[];function s(t){return t/n%2==0?" vis-even":" vis-odd"}function r(e){return e.isSame(Date.now(),"day")?" vis-today":e.isSame(t().add(1,"day"),"day")?" vis-tomorrow":e.isSame(t().add(-1,"day"),"day")?" vis-yesterday":""}function a(t){return t.isSame(Date.now(),"week")?" vis-current-week":""}function l(t){return t.isSame(Date.now(),"month")?" vis-current-month":""}switch(this.scale){case"millisecond":o.push(r(i)),o.push(s(i.milliseconds()));break;case"second":o.push(r(i)),o.push(s(i.seconds()));break;case"minute":o.push(r(i)),o.push(s(i.minutes()));break;case"hour":o.push(`vis-h${i.hours()}${4==this.step?"-h"+(i.hours()+4):""}`),o.push(r(i)),o.push(s(i.hours()));break;case"weekday":o.push(`vis-${i.format("dddd").toLowerCase()}`),o.push(r(i)),o.push(a(i)),o.push(s(i.date()));break;case"day":o.push(`vis-day${i.date()}`),o.push(`vis-${i.format("MMMM").toLowerCase()}`),o.push(r(i)),o.push(l(i)),o.push(this.step<=2?r(i):""),o.push(this.step<=2?`vis-${i.format("dddd").toLowerCase()}`:""),o.push(s(i.date()-1));break;case"week":o.push(`vis-week${i.format("w")}`),o.push(a(i)),o.push(s(i.week()));break;case"month":o.push(`vis-${i.format("MMMM").toLowerCase()}`),o.push(l(i)),o.push(s(i.month()));break;case"year":o.push(`vis-year${i.year()}`),o.push(function(t){return t.isSame(Date.now(),"year")?" vis-current-year":""}(i)),o.push(s(i.year()))}return o.filter(String).join(" ")}}ss.FORMAT={minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",week:"w",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",week:"MMMM YYYY",month:"YYYY",year:""}};class rs extends Go{constructor(t,e){super(),this.dom={foreground:null,lines:[],majorTexts:[],minorTexts:[],redundant:{lines:[],majorTexts:[],minorTexts:[]}},this.props={range:{start:0,end:0,minimumStep:0},lineTop:0},this.defaultOptions={orientation:{axis:"bottom"},showMinorLabels:!0,showMajorLabels:!0,showWeekScale:!1,maxMinorChars:7,format:Wo.extend({},ss.FORMAT),moment:No,timeAxis:null},this.options=Wo.extend({},this.defaultOptions),this.body=t,this._create(),this.setOptions(e)}setOptions(t){t&&(Wo.selectiveExtend(["showMinorLabels","showMajorLabels","showWeekScale","maxMinorChars","hiddenDates","timeAxis","moment","rtl"],this.options,t),Wo.selectiveDeepExtend(["format"],this.options,t),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.axis=t.orientation:"object"==typeof t.orientation&&"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis)),"locale"in t&&("function"==typeof No.locale?No.locale(t.locale):No.lang(t.locale)))}_create(){this.dom.foreground=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.foreground.className="vis-time-axis vis-foreground",this.dom.background.className="vis-time-axis vis-background"}destroy(){this.dom.foreground.parentNode&&this.dom.foreground.parentNode.removeChild(this.dom.foreground),this.dom.background.parentNode&&this.dom.background.parentNode.removeChild(this.dom.background),this.body=null}redraw(){const t=this.props,e=this.dom.foreground,i=this.dom.background,n="top"==this.options.orientation.axis?this.body.dom.top:this.body.dom.bottom,o=e.parentNode!==n;this._calculateCharSize();const s=this.options.showMinorLabels&&"none"!==this.options.orientation.axis,r=this.options.showMajorLabels&&"none"!==this.options.orientation.axis;t.minorLabelHeight=s?t.minorCharHeight:0,t.majorLabelHeight=r?t.majorCharHeight:0,t.height=t.minorLabelHeight+t.majorLabelHeight,t.width=e.offsetWidth,t.minorLineHeight=this.body.domProps.root.height-t.majorLabelHeight-("top"==this.options.orientation.axis?this.body.domProps.bottom.height:this.body.domProps.top.height),t.minorLineWidth=1,t.majorLineHeight=t.minorLineHeight+t.majorLabelHeight,t.majorLineWidth=1;const a=e.nextSibling,l=i.nextSibling;return e.parentNode&&e.parentNode.removeChild(e),i.parentNode&&i.parentNode.removeChild(i),e.style.height=`${this.props.height}px`,this._repaintLabels(),a?n.insertBefore(e,a):n.appendChild(e),l?this.body.dom.backgroundVertical.insertBefore(i,l):this.body.dom.backgroundVertical.appendChild(i),this._isResized()||o}_repaintLabels(){const t=this.options.orientation.axis,e=Wo.convert(this.body.range.start,"Number"),i=Wo.convert(this.body.range.end,"Number"),n=this.body.util.toTime((this.props.minorCharWidth||10)*this.options.maxMinorChars).valueOf();let o=n-Zo(this.options.moment,this.body.hiddenDates,this.body.range,n);o-=this.body.util.toTime(0).valueOf();const s=new ss(new Date(e),new Date(i),o,this.body.hiddenDates,this.options);s.setMoment(this.options.moment),this.options.format&&s.setFormat(this.options.format),this.options.timeAxis&&s.setScale(this.options.timeAxis),this.step=s;const r=this.dom;let a,l,h,d,c,u;r.redundant.lines=r.lines,r.redundant.majorTexts=r.majorTexts,r.redundant.minorTexts=r.minorTexts,r.lines=[],r.majorTexts=[],r.minorTexts=[];let p,m,f,g=0,v=0;const y=1e3;let b;for(s.start(),l=s.getCurrent(),d=this.body.util.toScreen(l);s.hasNext()&&v<y;){if(v++,c=s.isMajor(),b=s.getClassName(),a=l,h=d,s.next(),l=s.getCurrent(),d=this.body.util.toScreen(l),p=g,g=d-h,"week"===s.scale)u=!0;else u=g>=.4*p;if(this.options.showMinorLabels&&u){var w=this._repaintMinorText(h,s.getLabelMinor(a),t,b);w.style.width=`${g}px`}c&&this.options.showMajorLabels?(h>0&&(null==f&&(f=h),w=this._repaintMajorText(h,s.getLabelMajor(a),t,b)),m=this._repaintMajorLine(h,g,t,b)):u?m=this._repaintMinorLine(h,g,t,b):m&&(m.style.width=`${parseInt(m.style.width)+g}px`)}if(v!==y||as||(console.warn("Something is wrong with the Timeline scale. Limited drawing of grid lines to 1000 lines."),as=!0),this.options.showMajorLabels){const e=this.body.util.toTime(0),i=s.getLabelMajor(e),n=i.length*(this.props.majorCharWidth||10)+10;(null==f||n<f)&&this._repaintMajorText(0,i,t,b)}Wo.forEach(this.dom.redundant,(t=>{for(;t.length;){const e=t.pop();e&&e.parentNode&&e.parentNode.removeChild(e)}}))}_repaintMinorText(t,e,i,n){let o=this.dom.redundant.minorTexts.shift();if(!o){const t=document.createTextNode("");o=document.createElement("div"),o.appendChild(t),this.dom.foreground.appendChild(o)}this.dom.minorTexts.push(o),o.innerHTML=Wo.xss(e);let s="top"==i?this.props.majorLabelHeight:0;return this._setXY(o,t,s),o.className=`vis-text vis-minor ${n}`,o}_repaintMajorText(t,e,i,n){let o=this.dom.redundant.majorTexts.shift();if(!o){const t=document.createElement("div");o=document.createElement("div"),o.appendChild(t),this.dom.foreground.appendChild(o)}o.childNodes[0].innerHTML=Wo.xss(e),o.className=`vis-text vis-major ${n}`;let s="top"==i?0:this.props.minorLabelHeight;return this._setXY(o,t,s),this.dom.majorTexts.push(o),o}_setXY(t,e,i){const n=this.options.rtl?-1*e:e;t.style.transform=`translate(${n}px, ${i}px)`}_repaintMinorLine(t,e,i,n){let o=this.dom.redundant.lines.shift();o||(o=document.createElement("div"),this.dom.background.appendChild(o)),this.dom.lines.push(o);const s=this.props;o.style.width=`${e}px`,o.style.height=`${s.minorLineHeight}px`;let r="top"==i?s.majorLabelHeight:this.body.domProps.top.height,a=t-s.minorLineWidth/2;return this._setXY(o,a,r),o.className=`vis-grid ${this.options.rtl?"vis-vertical-rtl":"vis-vertical"} vis-minor ${n}`,o}_repaintMajorLine(t,e,i,n){let o=this.dom.redundant.lines.shift();o||(o=document.createElement("div"),this.dom.background.appendChild(o)),this.dom.lines.push(o);const s=this.props;o.style.width=`${e}px`,o.style.height=`${s.majorLineHeight}px`;let r="top"==i?0:this.body.domProps.top.height,a=t-s.majorLineWidth/2;return this._setXY(o,a,r),o.className=`vis-grid ${this.options.rtl?"vis-vertical-rtl":"vis-vertical"} vis-major ${n}`,o}_calculateCharSize(){this.dom.measureCharMinor||(this.dom.measureCharMinor=document.createElement("DIV"),this.dom.measureCharMinor.className="vis-text vis-minor vis-measure",this.dom.measureCharMinor.style.position="absolute",this.dom.measureCharMinor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMinor)),this.props.minorCharHeight=this.dom.measureCharMinor.clientHeight,this.props.minorCharWidth=this.dom.measureCharMinor.clientWidth,this.dom.measureCharMajor||(this.dom.measureCharMajor=document.createElement("DIV"),this.dom.measureCharMajor.className="vis-text vis-major vis-measure",this.dom.measureCharMajor.style.position="absolute",this.dom.measureCharMajor.appendChild(document.createTextNode("0")),this.dom.foreground.appendChild(this.dom.measureCharMajor)),this.props.majorCharHeight=this.dom.measureCharMajor.clientHeight,this.props.majorCharWidth=this.dom.measureCharMajor.clientWidth}}var as=!1;function ls(t){this.active=!1,this.dom={container:t},this.dom.overlay=document.createElement("div"),this.dom.overlay.className="vis-overlay",this.dom.container.appendChild(this.dom.overlay),this.hammer=ns(this.dom.overlay),this.hammer.on("tap",this._onTapOverlay.bind(this));var e=this;["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((function(t){e.hammer.on(t,(function(t){t.stopPropagation()}))})),document&&document.body&&(this.onClick=function(i){(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(i.target,t)||e.deactivate()},document.body.addEventListener("click",this.onClick)),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=function(t){var e,i=t&&t.preventDefault||!1,n=t&&t.container||window,o={},s={keydown:{},keyup:{}},r={};for(e=97;e<=122;e++)r[String.fromCharCode(e)]={code:e-97+65,shift:!1};for(e=65;e<=90;e++)r[String.fromCharCode(e)]={code:e,shift:!0};for(e=0;e<=9;e++)r[""+e]={code:48+e,shift:!1};for(e=1;e<=12;e++)r["F"+e]={code:111+e,shift:!1};for(e=0;e<=9;e++)r["num"+e]={code:96+e,shift:!1};r["num*"]={code:106,shift:!1},r["num+"]={code:107,shift:!1},r["num-"]={code:109,shift:!1},r["num/"]={code:111,shift:!1},r["num."]={code:110,shift:!1},r.left={code:37,shift:!1},r.up={code:38,shift:!1},r.right={code:39,shift:!1},r.down={code:40,shift:!1},r.space={code:32,shift:!1},r.enter={code:13,shift:!1},r.shift={code:16,shift:void 0},r.esc={code:27,shift:!1},r.backspace={code:8,shift:!1},r.tab={code:9,shift:!1},r.ctrl={code:17,shift:!1},r.alt={code:18,shift:!1},r.delete={code:46,shift:!1},r.pageup={code:33,shift:!1},r.pagedown={code:34,shift:!1},r["="]={code:187,shift:!1},r["-"]={code:189,shift:!1},r["]"]={code:221,shift:!1},r["["]={code:219,shift:!1};var a=function(t){h(t,"keydown")},l=function(t){h(t,"keyup")},h=function(t,e){if(void 0!==s[e][t.keyCode]){for(var n=s[e][t.keyCode],o=0;o<n.length;o++)(void 0===n[o].shift||1==n[o].shift&&1==t.shiftKey||0==n[o].shift&&0==t.shiftKey)&&n[o].fn(t);1==i&&t.preventDefault()}};return o.bind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===r[t])throw new Error("unsupported key: "+t);void 0===s[i][r[t].code]&&(s[i][r[t].code]=[]),s[i][r[t].code].push({fn:e,shift:r[t].shift})},o.bindAll=function(t,e){for(var i in void 0===e&&(e="keydown"),r)r.hasOwnProperty(i)&&o.bind(i,t,e)},o.getKey=function(t){for(var e in r)if(r.hasOwnProperty(e)){if(1==t.shiftKey&&1==r[e].shift&&t.keyCode==r[e].code)return e;if(0==t.shiftKey&&0==r[e].shift&&t.keyCode==r[e].code)return e;if(t.keyCode==r[e].code&&"shift"==e)return e}return"unknown key, currently not supported"},o.unbind=function(t,e,i){if(void 0===i&&(i="keydown"),void 0===r[t])throw new Error("unsupported key: "+t);if(void 0!==e){var n=[],o=s[i][r[t].code];if(void 0!==o)for(var a=0;a<o.length;a++)o[a].fn==e&&o[a].shift==r[t].shift||n.push(s[i][r[t].code][a]);s[i][r[t].code]=n}else s[i][r[t].code]=[]},o.reset=function(){s={keydown:{},keyup:{}}},o.destroy=function(){s={keydown:{},keyup:{}},n.removeEventListener("keydown",a,!0),n.removeEventListener("keyup",l,!0)},n.addEventListener("keydown",a,!0),n.addEventListener("keyup",l,!0),o}(),this.escListener=this.deactivate.bind(this)}G(ls.prototype),ls.current=null,ls.prototype.destroy=function(){this.deactivate(),this.dom.overlay.parentNode.removeChild(this.dom.overlay),this.onClick&&document.body.removeEventListener("click",this.onClick),void 0!==this.keycharm&&this.keycharm.destroy(),this.keycharm=null,this.hammer.destroy(),this.hammer=null},ls.prototype.activate=function(){ls.current&&ls.current.deactivate(),ls.current=this,this.active=!0,this.dom.overlay.style.display="none",Wo.addClassName(this.dom.container,"vis-active"),this.emit("change"),this.emit("activate"),this.keycharm.bind("esc",this.escListener)},ls.prototype.deactivate=function(){ls.current===this&&(ls.current=null),this.active=!1,this.dom.overlay.style.display="",Wo.removeClassName(this.dom.container,"vis-active"),this.keycharm.unbind("esc",this.escListener),this.emit("change"),this.emit("deactivate")},ls.prototype._onTapOverlay=function(t){this.activate(),t.stopPropagation()};const hs={current:"current",time:"time",deleteSelected:"Delete selected"},ds={current:"attuale",time:"tempo",deleteSelected:"Cancella la selezione"},cs={current:"huidige",time:"tijd",deleteSelected:"Selectie verwijderen"},us={current:"Aktuelle",time:"Zeit",deleteSelected:"Lösche Auswahl"},ps={current:"actuel",time:"heure",deleteSelected:"Effacer la selection"},ms={current:"corriente",time:"hora",deleteSelected:"Eliminar selección"},fs={current:"поточний",time:"час",deleteSelected:"Видалити обране"},gs={current:"текущее",time:"время",deleteSelected:"Удалить выбранное"},vs={current:"aktualny",time:"czas",deleteSelected:"Usuń wybrane"},ys={current:"atual",time:"data",deleteSelected:"Apagar selecionado"},bs={current:"現在",time:"時刻",deleteSelected:"選択されたものを削除"},ws={current:"nuvarande",time:"tid",deleteSelected:"Radera valda"},_s={current:"nåværende",time:"tid",deleteSelected:"Slett valgte"},xs={current:"einamas",time:"laikas",deleteSelected:"Pašalinti pasirinktą"},ks={en:hs,en_EN:hs,en_US:hs,it:ds,it_IT:ds,it_CH:ds,nl:cs,nl_NL:cs,nl_BE:cs,de:us,de_DE:us,fr:ps,fr_FR:ps,fr_CA:ps,fr_BE:ps,es:ms,es_ES:ms,uk:fs,uk_UA:fs,ru:gs,ru_RU:gs,pl:vs,pl_PL:vs,pt:ys,pt_BR:ys,pt_PT:ys,ja:bs,ja_JP:bs,lt:xs,lt_LT:xs,sv:ws,sv_SE:ws,nb:_s,nn:_s,nb_NO:_s,nn_NO:_s};class Ds extends Go{constructor(t,e){super(),this.body=t,this.defaultOptions={moment:No,locales:ks,locale:"en",id:void 0,title:void 0},this.options=Wo.extend({},this.defaultOptions),this.setOptions(e),this.options.locales=Wo.extend({},ks,this.options.locales);const i=this.defaultOptions.locales[this.defaultOptions.locale];Object.keys(this.options.locales).forEach((t=>{this.options.locales[t]=Wo.extend({},i,this.options.locales[t])})),e&&null!=e.time?this.customTime=e.time:this.customTime=new Date,this.eventParams={},this._create()}setOptions(t){t&&Wo.selectiveExtend(["moment","locale","locales","id","title","rtl","snap"],this.options,t)}_create(){const t=document.createElement("div");t["custom-time"]=this,t.className=`vis-custom-time ${this.options.id||""}`,t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t;const e=document.createElement("div");function i(t){this.body.range._onMouseWheel(t)}e.style.position="relative",e.style.top="0px",this.options.rtl?e.style.right="-10px":e.style.left="-10px",e.style.height="100%",e.style.width="20px",e.addEventListener?(e.addEventListener("mousewheel",i.bind(this),!1),e.addEventListener("DOMMouseScroll",i.bind(this),!1)):e.attachEvent("onmousewheel",i.bind(this)),t.appendChild(e),this.hammer=new ns(e),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:ns.DIRECTION_ALL}),this.hammer.get("press").set({time:1e4})}destroy(){this.hide(),this.hammer.destroy(),this.hammer=null,this.body=null}redraw(){const t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar));const e=this.body.util.toScreen(this.customTime);let i=this.options.locales[this.options.locale];i||(this.warned||(console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`),this.warned=!0),i=this.options.locales.en);let n=this.options.title;return void 0===n?(n=`${i.time}: ${this.options.moment(this.customTime).format("dddd, MMMM Do YYYY, H:mm:ss")}`,n=n.charAt(0).toUpperCase()+n.substring(1)):"function"==typeof n&&(n=n.call(this,this.customTime)),this.options.rtl?this.bar.style.right=`${e}px`:this.bar.style.left=`${e}px`,this.bar.title=n,!1}hide(){this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar)}setCustomTime(t){this.customTime=Wo.convert(t,"Date"),this.redraw()}getCustomTime(){return new Date(this.customTime.valueOf())}setCustomMarker(t,e){const i=document.createElement("div");i.className="vis-custom-time-marker",i.innerHTML=Wo.xss(t),i.style.position="absolute",e&&(i.setAttribute("contenteditable","true"),i.addEventListener("pointerdown",(function(){i.focus()})),i.addEventListener("input",this._onMarkerChange.bind(this)),i.title=t,i.addEventListener("blur",function(t){this.title!=t.target.innerHTML&&(this._onMarkerChanged(t),this.title=t.target.innerHTML)}.bind(this))),this.bar.appendChild(i)}setCustomTitle(t){this.options.title=t}_onDragStart(t){this.eventParams.dragging=!0,this.eventParams.customTime=this.customTime,t.stopPropagation()}_onDrag(t){if(!this.eventParams.dragging)return;let e=this.options.rtl?-1*t.deltaX:t.deltaX;const i=this.body.util.toScreen(this.eventParams.customTime)+e,n=this.body.util.toTime(i),o=this.body.util.getScale(),s=this.body.util.getStep(),r=this.options.snap,a=r?r(n,o,s):n;this.setCustomTime(a),this.body.emitter.emit("timechange",{id:this.options.id,time:new Date(this.customTime.valueOf()),event:t}),t.stopPropagation()}_onDragEnd(t){this.eventParams.dragging&&(this.body.emitter.emit("timechanged",{id:this.options.id,time:new Date(this.customTime.valueOf()),event:t}),t.stopPropagation())}_onMarkerChange(t){this.body.emitter.emit("markerchange",{id:this.options.id,title:t.target.innerHTML,event:t}),t.stopPropagation()}_onMarkerChanged(t){this.body.emitter.emit("markerchanged",{id:this.options.id,title:t.target.innerHTML,event:t}),t.stopPropagation()}static customTimeFromTarget(t){let e=t.target;for(;e;){if(e.hasOwnProperty("custom-time"))return e["custom-time"];e=e.parentNode}return null}}class Cs{_create(t){this.dom={},this.dom.container=t,this.dom.container.style.position="relative",this.dom.root=document.createElement("div"),this.dom.background=document.createElement("div"),this.dom.backgroundVertical=document.createElement("div"),this.dom.backgroundHorizontal=document.createElement("div"),this.dom.centerContainer=document.createElement("div"),this.dom.leftContainer=document.createElement("div"),this.dom.rightContainer=document.createElement("div"),this.dom.center=document.createElement("div"),this.dom.left=document.createElement("div"),this.dom.right=document.createElement("div"),this.dom.top=document.createElement("div"),this.dom.bottom=document.createElement("div"),this.dom.shadowTop=document.createElement("div"),this.dom.shadowBottom=document.createElement("div"),this.dom.shadowTopLeft=document.createElement("div"),this.dom.shadowBottomLeft=document.createElement("div"),this.dom.shadowTopRight=document.createElement("div"),this.dom.shadowBottomRight=document.createElement("div"),this.dom.rollingModeBtn=document.createElement("div"),this.dom.loadingScreen=document.createElement("div"),this.dom.root.className="vis-timeline",this.dom.background.className="vis-panel vis-background",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical",this.dom.backgroundHorizontal.className="vis-panel vis-background vis-horizontal",this.dom.centerContainer.className="vis-panel vis-center",this.dom.leftContainer.className="vis-panel vis-left",this.dom.rightContainer.className="vis-panel vis-right",this.dom.top.className="vis-panel vis-top",this.dom.bottom.className="vis-panel vis-bottom",this.dom.left.className="vis-content",this.dom.center.className="vis-content",this.dom.right.className="vis-content",this.dom.shadowTop.className="vis-shadow vis-top",this.dom.shadowBottom.className="vis-shadow vis-bottom",this.dom.shadowTopLeft.className="vis-shadow vis-top",this.dom.shadowBottomLeft.className="vis-shadow vis-bottom",this.dom.shadowTopRight.className="vis-shadow vis-top",this.dom.shadowBottomRight.className="vis-shadow vis-bottom",this.dom.rollingModeBtn.className="vis-rolling-mode-btn",this.dom.loadingScreen.className="vis-loading-screen",this.dom.root.appendChild(this.dom.background),this.dom.root.appendChild(this.dom.backgroundVertical),this.dom.root.appendChild(this.dom.backgroundHorizontal),this.dom.root.appendChild(this.dom.centerContainer),this.dom.root.appendChild(this.dom.leftContainer),this.dom.root.appendChild(this.dom.rightContainer),this.dom.root.appendChild(this.dom.top),this.dom.root.appendChild(this.dom.bottom),this.dom.root.appendChild(this.dom.rollingModeBtn),this.dom.centerContainer.appendChild(this.dom.center),this.dom.leftContainer.appendChild(this.dom.left),this.dom.rightContainer.appendChild(this.dom.right),this.dom.centerContainer.appendChild(this.dom.shadowTop),this.dom.centerContainer.appendChild(this.dom.shadowBottom),this.dom.leftContainer.appendChild(this.dom.shadowTopLeft),this.dom.leftContainer.appendChild(this.dom.shadowBottomLeft),this.dom.rightContainer.appendChild(this.dom.shadowTopRight),this.dom.rightContainer.appendChild(this.dom.shadowBottomRight),this.props={root:{},background:{},centerContainer:{},leftContainer:{},rightContainer:{},center:{},left:{},right:{},top:{},bottom:{},border:{},scrollTop:0,scrollTopMin:0},this.on("rangechange",(()=>{!0===this.initialDrawDone&&this._redraw()})),this.on("rangechanged",(()=>{this.initialRangeChangeDone||(this.initialRangeChangeDone=!0)})),this.on("touch",this._onTouch.bind(this)),this.on("panmove",this._onDrag.bind(this));const e=this;this._origRedraw=this._redraw.bind(this),this._redraw=Wo.throttle(this._origRedraw),this.on("_change",(t=>{e.itemSet&&e.itemSet.initialItemSetDrawn&&t&&1==t.queue?e._redraw():e._origRedraw()})),this.hammer=new ns(this.dom.root);const i=this.hammer.get("pinch").set({enable:!0});i&&function(t){t.getTouchAction=function(){return["pan-y"]}}(i),this.hammer.get("pan").set({threshold:5,direction:ns.DIRECTION_ALL}),this.timelineListeners={};var n,o;function s(t){this.isActive()&&this.emit("mousewheel",t);let e=0,i=0;if("detail"in t&&(i=-1*t.detail),"wheelDelta"in t&&(i=t.wheelDelta),"wheelDeltaY"in t&&(i=t.wheelDeltaY),"wheelDeltaX"in t&&(e=-1*t.wheelDeltaX),"axis"in t&&t.axis===t.HORIZONTAL_AXIS&&(e=-1*i,i=0),"deltaY"in t&&(i=-1*t.deltaY),"deltaX"in t&&(e=t.deltaX),t.deltaMode&&(1===t.deltaMode?(e*=40,i*=40):(e*=40,i*=800)),this.options.preferZoom){if(!this.options.zoomKey||t[this.options.zoomKey])return}else if(this.options.zoomKey&&t[this.options.zoomKey])return;if(this.options.verticalScroll||this.options.horizontalScroll)if(this.options.verticalScroll&&Math.abs(i)>=Math.abs(e)){const e=this.props.scrollTop,n=e+i;if(this.isActive()){this._setScrollTop(n)!==e&&(this._redraw(),this.emit("scroll",t),t.preventDefault())}}else if(this.options.horizontalScroll){const n=(Math.abs(e)>=Math.abs(i)?e:i)/120*(this.range.end-this.range.start)/20,o=this.range.start+n,s=this.range.end+n,r={animation:!1,byUser:!0,event:t};this.range.setRange(o,s,r),t.preventDefault()}}["tap","doubletap","press","pinch","pan","panstart","panmove","panend"].forEach((t=>{const i=i=>{e.isActive()&&e.emit(t,i)};e.hammer.on(t,i),e.timelineListeners[t]=i})),os(this.hammer,(t=>{e.emit("touch",t)})),n=this.hammer,(o=t=>{e.emit("release",t)}).inputHandler=function(t){t.isFinal&&o(t)},n.on("hammer.input",o.inputHandler);const r="onwheel"in document.createElement("div")?"wheel":void 0!==document.onmousewheel?"mousewheel":this.dom.centerContainer.addEventListener?"DOMMouseScroll":"onmousewheel";function a(t){if(e.options.verticalScroll&&(t.preventDefault(),e.isActive())){const i=-t.target.scrollTop;e._setScrollTop(i),e._redraw(),e.emit("scrollSide",t)}}this.dom.top.addEventListener,this.dom.bottom.addEventListener,this.dom.centerContainer.addEventListener(r,s.bind(this),!1),this.dom.top.addEventListener(r,s.bind(this),!1),this.dom.bottom.addEventListener(r,s.bind(this),!1),this.dom.left.parentNode.addEventListener("scroll",a.bind(this)),this.dom.right.parentNode.addEventListener("scroll",a.bind(this));let l=!1;if(this.dom.center.addEventListener("dragover",function(t){if(t.preventDefault&&(e.emit("dragover",e.getEventProperties(t)),t.preventDefault()),t.target.className.indexOf("timeline")>-1&&!l)return t.dataTransfer.dropEffect="move",l=!0,!1}.bind(this),!1),this.dom.center.addEventListener("drop",function(t){t.preventDefault&&t.preventDefault(),t.stopPropagation&&t.stopPropagation();try{var i=JSON.parse(t.dataTransfer.getData("text"));if(!i||!i.content)return}catch(t){return!1}return l=!1,t.center={x:t.clientX,y:t.clientY},"item"!==i.target?e.itemSet._onAddItem(t):e.itemSet._onDropObjectOnItem(t),e.emit("drop",e.getEventProperties(t)),!1}.bind(this),!1),this.customTimes=[],this.touch={},this.redrawCount=0,this.initialDrawDone=!1,this.initialRangeChangeDone=!1,!t)throw new Error("No container provided");t.appendChild(this.dom.root),t.appendChild(this.dom.loadingScreen)}setOptions(t){if(t){const e=["width","height","minHeight","maxHeight","autoResize","start","end","clickToUse","dataAttributes","hiddenDates","locale","locales","moment","preferZoom","rtl","zoomKey","horizontalScroll","verticalScroll","longSelectPressTime","snap"];if(Wo.selectiveExtend(e,this.options,t),this.dom.rollingModeBtn.style.visibility="hidden",this.options.rtl&&(this.dom.container.style.direction="rtl",this.dom.backgroundVertical.className="vis-panel vis-background vis-vertical-rtl"),this.options.verticalScroll&&(this.options.rtl?this.dom.rightContainer.className="vis-panel vis-right vis-vertical-scroll":this.dom.leftContainer.className="vis-panel vis-left vis-vertical-scroll"),"object"!=typeof this.options.orientation&&(this.options.orientation={item:void 0,axis:void 0}),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation={item:t.orientation,axis:t.orientation}:"object"==typeof t.orientation&&("item"in t.orientation&&(this.options.orientation.item=t.orientation.item),"axis"in t.orientation&&(this.options.orientation.axis=t.orientation.axis))),"both"===this.options.orientation.axis){if(!this.timeAxis2){const t=this.timeAxis2=new rs(this.body);t.setOptions=e=>{const i=e?Wo.extend({},e):{};i.orientation="top",rs.prototype.setOptions.call(t,i)},this.components.push(t)}}else if(this.timeAxis2){const t=this.components.indexOf(this.timeAxis2);-1!==t&&this.components.splice(t,1),this.timeAxis2.destroy(),this.timeAxis2=null}"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),"hiddenDates"in this.options&&Vo(this.options.moment,this.body,this.options.hiddenDates),"clickToUse"in t&&(t.clickToUse?this.activator||(this.activator=new ls(this.dom.root)):this.activator&&(this.activator.destroy(),delete this.activator)),this._initAutoResize()}if(this.components.forEach((e=>e.setOptions(t))),"configure"in t){this.configurator||(this.configurator=this._createConfigurator()),this.configurator.setOptions(t.configure);const e=Wo.deepExtend({},this.options);this.components.forEach((t=>{Wo.deepExtend(e,t.options)})),this.configurator.setModuleOptions({global:e})}this._redraw()}isActive(){return!this.activator||this.activator.active}destroy(){this.setItems(null),this.setGroups(null),this.off(),this._stopAutoResize(),this.dom.root.parentNode&&this.dom.root.parentNode.removeChild(this.dom.root),this.dom=null,this.activator&&(this.activator.destroy(),delete this.activator);for(const t in this.timelineListeners)this.timelineListeners.hasOwnProperty(t)&&delete this.timelineListeners[t];this.timelineListeners=null,this.hammer&&this.hammer.destroy(),this.hammer=null,this.components.forEach((t=>t.destroy())),this.body=null}setCustomTime(t,e){const i=this.customTimes.filter((t=>e===t.options.id));if(0===i.length)throw new Error(`No custom time bar found with id ${JSON.stringify(e)}`);i.length>0&&i[0].setCustomTime(t)}getCustomTime(t){const e=this.customTimes.filter((e=>e.options.id===t));if(0===e.length)throw new Error(`No custom time bar found with id ${JSON.stringify(t)}`);return e[0].getCustomTime()}setCustomTimeMarker(t,e,i){const n=this.customTimes.filter((t=>t.options.id===e));if(0===n.length)throw new Error(`No custom time bar found with id ${JSON.stringify(e)}`);n.length>0&&n[0].setCustomMarker(t,i)}setCustomTimeTitle(t,e){const i=this.customTimes.filter((t=>t.options.id===e));if(0===i.length)throw new Error(`No custom time bar found with id ${JSON.stringify(e)}`);if(i.length>0)return i[0].setCustomTitle(t)}getEventProperties(t){return{event:t}}addCustomTime(t,e){const i=void 0!==t?Wo.convert(t,"Date"):new Date,n=this.customTimes.some((t=>t.options.id===e));if(n)throw new Error(`A custom time with id ${JSON.stringify(e)} already exists`);const o=new Ds(this.body,Wo.extend({},this.options,{time:i,id:e,snap:this.itemSet?this.itemSet.options.snap:this.options.snap}));return this.customTimes.push(o),this.components.push(o),this._redraw(),e}removeCustomTime(t){const e=this.customTimes.filter((e=>e.options.id===t));if(0===e.length)throw new Error(`No custom time bar found with id ${JSON.stringify(t)}`);e.forEach((t=>{this.customTimes.splice(this.customTimes.indexOf(t),1),this.components.splice(this.components.indexOf(t),1),t.destroy()}))}getVisibleItems(){return this.itemSet&&this.itemSet.getVisibleItems()||[]}getItemsAtCurrentTime(t){return this.time=t,this.itemSet&&this.itemSet.getItemsAtCurrentTime(this.time)||[]}getVisibleGroups(){return this.itemSet&&this.itemSet.getVisibleGroups()||[]}fit(t,e){const i=this.getDataRange();if(null===i.min&&null===i.max)return;const n=i.max-i.min,o=new Date(i.min.valueOf()-.01*n),s=new Date(i.max.valueOf()+.01*n),r=!t||void 0===t.animation||t.animation;this.range.setRange(o,s,{animation:r},e)}getDataRange(){throw new Error("Cannot invoke abstract method getDataRange")}setWindow(t,e,i,n){let o,s;"function"==typeof arguments[2]&&(n=arguments[2],i={}),1==arguments.length?(s=arguments[0],o=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:o})):2==arguments.length&&"function"==typeof arguments[1]?(s=arguments[0],n=arguments[1],o=void 0===s.animation||s.animation,this.range.setRange(s.start,s.end,{animation:o},n)):(o=!i||void 0===i.animation||i.animation,this.range.setRange(t,e,{animation:o},n))}moveTo(t,e,i){"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.range.end-this.range.start,o=Wo.convert(t,"Date").valueOf(),s=o-n/2,r=o+n/2,a=!e||void 0===e.animation||e.animation;this.range.setRange(s,r,{animation:a},i)}getWindow(){const t=this.range.getRange();return{start:new Date(t.start),end:new Date(t.end)}}zoomIn(t,e,i){if(!t||t<0||t>1)return;"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.getWindow(),o=n.start.valueOf(),s=n.end.valueOf(),r=s-o,a=(r-r/(1+t))/2,l=o+a,h=s-a;this.setWindow(l,h,e,i)}zoomOut(t,e,i){if(!t||t<0||t>1)return;"function"==typeof arguments[1]&&(i=arguments[1],e={});const n=this.getWindow(),o=n.start.valueOf(),s=n.end.valueOf(),r=s-o,a=o-r*t/2,l=s+r*t/2;this.setWindow(a,l,e,i)}redraw(){this._redraw()}_redraw(){this.redrawCount++;const t=this.dom;if(!t||!t.container||0==t.root.offsetWidth)return;let e=!1;const i=this.options,n=this.props;Uo(this.options.moment,this.body,this.options.hiddenDates),"top"==i.orientation?(Wo.addClassName(t.root,"vis-top"),Wo.removeClassName(t.root,"vis-bottom")):(Wo.removeClassName(t.root,"vis-top"),Wo.addClassName(t.root,"vis-bottom")),i.rtl?(Wo.addClassName(t.root,"vis-rtl"),Wo.removeClassName(t.root,"vis-ltr")):(Wo.addClassName(t.root,"vis-ltr"),Wo.removeClassName(t.root,"vis-rtl")),t.root.style.maxHeight=Wo.option.asSize(i.maxHeight,""),t.root.style.minHeight=Wo.option.asSize(i.minHeight,""),t.root.style.width=Wo.option.asSize(i.width,"");const o=t.root.offsetWidth;n.border.left=1,n.border.right=1,n.border.top=1,n.border.bottom=1,n.center.height=t.center.offsetHeight,n.left.height=t.left.offsetHeight,n.right.height=t.right.offsetHeight,n.top.height=t.top.clientHeight||-n.border.top,n.bottom.height=Math.round(t.bottom.getBoundingClientRect().height)||t.bottom.clientHeight||-n.border.bottom;const s=Math.max(n.left.height,n.center.height,n.right.height),r=n.top.height+s+n.bottom.height+n.border.top+n.border.bottom;t.root.style.height=Wo.option.asSize(i.height,`${r}px`),n.root.height=t.root.offsetHeight,n.background.height=n.root.height;const a=n.root.height-n.top.height-n.bottom.height;n.centerContainer.height=a,n.leftContainer.height=a,n.rightContainer.height=n.leftContainer.height,n.root.width=o,n.background.width=n.root.width,this.initialDrawDone||(n.scrollbarWidth=Wo.getScrollBarWidth());const l=t.leftContainer.clientWidth,h=t.rightContainer.clientWidth;i.verticalScroll?i.rtl?(n.left.width=l||-n.border.left,n.right.width=h+n.scrollbarWidth||-n.border.right):(n.left.width=l+n.scrollbarWidth||-n.border.left,n.right.width=h||-n.border.right):(n.left.width=l||-n.border.left,n.right.width=h||-n.border.right),this._setDOM();let d=this._updateScrollTop();"top"!=i.orientation.item&&(d+=Math.max(n.centerContainer.height-n.center.height-n.border.top-n.border.bottom,0)),t.center.style.transform=`translateY(${d}px)`;const c=0==n.scrollTop?"hidden":"",u=n.scrollTop==n.scrollTopMin?"hidden":"";t.shadowTop.style.visibility=c,t.shadowBottom.style.visibility=u,t.shadowTopLeft.style.visibility=c,t.shadowBottomLeft.style.visibility=u,t.shadowTopRight.style.visibility=c,t.shadowBottomRight.style.visibility=u,i.verticalScroll&&(t.rightContainer.className="vis-panel vis-right vis-vertical-scroll",t.leftContainer.className="vis-panel vis-left vis-vertical-scroll",t.shadowTopRight.style.visibility="hidden",t.shadowBottomRight.style.visibility="hidden",t.shadowTopLeft.style.visibility="hidden",t.shadowBottomLeft.style.visibility="hidden",t.left.style.top="0px",t.right.style.top="0px"),(!i.verticalScroll||n.center.height<n.centerContainer.height)&&(t.left.style.top=`${d}px`,t.right.style.top=`${d}px`,t.rightContainer.className=t.rightContainer.className.replace(new RegExp("(?:^|\\s)vis-vertical-scroll(?:\\s|$)")," "),t.leftContainer.className=t.leftContainer.className.replace(new RegExp("(?:^|\\s)vis-vertical-scroll(?:\\s|$)")," "),n.left.width=l||-n.border.left,n.right.width=h||-n.border.right,this._setDOM());const p=n.center.height>n.centerContainer.height;this.hammer.get("pan").set({direction:p?ns.DIRECTION_ALL:ns.DIRECTION_HORIZONTAL}),this.hammer.get("press").set({time:this.options.longSelectPressTime}),this.components.forEach((t=>{e=t.redraw()||e}));if(e){if(this.redrawCount<5)return void this.body.emitter.emit("_change");console.log("WARNING: infinite loop in redraw?")}else this.redrawCount=0;this.body.emitter.emit("changed")}_setDOM(){const t=this.props,e=this.dom;t.leftContainer.width=t.left.width,t.rightContainer.width=t.right.width;const i=t.root.width-t.left.width-t.right.width;t.center.width=i,t.centerContainer.width=i,t.top.width=i,t.bottom.width=i,e.background.style.height=`${t.background.height}px`,e.backgroundVertical.style.height=`${t.background.height}px`,e.backgroundHorizontal.style.height=`${t.centerContainer.height}px`,e.centerContainer.style.height=`${t.centerContainer.height}px`,e.leftContainer.style.height=`${t.leftContainer.height}px`,e.rightContainer.style.height=`${t.rightContainer.height}px`,e.background.style.width=`${t.background.width}px`,e.backgroundVertical.style.width=`${t.centerContainer.width}px`,e.backgroundHorizontal.style.width=`${t.background.width}px`,e.centerContainer.style.width=`${t.center.width}px`,e.top.style.width=`${t.top.width}px`,e.bottom.style.width=`${t.bottom.width}px`,e.background.style.left="0",e.background.style.top="0",e.backgroundVertical.style.left=`${t.left.width+t.border.left}px`,e.backgroundVertical.style.top="0",e.backgroundHorizontal.style.left="0",e.backgroundHorizontal.style.top=`${t.top.height}px`,e.centerContainer.style.left=`${t.left.width}px`,e.centerContainer.style.top=`${t.top.height}px`,e.leftContainer.style.left="0",e.leftContainer.style.top=`${t.top.height}px`,e.rightContainer.style.left=`${t.left.width+t.center.width}px`,e.rightContainer.style.top=`${t.top.height}px`,e.top.style.left=`${t.left.width}px`,e.top.style.top="0",e.bottom.style.left=`${t.left.width}px`,e.bottom.style.top=`${t.top.height+t.centerContainer.height}px`,e.center.style.left="0",e.left.style.left="0",e.right.style.left="0"}setCurrentTime(t){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");this.currentTime.setCurrentTime(t)}getCurrentTime(){if(!this.currentTime)throw new Error("Option showCurrentTime must be true");return this.currentTime.getCurrentTime()}_toTime(t){return qo(this,t,this.props.center.width)}_toGlobalTime(t){return qo(this,t,this.props.root.width)}_toScreen(t){return $o(this,t,this.props.center.width)}_toGlobalScreen(t){return $o(this,t,this.props.root.width)}_initAutoResize(){1==this.options.autoResize?this._startAutoResize():this._stopAutoResize()}_startAutoResize(){const t=this;this._stopAutoResize(),this._onResize=()=>{if(1==t.options.autoResize){if(t.dom.root){const e=t.dom.root.offsetHeight,i=t.dom.root.offsetWidth;i==t.props.lastWidth&&e==t.props.lastHeight||(t.props.lastWidth=i,t.props.lastHeight=e,t.props.scrollbarWidth=Wo.getScrollBarWidth(),t.body.emitter.emit("_change"))}}else t._stopAutoResize()},Wo.addEventListener(window,"resize",this._onResize),t.dom.root&&(t.props.lastWidth=t.dom.root.offsetWidth,t.props.lastHeight=t.dom.root.offsetHeight),this.watchTimer=setInterval(this._onResize,1e3)}_stopAutoResize(){this.watchTimer&&(clearInterval(this.watchTimer),this.watchTimer=void 0),this._onResize&&(Wo.removeEventListener(window,"resize",this._onResize),this._onResize=null)}_onTouch(t){this.touch.allowDragging=!0,this.touch.initialScrollTop=this.props.scrollTop}_onPinch(t){this.touch.allowDragging=!1}_onDrag(t){if(!t)return;if(!this.touch.allowDragging)return;const e=t.deltaY,i=this._getScrollTop(),n=this._setScrollTop(this.touch.initialScrollTop+e);this.options.verticalScroll&&(this.dom.left.parentNode.scrollTop=-this.props.scrollTop,this.dom.right.parentNode.scrollTop=-this.props.scrollTop),n!=i&&this.emit("verticalDrag")}_setScrollTop(t){return this.props.scrollTop=t,this._updateScrollTop(),this.props.scrollTop}_updateScrollTop(){const t=Math.min(this.props.centerContainer.height-this.props.border.top-this.props.border.bottom-this.props.center.height,0);return t!=this.props.scrollTopMin&&("top"!=this.options.orientation.item&&(this.props.scrollTop+=t-this.props.scrollTopMin),this.props.scrollTopMin=t),this.props.scrollTop>0&&(this.props.scrollTop=0),this.props.scrollTop<t&&(this.props.scrollTop=t),this.options.verticalScroll&&(this.dom.left.parentNode.scrollTop=-this.props.scrollTop,this.dom.right.parentNode.scrollTop=-this.props.scrollTop),this.props.scrollTop}_getScrollTop(){return this.props.scrollTop}_createConfigurator(){throw new Error("Cannot invoke abstract method _createConfigurator")}}G(Cs.prototype);class Ss extends Go{constructor(t,e){super(),this.body=t,this.defaultOptions={rtl:!1,showCurrentTime:!0,alignCurrentTime:void 0,moment:No,locales:ks,locale:"en"},this.options=Wo.extend({},this.defaultOptions),this.setOptions(e),this.options.locales=Wo.extend({},ks,this.options.locales);const i=this.defaultOptions.locales[this.defaultOptions.locale];Object.keys(this.options.locales).forEach((t=>{this.options.locales[t]=Wo.extend({},i,this.options.locales[t])})),this.offset=0,this._create()}_create(){const t=document.createElement("div");t.className="vis-current-time",t.style.position="absolute",t.style.top="0px",t.style.height="100%",this.bar=t}destroy(){this.options.showCurrentTime=!1,this.redraw(),this.body=null}setOptions(t){t&&Wo.selectiveExtend(["rtl","showCurrentTime","alignCurrentTime","moment","locale","locales"],this.options,t)}redraw(){if(this.options.showCurrentTime){const t=this.body.dom.backgroundVertical;this.bar.parentNode!=t&&(this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),t.appendChild(this.bar),this.start());let e=this.options.moment(Date.now()+this.offset);this.options.alignCurrentTime&&(e=e.startOf(this.options.alignCurrentTime));const i=this.body.util.toScreen(e);let n=this.options.locales[this.options.locale];n||(this.warned||(console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`),this.warned=!0),n=this.options.locales.en);let o=`${n.current} ${n.time}: ${e.format("dddd, MMMM Do YYYY, H:mm:ss")}`;o=o.charAt(0).toUpperCase()+o.substring(1),this.options.rtl?this.bar.style.transform=`translateX(${-1*i}px)`:this.bar.style.transform=`translateX(${i}px)`,this.bar.title=o}else this.bar.parentNode&&this.bar.parentNode.removeChild(this.bar),this.stop();return!1}start(){const t=this;!function e(){t.stop();let i=1/t.body.range.conversion(t.body.domProps.center.width).scale/10;i<30&&(i=30),i>1e3&&(i=1e3),t.redraw(),t.body.emitter.emit("currentTimeTick"),t.currentTimeTimer=setTimeout(e,i)}()}stop(){void 0!==this.currentTimeTimer&&(clearTimeout(this.currentTimeTimer),delete this.currentTimeTimer)}setCurrentTime(t){const e=Wo.convert(t,"Date").valueOf(),i=Date.now();this.offset=e-i,this.redraw()}getCurrentTime(){return new Date(Date.now()+this.offset)}}const Ts=.001;function Es(t,e,i,n){return null===As(t,e.item,!1,(t=>t.stack&&(i||null===t.top)),(t=>t.stack),(t=>e.axis),n)}function Ms(t,e,i){const n=As(t,e.item,!1,(t=>t.stack),(t=>!0),(t=>t.baseTop));i.height=n-i.top+.5*e.item.vertical}function Os(t,e,i,n){for(let o=0;o<t.length;o++)if(null==t[o].data.subgroup)t[o].top=e.item.vertical;else if(void 0!==t[o].data.subgroup&&n){let n=0;for(const e in i)i.hasOwnProperty(e)&&1==i[e].visible&&i[e].index<i[t[o].data.subgroup].index&&(n+=i[e].height,i[t[o].data.subgroup].top=n);t[o].top=n+.5*e.item.vertical}n||function(t,e,i){As(Object.values(i).sort(((t,e)=>t.index>e.index?1:t.index<e.index?-1:0)),{vertical:0},!0,(t=>!0),(t=>!0),(t=>0));for(let n=0;n<t.length;n++)void 0!==t[n].data.subgroup&&(t[n].top=i[t[n].data.subgroup].top+.5*e.item.vertical)}(t,e,i)}function Is(t,e,i){let n=!1;const o=[];for(var s in i)i[s].hasOwnProperty("index")?o[i[s].index]=s:o.push(s);for(let r=0;r<o.length;r++)if(s=o[r],i.hasOwnProperty(s)){n=n||i[s].stack,i[s].top=0;for(const t in i)i[t].visible&&i[s].index>i[t].index&&(i[s].top+=i[t].height);const o=t[s];for(let t=0;t<o.length;t++)void 0!==o[t].data.subgroup&&(o[t].top=i[o[t].data.subgroup].top+.5*e.item.vertical,i[s].stack&&(o[t].baseTop=o[t].top));n&&i[s].stack&&Ms(t[s],e,i[s])}}function As(t,e,i,n,o,s,r){let a=t=>t.start,l=t=>t.end;if(!i){const i=!(!t[0]||!t[0].options.rtl);a=i?t=>t.right:t=>t.left,l=t=>a(t)+t.width+e.horizontal}const h=[],d=[];let c=null,u=0;for(const e of t)if(n(e))h.push(e);else if(o(e)){const t=a(e);null!==c&&t<c-Ts&&(u=0),c=t,u=Ps(d,(e=>a(e)-Ts>t),u),d.splice(u,0,e),u++}c=null;let p=null;u=0;let m=0,f=0,g=0;for(;h.length>0;){const t=h.shift();t.top=s(t);const i=a(t),n=l(t);null!==c&&i<c-Ts&&(m=0,f=0,u=0,p=null),c=i,m=Ps(d,(t=>i<l(t)-Ts),m),(null===p||p<n-Ts)&&(f=Ps(d,(t=>n<a(t)-Ts),Math.max(m,f))),null!==p&&p-Ts>n&&(f=Ns(d,(t=>n+Ts>=a(t)),m,horizontalOVerlapEndIndex)+1);const w=d.slice(m,f).filter((t=>i<l(t)-Ts&&n-Ts>a(t))).sort(((t,e)=>t.top-e.top));for(let i=0;i<w.length;i++){const n=w[i];y=n,b=e,(v=t).top-b.vertical+Ts<y.top+y.height&&v.top+v.height+b.vertical-Ts>y.top&&(t.top=n.top+n.height+e.vertical)}o(t)&&(u=Ps(d,(t=>a(t)-Ts>i),u),d.splice(u,0,t),u++);const _=t.top+t.height;if(_>g&&(g=_),r&&r())return null}var v,y,b;return g}function Ps(t,e,i){i||(i=0);const n=t.slice(i).findIndex(e);return-1===n?t.length:n+i}function Ns(t,e,n,o){for(n||(n=0),o||(o=t.length),i=o-1;i>=n;i--)if(e(t[i]))return i;return n-1}const Fs="__background__";class Rs{constructor(t,e,i){if(this.groupId=t,this.subgroups={},this.subgroupStack={},this.subgroupStackAll=!1,this.subgroupVisibility={},this.doInnerStack=!1,this.shouldBailStackItems=!1,this.subgroupIndex=0,this.subgroupOrderer=e&&e.subgroupOrder,this.itemSet=i,this.isVisible=null,this.stackDirty=!0,this._disposeCallbacks=[],e&&e.nestedGroups&&(this.nestedGroups=e.nestedGroups,0==e.showNested?this.showNested=!1:this.showNested=!0),e&&e.subgroupStack)if("boolean"==typeof e.subgroupStack)this.doInnerStack=e.subgroupStack,this.subgroupStackAll=e.subgroupStack;else for(const t in e.subgroupStack)this.subgroupStack[t]=e.subgroupStack[t],this.doInnerStack=this.doInnerStack||e.subgroupStack[t];e&&e.heightMode?this.heightMode=e.heightMode:this.heightMode=i.options.groupHeightMode,this.nestedInGroup=null,this.dom={},this.props={label:{width:0,height:0}},this.className=null,this.items={},this.visibleItems=[],this.itemsInRange=[],this.orderedItems={byStart:[],byEnd:[]},this.checkRangedItems=!1;const n=()=>{this.checkRangedItems=!0};this.itemSet.body.emitter.on("checkRangedItems",n),this._disposeCallbacks.push((()=>{this.itemSet.body.emitter.off("checkRangedItems",n)})),this._create(),this.setData(e)}_create(){const t=document.createElement("div");this.itemSet.options.groupEditable.order?t.className="vis-label draggable":t.className="vis-label",this.dom.label=t;const e=document.createElement("div");e.className="vis-inner",t.appendChild(e),this.dom.inner=e;const i=document.createElement("div");i.className="vis-group",i["vis-group"]=this,this.dom.foreground=i,this.dom.background=document.createElement("div"),this.dom.background.className="vis-group",this.dom.axis=document.createElement("div"),this.dom.axis.className="vis-group",this.dom.marker=document.createElement("div"),this.dom.marker.style.visibility="hidden",this.dom.marker.style.position="absolute",this.dom.marker.innerHTML="",this.dom.background.appendChild(this.dom.marker)}setData(t){if(this.itemSet.groupTouchParams.isDragging)return;let e,i;if(t&&t.subgroupVisibility)for(const e in t.subgroupVisibility)this.subgroupVisibility[e]=t.subgroupVisibility[e];if(this.itemSet.options&&this.itemSet.options.groupTemplate?(i=this.itemSet.options.groupTemplate.bind(this),e=i(t,this.dom.inner)):e=t&&t.content,e instanceof Element){for(;this.dom.inner.firstChild;)this.dom.inner.removeChild(this.dom.inner.firstChild);this.dom.inner.appendChild(e)}else e instanceof Object&&e.isReactComponent||(e instanceof Object?i(t,this.dom.inner):this.dom.inner.innerHTML=null!=e?Wo.xss(e):Wo.xss(this.groupId||""));this.dom.label.title=t&&t.title||"",this.dom.inner.firstChild?Wo.removeClassName(this.dom.inner,"vis-hidden"):Wo.addClassName(this.dom.inner,"vis-hidden"),t&&t.nestedGroups?(this.nestedGroups&&this.nestedGroups==t.nestedGroups||(this.nestedGroups=t.nestedGroups),void 0===t.showNested&&void 0!==this.showNested||(0==t.showNested?this.showNested=!1:this.showNested=!0),Wo.addClassName(this.dom.label,"vis-nesting-group"),this.showNested?(Wo.removeClassName(this.dom.label,"collapsed"),Wo.addClassName(this.dom.label,"expanded")):(Wo.removeClassName(this.dom.label,"expanded"),Wo.addClassName(this.dom.label,"collapsed"))):this.nestedGroups&&(this.nestedGroups=null,Wo.removeClassName(this.dom.label,"collapsed"),Wo.removeClassName(this.dom.label,"expanded"),Wo.removeClassName(this.dom.label,"vis-nesting-group")),t&&(t.treeLevel||t.nestedInGroup)?(Wo.addClassName(this.dom.label,"vis-nested-group"),t.treeLevel?Wo.addClassName(this.dom.label,"vis-group-level-"+t.treeLevel):Wo.addClassName(this.dom.label,"vis-group-level-unknown-but-gte1")):Wo.addClassName(this.dom.label,"vis-group-level-0");const n=t&&t.className||null;n!=this.className&&(this.className&&(Wo.removeClassName(this.dom.label,this.className),Wo.removeClassName(this.dom.foreground,this.className),Wo.removeClassName(this.dom.background,this.className),Wo.removeClassName(this.dom.axis,this.className)),Wo.addClassName(this.dom.label,n),Wo.addClassName(this.dom.foreground,n),Wo.addClassName(this.dom.background,n),Wo.addClassName(this.dom.axis,n),this.className=n),this.style&&(Wo.removeCssText(this.dom.label,this.style),this.style=null),t&&t.style&&(Wo.addCssText(this.dom.label,t.style),this.style=t.style)}getLabelWidth(){return this.props.label.width}_didMarkerHeightChange(){const t=this.dom.marker.clientHeight;if(t!=this.lastMarkerHeight){this.lastMarkerHeight=t;const e={};let i=0;Wo.forEach(this.items,((t,n)=>{if(t.dirty=!0,t.displayed){const o=!0;e[n]=t.redraw(o),i=e[n].length}}));if(i>0)for(let t=0;t<i;t++)Wo.forEach(e,(e=>{e[t]()}));return!0}return!1}_calculateGroupSizeAndPosition(){const{offsetTop:t,offsetLeft:e,offsetWidth:i}=this.dom.foreground;this.top=t,this.right=e,this.width=i}_shouldBailItemsRedraw(){const t=this,e=this.itemSet.options.onTimeout,i={relativeBailingTime:this.itemSet.itemsSettingTime,bailTimeMs:e&&e.timeoutMs,userBailFunction:e&&e.callback,shouldBailStackItems:this.shouldBailStackItems};let n=null;if(!this.itemSet.initialDrawDone){if(i.shouldBailStackItems)return!0;Math.abs(Date.now()-new Date(i.relativeBailingTime))>i.bailTimeMs&&(i.userBailFunction&&null==this.itemSet.userContinueNotBail?i.userBailFunction((e=>{t.itemSet.userContinueNotBail=e,n=!e})):n=0==t.itemSet.userContinueNotBail)}return n}_redrawItems(t,e,i,n){if(t||this.stackDirty||this.isVisible&&!e){const t={byEnd:this.orderedItems.byEnd.filter((t=>!t.isCluster)),byStart:this.orderedItems.byStart.filter((t=>!t.isCluster))},e={byEnd:[...new Set(this.orderedItems.byEnd.map((t=>t.cluster)).filter((t=>!!t)))],byStart:[...new Set(this.orderedItems.byStart.map((t=>t.cluster)).filter((t=>!!t)))]},o=()=>[...this._updateItemsInRange(t,this.visibleItems.filter((t=>!t.isCluster)),n),...this._updateClustersInRange(e,this.visibleItems.filter((t=>t.isCluster)),n)],s=t=>{let e={};for(const i in this.subgroups){const n=this.visibleItems.filter((t=>t.data.subgroup===i));e[i]=t?n.sort(((e,i)=>t(e.data,i.data))):n}return e};if("function"==typeof this.itemSet.options.order){const t=this;if(this.doInnerStack&&this.itemSet.options.stackSubgroups){Is(s(this.itemSet.options.order),i,this.subgroups),this.visibleItems=o(),this._updateSubGroupHeights(i)}else{this.visibleItems=o(),this._updateSubGroupHeights(i);const e=this.visibleItems.slice().filter((t=>t.isCluster||!t.isCluster&&!t.cluster)).sort(((e,i)=>t.itemSet.options.order(e.data,i.data)));this.shouldBailStackItems=Es(e,i,!0,this._shouldBailItemsRedraw.bind(this))}}else if(this.visibleItems=o(),this._updateSubGroupHeights(i),this.itemSet.options.stack)if(this.doInnerStack&&this.itemSet.options.stackSubgroups){Is(s(),i,this.subgroups)}else this.shouldBailStackItems=Es(this.visibleItems,i,!0,this._shouldBailItemsRedraw.bind(this));else Os(this.visibleItems,i,this.subgroups,this.itemSet.options.stackSubgroups);for(let t=0;t<this.visibleItems.length;t++)this.visibleItems[t].repositionX(),void 0!==this.subgroupVisibility[this.visibleItems[t].data.subgroup]&&(this.subgroupVisibility[this.visibleItems[t].data.subgroup]||this.visibleItems[t].hide());this.itemSet.options.cluster&&Wo.forEach(this.items,(t=>{t.cluster&&t.displayed&&t.hide()})),this.shouldBailStackItems&&this.itemSet.body.emitter.emit("destroyTimeline"),this.stackDirty=!1}}_didResize(t,e){t=Wo.updateProperty(this,"height",e)||t;const i=this.dom.inner.clientWidth,n=this.dom.inner.clientHeight;return t=Wo.updateProperty(this.props.label,"width",i)||t,t=Wo.updateProperty(this.props.label,"height",n)||t}_applyGroupHeight(t){this.dom.background.style.height=`${t}px`,this.dom.foreground.style.height=`${t}px`,this.dom.label.style.height=`${t}px`}_updateItemsVerticalPosition(t){for(let e=0,i=this.visibleItems.length;e<i;e++){const i=this.visibleItems[e];i.repositionY(t),this.isVisible||this.groupId==Fs||i.displayed&&i.hide()}}redraw(t,e,i,n){let o=!1;const s=this.isVisible;let r;const a=[()=>{i=this._didMarkerHeightChange.call(this)||i},this._updateSubGroupHeights.bind(this,e),this._calculateGroupSizeAndPosition.bind(this),()=>{this.isVisible=this._isGroupVisible.bind(this)(t,e)},()=>{this._redrawItems.bind(this)(i,s,e,t)},this._updateSubgroupsSizes.bind(this),()=>{r=this._calculateHeight.bind(this)(e)},this._calculateGroupSizeAndPosition.bind(this),()=>{o=this._didResize.bind(this)(o,r)},()=>{this._applyGroupHeight.bind(this)(r)},()=>{this._updateItemsVerticalPosition.bind(this)(e)},(()=>(!this.isVisible&&this.height&&(o=!1),o)).bind(this)];if(n)return a;{let t;return a.forEach((e=>{t=e()})),t}}_updateSubGroupHeights(t){if(Object.keys(this.subgroups).length>0){const e=this;this._resetSubgroups(),Wo.forEach(this.visibleItems,(i=>{void 0!==i.data.subgroup&&(e.subgroups[i.data.subgroup].height=Math.max(e.subgroups[i.data.subgroup].height,i.height+t.item.vertical),e.subgroups[i.data.subgroup].visible=void 0===this.subgroupVisibility[i.data.subgroup]||Boolean(this.subgroupVisibility[i.data.subgroup]))}))}}_isGroupVisible(t,e){return this.top<=t.body.domProps.centerContainer.height-t.body.domProps.scrollTop+e.axis&&this.top+this.height+e.axis>=-t.body.domProps.scrollTop}_calculateHeight(t){let e,i;if(i="fixed"===this.heightMode?Wo.toArray(this.items):this.visibleItems,i.length>0){let n=i[0].top,o=i[0].top+i[0].height;if(Wo.forEach(i,(t=>{n=Math.min(n,t.top),o=Math.max(o,t.top+t.height)})),n>t.axis){const e=n-t.axis;o-=e,Wo.forEach(i,(t=>{t.top-=e}))}e=Math.ceil(o+t.item.vertical/2),"fitItems"!==this.heightMode&&(e=Math.max(e,this.props.label.height))}else e=this.props.label.height;return e}show(){this.dom.label.parentNode||this.itemSet.dom.labelSet.appendChild(this.dom.label),this.dom.foreground.parentNode||this.itemSet.dom.foreground.appendChild(this.dom.foreground),this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background),this.dom.axis.parentNode||this.itemSet.dom.axis.appendChild(this.dom.axis)}hide(){const t=this.dom.label;t.parentNode&&t.parentNode.removeChild(t);const e=this.dom.foreground;e.parentNode&&e.parentNode.removeChild(e);const i=this.dom.background;i.parentNode&&i.parentNode.removeChild(i);const n=this.dom.axis;n.parentNode&&n.parentNode.removeChild(n)}add(t){if(this.items[t.id]=t,t.setParent(this),this.stackDirty=!0,void 0!==t.data.subgroup&&(this._addToSubgroup(t),this.orderSubgroups()),!this.visibleItems.includes(t)){const e=this.itemSet.body.range;this._checkIfVisible(t,this.visibleItems,e)}}_addToSubgroup(t,e=t.data.subgroup){null!=e&&void 0===this.subgroups[e]&&(this.subgroups[e]={height:0,top:0,start:t.data.start,end:t.data.end||t.data.start,visible:!1,index:this.subgroupIndex,items:[],stack:this.subgroupStackAll||this.subgroupStack[e]||!1},this.subgroupIndex++),new Date(t.data.start)<new Date(this.subgroups[e].start)&&(this.subgroups[e].start=t.data.start);const i=t.data.end||t.data.start;new Date(i)>new Date(this.subgroups[e].end)&&(this.subgroups[e].end=i),this.subgroups[e].items.push(t)}_updateSubgroupsSizes(){const t=this;if(t.subgroups)for(const e in t.subgroups){const i=t.subgroups[e].items[0].data.end||t.subgroups[e].items[0].data.start;let n=t.subgroups[e].items[0].data.start,o=i-1;t.subgroups[e].items.forEach((t=>{new Date(t.data.start)<new Date(n)&&(n=t.data.start);const e=t.data.end||t.data.start;new Date(e)>new Date(o)&&(o=e)})),t.subgroups[e].start=n,t.subgroups[e].end=new Date(o-1)}}orderSubgroups(){if(void 0!==this.subgroupOrderer){const t=[];if("string"==typeof this.subgroupOrderer){for(const e in this.subgroups)t.push({subgroup:e,sortField:this.subgroups[e].items[0].data[this.subgroupOrderer]});t.sort(((t,e)=>t.sortField-e.sortField))}else if("function"==typeof this.subgroupOrderer){for(const e in this.subgroups)t.push(this.subgroups[e].items[0].data);t.sort(this.subgroupOrderer)}if(t.length>0)for(let e=0;e<t.length;e++)this.subgroups[t[e].subgroup].index=e}}_resetSubgroups(){for(const t in this.subgroups)this.subgroups.hasOwnProperty(t)&&(this.subgroups[t].visible=!1,this.subgroups[t].height=0)}remove(t){delete this.items[t.id],t.setParent(null),this.stackDirty=!0;const e=this.visibleItems.indexOf(t);-1!=e&&this.visibleItems.splice(e,1),void 0!==t.data.subgroup&&(this._removeFromSubgroup(t),this.orderSubgroups())}_removeFromSubgroup(t,e=t.data.subgroup){if(null!=e){const i=this.subgroups[e];if(i){const n=i.items.indexOf(t);n>=0&&(i.items.splice(n,1),i.items.length?this._updateSubgroupsSizes():delete this.subgroups[e])}}}removeFromDataSet(t){this.itemSet.removeItem(t.id)}order(){const t=Wo.toArray(this.items),e=[],i=[];for(let n=0;n<t.length;n++)void 0!==t[n].data.end&&i.push(t[n]),e.push(t[n]);this.orderedItems={byStart:e,byEnd:i},this.orderedItems.byStart.sort(((t,e)=>t.data.start-e.data.start)),function(t){t.sort(((t,e)=>("end"in t.data?t.data.end:t.data.start)-("end"in e.data?e.data.end:e.data.start)))}(this.orderedItems.byEnd)}_updateItemsInRange(t,e,i){const n=[],o={};if(!this.isVisible&&this.groupId!=Fs){for(let t=0;t<e.length;t++){var s=e[t];s.displayed&&s.hide()}return n}const r=(i.end-i.start)/4,a=i.start-r,l=i.end+r,h=t=>{const{start:e,end:i}=t;return i<a?-1:e<=l?0:1};if(e.length>0)for(let t=0;t<e.length;t++)this._checkIfVisibleWithReference(e[t],n,o,i);const d=Wo.binarySearchCustom(t.byStart,(t=>t<a?-1:t<=l?0:1),"data","start");if(this._traceVisible(d,t.byStart,n,o,(t=>t.data.start<a||t.data.start>l)),1==this.checkRangedItems){this.checkRangedItems=!1;for(let e=0;e<t.byEnd.length;e++)this._checkIfVisibleWithReference(t.byEnd[e],n,o,i)}else{const e=Wo.binarySearchCustom(t.byEnd,h,"data");this._traceVisible(e,t.byEnd,n,o,(t=>t.data.end<a||t.data.start>l))}const c={};let u=0;for(let t=0;t<n.length;t++){const e=n[t];if(!e.displayed){const i=!0;c[t]=e.redraw(i),u=c[t].length}}if(u>0)for(let t=0;t<u;t++)Wo.forEach(c,(e=>{e[t]()}));for(let t=0;t<n.length;t++)n[t].repositionX();return n}_traceVisible(t,e,i,n,o){if(-1!=t){for(let s=t;s>=0;s--){let t=e[s];if(o(t))break;t.isCluster&&!t.hasItems()||t.cluster||void 0===n[t.id]&&(n[t.id]=!0,i.push(t))}for(let s=t+1;s<e.length;s++){let t=e[s];if(o(t))break;t.isCluster&&!t.hasItems()||t.cluster||void 0===n[t.id]&&(n[t.id]=!0,i.push(t))}}}_checkIfVisible(t,e,i){t.isVisible(i)?(t.displayed||t.show(),t.repositionX(),e.push(t)):t.displayed&&t.hide()}_checkIfVisibleWithReference(t,e,i,n){t.isVisible(n)?void 0===i[t.id]&&(i[t.id]=!0,e.push(t)):t.displayed&&t.hide()}_updateClustersInRange(t,e,i){const n=[],o={};if(e.length>0)for(let t=0;t<e.length;t++)this._checkIfVisibleWithReference(e[t],n,o,i);for(let e=0;e<t.byStart.length;e++)this._checkIfVisibleWithReference(t.byStart[e],n,o,i);for(let e=0;e<t.byEnd.length;e++)this._checkIfVisibleWithReference(t.byEnd[e],n,o,i);const s={};let r=0;for(let t=0;t<n.length;t++){const e=n[t];if(!e.displayed){const i=!0;s[t]=e.redraw(i),r=s[t].length}}if(r>0)for(var a=0;a<r;a++)Wo.forEach(s,(function(t){t[a]()}));for(let t=0;t<n.length;t++)n[t].repositionX();return n}changeSubgroup(t,e,i){this._removeFromSubgroup(t,e),this._addToSubgroup(t,i),this.orderSubgroups()}dispose(){let t;for(this.hide();t=this._disposeCallbacks.pop();)t()}}class Ls extends Rs{constructor(t,e,i){super(t,e,i),this.width=0,this.height=0,this.top=0,this.left=0}redraw(t,e,i){this.visibleItems=this._updateItemsInRange(this.orderedItems,this.visibleItems,t),this.width=this.dom.background.offsetWidth,this.dom.background.style.height="0";for(let t=0,i=this.visibleItems.length;t<i;t++){this.visibleItems[t].repositionY(e)}return!1}show(){this.dom.background.parentNode||this.itemSet.dom.background.appendChild(this.dom.background)}}class js{constructor(t,e,i){this.id=null,this.parent=null,this.data=t,this.dom=null,this.conversion=e||{},this.defaultOptions={locales:ks,locale:"en"},this.options=Wo.extend({},this.defaultOptions,i),this.options.locales=Wo.extend({},ks,this.options.locales);const n=this.defaultOptions.locales[this.defaultOptions.locale];Object.keys(this.options.locales).forEach((t=>{this.options.locales[t]=Wo.extend({},n,this.options.locales[t])})),this.selected=!1,this.displayed=!1,this.groupShowing=!0,this.selectable=i&&i.selectable||!1,this.dirty=!0,this.top=null,this.right=null,this.left=null,this.width=null,this.height=null,this.setSelectability(t),this.editable=null,this._updateEditStatus()}select(){this.selectable&&(this.selected=!0,this.dirty=!0,this.displayed&&this.redraw())}unselect(){this.selected=!1,this.dirty=!0,this.displayed&&this.redraw()}setData(t){null!=t.group&&this.data.group!=t.group&&null!=this.parent&&this.parent.itemSet._moveToGroup(this,t.group),this.setSelectability(t),this.parent&&(this.parent.stackDirty=!0);null!=t.subgroup&&this.data.subgroup!=t.subgroup&&null!=this.parent&&this.parent.changeSubgroup(this,this.data.subgroup,t.subgroup),this.data=t,this._updateEditStatus(),this.dirty=!0,this.displayed&&this.redraw()}setSelectability(t){t&&(this.selectable=void 0===t.selectable||Boolean(t.selectable))}setParent(t){this.displayed?(this.hide(),this.parent=t,this.parent&&this.show()):this.parent=t}isVisible(t){return!1}show(){return!1}hide(){return!1}redraw(){}repositionX(){}repositionY(){}_repaintDragCenter(){if(this.selected&&this.editable.updateTime&&!this.dom.dragCenter){const t=this,e=document.createElement("div");e.className="vis-drag-center",e.dragCenterItem=this,this.hammerDragCenter=new ns(e),this.hammerDragCenter.on("tap",(e=>{t.parent.itemSet.body.emitter.emit("click",{event:e,item:t.id})})),this.hammerDragCenter.on("doubletap",(e=>{e.stopPropagation(),t.parent.itemSet._onUpdateItem(t),t.parent.itemSet.body.emitter.emit("doubleClick",{event:e,item:t.id})})),this.hammerDragCenter.on("panstart",(e=>{e.stopPropagation(),t.parent.itemSet._onDragStart(e)})),this.hammerDragCenter.on("panmove",t.parent.itemSet._onDrag.bind(t.parent.itemSet)),this.hammerDragCenter.on("panend",t.parent.itemSet._onDragEnd.bind(t.parent.itemSet)),this.hammerDragCenter.get("press").set({time:1e4}),this.dom.box?this.dom.dragLeft?this.dom.box.insertBefore(e,this.dom.dragLeft):this.dom.box.appendChild(e):this.dom.point&&this.dom.point.appendChild(e),this.dom.dragCenter=e}else!this.selected&&this.dom.dragCenter&&(this.dom.dragCenter.parentNode&&this.dom.dragCenter.parentNode.removeChild(this.dom.dragCenter),this.dom.dragCenter=null,this.hammerDragCenter&&(this.hammerDragCenter.destroy(),this.hammerDragCenter=null))}_repaintDeleteButton(t){const e=(this.options.editable.overrideItems||null==this.editable)&&this.options.editable.remove||!this.options.editable.overrideItems&&null!=this.editable&&this.editable.remove;if(this.selected&&e&&!this.dom.deleteButton){const e=this,i=document.createElement("div");this.options.rtl?i.className="vis-delete-rtl":i.className="vis-delete";let n=this.options.locales[this.options.locale];n||(this.warned||(console.warn(`WARNING: options.locales['${this.options.locale}'] not found. See https://visjs.github.io/vis-timeline/docs/timeline/#Localization`),this.warned=!0),n=this.options.locales.en),i.title=n.deleteSelected,this.hammerDeleteButton=new ns(i).on("tap",(t=>{t.stopPropagation(),e.parent.removeFromDataSet(e)})),t.appendChild(i),this.dom.deleteButton=i}else this.selected&&e||!this.dom.deleteButton||(this.dom.deleteButton.parentNode&&this.dom.deleteButton.parentNode.removeChild(this.dom.deleteButton),this.dom.deleteButton=null,this.hammerDeleteButton&&(this.hammerDeleteButton.destroy(),this.hammerDeleteButton=null))}_repaintOnItemUpdateTimeTooltip(t){if(!this.options.tooltipOnItemUpdateTime)return;const e=(this.options.editable.updateTime||!0===this.data.editable)&&!1!==this.data.editable;if(this.selected&&e&&!this.dom.onItemUpdateTimeTooltip){const e=document.createElement("div");e.className="vis-onUpdateTime-tooltip",t.appendChild(e),this.dom.onItemUpdateTimeTooltip=e}else!this.selected&&this.dom.onItemUpdateTimeTooltip&&(this.dom.onItemUpdateTimeTooltip.parentNode&&this.dom.onItemUpdateTimeTooltip.parentNode.removeChild(this.dom.onItemUpdateTimeTooltip),this.dom.onItemUpdateTimeTooltip=null);if(this.dom.onItemUpdateTimeTooltip){this.dom.onItemUpdateTimeTooltip.style.visibility=this.parent.itemSet.touchParams.itemIsDragging?"visible":"hidden",this.dom.onItemUpdateTimeTooltip.style.transform="translateX(-50%)",this.dom.onItemUpdateTimeTooltip.style.left="50%";const t=50,e=this.parent.itemSet.body.domProps.scrollTop;let i;i="top"==this.options.orientation.item?this.top:this.parent.height-this.top-this.height;let n,o;i+this.parent.top-t<-e?(this.dom.onItemUpdateTimeTooltip.style.bottom="",this.dom.onItemUpdateTimeTooltip.style.top=`${this.height+2}px`):(this.dom.onItemUpdateTimeTooltip.style.top="",this.dom.onItemUpdateTimeTooltip.style.bottom=`${this.height+2}px`),this.options.tooltipOnItemUpdateTime&&this.options.tooltipOnItemUpdateTime.template?(o=this.options.tooltipOnItemUpdateTime.template.bind(this),n=o(this.data)):(n=`start: ${No(this.data.start).format("MM/DD/YYYY hh:mm")}`,this.data.end&&(n+=`<br> end: ${No(this.data.end).format("MM/DD/YYYY hh:mm")}`)),this.dom.onItemUpdateTimeTooltip.innerHTML=Wo.xss(n)}}_getItemData(){return this.parent.itemSet.itemsData.get(this.id)}_updateContents(t){let e,i,n,o,s;const r=this._getItemData(),a=(this.dom.box||this.dom.point).getElementsByClassName("vis-item-visible-frame")[0];if(this.options.visibleFrameTemplate?(s=this.options.visibleFrameTemplate.bind(this),o=Wo.xss(s(r,a))):o="",a)if(o instanceof Object&&!(o instanceof Element))s(r,a);else if(i=this._contentToString(this.itemVisibleFrameContent)!==this._contentToString(o),i){if(o instanceof Element)a.innerHTML="",a.appendChild(o);else if(null!=o)a.innerHTML=Wo.xss(o);else if("background"!=this.data.type||void 0!==this.data.content)throw new Error(`Property "content" missing in item ${this.id}`);this.itemVisibleFrameContent=o}if(this.options.template?(n=this.options.template.bind(this),e=n(r,t,this.data)):e=this.data.content,e instanceof Object&&!(e instanceof Element))n(r,t);else if(i=this._contentToString(this.content)!==this._contentToString(e),i){if(e instanceof Element)t.innerHTML="",t.appendChild(e);else if(null!=e)t.innerHTML=Wo.xss(e);else if("background"!=this.data.type||void 0!==this.data.content)throw new Error(`Property "content" missing in item ${this.id}`);this.content=e}}_updateDataAttributes(t){if(this.options.dataAttributes&&this.options.dataAttributes.length>0){let e=[];if(Array.isArray(this.options.dataAttributes))e=this.options.dataAttributes;else{if("all"!=this.options.dataAttributes)return;e=Object.keys(this.data)}for(const i of e){const e=this.data[i];null!=e?t.setAttribute(`data-${i}`,e):t.removeAttribute(`data-${i}`)}}}_updateStyle(t){this.style&&(Wo.removeCssText(t,this.style),this.style=null),this.data.style&&(Wo.addCssText(t,this.data.style),this.style=this.data.style)}_contentToString(t){return"string"==typeof t?t:t&&"outerHTML"in t?t.outerHTML:t}_updateEditStatus(){this.options&&("boolean"==typeof this.options.editable?this.editable={updateTime:this.options.editable,updateGroup:this.options.editable,remove:this.options.editable}:"object"==typeof this.options.editable&&(this.editable={},Wo.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,this.options.editable))),this.options&&this.options.editable&&!0===this.options.editable.overrideItems||this.data&&("boolean"==typeof this.data.editable?this.editable={updateTime:this.data.editable,updateGroup:this.data.editable,remove:this.data.editable}:"object"==typeof this.data.editable&&(this.editable={},Wo.selectiveExtend(["updateTime","updateGroup","remove"],this.editable,this.data.editable)))}getWidthLeft(){return 0}getWidthRight(){return 0}getTitle(){if(this.options.tooltip&&this.options.tooltip.template){return this.options.tooltip.template.bind(this)(this._getItemData(),this.data)}return this.data.title}}js.prototype.stack=!0;class Ys extends js{constructor(t,e,i){if(super(t,e,i),this.props={content:{width:0}},this.overflow=!1,t){if(null==t.start)throw new Error(`Property "start" missing in item ${t.id}`);if(null==t.end)throw new Error(`Property "end" missing in item ${t.id}`)}}isVisible(t){return!this.cluster&&(this.data.start<t.end&&this.data.end>t.start)}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("div"),this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-item-overflow",this.dom.box.appendChild(this.dom.frame),this.dom.visibleFrame=document.createElement("div"),this.dom.visibleFrame.className="vis-item-visible-frame",this.dom.box.appendChild(this.dom.visibleFrame),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.frame.appendChild(this.dom.content),this.dom.box["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.editable.updateTime||this.editable.updateGroup,e=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(t?" vis-editable":" vis-readonly");this.dom.box.className=this.baseClassName+e,this.dom.content.style.maxWidth="none"}}_getDomComponentsSizes(){return this.overflow="hidden"!==window.getComputedStyle(this.dom.frame).overflow,this.whiteSpace="nowrap"!==window.getComputedStyle(this.dom.content).whiteSpace,{content:{width:this.dom.content.offsetWidth},box:{height:this.dom.box.offsetHeight}}}_updateDomComponentsSizes(t){this.props.content.width=t.content.width,this.height=t.box.height,this.dom.content.style.maxWidth="",this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box),this._repaintDeleteButton(this.dom.box),this._repaintDragCenter(),this._repaintDragLeft(),this._repaintDragRight()}redraw(t){let e;const i=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),()=>{this.dirty&&(e=this._getDomComponentsSizes.bind(this)())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}show(t){if(!this.displayed)return this.redraw(t)}hide(){if(this.displayed){const t=this.dom.box;t.parentNode&&t.parentNode.removeChild(t),this.displayed=!1}}repositionX(t){const e=this.parent.width;let i=this.conversion.toScreen(this.data.start),n=this.conversion.toScreen(this.data.end);const o=void 0===this.data.align?this.options.align:this.data.align;let s,r;!1===this.data.limitSize||void 0!==t&&!0!==t||(i<-e&&(i=-e),n>2*e&&(n=2*e));const a=Math.max(Math.round(1e3*(n-i))/1e3,1);switch(this.overflow?(this.options.rtl?this.right=i:this.left=i,this.width=a+this.props.content.width,r=this.props.content.width):(this.options.rtl?this.right=i:this.left=i,this.width=a,r=Math.min(n-i,this.props.content.width)),this.options.rtl?this.dom.box.style.transform=`translateX(${-1*this.right}px)`:this.dom.box.style.transform=`translateX(${this.left}px)`,this.dom.box.style.width=`${a}px`,this.whiteSpace&&(this.height=this.dom.box.offsetHeight),o){case"left":this.dom.content.style.transform="translateX(0)";break;case"right":if(this.options.rtl){const t=-1*Math.max(a-r,0);this.dom.content.style.transform=`translateX(${t}px)`}else this.dom.content.style.transform=`translateX(${Math.max(a-r,0)}px)`;break;case"center":if(this.options.rtl){const t=-1*Math.max((a-r)/2,0);this.dom.content.style.transform=`translateX(${t}px)`}else this.dom.content.style.transform=`translateX(${Math.max((a-r)/2,0)}px)`;break;default:if(s=this.overflow?n>0?Math.max(-i,0):-r:i<0?-i:0,this.options.rtl){const t=-1*s;this.dom.content.style.transform=`translateX(${t}px)`}else this.dom.content.style.transform=`translateX(${s}px)`}}repositionY(){const t=this.options.orientation.item,e=this.dom.box;e.style.top="top"==t?`${this.top}px`:this.parent.height-this.top-this.height+"px"}_repaintDragLeft(){if((this.selected||this.options.itemsAlwaysDraggable.range)&&this.editable.updateTime&&!this.dom.dragLeft){const t=document.createElement("div");t.className="vis-drag-left",t.dragLeftItem=this,this.dom.box.appendChild(t),this.dom.dragLeft=t}else this.selected||this.options.itemsAlwaysDraggable.range||!this.dom.dragLeft||(this.dom.dragLeft.parentNode&&this.dom.dragLeft.parentNode.removeChild(this.dom.dragLeft),this.dom.dragLeft=null)}_repaintDragRight(){if((this.selected||this.options.itemsAlwaysDraggable.range)&&this.editable.updateTime&&!this.dom.dragRight){const t=document.createElement("div");t.className="vis-drag-right",t.dragRightItem=this,this.dom.box.appendChild(t),this.dom.dragRight=t}else this.selected||this.options.itemsAlwaysDraggable.range||!this.dom.dragRight||(this.dom.dragRight.parentNode&&this.dom.dragRight.parentNode.removeChild(this.dom.dragRight),this.dom.dragRight=null)}}Ys.prototype.baseClassName="vis-item vis-range";class Hs extends js{constructor(t,e,i){if(super(t,e,i),this.props={content:{width:0}},this.overflow=!1,t){if(null==t.start)throw new Error(`Property "start" missing in item ${t.id}`);if(null==t.end)throw new Error(`Property "end" missing in item ${t.id}`)}}isVisible(t){return this.data.start<t.end&&this.data.end>t.start}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("div"),this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-item-overflow",this.dom.box.appendChild(this.dom.frame),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.frame.appendChild(this.dom.content),this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.background;if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.box)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.content),this._updateStyle(this.dom.box);const t=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"");this.dom.box.className=this.baseClassName+t}}_getDomComponentsSizes(){return this.overflow="hidden"!==window.getComputedStyle(this.dom.content).overflow,{content:{width:this.dom.content.offsetWidth}}}_updateDomComponentsSizes(t){this.props.content.width=t.content.width,this.height=0,this.dirty=!1}_repaintDomAdditionals(){}redraw(t){let e;const i=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),()=>{this.dirty&&(e=this._getDomComponentsSizes.bind(this)())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}repositionY(t){let e;const i=this.options.orientation.item;if(void 0!==this.data.subgroup){const t=this.data.subgroup;this.dom.box.style.height=`${this.parent.subgroups[t].height}px`,this.dom.box.style.top="top"==i?`${this.parent.top+this.parent.subgroups[t].top}px`:this.parent.top+this.parent.height-this.parent.subgroups[t].top-this.parent.subgroups[t].height+"px",this.dom.box.style.bottom=""}else this.parent instanceof Ls?(e=Math.max(this.parent.height,this.parent.itemSet.body.domProps.center.height,this.parent.itemSet.body.domProps.centerContainer.height),this.dom.box.style.bottom="bottom"==i?"0":"",this.dom.box.style.top="top"==i?"0":""):(e=this.parent.height,this.dom.box.style.top=`${this.parent.top}px`,this.dom.box.style.bottom="");this.dom.box.style.height=`${e}px`}}Hs.prototype.baseClassName="vis-item vis-background",Hs.prototype.stack=!1,Hs.prototype.show=Ys.prototype.show,Hs.prototype.hide=Ys.prototype.hide,Hs.prototype.repositionX=Ys.prototype.repositionX;class zs{constructor(t,e){this.container=t,this.overflowMethod=e||"cap",this.x=0,this.y=0,this.padding=5,this.hidden=!1,this.frame=document.createElement("div"),this.frame.className="vis-tooltip",this.container.appendChild(this.frame)}setPosition(t,e){this.x=parseInt(t),this.y=parseInt(e)}setText(t){t instanceof Element?(this.frame.innerHTML="",this.frame.appendChild(t)):this.frame.innerHTML=Wo.xss(t)}show(t){if(void 0===t&&(t=!0),!0===t){var e=this.frame.clientHeight,i=this.frame.clientWidth,n=this.frame.parentNode.clientHeight,o=this.frame.parentNode.clientWidth,s=0,r=0;if("flip"==this.overflowMethod||"none"==this.overflowMethod){let t=!1,n=!0;"flip"==this.overflowMethod&&(this.y-e<this.padding&&(n=!1),this.x+i>o-this.padding&&(t=!0)),s=t?this.x-i:this.x,r=n?this.y-e:this.y}else(r=this.y-e)+e+this.padding>n&&(r=n-e-this.padding),r<this.padding&&(r=this.padding),(s=this.x)+i+this.padding>o&&(s=o-i-this.padding),s<this.padding&&(s=this.padding);this.frame.style.left=s+"px",this.frame.style.top=r+"px",this.frame.style.visibility="visible",this.hidden=!1}else this.hide()}hide(){this.hidden=!0,this.frame.style.left="0",this.frame.style.top="0",this.frame.style.visibility="hidden"}destroy(){this.frame.parentNode.removeChild(this.frame)}}class Bs extends js{constructor(t,e,i){if(super(t,e,Object.assign({},{fitOnDoubleClick:!0},i,{editable:!1})),this.props={content:{width:0,height:0}},!t||null==t.uiItems)throw new Error('Property "uiItems" missing in item '+t.id);this.id=fn(),this.group=t.group,this._setupRange(),this.emitter=this.data.eventEmitter,this.range=this.data.range,this.attached=!1,this.isCluster=!0,this.data.isCluster=!0}hasItems(){return this.data.uiItems&&this.data.uiItems.length&&this.attached}setUiItems(t){this.detach(),this.data.uiItems=t,this._setupRange(),this.attach()}isVisible(t){const e=this.data.end?this.data.end-this.data.start:0,i=this.width*t.getMillisecondsPerPixel(),n=Math.max(this.data.start.getTime()+e,this.data.start.getTime()+i);return this.data.start<t.end&&n>t.start&&this.hasItems()}getData(){return{isCluster:!0,id:this.id,items:this.data.items||[],data:this.data}}redraw(t){var e,i,n=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),function(){this.dirty&&(e=this._getDomComponentsSizes())}.bind(this),function(){this.dirty&&this._updateDomComponentsSizes.bind(this)(e)}.bind(this),this._repaintDomAdditionals.bind(this)];return t?n:(n.forEach((function(t){i=t()})),i)}show(){this.displayed||this.redraw()}hide(){if(this.displayed){var t=this.dom;t.box.parentNode&&t.box.parentNode.removeChild(t.box),this.options.showStipes&&(t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot)),this.displayed=!1}}repositionX(){let t=this.conversion.toScreen(this.data.start),e=this.data.end?this.conversion.toScreen(this.data.end):0;if(e)this.repositionXWithRanges(t,e);else{let e=void 0===this.data.align?this.options.align:this.data.align;this.repositionXWithoutRanges(t,e)}this.options.showStipes&&(this.dom.line.style.display=this._isStipeVisible()?"block":"none",this.dom.dot.style.display=this._isStipeVisible()?"block":"none",this._isStipeVisible()&&this.repositionStype(t,e))}repositionStype(t,e){this.dom.line.style.display="block",this.dom.dot.style.display="block";const i=this.dom.line.offsetWidth,n=this.dom.dot.offsetWidth;if(e){const o=i+t+(e-t)/2,s=o-n/2,r=this.options.rtl?-1*o:o,a=this.options.rtl?-1*s:s;this.dom.line.style.transform=`translateX(${r}px)`,this.dom.dot.style.transform=`translateX(${a}px)`}else{const e=this.options.rtl?-1*t:t,i=this.options.rtl?-1*(t-n/2):t-n/2;this.dom.line.style.transform=`translateX(${e}px)`,this.dom.dot.style.transform=`translateX(${i}px)`}}repositionXWithoutRanges(t,e){"right"==e?this.options.rtl?(this.right=t-this.width,this.dom.box.style.right=this.right+"px"):(this.left=t-this.width,this.dom.box.style.left=this.left+"px"):"left"==e?this.options.rtl?(this.right=t,this.dom.box.style.right=this.right+"px"):(this.left=t,this.dom.box.style.left=this.left+"px"):this.options.rtl?(this.right=t-this.width/2,this.dom.box.style.right=this.right+"px"):(this.left=t-this.width/2,this.dom.box.style.left=this.left+"px")}repositionXWithRanges(t,e){let i=Math.round(Math.max(e-t+.5,1));this.options.rtl?this.right=t:this.left=t,this.width=Math.max(i,this.minWidth||0),this.options.rtl?this.dom.box.style.right=this.right+"px":this.dom.box.style.left=this.left+"px",this.dom.box.style.width=i+"px"}repositionY(){var t=this.options.orientation.item,e=this.dom.box;if(e.style.top="top"==t?(this.top||0)+"px":(this.parent.height-this.top-this.height||0)+"px",this.options.showStipes){if("top"==t)this.dom.line.style.top="0",this.dom.line.style.height=this.parent.top+this.top+1+"px",this.dom.line.style.bottom="";else{var i=this.parent.itemSet.props.height,n=i-this.parent.top-this.parent.height+this.top;this.dom.line.style.top=i-n+"px",this.dom.line.style.bottom="0"}this.dom.dot.style.top=-this.dom.dot.offsetHeight/2+"px"}}getWidthLeft(){return this.width/2}getWidthRight(){return this.width/2}move(){this.repositionX(),this.repositionY()}attach(){for(let t of this.data.uiItems)t.cluster=this;this.data.items=this.data.uiItems.map((t=>t.data)),this.attached=!0,this.dirty=!0}detach(t=!1){if(this.hasItems()){for(let t of this.data.uiItems)delete t.cluster;this.attached=!1,t&&this.group&&(this.group.remove(this),this.group=null),this.data.items=[],this.dirty=!0}}_onDoubleClick(){this._fit()}_setupRange(){const t=this.data.uiItems.map((t=>({start:t.data.start.valueOf(),end:t.data.end?t.data.end.valueOf():t.data.start.valueOf()})));this.data.min=Math.min(...t.map((t=>Math.min(t.start,t.end||t.start)))),this.data.max=Math.max(...t.map((t=>Math.max(t.start,t.end||t.start))));const e=this.data.uiItems.map((t=>t.center)).reduce(((t,e)=>t+e),0)/this.data.uiItems.length;this.data.uiItems.some((t=>t.data.end))?(this.data.start=new Date(this.data.min),this.data.end=new Date(this.data.max)):(this.data.start=new Date(e),this.data.end=null)}_getUiItems(){return this.data.uiItems&&this.data.uiItems.length?this.data.uiItems.filter((t=>t.cluster===this)):[]}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("DIV"),this.dom.content=document.createElement("DIV"),this.dom.content.className="vis-item-content",this.dom.box.appendChild(this.dom.content),this.options.showStipes&&(this.dom.line=document.createElement("DIV"),this.dom.line.className="vis-cluster-line",this.dom.line.style.display="none",this.dom.dot=document.createElement("DIV"),this.dom.dot.className="vis-cluster-dot",this.dom.dot.style.display="none"),this.options.fitOnDoubleClick&&(this.dom.box.ondblclick=Bs.prototype._onDoubleClick.bind(this)),this.dom.box["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}const t=this.parent.dom.background;if(this.options.showStipes){if(!this.dom.line.parentNode){if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.line)}if(!this.dom.dot.parentNode){var e=this.parent.dom.axis;if(!t)throw new Error("Cannot redraw item: parent has no axis container element");e.appendChild(this.dom.dot)}}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.baseClassName+" "+(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+" vis-readonly";this.dom.box.className="vis-item "+t,this.options.showStipes&&(this.dom.line.className="vis-item vis-cluster-line "+(this.selected?" vis-selected":""),this.dom.dot.className="vis-item vis-cluster-dot "+(this.selected?" vis-selected":"")),this.data.end&&(this.dom.content.style.maxWidth="none")}}_getDomComponentsSizes(){const t={previous:{right:this.dom.box.style.right,left:this.dom.box.style.left},box:{width:this.dom.box.offsetWidth,height:this.dom.box.offsetHeight}};return this.options.showStipes&&(t.dot={height:this.dom.dot.offsetHeight,width:this.dom.dot.offsetWidth},t.line={width:this.dom.line.offsetWidth}),t}_updateDomComponentsSizes(t){this.options.rtl?this.dom.box.style.right="0px":this.dom.box.style.left="0px",this.data.end?this.minWidth=t.box.width:this.width=t.box.width,this.height=t.box.height,this.options.rtl?this.dom.box.style.right=t.previous.right:this.dom.box.style.left=t.previous.left,this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box)}_isStipeVisible(){return this.minWidth>=this.width||!this.data.end}_getFitRange(){const t=.05*(this.data.max-this.data.min)/2;return{fitStart:this.data.min-t,fitEnd:this.data.max+t}}_fit(){if(this.emitter){const{fitStart:t,fitEnd:e}=this._getFitRange(),i={start:new Date(t),end:new Date(e),animation:!0};this.emitter.emit("fit",i)}}_getItemData(){return this.data}}Bs.prototype.baseClassName="vis-item vis-range vis-cluster";const Ws="__ungrouped__";class Gs{constructor(t){this.itemSet=t,this.groups={},this.cache={},this.cache[-1]=[]}createClusterItem(t,e,i){return new Bs(t,e,i)}setItems(t,e){this.items=t||[],this.dataChanged=!0,this.applyOnChangedLevel=!1,e&&e.applyOnChangedLevel&&(this.applyOnChangedLevel=e.applyOnChangedLevel)}updateData(){this.dataChanged=!0,this.applyOnChangedLevel=!1}getClusters(t,e,i){let{maxItems:n,clusterCriteria:o}="boolean"==typeof i?{}:i;o||(o=()=>!0),n=n||1;let s=-1,r=0;if(e>0){if(e>=1)return[];s=Math.abs(Math.round(Math.log(100/e)/Math.log(2))),r=Math.abs(Math.pow(2,s))}if(this.dataChanged){const t=s!=this.cacheLevel;(!this.applyOnChangedLevel||t)&&(this._dropLevelsCache(),this._filterData())}this.cacheLevel=s;let a=this.cache[s];if(!a){a=[];for(let e in this.groups)if(this.groups.hasOwnProperty(e)){const s=this.groups[e],l=s.length;let h=0;for(;h<l;){let e=s[h],l=1,d=h-1;for(;d>=0&&e.center-s[d].center<r/2;)!s[d].cluster&&o(e.data,s[d].data)&&l++,d--;let c=h+1;for(;c<s.length&&s[c].center-e.center<r/2;)o(e.data,s[c].data)&&l++,c++;let u=a.length-1;for(;u>=0&&e.center-a[u].center<r;)e.group==a[u].group&&o(e.data,a[u].data)&&l++,u--;if(l>n){const r=l-n+1,d=[];let c=h;for(;d.length<r&&c<s.length;)o(s[h].data,s[c].data)&&d.push(s[c]),c++;const u=this.itemSet.getGroupId(e.data),p=this.itemSet.groups[u]||this.itemSet.groups[Ws];let m=this._getClusterForItems(d,p,t,i);a.push(m),h+=r}else delete e.cluster,h+=1}}this.cache[s]=a}return a}_filterData(){const t={};this.groups=t;for(const e of Object.values(this.items)){const i=e.parent?e.parent.groupId:"";let n=t[i];n||(n=[],t[i]=n),n.push(e),e.data.start&&(e.data.end?e.center=(e.data.start.valueOf()+e.data.end.valueOf())/2:e.center=e.data.start.valueOf())}for(let e in t)t.hasOwnProperty(e)&&t[e].sort(((t,e)=>t.center-e.center));this.dataChanged=!1}_getClusterForItems(t,e,i,n){const o=(i||[]).map((t=>({cluster:t,itemsIds:new Set(t.data.uiItems.map((t=>t.id)))})));let s;if(o.length)for(let e of o)if(e.itemsIds.size===t.length&&t.every((t=>e.itemsIds.has(t.id)))){s=e.cluster;break}if(s)return s.setUiItems(t),s.group!==e&&(s.group&&s.group.remove(s),e&&(e.add(s),s.group=e)),s;let r=n.titleTemplate||"";const a={toScreen:this.itemSet.body.util.toScreen,toTime:this.itemSet.body.util.toTime},l=r.replace(/{count}/,t.length),h='<div title="'+l+'">'+t.length+"</div>",d=Object.assign({},n,this.itemSet.options),c={content:h,title:l,group:e,uiItems:t,eventEmitter:this.itemSet.body.emitter,range:this.itemSet.body.range};return s=this.createClusterItem(c,a,d),e&&(e.add(s),s.group=e),s.attach(),s}_dropLevelsCache(){this.cache={},this.cacheLevel=-1,this.cache[this.cacheLevel]=[]}}const Vs="__ungrouped__",Us="__background__";class $s extends Go{constructor(t,e){super(),this.body=t,this.defaultOptions={type:null,orientation:{item:"bottom"},align:"auto",stack:!0,stackSubgroups:!0,groupOrderSwap(t,e,i){const n=e.order;e.order=t.order,t.order=n},groupOrder:"order",selectable:!0,multiselect:!1,longSelectPressTime:251,itemsAlwaysDraggable:{item:!1,range:!1},editable:{updateTime:!1,updateGroup:!1,add:!1,remove:!1,overrideItems:!1},groupEditable:{order:!1,add:!1,remove:!1},snap:ss.snap,onDropObjectOnItem(t,e,i){i(e)},onAdd(t,e){e(t)},onUpdate(t,e){e(t)},onMove(t,e){e(t)},onRemove(t,e){e(t)},onMoving(t,e){e(t)},onAddGroup(t,e){e(t)},onMoveGroup(t,e){e(t)},onRemoveGroup(t,e){e(t)},margin:{item:{horizontal:10,vertical:10},axis:20},showTooltips:!0,tooltip:{followMouse:!1,overflowMethod:"flip",delay:500},tooltipOnItemUpdateTime:!1},this.options=Wo.extend({},this.defaultOptions),this.options.rtl=e.rtl,this.options.onTimeout=e.onTimeout,this.conversion={toScreen:t.util.toScreen,toTime:t.util.toTime},this.dom={},this.props={},this.hammer=null;const i=this;this.itemsData=null,this.groupsData=null,this.itemsSettingTime=null,this.initialItemSetDrawn=!1,this.userContinueNotBail=null,this.sequentialSelection=!1,this.itemListeners={add(t,e,n){i._onAdd(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()},update(t,e,n){i._onUpdate(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()},remove(t,e,n){i._onRemove(e.items),i.options.cluster&&i.clusterGenerator.setItems(i.items,{applyOnChangedLevel:!1}),i.redraw()}},this.groupListeners={add(t,e,n){if(i._onAddGroups(e.items),i.groupsData&&i.groupsData.length>0){const t=i.groupsData.getDataSet();t.get().forEach((e=>{if(e.nestedGroups){0!=e.showNested&&(e.showNested=!0);let i=[];e.nestedGroups.forEach((n=>{const o=t.get(n);o&&(o.nestedInGroup=e.id,0==e.showNested&&(o.visible=!1),i=i.concat(o))})),t.update(i,n)}}))}},update(t,e,n){i._onUpdateGroups(e.items)},remove(t,e,n){i._onRemoveGroups(e.items)}},this.items={},this.groups={},this.groupIds=[],this.selection=[],this.popup=null,this.popupTimer=null,this.touchParams={},this.groupTouchParams={group:null,isDragging:!1},this._create(),this.setOptions(e),this.clusters=[]}_create(){const t=document.createElement("div");t.className="vis-itemset",t["vis-itemset"]=this,this.dom.frame=t;const e=document.createElement("div");e.className="vis-background",t.appendChild(e),this.dom.background=e;const i=document.createElement("div");i.className="vis-foreground",t.appendChild(i),this.dom.foreground=i;const n=document.createElement("div");n.className="vis-axis",this.dom.axis=n;const o=document.createElement("div");o.className="vis-labelset",this.dom.labelSet=o,this._updateUngrouped();const s=new Ls(Us,null,this);s.show(),this.groups[Us]=s,this.hammer=new ns(this.body.dom.centerContainer),this.hammer.on("hammer.input",(t=>{t.isFirst&&this._onTouch(t)})),this.hammer.on("panstart",this._onDragStart.bind(this)),this.hammer.on("panmove",this._onDrag.bind(this)),this.hammer.on("panend",this._onDragEnd.bind(this)),this.hammer.get("pan").set({threshold:5,direction:ns.ALL}),this.hammer.get("press").set({time:1e4}),this.hammer.on("tap",this._onSelectItem.bind(this)),this.hammer.on("press",this._onMultiSelectItem.bind(this)),this.hammer.get("press").set({time:1e4}),this.hammer.on("doubletap",this._onAddItem.bind(this)),this.options.rtl?this.groupHammer=new ns(this.body.dom.rightContainer):this.groupHammer=new ns(this.body.dom.leftContainer),this.groupHammer.on("tap",this._onGroupClick.bind(this)),this.groupHammer.on("panstart",this._onGroupDragStart.bind(this)),this.groupHammer.on("panmove",this._onGroupDrag.bind(this)),this.groupHammer.on("panend",this._onGroupDragEnd.bind(this)),this.groupHammer.get("pan").set({threshold:5,direction:ns.DIRECTION_VERTICAL}),this.body.dom.centerContainer.addEventListener("mouseover",this._onMouseOver.bind(this)),this.body.dom.centerContainer.addEventListener("mouseout",this._onMouseOut.bind(this)),this.body.dom.centerContainer.addEventListener("mousemove",this._onMouseMove.bind(this)),this.body.dom.centerContainer.addEventListener("contextmenu",this._onDragEnd.bind(this)),this.body.dom.centerContainer.addEventListener("mousewheel",this._onMouseWheel.bind(this)),this.show()}setOptions(t){if(t){const e=["type","rtl","align","order","stack","stackSubgroups","selectable","multiselect","sequentialSelection","multiselectPerGroup","longSelectPressTime","groupOrder","dataAttributes","template","groupTemplate","visibleFrameTemplate","hide","snap","groupOrderSwap","showTooltips","tooltip","tooltipOnItemUpdateTime","groupHeightMode","onTimeout"];Wo.selectiveExtend(e,this.options,t),"itemsAlwaysDraggable"in t&&("boolean"==typeof t.itemsAlwaysDraggable?(this.options.itemsAlwaysDraggable.item=t.itemsAlwaysDraggable,this.options.itemsAlwaysDraggable.range=!1):"object"==typeof t.itemsAlwaysDraggable&&(Wo.selectiveExtend(["item","range"],this.options.itemsAlwaysDraggable,t.itemsAlwaysDraggable),this.options.itemsAlwaysDraggable.item||(this.options.itemsAlwaysDraggable.range=!1))),"sequentialSelection"in t&&"boolean"==typeof t.sequentialSelection&&(this.options.sequentialSelection=t.sequentialSelection),"orientation"in t&&("string"==typeof t.orientation?this.options.orientation.item="top"===t.orientation?"top":"bottom":"object"==typeof t.orientation&&"item"in t.orientation&&(this.options.orientation.item=t.orientation.item)),"margin"in t&&("number"==typeof t.margin?(this.options.margin.axis=t.margin,this.options.margin.item.horizontal=t.margin,this.options.margin.item.vertical=t.margin):"object"==typeof t.margin&&(Wo.selectiveExtend(["axis"],this.options.margin,t.margin),"item"in t.margin&&("number"==typeof t.margin.item?(this.options.margin.item.horizontal=t.margin.item,this.options.margin.item.vertical=t.margin.item):"object"==typeof t.margin.item&&Wo.selectiveExtend(["horizontal","vertical"],this.options.margin.item,t.margin.item)))),["locale","locales"].forEach((e=>{e in t&&(this.options[e]=t[e])})),"editable"in t&&("boolean"==typeof t.editable?(this.options.editable.updateTime=t.editable,this.options.editable.updateGroup=t.editable,this.options.editable.add=t.editable,this.options.editable.remove=t.editable,this.options.editable.overrideItems=!1):"object"==typeof t.editable&&Wo.selectiveExtend(["updateTime","updateGroup","add","remove","overrideItems"],this.options.editable,t.editable)),"groupEditable"in t&&("boolean"==typeof t.groupEditable?(this.options.groupEditable.order=t.groupEditable,this.options.groupEditable.add=t.groupEditable,this.options.groupEditable.remove=t.groupEditable):"object"==typeof t.groupEditable&&Wo.selectiveExtend(["order","add","remove"],this.options.groupEditable,t.groupEditable));["onDropObjectOnItem","onAdd","onUpdate","onRemove","onMove","onMoving","onAddGroup","onMoveGroup","onRemoveGroup"].forEach((e=>{const i=t[e];if(i){if("function"!=typeof i)throw new Error(`option ${e} must be a function ${e}(item, callback)`);this.options[e]=i}})),t.cluster?(Object.assign(this.options,{cluster:t.cluster}),this.clusterGenerator||(this.clusterGenerator=new Gs(this)),this.clusterGenerator.setItems(this.items,{applyOnChangedLevel:!1}),this.markDirty({refreshItems:!0,restackGroups:!0}),this.redraw()):this.clusterGenerator?(this._detachAllClusters(),this.clusters=[],this.clusterGenerator=null,this.options.cluster=void 0,this.markDirty({refreshItems:!0,restackGroups:!0}),this.redraw()):this.markDirty()}}markDirty(t){this.groupIds=[],t&&(t.refreshItems&&Wo.forEach(this.items,(t=>{t.dirty=!0,t.displayed&&t.redraw()})),t.restackGroups&&Wo.forEach(this.groups,((t,e)=>{e!==Us&&(t.stackDirty=!0)})))}destroy(){this.clearPopupTimer(),this.hide(),this.setItems(null),this.setGroups(null),this.hammer&&this.hammer.destroy(),this.groupHammer&&this.groupHammer.destroy(),this.hammer=null,this.body=null,this.conversion=null}hide(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.axis.parentNode&&this.dom.axis.parentNode.removeChild(this.dom.axis),this.dom.labelSet.parentNode&&this.dom.labelSet.parentNode.removeChild(this.dom.labelSet)}show(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame),this.dom.axis.parentNode||this.body.dom.backgroundVertical.appendChild(this.dom.axis),this.dom.labelSet.parentNode||(this.options.rtl?this.body.dom.right.appendChild(this.dom.labelSet):this.body.dom.left.appendChild(this.dom.labelSet))}setPopupTimer(t){if(this.clearPopupTimer(),t){const e=this.options.tooltip.delay||"number"==typeof this.options.tooltip.delay?this.options.tooltip.delay:500;this.popupTimer=setTimeout((function(){t.show()}),e)}}clearPopupTimer(){null!=this.popupTimer&&(clearTimeout(this.popupTimer),this.popupTimer=null)}setSelection(t){null==t&&(t=[]),Array.isArray(t)||(t=[t]);const e=this.selection.filter((e=>-1===t.indexOf(e)));for(let t of e){const e=this.getItemById(t);e&&e.unselect()}this.selection=[...t];for(let e of t){const t=this.getItemById(e);t&&t.select()}}getSelection(){return this.selection.concat([])}getVisibleItems(){const t=this.body.range.getRange();let e,i;this.options.rtl?(e=this.body.util.toScreen(t.start),i=this.body.util.toScreen(t.end)):(i=this.body.util.toScreen(t.start),e=this.body.util.toScreen(t.end));const n=[];for(const t in this.groups)if(this.groups.hasOwnProperty(t)){const o=this.groups[t],s=o.isVisible?o.visibleItems:[];for(const t of s)this.options.rtl?t.right<i&&t.right+t.width>e&&n.push(t.id):t.left<e&&t.left+t.width>i&&n.push(t.id)}return n}getItemsAtCurrentTime(t){let e,i;this.options.rtl?(e=this.body.util.toScreen(t),i=this.body.util.toScreen(t)):(i=this.body.util.toScreen(t),e=this.body.util.toScreen(t));const n=[];for(const t in this.groups)if(this.groups.hasOwnProperty(t)){const o=this.groups[t],s=o.isVisible?o.visibleItems:[];for(const t of s)this.options.rtl?t.right<i&&t.right+t.width>e&&n.push(t.id):t.left<e&&t.left+t.width>i&&n.push(t.id)}return n}getVisibleGroups(){const t=[];for(const e in this.groups)if(this.groups.hasOwnProperty(e)){this.groups[e].isVisible&&t.push(e)}return t}getItemById(t){return this.items[t]||this.clusters.find((e=>e.id===t))}_deselect(t){const e=this.selection;for(let i=0,n=e.length;i<n;i++)if(e[i]==t){e.splice(i,1);break}}redraw(){const t=this.options.margin,e=this.body.range,i=Wo.option.asSize,n=this.options,o=n.orientation.item;let s=!1;const r=this.dom.frame;this.props.top=this.body.domProps.top.height+this.body.domProps.border.top,this.options.rtl?this.props.right=this.body.domProps.right.width+this.body.domProps.border.right:this.props.left=this.body.domProps.left.width+this.body.domProps.border.left,r.className="vis-itemset",this.options.cluster&&this._clusterItems(),s=this._orderGroups()||s;const a=e.end-e.start,l=a!=this.lastVisibleInterval||this.props.width!=this.props.lastWidth,h=e.start!=this.lastRangeStart,d=n.stack!=this.lastStack,c=n.stackSubgroups!=this.lastStackSubgroups,u=l||h||d||c;this.lastVisibleInterval=a,this.lastRangeStart=e.start,this.lastStack=n.stack,this.lastStackSubgroups=n.stackSubgroups,this.props.lastWidth=this.props.width;const p=this._firstGroup(),m={item:t.item,axis:t.axis},f={item:t.item,axis:t.item.vertical/2};let g=0;const v=t.axis+t.item.vertical;this.groups[Us].redraw(e,f,u);const y={};let b=0;Wo.forEach(this.groups,((t,i)=>{if(i===Us)return;const n=t==p?m:f;y[i]=t.redraw(e,n,u,!0),b=y[i].length}));if(b>0){const t={};for(let e=0;e<b;e++)Wo.forEach(y,((i,n)=>{t[n]=i[e]()}));Wo.forEach(this.groups,((e,i)=>{if(i===Us)return;const n=t[i];s=n||s,g+=e.height})),g=Math.max(g,v)}return g=Math.max(g,v),r.style.height=i(g),this.props.width=r.offsetWidth,this.props.height=g,this.dom.axis.style.top=i("top"==o?this.body.domProps.top.height+this.body.domProps.border.top:this.body.domProps.top.height+this.body.domProps.centerContainer.height),this.options.rtl?this.dom.axis.style.right="0":this.dom.axis.style.left="0",this.hammer.get("press").set({time:this.options.longSelectPressTime}),this.initialItemSetDrawn=!0,s=this._isResized()||s,s}_firstGroup(){const t="top"==this.options.orientation.item?0:this.groupIds.length-1,e=this.groupIds[t];return this.groups[e]||this.groups[Vs]||null}_updateUngrouped(){let t,e,i=this.groups[Vs];if(this.groupsData){if(i)for(e in i.dispose(),delete this.groups[Vs],this.items)if(this.items.hasOwnProperty(e)){t=this.items[e],t.parent&&t.parent.remove(t);const i=this.getGroupId(t.data),n=this.groups[i];n&&n.add(t)||t.hide()}}else if(!i){const n=null,o=null;for(e in i=new Rs(n,o,this),this.groups[Vs]=i,this.items)this.items.hasOwnProperty(e)&&(t=this.items[e],i.add(t));i.show()}}getLabelSet(){return this.dom.labelSet}setItems(t){this.itemsSettingTime=new Date;const e=this;let i;const n=this.itemsData;if(t){if(!Fo(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.itemsData=Yo(t)}else this.itemsData=null;if(n&&(Wo.forEach(this.itemListeners,((t,e)=>{n.off(e,t)})),n.dispose(),i=n.getIds(),this._onRemove(i)),this.itemsData){const t=this.id;Wo.forEach(this.itemListeners,((i,n)=>{e.itemsData.on(n,i,t)})),i=this.itemsData.getIds(),this._onAdd(i),this._updateUngrouped()}this.body.emitter.emit("_change",{queue:!0})}getItems(){return null!=this.itemsData?this.itemsData.rawDS:null}setGroups(t){const e=this;let i;if(this.groupsData&&(Wo.forEach(this.groupListeners,((t,i)=>{e.groupsData.off(i,t)})),i=this.groupsData.getIds(),this.groupsData=null,this._onRemoveGroups(i)),t){if(!Fo(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){const t=this.groupsData.getDataSet();t.get().forEach((e=>{e.nestedGroups&&e.nestedGroups.forEach((i=>{const n=t.get(i);n.nestedInGroup=e.id,0==e.showNested&&(n.visible=!1),t.update(n)}))}));const n=this.id;Wo.forEach(this.groupListeners,((t,i)=>{e.groupsData.on(i,t,n)})),i=this.groupsData.getIds(),this._onAddGroups(i)}this._updateUngrouped(),this._order(),this.options.cluster&&(this.clusterGenerator.updateData(),this._clusterItems(),this.markDirty({refreshItems:!0,restackGroups:!0})),this.body.emitter.emit("_change",{queue:!0})}getGroups(){return this.groupsData}removeItem(t){const e=this.itemsData.get(t);e&&this.options.onRemove(e,(e=>{e&&this.itemsData.remove(t)}))}_getType(t){return t.type||this.options.type||(t.end?"range":"box")}getGroupId(t){return"background"==this._getType(t)&&null==t.group?Us:this.groupsData?t.group:Vs}_onUpdate(t){const e=this;t.forEach((t=>{const i=e.itemsData.get(t);let n=e.items[t];const o=i?e._getType(i):null,s=$s.types[o];let r;if(n&&(s&&n instanceof s?e._updateItem(n,i):(r=n.selected,e._removeItem(n),n=null)),!n&&i){if(!s)throw new TypeError(`Unknown item type "${o}"`);n=new s(i,e.conversion,e.options),n.id=t,e._addItem(n),r&&(this.selection.push(t),n.select())}})),this._order(),this.options.cluster&&(this.clusterGenerator.setItems(this.items,{applyOnChangedLevel:!1}),this._clusterItems()),this.body.emitter.emit("_change",{queue:!0})}_onRemove(t){let e=0;const i=this;t.forEach((t=>{const n=i.items[t];n&&(e++,i._removeItem(n))})),e&&(this._order(),this.body.emitter.emit("_change",{queue:!0}))}_order(){Wo.forEach(this.groups,(t=>{t.order()}))}_onUpdateGroups(t){this._onAddGroups(t)}_onAddGroups(t){const e=this;t.forEach((t=>{const i=e.groupsData.get(t);let n=e.groups[t];if(n)n.setData(i);else{if(t==Vs||t==Us)throw new Error(`Illegal group id. ${t} is a reserved id.`);const o=Object.create(e.options);Wo.extend(o,{height:null}),n=new Rs(t,i,e),e.groups[t]=n;for(const i in e.items)if(e.items.hasOwnProperty(i)){const o=e.items[i];o.data.group==t&&n.add(o)}n.order(),n.show()}})),this.body.emitter.emit("_change",{queue:!0})}_onRemoveGroups(t){t.forEach((t=>{const e=this.groups[t];e&&(e.dispose(),delete this.groups[t])})),this.options.cluster&&(this.clusterGenerator.updateData(),this._clusterItems()),this.markDirty({restackGroups:!!this.options.cluster}),this.body.emitter.emit("_change",{queue:!0})}_orderGroups(){if(this.groupsData){let t=this.groupsData.getIds({order:this.options.groupOrder});t=this._orderNestedGroups(t);const e=!Wo.equalArray(t,this.groupIds);if(e){const e=this.groups;t.forEach((t=>{e[t].hide()})),t.forEach((t=>{e[t].show()})),this.groupIds=t}return e}return!1}_orderNestedGroups(t){return function t(e,i){let n=[];return i.forEach((i=>{n.push(i);if(e.groupsData.get(i).nestedGroups){const o=e.groupsData.get({filter:t=>t.nestedInGroup==i,order:e.options.groupOrder}).map((t=>t.id));n=n.concat(t(e,o))}})),n}(this,t.filter((t=>!this.groupsData.get(t).nestedInGroup)))}_addItem(t){this.items[t.id]=t;const e=this.getGroupId(t.data),i=this.groups[e];i?i&&i.data&&i.data.showNested&&(t.groupShowing=!0):t.groupShowing=!1,i&&i.add(t)}_updateItem(t,e){t.setData(e);const i=this.getGroupId(t.data),n=this.groups[i];n?n&&n.data&&n.data.showNested&&(t.groupShowing=!0):t.groupShowing=!1}_removeItem(t){t.hide(),delete this.items[t.id];const e=this.selection.indexOf(t.id);-1!=e&&this.selection.splice(e,1),t.parent&&t.parent.remove(t),null!=this.popup&&this.popup.hide()}_constructByEndArray(t){const e=[];for(let i=0;i<t.length;i++)t[i]instanceof Ys&&e.push(t[i]);return e}_onTouch(t){this.touchParams.item=this.itemFromTarget(t),this.touchParams.dragLeftItem=t.target.dragLeftItem||!1,this.touchParams.dragRightItem=t.target.dragRightItem||!1,this.touchParams.itemProps=null}_getGroupIndex(t){for(let e=0;e<this.groupIds.length;e++)if(t==this.groupIds[e])return e}_onDragStart(t){if(this.touchParams.itemIsDragging)return;const e=this.touchParams.item||null,i=this;let n;if(e&&(e.selected||this.options.itemsAlwaysDraggable.item)){if(this.options.editable.overrideItems&&!this.options.editable.updateTime&&!this.options.editable.updateGroup)return;if(null!=e.editable&&!e.editable.updateTime&&!e.editable.updateGroup&&!this.options.editable.overrideItems)return;const o=this.touchParams.dragLeftItem,s=this.touchParams.dragRightItem;if(this.touchParams.itemIsDragging=!0,this.touchParams.selectedItem=e,o)n={item:o,initialX:t.center.x,dragLeft:!0,data:this._cloneItemData(e.data)},this.touchParams.itemProps=[n];else if(s)n={item:s,initialX:t.center.x,dragRight:!0,data:this._cloneItemData(e.data)},this.touchParams.itemProps=[n];else if(this.options.editable.add&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey))this._onDragStartAddItem(t);else{this.groupIds.length<1&&this.redraw();const n=this._getGroupIndex(e.data.group),o=this.options.itemsAlwaysDraggable.item&&!e.selected?[e.id]:this.getSelection();this.touchParams.itemProps=o.map((e=>{const o=i.items[e],s=i._getGroupIndex(o.data.group);return{item:o,initialX:t.center.x,groupOffset:n-s,data:this._cloneItemData(o.data)}}))}t.stopPropagation()}else this.options.editable.add&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey)&&this._onDragStartAddItem(t)}_onDragStartAddItem(t){const e=this.options.snap||null,i=this.dom.frame.getBoundingClientRect(),n=this.options.rtl?i.right-t.center.x+10:t.center.x-i.left-10,o=this.body.util.toTime(n),s=this.body.util.getScale(),r=this.body.util.getStep(),a=e?e(o,s,r):o,l={type:"range",start:a,end:a,content:"new item"},h=fn();l[this.itemsData.idProp]=h;const d=this.groupFromTarget(t);d&&(l.group=d.groupId);const c=new Ys(l,this.conversion,this.options);c.id=h,c.data=this._cloneItemData(l),this._addItem(c),this.touchParams.selectedItem=c;const u={item:c,initialX:t.center.x,data:c.data};this.options.rtl?u.dragLeft=!0:u.dragRight=!0,this.touchParams.itemProps=[u],t.stopPropagation()}_onDrag(t){if(null!=this.popup&&this.options.showTooltips&&!this.popup.hidden){const e=this.body.dom.centerContainer,i=e.getBoundingClientRect();this.popup.setPosition(t.center.x-i.left+e.offsetLeft,t.center.y-i.top+e.offsetTop),this.popup.show()}if(this.touchParams.itemProps){t.stopPropagation();const e=this,i=this.options.snap||null,n=this.body.dom.root.offsetLeft,o=this.options.rtl?n+this.body.domProps.right.width:n+this.body.domProps.left.width,s=this.body.util.getScale(),r=this.body.util.getStep(),a=this.touchParams.selectedItem,l=(this.options.editable.overrideItems||null==a.editable)&&this.options.editable.updateGroup||!this.options.editable.overrideItems&&null!=a.editable&&a.editable.updateGroup;let h=null;if(l&&a&&null!=a.data.group){const i=e.groupFromTarget(t);i&&(h=this._getGroupIndex(i.groupId))}this.touchParams.itemProps.forEach((n=>{const d=e.body.util.toTime(t.center.x-o),c=e.body.util.toTime(n.initialX-o);let u,p,m,f,g;u=this.options.rtl?-(d-c):d-c;let v=this._cloneItemData(n.item.data);if(null!=n.item.editable&&!n.item.editable.updateTime&&!n.item.editable.updateGroup&&!e.options.editable.overrideItems)return;if((this.options.editable.overrideItems||null==a.editable)&&this.options.editable.updateTime||!this.options.editable.overrideItems&&null!=a.editable&&a.editable.updateTime)if(n.dragLeft)this.options.rtl?null!=v.end&&(m=Wo.convert(n.data.end,"Date"),g=new Date(m.valueOf()+u),v.end=i?i(g,s,r):g):null!=v.start&&(p=Wo.convert(n.data.start,"Date"),f=new Date(p.valueOf()+u),v.start=i?i(f,s,r):f);else if(n.dragRight)this.options.rtl?null!=v.start&&(p=Wo.convert(n.data.start,"Date"),f=new Date(p.valueOf()+u),v.start=i?i(f,s,r):f):null!=v.end&&(m=Wo.convert(n.data.end,"Date"),g=new Date(m.valueOf()+u),v.end=i?i(g,s,r):g);else if(null!=v.start)if(p=Wo.convert(n.data.start,"Date").valueOf(),f=new Date(p+u),null!=v.end){m=Wo.convert(n.data.end,"Date");const t=m.valueOf()-p.valueOf();v.start=i?i(f,s,r):f,v.end=new Date(v.start.valueOf()+t)}else v.start=i?i(f,s,r):f;if(l&&!n.dragLeft&&!n.dragRight&&null!=h&&null!=v.group){let t=h-n.groupOffset;t=Math.max(0,t),t=Math.min(e.groupIds.length-1,t),v.group=e.groupIds[t]}v=this._cloneItemData(v),e.options.onMoving(v,(t=>{t&&n.item.setData(this._cloneItemData(t,"Date"))}))})),this.body.emitter.emit("_change")}}_moveToGroup(t,e){const i=this.groups[e];if(i&&i.groupId!=t.data.group){const e=t.parent;e.remove(t),e.order(),t.data.group=i.groupId,i.add(t),i.order()}}_onDragEnd(t){if(this.touchParams.itemIsDragging=!1,this.touchParams.itemProps){t.stopPropagation();const e=this,i=this.touchParams.itemProps;this.touchParams.itemProps=null,i.forEach((t=>{const i=t.item.id;if(null!=e.itemsData.get(i)){const n=this._cloneItemData(t.item.data);e.options.onMove(n,(n=>{n?(n[this.itemsData.idProp]=i,this.itemsData.update(n)):(t.item.setData(t.data),e.body.emitter.emit("_change"))}))}else e.options.onAdd(t.item.data,(i=>{e._removeItem(t.item),i&&e.itemsData.add(i),e.body.emitter.emit("_change")}))}))}}_onGroupClick(t){const e=this.groupFromTarget(t);setTimeout((()=>{this.toggleGroupShowNested(e)}),1)}toggleGroupShowNested(t,e){if(!t||!t.nestedGroups)return;const i=this.groupsData.getDataSet();t.showNested=null!=e?!!e:!t.showNested;let n=i.get(t.groupId);n.showNested=t.showNested;let o=t.nestedGroups,s=o;for(;s.length>0;){let t=s;s=[];for(let e=0;e<t.length;e++){let n=i.get(t[e]);n.nestedGroups&&(s=s.concat(n.nestedGroups))}s.length>0&&(o=o.concat(s))}let r=i.get(o).map((function(t){return null==t.visible&&(t.visible=!0),t.visible=!!n.showNested,t}));i.update(r.concat(n)),n.showNested?(Wo.removeClassName(t.dom.label,"collapsed"),Wo.addClassName(t.dom.label,"expanded")):(Wo.removeClassName(t.dom.label,"expanded"),Wo.addClassName(t.dom.label,"collapsed"))}toggleGroupDragClassName(t){t.dom.label.classList.toggle("vis-group-is-dragging"),t.dom.foreground.classList.toggle("vis-group-is-dragging")}_onGroupDragStart(t){this.groupTouchParams.isDragging||this.options.groupEditable.order&&(this.groupTouchParams.group=this.groupFromTarget(t),this.groupTouchParams.group&&(t.stopPropagation(),this.groupTouchParams.isDragging=!0,this.toggleGroupDragClassName(this.groupTouchParams.group),this.groupTouchParams.originalOrder=this.groupsData.getIds({order:this.options.groupOrder})))}_onGroupDrag(t){if(this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();const e=this.groupsData.getDataSet(),i=this.groupFromTarget(t);if(i&&i.height!=this.groupTouchParams.group.height){const e=i.top<this.groupTouchParams.group.top,n=t.center?t.center.y:t.clientY,o=i.dom.foreground.getBoundingClientRect(),s=this.groupTouchParams.group.height;if(e){if(o.top+s<n)return}else{const t=i.height;if(o.top+t-s>n)return}}if(i&&i!=this.groupTouchParams.group){const t=e.get(i.groupId),n=e.get(this.groupTouchParams.group.groupId);n&&t&&(this.options.groupOrderSwap(n,t,e),e.update(n),e.update(t));const o=e.getIds({order:this.options.groupOrder});if(!Wo.equalArray(o,this.groupTouchParams.originalOrder)){const t=this.groupTouchParams.originalOrder,i=this.groupTouchParams.group.groupId,n=Math.min(t.length,o.length);let s=0,r=0,a=0;for(;s<n;){for(;s+r<n&&s+a<n&&o[s+r]==t[s+a];)s++;if(s+r>=n)break;if(o[s+r]==i)r=1;else if(t[s+a]==i)a=1;else{const i=o.indexOf(t[s+a]),n=e.get(o[s+r]),l=e.get(t[s+a]);this.options.groupOrderSwap(n,l,e),e.update(n),e.update(l);const h=o[s+r];o[s+r]=t[s+a],o[i]=h,s++}}}}}}_onGroupDragEnd(t){if(this.groupTouchParams.isDragging=!1,this.options.groupEditable.order&&this.groupTouchParams.group){t.stopPropagation();const e=this,i=e.groupTouchParams.group.groupId,n=e.groupsData.getDataSet(),o=Wo.extend({},n.get(i));e.options.onMoveGroup(o,(t=>{if(t)t[n._idProp]=i,n.update(t);else{const t=n.getIds({order:e.options.groupOrder});if(!Wo.equalArray(t,e.groupTouchParams.originalOrder)){const i=e.groupTouchParams.originalOrder,o=Math.min(i.length,t.length);let s=0;for(;s<o;){for(;s<o&&t[s]==i[s];)s++;if(s>=o)break;const r=t.indexOf(i[s]),a=n.get(t[s]),l=n.get(i[s]);e.options.groupOrderSwap(a,l,n),n.update(a),n.update(l);const h=t[s];t[s]=i[s],t[r]=h,s++}}}})),e.body.emitter.emit("groupDragged",{groupId:i}),this.toggleGroupDragClassName(this.groupTouchParams.group),this.groupTouchParams.group=null}}_onSelectItem(t){if(!this.options.selectable)return;const e=t.srcEvent&&(t.srcEvent.ctrlKey||t.srcEvent.metaKey),i=t.srcEvent&&t.srcEvent.shiftKey;if(e||i)return void this._onMultiSelectItem(t);const n=this.getSelection(),o=this.itemFromTarget(t),s=o&&o.selectable?[o.id]:[];this.setSelection(s);const r=this.getSelection();(r.length>0||n.length>0)&&this.body.emitter.emit("select",{items:r,event:t})}_onMouseOver(t){const e=this.itemFromTarget(t);if(!e)return;if(e===this.itemFromRelatedTarget(t))return;const i=e.getTitle();if(this.options.showTooltips&&i){null==this.popup&&(this.popup=new zs(this.body.dom.root,this.options.tooltip.overflowMethod||"flip")),this.popup.setText(i);const e=this.body.dom.centerContainer,n=e.getBoundingClientRect();this.popup.setPosition(t.clientX-n.left+e.offsetLeft,t.clientY-n.top+e.offsetTop),this.setPopupTimer(this.popup)}else this.clearPopupTimer(),null!=this.popup&&this.popup.hide();this.body.emitter.emit("itemover",{item:e.id,event:t})}_onMouseOut(t){const e=this.itemFromTarget(t);if(!e)return;e!==this.itemFromRelatedTarget(t)&&(this.clearPopupTimer(),null!=this.popup&&this.popup.hide(),this.body.emitter.emit("itemout",{item:e.id,event:t}))}_onMouseMove(t){if(this.itemFromTarget(t)&&(null!=this.popupTimer&&this.setPopupTimer(this.popup),this.options.showTooltips&&this.options.tooltip.followMouse&&this.popup&&!this.popup.hidden)){const e=this.body.dom.centerContainer,i=e.getBoundingClientRect();this.popup.setPosition(t.clientX-i.left+e.offsetLeft,t.clientY-i.top+e.offsetTop),this.popup.show()}}_onMouseWheel(t){this.touchParams.itemIsDragging&&this._onDragEnd(t)}_onUpdateItem(t){if(!this.options.selectable)return;if(!this.options.editable.updateTime&&!this.options.editable.updateGroup)return;const e=this;if(t){const i=e.itemsData.get(t.id);this.options.onUpdate(i,(t=>{t&&e.itemsData.update(t)}))}}_onDropObjectOnItem(t){const e=this.itemFromTarget(t),i=JSON.parse(t.dataTransfer.getData("text"));this.options.onDropObjectOnItem(i,e)}_onAddItem(t){if(!this.options.selectable)return;if(!this.options.editable.add)return;const e=this,i=this.options.snap||null,n=this.dom.frame.getBoundingClientRect(),o=this.options.rtl?n.right-t.center.x:t.center.x-n.left,s=this.body.util.toTime(o),r=this.body.util.getScale(),a=this.body.util.getStep();let l,h;"drop"==t.type?(h=JSON.parse(t.dataTransfer.getData("text")),h.content=h.content?h.content:"new item",h.start=h.start?h.start:i?i(s,r,a):s,h.type=h.type||"box",h[this.itemsData.idProp]=h.id||fn(),"range"!=h.type||h.end||(l=this.body.util.toTime(o+this.props.width/5),h.end=i?i(l,r,a):l)):(h={start:i?i(s,r,a):s,content:"new item"},h[this.itemsData.idProp]=fn(),"range"===this.options.type&&(l=this.body.util.toTime(o+this.props.width/5),h.end=i?i(l,r,a):l));const d=this.groupFromTarget(t);d&&(h.group=d.groupId),h=this._cloneItemData(h),this.options.onAdd(h,(i=>{i&&(e.itemsData.add(i),"drop"==t.type&&e.setSelection([i.id]))}))}_onMultiSelectItem(t){if(!this.options.selectable)return;const e=this.itemFromTarget(t);if(e){let i=this.options.multiselect?this.getSelection():[];if((t.srcEvent&&t.srcEvent.shiftKey||!1||this.options.sequentialSelection)&&this.options.multiselect){const t=this.itemsData.get(e.id).group;let n;this.options.multiselectPerGroup&&i.length>0&&(n=this.itemsData.get(i[0]).group),this.options.multiselectPerGroup&&null!=n&&n!=t||i.push(e.id);const o=$s._getItemRange(this.itemsData.get(i));if(!this.options.multiselectPerGroup||n==t){i=[];for(const t in this.items)if(this.items.hasOwnProperty(t)){const e=this.items[t],s=e.data.start,r=void 0!==e.data.end?e.data.end:s;!(s>=o.min&&r<=o.max)||this.options.multiselectPerGroup&&n!=this.itemsData.get(e.id).group||e instanceof Hs||i.push(e.id)}}}else{const t=i.indexOf(e.id);-1==t?i.push(e.id):i.splice(t,1)}const n=i.filter((t=>this.getItemById(t).selectable));this.setSelection(n),this.body.emitter.emit("select",{items:this.getSelection(),event:t})}}static _getItemRange(t){let e=null,i=null;return t.forEach((t=>{(null==i||t.start<i)&&(i=t.start),null!=t.end?(null==e||t.end>e)&&(e=t.end):(null==e||t.start>e)&&(e=t.start)})),{min:i,max:e}}itemFromElement(t){let e=t;for(;e;){if(e.hasOwnProperty("vis-item"))return e["vis-item"];e=e.parentNode}return null}itemFromTarget(t){return this.itemFromElement(t.target)}itemFromRelatedTarget(t){return this.itemFromElement(t.relatedTarget)}groupFromTarget(t){const e=t.center?t.center.y:t.clientY;let i=this.groupIds;i.length<=0&&this.groupsData&&(i=this.groupsData.getIds({order:this.options.groupOrder}));for(let t=0;t<i.length;t++){const n=i[t],o=this.groups[n],s=o.dom.foreground,r=s.getBoundingClientRect();if(e>=r.top&&e<r.top+s.offsetHeight)return o;if("top"===this.options.orientation.item){if(t===this.groupIds.length-1&&e>r.top)return o}else if(0===t&&e<r.top+s.offset)return o}return null}static itemSetFromTarget(t){let e=t.target;for(;e;){if(e.hasOwnProperty("vis-itemset"))return e["vis-itemset"];e=e.parentNode}return null}_cloneItemData(t,e){const i=Wo.extend({},t);return e||(e=this.itemsData.type),null!=i.start&&(i.start=Wo.convert(i.start,e&&e.start||"Date")),null!=i.end&&(i.end=Wo.convert(i.end,e&&e.end||"Date")),i}_clusterItems(){if(!this.options.cluster)return;const{scale:t}=this.body.range.conversion(this.body.domProps.center.width),e=this.clusterGenerator.getClusters(this.clusters,t,this.options.cluster);if(this.clusters!=e){if(this._detachAllClusters(),e){for(let t of e)t.attach();this.clusters=e}this._updateClusters(e)}}_detachAllClusters(){if(this.options.cluster&&this.clusters&&this.clusters.length)for(let t of this.clusters)t.detach()}_updateClusters(t){if(this.clusters&&this.clusters.length){const e=new Set(t.map((t=>t.id))),i=this.clusters.filter((t=>!e.has(t.id)));let n=!1;for(let t of i){const e=this.selection.indexOf(t.id);-1!==e&&(t.unselect(),this.selection.splice(e,1),n=!0)}if(n){const t=this.getSelection();this.body.emitter.emit("select",{items:t,event:event})}}this.clusters=t||[]}}$s.types={background:Hs,box:class extends js{constructor(t,e,i){if(super(t,e,i),this.props={dot:{width:0,height:0},line:{width:0,height:0}},t&&null==t.start)throw new Error(`Property "start" missing in item ${t}`)}isVisible(t){if(this.cluster)return!1;let e;const i=this.data.align||this.options.align,n=this.width*t.getMillisecondsPerPixel();return e="right"==i?this.data.start.getTime()>t.start&&this.data.start.getTime()-n<t.end:"left"==i?this.data.start.getTime()+n>t.start&&this.data.start.getTime()<t.end:this.data.start.getTime()+n/2>t.start&&this.data.start.getTime()-n/2<t.end,e}_createDomElement(){this.dom||(this.dom={},this.dom.box=document.createElement("DIV"),this.dom.content=document.createElement("DIV"),this.dom.content.className="vis-item-content",this.dom.box.appendChild(this.dom.content),this.dom.line=document.createElement("DIV"),this.dom.line.className="vis-line",this.dom.dot=document.createElement("DIV"),this.dom.dot.className="vis-dot",this.dom.box["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.box.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.box)}if(!this.dom.line.parentNode){var t=this.parent.dom.background;if(!t)throw new Error("Cannot redraw item: parent has no background container element");t.appendChild(this.dom.line)}if(!this.dom.dot.parentNode){const e=this.parent.dom.axis;if(!t)throw new Error("Cannot redraw item: parent has no axis container element");e.appendChild(this.dom.dot)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.box),this._updateStyle(this.dom.box);const t=this.editable.updateTime||this.editable.updateGroup,e=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(t?" vis-editable":" vis-readonly");this.dom.box.className=`vis-item vis-box${e}`,this.dom.line.className=`vis-item vis-line${e}`,this.dom.dot.className=`vis-item vis-dot${e}`}}_getDomComponentsSizes(){return{previous:{right:this.dom.box.style.right,left:this.dom.box.style.left},dot:{height:this.dom.dot.offsetHeight,width:this.dom.dot.offsetWidth},line:{width:this.dom.line.offsetWidth},box:{width:this.dom.box.offsetWidth,height:this.dom.box.offsetHeight}}}_updateDomComponentsSizes(t){this.options.rtl?this.dom.box.style.right="0px":this.dom.box.style.left="0px",this.props.dot.height=t.dot.height,this.props.dot.width=t.dot.width,this.props.line.width=t.line.width,this.width=t.box.width,this.height=t.box.height,this.options.rtl?this.dom.box.style.right=t.previous.right:this.dom.box.style.left=t.previous.left,this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.box),this._repaintDragCenter(),this._repaintDeleteButton(this.dom.box)}redraw(t){let e;const i=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),()=>{this.dirty&&(e=this._getDomComponentsSizes())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}show(t){if(!this.displayed)return this.redraw(t)}hide(){if(this.displayed){const t=this.dom;t.box.remove?t.box.remove():t.box.parentNode&&t.box.parentNode.removeChild(t.box),t.line.remove?t.line.remove():t.line.parentNode&&t.line.parentNode.removeChild(t.line),t.dot.remove?t.dot.remove():t.dot.parentNode&&t.dot.parentNode.removeChild(t.dot),this.displayed=!1}}repositionXY(){const t=this.options.rtl,e=(t,e,i,n=!1)=>{if(void 0===e&&void 0===i)return;const o=n?-1*e:e;t.style.transform=void 0!==i?void 0!==e?`translate(${o}px, ${i}px)`:`translateY(${i}px)`:`translateX(${o}px)`};e(this.dom.box,this.boxX,this.boxY,t),e(this.dom.dot,this.dotX,this.dotY,t),e(this.dom.line,this.lineX,this.lineY,t)}repositionX(){const t=this.conversion.toScreen(this.data.start),e=void 0===this.data.align?this.options.align:this.data.align,i=this.props.line.width,n=this.props.dot.width;"right"==e?(this.boxX=t-this.width,this.lineX=t-i,this.dotX=t-i/2-n/2):"left"==e?(this.boxX=t,this.lineX=t,this.dotX=t+i/2-n/2):(this.boxX=t-this.width/2,this.lineX=this.options.rtl?t-i:t-i/2,this.dotX=t-n/2),this.options.rtl?this.right=this.boxX:this.left=this.boxX,this.repositionXY()}repositionY(){const t=this.options.orientation.item,e=this.dom.line.style;if("top"==t){const t=this.parent.top+this.top+1;this.boxY=this.top||0,e.height=`${t}px`,e.bottom="",e.top="0"}else{const t=this.parent.itemSet.props.height-this.parent.top-this.parent.height+this.top;this.boxY=this.parent.height-this.top-(this.height||0),e.height=`${t}px`,e.top="",e.bottom="0"}this.dotY=-this.props.dot.height/2,this.repositionXY()}getWidthLeft(){return this.width/2}getWidthRight(){return this.width/2}},range:Ys,point:class extends js{constructor(t,e,i){if(super(t,e,i),this.props={dot:{top:0,width:0,height:0},content:{height:0,marginLeft:0,marginRight:0}},t&&null==t.start)throw new Error(`Property "start" missing in item ${t}`)}isVisible(t){if(this.cluster)return!1;const e=this.width*t.getMillisecondsPerPixel();return this.data.start.getTime()+e>t.start&&this.data.start<t.end}_createDomElement(){this.dom||(this.dom={},this.dom.point=document.createElement("div"),this.dom.content=document.createElement("div"),this.dom.content.className="vis-item-content",this.dom.point.appendChild(this.dom.content),this.dom.dot=document.createElement("div"),this.dom.point.appendChild(this.dom.dot),this.dom.point["vis-item"]=this,this.dirty=!0)}_appendDomElement(){if(!this.parent)throw new Error("Cannot redraw item: no parent attached");if(!this.dom.point.parentNode){const t=this.parent.dom.foreground;if(!t)throw new Error("Cannot redraw item: parent has no foreground container element");t.appendChild(this.dom.point)}this.displayed=!0}_updateDirtyDomComponents(){if(this.dirty){this._updateContents(this.dom.content),this._updateDataAttributes(this.dom.point),this._updateStyle(this.dom.point);const t=this.editable.updateTime||this.editable.updateGroup,e=(this.data.className?" "+this.data.className:"")+(this.selected?" vis-selected":"")+(t?" vis-editable":" vis-readonly");this.dom.point.className=`vis-item vis-point${e}`,this.dom.dot.className=`vis-item vis-dot${e}`}}_getDomComponentsSizes(){return{dot:{width:this.dom.dot.offsetWidth,height:this.dom.dot.offsetHeight},content:{width:this.dom.content.offsetWidth,height:this.dom.content.offsetHeight},point:{width:this.dom.point.offsetWidth,height:this.dom.point.offsetHeight}}}_updateDomComponentsSizes(t){this.props.dot.width=t.dot.width,this.props.dot.height=t.dot.height,this.props.content.height=t.content.height,this.options.rtl?this.dom.content.style.marginRight=this.props.dot.width/2+"px":this.dom.content.style.marginLeft=this.props.dot.width/2+"px",this.width=t.point.width,this.height=t.point.height,this.dom.dot.style.top=(this.height-this.props.dot.height)/2+"px";const e=this.props.dot.width,i=this.options.rtl?e/2:e/2*-1;this.dom.dot.style.transform=`translateX(${i}px`,this.dirty=!1}_repaintDomAdditionals(){this._repaintOnItemUpdateTimeTooltip(this.dom.point),this._repaintDragCenter(),this._repaintDeleteButton(this.dom.point)}redraw(t){let e;const i=[this._createDomElement.bind(this),this._appendDomElement.bind(this),this._updateDirtyDomComponents.bind(this),()=>{this.dirty&&(e=this._getDomComponentsSizes())},()=>{this.dirty&&this._updateDomComponentsSizes.bind(this)(e)},this._repaintDomAdditionals.bind(this)];if(t)return i;{let t;return i.forEach((e=>{t=e()})),t}}repositionXY(){const t=this.options.rtl;((t,e,i,n=!1)=>{if(void 0===e&&void 0===i)return;const o=n?-1*e:e;t.style.transform=void 0!==i?void 0!==e?`translate(${o}px, ${i}px)`:`translateY(${i}px)`:`translateX(${o}px)`})(this.dom.point,this.pointX,this.pointY,t)}show(t){if(!this.displayed)return this.redraw(t)}hide(){this.displayed&&(this.dom.point.parentNode&&this.dom.point.parentNode.removeChild(this.dom.point),this.displayed=!1)}repositionX(){const t=this.conversion.toScreen(this.data.start);this.pointX=t,this.options.rtl?this.right=t-this.props.dot.width:this.left=t-this.props.dot.width,this.repositionXY()}repositionY(){const t=this.options.orientation.item;this.pointY="top"==t?this.top:this.parent.height-this.top-this.height,this.repositionXY()}getWidthLeft(){return this.props.dot.width}getWidthRight(){return this.props.dot.width}}},$s.prototype._onAdd=$s.prototype._onUpdate;let qs,Xs=!1,Ks="background: #FFeeee; color: #dd0000";class Zs{constructor(){}static validate(t,e,i){Xs=!1,qs=e;let n=e;return void 0!==i&&(n=e[i]),Zs.parse(t,n,[]),Xs}static parse(t,e,i){for(let n in t)t.hasOwnProperty(n)&&Zs.check(n,t,e,i)}static check(t,e,i,n){if(void 0===i[t]&&void 0===i.__any__)return void Zs.getSuggestion(t,i,n);let o=t,s=!0;void 0===i[t]&&void 0!==i.__any__&&(o="__any__",s="object"===Zs.getType(e[t]));let r=i[o];s&&void 0!==r.__type__&&(r=r.__type__),Zs.checkFields(t,e,i,o,r,n)}static checkFields(t,e,i,n,o,s){let r=function(e){console.log("%c"+e+Zs.printLocation(s,t),Ks)},a=Zs.getType(e[t]),l=o[a];void 0!==l?"array"===Zs.getType(l)&&-1===l.indexOf(e[t])?(r('Invalid option detected in "'+t+'". Allowed values are:'+Zs.print(l)+' not "'+e[t]+'". '),Xs=!0):"object"===a&&"__any__"!==n&&(s=Wo.copyAndExtendArray(s,t),Zs.parse(e[t],i[n],s)):void 0===o.any&&(r('Invalid type received for "'+t+'". Expected: '+Zs.print(Object.keys(o))+". Received ["+a+'] "'+e[t]+'"'),Xs=!0)}static getType(t){var e=typeof t;return"object"===e?null===t?"null":t instanceof Boolean?"boolean":t instanceof Number?"number":t instanceof String?"string":Array.isArray(t)?"array":t instanceof Date?"date":void 0!==t.nodeType?"dom":!0===t._isAMomentObject?"moment":"object":"number"===e?"number":"boolean"===e?"boolean":"string"===e?"string":void 0===e?"undefined":e}static getSuggestion(t,e,i){let n,o=Zs.findInOptions(t,e,i,!1),s=Zs.findInOptions(t,qs,[],!0);n=void 0!==o.indexMatch?" in "+Zs.printLocation(o.path,t,"")+'Perhaps it was incomplete? Did you mean: "'+o.indexMatch+'"?\n\n':s.distance<=4&&o.distance>s.distance?" in "+Zs.printLocation(o.path,t,"")+"Perhaps it was misplaced? Matching option found at: "+Zs.printLocation(s.path,s.closestMatch,""):o.distance<=8?'. Did you mean "'+o.closestMatch+'"?'+Zs.printLocation(o.path,t):". Did you mean one of these: "+Zs.print(Object.keys(e))+Zs.printLocation(i,t),console.log('%cUnknown option detected: "'+t+'"'+n,Ks),Xs=!0}static findInOptions(t,e,i,n=!1){let o,s=1e9,r="",a=[],l=t.toLowerCase();for(let h in e){let d;if(void 0!==e[h].__type__&&!0===n){let n=Zs.findInOptions(t,e[h],Wo.copyAndExtendArray(i,h));s>n.distance&&(r=n.closestMatch,a=n.path,s=n.distance,o=n.indexMatch)}else-1!==h.toLowerCase().indexOf(l)&&(o=h),d=Zs.levenshteinDistance(t,h),s>d&&(r=h,a=Wo.copyArray(i),s=d)}return{closestMatch:r,path:a,distance:s,indexMatch:o}}static printLocation(t,e,i="Problem value found at: \n"){let n="\n\n"+i+"options = {\n";for(let e=0;e<t.length;e++){for(let t=0;t<e+1;t++)n+=" ";n+=t[e]+": {\n"}for(let e=0;e<t.length+1;e++)n+=" ";n+=e+"\n";for(let e=0;e<t.length+1;e++){for(let i=0;i<t.length-e;i++)n+=" ";n+="}\n"}return n+"\n\n"}static print(t){return JSON.stringify(t).replace(/(\")|(\[)|(\])|(,"__type__")/g,"").replace(/(\,)/g,", ")}static levenshteinDistance(t,e){if(0===t.length)return e.length;if(0===e.length)return t.length;var i,n,o=[];for(i=0;i<=e.length;i++)o[i]=[i];for(n=0;n<=t.length;n++)o[0][n]=n;for(i=1;i<=e.length;i++)for(n=1;n<=t.length;n++)e.charAt(i-1)==t.charAt(n-1)?o[i][n]=o[i-1][n-1]:o[i][n]=Math.min(o[i-1][n-1]+1,Math.min(o[i][n-1]+1,o[i-1][n]+1));return o[e.length][t.length]}}let Qs="string",Js="boolean",tr="number",er="array",ir="date",nr="object",or="moment",sr={configure:{enabled:{boolean:Js},filter:{boolean:Js,function:"function"},container:{dom:"dom"},__type__:{object:nr,boolean:Js,function:"function"}},align:{string:Qs},alignCurrentTime:{string:Qs,undefined:"undefined"},rtl:{boolean:Js,undefined:"undefined"},rollingMode:{follow:{boolean:Js},offset:{number:tr,undefined:"undefined"},__type__:{object:nr}},onTimeout:{timeoutMs:{number:tr},callback:{function:"function"},__type__:{object:nr}},verticalScroll:{boolean:Js,undefined:"undefined"},horizontalScroll:{boolean:Js,undefined:"undefined"},autoResize:{boolean:Js},throttleRedraw:{number:tr},clickToUse:{boolean:Js},dataAttributes:{string:Qs,array:er},editable:{add:{boolean:Js,undefined:"undefined"},remove:{boolean:Js,undefined:"undefined"},updateGroup:{boolean:Js,undefined:"undefined"},updateTime:{boolean:Js,undefined:"undefined"},overrideItems:{boolean:Js,undefined:"undefined"},__type__:{boolean:Js,object:nr}},end:{number:tr,date:ir,string:Qs,moment:or},format:{minorLabels:{millisecond:{string:Qs,undefined:"undefined"},second:{string:Qs,undefined:"undefined"},minute:{string:Qs,undefined:"undefined"},hour:{string:Qs,undefined:"undefined"},weekday:{string:Qs,undefined:"undefined"},day:{string:Qs,undefined:"undefined"},week:{string:Qs,undefined:"undefined"},month:{string:Qs,undefined:"undefined"},year:{string:Qs,undefined:"undefined"},__type__:{object:nr,function:"function"}},majorLabels:{millisecond:{string:Qs,undefined:"undefined"},second:{string:Qs,undefined:"undefined"},minute:{string:Qs,undefined:"undefined"},hour:{string:Qs,undefined:"undefined"},weekday:{string:Qs,undefined:"undefined"},day:{string:Qs,undefined:"undefined"},week:{string:Qs,undefined:"undefined"},month:{string:Qs,undefined:"undefined"},year:{string:Qs,undefined:"undefined"},__type__:{object:nr,function:"function"}},__type__:{object:nr}},moment:{function:"function"},groupHeightMode:{string:Qs},groupOrder:{string:Qs,function:"function"},groupEditable:{add:{boolean:Js,undefined:"undefined"},remove:{boolean:Js,undefined:"undefined"},order:{boolean:Js,undefined:"undefined"},__type__:{boolean:Js,object:nr}},groupOrderSwap:{function:"function"},height:{string:Qs,number:tr},hiddenDates:{start:{date:ir,number:tr,string:Qs,moment:or},end:{date:ir,number:tr,string:Qs,moment:or},repeat:{string:Qs},__type__:{object:nr,array:er}},itemsAlwaysDraggable:{item:{boolean:Js,undefined:"undefined"},range:{boolean:Js,undefined:"undefined"},__type__:{boolean:Js,object:nr}},limitSize:{boolean:Js},locale:{string:Qs},locales:{__any__:{any:"any"},__type__:{object:nr}},longSelectPressTime:{number:tr},margin:{axis:{number:tr},item:{horizontal:{number:tr,undefined:"undefined"},vertical:{number:tr,undefined:"undefined"},__type__:{object:nr,number:tr}},__type__:{object:nr,number:tr}},max:{date:ir,number:tr,string:Qs,moment:or},maxHeight:{number:tr,string:Qs},maxMinorChars:{number:tr},min:{date:ir,number:tr,string:Qs,moment:or},minHeight:{number:tr,string:Qs},moveable:{boolean:Js},multiselect:{boolean:Js},multiselectPerGroup:{boolean:Js},onAdd:{function:"function"},onDropObjectOnItem:{function:"function"},onUpdate:{function:"function"},onMove:{function:"function"},onMoving:{function:"function"},onRemove:{function:"function"},onAddGroup:{function:"function"},onMoveGroup:{function:"function"},onRemoveGroup:{function:"function"},onInitialDrawComplete:{function:"function"},order:{function:"function"},orientation:{axis:{string:Qs,undefined:"undefined"},item:{string:Qs,undefined:"undefined"},__type__:{string:Qs,object:nr}},selectable:{boolean:Js},sequentialSelection:{boolean:Js},showCurrentTime:{boolean:Js},showMajorLabels:{boolean:Js},showMinorLabels:{boolean:Js},showWeekScale:{boolean:Js},stack:{boolean:Js},stackSubgroups:{boolean:Js},cluster:{maxItems:{number:tr,undefined:"undefined"},titleTemplate:{string:Qs,undefined:"undefined"},clusterCriteria:{function:"function",undefined:"undefined"},showStipes:{boolean:Js,undefined:"undefined"},fitOnDoubleClick:{boolean:Js,undefined:"undefined"},__type__:{boolean:Js,object:nr}},snap:{function:"function",null:"null"},start:{date:ir,number:tr,string:Qs,moment:or},template:{function:"function"},loadingScreenTemplate:{function:"function"},groupTemplate:{function:"function"},visibleFrameTemplate:{string:Qs,function:"function"},showTooltips:{boolean:Js},tooltip:{followMouse:{boolean:Js},overflowMethod:{string:["cap","flip","none"]},delay:{number:tr},template:{function:"function"},__type__:{object:nr}},tooltipOnItemUpdateTime:{template:{function:"function"},__type__:{boolean:Js,object:nr}},timeAxis:{scale:{string:Qs,undefined:"undefined"},step:{number:tr,undefined:"undefined"},__type__:{object:nr}},type:{string:Qs},width:{string:Qs,number:tr},preferZoom:{boolean:Js},zoomable:{boolean:Js},zoomKey:{string:["ctrlKey","altKey","shiftKey","metaKey",""]},zoomFriction:{number:tr},zoomMax:{number:tr},zoomMin:{number:tr},xss:{disabled:{boolean:Js},filterOptions:{__any__:{any:"any"},__type__:{object:nr}},__type__:{object:nr}},__type__:{object:nr}},rr={global:{align:["center","left","right"],alignCurrentTime:["none","year","month","quarter","week","isoWeek","day","date","hour","minute","second"],direction:!1,autoResize:!0,clickToUse:!1,editable:{add:!1,remove:!1,updateGroup:!1,updateTime:!1},end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",week:"w",month:"MMM",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",week:"MMMM YYYY",month:"YYYY",year:""}},groupHeightMode:["auto","fixed","fitItems"],groupsDraggable:!1,height:"",locale:"",longSelectPressTime:251,margin:{axis:[20,0,100,1],item:{horizontal:[10,0,100,1],vertical:[10,0,100,1]}},max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!1,multiselect:!1,multiselectPerGroup:!1,orientation:{axis:["both","bottom","top"],item:["bottom","top"]},preferZoom:!1,selectable:!0,showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,stack:!0,stackSubgroups:!0,cluster:!1,start:"",showTooltips:!0,tooltip:{followMouse:!1,overflowMethod:"flip",delay:[500,0,99999,100]},tooltipOnItemUpdateTime:!1,type:["box","point","range","background"],width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","shiftKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1],xss:{disabled:!1}}};var ar={black:"#000000",navy:"#000080",darkblue:"#00008B",mediumblue:"#0000CD",blue:"#0000FF",darkgreen:"#006400",green:"#008000",teal:"#008080",darkcyan:"#008B8B",deepskyblue:"#00BFFF",darkturquoise:"#00CED1",mediumspringgreen:"#00FA9A",lime:"#00FF00",springgreen:"#00FF7F",aqua:"#00FFFF",cyan:"#00FFFF",midnightblue:"#191970",dodgerblue:"#1E90FF",lightseagreen:"#20B2AA",forestgreen:"#228B22",seagreen:"#2E8B57",darkslategray:"#2F4F4F",limegreen:"#32CD32",mediumseagreen:"#3CB371",turquoise:"#40E0D0",royalblue:"#4169E1",steelblue:"#4682B4",darkslateblue:"#483D8B",mediumturquoise:"#48D1CC",indigo:"#4B0082",darkolivegreen:"#556B2F",cadetblue:"#5F9EA0",cornflowerblue:"#6495ED",mediumaquamarine:"#66CDAA",dimgray:"#696969",slateblue:"#6A5ACD",olivedrab:"#6B8E23",slategray:"#708090",lightslategray:"#778899",mediumslateblue:"#7B68EE",lawngreen:"#7CFC00",chartreuse:"#7FFF00",aquamarine:"#7FFFD4",maroon:"#800000",purple:"#800080",olive:"#808000",gray:"#808080",skyblue:"#87CEEB",lightskyblue:"#87CEFA",blueviolet:"#8A2BE2",darkred:"#8B0000",darkmagenta:"#8B008B",saddlebrown:"#8B4513",darkseagreen:"#8FBC8F",lightgreen:"#90EE90",mediumpurple:"#9370D8",darkviolet:"#9400D3",palegreen:"#98FB98",darkorchid:"#9932CC",yellowgreen:"#9ACD32",sienna:"#A0522D",brown:"#A52A2A",darkgray:"#A9A9A9",lightblue:"#ADD8E6",greenyellow:"#ADFF2F",paleturquoise:"#AFEEEE",lightsteelblue:"#B0C4DE",powderblue:"#B0E0E6",firebrick:"#B22222",darkgoldenrod:"#B8860B",mediumorchid:"#BA55D3",rosybrown:"#BC8F8F",darkkhaki:"#BDB76B",silver:"#C0C0C0",mediumvioletred:"#C71585",indianred:"#CD5C5C",peru:"#CD853F",chocolate:"#D2691E",tan:"#D2B48C",lightgrey:"#D3D3D3",palevioletred:"#D87093",thistle:"#D8BFD8",orchid:"#DA70D6",goldenrod:"#DAA520",crimson:"#DC143C",gainsboro:"#DCDCDC",plum:"#DDA0DD",burlywood:"#DEB887",lightcyan:"#E0FFFF",lavender:"#E6E6FA",darksalmon:"#E9967A",violet:"#EE82EE",palegoldenrod:"#EEE8AA",lightcoral:"#F08080",khaki:"#F0E68C",aliceblue:"#F0F8FF",honeydew:"#F0FFF0",azure:"#F0FFFF",sandybrown:"#F4A460",wheat:"#F5DEB3",beige:"#F5F5DC",whitesmoke:"#F5F5F5",mintcream:"#F5FFFA",ghostwhite:"#F8F8FF",salmon:"#FA8072",antiquewhite:"#FAEBD7",linen:"#FAF0E6",lightgoldenrodyellow:"#FAFAD2",oldlace:"#FDF5E6",red:"#FF0000",fuchsia:"#FF00FF",magenta:"#FF00FF",deeppink:"#FF1493",orangered:"#FF4500",tomato:"#FF6347",hotpink:"#FF69B4",coral:"#FF7F50",darkorange:"#FF8C00",lightsalmon:"#FFA07A",orange:"#FFA500",lightpink:"#FFB6C1",pink:"#FFC0CB",gold:"#FFD700",peachpuff:"#FFDAB9",navajowhite:"#FFDEAD",moccasin:"#FFE4B5",bisque:"#FFE4C4",mistyrose:"#FFE4E1",blanchedalmond:"#FFEBCD",papayawhip:"#FFEFD5",lavenderblush:"#FFF0F5",seashell:"#FFF5EE",cornsilk:"#FFF8DC",lemonchiffon:"#FFFACD",floralwhite:"#FFFAF0",snow:"#FFFAFA",yellow:"#FFFF00",lightyellow:"#FFFFE0",ivory:"#FFFFF0",white:"#FFFFFF"};class lr{constructor(t=1){this.pixelRatio=t,this.generated=!1,this.centerCoordinates={x:144.5,y:144.5},this.r=289*.49,this.color={r:255,g:255,b:255,a:1},this.hueCircle=void 0,this.initialColor={r:255,g:255,b:255,a:1},this.previousColor=void 0,this.applied=!1,this.updateCallback=()=>{},this.closeCallback=()=>{},this._create()}insertTo(t){void 0!==this.hammer&&(this.hammer.destroy(),this.hammer=void 0),this.container=t,this.container.appendChild(this.frame),this._bindHammer(),this._setSize()}setUpdateCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker update callback is not a function.");this.updateCallback=t}setCloseCallback(t){if("function"!=typeof t)throw new Error("Function attempted to set as colorPicker closing callback is not a function.");this.closeCallback=t}_isColorString(t){if("string"==typeof t)return ar[t]}setColor(t,e=!0){if("none"===t)return;let i;var n=this._isColorString(t);if(void 0!==n&&(t=n),!0===Wo.isString(t)){if(!0===Wo.isValidRGB(t)){let e=t.substr(4).substr(0,t.length-5).split(",");i={r:e[0],g:e[1],b:e[2],a:1}}else if(!0===Wo.isValidRGBA(t)){let e=t.substr(5).substr(0,t.length-6).split(",");i={r:e[0],g:e[1],b:e[2],a:e[3]}}else if(!0===Wo.isValidHex(t)){let e=Wo.hexToRGB(t);i={r:e.r,g:e.g,b:e.b,a:1}}}else if(t instanceof Object&&void 0!==t.r&&void 0!==t.g&&void 0!==t.b){let e=void 0!==t.a?t.a:"1.0";i={r:t.r,g:t.g,b:t.b,a:e}}if(void 0===i)throw new Error("Unknown color passed to the colorPicker. Supported are strings: rgb, hex, rgba. Object: rgb ({r:r,g:g,b:b,[a:a]}). Supplied: "+JSON.stringify(t));this._setColor(i,e)}show(){void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0),this.applied=!1,this.frame.style.display="block",this._generateHueCircle()}_hide(t=!0){!0===t&&(this.previousColor=Wo.extend({},this.color)),!0===this.applied&&this.updateCallback(this.initialColor),this.frame.style.display="none",setTimeout((()=>{void 0!==this.closeCallback&&(this.closeCallback(),this.closeCallback=void 0)}),0)}_save(){this.updateCallback(this.color),this.applied=!1,this._hide()}_apply(){this.applied=!0,this.updateCallback(this.color),this._updatePicker(this.color)}_loadLast(){void 0!==this.previousColor?this.setColor(this.previousColor,!1):alert("There is no last color to load...")}_setColor(t,e=!0){!0===e&&(this.initialColor=Wo.extend({},t)),this.color=t;let i=Wo.RGBToHSV(t.r,t.g,t.b),n=2*Math.PI,o=this.r*i.s,s=this.centerCoordinates.x+o*Math.sin(n*i.h),r=this.centerCoordinates.y+o*Math.cos(n*i.h);this.colorPickerSelector.style.left=s-.5*this.colorPickerSelector.clientWidth+"px",this.colorPickerSelector.style.top=r-.5*this.colorPickerSelector.clientHeight+"px",this._updatePicker(t)}_setOpacity(t){this.color.a=t/100,this._updatePicker(this.color)}_setBrightness(t){let e=Wo.RGBToHSV(this.color.r,this.color.g,this.color.b);e.v=t/100;let i=Wo.HSVToRGB(e.h,e.s,e.v);i.a=this.color.a,this.color=i,this._updatePicker()}_updatePicker(t=this.color){let e=Wo.RGBToHSV(t.r,t.g,t.b),i=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(i.webkitBackingStorePixelRatio||i.mozBackingStorePixelRatio||i.msBackingStorePixelRatio||i.oBackingStorePixelRatio||i.backingStorePixelRatio||1)),i.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let n=this.colorPickerCanvas.clientWidth,o=this.colorPickerCanvas.clientHeight;i.clearRect(0,0,n,o),i.putImageData(this.hueCircle,0,0),i.fillStyle="rgba(0,0,0,"+(1-e.v)+")",i.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),i.fill(),this.brightnessRange.value=100*e.v,this.opacityRange.value=100*t.a,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}_setSize(){this.colorPickerCanvas.style.width="100%",this.colorPickerCanvas.style.height="100%",this.colorPickerCanvas.width=289*this.pixelRatio,this.colorPickerCanvas.height=289*this.pixelRatio}_create(){if(this.frame=document.createElement("div"),this.frame.className="vis-color-picker",this.colorPickerDiv=document.createElement("div"),this.colorPickerSelector=document.createElement("div"),this.colorPickerSelector.className="vis-selector",this.colorPickerDiv.appendChild(this.colorPickerSelector),this.colorPickerCanvas=document.createElement("canvas"),this.colorPickerDiv.appendChild(this.colorPickerCanvas),this.colorPickerCanvas.getContext){let t=this.colorPickerCanvas.getContext("2d");this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1),this.colorPickerCanvas.getContext("2d").setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0)}else{let t=document.createElement("DIV");t.style.color="red",t.style.fontWeight="bold",t.style.padding="10px",t.innerHTML="Error: your browser does not support HTML canvas",this.colorPickerCanvas.appendChild(t)}this.colorPickerDiv.className="vis-color",this.opacityDiv=document.createElement("div"),this.opacityDiv.className="vis-opacity",this.brightnessDiv=document.createElement("div"),this.brightnessDiv.className="vis-brightness",this.arrowDiv=document.createElement("div"),this.arrowDiv.className="vis-arrow",this.opacityRange=document.createElement("input");try{this.opacityRange.type="range",this.opacityRange.min="0",this.opacityRange.max="100"}catch(t){}this.opacityRange.value="100",this.opacityRange.className="vis-range",this.brightnessRange=document.createElement("input");try{this.brightnessRange.type="range",this.brightnessRange.min="0",this.brightnessRange.max="100"}catch(t){}this.brightnessRange.value="100",this.brightnessRange.className="vis-range",this.opacityDiv.appendChild(this.opacityRange),this.brightnessDiv.appendChild(this.brightnessRange);var t=this;this.opacityRange.onchange=function(){t._setOpacity(this.value)},this.opacityRange.oninput=function(){t._setOpacity(this.value)},this.brightnessRange.onchange=function(){t._setBrightness(this.value)},this.brightnessRange.oninput=function(){t._setBrightness(this.value)},this.brightnessLabel=document.createElement("div"),this.brightnessLabel.className="vis-label vis-brightness",this.brightnessLabel.innerHTML="brightness:",this.opacityLabel=document.createElement("div"),this.opacityLabel.className="vis-label vis-opacity",this.opacityLabel.innerHTML="opacity:",this.newColorDiv=document.createElement("div"),this.newColorDiv.className="vis-new-color",this.newColorDiv.innerHTML="new",this.initialColorDiv=document.createElement("div"),this.initialColorDiv.className="vis-initial-color",this.initialColorDiv.innerHTML="initial",this.cancelButton=document.createElement("div"),this.cancelButton.className="vis-button vis-cancel",this.cancelButton.innerHTML="cancel",this.cancelButton.onclick=this._hide.bind(this,!1),this.applyButton=document.createElement("div"),this.applyButton.className="vis-button vis-apply",this.applyButton.innerHTML="apply",this.applyButton.onclick=this._apply.bind(this),this.saveButton=document.createElement("div"),this.saveButton.className="vis-button vis-save",this.saveButton.innerHTML="save",this.saveButton.onclick=this._save.bind(this),this.loadButton=document.createElement("div"),this.loadButton.className="vis-button vis-load",this.loadButton.innerHTML="load last",this.loadButton.onclick=this._loadLast.bind(this),this.frame.appendChild(this.colorPickerDiv),this.frame.appendChild(this.arrowDiv),this.frame.appendChild(this.brightnessLabel),this.frame.appendChild(this.brightnessDiv),this.frame.appendChild(this.opacityLabel),this.frame.appendChild(this.opacityDiv),this.frame.appendChild(this.newColorDiv),this.frame.appendChild(this.initialColorDiv),this.frame.appendChild(this.cancelButton),this.frame.appendChild(this.applyButton),this.frame.appendChild(this.saveButton),this.frame.appendChild(this.loadButton)}_bindHammer(){this.drag={},this.pinch={},this.hammer=new ns(this.colorPickerCanvas),this.hammer.get("pinch").set({enable:!0}),os(this.hammer,(t=>{this._moveSelector(t)})),this.hammer.on("tap",(t=>{this._moveSelector(t)})),this.hammer.on("panstart",(t=>{this._moveSelector(t)})),this.hammer.on("panmove",(t=>{this._moveSelector(t)})),this.hammer.on("panend",(t=>{this._moveSelector(t)}))}_generateHueCircle(){if(!1===this.generated){let t=this.colorPickerCanvas.getContext("2d");void 0===this.pixelRation&&(this.pixelRatio=(window.devicePixelRatio||1)/(t.webkitBackingStorePixelRatio||t.mozBackingStorePixelRatio||t.msBackingStorePixelRatio||t.oBackingStorePixelRatio||t.backingStorePixelRatio||1)),t.setTransform(this.pixelRatio,0,0,this.pixelRatio,0,0);let e,i,n,o,s=this.colorPickerCanvas.clientWidth,r=this.colorPickerCanvas.clientHeight;t.clearRect(0,0,s,r),this.centerCoordinates={x:.5*s,y:.5*r},this.r=.49*s;let a,l=2*Math.PI/360,h=1/360,d=1/this.r;for(n=0;n<360;n++)for(o=0;o<this.r;o++)e=this.centerCoordinates.x+o*Math.sin(l*n),i=this.centerCoordinates.y+o*Math.cos(l*n),a=Wo.HSVToRGB(n*h,o*d,1),t.fillStyle="rgb("+a.r+","+a.g+","+a.b+")",t.fillRect(e-.5,i-.5,2,2);t.strokeStyle="rgba(0,0,0,1)",t.circle(this.centerCoordinates.x,this.centerCoordinates.y,this.r),t.stroke(),this.hueCircle=t.getImageData(0,0,s,r)}this.generated=!0}_moveSelector(t){let e=this.colorPickerDiv.getBoundingClientRect(),i=t.center.x-e.left,n=t.center.y-e.top,o=.5*this.colorPickerDiv.clientHeight,s=.5*this.colorPickerDiv.clientWidth,r=i-s,a=n-o,l=Math.atan2(r,a),h=.98*Math.min(Math.sqrt(r*r+a*a),s),d=Math.cos(l)*h+o,c=Math.sin(l)*h+s;this.colorPickerSelector.style.top=d-.5*this.colorPickerSelector.clientHeight+"px",this.colorPickerSelector.style.left=c-.5*this.colorPickerSelector.clientWidth+"px";let u=l/(2*Math.PI);u=u<0?u+1:u;let p=h/this.r,m=Wo.RGBToHSV(this.color.r,this.color.g,this.color.b);m.h=u,m.s=p;let f=Wo.HSVToRGB(m.h,m.s,m.v);f.a=this.color.a,this.color=f,this.initialColorDiv.style.backgroundColor="rgba("+this.initialColor.r+","+this.initialColor.g+","+this.initialColor.b+","+this.initialColor.a+")",this.newColorDiv.style.backgroundColor="rgba("+this.color.r+","+this.color.g+","+this.color.b+","+this.color.a+")"}}class hr{constructor(t,e,i,n=1){this.parent=t,this.changedOptions=[],this.container=e,this.allowCreation=!1,this.options={},this.initialized=!1,this.popupCounter=0,this.defaultOptions={enabled:!1,filter:!0,container:void 0,showButton:!0},Wo.extend(this.options,this.defaultOptions),this.configureOptions=i,this.moduleOptions={},this.domElements=[],this.popupDiv={},this.popupLimit=5,this.popupHistory={},this.colorPicker=new lr(n),this.wrapper=void 0}setOptions(t){if(void 0!==t){this.popupHistory={},this._removePopup();let e=!0;if("string"==typeof t)this.options.filter=t;else if(Array.isArray(t))this.options.filter=t.join();else if("object"==typeof t){if(null==t)throw new TypeError("options cannot be null");void 0!==t.container&&(this.options.container=t.container),void 0!==t.filter&&(this.options.filter=t.filter),void 0!==t.showButton&&(this.options.showButton=t.showButton),void 0!==t.enabled&&(e=t.enabled)}else"boolean"==typeof t?(this.options.filter=!0,e=t):"function"==typeof t&&(this.options.filter=t,e=!0);!1===this.options.filter&&(e=!1),this.options.enabled=e}this._clean()}setModuleOptions(t){this.moduleOptions=t,!0===this.options.enabled&&(this._clean(),void 0!==this.options.container&&(this.container=this.options.container),this._create())}_create(){this._clean(),this.changedOptions=[];let t=this.options.filter,e=0,i=!1;for(let n in this.configureOptions)this.configureOptions.hasOwnProperty(n)&&(this.allowCreation=!1,i=!1,"function"==typeof t?(i=t(n,[]),i=i||this._handleObject(this.configureOptions[n],[n],!0)):!0!==t&&-1===t.indexOf(n)||(i=!0),!1!==i&&(this.allowCreation=!0,e>0&&this._makeItem([]),this._makeHeader(n),this._handleObject(this.configureOptions[n],[n])),e++);this._makeButton(),this._push()}_push(){this.wrapper=document.createElement("div"),this.wrapper.className="vis-configuration-wrapper",this.container.appendChild(this.wrapper);for(var t=0;t<this.domElements.length;t++)this.wrapper.appendChild(this.domElements[t]);this._showPopupIfNeeded()}_clean(){for(var t=0;t<this.domElements.length;t++)this.wrapper.removeChild(this.domElements[t]);void 0!==this.wrapper&&(this.container.removeChild(this.wrapper),this.wrapper=void 0),this.domElements=[],this._removePopup()}_getValue(t){let e=this.moduleOptions;for(let i=0;i<t.length;i++){if(void 0===e[t[i]]){e=void 0;break}e=e[t[i]]}return e}_makeItem(t,...e){if(!0===this.allowCreation){let i=document.createElement("div");return i.className="vis-configuration vis-config-item vis-config-s"+t.length,e.forEach((t=>{i.appendChild(t)})),this.domElements.push(i),this.domElements.length}return 0}_makeHeader(t){let e=document.createElement("div");e.className="vis-configuration vis-config-header",e.innerHTML=Wo.xss(t),this._makeItem([],e)}_makeLabel(t,e,i=!1){let n=document.createElement("div");return n.className="vis-configuration vis-config-label vis-config-s"+e.length,n.innerHTML=!0===i?Wo.xss("<i><b>"+t+":</b></i>"):Wo.xss(t+":"),n}_makeDropdown(t,e,i){let n=document.createElement("select");n.className="vis-configuration vis-config-select";let o=0;void 0!==e&&-1!==t.indexOf(e)&&(o=t.indexOf(e));for(let e=0;e<t.length;e++){let i=document.createElement("option");i.value=t[e],e===o&&(i.selected="selected"),i.innerHTML=t[e],n.appendChild(i)}let s=this;n.onchange=function(){s._update(this.value,i)};let r=this._makeLabel(i[i.length-1],i);this._makeItem(i,r,n)}_makeRange(t,e,i){let n=t[0],o=t[1],s=t[2],r=t[3],a=document.createElement("input");a.className="vis-configuration vis-config-range";try{a.type="range",a.min=o,a.max=s}catch(t){}a.step=r;let l="",h=0;if(void 0!==e){let t=1.2;e<0&&e*t<o?(a.min=Math.ceil(e*t),h=a.min,l="range increased"):e/t<o&&(a.min=Math.ceil(e/t),h=a.min,l="range increased"),e*t>s&&1!==s&&(a.max=Math.ceil(e*t),h=a.max,l="range increased"),a.value=e}else a.value=n;let d=document.createElement("input");d.className="vis-configuration vis-config-rangeinput",d.value=Number(a.value);var c=this;a.onchange=function(){d.value=this.value,c._update(Number(this.value),i)},a.oninput=function(){d.value=this.value};let u=this._makeLabel(i[i.length-1],i),p=this._makeItem(i,u,a,d);""!==l&&this.popupHistory[p]!==h&&(this.popupHistory[p]=h,this._setupPopup(l,p))}_makeButton(){if(!0===this.options.showButton){let t=document.createElement("div");t.className="vis-configuration vis-config-button",t.innerHTML="generate options",t.onclick=()=>{this._printOptions()},t.onmouseover=()=>{t.className="vis-configuration vis-config-button hover"},t.onmouseout=()=>{t.className="vis-configuration vis-config-button"},this.optionsContainer=document.createElement("div"),this.optionsContainer.className="vis-configuration vis-config-option-container",this.domElements.push(this.optionsContainer),this.domElements.push(t)}}_setupPopup(t,e){if(!0===this.initialized&&!0===this.allowCreation&&this.popupCounter<this.popupLimit){let i=document.createElement("div");i.id="vis-configuration-popup",i.className="vis-configuration-popup",i.innerHTML=Wo.xss(t),i.onclick=()=>{this._removePopup()},this.popupCounter+=1,this.popupDiv={html:i,index:e}}}_removePopup(){void 0!==this.popupDiv.html&&(this.popupDiv.html.parentNode.removeChild(this.popupDiv.html),clearTimeout(this.popupDiv.hideTimeout),clearTimeout(this.popupDiv.deleteTimeout),this.popupDiv={})}_showPopupIfNeeded(){if(void 0!==this.popupDiv.html){let t=this.domElements[this.popupDiv.index].getBoundingClientRect();this.popupDiv.html.style.left=t.left+"px",this.popupDiv.html.style.top=t.top-30+"px",document.body.appendChild(this.popupDiv.html),this.popupDiv.hideTimeout=setTimeout((()=>{this.popupDiv.html.style.opacity=0}),1500),this.popupDiv.deleteTimeout=setTimeout((()=>{this._removePopup()}),1800)}}_makeCheckbox(t,e,i){var n=document.createElement("input");n.type="checkbox",n.className="vis-configuration vis-config-checkbox",n.checked=t,void 0!==e&&(n.checked=e,e!==t&&("object"==typeof t?e!==t.enabled&&this.changedOptions.push({path:i,value:e}):this.changedOptions.push({path:i,value:e})));let o=this;n.onchange=function(){o._update(this.checked,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeTextInput(t,e,i){var n=document.createElement("input");n.type="text",n.className="vis-configuration vis-config-text",n.value=e,e!==t&&this.changedOptions.push({path:i,value:e});let o=this;n.onchange=function(){o._update(this.value,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,n)}_makeColorField(t,e,i){let n=t[1],o=document.createElement("div");"none"!==(e=void 0===e?n:e)?(o.className="vis-configuration vis-config-colorBlock",o.style.backgroundColor=e):o.className="vis-configuration vis-config-colorBlock none",e=void 0===e?n:e,o.onclick=()=>{this._showColorPicker(e,o,i)};let s=this._makeLabel(i[i.length-1],i);this._makeItem(i,s,o)}_showColorPicker(t,e,i){e.onclick=function(){},this.colorPicker.insertTo(e),this.colorPicker.show(),this.colorPicker.setColor(t),this.colorPicker.setUpdateCallback((t=>{let n="rgba("+t.r+","+t.g+","+t.b+","+t.a+")";e.style.backgroundColor=n,this._update(n,i)})),this.colorPicker.setCloseCallback((()=>{e.onclick=()=>{this._showColorPicker(t,e,i)}}))}_handleObject(t,e=[],i=!1){let n=!1,o=this.options.filter,s=!1;for(let r in t)if(t.hasOwnProperty(r)){n=!0;let a=t[r],l=Wo.copyAndExtendArray(e,r);if("function"==typeof o&&(n=o(r,e),!1===n&&!Array.isArray(a)&&"string"!=typeof a&&"boolean"!=typeof a&&a instanceof Object&&(this.allowCreation=!1,n=this._handleObject(a,l,!0),this.allowCreation=!1===i)),!1!==n){s=!0;let t=this._getValue(l);if(Array.isArray(a))this._handleArray(a,t,l);else if("string"==typeof a)this._makeTextInput(a,t,l);else if("boolean"==typeof a)this._makeCheckbox(a,t,l);else if(a instanceof Object){let t=!0;if(-1!==e.indexOf("physics")&&this.moduleOptions.physics.solver!==r&&(t=!1),!0===t)if(void 0!==a.enabled){let t=Wo.copyAndExtendArray(l,"enabled"),e=this._getValue(t);if(!0===e){let t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}else this._makeCheckbox(a,e,l)}else{let t=this._makeLabel(r,l,!0);this._makeItem(l,t),s=this._handleObject(a,l)||s}}else console.error("dont know how to handle",a,r,l)}}return s}_handleArray(t,e,i){"string"==typeof t[0]&&"color"===t[0]?(this._makeColorField(t,e,i),t[1]!==e&&this.changedOptions.push({path:i,value:e})):"string"==typeof t[0]?(this._makeDropdown(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:e})):"number"==typeof t[0]&&(this._makeRange(t,e,i),t[0]!==e&&this.changedOptions.push({path:i,value:Number(e)}))}_update(t,e){let i=this._constructOptions(t,e);this.parent.body&&this.parent.body.emitter&&this.parent.body.emitter.emit&&this.parent.body.emitter.emit("configChange",i),this.initialized=!0,this.parent.setOptions(i)}_constructOptions(t,e,i={}){let n=i;t="false"!==(t="true"===t||t)&&t;for(let i=0;i<e.length;i++)"global"!==e[i]&&(void 0===n[e[i]]&&(n[e[i]]={}),i!==e.length-1?n=n[e[i]]:n[e[i]]=t);return i}_printOptions(){let t=this.getOptions();this.optionsContainer.innerHTML="<pre>var options = "+JSON.stringify(t,null,2)+"</pre>"}getOptions(){let t={};for(var e=0;e<this.changedOptions.length;e++)this._constructOptions(this.changedOptions[e].value,this.changedOptions[e].path,t);return t}}class dr extends Cs{constructor(t,e,i,n){if(super(),this.initTime=new Date,this.itemsDone=!1,!(this instanceof dr))throw new SyntaxError("Constructor must be called with the new operator");if(!Array.isArray(i)&&!Fo(i)&&i instanceof Object){const t=n;n=i,i=t}n&&n.throttleRedraw&&console.warn('Timeline option "throttleRedraw" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.');const o=this;if(this.defaultOptions={autoResize:!0,longSelectPressTime:251,orientation:{axis:"bottom",item:"bottom"},moment:No},this.options=Wo.deepExtend({},this.defaultOptions),n&&Wo.setupXSSProtection(n.xss),this._create(t),!n||n&&void 0===n.rtl){let t;this.dom.root.style.visibility="hidden";let e=this.dom.root;for(;!t&&e;)t=window.getComputedStyle(e,null).direction,e=e.parentElement;this.options.rtl=t&&"rtl"==t.toLowerCase()}else this.options.rtl=n.rtl;n&&(n.rollingMode&&(this.options.rollingMode=n.rollingMode),n.onInitialDrawComplete&&(this.options.onInitialDrawComplete=n.onInitialDrawComplete),n.onTimeout&&(this.options.onTimeout=n.onTimeout),n.loadingScreenTemplate&&(this.options.loadingScreenTemplate=n.loadingScreenTemplate));const s=document.createElement("div");if(this.options.loadingScreenTemplate){const t=this.options.loadingScreenTemplate.bind(this),e=t(this.dom.loadingScreen);e instanceof Object&&!(e instanceof Element)?t(s):e instanceof Element?(s.innerHTML="",s.appendChild(e)):null!=e&&(s.innerHTML=Wo.xss(e))}function r(t,e){o.hasListeners(t)&&o.emit(t,o.getEventProperties(e))}this.dom.loadingScreen.appendChild(s),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{getScale:()=>o.timeAxis.step.scale,getStep:()=>o.timeAxis.step.step,toScreen:o._toScreen.bind(o),toGlobalScreen:o._toGlobalScreen.bind(o),toTime:o._toTime.bind(o),toGlobalTime:o._toGlobalTime.bind(o)}},this.range=new ts(this.body,this.options),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new rs(this.body,this.options),this.timeAxis2=null,this.components.push(this.timeAxis),this.currentTime=new Ss(this.body,this.options),this.components.push(this.currentTime),this.itemSet=new $s(this.body,this.options),this.components.push(this.itemSet),this.itemsData=null,this.groupsData=null,this.dom.root.onclick=t=>{r("click",t)},this.dom.root.ondblclick=t=>{r("doubleClick",t)},this.dom.root.oncontextmenu=t=>{r("contextmenu",t)},this.dom.root.onmouseover=t=>{r("mouseOver",t)},window.PointerEvent?(this.dom.root.onpointerdown=t=>{r("mouseDown",t)},this.dom.root.onpointermove=t=>{r("mouseMove",t)},this.dom.root.onpointerup=t=>{r("mouseUp",t)}):(this.dom.root.onmousemove=t=>{r("mouseMove",t)},this.dom.root.onmousedown=t=>{r("mouseDown",t)},this.dom.root.onmouseup=t=>{r("mouseUp",t)}),this.initialFitDone=!1,this.on("changed",(()=>{if(null!=o.itemsData){if(!o.initialFitDone&&!o.options.rollingMode)if(o.initialFitDone=!0,null!=o.options.start||null!=o.options.end){if(null==o.options.start||null==o.options.end)var t=o.getItemRange();const e=null!=o.options.start?o.options.start:t.min,i=null!=o.options.end?o.options.end:t.max;o.setWindow(e,i,{animation:!1})}else o.fit({animation:!1});o.initialDrawDone||!o.initialRangeChangeDone&&(o.options.start||o.options.end)&&!o.options.rollingMode||(o.initialDrawDone=!0,o.itemSet.initialDrawDone=!0,o.dom.root.style.visibility="visible",o.dom.loadingScreen.parentNode.removeChild(o.dom.loadingScreen),o.options.onInitialDrawComplete&&setTimeout((()=>o.options.onInitialDrawComplete()),0))}})),this.on("destroyTimeline",(()=>{o.destroy()})),n&&this.setOptions(n),this.body.emitter.on("fit",(t=>{this._onFit(t),this.redraw()})),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}_createConfigurator(){return new hr(this,this.dom.container,rr)}redraw(){this.itemSet&&this.itemSet.markDirty({refreshItems:!0}),this._redraw()}setOptions(t){if(!0===Zs.validate(t,sr)&&console.log("%cErrors have been found in the supplied options object.",Ks),Cs.prototype.setOptions.call(this,t),"type"in t&&t.type!==this.options.type){this.options.type=t.type;const e=this.itemsData;if(e){const t=this.getSelection();this.setItems(null),this.setItems(e.rawDS),this.setSelection(t)}}}setItems(t){let e;this.itemsDone=!1,e=t?Fo(t)?Yo(t):Yo(new Dn(t)):null,this.itemsData&&this.itemsData.dispose(),this.itemsData=e,this.itemSet&&this.itemSet.setItems(null!=e?e.rawDS:null)}setGroups(t){let e;const i=t=>!1!==t.visible;t?(Array.isArray(t)&&(t=new Dn(t)),e=new Cn(t,{filter:i})):e=null,null!=this.groupsData&&"function"==typeof this.groupsData.setData&&this.groupsData.setData(null),this.groupsData=e,this.itemSet.setGroups(e)}setData(t){t&&t.groups&&this.setGroups(t.groups),t&&t.items&&this.setItems(t.items)}setSelection(t,e){this.itemSet&&this.itemSet.setSelection(t),e&&e.focus&&this.focus(t,e)}getSelection(){return this.itemSet&&this.itemSet.getSelection()||[]}focus(t,e){if(!this.itemsData||null==t)return;const i=Array.isArray(t)?t:[t],n=this.itemsData.get(i);let o=null,s=null;if(n.forEach((t=>{const e=t.start.valueOf(),i="end"in t?t.end.valueOf():t.start.valueOf();(null===o||e<o)&&(o=e),(null===s||i>s)&&(s=i)})),null!==o&&null!==s){const t=this,n=this.itemSet.items[i[0]];let r=-1*this._getScrollTop(),a=null;const l=(e,i,o)=>{const s=pr(t,n);if(!1===s)return;if(a||(a=s),a.itemTop==s.itemTop&&!a.shouldScroll)return;a.itemTop!=s.itemTop&&s.shouldScroll&&(a=s,r=-1*t._getScrollTop());const l=r,h=a.scrollOffset,d=o?h:l+(h-l)*e;t._setScrollTop(-d),i||t._redraw()},h=()=>{const e=pr(t,n);e.shouldScroll&&e.itemTop!=a.itemTop&&(t._setScrollTop(-e.scrollOffset),t._redraw())},d=()=>{h(),setTimeout(h,100)},c=!e||void 0===e.zoom||e.zoom,u=(o+s)/2,p=c?1.1*(s-o):Math.max(this.range.end-this.range.start,1.1*(s-o)),m=!e||void 0===e.animation||e.animation;m||(a={shouldScroll:!1,scrollOffset:-1,itemTop:-1}),this.range.setRange(u-p/2,u+p/2,{animation:m},d,l)}}fit(t,e){const i=!t||void 0===t.animation||t.animation;let n;1===this.itemsData.length&&void 0===this.itemsData.get()[0].end?(n=this.getDataRange(),this.moveTo(n.min.valueOf(),{animation:i},e)):(n=this.getItemRange(),this.range.setRange(n.min,n.max,{animation:i},e))}getItemRange(){const t=this.getDataRange();let e=null!==t.min?t.min.valueOf():null,i=null!==t.max?t.max.valueOf():null,n=null,o=null;if(null!=e&&null!=i){let t=i-e;t<=0&&(t=10);const s=t/this.props.center.width,r={};let a=0;Wo.forEach(this.itemSet.items,((t,e)=>{if(t.groupShowing){const i=!0;r[e]=t.redraw(i),a=r[e].length}}));if(a>0)for(let t=0;t<a;t++)Wo.forEach(r,(e=>{e[t]()}));if(Wo.forEach(this.itemSet.items,(t=>{const r=cr(t),a=ur(t);let l,h;this.options.rtl?(l=r-(t.getWidthRight()+10)*s,h=a+(t.getWidthLeft()+10)*s):(l=r-(t.getWidthLeft()+10)*s,h=a+(t.getWidthRight()+10)*s),l<e&&(e=l,n=t),h>i&&(i=h,o=t)})),n&&o){const s=n.getWidthLeft()+10,r=o.getWidthRight()+10,a=this.props.center.width-s-r;a>0&&(this.options.rtl?(e=cr(n)-r*t/a,i=ur(o)+s*t/a):(e=cr(n)-s*t/a,i=ur(o)+r*t/a))}}return{min:null!=e?new Date(e):null,max:null!=i?new Date(i):null}}getDataRange(){let t=null,e=null;return this.itemsData&&this.itemsData.forEach((i=>{const n=Wo.convert(i.start,"Date").valueOf(),o=Wo.convert(null!=i.end?i.end:i.start,"Date").valueOf();(null===t||n<t)&&(t=n),(null===e||o>e)&&(e=o)})),{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}}getEventProperties(t){const e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,n=this.dom.centerContainer.getBoundingClientRect(),o=this.options.rtl?n.right-e:e-n.left,s=i-n.top,r=this.itemSet.itemFromTarget(t),a=this.itemSet.groupFromTarget(t),l=Ds.customTimeFromTarget(t),h=this.itemSet.options.snap||null,d=this.body.util.getScale(),c=this.body.util.getStep(),u=this._toTime(o),p=h?h(u,d,c):u,m=Wo.getTarget(t);let f=null;return null!=r?f="item":null!=l?f="custom-time":Wo.hasParent(m,this.timeAxis.dom.foreground)||this.timeAxis2&&Wo.hasParent(m,this.timeAxis2.dom.foreground)?f="axis":Wo.hasParent(m,this.itemSet.dom.labelSet)?f="group-label":Wo.hasParent(m,this.currentTime.bar)?f="current-time":Wo.hasParent(m,this.dom.center)&&(f="background"),{event:t,item:r?r.id:null,isCluster:!!r&&!!r.isCluster,items:r?r.items||[]:null,group:a?a.groupId:null,customTime:l?l.options.id:null,what:f,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:o,y:s,time:u,snappedTime:p}}toggleRollingMode(){this.range.rolling?this.range.stopRolling():(null==this.options.rollingMode&&this.setOptions(this.options),this.range.startRolling())}_redraw(){Cs.prototype._redraw.call(this)}_onFit(t){const{start:e,end:i,animation:n}=t;i?this.range.setRange(e,i,{animation:n}):this.moveTo(e.valueOf(),{animation:n})}}function cr(t){return Wo.convert(t.data.start,"Date").valueOf()}function ur(t){const e=null!=t.data.end?t.data.end:t.data.start;return Wo.convert(e,"Date").valueOf()}function pr(t,e){if(!e.parent)return!1;const i=t.options.rtl?t.props.rightContainer.height:t.props.leftContainer.height,n=t.props.center.height,o=e.parent;let s=o.top,r=!0;const a=t.timeAxis.options.orientation.axis,l=()=>"bottom"==a?o.height-e.top-e.height:e.top,h=-1*t._getScrollTop(),d=s+l(),c=e.height;return d<h?s+i<=s+l()+c&&(s+=l()-t.itemSet.options.margin.item.vertical):d+c>h+i?s+=l()+c-i+t.itemSet.options.margin.item.vertical:r=!1,s=Math.min(s,n-i),{shouldScroll:r,scrollOffset:s,itemTop:d}}function mr(t){for(var e in t)t.hasOwnProperty(e)&&(t[e].redundant=t[e].used,t[e].used=[])}function fr(t){for(var e in t)if(t.hasOwnProperty(e)&&t[e].redundant){for(var i=0;i<t[e].redundant.length;i++)t[e].redundant[i].parentNode.removeChild(t[e].redundant[i]);t[e].redundant=[]}}function gr(t,e,i){var n;return e.hasOwnProperty(t)?e[t].redundant.length>0?(n=e[t].redundant[0],e[t].redundant.shift()):(n=document.createElementNS("http://www.w3.org/2000/svg",t),i.appendChild(n)):(n=document.createElementNS("http://www.w3.org/2000/svg",t),e[t]={used:[],redundant:[]},i.appendChild(n)),e[t].used.push(n),n}function vr(t,e,i,n){var o;return e.hasOwnProperty(t)?e[t].redundant.length>0?(o=e[t].redundant[0],e[t].redundant.shift()):(o=document.createElement(t),void 0!==n?i.insertBefore(o,n):i.appendChild(o)):(o=document.createElement(t),e[t]={used:[],redundant:[]},void 0!==n?i.insertBefore(o,n):i.appendChild(o)),e[t].used.push(o),o}function yr(t,e,i,n,o,s){var r;if("circle"==i.style?((r=gr("circle",n,o)).setAttributeNS(null,"cx",t),r.setAttributeNS(null,"cy",e),r.setAttributeNS(null,"r",.5*i.size)):((r=gr("rect",n,o)).setAttributeNS(null,"x",t-.5*i.size),r.setAttributeNS(null,"y",e-.5*i.size),r.setAttributeNS(null,"width",i.size),r.setAttributeNS(null,"height",i.size)),void 0!==i.styles&&r.setAttributeNS(null,"style",i.styles),r.setAttributeNS(null,"class",i.className+" vis-point"),s){var a=gr("text",n,o);s.xOffset&&(t+=s.xOffset),s.yOffset&&(e+=s.yOffset),s.content&&(a.textContent=s.content),s.className&&a.setAttributeNS(null,"class",s.className+" vis-label"),a.setAttributeNS(null,"x",t),a.setAttributeNS(null,"y",e)}return r}function br(t,e,i,n,o,s,r,a){if(0!=n){n<0&&(e-=n*=-1);var l=gr("rect",s,r);l.setAttributeNS(null,"x",t-.5*i),l.setAttributeNS(null,"y",e),l.setAttributeNS(null,"width",i),l.setAttributeNS(null,"height",n),l.setAttributeNS(null,"class",o),a&&l.setAttributeNS(null,"style",a)}}class wr{constructor(t,e,i,n,o,s,r=!1,a=!1){if(this.majorSteps=[1,2,5,10],this.minorSteps=[.25,.5,1,2],this.customLines=null,this.containerHeight=o,this.majorCharHeight=s,this._start=t,this._end=e,this.scale=1,this.minorStepIdx=-1,this.magnitudefactor=1,this.determineScale(),this.zeroAlign=r,this.autoScaleStart=i,this.autoScaleEnd=n,this.formattingFunction=a,i||n){const t=this,e=e=>{const i=e-e%(t.magnitudefactor*t.minorSteps[t.minorStepIdx]);return e%(t.magnitudefactor*t.minorSteps[t.minorStepIdx])>t.magnitudefactor*t.minorSteps[t.minorStepIdx]*.5?i+t.magnitudefactor*t.minorSteps[t.minorStepIdx]:i};i&&(this._start-=2*this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._start=e(this._start)),n&&(this._end+=this.magnitudefactor*this.minorSteps[this.minorStepIdx],this._end=e(this._end)),this.determineScale()}}setCharHeight(t){this.majorCharHeight=t}setHeight(t){this.containerHeight=t}determineScale(){const t=this._end-this._start;this.scale=this.containerHeight/t;const e=this.majorCharHeight/this.scale,i=t>0?Math.round(Math.log(t)/Math.LN10):0;this.minorStepIdx=-1,this.magnitudefactor=Math.pow(10,i);let n=0;i<0&&(n=i);let o=!1;for(let t=n;Math.abs(t)<=Math.abs(i);t++){this.magnitudefactor=Math.pow(10,t);for(let t=0;t<this.minorSteps.length;t++){if(this.magnitudefactor*this.minorSteps[t]>=e){o=!0,this.minorStepIdx=t;break}}if(!0===o)break}}is_major(t){return t%(this.magnitudefactor*this.majorSteps[this.minorStepIdx])==0}getStep(){return this.magnitudefactor*this.minorSteps[this.minorStepIdx]}getFirstMajor(){const t=this.magnitudefactor*this.majorSteps[this.minorStepIdx];return this.convertValue(this._start+(t-this._start%t)%t)}formatValue(t){let e=t.toPrecision(5);return"function"==typeof this.formattingFunction&&(e=this.formattingFunction(t)),"number"==typeof e?`${e}`:"string"==typeof e?e:t.toPrecision(5)}getLines(){const t=[],e=this.getStep(),i=(e-this._start%e)%e;for(let n=this._start+i;this._end-n>1e-5;n+=e)n!=this._start&&t.push({major:this.is_major(n),y:this.convertValue(n),val:this.formatValue(n)});return t}followScale(t){const e=this.minorStepIdx,i=this._start,n=this._end,o=this,s=()=>{o.magnitudefactor*=2},r=()=>{o.magnitudefactor/=2};t.minorStepIdx<=1&&this.minorStepIdx<=1||t.minorStepIdx>1&&this.minorStepIdx>1||(t.minorStepIdx<this.minorStepIdx?(this.minorStepIdx=1,2==e||s(),s()):(this.minorStepIdx=2,1==e||r(),r()));const a=t.convertValue(0),l=t.getStep()*t.scale;let h=!1,d=0;for(;!h&&d++<5;){this.scale=l/(this.minorSteps[this.minorStepIdx]*this.magnitudefactor);const e=this.containerHeight/this.scale;this._start=i,this._end=this._start+e;const o=this._end*this.scale,d=this.magnitudefactor*this.majorSteps[this.minorStepIdx],c=this.getFirstMajor()-t.getFirstMajor();if(this.zeroAlign){const t=a-o;this._end+=t/this.scale,this._start=this._end-e}else this.autoScaleStart?(this._start-=c/this.scale,this._end=this._start+e):(this._start+=d-c/this.scale,this._end=this._start+e);if(!this.autoScaleEnd&&this._end>n+1e-5)r(),h=!1;else{if(!this.autoScaleStart&&this._start<i-1e-5){if(!(this.zeroAlign&&i>=0)){r(),h=!1;continue}console.warn("Can't adhere to given 'min' range, due to zeroalign")}this.autoScaleStart&&this.autoScaleEnd&&e<n-i?(s(),h=!1):h=!0}}}convertValue(t){return this.containerHeight-(t-this._start)*this.scale}screenToValue(t){return(this.containerHeight-t)/this.scale+this._start}}class _r extends Go{constructor(t,e,i,n){super(),this.id=fn(),this.body=t,this.defaultOptions={orientation:"left",showMinorLabels:!0,showMajorLabels:!0,showWeekScale:!1,icons:!1,majorLinesOffset:7,minorLinesOffset:4,labelOffsetX:10,labelOffsetY:2,iconWidth:20,width:"40px",visible:!0,alignZeros:!0,left:{range:{min:void 0,max:void 0},format:t=>`${parseFloat(t.toPrecision(3))}`,title:{text:void 0,style:void 0}},right:{range:{min:void 0,max:void 0},format:t=>`${parseFloat(t.toPrecision(3))}`,title:{text:void 0,style:void 0}}},this.linegraphOptions=n,this.linegraphSVG=i,this.props={},this.DOMelements={lines:{},labels:{},title:{}},this.dom={},this.scale=void 0,this.range={start:0,end:0},this.options=Wo.extend({},this.defaultOptions),this.conversionFactor=1,this.setOptions(e),this.width=Number(`${this.options.width}`.replace("px","")),this.minWidth=this.width,this.height=this.linegraphSVG.getBoundingClientRect().height,this.hidden=!1,this.stepPixels=25,this.zeroCrossing=-1,this.amountOfSteps=-1,this.lineOffset=0,this.master=!0,this.masterAxis=null,this.svgElements={},this.iconsRemoved=!1,this.groups={},this.amountOfGroups=0,this._create(),null==this.scale&&this._redrawLabels(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups};const o=this;this.body.emitter.on("verticalDrag",(()=>{o.dom.lineContainer.style.top=`${o.body.domProps.scrollTop}px`}))}addGroup(t,e){this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1}updateGroup(t,e){this.groups.hasOwnProperty(t)||(this.amountOfGroups+=1),this.groups[t]=e}removeGroup(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)}setOptions(t){if(t){let e=!1;this.options.orientation!=t.orientation&&void 0!==t.orientation&&(e=!0);const i=["orientation","showMinorLabels","showMajorLabels","icons","majorLinesOffset","minorLinesOffset","labelOffsetX","labelOffsetY","iconWidth","width","visible","left","right","alignZeros"];Wo.selectiveDeepExtend(i,this.options,t),this.minWidth=Number(`${this.options.width}`.replace("px","")),!0===e&&this.dom.frame&&(this.hide(),this.show())}}_create(){this.dom.frame=document.createElement("div"),this.dom.frame.style.width=this.options.width,this.dom.frame.style.height=this.height,this.dom.lineContainer=document.createElement("div"),this.dom.lineContainer.style.width="100%",this.dom.lineContainer.style.height=this.height,this.dom.lineContainer.style.position="relative",this.dom.lineContainer.style.visibility="visible",this.dom.lineContainer.style.display="block",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.height="100%",this.svg.style.width="100%",this.svg.style.display="block",this.dom.frame.appendChild(this.svg)}_redrawGroupIcons(){let t;mr(this.svgElements);const e=this.options.iconWidth;let i=11.5;t="left"===this.options.orientation?4:this.width-e-4;const n=Object.keys(this.groups);n.sort(((t,e)=>t<e?-1:1));for(const o of n)!0!==this.groups[o].visible||void 0!==this.linegraphOptions.visibility[o]&&!0!==this.linegraphOptions.visibility[o]||(this.groups[o].getLegend(e,15,this.framework,t,i),i+=19);fr(this.svgElements),this.iconsRemoved=!1}_cleanupIcons(){!1===this.iconsRemoved&&(mr(this.svgElements),fr(this.svgElements),this.iconsRemoved=!0)}show(){this.hidden=!1,this.dom.frame.parentNode||("left"===this.options.orientation?this.body.dom.left.appendChild(this.dom.frame):this.body.dom.right.appendChild(this.dom.frame)),this.dom.lineContainer.parentNode||this.body.dom.backgroundHorizontal.appendChild(this.dom.lineContainer),this.dom.lineContainer.style.display="block"}hide(){this.hidden=!0,this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame),this.dom.lineContainer.style.display="none"}setRange(t,e){this.range.start=t,this.range.end=e}redraw(){let t=!1,e=0;this.dom.lineContainer.style.top=`${this.body.domProps.scrollTop}px`;for(const t in this.groups)this.groups.hasOwnProperty(t)&&(!0!==this.groups[t].visible||void 0!==this.linegraphOptions.visibility[t]&&!0!==this.linegraphOptions.visibility[t]||e++);if(0===this.amountOfGroups||0===e)this.hide();else{this.show(),this.height=Number(this.linegraphSVG.style.height.replace("px","")),this.dom.lineContainer.style.height=`${this.height}px`,this.width=!0===this.options.visible?Number(`${this.options.width}`.replace("px","")):0;const e=this.props,i=this.dom.frame;i.className="vis-data-axis",this._calculateCharSize();const n=this.options.orientation,o=this.options.showMinorLabels,s=this.options.showMajorLabels,r=this.body.dom.backgroundHorizontal.offsetWidth;e.minorLabelHeight=o?e.minorCharHeight:0,e.majorLabelHeight=s?e.majorCharHeight:0,e.minorLineWidth=r-this.lineOffset-this.width+2*this.options.minorLinesOffset,e.minorLineHeight=1,e.majorLineWidth=r-this.lineOffset-this.width+2*this.options.majorLinesOffset,e.majorLineHeight=1,"left"===n?(i.style.top="0",i.style.left="0",i.style.bottom="",i.style.width=`${this.width}px`,i.style.height=`${this.height}px`,this.props.width=this.body.domProps.left.width,this.props.height=this.body.domProps.left.height):(i.style.top="",i.style.bottom="0",i.style.left="0",i.style.width=`${this.width}px`,i.style.height=`${this.height}px`,this.props.width=this.body.domProps.right.width,this.props.height=this.body.domProps.right.height),t=this._redrawLabels(),t=this._isResized()||t,!0===this.options.icons?this._redrawGroupIcons():this._cleanupIcons(),this._redrawTitle(n)}return t}_redrawLabels(){let t=!1;mr(this.DOMelements.lines),mr(this.DOMelements.labels);const e=this.options.orientation,i=null!=this.options[e].range?this.options[e].range:{};let n=!0;null!=i.max&&(this.range.end=i.max,n=!1);let o=!0;null!=i.min&&(this.range.start=i.min,o=!1),this.scale=new wr(this.range.start,this.range.end,o,n,this.dom.frame.offsetHeight,this.props.majorCharHeight,this.options.alignZeros,this.options[e].format),!1===this.master&&null!=this.masterAxis?(this.scale.followScale(this.masterAxis.scale),this.dom.lineContainer.style.display="none"):this.dom.lineContainer.style.display="block",this.maxLabelSize=0;this.scale.getLines().forEach((t=>{const i=t.y,n=t.major;this.options.showMinorLabels&&!1===n&&this._redrawLabel(i-2,t.val,e,"vis-y-axis vis-minor",this.props.minorCharHeight),n&&i>=0&&this._redrawLabel(i-2,t.val,e,"vis-y-axis vis-major",this.props.majorCharHeight),!0===this.master&&(n?this._redrawLine(i,e,"vis-grid vis-horizontal vis-major",this.options.majorLinesOffset,this.props.majorLineWidth):this._redrawLine(i,e,"vis-grid vis-horizontal vis-minor",this.options.minorLinesOffset,this.props.minorLineWidth))}));let s=0;void 0!==this.options[e].title&&void 0!==this.options[e].title.text&&(s=this.props.titleCharHeight);const r=!0===this.options.icons?Math.max(this.options.iconWidth,s)+this.options.labelOffsetX+15:s+this.options.labelOffsetX+15;return this.maxLabelSize>this.width-r&&!0===this.options.visible?(this.width=this.maxLabelSize+r,this.options.width=`${this.width}px`,fr(this.DOMelements.lines),fr(this.DOMelements.labels),this.redraw(),t=!0):this.maxLabelSize<this.width-r&&!0===this.options.visible&&this.width>this.minWidth?(this.width=Math.max(this.minWidth,this.maxLabelSize+r),this.options.width=`${this.width}px`,fr(this.DOMelements.lines),fr(this.DOMelements.labels),this.redraw(),t=!0):(fr(this.DOMelements.lines),fr(this.DOMelements.labels),t=!1),t}convertValue(t){return this.scale.convertValue(t)}screenToValue(t){return this.scale.screenToValue(t)}_redrawLabel(t,e,i,n,o){const s=vr("div",this.DOMelements.labels,this.dom.frame);s.className=n,s.innerHTML=Wo.xss(e),"left"===i?(s.style.left=`-${this.options.labelOffsetX}px`,s.style.textAlign="right"):(s.style.right=`-${this.options.labelOffsetX}px`,s.style.textAlign="left"),s.style.top=`${t-.5*o+this.options.labelOffsetY}px`,e+="";const r=Math.max(this.props.majorCharWidth,this.props.minorCharWidth);this.maxLabelSize<e.length*r&&(this.maxLabelSize=e.length*r)}_redrawLine(t,e,i,n,o){if(!0===this.master){const s=vr("div",this.DOMelements.lines,this.dom.lineContainer);s.className=i,s.innerHTML="","left"===e?s.style.left=this.width-n+"px":s.style.right=this.width-n+"px",s.style.width=`${o}px`,s.style.top=`${t}px`}}_redrawTitle(t){if(mr(this.DOMelements.title),void 0!==this.options[t].title&&void 0!==this.options[t].title.text){const e=vr("div",this.DOMelements.title,this.dom.frame);e.className=`vis-y-axis vis-title vis-${t}`,e.innerHTML=Wo.xss(this.options[t].title.text),void 0!==this.options[t].title.style&&Wo.addCssText(e,this.options[t].title.style),"left"===t?e.style.left=`${this.props.titleCharHeight}px`:e.style.right=`${this.props.titleCharHeight}px`,e.style.width=`${this.height}px`}fr(this.DOMelements.title)}_calculateCharSize(){if(!("minorCharHeight"in this.props)){const t=document.createTextNode("0"),e=document.createElement("div");e.className="vis-y-axis vis-minor vis-measure",e.appendChild(t),this.dom.frame.appendChild(e),this.props.minorCharHeight=e.clientHeight,this.props.minorCharWidth=e.clientWidth,this.dom.frame.removeChild(e)}if(!("majorCharHeight"in this.props)){const t=document.createTextNode("0"),e=document.createElement("div");e.className="vis-y-axis vis-major vis-measure",e.appendChild(t),this.dom.frame.appendChild(e),this.props.majorCharHeight=e.clientHeight,this.props.majorCharWidth=e.clientWidth,this.dom.frame.removeChild(e)}if(!("titleCharHeight"in this.props)){const t=document.createTextNode("0"),e=document.createElement("div");e.className="vis-y-axis vis-title vis-measure",e.appendChild(t),this.dom.frame.appendChild(e),this.props.titleCharHeight=e.clientHeight,this.props.titleCharWidth=e.clientWidth,this.dom.frame.removeChild(e)}}}function xr(t,e){}function kr(t,e){return{style:(e=void 0===e?{}:e).style||t.options.drawPoints.style,styles:e.styles||t.options.drawPoints.styles,size:e.size||t.options.drawPoints.size,className:e.className||t.className}}function Dr(t,e){}function Cr(t,e){}function Sr(t,e,i,n){this.id=e;this.options=Wo.selectiveBridgeObject(["sampling","style","sort","yAxisOrientation","barChart","drawPoints","shaded","interpolation","zIndex","excludeFromStacking","excludeFromLegend"],i),this.usingDefaultStyle=void 0===t.className,this.groupsUsingDefaultStyles=n,this.zeroPosition=0,this.update(t),1==this.usingDefaultStyle&&(this.groupsUsingDefaultStyles[0]+=1),this.itemsData=[],this.visible=void 0===t.visible||t.visible}function Tr(t,e,i,n){this.body=t,this.defaultOptions={enabled:!1,icons:!0,iconSize:20,iconSpacing:6,left:{visible:!0,position:"top-left"},right:{visible:!0,position:"top-right"}},this.side=i,this.options=Wo.extend({},this.defaultOptions),this.linegraphOptions=n,this.svgElements={},this.dom={},this.groups={},this.amountOfGroups=0,this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups},this.setOptions(e)}xr.draw=function(t,e,i,n){n=n||0;for(var o=function(t,e){var i=void 0;t.options&&t.options.drawPoints&&t.options.drawPoints.onRender&&"function"==typeof t.options.drawPoints.onRender&&(i=t.options.drawPoints.onRender);e.group.options&&e.group.options.drawPoints&&e.group.options.drawPoints.onRender&&"function"==typeof e.group.options.drawPoints.onRender&&(i=e.group.options.drawPoints.onRender);return i}(i,e),s=0;s<t.length;s++)if(o){var r=o(t[s],e);!0!==r&&"object"!=typeof r||yr(t[s].screen_x+n,t[s].screen_y,kr(e,r),i.svgElements,i.svg,t[s].label)}else yr(t[s].screen_x+n,t[s].screen_y,kr(e),i.svgElements,i.svg,t[s].label)},xr.drawIcon=function(t,e,i,n,o,s){var r=.5*o,a=gr("rect",s.svgElements,s.svg);a.setAttributeNS(null,"x",e),a.setAttributeNS(null,"y",i-r),a.setAttributeNS(null,"width",n),a.setAttributeNS(null,"height",2*r),a.setAttributeNS(null,"class","vis-outline"),yr(e+.5*n,i,kr(t),s.svgElements,s.svg)},Dr.drawIcon=function(t,e,i,n,o,s){var r=.5*o,a=gr("rect",s.svgElements,s.svg);a.setAttributeNS(null,"x",e),a.setAttributeNS(null,"y",i-r),a.setAttributeNS(null,"width",n),a.setAttributeNS(null,"height",2*r),a.setAttributeNS(null,"class","vis-outline");var l=Math.round(.3*n),h=t.options.barChart.width/l,d=Math.round(.4*o),c=Math.round(.75*o),u=Math.round((n-2*l)/3);if(br(e+.5*l+u,i+r-d-1,l,d,t.className+" vis-bar",s.svgElements,s.svg,t.style),br(e+1.5*l+u+2,i+r-c-1,l,c,t.className+" vis-bar",s.svgElements,s.svg,t.style),1==t.options.drawPoints.enabled){var p={style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size/h,className:t.className};yr(e+.5*l+u,i+r-d-1,p,s.svgElements,s.svg),yr(e+1.5*l+u+2,i+r-c-1,p,s.svgElements,s.svg)}},Dr.draw=function(t,e,i){var n,o,s,r,a,l,h=[],d={},c=0;for(a=0;a<t.length;a++)if("bar"===(r=i.groups[t[a]]).options.style&&!0===r.visible&&(void 0===i.options.groups.visibility[t[a]]||!0===i.options.groups.visibility[t[a]]))for(l=0;l<e[t[a]].length;l++)h.push({screen_x:e[t[a]][l].screen_x,screen_end:e[t[a]][l].screen_end,screen_y:e[t[a]][l].screen_y,x:e[t[a]][l].x,end:e[t[a]][l].end,y:e[t[a]][l].y,groupId:t[a],label:e[t[a]][l].label}),c+=1;if(0!==c)for(h.sort((function(t,e){return t.screen_x===e.screen_x?t.groupId<e.groupId?-1:1:t.screen_x-e.screen_x})),Dr._getDataIntersections(d,h),a=0;a<h.length;a++){var u=null!=(r=i.groups[h[a].groupId]).options.barChart.minWidth?r.options.barChart.minWidth:.1*r.options.barChart.width,p=0;if(void 0===d[o=h[a].screen_x])a+1<h.length&&(n=Math.abs(h[a+1].screen_x-o)),s=Dr._getSafeDrawData(n,r,u);else{var m=a+(d[o].amount-d[o].resolved);m<h.length&&(n=Math.abs(h[m].screen_x-o)),s=Dr._getSafeDrawData(n,r,u),d[o].resolved+=1,!0===r.options.stack&&!0!==r.options.excludeFromStacking?h[a].screen_y<r.zeroPosition?(p=d[o].accumulatedNegative,d[o].accumulatedNegative+=r.zeroPosition-h[a].screen_y):(p=d[o].accumulatedPositive,d[o].accumulatedPositive+=r.zeroPosition-h[a].screen_y):!0===r.options.barChart.sideBySide&&(s.width=s.width/d[o].amount,s.offset+=d[o].resolved*s.width-.5*s.width*(d[o].amount+1))}let t=s.width,e=h[a].screen_x;if(null!=h[a].screen_end?(t=h[a].screen_end-h[a].screen_x,e+=.5*t):e+=s.offset,br(e,h[a].screen_y-p,t,r.zeroPosition-h[a].screen_y,r.className+" vis-bar",i.svgElements,i.svg,r.style),!0===r.options.drawPoints.enabled){let t={screen_x:h[a].screen_x,screen_y:h[a].screen_y-p,x:h[a].x,y:h[a].y,groupId:h[a].groupId,label:h[a].label};xr.draw([t],r,i,s.offset)}}},Dr._getDataIntersections=function(t,e){for(var i,n=0;n<e.length;n++)n+1<e.length&&(i=Math.abs(e[n+1].screen_x-e[n].screen_x)),n>0&&(i=Math.min(i,Math.abs(e[n-1].screen_x-e[n].screen_x))),0===i&&(void 0===t[e[n].screen_x]&&(t[e[n].screen_x]={amount:0,resolved:0,accumulatedPositive:0,accumulatedNegative:0}),t[e[n].screen_x].amount+=1)},Dr._getSafeDrawData=function(t,e,i){var n,o;return t<e.options.barChart.width&&t>0?(n=t<i?i:t,o=0,"left"===e.options.barChart.align?o-=.5*t:"right"===e.options.barChart.align&&(o+=.5*t)):(n=e.options.barChart.width,o=0,"left"===e.options.barChart.align?o-=.5*e.options.barChart.width:"right"===e.options.barChart.align&&(o+=.5*e.options.barChart.width)),{width:n,offset:o}},Dr.getStackedYRange=function(t,e,i,n,o){if(t.length>0){t.sort((function(t,e){return t.screen_x===e.screen_x?t.groupId<e.groupId?-1:1:t.screen_x-e.screen_x}));var s={};Dr._getDataIntersections(s,t),e[n]=Dr._getStackedYRange(s,t),e[n].yAxisOrientation=o,i.push(n)}},Dr._getStackedYRange=function(t,e){for(var i,n=e[0].screen_y,o=e[0].screen_y,s=0;s<e.length;s++)void 0===t[i=e[s].screen_x]?(n=n>e[s].screen_y?e[s].screen_y:n,o=o<e[s].screen_y?e[s].screen_y:o):e[s].screen_y<0?t[i].accumulatedNegative+=e[s].screen_y:t[i].accumulatedPositive+=e[s].screen_y;for(var r in t)t.hasOwnProperty(r)&&(n=(n=n>t[r].accumulatedNegative?t[r].accumulatedNegative:n)>t[r].accumulatedPositive?t[r].accumulatedPositive:n,o=(o=o<t[r].accumulatedNegative?t[r].accumulatedNegative:o)<t[r].accumulatedPositive?t[r].accumulatedPositive:o);return{min:n,max:o}},Cr.calcPath=function(t,e){if(null!=t&&t.length>0){return 1==e.options.interpolation.enabled?Cr._catmullRom(t,e):Cr._linear(t)}},Cr.drawIcon=function(t,e,i,n,o,s){var r,a,l=.5*o,h=gr("rect",s.svgElements,s.svg);(h.setAttributeNS(null,"x",e),h.setAttributeNS(null,"y",i-l),h.setAttributeNS(null,"width",n),h.setAttributeNS(null,"height",2*l),h.setAttributeNS(null,"class","vis-outline"),(r=gr("path",s.svgElements,s.svg)).setAttributeNS(null,"class",t.className),void 0!==t.style&&r.setAttributeNS(null,"style",t.style),r.setAttributeNS(null,"d","M"+e+","+i+" L"+(e+n)+","+i),1==t.options.shaded.enabled&&(a=gr("path",s.svgElements,s.svg),"top"==t.options.shaded.orientation?a.setAttributeNS(null,"d","M"+e+", "+(i-l)+"L"+e+","+i+" L"+(e+n)+","+i+" L"+(e+n)+","+(i-l)):a.setAttributeNS(null,"d","M"+e+","+i+" L"+e+","+(i+l)+" L"+(e+n)+","+(i+l)+"L"+(e+n)+","+i),a.setAttributeNS(null,"class",t.className+" vis-icon-fill"),void 0!==t.options.shaded.style&&""!==t.options.shaded.style&&a.setAttributeNS(null,"style",t.options.shaded.style)),1==t.options.drawPoints.enabled)&&yr(e+.5*n,i,{style:t.options.drawPoints.style,styles:t.options.drawPoints.styles,size:t.options.drawPoints.size,className:t.className},s.svgElements,s.svg)},Cr.drawShading=function(t,e,i,n){if(1==e.options.shaded.enabled){var o,s=Number(n.svg.style.height.replace("px","")),r=gr("path",n.svgElements,n.svg),a="L";1==e.options.interpolation.enabled&&(a="C");var l=0;l="top"==e.options.shaded.orientation?0:"bottom"==e.options.shaded.orientation?s:Math.min(Math.max(0,e.zeroPosition),s),o="group"==e.options.shaded.orientation&&null!=i&&null!=i?"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" L"+i[i.length-1][0]+","+i[i.length-1][1]+" "+this.serializePath(i,a,!0)+i[0][0]+","+i[0][1]+" Z":"M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,a,!1)+" V"+l+" H"+t[0][0]+" Z",r.setAttributeNS(null,"class",e.className+" vis-fill"),void 0!==e.options.shaded.style&&r.setAttributeNS(null,"style",e.options.shaded.style),r.setAttributeNS(null,"d",o)}},Cr.draw=function(t,e,i){if(null!=t&&null!=t){var n=gr("path",i.svgElements,i.svg);n.setAttributeNS(null,"class",e.className),void 0!==e.style&&n.setAttributeNS(null,"style",e.style);var o="L";1==e.options.interpolation.enabled&&(o="C"),n.setAttributeNS(null,"d","M"+t[0][0]+","+t[0][1]+" "+this.serializePath(t,o,!1))}},Cr.serializePath=function(t,e,i){if(t.length<2)return"";var n,o=e;if(i)for(n=t.length-2;n>0;n--)o+=t[n][0]+","+t[n][1]+" ";else for(n=1;n<t.length;n++)o+=t[n][0]+","+t[n][1]+" ";return o},Cr._catmullRomUniform=function(t){var e,i,n,o,s,r,a=[];a.push([Math.round(t[0].screen_x),Math.round(t[0].screen_y)]);for(var l=1/6,h=t.length,d=0;d<h-1;d++)e=0==d?t[0]:t[d-1],i=t[d],n=t[d+1],o=d+2<h?t[d+2]:n,s={screen_x:(-e.screen_x+6*i.screen_x+n.screen_x)*l,screen_y:(-e.screen_y+6*i.screen_y+n.screen_y)*l},r={screen_x:(i.screen_x+6*n.screen_x-o.screen_x)*l,screen_y:(i.screen_y+6*n.screen_y-o.screen_y)*l},a.push([s.screen_x,s.screen_y]),a.push([r.screen_x,r.screen_y]),a.push([n.screen_x,n.screen_y]);return a},Cr._catmullRom=function(t,e){var i=e.options.interpolation.alpha;if(0==i||void 0===i)return this._catmullRomUniform(t);var n,o,s,r,a,l,h,d,c,u,p,m,f,g,v,y,b,w,_,x=[];x.push([Math.round(t[0].screen_x),Math.round(t[0].screen_y)]);for(var k=t.length,D=0;D<k-1;D++)n=0==D?t[0]:t[D-1],o=t[D],s=t[D+1],r=D+2<k?t[D+2]:s,h=Math.sqrt(Math.pow(n.screen_x-o.screen_x,2)+Math.pow(n.screen_y-o.screen_y,2)),d=Math.sqrt(Math.pow(o.screen_x-s.screen_x,2)+Math.pow(o.screen_y-s.screen_y,2)),c=Math.sqrt(Math.pow(s.screen_x-r.screen_x,2)+Math.pow(s.screen_y-r.screen_y,2)),g=Math.pow(c,i),y=Math.pow(c,2*i),v=Math.pow(d,i),b=Math.pow(d,2*i),_=Math.pow(h,i),u=2*(w=Math.pow(h,2*i))+3*_*v+b,p=2*y+3*g*v+b,(m=3*_*(_+v))>0&&(m=1/m),(f=3*g*(g+v))>0&&(f=1/f),a={screen_x:(-b*n.screen_x+u*o.screen_x+w*s.screen_x)*m,screen_y:(-b*n.screen_y+u*o.screen_y+w*s.screen_y)*m},l={screen_x:(y*o.screen_x+p*s.screen_x-b*r.screen_x)*f,screen_y:(y*o.screen_y+p*s.screen_y-b*r.screen_y)*f},0==a.screen_x&&0==a.screen_y&&(a=o),0==l.screen_x&&0==l.screen_y&&(l=s),x.push([a.screen_x,a.screen_y]),x.push([l.screen_x,l.screen_y]),x.push([s.screen_x,s.screen_y]);return x},Cr._linear=function(t){for(var e=[],i=0;i<t.length;i++)e.push([t[i].screen_x,t[i].screen_y]);return e},Sr.prototype.setItems=function(t){null!=t?(this.itemsData=t,1==this.options.sort&&Wo.insertSort(this.itemsData,(function(t,e){return t.x>e.x?1:-1}))):this.itemsData=[]},Sr.prototype.getItems=function(){return this.itemsData},Sr.prototype.setZeroPosition=function(t){this.zeroPosition=t},Sr.prototype.setOptions=function(t){if(void 0!==t){Wo.selectiveDeepExtend(["sampling","style","sort","yAxisOrientation","barChart","zIndex","excludeFromStacking","excludeFromLegend"],this.options,t),"function"==typeof t.drawPoints&&(t.drawPoints={onRender:t.drawPoints}),Wo.mergeOptions(this.options,t,"interpolation"),Wo.mergeOptions(this.options,t,"drawPoints"),Wo.mergeOptions(this.options,t,"shaded"),t.interpolation&&"object"==typeof t.interpolation&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5))}},Sr.prototype.update=function(t){this.group=t,this.content=t.content||"graph",this.className=t.className||this.className||"vis-graph-group"+this.groupsUsingDefaultStyles[0]%10,this.visible=void 0===t.visible||t.visible,this.style=t.style,this.setOptions(t.options)},Sr.prototype.getLegend=function(t,e,i,n,o){null!=i&&null!=i||(i={svg:document.createElementNS("http://www.w3.org/2000/svg","svg"),svgElements:{},options:this.options,groups:[this]});switch(null!=n&&null!=n||(n=0),null!=o&&null!=o||(o=.5*e),this.options.style){case"line":Cr.drawIcon(this,n,o,t,e,i);break;case"points":case"point":xr.drawIcon(this,n,o,t,e,i);break;case"bar":Dr.drawIcon(this,n,o,t,e,i)}return{icon:i.svg,label:this.content,orientation:this.options.yAxisOrientation}},Sr.prototype.getYRange=function(t){for(var e=t[0].y,i=t[0].y,n=0;n<t.length;n++)e=e>t[n].y?t[n].y:e,i=i<t[n].y?t[n].y:i;return{min:e,max:i,yAxisOrientation:this.options.yAxisOrientation}},Tr.prototype=new Go,Tr.prototype.clear=function(){this.groups={},this.amountOfGroups=0},Tr.prototype.addGroup=function(t,e){1!=e.options.excludeFromLegend&&(this.groups.hasOwnProperty(t)||(this.groups[t]=e),this.amountOfGroups+=1)},Tr.prototype.updateGroup=function(t,e){this.groups[t]=e},Tr.prototype.removeGroup=function(t){this.groups.hasOwnProperty(t)&&(delete this.groups[t],this.amountOfGroups-=1)},Tr.prototype._create=function(){this.dom.frame=document.createElement("div"),this.dom.frame.className="vis-legend",this.dom.frame.style.position="absolute",this.dom.frame.style.top="10px",this.dom.frame.style.display="block",this.dom.textArea=document.createElement("div"),this.dom.textArea.className="vis-legend-text",this.dom.textArea.style.position="relative",this.dom.textArea.style.top="0px",this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="absolute",this.svg.style.top="0px",this.svg.style.width=this.options.iconSize+5+"px",this.svg.style.height="100%",this.dom.frame.appendChild(this.svg),this.dom.frame.appendChild(this.dom.textArea)},Tr.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame)},Tr.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame)},Tr.prototype.setOptions=function(t){Wo.selectiveDeepExtend(["enabled","orientation","icons","left","right"],this.options,t)},Tr.prototype.redraw=function(){var t=0,e=Object.keys(this.groups);e.sort((function(t,e){return t<e?-1:1}));for(var i=0;i<e.length;i++){var n=e[i];1!=this.groups[n].visible||void 0!==this.linegraphOptions.visibility[n]&&1!=this.linegraphOptions.visibility[n]||t++}if(0==this.options[this.side].visible||0==this.amountOfGroups||0==this.options.enabled||0==t)this.hide();else{if(this.show(),"top-left"==this.options[this.side].position||"bottom-left"==this.options[this.side].position?(this.dom.frame.style.left="4px",this.dom.frame.style.textAlign="left",this.dom.textArea.style.textAlign="left",this.dom.textArea.style.left=this.options.iconSize+15+"px",this.dom.textArea.style.right="",this.svg.style.left="0px",this.svg.style.right=""):(this.dom.frame.style.right="4px",this.dom.frame.style.textAlign="right",this.dom.textArea.style.textAlign="right",this.dom.textArea.style.right=this.options.iconSize+15+"px",this.dom.textArea.style.left="",this.svg.style.right="0px",this.svg.style.left=""),"top-left"==this.options[this.side].position||"top-right"==this.options[this.side].position)this.dom.frame.style.top=4-Number(this.body.dom.center.style.top.replace("px",""))+"px",this.dom.frame.style.bottom="";else{var o=this.body.domProps.center.height-this.body.domProps.centerContainer.height;this.dom.frame.style.bottom=4+o+Number(this.body.dom.center.style.top.replace("px",""))+"px",this.dom.frame.style.top=""}0==this.options.icons?(this.dom.frame.style.width=this.dom.textArea.offsetWidth+10+"px",this.dom.textArea.style.right="",this.dom.textArea.style.left="",this.svg.style.width="0px"):(this.dom.frame.style.width=this.options.iconSize+15+this.dom.textArea.offsetWidth+10+"px",this.drawLegendIcons());var s="";for(i=0;i<e.length;i++)n=e[i],1!=this.groups[n].visible||void 0!==this.linegraphOptions.visibility[n]&&1!=this.linegraphOptions.visibility[n]||(s+=this.groups[n].content+"<br />");this.dom.textArea.innerHTML=Wo.xss(s),this.dom.textArea.style.lineHeight=.75*this.options.iconSize+this.options.iconSpacing+"px"}},Tr.prototype.drawLegendIcons=function(){if(this.dom.frame.parentNode){var t=Object.keys(this.groups);t.sort((function(t,e){return t<e?-1:1})),mr(h=this.svgElements),fr(h),mr(h);var e=window.getComputedStyle(this.dom.frame).paddingTop,i=Number(e.replace("px","")),n=i,o=this.options.iconSize,s=.75*this.options.iconSize,r=i+.5*s+3;this.svg.style.width=o+5+i+"px";for(var a=0;a<t.length;a++){var l=t[a];1!=this.groups[l].visible||void 0!==this.linegraphOptions.visibility[l]&&1!=this.linegraphOptions.visibility[l]||(this.groups[l].getLegend(o,s,this.framework,n,r),r+=s+this.options.iconSpacing)}}var h};var Er="__ungrouped__";function Mr(t,e){this.id=fn(),this.body=t,this.defaultOptions={yAxisOrientation:"left",defaultGroup:"default",sort:!0,sampling:!0,stack:!1,graphHeight:"400px",shaded:{enabled:!1,orientation:"bottom"},style:"line",barChart:{width:50,sideBySide:!1,align:"center"},interpolation:{enabled:!0,parametrization:"centripetal",alpha:.5},drawPoints:{enabled:!0,size:6,style:"square"},dataAxis:{},legend:{},groups:{visibility:{}}},this.options=Wo.extend({},this.defaultOptions),this.dom={},this.props={},this.hammer=null,this.groups={},this.abortedGraphUpdate=!1,this.updateSVGheight=!1,this.updateSVGheightOnResize=!1,this.forceGraphUpdate=!0;var i=this;this.itemsData=null,this.groupsData=null,this.itemListeners={add:function(t,e,n){i._onAdd(e.items)},update:function(t,e,n){i._onUpdate(e.items)},remove:function(t,e,n){i._onRemove(e.items)}},this.groupListeners={add:function(t,e,n){i._onAddGroups(e.items)},update:function(t,e,n){i._onUpdateGroups(e.items)},remove:function(t,e,n){i._onRemoveGroups(e.items)}},this.items={},this.selection=[],this.lastStart=this.body.range.start,this.touchParams={},this.svgElements={},this.setOptions(e),this.groupsUsingDefaultStyles=[0],this.body.emitter.on("rangechanged",(function(){i.svg.style.left=Wo.option.asSize(-i.props.width),i.forceGraphUpdate=!0,i.redraw.call(i)})),this._create(),this.framework={svg:this.svg,svgElements:this.svgElements,options:this.options,groups:this.groups}}Mr.prototype=new Go,Mr.prototype._create=function(){var t=document.createElement("div");t.className="vis-line-graph",this.dom.frame=t,this.svg=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.svg.style.position="relative",this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",this.svg.style.display="block",t.appendChild(this.svg),this.options.dataAxis.orientation="left",this.yAxisLeft=new _r(this.body,this.options.dataAxis,this.svg,this.options.groups),this.options.dataAxis.orientation="right",this.yAxisRight=new _r(this.body,this.options.dataAxis,this.svg,this.options.groups),delete this.options.dataAxis.orientation,this.legendLeft=new Tr(this.body,this.options.legend,"left",this.options.groups),this.legendRight=new Tr(this.body,this.options.legend,"right",this.options.groups),this.show()},Mr.prototype.setOptions=function(t){if(t){void 0===t.graphHeight&&void 0!==t.height?(this.updateSVGheight=!0,this.updateSVGheightOnResize=!0):void 0!==this.body.domProps.centerContainer.height&&void 0!==t.graphHeight&&parseInt((t.graphHeight+"").replace("px",""))<this.body.domProps.centerContainer.height&&(this.updateSVGheight=!0),Wo.selectiveDeepExtend(["sampling","defaultGroup","stack","height","graphHeight","yAxisOrientation","style","barChart","dataAxis","sort","groups"],this.options,t),Wo.mergeOptions(this.options,t,"interpolation"),Wo.mergeOptions(this.options,t,"drawPoints"),Wo.mergeOptions(this.options,t,"shaded"),Wo.mergeOptions(this.options,t,"legend"),t.interpolation&&"object"==typeof t.interpolation&&t.interpolation.parametrization&&("uniform"==t.interpolation.parametrization?this.options.interpolation.alpha=0:"chordal"==t.interpolation.parametrization?this.options.interpolation.alpha=1:(this.options.interpolation.parametrization="centripetal",this.options.interpolation.alpha=.5)),this.yAxisLeft&&void 0!==t.dataAxis&&(this.yAxisLeft.setOptions(this.options.dataAxis),this.yAxisRight.setOptions(this.options.dataAxis)),this.legendLeft&&void 0!==t.legend&&(this.legendLeft.setOptions(this.options.legend),this.legendRight.setOptions(this.options.legend)),this.groups.hasOwnProperty(Er)&&this.groups[Er].setOptions(t)}this.dom.frame&&(this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0}))},Mr.prototype.hide=function(){this.dom.frame.parentNode&&this.dom.frame.parentNode.removeChild(this.dom.frame)},Mr.prototype.show=function(){this.dom.frame.parentNode||this.body.dom.center.appendChild(this.dom.frame)},Mr.prototype.setItems=function(t){var e,i=this,n=this.itemsData;if(t){if(!Fo(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.itemsData=Yo(t)}else this.itemsData=null;if(n&&(Wo.forEach(this.itemListeners,(function(t,e){n.off(e,t)})),n.dispose(),e=n.getIds(),this._onRemove(e)),this.itemsData){var o=this.id;Wo.forEach(this.itemListeners,(function(t,e){i.itemsData.on(e,t,o)})),e=this.itemsData.getIds(),this._onAdd(e)}},Mr.prototype.setGroups=function(t){var e,i=this;if(this.groupsData){Wo.forEach(this.groupListeners,(function(t,e){i.groupsData.off(e,t)})),e=this.groupsData.getIds(),this.groupsData=null;for(var n=0;n<e.length;n++)this._removeGroup(e[n])}if(t){if(!Fo(t))throw new TypeError("Data must implement the interface of DataSet or DataView");this.groupsData=t}else this.groupsData=null;if(this.groupsData){var o=this.id;Wo.forEach(this.groupListeners,(function(t,e){i.groupsData.on(e,t,o)})),e=this.groupsData.getIds(),this._onAddGroups(e)}},Mr.prototype._onUpdate=function(t){this._updateAllGroupData(t)},Mr.prototype._onAdd=function(t){this._onUpdate(t)},Mr.prototype._onRemove=function(t){this._onUpdate(t)},Mr.prototype._onUpdateGroups=function(t){this._updateAllGroupData(null,t)},Mr.prototype._onAddGroups=function(t){this._onUpdateGroups(t)},Mr.prototype._onRemoveGroups=function(t){for(var e=0;e<t.length;e++)this._removeGroup(t[e]);this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0})},Mr.prototype._removeGroup=function(t){this.groups.hasOwnProperty(t)&&("right"==this.groups[t].options.yAxisOrientation?(this.yAxisRight.removeGroup(t),this.legendRight.removeGroup(t),this.legendRight.redraw()):(this.yAxisLeft.removeGroup(t),this.legendLeft.removeGroup(t),this.legendLeft.redraw()),delete this.groups[t])},Mr.prototype._updateGroup=function(t,e){this.groups.hasOwnProperty(e)?(this.groups[e].update(t),"right"==this.groups[e].options.yAxisOrientation?(this.yAxisRight.updateGroup(e,this.groups[e]),this.legendRight.updateGroup(e,this.groups[e]),this.yAxisLeft.removeGroup(e),this.legendLeft.removeGroup(e)):(this.yAxisLeft.updateGroup(e,this.groups[e]),this.legendLeft.updateGroup(e,this.groups[e]),this.yAxisRight.removeGroup(e),this.legendRight.removeGroup(e))):(this.groups[e]=new Sr(t,e,this.options,this.groupsUsingDefaultStyles),"right"==this.groups[e].options.yAxisOrientation?(this.yAxisRight.addGroup(e,this.groups[e]),this.legendRight.addGroup(e,this.groups[e])):(this.yAxisLeft.addGroup(e,this.groups[e]),this.legendLeft.addGroup(e,this.groups[e]))),this.legendLeft.redraw(),this.legendRight.redraw()},Mr.prototype._updateAllGroupData=function(t,e){if(null!=this.itemsData){var i={},n=this.itemsData.get(),o=this.itemsData.idProp,s={};t&&t.map((function(t){s[t]=t}));for(var r={},a=0;a<n.length;a++){var l=n[a],h=l.group;null==h&&(h=Er),r.hasOwnProperty(h)?r[h]++:r[h]=1}var d={};if(!e&&t)for(h in this.groups)if(this.groups.hasOwnProperty(h)){var c=(f=this.groups[h]).getItems();i[h]=c.filter((function(t){return d[t[o]]=t[o],t[o]!==s[t[o]]}));var u=r[h];r[h]-=i[h].length,i[h].length<u&&(i[h][u-1]={})}for(a=0;a<n.length;a++)if(null==(h=(l=n[a]).group)&&(h=Er),e||!t||l[o]===s[l[o]]||!d.hasOwnProperty(l[o])){i.hasOwnProperty(h)||(i[h]=new Array(r[h]));var p=Wo.bridgeObject(l);p.x=Wo.convert(l.x,"Date"),p.end=Wo.convert(l.end,"Date"),p.orginalY=l.y,p.y=Number(l.y),p[o]=l[o];var m=i[h].length-r[h]--;i[h][m]=p}for(h in this.groups)this.groups.hasOwnProperty(h)&&(i.hasOwnProperty(h)||(i[h]=new Array(0)));for(h in i)if(i.hasOwnProperty(h))if(0==i[h].length)this.groups.hasOwnProperty(h)&&this._removeGroup(h);else{var f=void 0;null!=this.groupsData&&(f=this.groupsData.get(h)),null==f&&(f={id:h,content:this.options.defaultGroup+h}),this._updateGroup(f,h),this.groups[h].setItems(i[h])}this.forceGraphUpdate=!0,this.body.emitter.emit("_change",{queue:!0})}},Mr.prototype.redraw=function(){var t=!1;this.props.width=this.dom.frame.offsetWidth,this.props.height=this.body.domProps.centerContainer.height-this.body.domProps.border.top-this.body.domProps.border.bottom,t=this._isResized()||t;var e=this.body.range.end-this.body.range.start,i=e!=this.lastVisibleInterval;if(this.lastVisibleInterval=e,1==t&&(this.svg.style.width=Wo.option.asSize(3*this.props.width),this.svg.style.left=Wo.option.asSize(-this.props.width),-1==(this.options.height+"").indexOf("%")&&1!=this.updateSVGheightOnResize||(this.updateSVGheight=!0)),1==this.updateSVGheight?(this.options.graphHeight!=this.props.height+"px"&&(this.options.graphHeight=this.props.height+"px",this.svg.style.height=this.props.height+"px"),this.updateSVGheight=!1):this.svg.style.height=(""+this.options.graphHeight).replace("px","")+"px",1==t||1==i||1==this.abortedGraphUpdate||1==this.forceGraphUpdate)t=this._updateGraph()||t,this.forceGraphUpdate=!1,this.lastStart=this.body.range.start,this.svg.style.left=-this.props.width+"px";else if(0!=this.lastStart){var n=this.body.range.start-this.lastStart,o=this.body.range.end-this.body.range.start;if(0!=this.props.width){var s=n*(this.props.width/o);this.svg.style.left=-this.props.width-s+"px"}}return this.legendLeft.redraw(),this.legendRight.redraw(),t},Mr.prototype._getSortedGroupIds=function(){var t=[];for(var e in this.groups)if(this.groups.hasOwnProperty(e)){var i=this.groups[e];1!=i.visible||void 0!==this.options.groups.visibility[e]&&1!=this.options.groups.visibility[e]||t.push({id:e,zIndex:i.options.zIndex})}Wo.insertSort(t,(function(t,e){var i=t.zIndex,n=e.zIndex;return void 0===i&&(i=0),void 0===n&&(n=0),i==n?0:i<n?-1:1}));for(var n=new Array(t.length),o=0;o<t.length;o++)n[o]=t[o].id;return n},Mr.prototype._updateGraph=function(){if(mr(this.svgElements),0!=this.props.width&&null!=this.itemsData){var t,e,i={},n=this.body.util.toGlobalTime(-this.body.domProps.root.width),o=this.body.util.toGlobalTime(2*this.body.domProps.root.width),s=this._getSortedGroupIds();if(s.length>0){var r={};for(this._getRelevantData(s,r,n,o),this._applySampling(s,r),e=0;e<s.length;e++)this._convertXcoordinates(r[s[e]]);if(this._getYRanges(s,r,i),1==this._updateYAxis(s,i))return fr(this.svgElements),this.abortedGraphUpdate=!0,!0;this.abortedGraphUpdate=!1;var a=void 0;for(e=0;e<s.length;e++)t=this.groups[s[e]],!0===this.options.stack&&"line"===this.options.style&&(null!=t.options.excludeFromStacking&&t.options.excludeFromStacking||(null!=a&&(this._stack(r[t.id],r[a.id]),1==t.options.shaded.enabled&&"group"!==t.options.shaded.orientation&&("top"==t.options.shaded.orientation&&"group"!==a.options.shaded.orientation?(a.options.shaded.orientation="group",a.options.shaded.groupId=t.id):(t.options.shaded.orientation="group",t.options.shaded.groupId=a.id))),a=t)),this._convertYcoordinates(r[s[e]],t);var l={};for(e=0;e<s.length;e++)if("line"===(t=this.groups[s[e]]).options.style&&1==t.options.shaded.enabled){var h=r[s[e]];if(null==h||0==h.length)continue;if(l.hasOwnProperty(s[e])||(l[s[e]]=Cr.calcPath(h,t)),"group"===t.options.shaded.orientation){var d=t.options.shaded.groupId;if(-1===s.indexOf(d)){console.log(t.id+": Unknown shading group target given:"+d);continue}l.hasOwnProperty(d)||(l[d]=Cr.calcPath(r[d],this.groups[d])),Cr.drawShading(l[s[e]],t,l[d],this.framework)}else Cr.drawShading(l[s[e]],t,void 0,this.framework)}for(Dr.draw(s,r,this.framework),e=0;e<s.length;e++)if(t=this.groups[s[e]],r[s[e]].length>0)switch(t.options.style){case"line":l.hasOwnProperty(s[e])||(l[s[e]]=Cr.calcPath(r[s[e]],t)),Cr.draw(l[s[e]],t,this.framework);case"point":case"points":"point"!=t.options.style&&"points"!=t.options.style&&1!=t.options.drawPoints.enabled||xr.draw(r[s[e]],t,this.framework)}}}return fr(this.svgElements),!1},Mr.prototype._stack=function(t,e){var i,n,o,s,r;i=0;for(var a=0;a<t.length;a++){s=void 0,r=void 0;for(var l=i;l<e.length;l++){if(e[l].x===t[a].x){s=e[l],r=e[l],i=l;break}if(e[l].x>t[a].x){r=e[l],s=0==l?r:e[l-1],i=l;break}}void 0===r&&(s=e[e.length-1],r=e[e.length-1]),n=r.x-s.x,o=r.y-s.y,t[a].y=0==n?t[a].orginalY+r.y:t[a].orginalY+o/n*(t[a].x-s.x)+s.y}},Mr.prototype._getRelevantData=function(t,e,i,n){var o,s,r,a;if(t.length>0)for(s=0;s<t.length;s++){var l=(o=this.groups[t[s]]).getItems();if(1==o.options.sort){var h=function(t,e){return t.getTime()==e.getTime()?0:t<e?-1:1},d=Math.max(0,Wo.binarySearchValue(l,i,"x","before",h)),c=Math.min(l.length,Wo.binarySearchValue(l,n,"x","after",h)+1);c<=0&&(c=l.length);var u=new Array(c-d);for(r=d;r<c;r++)a=o.itemsData[r],u[r-d]=a;e[t[s]]=u}else e[t[s]]=o.itemsData}},Mr.prototype._applySampling=function(t,e){if(t.length>0)for(var i=0;i<t.length;i++)if(1==this.groups[t[i]].options.sampling){var n=e[t[i]];if(n.length>0){var o,s=n.length,r=s/(this.body.util.toGlobalScreen(n[n.length-1].x)-this.body.util.toGlobalScreen(n[0].x));o=Math.min(Math.ceil(.2*s),Math.max(1,Math.round(r)));for(var a=new Array(s),l=0;l<s;l+=o){a[Math.round(l/o)]=n[l]}e[t[i]]=a.splice(0,Math.round(s/o))}}},Mr.prototype._getYRanges=function(t,e,i){var n,o,s,r,a=[],l=[];if(t.length>0){for(s=0;s<t.length;s++)n=e[t[s]],r=this.groups[t[s]].options,n.length>0&&(o=this.groups[t[s]],!0===r.stack&&"bar"===r.style?"left"===r.yAxisOrientation?a=a.concat(n):l=l.concat(n):i[t[s]]=o.getYRange(n,t[s]));Dr.getStackedYRange(a,i,t,"__barStackLeft","left"),Dr.getStackedYRange(l,i,t,"__barStackRight","right")}},Mr.prototype._updateYAxis=function(t,e){var i,n,o=!1,s=!1,r=!1,a=1e9,l=1e9,h=-1e9,d=-1e9;if(t.length>0){for(var c=0;c<t.length;c++){var u=this.groups[t[c]];u&&"right"!=u.options.yAxisOrientation?(s=!0,a=1e9,h=-1e9):u&&u.options.yAxisOrientation&&(r=!0,l=1e9,d=-1e9)}for(c=0;c<t.length;c++)e.hasOwnProperty(t[c])&&!0!==e[t[c]].ignore&&(i=e[t[c]].min,n=e[t[c]].max,"right"!=e[t[c]].yAxisOrientation?(s=!0,a=a>i?i:a,h=h<n?n:h):(r=!0,l=l>i?i:l,d=d<n?n:d));1==s&&this.yAxisLeft.setRange(a,h),1==r&&this.yAxisRight.setRange(l,d)}o=this._toggleAxisVisiblity(s,this.yAxisLeft)||o,o=this._toggleAxisVisiblity(r,this.yAxisRight)||o,1==r&&1==s?(this.yAxisLeft.drawIcons=!0,this.yAxisRight.drawIcons=!0):(this.yAxisLeft.drawIcons=!1,this.yAxisRight.drawIcons=!1),this.yAxisRight.master=!s,this.yAxisRight.masterAxis=this.yAxisLeft,0==this.yAxisRight.master?(this.yAxisLeft.lineOffset=1==r?this.yAxisRight.width:0,o=this.yAxisLeft.redraw()||o,o=this.yAxisRight.redraw()||o):o=this.yAxisRight.redraw()||o;var p=["__barStackLeft","__barStackRight","__lineStackLeft","__lineStackRight"];for(c=0;c<p.length;c++)-1!=t.indexOf(p[c])&&t.splice(t.indexOf(p[c]),1);return o},Mr.prototype._toggleAxisVisiblity=function(t,e){var i=!1;return 0==t?e.dom.frame.parentNode&&0==e.hidden&&(e.hide(),i=!0):e.dom.frame.parentNode||1!=e.hidden||(e.show(),i=!0),i},Mr.prototype._convertXcoordinates=function(t){for(var e=this.body.util.toScreen,i=0;i<t.length;i++)t[i].screen_x=e(t[i].x)+this.props.width,t[i].screen_y=t[i].y,null!=t[i].end?t[i].screen_end=e(t[i].end)+this.props.width:t[i].screen_end=void 0},Mr.prototype._convertYcoordinates=function(t,e){var i=this.yAxisLeft,n=Number(this.svg.style.height.replace("px",""));"right"==e.options.yAxisOrientation&&(i=this.yAxisRight);for(var o=0;o<t.length;o++)t[o].screen_y=Math.round(i.convertValue(t[o].y));e.setZeroPosition(Math.min(n,i.convertValue(0)))};let Or="string",Ir="boolean",Ar="number",Pr="date",Nr="object",Fr="moment",Rr={configure:{enabled:{boolean:Ir},filter:{boolean:Ir,function:"function"},container:{dom:"dom"},__type__:{object:Nr,boolean:Ir,function:"function"}},alignCurrentTime:{string:Or,undefined:"undefined"},yAxisOrientation:{string:["left","right"]},defaultGroup:{string:Or},sort:{boolean:Ir},sampling:{boolean:Ir},stack:{boolean:Ir},graphHeight:{string:Or,number:Ar},shaded:{enabled:{boolean:Ir},orientation:{string:["bottom","top","zero","group"]},groupId:{object:Nr},__type__:{boolean:Ir,object:Nr}},style:{string:["line","bar","points"]},barChart:{width:{number:Ar},minWidth:{number:Ar},sideBySide:{boolean:Ir},align:{string:["left","center","right"]},__type__:{object:Nr}},interpolation:{enabled:{boolean:Ir},parametrization:{string:["centripetal","chordal","uniform"]},alpha:{number:Ar},__type__:{object:Nr,boolean:Ir}},drawPoints:{enabled:{boolean:Ir},onRender:{function:"function"},size:{number:Ar},style:{string:["square","circle"]},__type__:{object:Nr,boolean:Ir,function:"function"}},dataAxis:{showMinorLabels:{boolean:Ir},showMajorLabels:{boolean:Ir},showWeekScale:{boolean:Ir},icons:{boolean:Ir},width:{string:Or,number:Ar},visible:{boolean:Ir},alignZeros:{boolean:Ir},left:{range:{min:{number:Ar,undefined:"undefined"},max:{number:Ar,undefined:"undefined"},__type__:{object:Nr}},format:{function:"function"},title:{text:{string:Or,number:Ar,undefined:"undefined"},style:{string:Or,undefined:"undefined"},__type__:{object:Nr}},__type__:{object:Nr}},right:{range:{min:{number:Ar,undefined:"undefined"},max:{number:Ar,undefined:"undefined"},__type__:{object:Nr}},format:{function:"function"},title:{text:{string:Or,number:Ar,undefined:"undefined"},style:{string:Or,undefined:"undefined"},__type__:{object:Nr}},__type__:{object:Nr}},__type__:{object:Nr}},legend:{enabled:{boolean:Ir},icons:{boolean:Ir},left:{visible:{boolean:Ir},position:{string:["top-right","bottom-right","top-left","bottom-left"]},__type__:{object:Nr}},right:{visible:{boolean:Ir},position:{string:["top-right","bottom-right","top-left","bottom-left"]},__type__:{object:Nr}},__type__:{object:Nr,boolean:Ir}},groups:{visibility:{any:"any"},__type__:{object:Nr}},autoResize:{boolean:Ir},throttleRedraw:{number:Ar},clickToUse:{boolean:Ir},end:{number:Ar,date:Pr,string:Or,moment:Fr},format:{minorLabels:{millisecond:{string:Or,undefined:"undefined"},second:{string:Or,undefined:"undefined"},minute:{string:Or,undefined:"undefined"},hour:{string:Or,undefined:"undefined"},weekday:{string:Or,undefined:"undefined"},day:{string:Or,undefined:"undefined"},week:{string:Or,undefined:"undefined"},month:{string:Or,undefined:"undefined"},quarter:{string:Or,undefined:"undefined"},year:{string:Or,undefined:"undefined"},__type__:{object:Nr}},majorLabels:{millisecond:{string:Or,undefined:"undefined"},second:{string:Or,undefined:"undefined"},minute:{string:Or,undefined:"undefined"},hour:{string:Or,undefined:"undefined"},weekday:{string:Or,undefined:"undefined"},day:{string:Or,undefined:"undefined"},week:{string:Or,undefined:"undefined"},month:{string:Or,undefined:"undefined"},quarter:{string:Or,undefined:"undefined"},year:{string:Or,undefined:"undefined"},__type__:{object:Nr}},__type__:{object:Nr}},moment:{function:"function"},height:{string:Or,number:Ar},hiddenDates:{start:{date:Pr,number:Ar,string:Or,moment:Fr},end:{date:Pr,number:Ar,string:Or,moment:Fr},repeat:{string:Or},__type__:{object:Nr,array:"array"}},locale:{string:Or},locales:{__any__:{any:"any"},__type__:{object:Nr}},max:{date:Pr,number:Ar,string:Or,moment:Fr},maxHeight:{number:Ar,string:Or},maxMinorChars:{number:Ar},min:{date:Pr,number:Ar,string:Or,moment:Fr},minHeight:{number:Ar,string:Or},moveable:{boolean:Ir},multiselect:{boolean:Ir},orientation:{string:Or},showCurrentTime:{boolean:Ir},showMajorLabels:{boolean:Ir},showMinorLabels:{boolean:Ir},showWeekScale:{boolean:Ir},snap:{function:"function",null:"null"},start:{date:Pr,number:Ar,string:Or,moment:Fr},timeAxis:{scale:{string:Or,undefined:"undefined"},step:{number:Ar,undefined:"undefined"},__type__:{object:Nr}},width:{string:Or,number:Ar},zoomable:{boolean:Ir},zoomKey:{string:["ctrlKey","altKey","metaKey",""]},zoomMax:{number:Ar},zoomMin:{number:Ar},zIndex:{number:Ar},__type__:{object:Nr}},Lr={global:{alignCurrentTime:["none","year","month","quarter","week","isoWeek","day","date","hour","minute","second"],sort:!0,sampling:!0,stack:!1,shaded:{enabled:!1,orientation:["zero","top","bottom","group"]},style:["line","bar","points"],barChart:{width:[50,5,100,5],minWidth:[50,5,100,5],sideBySide:!1,align:["left","center","right"]},interpolation:{enabled:!0,parametrization:["centripetal","chordal","uniform"]},drawPoints:{enabled:!0,size:[6,2,30,1],style:["square","circle"]},dataAxis:{showMinorLabels:!0,showMajorLabels:!0,showWeekScale:!1,icons:!1,width:[40,0,200,1],visible:!0,alignZeros:!0,left:{title:{text:"",style:""}},right:{title:{text:"",style:""}}},legend:{enabled:!1,icons:!0,left:{visible:!0,position:["top-right","bottom-right","top-left","bottom-left"]},right:{visible:!0,position:["top-right","bottom-right","top-left","bottom-left"]}},autoResize:!0,clickToUse:!1,end:"",format:{minorLabels:{millisecond:"SSS",second:"s",minute:"HH:mm",hour:"HH:mm",weekday:"ddd D",day:"D",week:"w",month:"MMM",quarter:"[Q]Q",year:"YYYY"},majorLabels:{millisecond:"HH:mm:ss",second:"D MMMM HH:mm",minute:"ddd D MMMM",hour:"ddd D MMMM",weekday:"MMMM YYYY",day:"MMMM YYYY",week:"MMMM YYYY",month:"YYYY",quarter:"YYYY",year:""}},height:"",locale:"",max:"",maxHeight:"",maxMinorChars:[7,0,20,1],min:"",minHeight:"",moveable:!0,orientation:["both","bottom","top"],showCurrentTime:!1,showMajorLabels:!0,showMinorLabels:!0,showWeekScale:!1,start:"",width:"100%",zoomable:!0,zoomKey:["ctrlKey","altKey","metaKey",""],zoomMax:[31536e10,10,31536e10,1],zoomMin:[10,10,31536e10,1],zIndex:0}};function jr(t,e,i,n){if(!Array.isArray(i)&&!Fo(i)&&i instanceof Object){var o=n;n=i,i=o}n&&n.throttleRedraw&&console.warn('Graph2d option "throttleRedraw" is DEPRICATED and no longer supported. It will be removed in the next MAJOR release.');var s=this;this.defaultOptions={start:null,end:null,autoResize:!0,orientation:{axis:"bottom",item:"bottom"},moment:No,width:null,height:null,maxHeight:null,minHeight:null},this.options=Wo.deepExtend({},this.defaultOptions),this._create(t),this.components=[],this.body={dom:this.dom,domProps:this.props,emitter:{on:this.on.bind(this),off:this.off.bind(this),emit:this.emit.bind(this)},hiddenDates:[],util:{getScale:()=>s.timeAxis.step.scale,getStep:()=>s.timeAxis.step.step,toScreen:s._toScreen.bind(s),toGlobalScreen:s._toGlobalScreen.bind(s),toTime:s._toTime.bind(s),toGlobalTime:s._toGlobalTime.bind(s)}},this.range=new ts(this.body),this.components.push(this.range),this.body.range=this.range,this.timeAxis=new rs(this.body),this.components.push(this.timeAxis),this.currentTime=new Ss(this.body),this.components.push(this.currentTime),this.linegraph=new Mr(this.body),this.components.push(this.linegraph),this.itemsData=null,this.groupsData=null,this.on("tap",(function(t){s.emit("click",s.getEventProperties(t))})),this.on("doubletap",(function(t){s.emit("doubleClick",s.getEventProperties(t))})),this.dom.root.oncontextmenu=function(t){s.emit("contextmenu",s.getEventProperties(t))},this.initialFitDone=!1,this.on("changed",(function(){if(null!=s.itemsData){if(!s.initialFitDone&&!s.options.rollingMode)if(s.initialFitDone=!0,null!=s.options.start||null!=s.options.end){if(null==s.options.start||null==s.options.end)var t=s.getItemRange();var e=null!=s.options.start?s.options.start:t.min,i=null!=s.options.end?s.options.end:t.max;s.setWindow(e,i,{animation:!1})}else s.fit({animation:!1});s.initialDrawDone||!s.initialRangeChangeDone&&(s.options.start||s.options.end)&&!s.options.rollingMode||(s.initialDrawDone=!0,s.dom.root.style.visibility="visible",s.dom.loadingScreen.parentNode.removeChild(s.dom.loadingScreen),s.options.onInitialDrawComplete&&setTimeout((()=>s.options.onInitialDrawComplete()),0))}})),n&&this.setOptions(n),i&&this.setGroups(i),e&&this.setItems(e),this._redraw()}jr.prototype=new Cs,jr.prototype.setOptions=function(t){!0===Zs.validate(t,Rr)&&console.log("%cErrors have been found in the supplied options object.",Ks),Cs.prototype.setOptions.call(this,t)},jr.prototype.setItems=function(t){var e,i=null==this.itemsData;if(e=t?Fo(t)?Yo(t):Yo(new Dn(t)):null,this.itemsData&&this.itemsData.dispose(),this.itemsData=e,this.linegraph&&this.linegraph.setItems(null!=e?e.rawDS:null),i)if(null!=this.options.start||null!=this.options.end){var n=null!=this.options.start?this.options.start:null,o=null!=this.options.end?this.options.end:null;this.setWindow(n,o,{animation:!1})}else this.fit({animation:!1})},jr.prototype.setGroups=function(t){var e;e=t?Fo(t)?t:new Dn(t):null,this.groupsData=e,this.linegraph.setGroups(e)},jr.prototype.getLegend=function(t,e,i){return void 0===e&&(e=15),void 0===i&&(i=15),void 0!==this.linegraph.groups[t]?this.linegraph.groups[t].getLegend(e,i):"cannot find group:'"+t+"'"},jr.prototype.isGroupVisible=function(t){return void 0!==this.linegraph.groups[t]&&(this.linegraph.groups[t].visible&&(void 0===this.linegraph.options.groups.visibility[t]||1==this.linegraph.options.groups.visibility[t]))},jr.prototype.getDataRange=function(){var t=null,e=null;for(var i in this.linegraph.groups)if(this.linegraph.groups.hasOwnProperty(i)&&1==this.linegraph.groups[i].visible)for(var n=0;n<this.linegraph.groups[i].itemsData.length;n++){var o=this.linegraph.groups[i].itemsData[n],s=Wo.convert(o.x,"Date").valueOf();t=null==t||t>s?s:t,e=null==e||e<s?s:e}return{min:null!=t?new Date(t):null,max:null!=e?new Date(e):null}},jr.prototype.getEventProperties=function(t){var e=t.center?t.center.x:t.clientX,i=t.center?t.center.y:t.clientY,n=e-Wo.getAbsoluteLeft(this.dom.centerContainer),o=i-Wo.getAbsoluteTop(this.dom.centerContainer),s=this._toTime(n),r=Ds.customTimeFromTarget(t),a=Wo.getTarget(t),l=null;Wo.hasParent(a,this.timeAxis.dom.foreground)||this.timeAxis2&&Wo.hasParent(a,this.timeAxis2.dom.foreground)?l="axis":Wo.hasParent(a,this.linegraph.yAxisLeft.dom.frame)||Wo.hasParent(a,this.linegraph.yAxisRight.dom.frame)?l="data-axis":Wo.hasParent(a,this.linegraph.legendLeft.dom.frame)||Wo.hasParent(a,this.linegraph.legendRight.dom.frame)?l="legend":null!=r?l="custom-time":Wo.hasParent(a,this.currentTime.bar)?l="current-time":Wo.hasParent(a,this.dom.center)&&(l="background");var h=[],d=this.linegraph.yAxisLeft,c=this.linegraph.yAxisRight;return!d.hidden&&this.itemsData.length>0&&h.push(d.screenToValue(o)),!c.hidden&&this.itemsData.length>0&&h.push(c.screenToValue(o)),{event:t,customTime:r?r.options.id:null,what:l,pageX:t.srcEvent?t.srcEvent.pageX:t.pageX,pageY:t.srcEvent?t.srcEvent.pageY:t.pageY,x:n,y:o,time:s,value:h}},jr.prototype._createConfigurator=function(){return new hr(this,this.dom.container,Lr)};const Yr=function(){try{return navigator?navigator.languages&&navigator.languages.length?navigator.languages:navigator.userLanguage||navigator.language||navigator.browserLanguage||"en":"en"}catch(t){return"en"}}();Mn.locale(Yr);var Hr={exports:{}};!function(t){function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var i="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==B?B:"undefined"!=typeof self?self:{},n={exports:{}},o=function(t){return t&&t.Math==Math&&t},s=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof i&&i)||function(){return this}()||Function("return this")(),r=function(t){try{return!!t()}catch(t){return!0}},a=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")})),l=a,h=Function.prototype,d=h.apply,c=h.call,u="object"==typeof Reflect&&Reflect.apply||(l?c.bind(d):function(){return c.apply(d,arguments)}),p=a,m=Function.prototype,f=m.bind,g=m.call,v=p&&f.bind(g,g),y=p?function(t){return t&&v(t)}:function(t){return t&&function(){return g.apply(t,arguments)}},b=function(t){return"function"==typeof t},w={},_=!r((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),x=a,k=Function.prototype.call,D=x?k.bind(k):function(){return k.apply(k,arguments)},C={},S={}.propertyIsEnumerable,T=Object.getOwnPropertyDescriptor,E=T&&!S.call({1:2},1);C.f=E?function(t){var e=T(this,t);return!!e&&e.enumerable}:S;var M,O,I=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}},A=y,P=A({}.toString),N=A("".slice),F=function(t){return N(P(t),8,-1)},R=y,L=r,j=F,Y=s.Object,H=R("".split),z=L((function(){return!Y("z").propertyIsEnumerable(0)}))?function(t){return"String"==j(t)?H(t,""):Y(t)}:Y,W=s.TypeError,G=function(t){if(null==t)throw W("Can't call method on "+t);return t},V=z,U=G,$=function(t){return V(U(t))},q=b,X=function(t){return"object"==typeof t?null!==t:q(t)},K={},Z=K,Q=s,J=b,tt=function(t){return J(t)?t:void 0},et=function(t,e){return arguments.length<2?tt(Z[t])||tt(Q[t]):Z[t]&&Z[t][e]||Q[t]&&Q[t][e]},it=y({}.isPrototypeOf),nt=et("navigator","userAgent")||"",ot=s,st=nt,rt=ot.process,at=ot.Deno,lt=rt&&rt.versions||at&&at.version,ht=lt&&lt.v8;ht&&(O=(M=ht.split("."))[0]>0&&M[0]<4?1:+(M[0]+M[1])),!O&&st&&(!(M=st.match(/Edge\/(\d+)/))||M[1]>=74)&&(M=st.match(/Chrome\/(\d+)/))&&(O=+M[1]);var dt=O,ct=dt,ut=r,pt=!!Object.getOwnPropertySymbols&&!ut((function(){var t=Symbol();return!String(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&ct&&ct<41})),mt=pt&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,ft=et,gt=b,vt=it,yt=mt,bt=s.Object,wt=yt?function(t){return"symbol"==typeof t}:function(t){var e=ft("Symbol");return gt(e)&&vt(e.prototype,bt(t))},_t=s.String,xt=function(t){try{return _t(t)}catch(t){return"Object"}},kt=b,Dt=xt,Ct=s.TypeError,St=function(t){if(kt(t))return t;throw Ct(Dt(t)+" is not a function")},Tt=St,Et=function(t,e){var i=t[e];return null==i?void 0:Tt(i)},Mt=D,Ot=b,It=X,At=s.TypeError,Pt={exports:{}},Nt=s,Ft=Object.defineProperty,Rt=function(t,e){try{Ft(Nt,t,{value:e,configurable:!0,writable:!0})}catch(i){Nt[t]=e}return e},Lt="__core-js_shared__",jt=s[Lt]||Rt(Lt,{}),Yt=jt;(Pt.exports=function(t,e){return Yt[t]||(Yt[t]=void 0!==e?e:{})})("versions",[]).push({version:"3.21.1",mode:"pure",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.21.1/LICENSE",source:"https://github.com/zloirock/core-js"});var Ht=G,zt=s.Object,Bt=function(t){return zt(Ht(t))},Wt=Bt,Gt=y({}.hasOwnProperty),Vt=Object.hasOwn||function(t,e){return Gt(Wt(t),e)},Ut=y,$t=0,qt=Math.random(),Xt=Ut(1..toString),Kt=function(t){return"Symbol("+(void 0===t?"":t)+")_"+Xt(++$t+qt,36)},Zt=s,Qt=Pt.exports,Jt=Vt,te=Kt,ee=pt,ie=mt,ne=Qt("wks"),oe=Zt.Symbol,se=oe&&oe.for,re=ie?oe:oe&&oe.withoutSetter||te,ae=function(t){if(!Jt(ne,t)||!ee&&"string"!=typeof ne[t]){var e="Symbol."+t;ee&&Jt(oe,t)?ne[t]=oe[t]:ne[t]=ie&&se?se(e):re(e)}return ne[t]},le=D,he=X,de=wt,ce=Et,ue=function(t,e){var i,n;if("string"===e&&Ot(i=t.toString)&&!It(n=Mt(i,t)))return n;if(Ot(i=t.valueOf)&&!It(n=Mt(i,t)))return n;if("string"!==e&&Ot(i=t.toString)&&!It(n=Mt(i,t)))return n;throw At("Can't convert object to primitive value")},pe=ae,me=s.TypeError,fe=pe("toPrimitive"),ge=function(t,e){if(!he(t)||de(t))return t;var i,n=ce(t,fe);if(n){if(void 0===e&&(e="default"),i=le(n,t,e),!he(i)||de(i))return i;throw me("Can't convert object to primitive value")}return void 0===e&&(e="number"),ue(t,e)},ve=wt,ye=function(t){var e=ge(t,"string");return ve(e)?e:e+""},be=X,we=s.document,_e=be(we)&&be(we.createElement),xe=function(t){return _e?we.createElement(t):{}},ke=xe,De=!_&&!r((function(){return 7!=Object.defineProperty(ke("div"),"a",{get:function(){return 7}}).a})),Ce=_,Se=D,Te=C,Ee=I,Me=$,Oe=ye,Ie=Vt,Ae=De,Pe=Object.getOwnPropertyDescriptor;w.f=Ce?Pe:function(t,e){if(t=Me(t),e=Oe(e),Ae)try{return Pe(t,e)}catch(t){}if(Ie(t,e))return Ee(!Se(Te.f,t,e),t[e])};var Ne=r,Fe=b,Re=/#|\.prototype\./,Le=function(t,e){var i=Ye[je(t)];return i==ze||i!=He&&(Fe(e)?Ne(e):!!e)},je=Le.normalize=function(t){return String(t).replace(Re,".").toLowerCase()},Ye=Le.data={},He=Le.NATIVE="N",ze=Le.POLYFILL="P",Be=Le,We=St,Ge=a,Ve=y(y.bind),Ue=function(t,e){return We(t),void 0===e?t:Ge?Ve(t,e):function(){return t.apply(e,arguments)}},$e={},qe=_&&r((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Xe=s,Ke=X,Ze=Xe.String,Qe=Xe.TypeError,Je=function(t){if(Ke(t))return t;throw Qe(Ze(t)+" is not an object")},ti=_,ei=De,ii=qe,ni=Je,oi=ye,si=s.TypeError,ri=Object.defineProperty,ai=Object.getOwnPropertyDescriptor,li="enumerable",hi="configurable",di="writable";$e.f=ti?ii?function(t,e,i){if(ni(t),e=oi(e),ni(i),"function"==typeof t&&"prototype"===e&&"value"in i&&di in i&&!i.writable){var n=ai(t,e);n&&n.writable&&(t[e]=i.value,i={configurable:hi in i?i.configurable:n.configurable,enumerable:li in i?i.enumerable:n.enumerable,writable:!1})}return ri(t,e,i)}:ri:function(t,e,i){if(ni(t),e=oi(e),ni(i),ei)try{return ri(t,e,i)}catch(t){}if("get"in i||"set"in i)throw si("Accessors not supported");return"value"in i&&(t[e]=i.value),t};var ci=$e,ui=I,pi=_?function(t,e,i){return ci.f(t,e,ui(1,i))}:function(t,e,i){return t[e]=i,t},mi=s,fi=u,gi=y,vi=b,yi=w.f,bi=Be,wi=K,_i=Ue,xi=pi,ki=Vt,Di=function(t){var e=function(i,n,o){if(this instanceof e){switch(arguments.length){case 0:return new t;case 1:return new t(i);case 2:return new t(i,n)}return new t(i,n,o)}return fi(t,this,arguments)};return e.prototype=t.prototype,e},Ci=function(t,e){var i,n,o,s,r,a,l,h,d=t.target,c=t.global,u=t.stat,p=t.proto,m=c?mi:u?mi[d]:(mi[d]||{}).prototype,f=c?wi:wi[d]||xi(wi,d,{})[d],g=f.prototype;for(o in e)i=!bi(c?o:d+(u?".":"#")+o,t.forced)&&m&&ki(m,o),r=f[o],i&&(a=t.noTargetGet?(h=yi(m,o))&&h.value:m[o]),s=i&&a?a:e[o],i&&typeof r==typeof s||(l=t.bind&&i?_i(s,mi):t.wrap&&i?Di(s):p&&vi(s)?gi(s):s,(t.sham||s&&s.sham||r&&r.sham)&&xi(l,"sham",!0),xi(f,o,l),p&&(ki(wi,n=d+"Prototype")||xi(wi,n,{}),xi(wi[n],o,s),t.real&&g&&!g[o]&&xi(g,o,s)))},Si=Ci,Ti=_,Ei=$e.f;Si({target:"Object",stat:!0,forced:Object.defineProperty!==Ei,sham:!Ti},{defineProperty:Ei});var Mi=K.Object,Oi=n.exports=function(t,e,i){return Mi.defineProperty(t,e,i)};Mi.defineProperty.sham&&(Oi.sham=!0);var Ii=n.exports,Ai=Ii;function Pi(t,e){for(var i=0;i<e.length;i++){var n=e[i];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Ai(t,n.key,n)}}function Ni(t,e,i){return e&&Pi(t.prototype,e),i&&Pi(t,i),Ai(t,"prototype",{writable:!1}),t}function Fi(t,e,i){return e in t?Ai(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):t[e]=i,t}var Ri=y([].slice),Li=y,ji=St,Yi=X,Hi=Vt,zi=Ri,Bi=a,Wi=s.Function,Gi=Li([].concat),Vi=Li([].join),Ui={},$i=function(t,e,i){if(!Hi(Ui,e)){for(var n=[],o=0;o<e;o++)n[o]="a["+o+"]";Ui[e]=Wi("C,a","return new C("+Vi(n,",")+")")}return Ui[e](t,i)},qi=Bi?Wi.bind:function(t){var e=ji(this),i=e.prototype,n=zi(arguments,1),o=function(){var i=Gi(n,zi(arguments));return this instanceof o?$i(e,i.length,i):e.apply(t,i)};return Yi(i)&&(o.prototype=i),o},Xi=qi;Ci({target:"Function",proto:!0,forced:Function.bind!==Xi},{bind:Xi});var Ki=K,Zi=function(t){return Ki[t+"Prototype"]},Qi=Zi("Function").bind,Ji=it,tn=Qi,en=Function.prototype,nn=function(t){var e=t.bind;return t===en||Ji(en,t)&&e===en.bind?tn:e},on=Math.ceil,sn=Math.floor,rn=function(t){var e=+t;return e!=e||0===e?0:(e>0?sn:on)(e)},an=rn,ln=Math.min,hn=function(t){return t>0?ln(an(t),9007199254740991):0},dn=function(t){return hn(t.length)},cn=St,un=Bt,pn=z,mn=dn,fn=s.TypeError,gn=function(t){return function(e,i,n,o){cn(i);var s=un(e),r=pn(s),a=mn(s),l=t?a-1:0,h=t?-1:1;if(n<2)for(;;){if(l in r){o=r[l],l+=h;break}if(l+=h,t?l<0:a<=l)throw fn("Reduce of empty array with no initial value")}for(;t?l>=0:a>l;l+=h)l in r&&(o=i(o,r[l],l,s));return o}},vn={left:gn(!1),right:gn(!0)},yn=r,bn=function(t,e){var i=[][t];return!!i&&yn((function(){i.call(null,e||function(){return 1},1)}))},wn="process"==F(s.process),_n=vn.left,xn=dt,kn=wn;Ci({target:"Array",proto:!0,forced:!bn("reduce")||!kn&&xn>79&&xn<83},{reduce:function(t){var e=arguments.length;return _n(this,t,e,e>1?arguments[1]:void 0)}});var Dn=Zi("Array").reduce,Cn=it,Sn=Dn,Tn=Array.prototype,En=function(t){var e=t.reduce;return t===Tn||Cn(Tn,t)&&e===Tn.reduce?Sn:e},Mn=F,On=Array.isArray||function(t){return"Array"==Mn(t)},In={};In[ae("toStringTag")]="z";var An="[object z]"===String(In),Pn=s,Nn=An,Fn=b,Rn=F,Ln=ae("toStringTag"),jn=Pn.Object,Yn="Arguments"==Rn(function(){return arguments}()),Hn=Nn?Rn:function(t){var e,i,n;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(t){}}(e=jn(t),Ln))?i:Yn?Rn(e):"Object"==(n=Rn(e))&&Fn(e.callee)?"Arguments":n},zn=b,Bn=jt,Wn=y(Function.toString);zn(Bn.inspectSource)||(Bn.inspectSource=function(t){return Wn(t)});var Gn=Bn.inspectSource,Vn=y,Un=r,$n=b,qn=Hn,Xn=Gn,Kn=function(){},Zn=[],Qn=et("Reflect","construct"),Jn=/^\s*(?:class|function)\b/,to=Vn(Jn.exec),eo=!Jn.exec(Kn),io=function(t){if(!$n(t))return!1;try{return Qn(Kn,Zn,t),!0}catch(t){return!1}},no=function(t){if(!$n(t))return!1;switch(qn(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return eo||!!to(Jn,Xn(t))}catch(t){return!0}};no.sham=!0;var oo=!Qn||Un((function(){var t;return io(io.call)||!io(Object)||!io((function(){t=!0}))||t}))?no:io,so=s,ro=On,ao=oo,lo=X,ho=ae("species"),co=so.Array,uo=function(t){var e;return ro(t)&&(e=t.constructor,(ao(e)&&(e===co||ro(e.prototype))||lo(e)&&null===(e=e[ho]))&&(e=void 0)),void 0===e?co:e},po=function(t,e){return new(uo(t))(0===e?0:e)},mo=Ue,fo=z,go=Bt,vo=dn,yo=po,bo=y([].push),wo=function(t){var e=1==t,i=2==t,n=3==t,o=4==t,s=6==t,r=7==t,a=5==t||s;return function(l,h,d,c){for(var u,p,m=go(l),f=fo(m),g=mo(h,d),v=vo(f),y=0,b=c||yo,w=e?b(l,v):i||r?b(l,0):void 0;v>y;y++)if((a||y in f)&&(p=g(u=f[y],y,m),t))if(e)w[y]=p;else if(p)switch(t){case 3:return!0;case 5:return u;case 6:return y;case 2:bo(w,u)}else switch(t){case 4:return!1;case 7:bo(w,u)}return s?-1:n||o?o:w}},_o={forEach:wo(0),map:wo(1),filter:wo(2),some:wo(3),every:wo(4),find:wo(5),findIndex:wo(6),filterReject:wo(7)},xo=r,ko=dt,Do=ae("species"),Co=function(t){return ko>=51||!xo((function(){var e=[];return(e.constructor={})[Do]=function(){return{foo:1}},1!==e[t](Boolean).foo}))},So=_o.filter;Ci({target:"Array",proto:!0,forced:!Co("filter")},{filter:function(t){return So(this,t,arguments.length>1?arguments[1]:void 0)}});var To=Zi("Array").filter,Eo=it,Mo=To,Oo=Array.prototype,Io=function(t){var e=t.filter;return t===Oo||Eo(Oo,t)&&e===Oo.filter?Mo:e},Ao=_o.map;Ci({target:"Array",proto:!0,forced:!Co("map")},{map:function(t){return Ao(this,t,arguments.length>1?arguments[1]:void 0)}});var Po=Zi("Array").map,No=it,Fo=Po,Ro=Array.prototype,Lo=function(t){var e=t.map;return t===Ro||No(Ro,t)&&e===Ro.map?Fo:e},jo=On,Yo=dn,Ho=Ue,zo=s.TypeError,Bo=function(t,e,i,n,o,s,r,a){for(var l,h,d=o,c=0,u=!!r&&Ho(r,a);c<n;){if(c in i){if(l=u?u(i[c],c,e):i[c],s>0&&jo(l))h=Yo(l),d=Bo(t,e,l,h,d,s-1)-1;else{if(d>=9007199254740991)throw zo("Exceed the acceptable array length");t[d]=l}d++}c++}return d},Wo=Bo,Go=St,Vo=Bt,Uo=dn,$o=po;Ci({target:"Array",proto:!0},{flatMap:function(t){var e,i=Vo(this),n=Uo(i);return Go(t),(e=$o(i,0)).length=Wo(e,i,i,n,0,1,t,arguments.length>1?arguments[1]:void 0),e}});var qo,Xo,Ko,Zo=Zi("Array").flatMap,Qo=it,Jo=Zo,ts=Array.prototype,es=function(t){var e=t.flatMap;return t===ts||Qo(ts,t)&&e===ts.flatMap?Jo:e},is=function(){function t(i,n,o){var s,r,a;e(this,t),Fi(this,"_source",void 0),Fi(this,"_transformers",void 0),Fi(this,"_target",void 0),Fi(this,"_listeners",{add:nn(s=this._add).call(s,this),remove:nn(r=this._remove).call(r,this),update:nn(a=this._update).call(a,this)}),this._source=i,this._transformers=n,this._target=o}return Ni(t,[{key:"all",value:function(){return this._target.update(this._transformItems(this._source.get())),this}},{key:"start",value:function(){return this._source.on("add",this._listeners.add),this._source.on("remove",this._listeners.remove),this._source.on("update",this._listeners.update),this}},{key:"stop",value:function(){return this._source.off("add",this._listeners.add),this._source.off("remove",this._listeners.remove),this._source.off("update",this._listeners.update),this}},{key:"_transformItems",value:function(t){var e;return En(e=this._transformers).call(e,(function(t,e){return e(t)}),t)}},{key:"_add",value:function(t,e){null!=e&&this._target.add(this._transformItems(this._source.get(e.items)))}},{key:"_update",value:function(t,e){null!=e&&this._target.update(this._transformItems(this._source.get(e.items)))}},{key:"_remove",value:function(t,e){null!=e&&this._target.remove(this._transformItems(e.oldData))}}]),t}(),ns=function(){function t(i){e(this,t),Fi(this,"_source",void 0),Fi(this,"_transformers",[]),this._source=i}return Ni(t,[{key:"filter",value:function(t){return this._transformers.push((function(e){return Io(e).call(e,t)})),this}},{key:"map",value:function(t){return this._transformers.push((function(e){return Lo(e).call(e,t)})),this}},{key:"flatMap",value:function(t){return this._transformers.push((function(e){return es(e).call(e,t)})),this}},{key:"to",value:function(t){return new is(this._source,this._transformers,t)}}]),t}(),os=Hn,ss=s.String,rs=function(t){if("Symbol"===os(t))throw TypeError("Cannot convert a Symbol value to a string");return ss(t)},as=y,ls=rn,hs=rs,ds=G,cs=as("".charAt),us=as("".charCodeAt),ps=as("".slice),ms=function(t){return function(e,i){var n,o,s=hs(ds(e)),r=ls(i),a=s.length;return r<0||r>=a?t?"":void 0:(n=us(s,r))<55296||n>56319||r+1===a||(o=us(s,r+1))<56320||o>57343?t?cs(s,r):n:t?ps(s,r,r+2):o-56320+(n-55296<<10)+65536}},fs={codeAt:ms(!1),charAt:ms(!0)},gs=b,vs=Gn,ys=s.WeakMap,bs=gs(ys)&&/native code/.test(vs(ys)),ws=Pt.exports,_s=Kt,xs=ws("keys"),ks=function(t){return xs[t]||(xs[t]=_s(t))},Ds={},Cs=bs,Ss=s,Ts=y,Es=X,Ms=pi,Os=Vt,Is=jt,As=ks,Ps=Ds,Ns="Object already initialized",Fs=Ss.TypeError,Rs=Ss.WeakMap;if(Cs||Is.state){var Ls=Is.state||(Is.state=new Rs),js=Ts(Ls.get),Ys=Ts(Ls.has),Hs=Ts(Ls.set);qo=function(t,e){if(Ys(Ls,t))throw new Fs(Ns);return e.facade=t,Hs(Ls,t,e),e},Xo=function(t){return js(Ls,t)||{}},Ko=function(t){return Ys(Ls,t)}}else{var zs=As("state");Ps[zs]=!0,qo=function(t,e){if(Os(t,zs))throw new Fs(Ns);return e.facade=t,Ms(t,zs,e),e},Xo=function(t){return Os(t,zs)?t[zs]:{}},Ko=function(t){return Os(t,zs)}}var Bs={set:qo,get:Xo,has:Ko,enforce:function(t){return Ko(t)?Xo(t):qo(t,{})},getterFor:function(t){return function(e){var i;if(!Es(e)||(i=Xo(e)).type!==t)throw Fs("Incompatible receiver, "+t+" required");return i}}},Ws=_,Gs=Vt,Vs=Function.prototype,Us=Ws&&Object.getOwnPropertyDescriptor,$s=Gs(Vs,"name"),qs={EXISTS:$s,PROPER:$s&&"something"===function(){}.name,CONFIGURABLE:$s&&(!Ws||Ws&&Us(Vs,"name").configurable)},Xs={},Ks=rn,Zs=Math.max,Qs=Math.min,Js=function(t,e){var i=Ks(t);return i<0?Zs(i+e,0):Qs(i,e)},tr=$,er=Js,ir=dn,nr=function(t){return function(e,i,n){var o,s=tr(e),r=ir(s),a=er(n,r);if(t&&i!=i){for(;r>a;)if((o=s[a++])!=o)return!0}else for(;r>a;a++)if((t||a in s)&&s[a]===i)return t||a||0;return!t&&-1}},or={includes:nr(!0),indexOf:nr(!1)},sr=Vt,rr=$,ar=or.indexOf,lr=Ds,hr=y([].push),dr=function(t,e){var i,n=rr(t),o=0,s=[];for(i in n)!sr(lr,i)&&sr(n,i)&&hr(s,i);for(;e.length>o;)sr(n,i=e[o++])&&(~ar(s,i)||hr(s,i));return s},cr=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],ur=dr,pr=cr,mr=Object.keys||function(t){return ur(t,pr)},fr=_,gr=qe,vr=$e,yr=Je,br=$,wr=mr;Xs.f=fr&&!gr?Object.defineProperties:function(t,e){yr(t);for(var i,n=br(e),o=wr(e),s=o.length,r=0;s>r;)vr.f(t,i=o[r++],n[i]);return t};var _r,xr=et("document","documentElement"),kr=Je,Dr=Xs,Cr=cr,Sr=Ds,Tr=xr,Er=xe,Mr=ks("IE_PROTO"),Or=function(){},Ir=function(t){return"<script>"+t+"<\/script>"},Ar=function(t){t.write(Ir("")),t.close();var e=t.parentWindow.Object;return t=null,e},Pr=function(){try{_r=new ActiveXObject("htmlfile")}catch(t){}var t,e;Pr="undefined"!=typeof document?document.domain&&_r?Ar(_r):((e=Er("iframe")).style.display="none",Tr.appendChild(e),e.src=String("javascript:"),(t=e.contentWindow.document).open(),t.write(Ir("document.F=Object")),t.close(),t.F):Ar(_r);for(var i=Cr.length;i--;)delete Pr.prototype[Cr[i]];return Pr()};Sr[Mr]=!0;var Nr,Fr,Rr,Lr=Object.create||function(t,e){var i;return null!==t?(Or.prototype=kr(t),i=new Or,Or.prototype=null,i[Mr]=t):i=Pr(),void 0===e?i:Dr.f(i,e)},jr=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})),Yr=s,Hr=Vt,zr=b,Br=Bt,Wr=jr,Gr=ks("IE_PROTO"),Vr=Yr.Object,Ur=Vr.prototype,$r=Wr?Vr.getPrototypeOf:function(t){var e=Br(t);if(Hr(e,Gr))return e[Gr];var i=e.constructor;return zr(i)&&e instanceof i?i.prototype:e instanceof Vr?Ur:null},qr=pi,Xr=function(t,e,i,n){n&&n.enumerable?t[e]=i:qr(t,e,i)},Kr=r,Zr=b,Qr=Lr,Jr=$r,ta=Xr,ea=ae("iterator"),ia=!1;[].keys&&("next"in(Rr=[].keys())?(Fr=Jr(Jr(Rr)))!==Object.prototype&&(Nr=Fr):ia=!0);var na=null==Nr||Kr((function(){var t={};return Nr[ea].call(t)!==t}));Zr((Nr=na?{}:Qr(Nr))[ea])||ta(Nr,ea,(function(){return this}));var oa={IteratorPrototype:Nr,BUGGY_SAFARI_ITERATORS:ia},sa=Hn,ra=An?{}.toString:function(){return"[object "+sa(this)+"]"},aa=An,la=$e.f,ha=pi,da=Vt,ca=ra,ua=ae("toStringTag"),pa=function(t,e,i,n){if(t){var o=i?t:t.prototype;da(o,ua)||la(o,ua,{configurable:!0,value:e}),n&&!aa&&ha(o,"toString",ca)}},ma={},fa=oa.IteratorPrototype,ga=Lr,va=I,ya=pa,ba=ma,wa=function(){return this},_a=s,xa=b,ka=_a.String,Da=_a.TypeError,Ca=y,Sa=Je,Ta=function(t){if("object"==typeof t||xa(t))return t;throw Da("Can't set "+ka(t)+" as a prototype")},Ea=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{(t=Ca(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(i,[]),e=i instanceof Array}catch(t){}return function(i,n){return Sa(i),Ta(n),e?t(i,n):i.__proto__=n,i}}():void 0),Ma=Ci,Oa=D,Ia=function(t,e,i,n){var o=e+" Iterator";return t.prototype=ga(fa,{next:va(+!n,i)}),ya(t,o,!1,!0),ba[o]=wa,t},Aa=$r,Pa=pa,Na=Xr,Fa=ma,Ra=qs.PROPER,La=oa.BUGGY_SAFARI_ITERATORS,ja=ae("iterator"),Ya="keys",Ha="values",za="entries",Ba=function(){return this},Wa=function(t,e,i,n,o,s,r){Ia(i,e,n);var a,l,h,d=function(t){if(t===o&&f)return f;if(!La&&t in p)return p[t];switch(t){case Ya:case Ha:case za:return function(){return new i(this,t)}}return function(){return new i(this)}},c=e+" Iterator",u=!1,p=t.prototype,m=p[ja]||p["@@iterator"]||o&&p[o],f=!La&&m||d(o),g="Array"==e&&p.entries||m;if(g&&(a=Aa(g.call(new t)))!==Object.prototype&&a.next&&(Pa(a,c,!0,!0),Fa[c]=Ba),Ra&&o==Ha&&m&&m.name!==Ha&&(u=!0,f=function(){return Oa(m,this)}),o)if(l={values:d(Ha),keys:s?f:d(Ya),entries:d(za)},r)for(h in l)(La||u||!(h in p))&&Na(p,h,l[h]);else Ma({target:e,proto:!0,forced:La||u},l);return r&&p[ja]!==f&&Na(p,ja,f,{name:o}),Fa[e]=f,l},Ga=fs.charAt,Va=rs,Ua=Bs,$a=Wa,qa="String Iterator",Xa=Ua.set,Ka=Ua.getterFor(qa);$a(String,"String",(function(t){Xa(this,{type:qa,string:Va(t),index:0})}),(function(){var t,e=Ka(this),i=e.string,n=e.index;return n>=i.length?{value:void 0,done:!0}:(t=Ga(i,n),e.index+=t.length,{value:t,done:!1})}));var Za=D,Qa=Je,Ja=Et,tl=function(t,e,i){var n,o;Qa(t);try{if(!(n=Ja(t,"return"))){if("throw"===e)throw i;return i}n=Za(n,t)}catch(t){o=!0,n=t}if("throw"===e)throw i;if(o)throw n;return Qa(n),i},el=Je,il=tl,nl=ma,ol=ae("iterator"),sl=Array.prototype,rl=function(t){return void 0!==t&&(nl.Array===t||sl[ol]===t)},al=ye,ll=$e,hl=I,dl=function(t,e,i){var n=al(e);n in t?ll.f(t,n,hl(0,i)):t[n]=i},cl=Hn,ul=Et,pl=ma,ml=ae("iterator"),fl=function(t){if(null!=t)return ul(t,ml)||ul(t,"@@iterator")||pl[cl(t)]},gl=D,vl=St,yl=Je,bl=xt,wl=fl,_l=s.TypeError,xl=function(t,e){var i=arguments.length<2?wl(t):e;if(vl(i))return yl(gl(i,t));throw _l(bl(t)+" is not iterable")},kl=Ue,Dl=D,Cl=Bt,Sl=function(t,e,i,n){try{return n?e(el(i)[0],i[1]):e(i)}catch(e){il(t,"throw",e)}},Tl=rl,El=oo,Ml=dn,Ol=dl,Il=xl,Al=fl,Pl=s.Array,Nl=ae("iterator"),Fl=!1;try{var Rl=0,Ll={next:function(){return{done:!!Rl++}},return:function(){Fl=!0}};Ll[Nl]=function(){return this},Array.from(Ll,(function(){throw 2}))}catch(t){}var jl=function(t){var e=Cl(t),i=El(this),n=arguments.length,o=n>1?arguments[1]:void 0,s=void 0!==o;s&&(o=kl(o,n>2?arguments[2]:void 0));var r,a,l,h,d,c,u=Al(e),p=0;if(!u||this==Pl&&Tl(u))for(r=Ml(e),a=i?new this(r):Pl(r);r>p;p++)c=s?o(e[p],p):e[p],Ol(a,p,c);else for(d=(h=Il(e,u)).next,a=i?new this:[];!(l=Dl(d,h)).done;p++)c=s?Sl(h,o,[l.value,p],!0):l.value,Ol(a,p,c);return a.length=p,a},Yl=function(t,e){if(!e&&!Fl)return!1;var i=!1;try{var n={};n[Nl]=function(){return{next:function(){return{done:i=!0}}}},t(n)}catch(t){}return i};Ci({target:"Array",stat:!0,forced:!Yl((function(t){Array.from(t)}))},{from:jl});var Hl=K.Array.from,zl=Hl,Bl=$,Wl=ma,Gl=Bs;$e.f;var Vl=Wa,Ul="Array Iterator",$l=Gl.set,ql=Gl.getterFor(Ul);Vl(Array,"Array",(function(t,e){$l(this,{type:Ul,target:Bl(t),index:0,kind:e})}),(function(){var t=ql(this),e=t.target,i=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==i?{value:n,done:!1}:"values"==i?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}}),"values"),Wl.Arguments=Wl.Array;var Xl=fl,Kl={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0},Zl=s,Ql=Hn,Jl=pi,th=ma,eh=ae("toStringTag");for(var ih in Kl){var nh=Zl[ih],oh=nh&&nh.prototype;oh&&Ql(oh)!==eh&&Jl(oh,eh,ih),th[ih]=th.Array}var sh=Xl,rh={},ah=dr,lh=cr.concat("length","prototype");rh.f=Object.getOwnPropertyNames||function(t){return ah(t,lh)};var hh={},dh=Js,ch=dn,uh=dl,ph=s.Array,mh=Math.max,fh=function(t,e,i){for(var n=ch(t),o=dh(e,n),s=dh(void 0===i?n:i,n),r=ph(mh(s-o,0)),a=0;o<s;o++,a++)uh(r,a,t[o]);return r.length=a,r},gh=F,vh=$,yh=rh.f,bh=fh,wh="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[];hh.f=function(t){return wh&&"Window"==gh(t)?function(t){try{return yh(t)}catch(t){return bh(wh)}}(t):yh(vh(t))};var _h={};_h.f=Object.getOwnPropertySymbols;var xh={},kh=ae;xh.f=kh;var Dh=K,Ch=Vt,Sh=xh,Th=$e.f,Eh=function(t){var e=Dh.Symbol||(Dh.Symbol={});Ch(e,t)||Th(e,t,{value:Sh.f(t)})},Mh=Ci,Oh=s,Ih=et,Ah=u,Ph=D,Nh=y,Fh=_,Rh=pt,Lh=r,jh=Vt,Yh=On,Hh=b,zh=X,Bh=it,Wh=wt,Gh=Je,Vh=Bt,Uh=$,$h=ye,qh=rs,Xh=I,Kh=Lr,Zh=mr,Qh=rh,Jh=hh,td=_h,ed=w,id=$e,nd=Xs,od=C,sd=Ri,rd=Xr,ad=Pt.exports,ld=Ds,hd=Kt,dd=ae,cd=xh,ud=Eh,pd=pa,md=Bs,fd=_o.forEach,gd=ks("hidden"),vd="Symbol",yd=dd("toPrimitive"),bd=md.set,wd=md.getterFor(vd),_d=Object.prototype,xd=Oh.Symbol,kd=xd&&xd.prototype,Dd=Oh.TypeError,Cd=Oh.QObject,Sd=Ih("JSON","stringify"),Td=ed.f,Ed=id.f,Md=Jh.f,Od=od.f,Id=Nh([].push),Ad=ad("symbols"),Pd=ad("op-symbols"),Nd=ad("string-to-symbol-registry"),Fd=ad("symbol-to-string-registry"),Rd=ad("wks"),Ld=!Cd||!Cd.prototype||!Cd.prototype.findChild,jd=Fh&&Lh((function(){return 7!=Kh(Ed({},"a",{get:function(){return Ed(this,"a",{value:7}).a}})).a}))?function(t,e,i){var n=Td(_d,e);n&&delete _d[e],Ed(t,e,i),n&&t!==_d&&Ed(_d,e,n)}:Ed,Yd=function(t,e){var i=Ad[t]=Kh(kd);return bd(i,{type:vd,tag:t,description:e}),Fh||(i.description=e),i},Hd=function(t,e,i){t===_d&&Hd(Pd,e,i),Gh(t);var n=$h(e);return Gh(i),jh(Ad,n)?(i.enumerable?(jh(t,gd)&&t[gd][n]&&(t[gd][n]=!1),i=Kh(i,{enumerable:Xh(0,!1)})):(jh(t,gd)||Ed(t,gd,Xh(1,{})),t[gd][n]=!0),jd(t,n,i)):Ed(t,n,i)},zd=function(t,e){Gh(t);var i=Uh(e),n=Zh(i).concat(Vd(i));return fd(n,(function(e){Fh&&!Ph(Bd,i,e)||Hd(t,e,i[e])})),t},Bd=function(t){var e=$h(t),i=Ph(Od,this,e);return!(this===_d&&jh(Ad,e)&&!jh(Pd,e))&&(!(i||!jh(this,e)||!jh(Ad,e)||jh(this,gd)&&this[gd][e])||i)},Wd=function(t,e){var i=Uh(t),n=$h(e);if(i!==_d||!jh(Ad,n)||jh(Pd,n)){var o=Td(i,n);return!o||!jh(Ad,n)||jh(i,gd)&&i[gd][n]||(o.enumerable=!0),o}},Gd=function(t){var e=Md(Uh(t)),i=[];return fd(e,(function(t){jh(Ad,t)||jh(ld,t)||Id(i,t)})),i},Vd=function(t){var e=t===_d,i=Md(e?Pd:Uh(t)),n=[];return fd(i,(function(t){!jh(Ad,t)||e&&!jh(_d,t)||Id(n,Ad[t])})),n};if(Rh||(xd=function(){if(Bh(kd,this))throw Dd("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?qh(arguments[0]):void 0,e=hd(t),i=function(t){this===_d&&Ph(i,Pd,t),jh(this,gd)&&jh(this[gd],e)&&(this[gd][e]=!1),jd(this,e,Xh(1,t))};return Fh&&Ld&&jd(_d,e,{configurable:!0,set:i}),Yd(e,t)},rd(kd=xd.prototype,"toString",(function(){return wd(this).tag})),rd(xd,"withoutSetter",(function(t){return Yd(hd(t),t)})),od.f=Bd,id.f=Hd,nd.f=zd,ed.f=Wd,Qh.f=Jh.f=Gd,td.f=Vd,cd.f=function(t){return Yd(dd(t),t)},Fh&&Ed(kd,"description",{configurable:!0,get:function(){return wd(this).description}})),Mh({global:!0,wrap:!0,forced:!Rh,sham:!Rh},{Symbol:xd}),fd(Zh(Rd),(function(t){ud(t)})),Mh({target:vd,stat:!0,forced:!Rh},{for:function(t){var e=qh(t);if(jh(Nd,e))return Nd[e];var i=xd(e);return Nd[e]=i,Fd[i]=e,i},keyFor:function(t){if(!Wh(t))throw Dd(t+" is not a symbol");if(jh(Fd,t))return Fd[t]},useSetter:function(){Ld=!0},useSimple:function(){Ld=!1}}),Mh({target:"Object",stat:!0,forced:!Rh,sham:!Fh},{create:function(t,e){return void 0===e?Kh(t):zd(Kh(t),e)},defineProperty:Hd,defineProperties:zd,getOwnPropertyDescriptor:Wd}),Mh({target:"Object",stat:!0,forced:!Rh},{getOwnPropertyNames:Gd,getOwnPropertySymbols:Vd}),Mh({target:"Object",stat:!0,forced:Lh((function(){td.f(1)}))},{getOwnPropertySymbols:function(t){return td.f(Vh(t))}}),Sd){var Ud=!Rh||Lh((function(){var t=xd();return"[null]"!=Sd([t])||"{}"!=Sd({a:t})||"{}"!=Sd(Object(t))}));Mh({target:"JSON",stat:!0,forced:Ud},{stringify:function(t,e,i){var n=sd(arguments),o=e;if((zh(e)||void 0!==t)&&!Wh(t))return Yh(e)||(e=function(t,e){if(Hh(o)&&(e=Ph(o,this,t,e)),!Wh(e))return e}),n[1]=e,Ah(Sd,null,n)}})}if(!kd[yd]){var $d=kd.valueOf;rd(kd,yd,(function(t){return Ph($d,this)}))}pd(xd,vd),ld[gd]=!0;var qd=K.Object.getOwnPropertySymbols,Xd={exports:{}},Kd=Ci,Zd=r,Qd=$,Jd=w.f,tc=_,ec=Zd((function(){Jd(1)}));Kd({target:"Object",stat:!0,forced:!tc||ec,sham:!tc},{getOwnPropertyDescriptor:function(t,e){return Jd(Qd(t),e)}});var ic=K.Object,nc=Xd.exports=function(t,e){return ic.getOwnPropertyDescriptor(t,e)};ic.getOwnPropertyDescriptor.sham&&(nc.sham=!0);var oc=Xd.exports,sc=et,rc=rh,ac=_h,lc=Je,hc=y([].concat),dc=sc("Reflect","ownKeys")||function(t){var e=rc.f(lc(t)),i=ac.f;return i?hc(e,i(t)):e},cc=dc,uc=$,pc=w,mc=dl;Ci({target:"Object",stat:!0,sham:!_},{getOwnPropertyDescriptors:function(t){for(var e,i,n=uc(t),o=pc.f,s=cc(n),r={},a=0;s.length>a;)void 0!==(i=o(n,e=s[a++]))&&mc(r,e,i);return r}});var fc=K.Object.getOwnPropertyDescriptors,gc={exports:{}},vc=Ci,yc=_,bc=Xs.f;vc({target:"Object",stat:!0,forced:Object.defineProperties!==bc,sham:!yc},{defineProperties:bc});var wc=K.Object,_c=gc.exports=function(t,e){return wc.defineProperties(t,e)};wc.defineProperties.sham&&(_c.sham=!0);var xc=gc.exports,kc=Ii;Ci({target:"Array",stat:!0},{isArray:On});var Dc=K.Array.isArray,Cc=Dc,Sc=Ci,Tc=s,Ec=r,Mc=On,Oc=X,Ic=Bt,Ac=dn,Pc=dl,Nc=po,Fc=Co,Rc=dt,Lc=ae("isConcatSpreadable"),jc=9007199254740991,Yc="Maximum allowed index exceeded",Hc=Tc.TypeError,zc=Rc>=51||!Ec((function(){var t=[];return t[Lc]=!1,t.concat()[0]!==t})),Bc=Fc("concat"),Wc=function(t){if(!Oc(t))return!1;var e=t[Lc];return void 0!==e?!!e:Mc(t)};Sc({target:"Array",proto:!0,forced:!zc||!Bc},{concat:function(t){var e,i,n,o,s,r=Ic(this),a=Nc(r,0),l=0;for(e=-1,n=arguments.length;e<n;e++)if(Wc(s=-1===e?r:arguments[e])){if(l+(o=Ac(s))>jc)throw Hc(Yc);for(i=0;i<o;i++,l++)i in s&&Pc(a,l,s[i])}else{if(l>=jc)throw Hc(Yc);Pc(a,l++,s)}return a.length=l,a}}),Eh("asyncIterator"),Eh("hasInstance"),Eh("isConcatSpreadable"),Eh("iterator"),Eh("match"),Eh("matchAll"),Eh("replace"),Eh("search"),Eh("species"),Eh("split"),Eh("toPrimitive"),Eh("toStringTag"),Eh("unscopables"),pa(s.JSON,"JSON",!0);var Gc=K.Symbol,Vc=Gc;Eh("asyncDispose"),Eh("dispose"),Eh("matcher"),Eh("metadata"),Eh("observable"),Eh("patternMatch"),Eh("replaceAll");var Uc=Vc,$c=Ci,qc=s,Xc=On,Kc=oo,Zc=X,Qc=Js,Jc=dn,tu=$,eu=dl,iu=ae,nu=Ri,ou=Co("slice"),su=iu("species"),ru=qc.Array,au=Math.max;$c({target:"Array",proto:!0,forced:!ou},{slice:function(t,e){var i,n,o,s=tu(this),r=Jc(s),a=Qc(t,r),l=Qc(void 0===e?r:e,r);if(Xc(s)&&(i=s.constructor,(Kc(i)&&(i===ru||Xc(i.prototype))||Zc(i)&&null===(i=i[su]))&&(i=void 0),i===ru||void 0===i))return nu(s,a,l);for(n=new(void 0===i?ru:i)(au(l-a,0)),o=0;a<l;a++,o++)a in s&&eu(n,o,s[a]);return n.length=o,n}});var lu=Zi("Array").slice,hu=it,du=lu,cu=Array.prototype,uu=function(t){var e=t.slice;return t===cu||hu(cu,t)&&e===cu.slice?du:e},pu=uu,mu=Hl;function fu(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function gu(t,e){var i;if(t){if("string"==typeof t)return fu(t,e);var n=pu(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?mu(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?fu(t,e):void 0}}function vu(t,e){return function(t){if(Cc(t))return t}(t)||function(t,e){var i=null==t?null:void 0!==Uc&&sh(t)||t["@@iterator"];if(null!=i){var n,o,s=[],r=!0,a=!1;try{for(i=i.call(t);!(r=(n=i.next()).done)&&(s.push(n.value),!e||s.length!==e);r=!0);}catch(t){a=!0,o=t}finally{try{r||null==i.return||i.return()}finally{if(a)throw o}}return s}}(t,e)||gu(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var yu=xh.f("iterator"),bu=yu;function wu(t){return wu="function"==typeof Uc&&"symbol"==typeof bu?function(t){return typeof t}:function(t){return t&&"function"==typeof Uc&&t.constructor===Uc&&t!==Uc.prototype?"symbol":typeof t},wu(t)}function _u(t){return function(t){if(Cc(t))return fu(t)}(t)||function(t){if(void 0!==Uc&&null!=sh(t)||null!=t["@@iterator"])return mu(t)}(t)||gu(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}var xu=Gc,ku=Zi("Array").concat,Du=it,Cu=ku,Su=Array.prototype,Tu=function(t){var e=t.concat;return t===Su||Du(Su,t)&&e===Su.concat?Cu:e},Eu=uu;Ci({target:"Reflect",stat:!0},{ownKeys:dc});var Mu=K.Reflect.ownKeys,Ou=Dc,Iu=Bt,Au=mr;Ci({target:"Object",stat:!0,forced:r((function(){Au(1)}))},{keys:function(t){return Au(Iu(t))}});var Pu=K.Object.keys,Nu=Ci,Fu=y,Ru=s.Date,Lu=Fu(Ru.prototype.getTime);Nu({target:"Date",stat:!0},{now:function(){return Lu(new Ru)}}),K.Date.now;var ju=_o.forEach,Yu=bn("forEach")?[].forEach:function(t){return ju(this,t,arguments.length>1?arguments[1]:void 0)};Ci({target:"Array",proto:!0,forced:[].forEach!=Yu},{forEach:Yu});var Hu=Zi("Array").forEach,zu=Hn,Bu=Vt,Wu=it,Gu=Hu,Vu=Array.prototype,Uu={DOMTokenList:!0,NodeList:!0},$u=function(t){var e=t.forEach;return t===Vu||Wu(Vu,t)&&e===Vu.forEach||Bu(Uu,zu(t))?Gu:e},qu=Ci,Xu=On,Ku=y([].reverse),Zu=[1,2];qu({target:"Array",proto:!0,forced:String(Zu)===String(Zu.reverse())},{reverse:function(){return Xu(this)&&(this.length=this.length),Ku(this)}});var Qu=Zi("Array").reverse,Ju=it,tp=Qu,ep=Array.prototype,ip=function(t){var e=t.reverse;return t===ep||Ju(ep,t)&&e===ep.reverse?tp:e},np=Ci,op=s,sp=Js,rp=rn,ap=dn,lp=Bt,hp=po,dp=dl,cp=Co("splice"),up=op.TypeError,pp=Math.max,mp=Math.min,fp=9007199254740991,gp="Maximum allowed length exceeded";np({target:"Array",proto:!0,forced:!cp},{splice:function(t,e){var i,n,o,s,r,a,l=lp(this),h=ap(l),d=sp(t,h),c=arguments.length;if(0===c?i=n=0:1===c?(i=0,n=h-d):(i=c-2,n=mp(pp(rp(e),0),h-d)),h+i-n>fp)throw up(gp);for(o=hp(l,n),s=0;s<n;s++)(r=d+s)in l&&dp(o,s,l[r]);if(o.length=n,i<n){for(s=d;s<h-n;s++)a=s+i,(r=s+n)in l?l[a]=l[r]:delete l[a];for(s=h;s>h-n+i;s--)delete l[s-1]}else if(i>n)for(s=h-n;s>d;s--)a=s+i-1,(r=s+n-1)in l?l[a]=l[r]:delete l[a];for(s=0;s<i;s++)l[s+d]=arguments[s+2];return l.length=h-n+i,o}});var vp=Zi("Array").splice,yp=it,bp=vp,wp=Array.prototype,_p=function(t){var e=t.splice;return t===wp||yp(wp,t)&&e===wp.splice?bp:e},xp=_,kp=y,Dp=D,Cp=r,Sp=mr,Tp=_h,Ep=C,Mp=Bt,Op=z,Ip=Object.assign,Ap=Object.defineProperty,Pp=kp([].concat),Np=!Ip||Cp((function(){if(xp&&1!==Ip({b:1},Ip(Ap({},"a",{enumerable:!0,get:function(){Ap(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol(),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach((function(t){e[t]=t})),7!=Ip({},t)[i]||Sp(Ip({},e)).join("")!=n}))?function(t,e){for(var i=Mp(t),n=arguments.length,o=1,s=Tp.f,r=Ep.f;n>o;)for(var a,l=Op(arguments[o++]),h=s?Pp(Sp(l),s(l)):Sp(l),d=h.length,c=0;d>c;)a=h[c++],xp&&!Dp(r,l,a)||(i[a]=l[a]);return i}:Ip,Fp=Np;Ci({target:"Object",stat:!0,forced:Object.assign!==Fp},{assign:Fp});var Rp=K.Object.assign,Lp=or.includes;Ci({target:"Array",proto:!0},{includes:function(t){return Lp(this,t,arguments.length>1?arguments[1]:void 0)}}),Zi("Array").includes;var jp=X,Yp=F,Hp=ae("match"),zp=function(t){var e;return jp(t)&&(void 0!==(e=t[Hp])?!!e:"RegExp"==Yp(t))},Bp=s.TypeError,Wp=ae("match"),Gp=Ci,Vp=function(t){if(zp(t))throw Bp("The method doesn't accept regular expressions");return t},Up=G,$p=rs,qp=function(t){var e=/./;try{"/./"[t](e)}catch(i){try{return e[Wp]=!1,"/./"[t](e)}catch(t){}}return!1},Xp=y("".indexOf);Gp({target:"String",proto:!0,forced:!qp("includes")},{includes:function(t){return!!~Xp($p(Up(this)),$p(Vp(t)),arguments.length>1?arguments[1]:void 0)}}),Zi("String").includes;var Kp=Bt,Zp=$r,Qp=jr;Ci({target:"Object",stat:!0,forced:r((function(){Zp(1)})),sham:!Qp},{getPrototypeOf:function(t){return Zp(Kp(t))}});var Jp=K.Object.getPrototypeOf,tm=_,em=y,im=mr,nm=$,om=em(C.f),sm=em([].push),rm=function(t){return function(e){for(var i,n=nm(e),o=im(n),s=o.length,r=0,a=[];s>r;)i=o[r++],tm&&!om(n,i)||sm(a,t?[i,n[i]]:n[i]);return a}},am=(rm(!0),rm(!1));Ci({target:"Object",stat:!0},{values:function(t){return am(t)}}),K.Object.values;var lm="\t\n\v\f\r    \u2028\u2029\ufeff",hm=G,dm=rs,cm=y("".replace),um="[\t\n\v\f\r    \u2028\u2029\ufeff]",pm=RegExp("^"+um+um+"*"),mm=RegExp(um+um+"*$"),fm=function(t){return function(e){var i=dm(hm(e));return 1&t&&(i=cm(i,pm,"")),2&t&&(i=cm(i,mm,"")),i}},gm={start:fm(1),end:fm(2),trim:fm(3)},vm=s,ym=r,bm=y,wm=rs,_m=gm.trim,xm=lm,km=vm.parseInt,Dm=vm.Symbol,Cm=Dm&&Dm.iterator,Sm=/^[+-]?0x/i,Tm=bm(Sm.exec),Em=8!==km(xm+"08")||22!==km(xm+"0x16")||Cm&&!ym((function(){km(Object(Cm))}))?function(t,e){var i=_m(wm(t));return km(i,e>>>0||(Tm(Sm,i)?16:10))}:km;Ci({global:!0,forced:parseInt!=Em},{parseInt:Em});var Mm=Ci,Om=or.indexOf,Im=bn,Am=y([].indexOf),Pm=!!Am&&1/Am([1],1,-0)<0,Nm=Im("indexOf");Mm({target:"Array",proto:!0,forced:Pm||!Nm},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return Pm?Am(this,t,e)||0:Om(this,t,e)}}),Zi("Array").indexOf;var Fm=qs.PROPER,Rm=r,Lm=lm,jm=gm.trim;Ci({target:"String",proto:!0,forced:function(t){return Rm((function(){return!!Lm[t]()||"…"!=="…"[t]()||Fm&&Lm[t].name!==t}))}("trim")},{trim:function(){return jm(this)}}),Zi("String").trim,Ci({target:"Object",stat:!0,sham:!_},{create:Lr});var Ym=K.Object,Hm=function(t,e){return Ym.create(t,e)},zm=Hm,Bm=Ci,Wm=et,Gm=u,Vm=y,Um=r,$m=s.Array,qm=Wm("JSON","stringify"),Xm=Vm(/./.exec),Km=Vm("".charAt),Zm=Vm("".charCodeAt),Qm=Vm("".replace),Jm=Vm(1..toString),tf=/[\uD800-\uDFFF]/g,ef=/^[\uD800-\uDBFF]$/,nf=/^[\uDC00-\uDFFF]$/,of=function(t,e,i){var n=Km(i,e-1),o=Km(i,e+1);return Xm(ef,t)&&!Xm(nf,o)||Xm(nf,t)&&!Xm(ef,n)?"\\u"+Jm(Zm(t,0),16):t},sf=Um((function(){return'"\\udf06\\ud834"'!==qm("\udf06\ud834")||'"\\udead"'!==qm("\udead")}));qm&&Bm({target:"JSON",stat:!0,forced:sf},{stringify:function(t,e,i){for(var n=0,o=arguments.length,s=$m(o);n<o;n++)s[n]=arguments[n];var r=Gm(qm,null,s);return"string"==typeof r?Qm(r,tf,of):r}});var rf=K,af=u;rf.JSON||(rf.JSON={stringify:JSON.stringify});var lf=function(t,e,i){return af(rf.JSON.stringify,null,arguments)},hf=lf,df=s.TypeError,cf=Ci,uf=s,pf=u,mf=b,ff=Ri,gf=function(t,e){if(t<e)throw df("Not enough arguments");return t},vf=/MSIE .\./.test(nt),yf=uf.Function,bf=function(t){return function(e,i){var n=gf(arguments.length,1)>2,o=mf(e)?e:yf(e),s=n?ff(arguments,2):void 0;return t(n?function(){pf(o,this,s)}:o,i)}};cf({global:!0,bind:!0,forced:vf},{setTimeout:bf(uf.setTimeout),setInterval:bf(uf.setInterval)});var wf=K.setTimeout,_f=Bt,xf=Js,kf=dn,Df=function(t){for(var e=_f(this),i=kf(e),n=arguments.length,o=xf(n>1?arguments[1]:void 0,i),s=n>2?arguments[2]:void 0,r=void 0===s?i:xf(s,i);r>o;)e[o++]=t;return e};Ci({target:"Array",proto:!0},{fill:Df}),Zi("Array").fill;var Cf={exports:{}};!function(t){function e(t){if(t)return function(t){for(var i in e.prototype)t[i]=e.prototype[i];return t}(t)}t.exports=e,e.prototype.on=e.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},e.prototype.once=function(t,e){function i(){this.off(t,i),e.apply(this,arguments)}return i.fn=e,this.on(t,i),this},e.prototype.off=e.prototype.removeListener=e.prototype.removeAllListeners=e.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var i,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((i=n[o])===e||i.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},e.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),i=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(i){n=0;for(var o=(i=i.slice(0)).length;n<o;++n)i[n].apply(this,e)}return this},e.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},e.prototype.hasListeners=function(t){return!!this.listeners(t).length}}(Cf);var Sf,Tf=Cf.exports;
/*! Hammer.JS - v2.0.17-rc - 2019-12-16
* http://naver.github.io/egjs
*
* Forked By Naver egjs
* Copyright (c) hammerjs
* Licensed under the MIT license */function Ef(){return Ef=Object.assign||function(t){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(t[n]=i[n])}return t},Ef.apply(this,arguments)}function Mf(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}function Of(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}Sf="function"!=typeof Object.assign?function(t){if(null==t)throw new TypeError("Cannot convert undefined or null to object");for(var e=Object(t),i=1;i<arguments.length;i++){var n=arguments[i];if(null!=n)for(var o in n)n.hasOwnProperty(o)&&(e[o]=n[o])}return e}:Object.assign;var If,Af=Sf,Pf=["","webkit","Moz","MS","ms","o"],Nf="undefined"==typeof document?{style:{}}:document.createElement("div"),Ff=Math.round,Rf=Math.abs,Lf=Date.now;function jf(t,e){for(var i,n,o=e[0].toUpperCase()+e.slice(1),s=0;s<Pf.length;){if((n=(i=Pf[s])?i+o:e)in t)return n;s++}}If="undefined"==typeof window?{}:window;var Yf=jf(Nf.style,"touchAction"),Hf=void 0!==Yf,zf="compute",Bf="auto",Wf="manipulation",Gf="none",Vf="pan-x",Uf="pan-y",$f=function(){if(!Hf)return!1;var t={},e=If.CSS&&If.CSS.supports;return["auto","manipulation","pan-y","pan-x","pan-x pan-y","none"].forEach((function(i){return t[i]=!e||If.CSS.supports("touch-action",i)})),t}(),qf="ontouchstart"in If,Xf=void 0!==jf(If,"PointerEvent"),Kf=qf&&/mobile|tablet|ip(ad|hone|od)|android/i.test(navigator.userAgent),Zf="touch",Qf="mouse",Jf=16,tg=24,eg=["x","y"],ig=["clientX","clientY"];function ng(t,e,i){var n;if(t)if(t.forEach)t.forEach(e,i);else if(void 0!==t.length)for(n=0;n<t.length;)e.call(i,t[n],n,t),n++;else for(n in t)t.hasOwnProperty(n)&&e.call(i,t[n],n,t)}function og(t,e){return"function"==typeof t?t.apply(e&&e[0]||void 0,e):t}function sg(t,e){return t.indexOf(e)>-1}var rg=function(){function t(t,e){this.manager=t,this.set(e)}var e=t.prototype;return e.set=function(t){t===zf&&(t=this.compute()),Hf&&this.manager.element.style&&$f[t]&&(this.manager.element.style[Yf]=t),this.actions=t.toLowerCase().trim()},e.update=function(){this.set(this.manager.options.touchAction)},e.compute=function(){var t=[];return ng(this.manager.recognizers,(function(e){og(e.options.enable,[e])&&(t=t.concat(e.getTouchAction()))})),function(t){if(sg(t,Gf))return Gf;var e=sg(t,Vf),i=sg(t,Uf);return e&&i?Gf:e||i?e?Vf:Uf:sg(t,Wf)?Wf:Bf}(t.join(" "))},e.preventDefaults=function(t){var e=t.srcEvent,i=t.offsetDirection;if(this.manager.session.prevented)e.preventDefault();else{var n=this.actions,o=sg(n,Gf)&&!$f.none,s=sg(n,Uf)&&!$f["pan-y"],r=sg(n,Vf)&&!$f["pan-x"];if(o){var a=1===t.pointers.length,l=t.distance<2,h=t.deltaTime<250;if(a&&l&&h)return}if(!r||!s)return o||s&&6&i||r&&i&tg?this.preventSrc(e):void 0}},e.preventSrc=function(t){this.manager.session.prevented=!0,t.preventDefault()},t}();function ag(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1}function lg(t){var e=t.length;if(1===e)return{x:Ff(t[0].clientX),y:Ff(t[0].clientY)};for(var i=0,n=0,o=0;o<e;)i+=t[o].clientX,n+=t[o].clientY,o++;return{x:Ff(i/e),y:Ff(n/e)}}function hg(t){for(var e=[],i=0;i<t.pointers.length;)e[i]={clientX:Ff(t.pointers[i].clientX),clientY:Ff(t.pointers[i].clientY)},i++;return{timeStamp:Lf(),pointers:e,center:lg(e),deltaX:t.deltaX,deltaY:t.deltaY}}function dg(t,e,i){i||(i=eg);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return Math.sqrt(n*n+o*o)}function cg(t,e,i){i||(i=eg);var n=e[i[0]]-t[i[0]],o=e[i[1]]-t[i[1]];return 180*Math.atan2(o,n)/Math.PI}function ug(t,e){return t===e?1:Rf(t)>=Rf(e)?t<0?2:4:e<0?8:Jf}function pg(t,e,i){return{x:e/t||0,y:i/t||0}}function mg(t,e){var i=t.session,n=e.pointers,o=n.length;i.firstInput||(i.firstInput=hg(e)),o>1&&!i.firstMultiple?i.firstMultiple=hg(e):1===o&&(i.firstMultiple=!1);var s=i.firstInput,r=i.firstMultiple,a=r?r.center:s.center,l=e.center=lg(n);e.timeStamp=Lf(),e.deltaTime=e.timeStamp-s.timeStamp,e.angle=cg(a,l),e.distance=dg(a,l),function(t,e){var i=e.center,n=t.offsetDelta||{},o=t.prevDelta||{},s=t.prevInput||{};1!==e.eventType&&4!==s.eventType||(o=t.prevDelta={x:s.deltaX||0,y:s.deltaY||0},n=t.offsetDelta={x:i.x,y:i.y}),e.deltaX=o.x+(i.x-n.x),e.deltaY=o.y+(i.y-n.y)}(i,e),e.offsetDirection=ug(e.deltaX,e.deltaY);var h,d,c=pg(e.deltaTime,e.deltaX,e.deltaY);e.overallVelocityX=c.x,e.overallVelocityY=c.y,e.overallVelocity=Rf(c.x)>Rf(c.y)?c.x:c.y,e.scale=r?(h=r.pointers,dg((d=n)[0],d[1],ig)/dg(h[0],h[1],ig)):1,e.rotation=r?function(t,e){return cg(e[1],e[0],ig)+cg(t[1],t[0],ig)}(r.pointers,n):0,e.maxPointers=i.prevInput?e.pointers.length>i.prevInput.maxPointers?e.pointers.length:i.prevInput.maxPointers:e.pointers.length,function(t,e){var i,n,o,s,r=t.lastInterval||e,a=e.timeStamp-r.timeStamp;if(8!==e.eventType&&(a>25||void 0===r.velocity)){var l=e.deltaX-r.deltaX,h=e.deltaY-r.deltaY,d=pg(a,l,h);n=d.x,o=d.y,i=Rf(d.x)>Rf(d.y)?d.x:d.y,s=ug(l,h),t.lastInterval=e}else i=r.velocity,n=r.velocityX,o=r.velocityY,s=r.direction;e.velocity=i,e.velocityX=n,e.velocityY=o,e.direction=s}(i,e);var u,p=t.element,m=e.srcEvent;ag(u=m.composedPath?m.composedPath()[0]:m.path?m.path[0]:m.target,p)&&(p=u),e.target=p}function fg(t,e,i){var n=i.pointers.length,o=i.changedPointers.length,s=1&e&&n-o==0,r=12&e&&n-o==0;i.isFirst=!!s,i.isFinal=!!r,s&&(t.session={}),i.eventType=e,mg(t,i),t.emit("hammer.input",i),t.recognize(i),t.session.prevInput=i}function gg(t){return t.trim().split(/\s+/g)}function vg(t,e,i){ng(gg(e),(function(e){t.addEventListener(e,i,!1)}))}function yg(t,e,i){ng(gg(e),(function(e){t.removeEventListener(e,i,!1)}))}function bg(t){var e=t.ownerDocument||t;return e.defaultView||e.parentWindow||window}var wg=function(){function t(t,e){var i=this;this.manager=t,this.callback=e,this.element=t.element,this.target=t.options.inputTarget,this.domHandler=function(e){og(t.options.enable,[t])&&i.handler(e)},this.init()}var e=t.prototype;return e.handler=function(){},e.init=function(){this.evEl&&vg(this.element,this.evEl,this.domHandler),this.evTarget&&vg(this.target,this.evTarget,this.domHandler),this.evWin&&vg(bg(this.element),this.evWin,this.domHandler)},e.destroy=function(){this.evEl&&yg(this.element,this.evEl,this.domHandler),this.evTarget&&yg(this.target,this.evTarget,this.domHandler),this.evWin&&yg(bg(this.element),this.evWin,this.domHandler)},t}();function _g(t,e,i){if(t.indexOf&&!i)return t.indexOf(e);for(var n=0;n<t.length;){if(i&&t[n][i]==e||!i&&t[n]===e)return n;n++}return-1}var xg={pointerdown:1,pointermove:2,pointerup:4,pointercancel:8,pointerout:8},kg={2:Zf,3:"pen",4:Qf,5:"kinect"},Dg="pointerdown",Cg="pointermove pointerup pointercancel";If.MSPointerEvent&&!If.PointerEvent&&(Dg="MSPointerDown",Cg="MSPointerMove MSPointerUp MSPointerCancel");var Sg=function(t){function e(){var i,n=e.prototype;return n.evEl=Dg,n.evWin=Cg,(i=t.apply(this,arguments)||this).store=i.manager.session.pointerEvents=[],i}return Mf(e,t),e.prototype.handler=function(t){var e=this.store,i=!1,n=t.type.toLowerCase().replace("ms",""),o=xg[n],s=kg[t.pointerType]||t.pointerType,r=s===Zf,a=_g(e,t.pointerId,"pointerId");1&o&&(0===t.button||r)?a<0&&(e.push(t),a=e.length-1):12&o&&(i=!0),a<0||(e[a]=t,this.callback(this.manager,o,{pointers:e,changedPointers:[t],pointerType:s,srcEvent:t}),i&&e.splice(a,1))},e}(wg);function Tg(t){return Array.prototype.slice.call(t,0)}function Eg(t,e,i){for(var n=[],o=[],s=0;s<t.length;){var r=e?t[s][e]:t[s];_g(o,r)<0&&n.push(t[s]),o[s]=r,s++}return i&&(n=e?n.sort((function(t,i){return t[e]>i[e]})):n.sort()),n}var Mg={touchstart:1,touchmove:2,touchend:4,touchcancel:8},Og="touchstart touchmove touchend touchcancel",Ig=function(t){function e(){var i;return e.prototype.evTarget=Og,(i=t.apply(this,arguments)||this).targetIds={},i}return Mf(e,t),e.prototype.handler=function(t){var e=Mg[t.type],i=Ag.call(this,t,e);i&&this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Zf,srcEvent:t})},e}(wg);function Ag(t,e){var i,n,o=Tg(t.touches),s=this.targetIds;if(3&e&&1===o.length)return s[o[0].identifier]=!0,[o,o];var r=Tg(t.changedTouches),a=[],l=this.target;if(n=o.filter((function(t){return ag(t.target,l)})),1===e)for(i=0;i<n.length;)s[n[i].identifier]=!0,i++;for(i=0;i<r.length;)s[r[i].identifier]&&a.push(r[i]),12&e&&delete s[r[i].identifier],i++;return a.length?[Eg(n.concat(a),"identifier",!0),a]:void 0}var Pg={mousedown:1,mousemove:2,mouseup:4},Ng="mousedown",Fg="mousemove mouseup",Rg=function(t){function e(){var i,n=e.prototype;return n.evEl=Ng,n.evWin=Fg,(i=t.apply(this,arguments)||this).pressed=!1,i}return Mf(e,t),e.prototype.handler=function(t){var e=Pg[t.type];1&e&&0===t.button&&(this.pressed=!0),2&e&&1!==t.which&&(e=4),this.pressed&&(4&e&&(this.pressed=!1),this.callback(this.manager,e,{pointers:[t],changedPointers:[t],pointerType:Qf,srcEvent:t}))},e}(wg);function Lg(t){var e=t.changedPointers[0];if(e.identifier===this.primaryTouch){var i={x:e.clientX,y:e.clientY},n=this.lastTouches;this.lastTouches.push(i),setTimeout((function(){var t=n.indexOf(i);t>-1&&n.splice(t,1)}),2500)}}function jg(t,e){1&t?(this.primaryTouch=e.changedPointers[0].identifier,Lg.call(this,e)):12&t&&Lg.call(this,e)}function Yg(t){for(var e=t.srcEvent.clientX,i=t.srcEvent.clientY,n=0;n<this.lastTouches.length;n++){var o=this.lastTouches[n],s=Math.abs(e-o.x),r=Math.abs(i-o.y);if(s<=25&&r<=25)return!0}return!1}var Hg=function(t){function e(e,i){var n;return(n=t.call(this,e,i)||this).handler=function(t,e,i){var o=i.pointerType===Zf,s=i.pointerType===Qf;if(!(s&&i.sourceCapabilities&&i.sourceCapabilities.firesTouchEvents)){if(o)jg.call(Of(Of(n)),e,i);else if(s&&Yg.call(Of(Of(n)),i))return;n.callback(t,e,i)}},n.touch=new Ig(n.manager,n.handler),n.mouse=new Rg(n.manager,n.handler),n.primaryTouch=null,n.lastTouches=[],n}return Mf(e,t),e.prototype.destroy=function(){this.touch.destroy(),this.mouse.destroy()},e}(wg);function zg(t,e,i){return!!Array.isArray(t)&&(ng(t,i[e],i),!0)}var Bg=32,Wg=1;function Gg(t,e){var i=e.manager;return i?i.get(t):t}function Vg(t){return 16&t?"cancel":8&t?"end":4&t?"move":2&t?"start":""}var Ug=function(){function t(t){void 0===t&&(t={}),this.options=Ef({enable:!0},t),this.id=Wg++,this.manager=null,this.state=1,this.simultaneous={},this.requireFail=[]}var e=t.prototype;return e.set=function(t){return Af(this.options,t),this.manager&&this.manager.touchAction.update(),this},e.recognizeWith=function(t){if(zg(t,"recognizeWith",this))return this;var e=this.simultaneous;return e[(t=Gg(t,this)).id]||(e[t.id]=t,t.recognizeWith(this)),this},e.dropRecognizeWith=function(t){return zg(t,"dropRecognizeWith",this)||(t=Gg(t,this),delete this.simultaneous[t.id]),this},e.requireFailure=function(t){if(zg(t,"requireFailure",this))return this;var e=this.requireFail;return-1===_g(e,t=Gg(t,this))&&(e.push(t),t.requireFailure(this)),this},e.dropRequireFailure=function(t){if(zg(t,"dropRequireFailure",this))return this;t=Gg(t,this);var e=_g(this.requireFail,t);return e>-1&&this.requireFail.splice(e,1),this},e.hasRequireFailures=function(){return this.requireFail.length>0},e.canRecognizeWith=function(t){return!!this.simultaneous[t.id]},e.emit=function(t){var e=this,i=this.state;function n(i){e.manager.emit(i,t)}i<8&&n(e.options.event+Vg(i)),n(e.options.event),t.additionalEvent&&n(t.additionalEvent),i>=8&&n(e.options.event+Vg(i))},e.tryEmit=function(t){if(this.canEmit())return this.emit(t);this.state=Bg},e.canEmit=function(){for(var t=0;t<this.requireFail.length;){if(!(33&this.requireFail[t].state))return!1;t++}return!0},e.recognize=function(t){var e=Af({},t);if(!og(this.options.enable,[this,e]))return this.reset(),void(this.state=Bg);56&this.state&&(this.state=1),this.state=this.process(e),30&this.state&&this.tryEmit(e)},e.process=function(t){},e.getTouchAction=function(){},e.reset=function(){},t}(),$g=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Ef({event:"tap",pointers:1,taps:1,interval:300,time:250,threshold:9,posThreshold:10},e))||this).pTime=!1,i.pCenter=!1,i._timer=null,i._input=null,i.count=0,i}Mf(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Wf]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,s=t.deltaTime<i.time;if(this.reset(),1&t.eventType&&0===this.count)return this.failTimeout();if(o&&s&&n){if(4!==t.eventType)return this.failTimeout();var r=!this.pTime||t.timeStamp-this.pTime<i.interval,a=!this.pCenter||dg(this.pCenter,t.center)<i.posThreshold;if(this.pTime=t.timeStamp,this.pCenter=t.center,a&&r?this.count+=1:this.count=1,this._input=t,0==this.count%i.taps)return this.hasRequireFailures()?(this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),i.interval),2):8}return Bg},i.failTimeout=function(){var t=this;return this._timer=setTimeout((function(){t.state=Bg}),this.options.interval),Bg},i.reset=function(){clearTimeout(this._timer)},i.emit=function(){8===this.state&&(this._input.tapCount=this.count,this.manager.emit(this.options.event,this._input))},e}(Ug),qg=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ef({pointers:1},e))||this}Mf(e,t);var i=e.prototype;return i.attrTest=function(t){var e=this.options.pointers;return 0===e||t.pointers.length===e},i.process=function(t){var e=this.state,i=t.eventType,n=6&e,o=this.attrTest(t);return n&&(8&i||!o)?16|e:n||o?4&i?8|e:2&e?4|e:2:Bg},e}(Ug);function Xg(t){return t===Jf?"down":8===t?"up":2===t?"left":4===t?"right":""}var Kg=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Ef({event:"pan",threshold:10,pointers:1,direction:30},e))||this).pX=null,i.pY=null,i}Mf(e,t);var i=e.prototype;return i.getTouchAction=function(){var t=this.options.direction,e=[];return 6&t&&e.push(Uf),t&tg&&e.push(Vf),e},i.directionTest=function(t){var e=this.options,i=!0,n=t.distance,o=t.direction,s=t.deltaX,r=t.deltaY;return o&e.direction||(6&e.direction?(o=0===s?1:s<0?2:4,i=s!==this.pX,n=Math.abs(t.deltaX)):(o=0===r?1:r<0?8:Jf,i=r!==this.pY,n=Math.abs(t.deltaY))),t.direction=o,i&&n>e.threshold&&o&e.direction},i.attrTest=function(t){return qg.prototype.attrTest.call(this,t)&&(2&this.state||!(2&this.state)&&this.directionTest(t))},i.emit=function(e){this.pX=e.deltaX,this.pY=e.deltaY;var i=Xg(e.direction);i&&(e.additionalEvent=this.options.event+i),t.prototype.emit.call(this,e)},e}(qg),Zg=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ef({event:"swipe",threshold:10,velocity:.3,direction:30,pointers:1},e))||this}Mf(e,t);var i=e.prototype;return i.getTouchAction=function(){return Kg.prototype.getTouchAction.call(this)},i.attrTest=function(e){var i,n=this.options.direction;return 30&n?i=e.overallVelocity:6&n?i=e.overallVelocityX:n&tg&&(i=e.overallVelocityY),t.prototype.attrTest.call(this,e)&&n&e.offsetDirection&&e.distance>this.options.threshold&&e.maxPointers===this.options.pointers&&Rf(i)>this.options.velocity&&4&e.eventType},i.emit=function(t){var e=Xg(t.offsetDirection);e&&this.manager.emit(this.options.event+e,t),this.manager.emit(this.options.event,t)},e}(qg),Qg=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ef({event:"pinch",threshold:0,pointers:2},e))||this}Mf(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Gf]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.scale-1)>this.options.threshold||2&this.state)},i.emit=function(e){if(1!==e.scale){var i=e.scale<1?"in":"out";e.additionalEvent=this.options.event+i}t.prototype.emit.call(this,e)},e}(qg),Jg=function(t){function e(e){return void 0===e&&(e={}),t.call(this,Ef({event:"rotate",threshold:0,pointers:2},e))||this}Mf(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Gf]},i.attrTest=function(e){return t.prototype.attrTest.call(this,e)&&(Math.abs(e.rotation)>this.options.threshold||2&this.state)},e}(qg),tv=function(t){function e(e){var i;return void 0===e&&(e={}),(i=t.call(this,Ef({event:"press",pointers:1,time:251,threshold:9},e))||this)._timer=null,i._input=null,i}Mf(e,t);var i=e.prototype;return i.getTouchAction=function(){return[Bf]},i.process=function(t){var e=this,i=this.options,n=t.pointers.length===i.pointers,o=t.distance<i.threshold,s=t.deltaTime>i.time;if(this._input=t,!o||!n||12&t.eventType&&!s)this.reset();else if(1&t.eventType)this.reset(),this._timer=setTimeout((function(){e.state=8,e.tryEmit()}),i.time);else if(4&t.eventType)return 8;return Bg},i.reset=function(){clearTimeout(this._timer)},i.emit=function(t){8===this.state&&(t&&4&t.eventType?this.manager.emit(this.options.event+"up",t):(this._input.timeStamp=Lf(),this.manager.emit(this.options.event,this._input)))},e}(Ug),ev={domEvents:!1,touchAction:zf,enable:!0,inputTarget:null,inputClass:null,cssProps:{userSelect:"none",touchSelect:"none",touchCallout:"none",contentZooming:"none",userDrag:"none",tapHighlightColor:"rgba(0,0,0,0)"}},iv=[[Jg,{enable:!1}],[Qg,{enable:!1},["rotate"]],[Zg,{direction:6}],[Kg,{direction:6},["swipe"]],[$g],[$g,{event:"doubletap",taps:2},["tap"]],[tv]];function nv(t,e){var i,n=t.element;n.style&&(ng(t.options.cssProps,(function(o,s){i=jf(n.style,s),e?(t.oldCssProps[i]=n.style[i],n.style[i]=o):n.style[i]=t.oldCssProps[i]||""})),e||(t.oldCssProps={}))}var ov=function(){function t(t,e){var i,n=this;this.options=Af({},ev,e||{}),this.options.inputTarget=this.options.inputTarget||t,this.handlers={},this.session={},this.recognizers=[],this.oldCssProps={},this.element=t,this.input=new((i=this).options.inputClass||(Xf?Sg:Kf?Ig:qf?Hg:Rg))(i,fg),this.touchAction=new rg(this,this.options.touchAction),nv(this,!0),ng(this.options.recognizers,(function(t){var e=n.add(new t[0](t[1]));t[2]&&e.recognizeWith(t[2]),t[3]&&e.requireFailure(t[3])}),this)}var e=t.prototype;return e.set=function(t){return Af(this.options,t),t.touchAction&&this.touchAction.update(),t.inputTarget&&(this.input.destroy(),this.input.target=t.inputTarget,this.input.init()),this},e.stop=function(t){this.session.stopped=t?2:1},e.recognize=function(t){var e=this.session;if(!e.stopped){var i;this.touchAction.preventDefaults(t);var n=this.recognizers,o=e.curRecognizer;(!o||o&&8&o.state)&&(e.curRecognizer=null,o=null);for(var s=0;s<n.length;)i=n[s],2===e.stopped||o&&i!==o&&!i.canRecognizeWith(o)?i.reset():i.recognize(t),!o&&14&i.state&&(e.curRecognizer=i,o=i),s++}},e.get=function(t){if(t instanceof Ug)return t;for(var e=this.recognizers,i=0;i<e.length;i++)if(e[i].options.event===t)return e[i];return null},e.add=function(t){if(zg(t,"add",this))return this;var e=this.get(t.options.event);return e&&this.remove(e),this.recognizers.push(t),t.manager=this,this.touchAction.update(),t},e.remove=function(t){if(zg(t,"remove",this))return this;var e=this.get(t);if(t){var i=this.recognizers,n=_g(i,e);-1!==n&&(i.splice(n,1),this.touchAction.update())}return this},e.on=function(t,e){if(void 0===t||void 0===e)return this;var i=this.handlers;return ng(gg(t),(function(t){i[t]=i[t]||[],i[t].push(e)})),this},e.off=function(t,e){if(void 0===t)return this;var i=this.handlers;return ng(gg(t),(function(t){e?i[t]&&i[t].splice(_g(i[t],e),1):delete i[t]})),this},e.emit=function(t,e){this.options.domEvents&&function(t,e){var i=document.createEvent("Event");i.initEvent(t,!0,!0),i.gesture=e,e.target.dispatchEvent(i)}(t,e);var i=this.handlers[t]&&this.handlers[t].slice();if(i&&i.length){e.type=t,e.preventDefault=function(){e.srcEvent.preventDefault()};for(var n=0;n<i.length;)i[n](e),n++}},e.destroy=function(){this.element&&nv(this,!1),this.handlers={},this.session={},this.input.destroy(),this.element=null},t}(),sv={touchstart:1,touchmove:2,touchend:4,touchcancel:8},rv="touchstart",av="touchstart touchmove touchend touchcancel",lv=function(t){function e(){var i,n=e.prototype;return n.evTarget=rv,n.evWin=av,(i=t.apply(this,arguments)||this).started=!1,i}return Mf(e,t),e.prototype.handler=function(t){var e=sv[t.type];if(1===e&&(this.started=!0),this.started){var i=hv.call(this,t,e);12&e&&i[0].length-i[1].length==0&&(this.started=!1),this.callback(this.manager,e,{pointers:i[0],changedPointers:i[1],pointerType:Zf,srcEvent:t})}},e}(wg);function hv(t,e){var i=Tg(t.touches),n=Tg(t.changedTouches);return 12&e&&(i=Eg(i.concat(n),"identifier",!0)),[i,n]}function dv(t,e,i){var n="DEPRECATED METHOD: "+e+"\n"+i+" AT \n";return function(){var e=new Error("get-stack-trace"),i=e&&e.stack?e.stack.replace(/^[^\(]+?[\n$]/gm,"").replace(/^\s+at\s+/gm,"").replace(/^Object.<anonymous>\s*\(/gm,"{anonymous}()@"):"Unknown Stack Trace",o=window.console&&(window.console.warn||window.console.log);return o&&o.call(window.console,n,i),t.apply(this,arguments)}}var cv=dv((function(t,e,i){for(var n=Object.keys(e),o=0;o<n.length;)(!i||i&&void 0===t[n[o]])&&(t[n[o]]=e[n[o]]),o++;return t}),"extend","Use `assign`."),uv=dv((function(t,e){return cv(t,e,!0)}),"merge","Use `assign`.");function pv(t,e,i){var n,o=e.prototype;(n=t.prototype=Object.create(o)).constructor=t,n._super=o,i&&Af(n,i)}function mv(t,e){return function(){return t.apply(e,arguments)}}var fv=function(){var t=function(t,e){return void 0===e&&(e={}),new ov(t,Ef({recognizers:iv.concat()},e))};return t.VERSION="2.0.17-rc",t.DIRECTION_ALL=30,t.DIRECTION_DOWN=Jf,t.DIRECTION_LEFT=2,t.DIRECTION_RIGHT=4,t.DIRECTION_UP=8,t.DIRECTION_HORIZONTAL=6,t.DIRECTION_VERTICAL=tg,t.DIRECTION_NONE=1,t.DIRECTION_DOWN=Jf,t.INPUT_START=1,t.INPUT_MOVE=2,t.INPUT_END=4,t.INPUT_CANCEL=8,t.STATE_POSSIBLE=1,t.STATE_BEGAN=2,t.STATE_CHANGED=4,t.STATE_ENDED=8,t.STATE_RECOGNIZED=8,t.STATE_CANCELLED=16,t.STATE_FAILED=Bg,t.Manager=ov,t.Input=wg,t.TouchAction=rg,t.TouchInput=Ig,t.MouseInput=Rg,t.PointerEventInput=Sg,t.TouchMouseInput=Hg,t.SingleTouchInput=lv,t.Recognizer=Ug,t.AttrRecognizer=qg,t.Tap=$g,t.Pan=Kg,t.Swipe=Zg,t.Pinch=Qg,t.Rotate=Jg,t.Press=tv,t.on=vg,t.off=yg,t.each=ng,t.merge=uv,t.extend=cv,t.bindFn=mv,t.assign=Af,t.inherit=pv,t.bindFn=mv,t.prefixed=jf,t.toArray=Tg,t.inArray=_g,t.uniqueArray=Eg,t.splitStr=gg,t.boolOrFn=og,t.hasParent=ag,t.addEventListeners=vg,t.removeEventListeners=yg,t.defaults=Af({},ev,{preset:iv}),t}();function gv(t,e){var i=void 0!==xu&&sh(t)||t["@@iterator"];if(!i){if(Ou(t)||(i=function(t,e){var i;if(t){if("string"==typeof t)return vv(t,e);var n=Eu(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?zl(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?vv(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function vv(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}var yv=xu("DELETE");function bv(){var t=wv.apply(void 0,arguments);return xv(t),t}function wv(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];if(e.length<2)return e[0];var n;if(e.length>2)return wv.apply(void 0,Tu(n=[bv(e[0],e[1])]).call(n,_u(Eu(e).call(e,2))));var o,s=e[0],r=e[1],a=gv(Mu(r));try{for(a.s();!(o=a.n()).done;){var l=o.value;Object.prototype.propertyIsEnumerable.call(r,l)&&(r[l]===yv?delete s[l]:null===s[l]||null===r[l]||"object"!==wu(s[l])||"object"!==wu(r[l])||Ou(s[l])||Ou(r[l])?s[l]=_v(r[l]):s[l]=wv(s[l],r[l]))}}catch(t){a.e(t)}finally{a.f()}return s}function _v(t){return Ou(t)?Lo(t).call(t,(function(t){return _v(t)})):"object"===wu(t)&&null!==t?wv({},t):t}function xv(t){for(var e=0,i=Pu(t);e<i.length;e++){var n=i[e];t[n]===yv?delete t[n]:"object"===wu(t[n])&&null!==t[n]&&xv(t[n])}}var kv="undefined"!=typeof window?window.Hammer||fv:function(){return function(){var t=function(){};return{on:t,off:t,destroy:t,emit:t,get:function(){return{set:t}}}}()};function Dv(t){var e,i=this;this._cleanupQueue=[],this.active=!1,this._dom={container:t,overlay:document.createElement("div")},this._dom.overlay.classList.add("vis-overlay"),this._dom.container.appendChild(this._dom.overlay),this._cleanupQueue.push((function(){i._dom.overlay.parentNode.removeChild(i._dom.overlay)}));var n=kv(this._dom.overlay);n.on("tap",nn(e=this._onTapOverlay).call(e,this)),this._cleanupQueue.push((function(){n.destroy()}));var o=["tap","doubletap","press","pinch","pan","panstart","panmove","panend"];$u(o).call(o,(function(t){n.on(t,(function(t){t.srcEvent.stopPropagation()}))})),document&&document.body&&(this._onClick=function(e){(function(t,e){for(;t;){if(t===e)return!0;t=t.parentNode}return!1})(e.target,t)||i.deactivate()},document.body.addEventListener("click",this._onClick),this._cleanupQueue.push((function(){document.body.removeEventListener("click",i._onClick)}))),this._escListener=function(t){("key"in t?"Escape"===t.key:27===t.keyCode)&&i.deactivate()}}Tf(Dv.prototype),Dv.current=null,Dv.prototype.destroy=function(){var t,e;this.deactivate();var i,n=gv(ip(t=_p(e=this._cleanupQueue).call(e,0)).call(t));try{for(n.s();!(i=n.n()).done;)(0,i.value)()}catch(t){n.e(t)}finally{n.f()}},Dv.prototype.activate=function(){Dv.current&&Dv.current.deactivate(),Dv.current=this,this.active=!0,this._dom.overlay.style.display="none",this._dom.container.classList.add("vis-active"),this.emit("change"),this.emit("activate"),document.body.addEventListener("keydown",this._escListener)},Dv.prototype.deactivate=function(){this.active=!1,this._dom.overlay.style.display="block",this._dom.container.classList.remove("vis-active"),document.body.removeEventListener("keydown",this._escListener),this.emit("change"),this.emit("deactivate")},Dv.prototype._onTapOverlay=function(t){this.activate(),t.srcEvent.stopPropagation()};var Cv=oo,Sv=xt,Tv=s.TypeError,Ev=Ci,Mv=u,Ov=qi,Iv=function(t){if(Cv(t))return t;throw Tv(Sv(t)+" is not a constructor")},Av=Je,Pv=X,Nv=Lr,Fv=r,Rv=et("Reflect","construct"),Lv=Object.prototype,jv=[].push,Yv=Fv((function(){function t(){}return!(Rv((function(){}),[],t)instanceof t)})),Hv=!Fv((function(){Rv((function(){}))})),zv=Yv||Hv;Ev({target:"Reflect",stat:!0,forced:zv,sham:zv},{construct:function(t,e){Iv(t),Av(e);var i=arguments.length<3?t:Iv(arguments[2]);if(Hv&&!Yv)return Rv(t,e,i);if(t==i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var n=[null];return Mv(jv,n,e),new(Mv(Ov,t,n))}var o=i.prototype,s=Nv(Pv(o)?o:Lv),r=Mv(t,s,e);return Pv(r)?r:s}});var Bv=K.Reflect.construct;function Wv(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}var Gv=Hm;Ci({target:"Object",stat:!0},{setPrototypeOf:Ea});var Vv=K.Object.setPrototypeOf;function Uv(t,e){return Uv=Vv||function(t,e){return t.__proto__=e,t},Uv(t,e)}function $v(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Gv(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Ai(t,"prototype",{writable:!1}),e&&Uv(t,e)}function qv(t,e){if(e&&("object"===wu(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return Wv(t)}var Xv=Jp;function Kv(t){return Kv=Vv?Xv:function(t){return t.__proto__||Xv(t)},Kv(t)}var Zv={exports:{}};!function(t){var e=function(t){var e,i=Object.prototype,n=i.hasOwnProperty,o="function"==typeof Symbol?Symbol:{},s=o.iterator||"@@iterator",r=o.asyncIterator||"@@asyncIterator",a=o.toStringTag||"@@toStringTag";function l(t,e,i){return Object.defineProperty(t,e,{value:i,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,i){return t[e]=i}}function h(t,e,i,n){var o=e&&e.prototype instanceof g?e:g,s=Object.create(o.prototype),r=new E(n||[]);return s._invoke=function(t,e,i){var n=c;return function(o,s){if(n===p)throw new Error("Generator is already running");if(n===m){if("throw"===o)throw s;return O()}for(i.method=o,i.arg=s;;){var r=i.delegate;if(r){var a=C(r,i);if(a){if(a===f)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if(n===c)throw n=m,i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);n=p;var l=d(t,e,i);if("normal"===l.type){if(n=i.done?m:u,l.arg===f)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(n=m,i.method="throw",i.arg=l.arg)}}}(t,i,r),s}function d(t,e,i){try{return{type:"normal",arg:t.call(e,i)}}catch(t){return{type:"throw",arg:t}}}t.wrap=h;var c="suspendedStart",u="suspendedYield",p="executing",m="completed",f={};function g(){}function v(){}function y(){}var b={};l(b,s,(function(){return this}));var w=Object.getPrototypeOf,_=w&&w(w(M([])));_&&_!==i&&n.call(_,s)&&(b=_);var x=y.prototype=g.prototype=Object.create(b);function k(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function D(t,e){function i(o,s,r,a){var l=d(t[o],t,s);if("throw"!==l.type){var h=l.arg,c=h.value;return c&&"object"==typeof c&&n.call(c,"__await")?e.resolve(c.__await).then((function(t){i("next",t,r,a)}),(function(t){i("throw",t,r,a)})):e.resolve(c).then((function(t){h.value=t,r(h)}),(function(t){return i("throw",t,r,a)}))}a(l.arg)}var o;this._invoke=function(t,n){function s(){return new e((function(e,o){i(t,n,e,o)}))}return o=o?o.then(s,s):s()}}function C(t,i){var n=t.iterator[i.method];if(n===e){if(i.delegate=null,"throw"===i.method){if(t.iterator.return&&(i.method="return",i.arg=e,C(t,i),"throw"===i.method))return f;i.method="throw",i.arg=new TypeError("The iterator does not provide a 'throw' method")}return f}var o=d(n,t.iterator,i.arg);if("throw"===o.type)return i.method="throw",i.arg=o.arg,i.delegate=null,f;var s=o.arg;return s?s.done?(i[t.resultName]=s.value,i.next=t.nextLoc,"return"!==i.method&&(i.method="next",i.arg=e),i.delegate=null,f):s:(i.method="throw",i.arg=new TypeError("iterator result is not an object"),i.delegate=null,f)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function T(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function M(t){if(t){var i=t[s];if(i)return i.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,r=function i(){for(;++o<t.length;)if(n.call(t,o))return i.value=t[o],i.done=!1,i;return i.value=e,i.done=!0,i};return r.next=r}}return{next:O}}function O(){return{value:e,done:!0}}return v.prototype=y,l(x,"constructor",y),l(y,"constructor",v),v.displayName=l(y,a,"GeneratorFunction"),t.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===v||"GeneratorFunction"===(e.displayName||e.name))},t.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,y):(t.__proto__=y,l(t,a,"GeneratorFunction")),t.prototype=Object.create(x),t},t.awrap=function(t){return{__await:t}},k(D.prototype),l(D.prototype,r,(function(){return this})),t.AsyncIterator=D,t.async=function(e,i,n,o,s){void 0===s&&(s=Promise);var r=new D(h(e,i,n,o),s);return t.isGeneratorFunction(i)?r:r.next().then((function(t){return t.done?t.value:r.next()}))},k(x),l(x,a,"Generator"),l(x,s,(function(){return this})),l(x,"toString",(function(){return"[object Generator]"})),t.keys=function(t){var e=[];for(var i in t)e.push(i);return e.reverse(),function i(){for(;e.length;){var n=e.pop();if(n in t)return i.value=n,i.done=!1,i}return i.done=!0,i}},t.values=M,E.prototype={constructor:E,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(T),!t)for(var i in this)"t"===i.charAt(0)&&n.call(this,i)&&!isNaN(+i.slice(1))&&(this[i]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var i=this;function o(n,o){return a.type="throw",a.arg=t,i.next=n,o&&(i.method="next",i.arg=e),!!o}for(var s=this.tryEntries.length-1;s>=0;--s){var r=this.tryEntries[s],a=r.completion;if("root"===r.tryLoc)return o("end");if(r.tryLoc<=this.prev){var l=n.call(r,"catchLoc"),h=n.call(r,"finallyLoc");if(l&&h){if(this.prev<r.catchLoc)return o(r.catchLoc,!0);if(this.prev<r.finallyLoc)return o(r.finallyLoc)}else if(l){if(this.prev<r.catchLoc)return o(r.catchLoc,!0)}else{if(!h)throw new Error("try statement without catch or finally");if(this.prev<r.finallyLoc)return o(r.finallyLoc)}}}},abrupt:function(t,e){for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i];if(o.tryLoc<=this.prev&&n.call(o,"finallyLoc")&&this.prev<o.finallyLoc){var s=o;break}}s&&("break"===t||"continue"===t)&&s.tryLoc<=e&&e<=s.finallyLoc&&(s=null);var r=s?s.completion:{};return r.type=t,r.arg=e,s?(this.method="next",this.next=s.finallyLoc,f):this.complete(r)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),f},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.finallyLoc===t)return this.complete(i.completion,i.afterLoc),T(i),f}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var i=this.tryEntries[e];if(i.tryLoc===t){var n=i.completion;if("throw"===n.type){var o=n.arg;T(i)}return o}}throw new Error("illegal catch attempt")},delegateYield:function(t,i,n){return this.delegate={iterator:M(t),resultName:i,nextLoc:n},"next"===this.method&&(this.arg=e),f}},t}(t.exports);try{regeneratorRuntime=e}catch(t){"object"==typeof globalThis?globalThis.regeneratorRuntime=e:Function("r","regeneratorRuntime = r")(e)}}(Zv);var Qv=Zv.exports,Jv={exports:{}},ty=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}})),ey=r,iy=X,ny=F,oy=ty,sy=Object.isExtensible,ry=ey((function(){sy(1)}))||oy?function(t){return!!iy(t)&&(!oy||"ArrayBuffer"!=ny(t))&&(!sy||sy(t))}:sy,ay=!r((function(){return Object.isExtensible(Object.preventExtensions({}))})),ly=Ci,hy=y,dy=Ds,cy=X,uy=Vt,py=$e.f,my=rh,fy=hh,gy=ry,vy=ay,yy=!1,by=Kt("meta"),wy=0,_y=function(t){py(t,by,{value:{objectID:"O"+wy++,weakData:{}}})},xy=Jv.exports={enable:function(){xy.enable=function(){},yy=!0;var t=my.f,e=hy([].splice),i={};i[by]=1,t(i).length&&(my.f=function(i){for(var n=t(i),o=0,s=n.length;o<s;o++)if(n[o]===by){e(n,o,1);break}return n},ly({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:fy.f}))},fastKey:function(t,e){if(!cy(t))return"symbol"==typeof t?t:("string"==typeof t?"S":"P")+t;if(!uy(t,by)){if(!gy(t))return"F";if(!e)return"E";_y(t)}return t[by].objectID},getWeakData:function(t,e){if(!uy(t,by)){if(!gy(t))return!0;if(!e)return!1;_y(t)}return t[by].weakData},onFreeze:function(t){return vy&&yy&&gy(t)&&!uy(t,by)&&_y(t),t}};dy[by]=!0;var ky=Ue,Dy=D,Cy=Je,Sy=xt,Ty=rl,Ey=dn,My=it,Oy=xl,Iy=fl,Ay=tl,Py=s.TypeError,Ny=function(t,e){this.stopped=t,this.result=e},Fy=Ny.prototype,Ry=function(t,e,i){var n,o,s,r,a,l,h,d=i&&i.that,c=!(!i||!i.AS_ENTRIES),u=!(!i||!i.IS_ITERATOR),p=!(!i||!i.INTERRUPTED),m=ky(e,d),f=function(t){return n&&Ay(n,"normal",t),new Ny(!0,t)},g=function(t){return c?(Cy(t),p?m(t[0],t[1],f):m(t[0],t[1])):p?m(t,f):m(t)};if(u)n=t;else{if(!(o=Iy(t)))throw Py(Sy(t)+" is not iterable");if(Ty(o)){for(s=0,r=Ey(t);r>s;s++)if((a=g(t[s]))&&My(Fy,a))return a;return new Ny(!1)}n=Oy(t,o)}for(l=n.next;!(h=Dy(l,n)).done;){try{a=g(h.value)}catch(t){Ay(n,"throw",t)}if("object"==typeof a&&a&&My(Fy,a))return a}return new Ny(!1)},Ly=it,jy=s.TypeError,Yy=function(t,e){if(Ly(e,t))return t;throw jy("Incorrect invocation")},Hy=Ci,zy=s,By=Jv.exports,Wy=r,Gy=pi,Vy=Ry,Uy=Yy,$y=b,qy=X,Xy=pa,Ky=$e.f,Zy=_o.forEach,Qy=_,Jy=Bs.set,tb=Bs.getterFor,eb=function(t,e,i){var n,o=-1!==t.indexOf("Map"),s=-1!==t.indexOf("Weak"),r=o?"set":"add",a=zy[t],l=a&&a.prototype,h={};if(Qy&&$y(a)&&(s||l.forEach&&!Wy((function(){(new a).entries().next()})))){var d=(n=e((function(e,i){Jy(Uy(e,d),{type:t,collection:new a}),null!=i&&Vy(i,e[r],{that:e,AS_ENTRIES:o})}))).prototype,c=tb(t);Zy(["add","clear","delete","forEach","get","has","set","keys","values","entries"],(function(t){var e="add"==t||"set"==t;!(t in l)||s&&"clear"==t||Gy(d,t,(function(i,n){var o=c(this).collection;if(!e&&s&&!qy(i))return"get"==t&&void 0;var r=o[t](0===i?0:i,n);return e?this:r}))})),s||Ky(d,"size",{configurable:!0,get:function(){return c(this).collection.size}})}else n=i.getConstructor(e,t,o,r),By.enable();return Xy(n,t,!1,!0),h[t]=n,Hy({global:!0,forced:!0},h),s||i.setStrong(n,t,o),n},ib=Xr,nb=et,ob=$e,sb=_,rb=ae("species"),ab=$e.f,lb=Lr,hb=function(t,e,i){for(var n in e)i&&i.unsafe&&t[n]?t[n]=e[n]:ib(t,n,e[n],i);return t},db=Ue,cb=Yy,ub=Ry,pb=Wa,mb=function(t){var e=nb(t),i=ob.f;sb&&e&&!e[rb]&&i(e,rb,{configurable:!0,get:function(){return this}})},fb=_,gb=Jv.exports.fastKey,vb=Bs.set,yb=Bs.getterFor,bb={getConstructor:function(t,e,i,n){var o=t((function(t,o){cb(t,s),vb(t,{type:e,index:lb(null),first:void 0,last:void 0,size:0}),fb||(t.size=0),null!=o&&ub(o,t[n],{that:t,AS_ENTRIES:i})})),s=o.prototype,r=yb(e),a=function(t,e,i){var n,o,s=r(t),a=l(t,e);return a?a.value=i:(s.last=a={index:o=gb(e,!0),key:e,value:i,previous:n=s.last,next:void 0,removed:!1},s.first||(s.first=a),n&&(n.next=a),fb?s.size++:t.size++,"F"!==o&&(s.index[o]=a)),t},l=function(t,e){var i,n=r(t),o=gb(e);if("F"!==o)return n.index[o];for(i=n.first;i;i=i.next)if(i.key==e)return i};return hb(s,{clear:function(){for(var t=r(this),e=t.index,i=t.first;i;)i.removed=!0,i.previous&&(i.previous=i.previous.next=void 0),delete e[i.index],i=i.next;t.first=t.last=void 0,fb?t.size=0:this.size=0},delete:function(t){var e=this,i=r(e),n=l(e,t);if(n){var o=n.next,s=n.previous;delete i.index[n.index],n.removed=!0,s&&(s.next=o),o&&(o.previous=s),i.first==n&&(i.first=o),i.last==n&&(i.last=s),fb?i.size--:e.size--}return!!n},forEach:function(t){for(var e,i=r(this),n=db(t,arguments.length>1?arguments[1]:void 0);e=e?e.next:i.first;)for(n(e.value,e.key,this);e&&e.removed;)e=e.previous},has:function(t){return!!l(this,t)}}),hb(s,i?{get:function(t){var e=l(this,t);return e&&e.value},set:function(t,e){return a(this,0===t?0:t,e)}}:{add:function(t){return a(this,t=0===t?0:t,t)}}),fb&&ab(s,"size",{get:function(){return r(this).size}}),o},setStrong:function(t,e,i){var n=e+" Iterator",o=yb(e),s=yb(n);pb(t,e,(function(t,e){vb(this,{type:n,target:t,state:o(t),kind:e,last:void 0})}),(function(){for(var t=s(this),e=t.kind,i=t.last;i&&i.removed;)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?"keys"==e?{value:i.key,done:!1}:"values"==e?{value:i.value,done:!1}:{value:[i.key,i.value],done:!1}:(t.target=void 0,{value:void 0,done:!0})}),i?"entries":"values",!i,!0),mb(e)}};eb("Map",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),bb);var wb=K.Map,_b=_o.some;Ci({target:"Array",proto:!0,forced:!bn("some")},{some:function(t){return _b(this,t,arguments.length>1?arguments[1]:void 0)}});var xb=Zi("Array").some,kb=it,Db=xb,Cb=Array.prototype,Sb=function(t){var e=t.some;return t===Cb||kb(Cb,t)&&e===Cb.some?Db:e},Tb=Zi("Array").keys,Eb=Hn,Mb=Vt,Ob=it,Ib=Tb,Ab=Array.prototype,Pb={DOMTokenList:!0,NodeList:!0},Nb=function(t){var e=t.keys;return t===Ab||Ob(Ab,t)&&e===Ab.keys||Mb(Pb,Eb(t))?Ib:e},Fb=fh,Rb=Math.floor,Lb=function(t,e){var i=t.length,n=Rb(i/2);return i<8?jb(t,e):Yb(t,Lb(Fb(t,0,n),e),Lb(Fb(t,n),e),e)},jb=function(t,e){for(var i,n,o=t.length,s=1;s<o;){for(n=s,i=t[s];n&&e(t[n-1],i)>0;)t[n]=t[--n];n!==s++&&(t[n]=i)}return t},Yb=function(t,e,i,n){for(var o=e.length,s=i.length,r=0,a=0;r<o||a<s;)t[r+a]=r<o&&a<s?n(e[r],i[a])<=0?e[r++]:i[a++]:r<o?e[r++]:i[a++];return t},Hb=Lb,zb=nt.match(/firefox\/(\d+)/i),Bb=!!zb&&+zb[1],Wb=/MSIE|Trident/.test(nt),Gb=nt.match(/AppleWebKit\/(\d+)\./),Vb=!!Gb&&+Gb[1],Ub=Ci,$b=y,qb=St,Xb=Bt,Kb=dn,Zb=rs,Qb=r,Jb=Hb,tw=bn,ew=Bb,iw=Wb,nw=dt,ow=Vb,sw=[],rw=$b(sw.sort),aw=$b(sw.push),lw=Qb((function(){sw.sort(void 0)})),hw=Qb((function(){sw.sort(null)})),dw=tw("sort"),cw=!Qb((function(){if(nw)return nw<70;if(!(ew&&ew>3)){if(iw)return!0;if(ow)return ow<603;var t,e,i,n,o="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(n=0;n<47;n++)sw.push({k:e+n,v:i})}for(sw.sort((function(t,e){return e.v-t.v})),n=0;n<sw.length;n++)e=sw[n].k.charAt(0),o.charAt(o.length-1)!==e&&(o+=e);return"DGBEFHACIJK"!==o}}));Ub({target:"Array",proto:!0,forced:lw||!hw||!dw||!cw},{sort:function(t){void 0!==t&&qb(t);var e=Xb(this);if(cw)return void 0===t?rw(e):rw(e,t);var i,n,o=[],s=Kb(e);for(n=0;n<s;n++)n in e&&aw(o,e[n]);for(Jb(o,function(t){return function(e,i){return void 0===i?-1:void 0===e?1:void 0!==t?+t(e,i)||0:Zb(e)>Zb(i)?1:-1}}(t)),i=o.length,n=0;n<i;)e[n]=o[n++];for(;n<s;)delete e[n++];return e}});var uw,pw=Zi("Array").sort,mw=it,fw=pw,gw=Array.prototype,vw=function(t){var e=t.sort;return t===gw||mw(gw,t)&&e===gw.sort?fw:e},yw=Zi("Array").values,bw=Hn,ww=Vt,_w=it,xw=yw,kw=Array.prototype,Dw={DOMTokenList:!0,NodeList:!0},Cw=function(t){var e=t.values;return t===kw||_w(kw,t)&&e===kw.values||ww(Dw,bw(t))?xw:e},Sw=yu,Tw=Zi("Array").entries,Ew=Hn,Mw=Vt,Ow=it,Iw=Tw,Aw=Array.prototype,Pw={DOMTokenList:!0,NodeList:!0},Nw=function(t){var e=t.entries;return t===Aw||Ow(Aw,t)&&e===Aw.entries||Mw(Pw,Ew(t))?Iw:e},Fw=new Uint8Array(16);function Rw(){if(!uw&&!(uw="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto)))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return uw(Fw)}var Lw=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function jw(t){return"string"==typeof t&&Lw.test(t)}for(var Yw=[],Hw=0;Hw<256;++Hw)Yw.push((Hw+256).toString(16).substr(1));function zw(t,e,i){var n=(t=t||{}).random||(t.rng||Rw)();if(n[6]=15&n[6]|64,n[8]=63&n[8]|128,e){i=i||0;for(var o=0;o<16;++o)e[i+o]=n[o];return e}return function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,i=(Yw[t[e+0]]+Yw[t[e+1]]+Yw[t[e+2]]+Yw[t[e+3]]+"-"+Yw[t[e+4]]+Yw[t[e+5]]+"-"+Yw[t[e+6]]+Yw[t[e+7]]+"-"+Yw[t[e+8]]+Yw[t[e+9]]+"-"+Yw[t[e+10]]+Yw[t[e+11]]+Yw[t[e+12]]+Yw[t[e+13]]+Yw[t[e+14]]+Yw[t[e+15]]).toLowerCase();if(!jw(i))throw TypeError("Stringified UUID is invalid");return i}(n)}function Bw(t){return"string"==typeof t||"number"==typeof t}var Ww=function(){function t(i){e(this,t),Fi(this,"delay",void 0),Fi(this,"max",void 0),Fi(this,"_queue",[]),Fi(this,"_timeout",null),Fi(this,"_extended",null),this.delay=null,this.max=1/0,this.setOptions(i)}return Ni(t,[{key:"setOptions",value:function(t){t&&void 0!==t.delay&&(this.delay=t.delay),t&&void 0!==t.max&&(this.max=t.max),this._flushIfNeeded()}},{key:"destroy",value:function(){if(this.flush(),this._extended){for(var t=this._extended.object,e=this._extended.methods,i=0;i<e.length;i++){var n=e[i];n.original?t[n.name]=n.original:delete t[n.name]}this._extended=null}}},{key:"replace",value:function(t,e){var i=this,n=t[e];if(!n)throw new Error("Method "+e+" undefined");t[e]=function(){for(var t=arguments.length,e=new Array(t),o=0;o<t;o++)e[o]=arguments[o];i.queue({args:e,fn:n,context:this})}}},{key:"queue",value:function(t){"function"==typeof t?this._queue.push({fn:t}):this._queue.push(t),this._flushIfNeeded()}},{key:"_flushIfNeeded",value:function(){var t=this;this._queue.length>this.max&&this.flush(),null!=this._timeout&&(clearTimeout(this._timeout),this._timeout=null),this.queue.length>0&&"number"==typeof this.delay&&(this._timeout=wf((function(){t.flush()}),this.delay))}},{key:"flush",value:function(){var t,e;$u(t=_p(e=this._queue).call(e,0)).call(t,(function(t){t.fn.apply(t.context||t.fn,t.args||[])}))}}],[{key:"extend",value:function(e,i){var n=new t(i);if(void 0!==e.flush)throw new Error("Target object already has a property flush");e.flush=function(){n.flush()};var o=[{name:"flush",original:void 0}];if(i&&i.replace)for(var s=0;s<i.replace.length;s++){var r=i.replace[s];o.push({name:r,original:e[r]}),n.replace(e,r)}return n._extended={object:e,methods:o},n}}]),t}(),Gw=function(){function t(){e(this,t),Fi(this,"_subscribers",{"*":[],add:[],remove:[],update:[]}),Fi(this,"subscribe",t.prototype.on),Fi(this,"unsubscribe",t.prototype.off)}return Ni(t,[{key:"_trigger",value:function(t,e,i){var n,o;if("*"===t)throw new Error("Cannot trigger event *");$u(n=Tu(o=[]).call(o,_u(this._subscribers[t]),_u(this._subscribers["*"]))).call(n,(function(n){n(t,e,null!=i?i:null)}))}},{key:"on",value:function(t,e){"function"==typeof e&&this._subscribers[t].push(e)}},{key:"off",value:function(t,e){var i;this._subscribers[t]=Io(i=this._subscribers[t]).call(i,(function(t){return t!==e}))}}]),t}();eb("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),bb);var Vw,Uw=K.Set,$w=xl;function qw(t,e){var i=void 0!==xu&&sh(t)||t["@@iterator"];if(!i){if(Ou(t)||(i=function(t,e){var i;if(t){if("string"==typeof t)return Xw(t,e);var n=Eu(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?zl(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?Xw(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function Xw(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}Vw=Sw;var Kw=function(){function t(i){e(this,t),Fi(this,"_pairs",void 0),this._pairs=i}return Ni(t,[{key:Vw,value:Qv.mark((function t(){var e,i,n,o,s;return Qv.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=qw(this._pairs),t.prev=1,e.s();case 3:if((i=e.n()).done){t.next=9;break}return n=vu(i.value,2),o=n[0],s=n[1],t.next=7,[o,s];case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"entries",value:Qv.mark((function t(){var e,i,n,o,s;return Qv.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=qw(this._pairs),t.prev=1,e.s();case 3:if((i=e.n()).done){t.next=9;break}return n=vu(i.value,2),o=n[0],s=n[1],t.next=7,[o,s];case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"keys",value:Qv.mark((function t(){var e,i,n,o;return Qv.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=qw(this._pairs),t.prev=1,e.s();case 3:if((i=e.n()).done){t.next=9;break}return n=vu(i.value,1),o=n[0],t.next=7,o;case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"values",value:Qv.mark((function t(){var e,i,n,o;return Qv.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e=qw(this._pairs),t.prev=1,e.s();case 3:if((i=e.n()).done){t.next=9;break}return n=vu(i.value,2),o=n[1],t.next=7,o;case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),e.e(t.t0);case 14:return t.prev=14,e.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,this,[[1,11,14,17]])}))},{key:"toIdArray",value:function(){var t;return Lo(t=_u(this._pairs)).call(t,(function(t){return t[0]}))}},{key:"toItemArray",value:function(){var t;return Lo(t=_u(this._pairs)).call(t,(function(t){return t[1]}))}},{key:"toEntryArray",value:function(){return _u(this._pairs)}},{key:"toObjectMap",value:function(){var t,e=zm(null),i=qw(this._pairs);try{for(i.s();!(t=i.n()).done;){var n=vu(t.value,2),o=n[0],s=n[1];e[o]=s}}catch(t){i.e(t)}finally{i.f()}return e}},{key:"toMap",value:function(){return new wb(this._pairs)}},{key:"toIdSet",value:function(){return new Uw(this.toIdArray())}},{key:"toItemSet",value:function(){return new Uw(this.toItemArray())}},{key:"cache",value:function(){return new t(_u(this._pairs))}},{key:"distinct",value:function(t){var e,i=new Uw,n=qw(this._pairs);try{for(n.s();!(e=n.n()).done;){var o=vu(e.value,2),s=o[0],r=o[1];i.add(t(r,s))}}catch(t){n.e(t)}finally{n.f()}return i}},{key:"filter",value:function(e){var i=this._pairs;return new t(Fi({},Sw,Qv.mark((function t(){var n,o,s,r,a;return Qv.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=qw(i),t.prev=1,n.s();case 3:if((o=n.n()).done){t.next=10;break}if(s=vu(o.value,2),r=s[0],a=s[1],!e(a,r)){t.next=8;break}return t.next=8,[r,a];case 8:t.next=3;break;case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(1),n.e(t.t0);case 15:return t.prev=15,n.f(),t.finish(15);case 18:case"end":return t.stop()}}),t,null,[[1,12,15,18]])}))))}},{key:"forEach",value:function(t){var e,i=qw(this._pairs);try{for(i.s();!(e=i.n()).done;){var n=vu(e.value,2),o=n[0];t(n[1],o)}}catch(t){i.e(t)}finally{i.f()}}},{key:"map",value:function(e){var i=this._pairs;return new t(Fi({},Sw,Qv.mark((function t(){var n,o,s,r,a;return Qv.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=qw(i),t.prev=1,n.s();case 3:if((o=n.n()).done){t.next=9;break}return s=vu(o.value,2),r=s[0],a=s[1],t.next=7,[r,e(a,r)];case 7:t.next=3;break;case 9:t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),n.e(t.t0);case 14:return t.prev=14,n.f(),t.finish(14);case 17:case"end":return t.stop()}}),t,null,[[1,11,14,17]])}))))}},{key:"max",value:function(t){var e=$w(this._pairs),i=e.next();if(i.done)return null;for(var n=i.value[1],o=t(i.value[1],i.value[0]);!(i=e.next()).done;){var s=vu(i.value,2),r=s[0],a=s[1],l=t(a,r);l>o&&(o=l,n=a)}return n}},{key:"min",value:function(t){var e=$w(this._pairs),i=e.next();if(i.done)return null;for(var n=i.value[1],o=t(i.value[1],i.value[0]);!(i=e.next()).done;){var s=vu(i.value,2),r=s[0],a=s[1],l=t(a,r);l<o&&(o=l,n=a)}return n}},{key:"reduce",value:function(t,e){var i,n=qw(this._pairs);try{for(n.s();!(i=n.n()).done;){var o=vu(i.value,2),s=o[0];e=t(e,o[1],s)}}catch(t){n.e(t)}finally{n.f()}return e}},{key:"sort",value:function(e){var i=this;return new t(Fi({},Sw,(function(){var t;return $w(vw(t=_u(i._pairs)).call(t,(function(t,i){var n=vu(t,2),o=n[0],s=n[1],r=vu(i,2),a=r[0],l=r[1];return e(s,l,o,a)})))})))}}]),t}();function Zw(t,e){var i=Pu(t);if(qd){var n=qd(t);e&&(n=Io(n).call(n,(function(e){return oc(t,e).enumerable}))),i.push.apply(i,n)}return i}function Qw(t){for(var e=1;e<arguments.length;e++){var i,n,o=null!=arguments[e]?arguments[e]:{};e%2?$u(i=Zw(Object(o),!0)).call(i,(function(e){Fi(t,e,o[e])})):fc?xc(t,fc(o)):$u(n=Zw(Object(o))).call(n,(function(e){kc(t,e,oc(o,e))}))}return t}function Jw(t,e){var i=void 0!==xu&&sh(t)||t["@@iterator"];if(!i){if(Ou(t)||(i=function(t,e){var i;if(t){if("string"==typeof t)return t_(t,e);var n=Eu(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?zl(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t_(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function t_(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function e_(t){var e=function(){if("undefined"==typeof Reflect||!Bv)return!1;if(Bv.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Bv(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Kv(t);if(e){var o=Kv(this).constructor;i=Bv(n,arguments,o)}else i=n.apply(this,arguments);return qv(this,i)}}var i_=function(t){$v(n,t);var i=e_(n);function n(t,o){var s;return e(this,n),Fi(Wv(s=i.call(this)),"flush",void 0),Fi(Wv(s),"length",void 0),Fi(Wv(s),"_options",void 0),Fi(Wv(s),"_data",void 0),Fi(Wv(s),"_idProp",void 0),Fi(Wv(s),"_queue",null),t&&!Ou(t)&&(o=t,t=[]),s._options=o||{},s._data=new wb,s.length=0,s._idProp=s._options.fieldId||"id",t&&t.length&&s.add(t),s.setOptions(o),s}return Ni(n,[{key:"idProp",get:function(){return this._idProp}},{key:"setOptions",value:function(t){t&&void 0!==t.queue&&(!1===t.queue?this._queue&&(this._queue.destroy(),this._queue=null):(this._queue||(this._queue=Ww.extend(this,{replace:["add","update","remove"]})),t.queue&&"object"===wu(t.queue)&&this._queue.setOptions(t.queue)))}},{key:"add",value:function(t,e){var i,n=this,o=[];if(Ou(t)){var s=Lo(t).call(t,(function(t){return t[n._idProp]}));if(Sb(s).call(s,(function(t){return n._data.has(t)})))throw new Error("A duplicate id was found in the parameter array.");for(var r=0,a=t.length;r<a;r++)i=this._addItem(t[r]),o.push(i)}else{if(!t||"object"!==wu(t))throw new Error("Unknown dataType");i=this._addItem(t),o.push(i)}return o.length&&this._trigger("add",{items:o},e),o}},{key:"update",value:function(t,e){var i=this,n=[],o=[],s=[],r=[],a=this._idProp,l=function(t){var e=t[a];if(null!=e&&i._data.has(e)){var l=t,h=Rp({},i._data.get(e)),d=i._updateItem(l);o.push(d),r.push(l),s.push(h)}else{var c=i._addItem(t);n.push(c)}};if(Ou(t))for(var h=0,d=t.length;h<d;h++)t[h]&&"object"===wu(t[h])?l(t[h]):console.warn("Ignoring input item, which is not an object at index "+h);else{if(!t||"object"!==wu(t))throw new Error("Unknown dataType");l(t)}if(n.length&&this._trigger("add",{items:n},e),o.length){var c={items:o,oldData:s,data:r};this._trigger("update",c,e)}return Tu(n).call(n,o)}},{key:"updateOnly",value:function(t,e){var i,n=this;Ou(t)||(t=[t]);var o=Lo(i=Lo(t).call(t,(function(t){var e=n._data.get(t[n._idProp]);if(null==e)throw new Error("Updating non-existent items is not allowed.");return{oldData:e,update:t}}))).call(i,(function(t){var e=t.oldData,i=t.update,o=e[n._idProp],s=function(t){for(var e,i=arguments.length,n=new Array(i>1?i-1:0),o=1;o<i;o++)n[o-1]=arguments[o];return bv.apply(void 0,Tu(e=[{},t]).call(e,n))}(e,i);return n._data.set(o,s),{id:o,oldData:e,updatedData:s}}));if(o.length){var s={items:Lo(o).call(o,(function(t){return t.id})),oldData:Lo(o).call(o,(function(t){return t.oldData})),data:Lo(o).call(o,(function(t){return t.updatedData}))};return this._trigger("update",s,e),s.items}return[]}},{key:"get",value:function(t,e){var i=void 0,n=void 0,o=void 0;Bw(t)?(i=t,o=e):Ou(t)?(n=t,o=e):o=t;var s,r=o&&"Object"===o.returnType?"Object":"Array",a=o&&Io(o),l=[],h=void 0,d=void 0,c=void 0;if(null!=i)(h=this._data.get(i))&&a&&!a(h)&&(h=void 0);else if(null!=n)for(var u=0,p=n.length;u<p;u++)null==(h=this._data.get(n[u]))||a&&!a(h)||l.push(h);else for(var m,f=0,g=(d=_u(Nb(m=this._data).call(m))).length;f<g;f++)c=d[f],null==(h=this._data.get(c))||a&&!a(h)||l.push(h);if(o&&o.order&&null==i&&this._sort(l,o.order),o&&o.fields){var v=o.fields;if(null!=i&&null!=h)h=this._filterFields(h,v);else for(var y=0,b=l.length;y<b;y++)l[y]=this._filterFields(l[y],v)}if("Object"==r){for(var w={},_=0,x=l.length;_<x;_++){var k=l[_];w[k[this._idProp]]=k}return w}return null!=i?null!==(s=h)&&void 0!==s?s:null:l}},{key:"getIds",value:function(t){var e=this._data,i=t&&Io(t),n=t&&t.order,o=_u(Nb(e).call(e)),s=[];if(i)if(n){for(var r=[],a=0,l=o.length;a<l;a++){var h=o[a],d=this._data.get(h);null!=d&&i(d)&&r.push(d)}this._sort(r,n);for(var c=0,u=r.length;c<u;c++)s.push(r[c][this._idProp])}else for(var p=0,m=o.length;p<m;p++){var f=o[p],g=this._data.get(f);null!=g&&i(g)&&s.push(g[this._idProp])}else if(n){for(var v=[],y=0,b=o.length;y<b;y++){var w=o[y];v.push(e.get(w))}this._sort(v,n);for(var _=0,x=v.length;_<x;_++)s.push(v[_][this._idProp])}else for(var k=0,D=o.length;k<D;k++){var C=o[k],S=e.get(C);null!=S&&s.push(S[this._idProp])}return s}},{key:"getDataSet",value:function(){return this}},{key:"forEach",value:function(t,e){var i=e&&Io(e),n=this._data,o=_u(Nb(n).call(n));if(e&&e.order)for(var s=this.get(e),r=0,a=s.length;r<a;r++){var l=s[r];t(l,l[this._idProp])}else for(var h=0,d=o.length;h<d;h++){var c=o[h],u=this._data.get(c);null==u||i&&!i(u)||t(u,c)}}},{key:"map",value:function(t,e){for(var i=e&&Io(e),n=[],o=this._data,s=_u(Nb(o).call(o)),r=0,a=s.length;r<a;r++){var l=s[r],h=this._data.get(l);null==h||i&&!i(h)||n.push(t(h,l))}return e&&e.order&&this._sort(n,e.order),n}},{key:"_filterFields",value:function(t,e){var i;return t?En(i=Ou(e)?e:Pu(e)).call(i,(function(e,i){return e[i]=t[i],e}),{}):t}},{key:"_sort",value:function(t,e){if("string"==typeof e){var i=e;vw(t).call(t,(function(t,e){var n=t[i],o=e[i];return n>o?1:n<o?-1:0}))}else{if("function"!=typeof e)throw new TypeError("Order must be a function or a string");vw(t).call(t,e)}}},{key:"remove",value:function(t,e){for(var i=[],n=[],o=Ou(t)?t:[t],s=0,r=o.length;s<r;s++){var a=this._remove(o[s]);if(a){var l=a[this._idProp];null!=l&&(i.push(l),n.push(a))}}return i.length&&this._trigger("remove",{items:i,oldData:n},e),i}},{key:"_remove",value:function(t){var e;if(Bw(t)?e=t:t&&"object"===wu(t)&&(e=t[this._idProp]),null!=e&&this._data.has(e)){var i=this._data.get(e)||null;return this._data.delete(e),--this.length,i}return null}},{key:"clear",value:function(t){for(var e,i=_u(Nb(e=this._data).call(e)),n=[],o=0,s=i.length;o<s;o++)n.push(this._data.get(i[o]));return this._data.clear(),this.length=0,this._trigger("remove",{items:i,oldData:n},t),i}},{key:"max",value:function(t){var e,i,n=null,o=null,s=Jw(Cw(e=this._data).call(e));try{for(s.s();!(i=s.n()).done;){var r=i.value,a=r[t];"number"==typeof a&&(null==o||a>o)&&(n=r,o=a)}}catch(t){s.e(t)}finally{s.f()}return n||null}},{key:"min",value:function(t){var e,i,n=null,o=null,s=Jw(Cw(e=this._data).call(e));try{for(s.s();!(i=s.n()).done;){var r=i.value,a=r[t];"number"==typeof a&&(null==o||a<o)&&(n=r,o=a)}}catch(t){s.e(t)}finally{s.f()}return n||null}},{key:"distinct",value:function(t){for(var e=this._data,i=_u(Nb(e).call(e)),n=[],o=0,s=0,r=i.length;s<r;s++){for(var a=i[s],l=e.get(a)[t],h=!1,d=0;d<o;d++)if(n[d]==l){h=!0;break}h||void 0===l||(n[o]=l,o++)}return n}},{key:"_addItem",value:function(t){var e=function(t,e){return null==t[e]&&(t[e]=zw()),t}(t,this._idProp),i=e[this._idProp];if(this._data.has(i))throw new Error("Cannot add item: item with id "+i+" already exists");return this._data.set(i,e),++this.length,i}},{key:"_updateItem",value:function(t){var e=t[this._idProp];if(null==e)throw new Error("Cannot update item: item has no id (item: "+hf(t)+")");var i=this._data.get(e);if(!i)throw new Error("Cannot update item: no item with id "+e+" found");return this._data.set(e,Qw(Qw({},i),t)),e}},{key:"stream",value:function(t){if(t){var e=this._data;return new Kw(Fi({},Sw,Qv.mark((function i(){var n,o,s,r;return Qv.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:n=Jw(t),i.prev=1,n.s();case 3:if((o=n.n()).done){i.next=11;break}if(s=o.value,null==(r=e.get(s))){i.next=9;break}return i.next=9,[s,r];case 9:i.next=3;break;case 11:i.next=16;break;case 13:i.prev=13,i.t0=i.catch(1),n.e(i.t0);case 16:return i.prev=16,n.f(),i.finish(16);case 19:case"end":return i.stop()}}),i,null,[[1,13,16,19]])}))))}var i;return new Kw(Fi({},Sw,nn(i=Nw(this._data)).call(i,this._data)))}}]),n}(Gw);function n_(t,e){var i=void 0!==xu&&sh(t)||t["@@iterator"];if(!i){if(Ou(t)||(i=function(t,e){var i;if(t){if("string"==typeof t)return o_(t,e);var n=Eu(i=Object.prototype.toString.call(t)).call(i,8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?zl(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?o_(t,e):void 0}}(t))||e&&t&&"number"==typeof t.length){i&&(t=i);var n=0,o=function(){};return{s:o,n:function(){return n>=t.length?{done:!0}:{done:!1,value:t[n++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var s,r=!0,a=!1;return{s:function(){i=i.call(t)},n:function(){var t=i.next();return r=t.done,t},e:function(t){a=!0,s=t},f:function(){try{r||null==i.return||i.return()}finally{if(a)throw s}}}}function o_(t,e){(null==e||e>t.length)&&(e=t.length);for(var i=0,n=new Array(e);i<e;i++)n[i]=t[i];return n}function s_(t){var e=function(){if("undefined"==typeof Reflect||!Bv)return!1;if(Bv.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Bv(Boolean,[],(function(){}))),!0}catch(t){return!1}}();return function(){var i,n=Kv(t);if(e){var o=Kv(this).constructor;i=Bv(n,arguments,o)}else i=n.apply(this,arguments);return qv(this,i)}}var r_=function(t){$v(n,t);var i=s_(n);function n(t,o){var s,r;return e(this,n),Fi(Wv(r=i.call(this)),"length",0),Fi(Wv(r),"_listener",void 0),Fi(Wv(r),"_data",void 0),Fi(Wv(r),"_ids",new Uw),Fi(Wv(r),"_options",void 0),r._options=o||{},r._listener=nn(s=r._onEvent).call(s,Wv(r)),r.setData(t),r}return Ni(n,[{key:"idProp",get:function(){return this.getDataSet().idProp}},{key:"setData",value:function(t){if(this._data){this._data.off&&this._data.off("*",this._listener);var e=this._data.getIds({filter:Io(this._options)}),i=this._data.get(e);this._ids.clear(),this.length=0,this._trigger("remove",{items:e,oldData:i})}if(null!=t){this._data=t;for(var n=this._data.getIds({filter:Io(this._options)}),o=0,s=n.length;o<s;o++){var r=n[o];this._ids.add(r)}this.length=n.length,this._trigger("add",{items:n})}else this._data=new i_;this._data.on&&this._data.on("*",this._listener)}},{key:"refresh",value:function(){for(var t=this._data.getIds({filter:Io(this._options)}),e=_u(this._ids),i={},n=[],o=[],s=[],r=0,a=t.length;r<a;r++){var l=t[r];i[l]=!0,this._ids.has(l)||(n.push(l),this._ids.add(l))}for(var h=0,d=e.length;h<d;h++){var c=e[h],u=this._data.get(c);null==u?console.error("If you see this, report it please."):i[c]||(o.push(c),s.push(u),this._ids.delete(c))}this.length+=n.length-o.length,n.length&&this._trigger("add",{items:n}),o.length&&this._trigger("remove",{items:o,oldData:s})}},{key:"get",value:function(t,e){if(null==this._data)return null;var i,n=null;Bw(t)||Ou(t)?(n=t,i=e):i=t;var o=Rp({},this._options,i),s=Io(this._options),r=i&&Io(i);return s&&r&&(o.filter=function(t){return s(t)&&r(t)}),null==n?this._data.get(o):this._data.get(n,o)}},{key:"getIds",value:function(t){if(this._data.length){var e,i=Io(this._options),n=null!=t?Io(t):null;return e=n?i?function(t){return i(t)&&n(t)}:n:i,this._data.getIds({filter:e,order:t&&t.order})}return[]}},{key:"forEach",value:function(t,e){if(this._data){var i,n,o=Io(this._options),s=e&&Io(e);n=s?o?function(t){return o(t)&&s(t)}:s:o,$u(i=this._data).call(i,t,{filter:n,order:e&&e.order})}}},{key:"map",value:function(t,e){if(this._data){var i,n,o=Io(this._options),s=e&&Io(e);return n=s?o?function(t){return o(t)&&s(t)}:s:o,Lo(i=this._data).call(i,t,{filter:n,order:e&&e.order})}return[]}},{key:"getDataSet",value:function(){return this._data.getDataSet()}},{key:"stream",value:function(t){var e;return this._data.stream(t||Fi({},Sw,nn(e=Nb(this._ids)).call(e,this._ids)))}},{key:"dispose",value:function(){var t;null!==(t=this._data)&&void 0!==t&&t.off&&this._data.off("*",this._listener);var e,i="This data view has already been disposed of.",o={get:function(){throw new Error(i)},set:function(){throw new Error(i)},configurable:!1},s=n_(Mu(n.prototype));try{for(s.s();!(e=s.n()).done;){var r=e.value;kc(this,r,o)}}catch(t){s.e(t)}finally{s.f()}}},{key:"_onEvent",value:function(t,e,i){if(e&&e.items&&this._data){var n=e.items,o=[],s=[],r=[],a=[],l=[],h=[];switch(t){case"add":for(var d=0,c=n.length;d<c;d++){var u=n[d];this.get(u)&&(this._ids.add(u),o.push(u))}break;case"update":for(var p=0,m=n.length;p<m;p++){var f=n[p];this.get(f)?this._ids.has(f)?(s.push(f),l.push(e.data[p]),a.push(e.oldData[p])):(this._ids.add(f),o.push(f)):this._ids.has(f)&&(this._ids.delete(f),r.push(f),h.push(e.oldData[p]))}break;case"remove":for(var g=0,v=n.length;g<v;g++){var y=n[g];this._ids.has(y)&&(this._ids.delete(y),r.push(y),h.push(e.oldData[g]))}}this.length+=o.length-r.length,o.length&&this._trigger("add",{items:o},i),s.length&&this._trigger("update",{items:s,oldData:a,data:l},i),r.length&&this._trigger("remove",{items:r,oldData:h},i)}}}]),n}(Gw);function a_(t,e){return"object"===wu(e)&&null!==e&&t===e.idProp&&"function"==typeof e.add&&"function"==typeof e.clear&&"function"==typeof e.distinct&&"function"==typeof $u(e)&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof Lo(e)&&"function"==typeof e.max&&"function"==typeof e.min&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.remove&&"function"==typeof e.setOptions&&"function"==typeof e.stream&&"function"==typeof e.update&&"function"==typeof e.updateOnly}t.DELETE=yv,t.DataSet=i_,t.DataStream=Kw,t.DataView=r_,t.Queue=Ww,t.createNewDataPipeFrom=function(t){return new ns(t)},t.isDataSetLike=a_,t.isDataViewLike=function(t,e){return"object"===wu(e)&&null!==e&&t===e.idProp&&"function"==typeof $u(e)&&"function"==typeof e.get&&"function"==typeof e.getDataSet&&"function"==typeof e.getIds&&"number"==typeof e.length&&"function"==typeof Lo(e)&&"function"==typeof e.off&&"function"==typeof e.on&&"function"==typeof e.stream&&a_(t,e.getDataSet())},Object.defineProperty(t,"__esModule",{value:!0})}(Hr.exports);class zr{constructor(i,n,o,s){this._dataset=new Hr.exports.DataSet,this._recordingRanges=new t,this._eventRanges=new e,this._cameraManager=i,this._cameraIDs=n,this._mediaType=o,this._showRecordings=s}get dataset(){return this._dataset}rewriteEvent(t){const e=this._dataset.get(t);e&&(this._dataset.remove(t),this._dataset.add(e))}async refresh(t,e){try{await Promise.all([this._refreshEvents(t,e),...this._showRecordings?[this._refreshRecordings(t,e)]:[]])}catch(t){n(t)}}getCacheFriendlyEventWindow(t){return o(t,{endCap:!0})}getTimelineEventQueries(t){return this._cameraManager.generateDefaultEventQueries(this._cameraIDs,{start:t.start,end:t.end,..."clips"===this._mediaType&&{hasClip:!0},..."snapshots"===this._mediaType&&{hasSnapshot:!0}})}async _refreshEvents(t,e){if(this._eventRanges.hasCoverage({start:e.start,end:z(s(e.end),{seconds:30})}))return;const i=this.getCacheFriendlyEventWindow(e),n=this.getTimelineEventQueries(i);if(!n)return;const o=await this._cameraManager.executeMediaQueries(t,n),a=[];for(const t of o??[]){const e=t.getEndTime(),i=t.getStartTime(),n=t.getID();n&&i&&a.push({id:n,group:t.getCameraID(),content:"",media:t,start:i.getTime(),type:"range",end:e?.getTime()??i.getTime()})}this._dataset.update(a),this._eventRanges.add({...i,expires:r(new Date,{seconds:30})})}async _refreshRecordings(t,e){const i=(t,e)=>({id:`recording-${t}-${e.id}`,group:t,start:1e3*e.start_time,end:1e3*e.end_time,content:"",type:"background"}),n=t=>this._dataset.get({filter:e=>"background"==e.type&&e.group===t&&void 0!==e.end}),r=t=>{this._dataset.remove(this._dataset.get({filter:e=>"background"===e.type&&e.group===t}))},l=t=>{this._dataset.add(t)};if(this._recordingRanges.hasCoverage({start:e.start,end:z(s(e.end),{seconds:30})}))return;const h=o(e,{endCap:!0}),d=this._cameraManager.generateDefaultRecordingSegmentsQueries(this._cameraIDs,{start:h.start,end:h.end});if(!d)return;const c=await this._cameraManager.getRecordingSegments(t,d),u=new Map;for(const[t,e]of c)for(const i of t.cameraIDs){let t=u.get(i);t||(t=[],u.set(i,t)),e.segments.forEach((e=>t?.push(e)))}for(const[t,e]of u.entries()){const o=n(t).concat(e.map((e=>i(t,e)))),s=a(o,60);r(t),l(s)}this._recordingRanges.add({start:h.start,end:h.end})}}
/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */function Br(t,e,i,n){var o,s=arguments.length,r=s<3?e:null===n?n=Object.getOwnPropertyDescriptor(e,i):n;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)r=Reflect.decorate(t,e,i,n);else for(var a=t.length-1;a>=0;a--)(o=t[a])&&(r=(s<3?o(r):s>3?o(e,i,r):o(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r}var Wr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Gr={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(t){return"undefined"!=typeof console&&console.warn(t)},getWeek:function(t){var e=new Date(t.getTime());e.setHours(0,0,0,0),e.setDate(e.getDate()+3-(e.getDay()+6)%7);var i=new Date(e.getFullYear(),0,4);return 1+Math.round(((e.getTime()-i.getTime())/864e5-3+(i.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Vr={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(t){var e=t%100;if(e>3&&e<21)return"th";switch(e%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},Ur=function(t,e){return void 0===e&&(e=2),("000"+t).slice(-1*e)},$r=function(t){return!0===t?1:0};function qr(t,e){var i;return function(){var n=this,o=arguments;clearTimeout(i),i=setTimeout((function(){return t.apply(n,o)}),e)}}var Xr=function(t){return t instanceof Array?t:[t]};function Kr(t,e,i){if(!0===i)return t.classList.add(e);t.classList.remove(e)}function Zr(t,e,i){var n=window.document.createElement(t);return e=e||"",i=i||"",n.className=e,void 0!==i&&(n.textContent=i),n}function Qr(t){for(;t.firstChild;)t.removeChild(t.firstChild)}function Jr(t,e){return e(t)?t:t.parentNode?Jr(t.parentNode,e):void 0}function ta(t,e){var i=Zr("div","numInputWrapper"),n=Zr("input","numInput "+t),o=Zr("span","arrowUp"),s=Zr("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?n.type="number":(n.type="text",n.pattern="\\d*"),void 0!==e)for(var r in e)n.setAttribute(r,e[r]);return i.appendChild(n),i.appendChild(o),i.appendChild(s),i}function ea(t){try{return"function"==typeof t.composedPath?t.composedPath()[0]:t.target}catch(e){return t.target}}var ia=function(){},na=function(t,e,i){return i.months[e?"shorthand":"longhand"][t]},oa={D:ia,F:function(t,e,i){t.setMonth(i.months.longhand.indexOf(e))},G:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},H:function(t,e){t.setHours(parseFloat(e))},J:function(t,e){t.setDate(parseFloat(e))},K:function(t,e,i){t.setHours(t.getHours()%12+12*$r(new RegExp(i.amPM[1],"i").test(e)))},M:function(t,e,i){t.setMonth(i.months.shorthand.indexOf(e))},S:function(t,e){t.setSeconds(parseFloat(e))},U:function(t,e){return new Date(1e3*parseFloat(e))},W:function(t,e,i){var n=parseInt(e),o=new Date(t.getFullYear(),0,2+7*(n-1),0,0,0,0);return o.setDate(o.getDate()-o.getDay()+i.firstDayOfWeek),o},Y:function(t,e){t.setFullYear(parseFloat(e))},Z:function(t,e){return new Date(e)},d:function(t,e){t.setDate(parseFloat(e))},h:function(t,e){t.setHours((t.getHours()>=12?12:0)+parseFloat(e))},i:function(t,e){t.setMinutes(parseFloat(e))},j:function(t,e){t.setDate(parseFloat(e))},l:ia,m:function(t,e){t.setMonth(parseFloat(e)-1)},n:function(t,e){t.setMonth(parseFloat(e)-1)},s:function(t,e){t.setSeconds(parseFloat(e))},u:function(t,e){return new Date(parseFloat(e))},w:ia,y:function(t,e){t.setFullYear(2e3+parseFloat(e))}},sa={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},ra={Z:function(t){return t.toISOString()},D:function(t,e,i){return e.weekdays.shorthand[ra.w(t,e,i)]},F:function(t,e,i){return na(ra.n(t,e,i)-1,!1,e)},G:function(t,e,i){return Ur(ra.h(t,e,i))},H:function(t){return Ur(t.getHours())},J:function(t,e){return void 0!==e.ordinal?t.getDate()+e.ordinal(t.getDate()):t.getDate()},K:function(t,e){return e.amPM[$r(t.getHours()>11)]},M:function(t,e){return na(t.getMonth(),!0,e)},S:function(t){return Ur(t.getSeconds())},U:function(t){return t.getTime()/1e3},W:function(t,e,i){return i.getWeek(t)},Y:function(t){return Ur(t.getFullYear(),4)},d:function(t){return Ur(t.getDate())},h:function(t){return t.getHours()%12?t.getHours()%12:12},i:function(t){return Ur(t.getMinutes())},j:function(t){return t.getDate()},l:function(t,e){return e.weekdays.longhand[t.getDay()]},m:function(t){return Ur(t.getMonth()+1)},n:function(t){return t.getMonth()+1},s:function(t){return t.getSeconds()},u:function(t){return t.getTime()},w:function(t){return t.getDay()},y:function(t){return String(t.getFullYear()).substring(2)}},aa=function(t){var e=t.config,i=void 0===e?Gr:e,n=t.l10n,o=void 0===n?Vr:n,s=t.isMobile,r=void 0!==s&&s;return function(t,e,n){var s=n||o;return void 0===i.formatDate||r?e.split("").map((function(e,n,o){return ra[e]&&"\\"!==o[n-1]?ra[e](t,s,i):"\\"!==e?e:""})).join(""):i.formatDate(t,e,s)}},la=function(t){var e=t.config,i=void 0===e?Gr:e,n=t.l10n,o=void 0===n?Vr:n;return function(t,e,n,s){if(0===t||t){var r,a=s||o,l=t;if(t instanceof Date)r=new Date(t.getTime());else if("string"!=typeof t&&void 0!==t.toFixed)r=new Date(t);else if("string"==typeof t){var h=e||(i||Gr).dateFormat,d=String(t).trim();if("today"===d)r=new Date,n=!0;else if(i&&i.parseDate)r=i.parseDate(t,h);else if(/Z$/.test(d)||/GMT$/.test(d))r=new Date(t);else{for(var c=void 0,u=[],p=0,m=0,f="";p<h.length;p++){var g=h[p],v="\\"===g,y="\\"===h[p-1]||v;if(sa[g]&&!y){f+=sa[g];var b=new RegExp(f).exec(t);b&&(c=!0)&&u["Y"!==g?"push":"unshift"]({fn:oa[g],val:b[++m]})}else v||(f+=".")}r=i&&i.noCalendar?new Date((new Date).setHours(0,0,0,0)):new Date((new Date).getFullYear(),0,1,0,0,0,0),u.forEach((function(t){var e=t.fn,i=t.val;return r=e(r,i,a)||r})),r=c?r:void 0}}if(r instanceof Date&&!isNaN(r.getTime()))return!0===n&&r.setHours(0,0,0,0),r;i.errorHandler(new Error("Invalid date provided: "+l))}}};function ha(t,e,i){return void 0===i&&(i=!0),!1!==i?new Date(t.getTime()).setHours(0,0,0,0)-new Date(e.getTime()).setHours(0,0,0,0):t.getTime()-e.getTime()}var da=function(t,e,i){return t>Math.min(e,i)&&t<Math.max(e,i)},ca=function(t,e,i){return 3600*t+60*e+i},ua=function(t){var e=Math.floor(t/3600),i=(t-3600*e)/60;return[e,i,t-3600*e-60*i]},pa={DAY:864e5};function ma(t){var e=t.defaultHour,i=t.defaultMinute,n=t.defaultSeconds;if(void 0!==t.minDate){var o=t.minDate.getHours(),s=t.minDate.getMinutes(),r=t.minDate.getSeconds();e<o&&(e=o),e===o&&i<s&&(i=s),e===o&&i===s&&n<r&&(n=t.minDate.getSeconds())}if(void 0!==t.maxDate){var a=t.maxDate.getHours(),l=t.maxDate.getMinutes();(e=Math.min(e,a))===a&&(i=Math.min(l,i)),e===a&&i===l&&(n=t.maxDate.getSeconds())}return{hours:e,minutes:i,seconds:n}}"function"!=typeof Object.assign&&(Object.assign=function(t){for(var e=[],i=1;i<arguments.length;i++)e[i-1]=arguments[i];if(!t)throw TypeError("Cannot convert undefined or null to object");for(var n=function(e){e&&Object.keys(e).forEach((function(i){return t[i]=e[i]}))},o=0,s=e;o<s.length;o++){n(s[o])}return t});var fa=window&&window.__assign||function(){return fa=Object.assign||function(t){for(var e,i=1,n=arguments.length;i<n;i++)for(var o in e=arguments[i])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t},fa.apply(this,arguments)},ga=window&&window.__spreadArrays||function(){for(var t=0,e=0,i=arguments.length;e<i;e++)t+=arguments[e].length;var n=Array(t),o=0;for(e=0;e<i;e++)for(var s=arguments[e],r=0,a=s.length;r<a;r++,o++)n[o]=s[r];return n},va=300;function ya(t,e){var i={config:fa(fa({},Gr),wa.defaultConfig),l10n:Vr};function n(){var t;return(null===(t=i.calendarContainer)||void 0===t?void 0:t.getRootNode()).activeElement||document.activeElement}function o(t){return t.bind(i)}function s(){var t=i.config;!1===t.weekNumbers&&1===t.showMonths||!0!==t.noCalendar&&window.requestAnimationFrame((function(){if(void 0!==i.calendarContainer&&(i.calendarContainer.style.visibility="hidden",i.calendarContainer.style.display="block"),void 0!==i.daysContainer){var e=(i.days.offsetWidth+1)*t.showMonths;i.daysContainer.style.width=e+"px",i.calendarContainer.style.width=e+(void 0!==i.weekWrapper?i.weekWrapper.offsetWidth:0)+"px",i.calendarContainer.style.removeProperty("visibility"),i.calendarContainer.style.removeProperty("display")}}))}function r(t){if(0===i.selectedDates.length){var e=void 0===i.config.minDate||ha(new Date,i.config.minDate)>=0?new Date:new Date(i.config.minDate.getTime()),n=ma(i.config);e.setHours(n.hours,n.minutes,n.seconds,e.getMilliseconds()),i.selectedDates=[e],i.latestSelectedDateObj=e}void 0!==t&&"blur"!==t.type&&function(t){t.preventDefault();var e="keydown"===t.type,n=ea(t),o=n;void 0!==i.amPM&&n===i.amPM&&(i.amPM.textContent=i.l10n.amPM[$r(i.amPM.textContent===i.l10n.amPM[0])]);var s=parseFloat(o.getAttribute("min")),r=parseFloat(o.getAttribute("max")),a=parseFloat(o.getAttribute("step")),l=parseInt(o.value,10),h=t.delta||(e?38===t.which?1:-1:0),d=l+a*h;if(void 0!==o.value&&2===o.value.length){var c=o===i.hourElement,u=o===i.minuteElement;d<s?(d=r+d+$r(!c)+($r(c)&&$r(!i.amPM)),u&&f(void 0,-1,i.hourElement)):d>r&&(d=o===i.hourElement?d-r-$r(!i.amPM):s,u&&f(void 0,1,i.hourElement)),i.amPM&&c&&(1===a?d+l===23:Math.abs(d-l)>a)&&(i.amPM.textContent=i.l10n.amPM[$r(i.amPM.textContent===i.l10n.amPM[0])]),o.value=Ur(d)}}(t);var o=i._input.value;a(),J(),i._input.value!==o&&i._debouncedChange()}function a(){if(void 0!==i.hourElement&&void 0!==i.minuteElement){var t,e,n=(parseInt(i.hourElement.value.slice(-2),10)||0)%24,o=(parseInt(i.minuteElement.value,10)||0)%60,s=void 0!==i.secondElement?(parseInt(i.secondElement.value,10)||0)%60:0;void 0!==i.amPM&&(t=n,e=i.amPM.textContent,n=t%12+12*$r(e===i.l10n.amPM[1]));var r=void 0!==i.config.minTime||i.config.minDate&&i.minDateHasTime&&i.latestSelectedDateObj&&0===ha(i.latestSelectedDateObj,i.config.minDate,!0),a=void 0!==i.config.maxTime||i.config.maxDate&&i.maxDateHasTime&&i.latestSelectedDateObj&&0===ha(i.latestSelectedDateObj,i.config.maxDate,!0);if(void 0!==i.config.maxTime&&void 0!==i.config.minTime&&i.config.minTime>i.config.maxTime){var l=ca(i.config.minTime.getHours(),i.config.minTime.getMinutes(),i.config.minTime.getSeconds()),d=ca(i.config.maxTime.getHours(),i.config.maxTime.getMinutes(),i.config.maxTime.getSeconds()),c=ca(n,o,s);if(c>d&&c<l){var u=ua(l);n=u[0],o=u[1],s=u[2]}}else{if(a){var p=void 0!==i.config.maxTime?i.config.maxTime:i.config.maxDate;(n=Math.min(n,p.getHours()))===p.getHours()&&(o=Math.min(o,p.getMinutes())),o===p.getMinutes()&&(s=Math.min(s,p.getSeconds()))}if(r){var m=void 0!==i.config.minTime?i.config.minTime:i.config.minDate;(n=Math.max(n,m.getHours()))===m.getHours()&&o<m.getMinutes()&&(o=m.getMinutes()),o===m.getMinutes()&&(s=Math.max(s,m.getSeconds()))}}h(n,o,s)}}function l(t){var e=t||i.latestSelectedDateObj;e&&e instanceof Date&&h(e.getHours(),e.getMinutes(),e.getSeconds())}function h(t,e,n){void 0!==i.latestSelectedDateObj&&i.latestSelectedDateObj.setHours(t%24,e,n||0,0),i.hourElement&&i.minuteElement&&!i.isMobile&&(i.hourElement.value=Ur(i.config.time_24hr?t:(12+t)%12+12*$r(t%12==0)),i.minuteElement.value=Ur(e),void 0!==i.amPM&&(i.amPM.textContent=i.l10n.amPM[$r(t>=12)]),void 0!==i.secondElement&&(i.secondElement.value=Ur(n)))}function d(t){var e=ea(t),i=parseInt(e.value)+(t.delta||0);(i/1e3>1||"Enter"===t.key&&!/[^\d]/.test(i.toString()))&&O(i)}function c(t,e,n,o){return e instanceof Array?e.forEach((function(e){return c(t,e,n,o)})):t instanceof Array?t.forEach((function(t){return c(t,e,n,o)})):(t.addEventListener(e,n,o),void i._handlers.push({remove:function(){return t.removeEventListener(e,n,o)}}))}function u(){q("onChange")}function p(t,e){var n=void 0!==t?i.parseDate(t):i.latestSelectedDateObj||(i.config.minDate&&i.config.minDate>i.now?i.config.minDate:i.config.maxDate&&i.config.maxDate<i.now?i.config.maxDate:i.now),o=i.currentYear,s=i.currentMonth;try{void 0!==n&&(i.currentYear=n.getFullYear(),i.currentMonth=n.getMonth())}catch(t){t.message="Invalid date supplied: "+n,i.config.errorHandler(t)}e&&i.currentYear!==o&&(q("onYearChange"),x()),!e||i.currentYear===o&&i.currentMonth===s||q("onMonthChange"),i.redraw()}function m(t){var e=ea(t);~e.className.indexOf("arrow")&&f(t,e.classList.contains("arrowUp")?1:-1)}function f(t,e,i){var n=t&&ea(t),o=i||n&&n.parentNode&&n.parentNode.firstChild,s=X("increment");s.delta=e,o&&o.dispatchEvent(s)}function g(t,e,n,o){var s=I(e,!0),r=Zr("span",t,e.getDate().toString());return r.dateObj=e,r.$i=o,r.setAttribute("aria-label",i.formatDate(e,i.config.ariaDateFormat)),-1===t.indexOf("hidden")&&0===ha(e,i.now)&&(i.todayDateElem=r,r.classList.add("today"),r.setAttribute("aria-current","date")),s?(r.tabIndex=-1,K(e)&&(r.classList.add("selected"),i.selectedDateElem=r,"range"===i.config.mode&&(Kr(r,"startRange",i.selectedDates[0]&&0===ha(e,i.selectedDates[0],!0)),Kr(r,"endRange",i.selectedDates[1]&&0===ha(e,i.selectedDates[1],!0)),"nextMonthDay"===t&&r.classList.add("inRange")))):r.classList.add("flatpickr-disabled"),"range"===i.config.mode&&function(t){return!("range"!==i.config.mode||i.selectedDates.length<2)&&(ha(t,i.selectedDates[0])>=0&&ha(t,i.selectedDates[1])<=0)}(e)&&!K(e)&&r.classList.add("inRange"),i.weekNumbers&&1===i.config.showMonths&&"prevMonthDay"!==t&&o%7==6&&i.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+i.config.getWeek(e)+"</span>"),q("onDayCreate",r),r}function v(t){t.focus(),"range"===i.config.mode&&F(t)}function y(t){for(var e=t>0?0:i.config.showMonths-1,n=t>0?i.config.showMonths:-1,o=e;o!=n;o+=t)for(var s=i.daysContainer.children[o],r=t>0?0:s.children.length-1,a=t>0?s.children.length:-1,l=r;l!=a;l+=t){var h=s.children[l];if(-1===h.className.indexOf("hidden")&&I(h.dateObj))return h}}function b(t,e){var o=n(),s=A(o||document.body),r=void 0!==t?t:s?o:void 0!==i.selectedDateElem&&A(i.selectedDateElem)?i.selectedDateElem:void 0!==i.todayDateElem&&A(i.todayDateElem)?i.todayDateElem:y(e>0?1:-1);void 0===r?i._input.focus():s?function(t,e){for(var n=-1===t.className.indexOf("Month")?t.dateObj.getMonth():i.currentMonth,o=e>0?i.config.showMonths:-1,s=e>0?1:-1,r=n-i.currentMonth;r!=o;r+=s)for(var a=i.daysContainer.children[r],l=n-i.currentMonth===r?t.$i+e:e<0?a.children.length-1:0,h=a.children.length,d=l;d>=0&&d<h&&d!=(e>0?h:-1);d+=s){var c=a.children[d];if(-1===c.className.indexOf("hidden")&&I(c.dateObj)&&Math.abs(t.$i-d)>=Math.abs(e))return v(c)}i.changeMonth(s),b(y(s),0)}(r,e):v(r)}function w(t,e){for(var n=(new Date(t,e,1).getDay()-i.l10n.firstDayOfWeek+7)%7,o=i.utils.getDaysInMonth((e-1+12)%12,t),s=i.utils.getDaysInMonth(e,t),r=window.document.createDocumentFragment(),a=i.config.showMonths>1,l=a?"prevMonthDay hidden":"prevMonthDay",h=a?"nextMonthDay hidden":"nextMonthDay",d=o+1-n,c=0;d<=o;d++,c++)r.appendChild(g("flatpickr-day "+l,new Date(t,e-1,d),0,c));for(d=1;d<=s;d++,c++)r.appendChild(g("flatpickr-day",new Date(t,e,d),0,c));for(var u=s+1;u<=42-n&&(1===i.config.showMonths||c%7!=0);u++,c++)r.appendChild(g("flatpickr-day "+h,new Date(t,e+1,u%s),0,c));var p=Zr("div","dayContainer");return p.appendChild(r),p}function _(){if(void 0!==i.daysContainer){Qr(i.daysContainer),i.weekNumbers&&Qr(i.weekNumbers);for(var t=document.createDocumentFragment(),e=0;e<i.config.showMonths;e++){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+e),t.appendChild(w(n.getFullYear(),n.getMonth()))}i.daysContainer.appendChild(t),i.days=i.daysContainer.firstChild,"range"===i.config.mode&&1===i.selectedDates.length&&F()}}function x(){if(!(i.config.showMonths>1||"dropdown"!==i.config.monthSelectorType)){var t=function(t){return!(void 0!==i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&t<i.config.minDate.getMonth())&&!(void 0!==i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()&&t>i.config.maxDate.getMonth())};i.monthsDropdownContainer.tabIndex=-1,i.monthsDropdownContainer.innerHTML="";for(var e=0;e<12;e++)if(t(e)){var n=Zr("option","flatpickr-monthDropdown-month");n.value=new Date(i.currentYear,e).getMonth().toString(),n.textContent=na(e,i.config.shorthandCurrentMonth,i.l10n),n.tabIndex=-1,i.currentMonth===e&&(n.selected=!0),i.monthsDropdownContainer.appendChild(n)}}}function k(){var t,e=Zr("div","flatpickr-month"),n=window.document.createDocumentFragment();i.config.showMonths>1||"static"===i.config.monthSelectorType?t=Zr("span","cur-month"):(i.monthsDropdownContainer=Zr("select","flatpickr-monthDropdown-months"),i.monthsDropdownContainer.setAttribute("aria-label",i.l10n.monthAriaLabel),c(i.monthsDropdownContainer,"change",(function(t){var e=ea(t),n=parseInt(e.value,10);i.changeMonth(n-i.currentMonth),q("onMonthChange")})),x(),t=i.monthsDropdownContainer);var o=ta("cur-year",{tabindex:"-1"}),s=o.getElementsByTagName("input")[0];s.setAttribute("aria-label",i.l10n.yearAriaLabel),i.config.minDate&&s.setAttribute("min",i.config.minDate.getFullYear().toString()),i.config.maxDate&&(s.setAttribute("max",i.config.maxDate.getFullYear().toString()),s.disabled=!!i.config.minDate&&i.config.minDate.getFullYear()===i.config.maxDate.getFullYear());var r=Zr("div","flatpickr-current-month");return r.appendChild(t),r.appendChild(o),n.appendChild(r),e.appendChild(n),{container:e,yearElement:s,monthElement:t}}function D(){Qr(i.monthNav),i.monthNav.appendChild(i.prevMonthNav),i.config.showMonths&&(i.yearElements=[],i.monthElements=[]);for(var t=i.config.showMonths;t--;){var e=k();i.yearElements.push(e.yearElement),i.monthElements.push(e.monthElement),i.monthNav.appendChild(e.container)}i.monthNav.appendChild(i.nextMonthNav)}function C(){i.weekdayContainer?Qr(i.weekdayContainer):i.weekdayContainer=Zr("div","flatpickr-weekdays");for(var t=i.config.showMonths;t--;){var e=Zr("div","flatpickr-weekdaycontainer");i.weekdayContainer.appendChild(e)}return S(),i.weekdayContainer}function S(){if(i.weekdayContainer){var t=i.l10n.firstDayOfWeek,e=ga(i.l10n.weekdays.shorthand);t>0&&t<e.length&&(e=ga(e.splice(t,e.length),e.splice(0,t)));for(var n=i.config.showMonths;n--;)i.weekdayContainer.children[n].innerHTML="\n <span class='flatpickr-weekday'>\n "+e.join("</span><span class='flatpickr-weekday'>")+"\n </span>\n "}}function T(t,e){void 0===e&&(e=!0);var n=e?t:t-i.currentMonth;n<0&&!0===i._hidePrevMonthArrow||n>0&&!0===i._hideNextMonthArrow||(i.currentMonth+=n,(i.currentMonth<0||i.currentMonth>11)&&(i.currentYear+=i.currentMonth>11?1:-1,i.currentMonth=(i.currentMonth+12)%12,q("onYearChange"),x()),_(),q("onMonthChange"),Z())}function E(t){return i.calendarContainer.contains(t)}function M(t){if(i.isOpen&&!i.config.inline){var e=ea(t),n=E(e),o=!(e===i.input||e===i.altInput||i.element.contains(e)||t.path&&t.path.indexOf&&(~t.path.indexOf(i.input)||~t.path.indexOf(i.altInput)))&&!n&&!E(t.relatedTarget),s=!i.config.ignoredFocusElements.some((function(t){return t.contains(e)}));o&&s&&(i.config.allowInput&&i.setDate(i._input.value,!1,i.config.altInput?i.config.altFormat:i.config.dateFormat),void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement&&""!==i.input.value&&void 0!==i.input.value&&r(),i.close(),i.config&&"range"===i.config.mode&&1===i.selectedDates.length&&i.clear(!1))}}function O(t){if(!(!t||i.config.minDate&&t<i.config.minDate.getFullYear()||i.config.maxDate&&t>i.config.maxDate.getFullYear())){var e=t,n=i.currentYear!==e;i.currentYear=e||i.currentYear,i.config.maxDate&&i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth=Math.min(i.config.maxDate.getMonth(),i.currentMonth):i.config.minDate&&i.currentYear===i.config.minDate.getFullYear()&&(i.currentMonth=Math.max(i.config.minDate.getMonth(),i.currentMonth)),n&&(i.redraw(),q("onYearChange"),x())}}function I(t,e){var n;void 0===e&&(e=!0);var o=i.parseDate(t,void 0,e);if(i.config.minDate&&o&&ha(o,i.config.minDate,void 0!==e?e:!i.minDateHasTime)<0||i.config.maxDate&&o&&ha(o,i.config.maxDate,void 0!==e?e:!i.maxDateHasTime)>0)return!1;if(!i.config.enable&&0===i.config.disable.length)return!0;if(void 0===o)return!1;for(var s=!!i.config.enable,r=null!==(n=i.config.enable)&&void 0!==n?n:i.config.disable,a=0,l=void 0;a<r.length;a++){if("function"==typeof(l=r[a])&&l(o))return s;if(l instanceof Date&&void 0!==o&&l.getTime()===o.getTime())return s;if("string"==typeof l){var h=i.parseDate(l,void 0,!0);return h&&h.getTime()===o.getTime()?s:!s}if("object"==typeof l&&void 0!==o&&l.from&&l.to&&o.getTime()>=l.from.getTime()&&o.getTime()<=l.to.getTime())return s}return!s}function A(t){return void 0!==i.daysContainer&&(-1===t.className.indexOf("hidden")&&-1===t.className.indexOf("flatpickr-disabled")&&i.daysContainer.contains(t))}function P(t){var e=t.target===i._input,n=i._input.value.trimEnd()!==Q();!e||!n||t.relatedTarget&&E(t.relatedTarget)||i.setDate(i._input.value,!0,t.target===i.altInput?i.config.altFormat:i.config.dateFormat)}function N(e){var o=ea(e),s=i.config.wrap?t.contains(o):o===i._input,l=i.config.allowInput,h=i.isOpen&&(!l||!s),d=i.config.inline&&s&&!l;if(13===e.keyCode&&s){if(l)return i.setDate(i._input.value,!0,o===i.altInput?i.config.altFormat:i.config.dateFormat),i.close(),o.blur();i.open()}else if(E(o)||h||d){var c=!!i.timeContainer&&i.timeContainer.contains(o);switch(e.keyCode){case 13:c?(e.preventDefault(),r(),B()):W(e);break;case 27:e.preventDefault(),B();break;case 8:case 46:s&&!i.config.allowInput&&(e.preventDefault(),i.clear());break;case 37:case 39:if(c||s)i.hourElement&&i.hourElement.focus();else{e.preventDefault();var u=n();if(void 0!==i.daysContainer&&(!1===l||u&&A(u))){var p=39===e.keyCode?1:-1;e.ctrlKey?(e.stopPropagation(),T(p),b(y(1),0)):b(void 0,p)}}break;case 38:case 40:e.preventDefault();var m=40===e.keyCode?1:-1;i.daysContainer&&void 0!==o.$i||o===i.input||o===i.altInput?e.ctrlKey?(e.stopPropagation(),O(i.currentYear-m),b(y(1),0)):c||b(void 0,7*m):o===i.currentYearElement?O(i.currentYear-m):i.config.enableTime&&(!c&&i.hourElement&&i.hourElement.focus(),r(e),i._debouncedChange());break;case 9:if(c){var f=[i.hourElement,i.minuteElement,i.secondElement,i.amPM].concat(i.pluginElements).filter((function(t){return t})),g=f.indexOf(o);if(-1!==g){var v=f[g+(e.shiftKey?-1:1)];e.preventDefault(),(v||i._input).focus()}}else!i.config.noCalendar&&i.daysContainer&&i.daysContainer.contains(o)&&e.shiftKey&&(e.preventDefault(),i._input.focus())}}if(void 0!==i.amPM&&o===i.amPM)switch(e.key){case i.l10n.amPM[0].charAt(0):case i.l10n.amPM[0].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[0],a(),J();break;case i.l10n.amPM[1].charAt(0):case i.l10n.amPM[1].charAt(0).toLowerCase():i.amPM.textContent=i.l10n.amPM[1],a(),J()}(s||E(o))&&q("onKeyDown",e)}function F(t,e){if(void 0===e&&(e="flatpickr-day"),1===i.selectedDates.length&&(!t||t.classList.contains(e)&&!t.classList.contains("flatpickr-disabled"))){for(var n=t?t.dateObj.getTime():i.days.firstElementChild.dateObj.getTime(),o=i.parseDate(i.selectedDates[0],void 0,!0).getTime(),s=Math.min(n,i.selectedDates[0].getTime()),r=Math.max(n,i.selectedDates[0].getTime()),a=!1,l=0,h=0,d=s;d<r;d+=pa.DAY)I(new Date(d),!0)||(a=a||d>s&&d<r,d<o&&(!l||d>l)?l=d:d>o&&(!h||d<h)&&(h=d));Array.from(i.rContainer.querySelectorAll("*:nth-child(-n+"+i.config.showMonths+") > ."+e)).forEach((function(e){var s=e.dateObj.getTime(),r=l>0&&s<l||h>0&&s>h;if(r)return e.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach((function(t){e.classList.remove(t)}));a&&!r||(["startRange","inRange","endRange","notAllowed"].forEach((function(t){e.classList.remove(t)})),void 0!==t&&(t.classList.add(n<=i.selectedDates[0].getTime()?"startRange":"endRange"),o<n&&s===o?e.classList.add("startRange"):o>n&&s===o&&e.classList.add("endRange"),s>=l&&(0===h||s<=h)&&da(s,o,n)&&e.classList.add("inRange")))}))}}function R(){!i.isOpen||i.config.static||i.config.inline||H()}function L(t){return function(e){var n=i.config["_"+t+"Date"]=i.parseDate(e,i.config.dateFormat),o=i.config["_"+("min"===t?"max":"min")+"Date"];void 0!==n&&(i["min"===t?"minDateHasTime":"maxDateHasTime"]=n.getHours()>0||n.getMinutes()>0||n.getSeconds()>0),i.selectedDates&&(i.selectedDates=i.selectedDates.filter((function(t){return I(t)})),i.selectedDates.length||"min"!==t||l(n),J()),i.daysContainer&&(z(),void 0!==n?i.currentYearElement[t]=n.getFullYear().toString():i.currentYearElement.removeAttribute(t),i.currentYearElement.disabled=!!o&&void 0!==n&&o.getFullYear()===n.getFullYear())}}function j(){return i.config.wrap?t.querySelector("[data-input]"):t}function Y(){"object"!=typeof i.config.locale&&void 0===wa.l10ns[i.config.locale]&&i.config.errorHandler(new Error("flatpickr: invalid locale "+i.config.locale)),i.l10n=fa(fa({},wa.l10ns.default),"object"==typeof i.config.locale?i.config.locale:"default"!==i.config.locale?wa.l10ns[i.config.locale]:void 0),sa.D="("+i.l10n.weekdays.shorthand.join("|")+")",sa.l="("+i.l10n.weekdays.longhand.join("|")+")",sa.M="("+i.l10n.months.shorthand.join("|")+")",sa.F="("+i.l10n.months.longhand.join("|")+")",sa.K="("+i.l10n.amPM[0]+"|"+i.l10n.amPM[1]+"|"+i.l10n.amPM[0].toLowerCase()+"|"+i.l10n.amPM[1].toLowerCase()+")",void 0===fa(fa({},e),JSON.parse(JSON.stringify(t.dataset||{}))).time_24hr&&void 0===wa.defaultConfig.time_24hr&&(i.config.time_24hr=i.l10n.time_24hr),i.formatDate=aa(i),i.parseDate=la({config:i.config,l10n:i.l10n})}function H(t){if("function"!=typeof i.config.position){if(void 0!==i.calendarContainer){q("onPreCalendarPosition");var e=t||i._positionElement,n=Array.prototype.reduce.call(i.calendarContainer.children,(function(t,e){return t+e.offsetHeight}),0),o=i.calendarContainer.offsetWidth,s=i.config.position.split(" "),r=s[0],a=s.length>1?s[1]:null,l=e.getBoundingClientRect(),h=window.innerHeight-l.bottom,d="above"===r||"below"!==r&&h<n&&l.top>n,c=window.pageYOffset+l.top+(d?-n-2:e.offsetHeight+2);if(Kr(i.calendarContainer,"arrowTop",!d),Kr(i.calendarContainer,"arrowBottom",d),!i.config.inline){var u=window.pageXOffset+l.left,p=!1,m=!1;"center"===a?(u-=(o-l.width)/2,p=!0):"right"===a&&(u-=o-l.width,m=!0),Kr(i.calendarContainer,"arrowLeft",!p&&!m),Kr(i.calendarContainer,"arrowCenter",p),Kr(i.calendarContainer,"arrowRight",m);var f=window.document.body.offsetWidth-(window.pageXOffset+l.right),g=u+o>window.document.body.offsetWidth,v=f+o>window.document.body.offsetWidth;if(Kr(i.calendarContainer,"rightMost",g),!i.config.static)if(i.calendarContainer.style.top=c+"px",g)if(v){var y=function(){for(var t=null,e=0;e<document.styleSheets.length;e++){var i=document.styleSheets[e];if(i.cssRules){try{i.cssRules}catch(t){continue}t=i;break}}return null!=t?t:(n=document.createElement("style"),document.head.appendChild(n),n.sheet);var n}();if(void 0===y)return;var b=window.document.body.offsetWidth,w=Math.max(0,b/2-o/2),_=y.cssRules.length,x="{left:"+l.left+"px;right:auto;}";Kr(i.calendarContainer,"rightMost",!1),Kr(i.calendarContainer,"centerMost",!0),y.insertRule(".flatpickr-calendar.centerMost:before,.flatpickr-calendar.centerMost:after"+x,_),i.calendarContainer.style.left=w+"px",i.calendarContainer.style.right="auto"}else i.calendarContainer.style.left="auto",i.calendarContainer.style.right=f+"px";else i.calendarContainer.style.left=u+"px",i.calendarContainer.style.right="auto"}}}else i.config.position(i,t)}function z(){i.config.noCalendar||i.isMobile||(x(),Z(),_())}function B(){i._input.focus(),-1!==window.navigator.userAgent.indexOf("MSIE")||void 0!==navigator.msMaxTouchPoints?setTimeout(i.close,0):i.close()}function W(t){t.preventDefault(),t.stopPropagation();var e=Jr(ea(t),(function(t){return t.classList&&t.classList.contains("flatpickr-day")&&!t.classList.contains("flatpickr-disabled")&&!t.classList.contains("notAllowed")}));if(void 0!==e){var n=e,o=i.latestSelectedDateObj=new Date(n.dateObj.getTime()),s=(o.getMonth()<i.currentMonth||o.getMonth()>i.currentMonth+i.config.showMonths-1)&&"range"!==i.config.mode;if(i.selectedDateElem=n,"single"===i.config.mode)i.selectedDates=[o];else if("multiple"===i.config.mode){var r=K(o);r?i.selectedDates.splice(parseInt(r),1):i.selectedDates.push(o)}else"range"===i.config.mode&&(2===i.selectedDates.length&&i.clear(!1,!1),i.latestSelectedDateObj=o,i.selectedDates.push(o),0!==ha(o,i.selectedDates[0],!0)&&i.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()})));if(a(),s){var l=i.currentYear!==o.getFullYear();i.currentYear=o.getFullYear(),i.currentMonth=o.getMonth(),l&&(q("onYearChange"),x()),q("onMonthChange")}if(Z(),_(),J(),s||"range"===i.config.mode||1!==i.config.showMonths?void 0!==i.selectedDateElem&&void 0===i.hourElement&&i.selectedDateElem&&i.selectedDateElem.focus():v(n),void 0!==i.hourElement&&void 0!==i.hourElement&&i.hourElement.focus(),i.config.closeOnSelect){var h="single"===i.config.mode&&!i.config.enableTime,d="range"===i.config.mode&&2===i.selectedDates.length&&!i.config.enableTime;(h||d)&&B()}u()}}i.parseDate=la({config:i.config,l10n:i.l10n}),i._handlers=[],i.pluginElements=[],i.loadedPlugins=[],i._bind=c,i._setHoursFromDate=l,i._positionCalendar=H,i.changeMonth=T,i.changeYear=O,i.clear=function(t,e){void 0===t&&(t=!0);void 0===e&&(e=!0);i.input.value="",void 0!==i.altInput&&(i.altInput.value="");void 0!==i.mobileInput&&(i.mobileInput.value="");i.selectedDates=[],i.latestSelectedDateObj=void 0,!0===e&&(i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth());if(!0===i.config.enableTime){var n=ma(i.config);h(n.hours,n.minutes,n.seconds)}i.redraw(),t&&q("onChange")},i.close=function(){i.isOpen=!1,i.isMobile||(void 0!==i.calendarContainer&&i.calendarContainer.classList.remove("open"),void 0!==i._input&&i._input.classList.remove("active"));q("onClose")},i.onMouseOver=F,i._createElement=Zr,i.createDay=g,i.destroy=function(){void 0!==i.config&&q("onDestroy");for(var t=i._handlers.length;t--;)i._handlers[t].remove();if(i._handlers=[],i.mobileInput)i.mobileInput.parentNode&&i.mobileInput.parentNode.removeChild(i.mobileInput),i.mobileInput=void 0;else if(i.calendarContainer&&i.calendarContainer.parentNode)if(i.config.static&&i.calendarContainer.parentNode){var e=i.calendarContainer.parentNode;if(e.lastChild&&e.removeChild(e.lastChild),e.parentNode){for(;e.firstChild;)e.parentNode.insertBefore(e.firstChild,e);e.parentNode.removeChild(e)}}else i.calendarContainer.parentNode.removeChild(i.calendarContainer);i.altInput&&(i.input.type="text",i.altInput.parentNode&&i.altInput.parentNode.removeChild(i.altInput),delete i.altInput);i.input&&(i.input.type=i.input._type,i.input.classList.remove("flatpickr-input"),i.input.removeAttribute("readonly"));["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach((function(t){try{delete i[t]}catch(t){}}))},i.isEnabled=I,i.jumpToDate=p,i.updateValue=J,i.open=function(t,e){void 0===e&&(e=i._positionElement);if(!0===i.isMobile){if(t){t.preventDefault();var n=ea(t);n&&n.blur()}return void 0!==i.mobileInput&&(i.mobileInput.focus(),i.mobileInput.click()),void q("onOpen")}if(i._input.disabled||i.config.inline)return;var o=i.isOpen;i.isOpen=!0,o||(i.calendarContainer.classList.add("open"),i._input.classList.add("active"),q("onOpen"),H(e));!0===i.config.enableTime&&!0===i.config.noCalendar&&(!1!==i.config.allowInput||void 0!==t&&i.timeContainer.contains(t.relatedTarget)||setTimeout((function(){return i.hourElement.select()}),50))},i.redraw=z,i.set=function(t,e){if(null!==t&&"object"==typeof t)for(var n in Object.assign(i.config,t),t)void 0!==G[n]&&G[n].forEach((function(t){return t()}));else i.config[t]=e,void 0!==G[t]?G[t].forEach((function(t){return t()})):Wr.indexOf(t)>-1&&(i.config[t]=Xr(e));i.redraw(),J(!0)},i.setDate=function(t,e,n){void 0===e&&(e=!1);void 0===n&&(n=i.config.dateFormat);if(0!==t&&!t||t instanceof Array&&0===t.length)return i.clear(e);V(t,n),i.latestSelectedDateObj=i.selectedDates[i.selectedDates.length-1],i.redraw(),p(void 0,e),l(),0===i.selectedDates.length&&i.clear(!1);J(e),e&&q("onChange")},i.toggle=function(t){if(!0===i.isOpen)return i.close();i.open(t)};var G={locale:[Y,S],showMonths:[D,s,C],minDate:[p],maxDate:[p],positionElement:[$],clickOpens:[function(){!0===i.config.clickOpens?(c(i._input,"focus",i.open),c(i._input,"click",i.open)):(i._input.removeEventListener("focus",i.open),i._input.removeEventListener("click",i.open))}]};function V(t,e){var n=[];if(t instanceof Array)n=t.map((function(t){return i.parseDate(t,e)}));else if(t instanceof Date||"number"==typeof t)n=[i.parseDate(t,e)];else if("string"==typeof t)switch(i.config.mode){case"single":case"time":n=[i.parseDate(t,e)];break;case"multiple":n=t.split(i.config.conjunction).map((function(t){return i.parseDate(t,e)}));break;case"range":n=t.split(i.l10n.rangeSeparator).map((function(t){return i.parseDate(t,e)}))}else i.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(t)));i.selectedDates=i.config.allowInvalidPreload?n:n.filter((function(t){return t instanceof Date&&I(t,!1)})),"range"===i.config.mode&&i.selectedDates.sort((function(t,e){return t.getTime()-e.getTime()}))}function U(t){return t.slice().map((function(t){return"string"==typeof t||"number"==typeof t||t instanceof Date?i.parseDate(t,void 0,!0):t&&"object"==typeof t&&t.from&&t.to?{from:i.parseDate(t.from,void 0),to:i.parseDate(t.to,void 0)}:t})).filter((function(t){return t}))}function $(){i._positionElement=i.config.positionElement||i._input}function q(t,e){if(void 0!==i.config){var n=i.config[t];if(void 0!==n&&n.length>0)for(var o=0;n[o]&&o<n.length;o++)n[o](i.selectedDates,i.input.value,i,e);"onChange"===t&&(i.input.dispatchEvent(X("change")),i.input.dispatchEvent(X("input")))}}function X(t){var e=document.createEvent("Event");return e.initEvent(t,!0,!0),e}function K(t){for(var e=0;e<i.selectedDates.length;e++){var n=i.selectedDates[e];if(n instanceof Date&&0===ha(n,t))return""+e}return!1}function Z(){i.config.noCalendar||i.isMobile||!i.monthNav||(i.yearElements.forEach((function(t,e){var n=new Date(i.currentYear,i.currentMonth,1);n.setMonth(i.currentMonth+e),i.config.showMonths>1||"static"===i.config.monthSelectorType?i.monthElements[e].textContent=na(n.getMonth(),i.config.shorthandCurrentMonth,i.l10n)+" ":i.monthsDropdownContainer.value=n.getMonth().toString(),t.value=n.getFullYear().toString()})),i._hidePrevMonthArrow=void 0!==i.config.minDate&&(i.currentYear===i.config.minDate.getFullYear()?i.currentMonth<=i.config.minDate.getMonth():i.currentYear<i.config.minDate.getFullYear()),i._hideNextMonthArrow=void 0!==i.config.maxDate&&(i.currentYear===i.config.maxDate.getFullYear()?i.currentMonth+1>i.config.maxDate.getMonth():i.currentYear>i.config.maxDate.getFullYear()))}function Q(t){var e=t||(i.config.altInput?i.config.altFormat:i.config.dateFormat);return i.selectedDates.map((function(t){return i.formatDate(t,e)})).filter((function(t,e,n){return"range"!==i.config.mode||i.config.enableTime||n.indexOf(t)===e})).join("range"!==i.config.mode?i.config.conjunction:i.l10n.rangeSeparator)}function J(t){void 0===t&&(t=!0),void 0!==i.mobileInput&&i.mobileFormatStr&&(i.mobileInput.value=void 0!==i.latestSelectedDateObj?i.formatDate(i.latestSelectedDateObj,i.mobileFormatStr):""),i.input.value=Q(i.config.dateFormat),void 0!==i.altInput&&(i.altInput.value=Q(i.config.altFormat)),!1!==t&&q("onValueUpdate")}function tt(t){var e=ea(t),n=i.prevMonthNav.contains(e),o=i.nextMonthNav.contains(e);n||o?T(n?-1:1):i.yearElements.indexOf(e)>=0?e.select():e.classList.contains("arrowUp")?i.changeYear(i.currentYear+1):e.classList.contains("arrowDown")&&i.changeYear(i.currentYear-1)}return function(){i.element=i.input=t,i.isOpen=!1,function(){var n=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],s=fa(fa({},JSON.parse(JSON.stringify(t.dataset||{}))),e),r={};i.config.parseDate=s.parseDate,i.config.formatDate=s.formatDate,Object.defineProperty(i.config,"enable",{get:function(){return i.config._enable},set:function(t){i.config._enable=U(t)}}),Object.defineProperty(i.config,"disable",{get:function(){return i.config._disable},set:function(t){i.config._disable=U(t)}});var a="time"===s.mode;if(!s.dateFormat&&(s.enableTime||a)){var l=wa.defaultConfig.dateFormat||Gr.dateFormat;r.dateFormat=s.noCalendar||a?"H:i"+(s.enableSeconds?":S":""):l+" H:i"+(s.enableSeconds?":S":"")}if(s.altInput&&(s.enableTime||a)&&!s.altFormat){var h=wa.defaultConfig.altFormat||Gr.altFormat;r.altFormat=s.noCalendar||a?"h:i"+(s.enableSeconds?":S K":" K"):h+" h:i"+(s.enableSeconds?":S":"")+" K"}Object.defineProperty(i.config,"minDate",{get:function(){return i.config._minDate},set:L("min")}),Object.defineProperty(i.config,"maxDate",{get:function(){return i.config._maxDate},set:L("max")});var d=function(t){return function(e){i.config["min"===t?"_minTime":"_maxTime"]=i.parseDate(e,"H:i:S")}};Object.defineProperty(i.config,"minTime",{get:function(){return i.config._minTime},set:d("min")}),Object.defineProperty(i.config,"maxTime",{get:function(){return i.config._maxTime},set:d("max")}),"time"===s.mode&&(i.config.noCalendar=!0,i.config.enableTime=!0);Object.assign(i.config,r,s);for(var c=0;c<n.length;c++)i.config[n[c]]=!0===i.config[n[c]]||"true"===i.config[n[c]];Wr.filter((function(t){return void 0!==i.config[t]})).forEach((function(t){i.config[t]=Xr(i.config[t]||[]).map(o)})),i.isMobile=!i.config.disableMobile&&!i.config.inline&&"single"===i.config.mode&&!i.config.disable.length&&!i.config.enable&&!i.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(c=0;c<i.config.plugins.length;c++){var u=i.config.plugins[c](i)||{};for(var p in u)Wr.indexOf(p)>-1?i.config[p]=Xr(u[p]).map(o).concat(i.config[p]):void 0===s[p]&&(i.config[p]=u[p])}s.altInputClass||(i.config.altInputClass=j().className+" "+i.config.altInputClass);q("onParseConfig")}(),Y(),function(){if(i.input=j(),!i.input)return void i.config.errorHandler(new Error("Invalid input element specified"));i.input._type=i.input.type,i.input.type="text",i.input.classList.add("flatpickr-input"),i._input=i.input,i.config.altInput&&(i.altInput=Zr(i.input.nodeName,i.config.altInputClass),i._input=i.altInput,i.altInput.placeholder=i.input.placeholder,i.altInput.disabled=i.input.disabled,i.altInput.required=i.input.required,i.altInput.tabIndex=i.input.tabIndex,i.altInput.type="text",i.input.setAttribute("type","hidden"),!i.config.static&&i.input.parentNode&&i.input.parentNode.insertBefore(i.altInput,i.input.nextSibling));i.config.allowInput||i._input.setAttribute("readonly","readonly");$()}(),function(){i.selectedDates=[],i.now=i.parseDate(i.config.now)||new Date;var t=i.config.defaultDate||("INPUT"!==i.input.nodeName&&"TEXTAREA"!==i.input.nodeName||!i.input.placeholder||i.input.value!==i.input.placeholder?i.input.value:null);t&&V(t,i.config.dateFormat);i._initialDate=i.selectedDates.length>0?i.selectedDates[0]:i.config.minDate&&i.config.minDate.getTime()>i.now.getTime()?i.config.minDate:i.config.maxDate&&i.config.maxDate.getTime()<i.now.getTime()?i.config.maxDate:i.now,i.currentYear=i._initialDate.getFullYear(),i.currentMonth=i._initialDate.getMonth(),i.selectedDates.length>0&&(i.latestSelectedDateObj=i.selectedDates[0]);void 0!==i.config.minTime&&(i.config.minTime=i.parseDate(i.config.minTime,"H:i"));void 0!==i.config.maxTime&&(i.config.maxTime=i.parseDate(i.config.maxTime,"H:i"));i.minDateHasTime=!!i.config.minDate&&(i.config.minDate.getHours()>0||i.config.minDate.getMinutes()>0||i.config.minDate.getSeconds()>0),i.maxDateHasTime=!!i.config.maxDate&&(i.config.maxDate.getHours()>0||i.config.maxDate.getMinutes()>0||i.config.maxDate.getSeconds()>0)}(),i.utils={getDaysInMonth:function(t,e){return void 0===t&&(t=i.currentMonth),void 0===e&&(e=i.currentYear),1===t&&(e%4==0&&e%100!=0||e%400==0)?29:i.l10n.daysInMonth[t]}},i.isMobile||function(){var t=window.document.createDocumentFragment();if(i.calendarContainer=Zr("div","flatpickr-calendar"),i.calendarContainer.tabIndex=-1,!i.config.noCalendar){if(t.appendChild((i.monthNav=Zr("div","flatpickr-months"),i.yearElements=[],i.monthElements=[],i.prevMonthNav=Zr("span","flatpickr-prev-month"),i.prevMonthNav.innerHTML=i.config.prevArrow,i.nextMonthNav=Zr("span","flatpickr-next-month"),i.nextMonthNav.innerHTML=i.config.nextArrow,D(),Object.defineProperty(i,"_hidePrevMonthArrow",{get:function(){return i.__hidePrevMonthArrow},set:function(t){i.__hidePrevMonthArrow!==t&&(Kr(i.prevMonthNav,"flatpickr-disabled",t),i.__hidePrevMonthArrow=t)}}),Object.defineProperty(i,"_hideNextMonthArrow",{get:function(){return i.__hideNextMonthArrow},set:function(t){i.__hideNextMonthArrow!==t&&(Kr(i.nextMonthNav,"flatpickr-disabled",t),i.__hideNextMonthArrow=t)}}),i.currentYearElement=i.yearElements[0],Z(),i.monthNav)),i.innerContainer=Zr("div","flatpickr-innerContainer"),i.config.weekNumbers){var e=function(){i.calendarContainer.classList.add("hasWeeks");var t=Zr("div","flatpickr-weekwrapper");t.appendChild(Zr("span","flatpickr-weekday",i.l10n.weekAbbreviation));var e=Zr("div","flatpickr-weeks");return t.appendChild(e),{weekWrapper:t,weekNumbers:e}}(),n=e.weekWrapper,o=e.weekNumbers;i.innerContainer.appendChild(n),i.weekNumbers=o,i.weekWrapper=n}i.rContainer=Zr("div","flatpickr-rContainer"),i.rContainer.appendChild(C()),i.daysContainer||(i.daysContainer=Zr("div","flatpickr-days"),i.daysContainer.tabIndex=-1),_(),i.rContainer.appendChild(i.daysContainer),i.innerContainer.appendChild(i.rContainer),t.appendChild(i.innerContainer)}i.config.enableTime&&t.appendChild(function(){i.calendarContainer.classList.add("hasTime"),i.config.noCalendar&&i.calendarContainer.classList.add("noCalendar");var t=ma(i.config);i.timeContainer=Zr("div","flatpickr-time"),i.timeContainer.tabIndex=-1;var e=Zr("span","flatpickr-time-separator",":"),n=ta("flatpickr-hour",{"aria-label":i.l10n.hourAriaLabel});i.hourElement=n.getElementsByTagName("input")[0];var o=ta("flatpickr-minute",{"aria-label":i.l10n.minuteAriaLabel});i.minuteElement=o.getElementsByTagName("input")[0],i.hourElement.tabIndex=i.minuteElement.tabIndex=-1,i.hourElement.value=Ur(i.latestSelectedDateObj?i.latestSelectedDateObj.getHours():i.config.time_24hr?t.hours:function(t){switch(t%24){case 0:case 12:return 12;default:return t%12}}(t.hours)),i.minuteElement.value=Ur(i.latestSelectedDateObj?i.latestSelectedDateObj.getMinutes():t.minutes),i.hourElement.setAttribute("step",i.config.hourIncrement.toString()),i.minuteElement.setAttribute("step",i.config.minuteIncrement.toString()),i.hourElement.setAttribute("min",i.config.time_24hr?"0":"1"),i.hourElement.setAttribute("max",i.config.time_24hr?"23":"12"),i.hourElement.setAttribute("maxlength","2"),i.minuteElement.setAttribute("min","0"),i.minuteElement.setAttribute("max","59"),i.minuteElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(n),i.timeContainer.appendChild(e),i.timeContainer.appendChild(o),i.config.time_24hr&&i.timeContainer.classList.add("time24hr");if(i.config.enableSeconds){i.timeContainer.classList.add("hasSeconds");var s=ta("flatpickr-second");i.secondElement=s.getElementsByTagName("input")[0],i.secondElement.value=Ur(i.latestSelectedDateObj?i.latestSelectedDateObj.getSeconds():t.seconds),i.secondElement.setAttribute("step",i.minuteElement.getAttribute("step")),i.secondElement.setAttribute("min","0"),i.secondElement.setAttribute("max","59"),i.secondElement.setAttribute("maxlength","2"),i.timeContainer.appendChild(Zr("span","flatpickr-time-separator",":")),i.timeContainer.appendChild(s)}i.config.time_24hr||(i.amPM=Zr("span","flatpickr-am-pm",i.l10n.amPM[$r((i.latestSelectedDateObj?i.hourElement.value:i.config.defaultHour)>11)]),i.amPM.title=i.l10n.toggleTitle,i.amPM.tabIndex=-1,i.timeContainer.appendChild(i.amPM));return i.timeContainer}());Kr(i.calendarContainer,"rangeMode","range"===i.config.mode),Kr(i.calendarContainer,"animate",!0===i.config.animate),Kr(i.calendarContainer,"multiMonth",i.config.showMonths>1),i.calendarContainer.appendChild(t);var s=void 0!==i.config.appendTo&&void 0!==i.config.appendTo.nodeType;if((i.config.inline||i.config.static)&&(i.calendarContainer.classList.add(i.config.inline?"inline":"static"),i.config.inline&&(!s&&i.element.parentNode?i.element.parentNode.insertBefore(i.calendarContainer,i._input.nextSibling):void 0!==i.config.appendTo&&i.config.appendTo.appendChild(i.calendarContainer)),i.config.static)){var r=Zr("div","flatpickr-wrapper");i.element.parentNode&&i.element.parentNode.insertBefore(r,i.element),r.appendChild(i.element),i.altInput&&r.appendChild(i.altInput),r.appendChild(i.calendarContainer)}i.config.static||i.config.inline||(void 0!==i.config.appendTo?i.config.appendTo:window.document.body).appendChild(i.calendarContainer)}(),function(){i.config.wrap&&["open","close","toggle","clear"].forEach((function(t){Array.prototype.forEach.call(i.element.querySelectorAll("[data-"+t+"]"),(function(e){return c(e,"click",i[t])}))}));if(i.isMobile)return void function(){var t=i.config.enableTime?i.config.noCalendar?"time":"datetime-local":"date";i.mobileInput=Zr("input",i.input.className+" flatpickr-mobile"),i.mobileInput.tabIndex=1,i.mobileInput.type=t,i.mobileInput.disabled=i.input.disabled,i.mobileInput.required=i.input.required,i.mobileInput.placeholder=i.input.placeholder,i.mobileFormatStr="datetime-local"===t?"Y-m-d\\TH:i:S":"date"===t?"Y-m-d":"H:i:S",i.selectedDates.length>0&&(i.mobileInput.defaultValue=i.mobileInput.value=i.formatDate(i.selectedDates[0],i.mobileFormatStr));i.config.minDate&&(i.mobileInput.min=i.formatDate(i.config.minDate,"Y-m-d"));i.config.maxDate&&(i.mobileInput.max=i.formatDate(i.config.maxDate,"Y-m-d"));i.input.getAttribute("step")&&(i.mobileInput.step=String(i.input.getAttribute("step")));i.input.type="hidden",void 0!==i.altInput&&(i.altInput.type="hidden");try{i.input.parentNode&&i.input.parentNode.insertBefore(i.mobileInput,i.input.nextSibling)}catch(t){}c(i.mobileInput,"change",(function(t){i.setDate(ea(t).value,!1,i.mobileFormatStr),q("onChange"),q("onClose")}))}();var t=qr(R,50);i._debouncedChange=qr(u,va),i.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&c(i.daysContainer,"mouseover",(function(t){"range"===i.config.mode&&F(ea(t))}));c(i._input,"keydown",N),void 0!==i.calendarContainer&&c(i.calendarContainer,"keydown",N);i.config.inline||i.config.static||c(window,"resize",t);void 0!==window.ontouchstart?c(window.document,"touchstart",M):c(window.document,"mousedown",M);c(window.document,"focus",M,{capture:!0}),!0===i.config.clickOpens&&(c(i._input,"focus",i.open),c(i._input,"click",i.open));void 0!==i.daysContainer&&(c(i.monthNav,"click",tt),c(i.monthNav,["keyup","increment"],d),c(i.daysContainer,"click",W));if(void 0!==i.timeContainer&&void 0!==i.minuteElement&&void 0!==i.hourElement){var e=function(t){return ea(t).select()};c(i.timeContainer,["increment"],r),c(i.timeContainer,"blur",r,{capture:!0}),c(i.timeContainer,"click",m),c([i.hourElement,i.minuteElement],["focus","click"],e),void 0!==i.secondElement&&c(i.secondElement,"focus",(function(){return i.secondElement&&i.secondElement.select()})),void 0!==i.amPM&&c(i.amPM,"click",(function(t){r(t)}))}i.config.allowInput&&c(i._input,"blur",P)}(),(i.selectedDates.length||i.config.noCalendar)&&(i.config.enableTime&&l(i.config.noCalendar?i.latestSelectedDateObj:void 0),J(!1)),s();var n=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!i.isMobile&&n&&H(),q("onReady")}(),i}function ba(t,e){for(var i=Array.prototype.slice.call(t).filter((function(t){return t instanceof HTMLElement})),n=[],o=0;o<i.length;o++){var s=i[o];try{if(null!==s.getAttribute("data-fp-omit"))continue;void 0!==s._flatpickr&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=ya(s,e||{}),n.push(s._flatpickr)}catch(t){console.error(t)}}return 1===n.length?n[0]:n}"undefined"!=typeof HTMLElement&&"undefined"!=typeof HTMLCollection&&"undefined"!=typeof NodeList&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return ba(this,t)},HTMLElement.prototype.flatpickr=function(t){return ba([this],t)});var wa=function(t,e){return"string"==typeof t?ba(window.document.querySelectorAll(t),e):t instanceof Node?ba([t],e):ba(t,e)};wa.defaultConfig={},wa.l10ns={en:fa({},Vr),default:fa({},Vr)},wa.localize=function(t){wa.l10ns.default=fa(fa({},wa.l10ns.default),t)},wa.setDefaults=function(t){wa.defaultConfig=fa(fa({},wa.defaultConfig),t)},wa.parseDate=la({}),wa.formatDate=aa({}),wa.compareDates=ha,"undefined"!=typeof jQuery&&void 0!==jQuery.fn&&(jQuery.fn.flatpickr=function(t){return ba(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+("string"==typeof t?parseInt(t,10):t))},"undefined"!=typeof window&&(window.flatpickr=wa);const _a="https://npmcdn.com/flatpickr@4.6.9/dist/themes/";var xa;!function(t){t.light="light",t.dark="dark",t.materialBlue="material_blue",t.materialGreen="material_green",t.materialOrange="material_orange",t.materialRed="material_red",t.airbnb="airbnb",t.confetti="confetti",t.none="none"}(xa||(xa={}));class ka{constructor(t){this.theme=t,this.theme=t}async initStyles(){const t=(e=this.theme,`${_a}${e}.css`);var e;this.isThemeLoaded()||(this.appendThemeStyles(t),await this.waitForStyleToLoad((()=>this.isThemeLoaded())))}waitForStyleToLoad(t){return new Promise(((e,i)=>{const n=(i=0)=>{if(t())return e();if(i>10)throw Error("Styles took too long to load, or were not able to be loaded");setTimeout((()=>n(i++)),100)};n()}))}isThemeLoaded(){if(this.theme===xa.none)return!0;return Array.from(document.styleSheets).map((t=>t.href)).some((t=>null!=t&&new RegExp("https://npmcdn.com/flatpickr@4.6.9/dist/themes").test(t)))}appendThemeStyles(t){const e=document.createElement("link");e.rel="stylesheet",e.type="text/css",e.href=t,document.head.append(e)}}const Da="https://npmcdn.com/flatpickr@4.6.9/dist/l10n";const Ca="https://npmcdn.com/flatpickr@4.6.9/dist";let Sa=class extends d{constructor(){super(...arguments),this.placeholder="",this.altFormat="F j, Y",this.altInput=!1,this.altInputClass="",this.allowInput=!1,this.ariaDateFormat="F j, Y",this.clickOpens=!0,this.dateFormat="Y-m-d",this.defaultHour=12,this.defaultMinute=0,this.disable=[],this.disableMobile=!1,this.enable=void 0,this.enableTime=!1,this.enableSeconds=!1,this.hourIncrement=1,this.minuteIncrement=5,this.inline=!1,this.mode="single",this.nextArrow=">",this.prevArrow="<",this.noCalendar=!1,this.position="auto",this.shorthandCurrentMonth=!1,this.showMonths=1,this.static=!1,this.time_24hr=!1,this.weekNumbers=!1,this.wrap=!1,this.theme="light",this.firstDayOfWeek=1,this.defaultToToday=!1,this.weekSelect=!1,this.monthSelect=!1,this.confirmDate=!1,this._hasSlottedElement=!1}static get styles(){return[c`
:host {
width: fit-content;
display: block;
cursor: pointer;
background: #fff;
color: #000;
overflow: hidden;
}
::slotted(*) {
cursor: pointer;
}
input {
width: 100%;
height: 100%;
font-size: inherit;
cursor: pointer;
background: inherit;
box-sizing: border-box;
outline: none;
color: inherit;
border: none;
}
`]}firstUpdated(){this._hasSlottedElement=this.checkForSlottedElement()}updated(){this.init()}getToday(){const t=new Date;return`${t.getFullYear()}-${t.getMonth()+1}-${t.getDate()}`}checkForSlottedElement(){var t;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),i=e?e.assignedNodes().filter(this.removeTextNodes):[];return null!=e&&i&&i.length>0}getSlottedElement(){var t;if(!this._hasSlottedElement)return;const e=null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("slot"),i=null==e?void 0:e.assignedNodes().filter(this.removeTextNodes);return!i||i.length<1?void 0:i[0]}removeTextNodes(t){return"#text"!==t.nodeName}async init(){const t=new ka(this.theme);await t.initStyles(),this.locale&&await async function(t){const e=Da+"/"+t+".js";await import(e)}(this.locale),await this.initializeComponent()}async getOptions(){let t={altFormat:this.altFormat,altInput:this.altInput,altInputClass:this.altInputClass,allowInput:this.allowInput,ariaDateFormat:this.ariaDateFormat,clickOpens:this.clickOpens,dateFormat:this.dateFormat,defaultDate:this.defaultToToday?this.getToday():this.defaultDate,defaultHour:this.defaultHour,defaultMinute:this.defaultMinute,disable:this.disable,disableMobile:this.disableMobile,enable:this.enable,enableTime:this.enableTime,enableSeconds:this.enableSeconds,formatDate:this.formatDateFn,hourIncrement:this.hourIncrement,inline:this.inline,maxDate:this.maxDate,minDate:this.minDate,minuteIncrement:this.minuteIncrement,mode:this.mode,nextArrow:this.nextArrow,prevArrow:this.prevArrow,noCalendar:this.noCalendar,onChange:this.onChange,onClose:this.onClose,onOpen:this.onOpen,onReady:this.onReady,onMonthChange:this.onMonthChange,onYearChange:this.onYearChange,onValueUpdate:this.onValueUpdate,parseDate:this.parseDateFn,position:this.position,shorthandCurrentMonth:this.shorthandCurrentMonth,showMonths:this.showMonths,static:this.static,time_24hr:this.time_24hr,weekNumbers:this.weekNumbers,wrap:this.wrap,locale:this.locale,plugins:[]};return t=await async function(t,e){if(t.weekSelect){const t=(await import(Ca+"/esm/plugins/weekSelect/weekSelect.js")).default;e={...e,plugins:[...e.plugins,t()],onChange:function(){const t=this.selectedDates[0]?this.config.getWeek(this.selectedDates[0]):null;this.input.value=t}}}if(t.monthSelect){const i=(await import(Ca+"/esm/plugins/monthSelect/index.js")).default;e={...e,plugins:[...e.plugins,i({shorthand:!1,dateFormat:t.dateFormat,altFormat:t.altFormat})]};const n=document.createElement("link");n.rel="stylesheet",n.href=Ca+"/plugins/monthSelect/style.css",document.head.appendChild(n)}return e}(this,t),Object.keys(t).forEach((e=>{void 0===t[e]&&delete t[e]})),t}async initializeComponent(){var t;let e;if(this._instance&&Object.prototype.hasOwnProperty.call(this,"destroy")&&this._instance.destroy(),e=this._hasSlottedElement?this.findInputField():null===(t=this.shadowRoot)||void 0===t?void 0:t.querySelector("input"),e){this._inputElement=e,flatpickr.l10ns.default.firstDayOfWeek=this.firstDayOfWeek;const t=await this.getOptions();this._instance=flatpickr(e,t)}}findInputField(){let t=null;if(t=this.querySelector("input"),t)return t;const e=this.getSlottedElement();return void 0!==typeof e&&(t=this.searchWebComponentForInputElement(e)),t||null}searchWebComponentForInputElement(t){let e=this.getInputFieldInElement(t);if(e)return e;const i=this.getWebComponentsInsideElement(t);for(let t=0;t<i.length&&(e=this.searchWebComponentForInputElement(i[t]),!e);t++);return e}getInputFieldInElement(t){let e=null;return e=t.shadowRoot?t.shadowRoot.querySelector("input"):t.querySelector("input"),e}getWebComponentsInsideElement(t){return t.shadowRoot?[...Array.from(t.querySelectorAll("*")),...Array.from(t.shadowRoot.querySelectorAll("*"))].filter((t=>t.shadowRoot)):Array.from(t.querySelectorAll("*")).filter((t=>t.shadowRoot))}changeMonth(t,e=!0){this._instance&&this._instance.changeMonth(t,e)}clear(){this._instance&&this._instance.clear()}close(){this._instance&&this._instance.close()}destroy(){this._instance&&this._instance.destroy()}formatDate(t,e){return this._instance?this._instance.formatDate(t,e):""}jumpToDate(t,e){this._instance&&this._instance.jumpToDate(t,e)}open(){this._instance&&this._instance.open()}parseDate(t,e){if(this._instance)return this._instance.parseDate(t,e)}redraw(){this._instance&&this._instance.redraw()}set(t,e){this._instance&&this._instance.set(t,e)}setDate(t,e,i){this._instance&&this._instance.setDate(t,e,i)}toggle(){this._instance}getSelectedDates(){return this._instance?this._instance.selectedDates:[]}getCurrentYear(){return this._instance?this._instance.currentYear:-1}getCurrentMonth(){return this._instance?this._instance.currentMonth:-1}getConfig(){return this._instance?this._instance.config:{}}getValue(){return this._inputElement?this._inputElement.value:""}render(){return u`
${this._hasSlottedElement?u``:u`<input class="lit-flatpickr flatpickr flatpickr-input" placeholder=${this.placeholder} />`}
<slot></slot>
`}};Br([l({type:String})],Sa.prototype,"placeholder",void 0),Br([l({type:String})],Sa.prototype,"altFormat",void 0),Br([l({type:Boolean})],Sa.prototype,"altInput",void 0),Br([l({type:String})],Sa.prototype,"altInputClass",void 0),Br([l({type:Boolean})],Sa.prototype,"allowInput",void 0),Br([l({type:String})],Sa.prototype,"ariaDateFormat",void 0),Br([l({type:Boolean})],Sa.prototype,"clickOpens",void 0),Br([l({type:String})],Sa.prototype,"dateFormat",void 0),Br([l({type:Object})],Sa.prototype,"defaultDate",void 0),Br([l({type:Number})],Sa.prototype,"defaultHour",void 0),Br([l({type:Number})],Sa.prototype,"defaultMinute",void 0),Br([l({type:Array})],Sa.prototype,"disable",void 0),Br([l({type:Boolean})],Sa.prototype,"disableMobile",void 0),Br([l({type:Array})],Sa.prototype,"enable",void 0),Br([l({type:Boolean})],Sa.prototype,"enableTime",void 0),Br([l({type:Boolean})],Sa.prototype,"enableSeconds",void 0),Br([l({type:Function})],Sa.prototype,"formatDateFn",void 0),Br([l({type:Number})],Sa.prototype,"hourIncrement",void 0),Br([l({type:Number})],Sa.prototype,"minuteIncrement",void 0),Br([l({type:Boolean})],Sa.prototype,"inline",void 0),Br([l({type:String})],Sa.prototype,"maxDate",void 0),Br([l({type:String})],Sa.prototype,"minDate",void 0),Br([l({type:String})],Sa.prototype,"mode",void 0),Br([l({type:String})],Sa.prototype,"nextArrow",void 0),Br([l({type:String})],Sa.prototype,"prevArrow",void 0),Br([l({type:Boolean})],Sa.prototype,"noCalendar",void 0),Br([l({type:Function})],Sa.prototype,"onChange",void 0),Br([l({type:Function})],Sa.prototype,"onClose",void 0),Br([l({type:Function})],Sa.prototype,"onOpen",void 0),Br([l({type:Function})],Sa.prototype,"onReady",void 0),Br([l({type:Function})],Sa.prototype,"onMonthChange",void 0),Br([l({type:Function})],Sa.prototype,"onYearChange",void 0),Br([l({type:Function})],Sa.prototype,"onValueUpdate",void 0),Br([l({type:Function})],Sa.prototype,"parseDateFn",void 0),Br([l({type:String})],Sa.prototype,"position",void 0),Br([l({type:Boolean})],Sa.prototype,"shorthandCurrentMonth",void 0),Br([l({type:Number})],Sa.prototype,"showMonths",void 0),Br([l({type:Boolean})],Sa.prototype,"static",void 0),Br([l({type:Boolean})],Sa.prototype,"time_24hr",void 0),Br([l({type:Boolean})],Sa.prototype,"weekNumbers",void 0),Br([l({type:Boolean})],Sa.prototype,"wrap",void 0),Br([l({type:String})],Sa.prototype,"theme",void 0),Br([l({type:Number})],Sa.prototype,"firstDayOfWeek",void 0),Br([l({type:String})],Sa.prototype,"locale",void 0),Br([l({type:Boolean,attribute:"default-to-today"})],Sa.prototype,"defaultToToday",void 0),Br([l({type:Boolean,attribute:"week-select"})],Sa.prototype,"weekSelect",void 0),Br([l({type:Boolean,attribute:"month-select"})],Sa.prototype,"monthSelect",void 0),Br([l({type:Boolean,attribute:"confirm-date"})],Sa.prototype,"confirmDate",void 0),Br([l({type:Boolean})],Sa.prototype,"_hasSlottedElement",void 0),Sa=Br([h("lit-flatpickr")],Sa);let Ta=class extends d{constructor(){super(...arguments),this._refInput=m()}open(){this._refInput.value?.open()}render(){return u` <lit-flatpickr
${f(this._refInput)}
.onChange=${t=>{t.length&&g(this,"date-picker:change",{date:t[0]})}}
></lit-flatpickr>`}static get styles(){return v("lit-flatpickr {\n visibility: hidden;\n width: 0px;\n height: 0px;\n}")}};Ta=p([h("frigate-card-date-picker")],Ta);class Ea extends CustomEvent{}const Ma="target_bar";let Oa=class extends d{constructor(){super(...arguments),this.details=!1}render(){if(!this.item)return u``;const t={item:this.item};return this.dispatchEvent(new Ea("frigate-card:timeline:thumbnail-data-request",{composed:!0,bubbles:!0,detail:t})),t.hass&&t.cameraManager&&t.cameraConfig&&t.media&&t.view?u` <frigate-card-thumbnail
.hass=${t.hass}
.cameraManager=${t.cameraManager}
.media=${t.media}
.view=${t.view}
?details=${this.details}
>
</frigate-card-thumbnail>`:u``}};p([l({attribute:!0})],Oa.prototype,"item",void 0),p([l({attribute:!0,type:Boolean})],Oa.prototype,"details",void 0),Oa=p([h("frigate-card-timeline-thumbnail")],Oa);let Ia=class extends d{constructor(){super(...arguments),this.mini=!1,this._panBehavior="seek",this._targetBarVisible=!1,this._refDatePicker=m(),this._refTimeline=m(),this._timelineSource=null,this._pointerHeld=null,this._ignoreClick=!1,this._isHoverableDevice=w(),this._throttledSetViewDuringRangeChange=_(this._setViewDuringRangeChange.bind(this),100)}_getTooltip(t){return this._isHoverableDevice?`\n <frigate-card-timeline-thumbnail\n item='${t.id}'\n ${this.thumbnailConfig?.show_details?"details":""}\n >\n </frigate-card-timeline-thumbnail>`:""}_handleThumbnailDataRequest(t){const e=t.detail.item,i=this._timelineSource?.dataset.get(e)?.media,n=i?this.cameraManager?.getStore().getCameraConfigForMedia(i)??void 0:void 0;t.detail.hass=this.hass,t.detail.cameraConfig=n,t.detail.cameraManager=this.cameraManager,t.detail.media=i,t.detail.view=this.view}render(){const t=this._getTimelineCameraIDs();if(!(this.hass&&this.view&&this.timelineConfig&&t))return;const e=this.cameraManager?.getAggregateCameraCapabilities(t),i="pan"===this._panBehavior?x("timeline.pan_behavior.pan"):"seek"===this._panBehavior?x("timeline.pan_behavior.seek"):x("timeline.pan_behavior.seek-in-media"),n="pan"===this._panBehavior?"mdi:pan-horizontal":"seek"===this._panBehavior?"mdi:filmstrip":"mdi:lock";return u` ${e?.supportsTimeline?u` <div
@frigate-card:timeline:thumbnail-data-request=${this._handleThumbnailDataRequest.bind(this)}
class="timeline"
${f(this._refTimeline)}
>
<div class="timeline-tools">
${this._shouldSupportSeeking()?u` <ha-icon
.icon=${n}
@click=${()=>{this._panBehavior="pan"===this._panBehavior?"seek":"seek"===this._panBehavior?"seek-in-media":"pan"}}
aria-label="${i}"
title="${i}"
>
</ha-icon>`:""}
<ha-icon
.icon=${"mdi:calendar-search"}
aria-label="${x("timeline.select_date")}"
title="${x("timeline.select_date")}"
@click=${()=>{this._refDatePicker.value?.open()}}
>
</ha-icon>
<frigate-card-date-picker
${f(this._refDatePicker)}
@frigate-card:date-picker:change=${t=>{this._timeline?.setWindow(k(t.detail.date),D(t.detail.date))}}
>
</frigate-card-date-picker>
</div>
</div>`:""}`}_getTimelineCameraIDs(){return this.cameraIDs??this.cameraManager?.getStore().getVisibleCameraIDs()??null}_timelineRangeChangeHandler(t){if(this._pointerHeld&&(this._ignoreClick=!0),this._shouldSupportSeeking()&&this._timeline&&t.byUser&&"wheel"!==t.event.type&&"pinchin"!==t.event.additionalEvent&&"pinchout"!==t.event.additionalEvent){const e=this._pointerHeld?.window?r(t.start,{seconds:(this._pointerHeld.time.getTime()-this._pointerHeld.window.start.getTime())/1e3}):t.end;this._pointerHeld&&this._setTargetBarAppropriately(e),this._throttledSetViewDuringRangeChange(e,t)}}_shouldSupportSeeking(){return this.mini}_setTargetBarAppropriately(t){if(!this._timeline)return;if(this._shouldSupportSeeking()&&("seek"===this._panBehavior||"seek-in-media"===this._panBehavior&&this._timeline.getSelection().some((e=>{const i=this._timelineSource?.dataset?.get(e);return i&&i.start&&i.end&&t.getTime()>=i.start&&t.getTime()<=i.end})))){this._targetBarVisible?this._timeline?.setCustomTime(t,Ma):(this._timeline?.addCustomTime(t,Ma),this._targetBarVisible=!0);const e=this._timeline.getWindow(),i=(t.getTime()-e.start.getTime())/(e.end.getTime()-e.start.getTime());this.setAttribute("target-bar-marker-direction",i<.25?"right":i>.75?"left":"center"),this._timeline?.setCustomTimeMarker?.(C(t,!0),Ma)}else this._removeTargetBar()}_removeTargetBar(){this.removeAttribute("target-bar-direction"),this._targetBarVisible&&(this._timeline?.removeCustomTime(Ma),this._targetBarVisible=!1)}async _setViewDuringRangeChange(t,e){const i=this.view?.queryResults,n=i?.getResults();if(!(n&&i&&this._timeline&&this.view&&this.hass&&this.cameraManager&&"pan"!==this._panBehavior))return;const o=this._shouldSupportSeeking(),s="seek-in-media"===this._panBehavior?null:i.clone().resetSelectedResult().selectBestResult((e=>S(e,t))),r=this.mini?t>=new Date?"live":"media":this.view.view;this.view.evolve({view:r,...s&&s.hasSelectedResult()&&{queryResults:s}}).mergeInContext({...o&&{mediaViewer:{seek:t}},...this._getTimelineContext({start:e.start,end:e.end})}).dispatchChangeEvent(this)}async _timelineClickHandler(t){(this._ignoreClick||t.what&&["item","background","group-label","axis"].includes(t.what))&&T(t.event);const e=this._getTimelineCameraIDs();if(this._ignoreClick||!this.hass||!this._timeline||!this.view||!this.cameraManager||!this.cardWideConfig||!e||!t.what)return;let i=null,n="close";if(this.timelineConfig?.show_recordings&&["background","group-label"].includes(t.what)){const e=t.group?new Set([String(t.group)]):this._getTimelineCameraIDs(),n=e?E(this.cameraManager,this.cardWideConfig,e):null;n&&(i=await M(this,this.hass,this.cameraManager,this.view,n,{targetView:"recording",targetTime:"background"===t.what?t.time:this._timeline.getWindow().end,select:"time"}))}else if(this.timelineConfig?.show_recordings&&"axis"===t.what){const n=E(this.cameraManager,this.cardWideConfig,e,{start:O(t.time),end:I(t.time)});n&&(i=await M(this,this.hass,this.cameraManager,this.view,n,{targetView:"recording",targetTime:t.time,select:"time"}))}else if(t.item&&"item"===t.what){const e=this.view.queryResults?.clone().resetSelectedResult().selectResultIfFound((e=>e.getID()===t.item));if(e&&e.hasSelectedResult())i=this.view.evolve({queryResults:e,view:"play"===this.itemClickAction?"media":this.view.view});else{const e=await this._createViewWithEventMediaQuery(this._createEventMediaQuerys(),{selectedItem:t.item,targetView:"media"});e?.queryResults?.hasResults()&&(i=e)}i?.queryResults?.hasResults()&&i.mergeInContext({mediaViewer:{seek:t.time}}),i?.mergeInContext(this._getTimelineContext()),"select"===this.itemClickAction&&i&&(n="open")}i&&i.dispatchChangeEvent(this),g(this,`thumbnails:${n}`),this._ignoreClick=!1}_getPrefetchWindow(t){const e=A(t.end,t.start);return{start:z(t.start,{seconds:e}),end:r(t.end,{seconds:e})}}async _timelineRangeChangedHandler(t){if(!t.byUser)return;if(this._removeTargetBar(),!this.hass)return;const e=this._getPrefetchWindow(t);if(await(this._timelineSource?.refresh(this.hass,e)),this._timeline&&this.view&&!P.areRecordingQueries(this.view.query)){const t=await this._createViewWithEventMediaQuery(this._createEventMediaQuerys({window:this._timeline.getWindow()})),e=t?.queryResults;t&&e&&!this.view.queryResults?.isSupersetOf(e)&&t?.mergeInContext(this._getTimelineContext())?.dispatchChangeEvent(this)}}_createEventMediaQuerys(t){if(!this._timeline||!this._timelineSource||!this.cardWideConfig)return null;const e=this._timelineSource.getCacheFriendlyEventWindow(t?.window??this._timeline.getWindow()),i=this._timelineSource.getTimelineEventQueries(e);return i?new N(i):null}async _createViewWithEventMediaQuery(t,e){if(!(this.hass&&this.cameraManager&&this.view&&t))return null;const i=await M(this,this.hass,this.cameraManager,this.view,t,{targetView:e?.targetView,select:"latest"});if(!i)return null;if(e?.selectedItem)i.queryResults?.selectResultIfFound((t=>t.getID()===e.selectedItem));else{const t=this.view.queryResults?.getSelectedResult();t&&i.queryResults?.selectResultIfFound((e=>e.getID()===t.getID()))}return i}_getGroups(){const t=[];return(this._getTimelineCameraIDs()??[]).forEach((e=>{if(!this.hass||!this.cameraManager)return;const i=this.cameraManager.getCameraMetadata(this.hass,e),n=this.cameraManager.getCameraCapabilities(e);i&&n?.supportsTimeline&&t.push({id:e,content:i.title})})),new Dn(t)}_getPerfectWindowFromMedia(t){const e=t.getStartTime(),i=t.getEndTime();if(F.isEvent(t)){const t=this._getConfiguredWindowSeconds();if(e&&i){if(i.getTime()-e.getTime()>1e3*t)return{start:z(i,{seconds:t}),end:i};{const n=t-(i.getTime()-e.getTime())/1e3;return{start:z(e,{seconds:n/2}),end:r(i,{seconds:n/2})}}}if(e)return{start:z(e,{seconds:t/2}),end:r(e,{seconds:t/2})}}else if(F.isRecording(t)&&e&&i)return{start:e,end:i};return null}_getConfiguredWindowSeconds(){return this.timelineConfig?.window_seconds??R.timeline.window_seconds}_getDefaultStartEnd(){const t=new Date;return{start:z(t,{seconds:this._getConfiguredWindowSeconds()}),end:t}}_isClustering(){return"stack"===this.timelineConfig?.style&&!!this.timelineConfig?.clustering_threshold&&this.timelineConfig.clustering_threshold>0}_getOptions(){if(!this.timelineConfig)return null;const t=this._getDefaultStartEnd(),e="stack"===this.timelineConfig.style;return{cluster:!!this._isClustering()&&{maxItems:this.timelineConfig.clustering_threshold,clusterCriteria:(t,e)=>{const i=this.view?.queryResults?.getSelectedResult(),n=i?.getID(),o=t.media,s=e.media;return"background"!==t.type&&t.type===e.type&&t.id!==n&&e.id!==n&&!!o&&!!s&&F.isEvent(o)&&F.isEvent(s)&&o.isGroupableWith(s)}},minHeight:"100%",maxHeight:"100%",zoomMax:864e5,zoomMin:1e3,margin:{item:{vertical:e?10:24}},selectable:!0,stack:e,start:t.start,end:t.end,groupHeightMode:"auto",tooltip:{followMouse:!0,overflowMethod:"cap",template:this._getTooltip.bind(this)},xss:{disabled:!1,filterOptions:{whiteList:{"frigate-card-timeline-thumbnail":["details","item"],div:["title"],span:["style"]}}}}}shouldUpdate(t){return!!this.hass&&!!this.cameraManager}async _updateTimelineFromView(){if(!(this.hass&&this.view&&this.timelineConfig&&this._timelineSource&&this._timeline))return;const t=this._timeline.getWindow();let e=t;const i=this.view.queryResults?.getSelectedResult(),n=i?.getStartTime(),o=i?.getEndTime(),s=i&&n?{start:n,end:o??n}:null,r=this.view.context?.timeline;if(r&&r.panBehavior&&(this._panBehavior=r.panBehavior),r&&r.window)e=r.window;else if(i&&s&&!L(s,t)){const t=this._getPerfectWindowFromMedia(i);t&&(e=t)}const a=this._getPrefetchWindow(e);this._pointerHeld||await(this._timelineSource?.refresh(this.hass,a));const l=i?.getID();i&&l&&this._isClustering()&&this._timelineSource?.rewriteEvent(l);const h=i&&F.isEvent(i)?i.getID():null;h&&this._timeline?.setSelection([h],{focus:!1,animation:{animation:!1,zoom:!1}}),this._pointerHeld||j(e,t)||this._timeline.setWindow(e.start,e.end);const d=this._createEventMediaQuerys({window:e});this.mini||P.areRecordingQueries(this.view.query)||!d||this._alreadyHasAcceptableMediaQuery(d)||(await this._createViewWithEventMediaQuery(d))?.mergeInContext(this._getTimelineContext(e)).dispatchChangeEvent(this)}_alreadyHasAcceptableMediaQuery(t){const e=this.view?.query?.getQueries(),i=this.view?.queryResults?.getResultsTimestamp();return!!this.cameraManager&&!!e&&!!i&&j(e,t.getQueries())&&this.cameraManager.areMediaQueriesResultsFresh(e,i)}_getTimelineContext(t){const e=t??this._timeline?.getWindow();return{timeline:{...this.view?.context?.timeline,panBehavior:this._panBehavior,...e&&{window:e}}}}willUpdate(t){if(t.has("thumbnailConfig")&&(this.thumbnailConfig?this.style.setProperty("--frigate-card-thumbnail-size",`${this.thumbnailConfig.size}px`):this.style.removeProperty("--frigate-card-thumbnail-size")),t.has("timelineConfig")&&(Y(this,!!this.timelineConfig?.show_recordings,"recordings"),Y(this,"ribbon"===this.timelineConfig?.style,"ribbon"),Y(this,"stack"===this.timelineConfig?.style,"stack")),t.has("cameraManager")||t.has("cameras")||t.has("timelineConfig")||t.has("cameraIDs")){const t=this._getTimelineCameraIDs();t&&this.cameraManager&&this.timelineConfig?this._timelineSource=new zr(this.cameraManager,t,this.timelineConfig.media,this.timelineConfig.show_recordings):this._timelineSource=null}}_destroy(){this._timeline?.destroy(),this._timeline=void 0,this._targetBarVisible=!1,this._pointerHeld=null}updated(t){super.updated(t),(t.has("cameras")||t.has("cameraManager"))&&this._destroy();let e=!1;if(this._timelineSource&&this._refTimeline.value&&this.timelineConfig&&(t.has("timelineConfig")||t.has("cameraIDs"))){this._timeline&&this._destroy();const t=this._getGroups();if(!t.length)return void(this.mini||H(this,x("error.timeline_no_cameras"),"info",{icon:"mdi:chart-gantt"}));const i=this._getOptions();if(i){e=!0;const n=this.mini&&1===t.length;this._timeline=n?new dr(this._refTimeline.value,this._timelineSource.dataset,i):new dr(this._refTimeline.value,this._timelineSource.dataset,t,i),Y(this,!n,"groups"),this._timeline.on("rangechanged",this._timelineRangeChangedHandler.bind(this)),this._timeline.on("click",this._timelineClickHandler.bind(this)),this._timeline.on("rangechange",this._timelineRangeChangeHandler.bind(this)),this._timeline.on("mouseDown",(t=>{const e=this._timeline?.getWindow();this._pointerHeld={...t,...e&&{window:e}},this._ignoreClick=!1})),this._timeline.on("mouseUp",(()=>{this._pointerHeld=null,this._removeTargetBar()}))}}e?window.requestAnimationFrame(this._updateTimelineFromView.bind(this)):t.has("view")&&this._updateTimelineFromView()}static get styles(){return v('@charset "UTF-8";\n/* override some bootstrap styles screwing up the timelines css */\n.vis [class*=span] {\n min-height: 0;\n width: auto;\n}\n\n.vis-current-time {\n background-color: #FF7F6E;\n width: 2px;\n z-index: 1;\n pointer-events: none;\n}\n\n.vis-rolling-mode-btn {\n height: 40px;\n width: 40px;\n position: absolute;\n top: 7px;\n right: 20px;\n border-radius: 50%;\n font-size: 28px;\n cursor: pointer;\n opacity: 0.8;\n color: white;\n font-weight: bold;\n text-align: center;\n background: #3876c2;\n}\n\n.vis-rolling-mode-btn:before {\n content: "⛶";\n}\n\n.vis-rolling-mode-btn:hover {\n opacity: 1;\n}\n\n.vis-timeline {\n /*\n -webkit-transition: height .4s ease-in-out;\n transition: height .4s ease-in-out;\n */\n}\n\n.vis-panel {\n /*\n -webkit-transition: height .4s ease-in-out, top .4s ease-in-out;\n transition: height .4s ease-in-out, top .4s ease-in-out;\n */\n}\n\n.vis-axis {\n /*\n -webkit-transition: top .4s ease-in-out;\n transition: top .4s ease-in-out;\n */\n}\n\n/* TODO: get animation working nicely\n\n.vis-item {\n -webkit-transition: top .4s ease-in-out;\n transition: top .4s ease-in-out;\n}\n\n.vis-item.line {\n -webkit-transition: height .4s ease-in-out, top .4s ease-in-out;\n transition: height .4s ease-in-out, top .4s ease-in-out;\n}\n/**/\n.vis-panel {\n position: absolute;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n.vis-panel.vis-center,\n.vis-panel.vis-left,\n.vis-panel.vis-right,\n.vis-panel.vis-top,\n.vis-panel.vis-bottom {\n border: 1px #bfbfbf;\n}\n\n.vis-panel.vis-center,\n.vis-panel.vis-left,\n.vis-panel.vis-right {\n border-top-style: solid;\n border-bottom-style: solid;\n overflow: hidden;\n}\n\n.vis-left.vis-panel.vis-vertical-scroll, .vis-right.vis-panel.vis-vertical-scroll {\n height: 100%;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n\n.vis-left.vis-panel.vis-vertical-scroll {\n direction: rtl;\n}\n\n.vis-left.vis-panel.vis-vertical-scroll .vis-content {\n direction: ltr;\n}\n\n.vis-right.vis-panel.vis-vertical-scroll {\n direction: ltr;\n}\n\n.vis-right.vis-panel.vis-vertical-scroll .vis-content {\n direction: rtl;\n}\n\n.vis-panel.vis-center,\n.vis-panel.vis-top,\n.vis-panel.vis-bottom {\n border-left-style: solid;\n border-right-style: solid;\n}\n\n.vis-background {\n overflow: hidden;\n}\n\n.vis-panel > .vis-content {\n position: relative;\n}\n\n.vis-panel .vis-shadow {\n position: absolute;\n width: 100%;\n height: 1px;\n box-shadow: 0 0 10px rgba(0, 0, 0, 0.8);\n /* TODO: find a nice way to ensure vis-shadows are drawn on top of items\n z-index: 1;\n */\n}\n\n.vis-panel .vis-shadow.vis-top {\n top: -1px;\n left: 0;\n}\n\n.vis-panel .vis-shadow.vis-bottom {\n bottom: -1px;\n left: 0;\n}\n\n.vis-graph-group0 {\n fill: #4f81bd;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #4f81bd;\n}\n\n.vis-graph-group1 {\n fill: #f79646;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #f79646;\n}\n\n.vis-graph-group2 {\n fill: #8c51cf;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #8c51cf;\n}\n\n.vis-graph-group3 {\n fill: #75c841;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #75c841;\n}\n\n.vis-graph-group4 {\n fill: #ff0100;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #ff0100;\n}\n\n.vis-graph-group5 {\n fill: #37d8e6;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #37d8e6;\n}\n\n.vis-graph-group6 {\n fill: #042662;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #042662;\n}\n\n.vis-graph-group7 {\n fill: #00ff26;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #00ff26;\n}\n\n.vis-graph-group8 {\n fill: #ff00ff;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #ff00ff;\n}\n\n.vis-graph-group9 {\n fill: #8f3938;\n fill-opacity: 0;\n stroke-width: 2px;\n stroke: #8f3938;\n}\n\n.vis-timeline .vis-fill {\n fill-opacity: 0.1;\n stroke: none;\n}\n\n.vis-timeline .vis-bar {\n fill-opacity: 0.5;\n stroke-width: 1px;\n}\n\n.vis-timeline .vis-point {\n stroke-width: 2px;\n fill-opacity: 1;\n}\n\n.vis-timeline .vis-legend-background {\n stroke-width: 1px;\n fill-opacity: 0.9;\n fill: #ffffff;\n stroke: #c2c2c2;\n}\n\n.vis-timeline .vis-outline {\n stroke-width: 1px;\n fill-opacity: 1;\n fill: #ffffff;\n stroke: #e5e5e5;\n}\n\n.vis-timeline .vis-icon-fill {\n fill-opacity: 0.3;\n stroke: none;\n}\n\n.vis-timeline {\n position: relative;\n border: 1px solid #bfbfbf;\n overflow: hidden;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n.vis-loading-screen {\n width: 100%;\n height: 100%;\n position: absolute;\n top: 0;\n left: 0;\n}\n\n.vis-custom-time {\n background-color: #6E94FF;\n width: 2px;\n cursor: move;\n z-index: 1;\n}\n\n.vis-custom-time > .vis-custom-time-marker {\n background-color: inherit;\n color: white;\n font-size: 12px;\n white-space: nowrap;\n padding: 3px 5px;\n top: 0px;\n cursor: initial;\n z-index: inherit;\n}\n\n.vis-panel.vis-background.vis-horizontal .vis-grid.vis-horizontal {\n position: absolute;\n width: 100%;\n height: 0;\n border-bottom: 1px solid;\n}\n\n.vis-panel.vis-background.vis-horizontal .vis-grid.vis-minor {\n border-color: #e5e5e5;\n}\n\n.vis-panel.vis-background.vis-horizontal .vis-grid.vis-major {\n border-color: #bfbfbf;\n}\n\n.vis-data-axis .vis-y-axis.vis-major {\n width: 100%;\n position: absolute;\n color: #4d4d4d;\n white-space: nowrap;\n}\n\n.vis-data-axis .vis-y-axis.vis-major.vis-measure {\n padding: 0;\n margin: 0;\n border: 0;\n visibility: hidden;\n width: auto;\n}\n\n.vis-data-axis .vis-y-axis.vis-minor {\n position: absolute;\n width: 100%;\n color: #bebebe;\n white-space: nowrap;\n}\n\n.vis-data-axis .vis-y-axis.vis-minor.vis-measure {\n padding: 0;\n margin: 0;\n border: 0;\n visibility: hidden;\n width: auto;\n}\n\n.vis-data-axis .vis-y-axis.vis-title {\n position: absolute;\n color: #4d4d4d;\n white-space: nowrap;\n bottom: 20px;\n text-align: center;\n}\n\n.vis-data-axis .vis-y-axis.vis-title.vis-measure {\n padding: 0;\n margin: 0;\n visibility: hidden;\n width: auto;\n}\n\n.vis-data-axis .vis-y-axis.vis-title.vis-left {\n bottom: 0;\n -webkit-transform-origin: left top;\n -moz-transform-origin: left top;\n -ms-transform-origin: left top;\n -o-transform-origin: left top;\n transform-origin: left bottom;\n -webkit-transform: rotate(-90deg);\n -moz-transform: rotate(-90deg);\n -ms-transform: rotate(-90deg);\n -o-transform: rotate(-90deg);\n transform: rotate(-90deg);\n}\n\n.vis-data-axis .vis-y-axis.vis-title.vis-right {\n bottom: 0;\n -webkit-transform-origin: right bottom;\n -moz-transform-origin: right bottom;\n -ms-transform-origin: right bottom;\n -o-transform-origin: right bottom;\n transform-origin: right bottom;\n -webkit-transform: rotate(90deg);\n -moz-transform: rotate(90deg);\n -ms-transform: rotate(90deg);\n -o-transform: rotate(90deg);\n transform: rotate(90deg);\n}\n\n.vis-legend {\n background-color: rgba(247, 252, 255, 0.65);\n padding: 5px;\n border: 1px solid #b3b3b3;\n box-shadow: 2px 2px 10px rgba(154, 154, 154, 0.55);\n}\n\n.vis-legend-text {\n /*font-size: 10px;*/\n white-space: nowrap;\n display: inline-block;\n}\n\n.vis-labelset {\n position: relative;\n overflow: hidden;\n box-sizing: border-box;\n}\n\n.vis-labelset .vis-label {\n position: relative;\n left: 0;\n top: 0;\n width: 100%;\n color: #4d4d4d;\n box-sizing: border-box;\n}\n\n.vis-labelset .vis-label {\n border-bottom: 1px solid #bfbfbf;\n}\n\n.vis-labelset .vis-label.draggable {\n cursor: pointer;\n}\n\n.vis-group-is-dragging {\n background: rgba(0, 0, 0, 0.1);\n}\n\n.vis-labelset .vis-label:last-child {\n border-bottom: none;\n}\n\n.vis-labelset .vis-label .vis-inner {\n display: inline-block;\n padding: 5px;\n}\n\n.vis-labelset .vis-label .vis-inner.vis-hidden {\n padding: 0;\n}\n\n.vis-itemset {\n position: relative;\n padding: 0;\n margin: 0;\n box-sizing: border-box;\n}\n\n.vis-itemset .vis-background,\n.vis-itemset .vis-foreground {\n position: absolute;\n width: 100%;\n height: 100%;\n overflow: visible;\n}\n\n.vis-axis {\n position: absolute;\n width: 100%;\n height: 0;\n left: 0;\n z-index: 1;\n}\n\n.vis-foreground .vis-group {\n position: relative;\n box-sizing: border-box;\n border-bottom: 1px solid #bfbfbf;\n}\n\n.vis-foreground .vis-group:last-child {\n border-bottom: none;\n}\n\n.vis-nesting-group {\n cursor: pointer;\n}\n\n.vis-label.vis-nested-group.vis-group-level-unknown-but-gte1 {\n background: #f5f5f5;\n}\n\n.vis-label.vis-nested-group.vis-group-level-0 {\n background-color: #ffffff;\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-0 .vis-inner {\n padding-left: 0;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-0 .vis-inner {\n padding-right: 0;\n}\n\n.vis-label.vis-nested-group.vis-group-level-1 {\n background-color: rgba(0, 0, 0, 0.05);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-1 .vis-inner {\n padding-left: 15px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-1 .vis-inner {\n padding-right: 15px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-2 {\n background-color: rgba(0, 0, 0, 0.1);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-2 .vis-inner {\n padding-left: 30px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-2 .vis-inner {\n padding-right: 30px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-3 {\n background-color: rgba(0, 0, 0, 0.15);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-3 .vis-inner {\n padding-left: 45px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-3 .vis-inner {\n padding-right: 45px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-4 {\n background-color: rgba(0, 0, 0, 0.2);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-4 .vis-inner {\n padding-left: 60px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-4 .vis-inner {\n padding-right: 60px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-5 {\n background-color: rgba(0, 0, 0, 0.25);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-5 .vis-inner {\n padding-left: 75px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-5 .vis-inner {\n padding-right: 75px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-6 {\n background-color: rgba(0, 0, 0, 0.3);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-6 .vis-inner {\n padding-left: 90px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-6 .vis-inner {\n padding-right: 90px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-7 {\n background-color: rgba(0, 0, 0, 0.35);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-7 .vis-inner {\n padding-left: 105px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-7 .vis-inner {\n padding-right: 105px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-8 {\n background-color: rgba(0, 0, 0, 0.4);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-8 .vis-inner {\n padding-left: 120px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-8 .vis-inner {\n padding-right: 120px;\n}\n\n.vis-label.vis-nested-group.vis-group-level-9 {\n background-color: rgba(0, 0, 0, 0.45);\n}\n\n.vis-ltr .vis-label.vis-nested-group.vis-group-level-9 .vis-inner {\n padding-left: 135px;\n}\n\n.vis-rtl .vis-label.vis-nested-group.vis-group-level-9 .vis-inner {\n padding-right: 135px;\n}\n\n/* default takes over beginning with level-10 (thats why we add .vis-nested-group\n to the selectors above, to have higher specifity than these rules for the defaults) */\n.vis-label.vis-nested-group {\n background-color: rgba(0, 0, 0, 0.5);\n}\n\n.vis-ltr .vis-label.vis-nested-group .vis-inner {\n padding-left: 150px;\n}\n\n.vis-rtl .vis-label.vis-nested-group .vis-inner {\n padding-right: 150px;\n}\n\n.vis-group-level-unknown-but-gte1 {\n border: 1px solid red;\n}\n\n/* expanded/collapsed indicators */\n.vis-label.vis-nesting-group:before,\n.vis-label.vis-nesting-group:before {\n display: inline-block;\n width: 15px;\n}\n\n.vis-label.vis-nesting-group.expanded:before {\n content: "▼";\n}\n\n.vis-label.vis-nesting-group.collapsed:before {\n content: "▶";\n}\n\n.vis-rtl .vis-label.vis-nesting-group.collapsed:before {\n content: "◀";\n}\n\n/* compensate missing expanded/collapsed indicator, but only at levels > 0 */\n.vis-ltr .vis-label:not(.vis-nesting-group):not(.vis-group-level-0) {\n padding-left: 15px;\n}\n\n.vis-rtl .vis-label:not(.vis-nesting-group):not(.vis-group-level-0) {\n padding-right: 15px;\n}\n\n.vis-overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n z-index: 10;\n}\n\n.vis-time-axis {\n position: relative;\n overflow: hidden;\n}\n\n.vis-time-axis.vis-foreground {\n top: 0;\n left: 0;\n width: 100%;\n}\n\n.vis-time-axis.vis-background {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n}\n\n.vis-time-axis .vis-text {\n position: absolute;\n color: #4d4d4d;\n padding: 3px;\n overflow: hidden;\n box-sizing: border-box;\n white-space: nowrap;\n}\n\n.vis-time-axis .vis-text.vis-measure {\n position: absolute;\n padding-left: 0;\n padding-right: 0;\n margin-left: 0;\n margin-right: 0;\n visibility: hidden;\n}\n\n.vis-time-axis .vis-grid.vis-vertical {\n position: absolute;\n border-left: 1px solid;\n}\n\n.vis-time-axis .vis-grid.vis-vertical-rtl {\n position: absolute;\n border-right: 1px solid;\n}\n\n.vis-time-axis .vis-grid.vis-minor {\n border-color: #e5e5e5;\n}\n\n.vis-time-axis .vis-grid.vis-major {\n border-color: #bfbfbf;\n}\n\n.vis-item {\n position: absolute;\n color: #1A1A1A;\n border-color: #97B0F8;\n border-width: 1px;\n background-color: #D5DDF6;\n display: inline-block;\n z-index: 1;\n /*overflow: hidden;*/\n}\n\n.vis-item.vis-selected {\n border-color: #FFC200;\n background-color: #FFF785;\n /* z-index must be higher than the z-index of custom time bar and current time bar */\n z-index: 2;\n}\n\n.vis-editable.vis-selected {\n cursor: move;\n}\n\n.vis-item.vis-point.vis-selected {\n background-color: #FFF785;\n}\n\n.vis-item.vis-box {\n text-align: center;\n border-style: solid;\n border-radius: 2px;\n}\n\n.vis-item.vis-point {\n background: none;\n}\n\n.vis-item.vis-dot {\n position: absolute;\n padding: 0;\n border-width: 4px;\n border-style: solid;\n border-radius: 4px;\n}\n\n.vis-item.vis-range {\n border-style: solid;\n border-radius: 2px;\n box-sizing: border-box;\n}\n\n.vis-item.vis-background {\n border: none;\n background-color: rgba(213, 221, 246, 0.4);\n box-sizing: border-box;\n padding: 0;\n margin: 0;\n}\n\n.vis-item .vis-item-overflow {\n position: relative;\n width: 100%;\n height: 100%;\n padding: 0;\n margin: 0;\n overflow: hidden;\n}\n\n.vis-item-visible-frame {\n white-space: nowrap;\n}\n\n.vis-item.vis-range .vis-item-content {\n position: relative;\n display: inline-block;\n}\n\n.vis-item.vis-background .vis-item-content {\n position: absolute;\n display: inline-block;\n}\n\n.vis-item.vis-line {\n padding: 0;\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.vis-item .vis-item-content {\n white-space: nowrap;\n box-sizing: border-box;\n padding: 5px;\n}\n\n.vis-item .vis-onUpdateTime-tooltip {\n position: absolute;\n background: #4f81bd;\n color: white;\n width: 200px;\n text-align: center;\n white-space: nowrap;\n padding: 5px;\n border-radius: 1px;\n transition: 0.4s;\n -o-transition: 0.4s;\n -moz-transition: 0.4s;\n -webkit-transition: 0.4s;\n}\n\n.vis-item .vis-delete, .vis-item .vis-delete-rtl {\n position: absolute;\n top: 0px;\n width: 24px;\n height: 24px;\n box-sizing: border-box;\n padding: 0px 5px;\n cursor: pointer;\n -webkit-transition: background 0.2s linear;\n -moz-transition: background 0.2s linear;\n -ms-transition: background 0.2s linear;\n -o-transition: background 0.2s linear;\n transition: background 0.2s linear;\n}\n\n.vis-item .vis-delete {\n right: -24px;\n}\n\n.vis-item .vis-delete-rtl {\n left: -24px;\n}\n\n.vis-item .vis-delete:after, .vis-item .vis-delete-rtl:after {\n content: "×"; /* MULTIPLICATION SIGN */\n color: red;\n font-family: arial, sans-serif;\n font-size: 22px;\n font-weight: bold;\n -webkit-transition: color 0.2s linear;\n -moz-transition: color 0.2s linear;\n -ms-transition: color 0.2s linear;\n -o-transition: color 0.2s linear;\n transition: color 0.2s linear;\n}\n\n.vis-item .vis-delete:hover, .vis-item .vis-delete-rtl:hover {\n background: red;\n}\n\n.vis-item .vis-delete:hover:after, .vis-item .vis-delete-rtl:hover:after {\n color: white;\n}\n\n.vis-item .vis-drag-center {\n position: absolute;\n width: 100%;\n height: 100%;\n top: 0;\n left: 0px;\n cursor: move;\n}\n\n.vis-item.vis-range .vis-drag-left {\n position: absolute;\n width: 24px;\n max-width: 20%;\n min-width: 2px;\n height: 100%;\n top: 0;\n left: -4px;\n cursor: w-resize;\n}\n\n.vis-item.vis-range .vis-drag-right {\n position: absolute;\n width: 24px;\n max-width: 20%;\n min-width: 2px;\n height: 100%;\n top: 0;\n right: -4px;\n cursor: e-resize;\n}\n\n.vis-range.vis-item.vis-readonly .vis-drag-left,\n.vis-range.vis-item.vis-readonly .vis-drag-right {\n cursor: auto;\n}\n\n.vis-item.vis-cluster {\n vertical-align: center;\n text-align: center;\n border-style: solid;\n border-radius: 2px;\n}\n\n.vis-item.vis-cluster-line {\n padding: 0;\n position: absolute;\n width: 0;\n border-left-width: 1px;\n border-left-style: solid;\n}\n\n.vis-item.vis-cluster-dot {\n position: absolute;\n padding: 0;\n border-width: 4px;\n border-style: solid;\n border-radius: 4px;\n}\n\ndiv.vis-configuration {\n position: relative;\n display: block;\n float: left;\n font-size: 12px;\n}\n\ndiv.vis-configuration-wrapper {\n display: block;\n width: 700px;\n}\n\ndiv.vis-configuration-wrapper::after {\n clear: both;\n content: "";\n display: block;\n}\n\ndiv.vis-configuration.vis-config-option-container {\n display: block;\n width: 495px;\n background-color: #ffffff;\n border: 2px solid #f7f8fa;\n border-radius: 4px;\n margin-top: 20px;\n left: 10px;\n padding-left: 5px;\n}\n\ndiv.vis-configuration.vis-config-button {\n display: block;\n width: 495px;\n height: 25px;\n vertical-align: middle;\n line-height: 25px;\n background-color: #f7f8fa;\n border: 2px solid #ceced0;\n border-radius: 4px;\n margin-top: 20px;\n left: 10px;\n padding-left: 5px;\n cursor: pointer;\n margin-bottom: 30px;\n}\n\ndiv.vis-configuration.vis-config-button.hover {\n background-color: #4588e6;\n border: 2px solid #214373;\n color: #ffffff;\n}\n\ndiv.vis-configuration.vis-config-item {\n display: block;\n float: left;\n width: 495px;\n height: 25px;\n vertical-align: middle;\n line-height: 25px;\n}\n\ndiv.vis-configuration.vis-config-item.vis-config-s2 {\n left: 10px;\n background-color: #f7f8fa;\n padding-left: 5px;\n border-radius: 3px;\n}\n\ndiv.vis-configuration.vis-config-item.vis-config-s3 {\n left: 20px;\n background-color: #e4e9f0;\n padding-left: 5px;\n border-radius: 3px;\n}\n\ndiv.vis-configuration.vis-config-item.vis-config-s4 {\n left: 30px;\n background-color: #cfd8e6;\n padding-left: 5px;\n border-radius: 3px;\n}\n\ndiv.vis-configuration.vis-config-header {\n font-size: 18px;\n font-weight: bold;\n}\n\ndiv.vis-configuration.vis-config-label {\n width: 120px;\n height: 25px;\n line-height: 25px;\n}\n\ndiv.vis-configuration.vis-config-label.vis-config-s3 {\n width: 110px;\n}\n\ndiv.vis-configuration.vis-config-label.vis-config-s4 {\n width: 100px;\n}\n\ndiv.vis-configuration.vis-config-colorBlock {\n top: 1px;\n width: 30px;\n height: 19px;\n border: 1px solid #444444;\n border-radius: 2px;\n padding: 0px;\n margin: 0px;\n cursor: pointer;\n}\n\ninput.vis-configuration.vis-config-checkbox {\n left: -5px;\n}\n\ninput.vis-configuration.vis-config-rangeinput {\n position: relative;\n top: -5px;\n width: 60px;\n /*height:13px;*/\n padding: 1px;\n margin: 0;\n pointer-events: none;\n}\n\ninput.vis-configuration.vis-config-range {\n /*removes default webkit styles*/\n -webkit-appearance: none;\n /*fix for FF unable to apply focus style bug */\n border: 0px solid white;\n background-color: rgba(0, 0, 0, 0);\n /*required for proper track sizing in FF*/\n width: 300px;\n height: 20px;\n}\n\ninput.vis-configuration.vis-config-range::-webkit-slider-runnable-track {\n width: 300px;\n height: 5px;\n background: #dedede; /* Old browsers */\n background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dedede), color-stop(99%, #c8c8c8)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* IE10+ */\n background: linear-gradient(to bottom, #dedede 0%, #c8c8c8 99%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#dedede", endColorstr="#c8c8c8",GradientType=0 ); /* IE6-9 */\n border: 1px solid #999999;\n box-shadow: #aaaaaa 0px 0px 3px 0px;\n border-radius: 3px;\n}\n\ninput.vis-configuration.vis-config-range::-webkit-slider-thumb {\n -webkit-appearance: none;\n border: 1px solid #14334b;\n height: 17px;\n width: 17px;\n border-radius: 50%;\n background: #3876c2; /* Old browsers */\n background: -moz-linear-gradient(top, #3876c2 0%, #385380 100%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #3876c2), color-stop(100%, #385380)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #3876c2 0%, #385380 100%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #3876c2 0%, #385380 100%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #3876c2 0%, #385380 100%); /* IE10+ */\n background: linear-gradient(to bottom, #3876c2 0%, #385380 100%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#3876c2", endColorstr="#385380",GradientType=0 ); /* IE6-9 */\n box-shadow: #111927 0px 0px 1px 0px;\n margin-top: -7px;\n}\n\ninput.vis-configuration.vis-config-range:focus {\n outline: none;\n}\n\ninput.vis-configuration.vis-config-range:focus::-webkit-slider-runnable-track {\n background: #9d9d9d; /* Old browsers */\n background: -moz-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #9d9d9d), color-stop(99%, #c8c8c8)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #9d9d9d 0%, #c8c8c8 99%); /* IE10+ */\n background: linear-gradient(to bottom, #9d9d9d 0%, #c8c8c8 99%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#9d9d9d", endColorstr="#c8c8c8",GradientType=0 ); /* IE6-9 */\n}\n\ninput.vis-configuration.vis-config-range::-moz-range-track {\n width: 300px;\n height: 10px;\n background: #dedede; /* Old browsers */\n background: -moz-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* FF3.6+ */\n background: -webkit-gradient(linear, left top, left bottom, color-stop(0%, #dedede), color-stop(99%, #c8c8c8)); /* Chrome,Safari4+ */\n background: -webkit-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Chrome10+,Safari5.1+ */\n background: -o-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* Opera 11.10+ */\n background: -ms-linear-gradient(top, #dedede 0%, #c8c8c8 99%); /* IE10+ */\n background: linear-gradient(to bottom, #dedede 0%, #c8c8c8 99%); /* W3C */\n filter: progid:DXImageTransform.Microsoft.gradient( startColorstr="#dedede", endColorstr="#c8c8c8",GradientType=0 ); /* IE6-9 */\n border: 1px solid #999999;\n box-shadow: #aaaaaa 0px 0px 3px 0px;\n border-radius: 3px;\n}\n\ninput.vis-configuration.vis-config-range::-moz-range-thumb {\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #385380;\n}\n\n/*hide the outline behind the border*/\ninput.vis-configuration.vis-config-range:-moz-focusring {\n outline: 1px solid white;\n outline-offset: -1px;\n}\n\ninput.vis-configuration.vis-config-range::-ms-track {\n width: 300px;\n height: 5px;\n /*remove bg colour from the track, we\'ll use ms-fill-lower and ms-fill-upper instead */\n background: transparent;\n /*leave room for the larger thumb to overflow with a transparent border */\n border-color: transparent;\n border-width: 6px 0;\n /*remove default tick marks*/\n color: transparent;\n}\n\ninput.vis-configuration.vis-config-range::-ms-fill-lower {\n background: #777;\n border-radius: 10px;\n}\n\ninput.vis-configuration.vis-config-range::-ms-fill-upper {\n background: #ddd;\n border-radius: 10px;\n}\n\ninput.vis-configuration.vis-config-range::-ms-thumb {\n border: none;\n height: 16px;\n width: 16px;\n border-radius: 50%;\n background: #385380;\n}\n\ninput.vis-configuration.vis-config-range:focus::-ms-fill-lower {\n background: #888;\n}\n\ninput.vis-configuration.vis-config-range:focus::-ms-fill-upper {\n background: #ccc;\n}\n\n.vis-configuration-popup {\n position: absolute;\n background: rgba(57, 76, 89, 0.85);\n border: 2px solid #f2faff;\n line-height: 30px;\n height: 30px;\n width: 150px;\n text-align: center;\n color: #ffffff;\n font-size: 14px;\n border-radius: 4px;\n -webkit-transition: opacity 0.3s ease-in-out;\n -moz-transition: opacity 0.3s ease-in-out;\n transition: opacity 0.3s ease-in-out;\n}\n\n.vis-configuration-popup:after, .vis-configuration-popup:before {\n left: 100%;\n top: 50%;\n border: solid transparent;\n content: " ";\n height: 0;\n width: 0;\n position: absolute;\n pointer-events: none;\n}\n\n.vis-configuration-popup:after {\n border-color: rgba(136, 183, 213, 0);\n border-left-color: rgba(57, 76, 89, 0.85);\n border-width: 8px;\n margin-top: -8px;\n}\n\n.vis-configuration-popup:before {\n border-color: rgba(194, 225, 245, 0);\n border-left-color: #f2faff;\n border-width: 12px;\n margin-top: -12px;\n}\n\n.vis .overlay {\n position: absolute;\n top: 0;\n left: 0;\n width: 100%;\n height: 100%;\n /* Must be displayed above for example selected Timeline items */\n z-index: 10;\n}\n\n.vis-active {\n box-shadow: 0 0 10px #86d5f8;\n}\n\ndiv.vis-tooltip {\n position: absolute;\n visibility: hidden;\n padding: 5px;\n white-space: nowrap;\n font-family: verdana;\n font-size: 14px;\n color: #000000;\n background-color: #f5f4ed;\n -moz-border-radius: 3px;\n -webkit-border-radius: 3px;\n border-radius: 3px;\n border: 1px solid #808074;\n box-shadow: 3px 3px 10px rgba(0, 0, 0, 0.2);\n pointer-events: none;\n z-index: 5;\n}\n\nside-drawer {\n background-color: var(--card-background-color);\n}\n\ndiv.control-surround {\n position: absolute;\n bottom: 50%;\n transform: translateY(50%);\n z-index: 0;\n padding-top: 20px;\n padding-bottom: 20px;\n}\n\n:host([location=left]) div.control-surround {\n padding-right: 12px;\n left: 100%;\n}\n\n:host([location=right]) div.control-surround {\n padding-left: 12px;\n right: 100%;\n}\n\n:host([empty]), :host([empty]) > * {\n visibility: hidden;\n}\n\n:host(:not([empty])), :host(:not([empty])) > * {\n visibility: visible;\n}\n\nha-icon.control {\n color: var(--secondary-color, white);\n background-color: rgba(0, 0, 0, 0.7);\n opacity: 0.5;\n pointer-events: all;\n --mdc-icon-size: 20px;\n padding-top: 20px;\n padding-bottom: 20px;\n transition: opacity 0.5s ease;\n}\n\n:host([open]) ha-icon.control, ha-icon.control:hover {\n opacity: 1;\n background-color: black;\n}\n\n:host([location=left]) ha-icon.control {\n border-top-right-radius: 20px;\n border-bottom-right-radius: 20px;\n}\n\n:host([location=right]) ha-icon.control {\n border-top-left-radius: 20px;\n border-bottom-left-radius: 20px;\n}\n\n:host {\n --frigate-card-thumbnail-size-max: 175px;\n --frigate-card-thumbnail-details-width: calc(\n var(--frigate-card-thumbnail-size) + 200px\n );\n}\n\n:host {\n width: 100%;\n display: flex;\n flex-direction: column;\n position: relative;\n}\n\n:host(:not([mini])) {\n height: 100%;\n}\n\nfrigate-card-thumbnail {\n height: var(--frigate-card-thumbnail-size);\n width: var(--frigate-card-thumbnail-size);\n}\n\nfrigate-card-thumbnail[details] {\n width: var(--frigate-card-thumbnail-details-width);\n}\n\ndiv.timeline {\n flex: 1;\n}\n\n.vis-text {\n color: var(--primary-text-color) !important;\n}\n\n.vis-timeline {\n border: none;\n}\n\n.vis-labelset .vis-label {\n color: var(--primary-text-color);\n}\n\n:host([ribbon]:not([groups])) .vis-item:not(.vis-background) {\n margin-top: 7px;\n}\n\n:host([ribbon]) .vis-item:not(.vis-background) {\n height: 6px;\n}\n\n.vis-item {\n border-color: var(--primary-color);\n background: none;\n color: var(--primary-text-color);\n background-color: var(--primary-color);\n transition: background-color ease-in-out 1s, border-color ease-in-out 1s, box-shadow ease-in-out 1s;\n}\n\n.vis-item.vis-selected {\n border-color: var(--accent-color);\n background-color: var(--accent-color);\n box-shadow: var(--frigate-card-css-box-shadow, 0px 0px 5px 1px var(--primary-color));\n}\n\n.vis-item.vis-background {\n background-color: var(--primary-color);\n opacity: 0.1;\n}\n\n:host(:not([groups])) .vis-item.vis-background {\n min-height: 100%;\n}\n\n.vis-item:not(.vis-background) {\n cursor: pointer;\n}\n\n:host([recordings]) .vis-item.vis-background,\n:host([recordings]) .vis-labelset,\n:host([recordings]) .vis-time-axis {\n cursor: crosshair;\n}\n\n.vis-item:active {\n cursor: unset;\n}\n\n.vis-item.vis-box {\n border: none;\n}\n\n.vis-item .vis-item-content {\n padding: 0px;\n}\n\n.vis-item.vis-cluster {\n border-style: dotted;\n color: var(--primary-text-color);\n background-color: var(--primary-background-color);\n box-shadow: var(--frigate-card-css-box-shadow, 0px 0px 5px 1px var(--primary-color));\n}\n\n.vis-item.vis-range {\n border-radius: var(--frigate-card-css-border-radius, unset);\n}\n\n.vis-time-axis .vis-grid.vis-minor {\n border-color: var(--secondary-color);\n}\n\n.vis-text.vis-minor,\n.vis-label {\n transition: background-color 0.5s ease-out;\n}\n\n:host([recordings]) .vis-text.vis-minor:hover,\n:host([recordings]) .vis-label:hover {\n background-color: var(--primary-color);\n}\n\n.vis-time-axis .vis-grid.vis-major {\n border-color: var(--secondary-color);\n}\n\n.vis-label {\n display: flex;\n justify-content: center;\n align-items: center;\n}\n\ndiv.vis-tooltip {\n padding: 0px;\n background-color: unset;\n border: none;\n font-family: unset;\n z-index: 30;\n}\n\n.target_bar {\n background-color: var(--primary-color);\n width: 2px;\n z-index: 20;\n pointer-events: none;\n}\n\n.target_bar .vis-custom-time-marker {\n background-color: var(--primary-background-color);\n color: var(--primary-text-color);\n bottom: 0px;\n top: unset;\n}\n\n:host([target-bar-marker-direction=right]) .target_bar .vis-custom-time-marker {\n left: 2px;\n}\n\n:host([target-bar-marker-direction=left]) .target_bar .vis-custom-time-marker {\n right: 2px;\n}\n\n:host([target-bar-marker-direction=center]) .target_bar .vis-custom-time-marker {\n left: 0px;\n transform: translateX(-50%);\n}\n\n.timeline-tools {\n position: absolute;\n right: 2px;\n bottom: 2px;\n color: var(--primary-color);\n z-index: 10;\n}\n\n.timeline-tools ha-icon {\n cursor: pointer;\n}')}};p([l({attribute:!1})],Ia.prototype,"hass",void 0),p([l({attribute:!1})],Ia.prototype,"view",void 0),p([l({attribute:!1,hasChanged:y})],Ia.prototype,"timelineConfig",void 0),p([l({attribute:!0,type:Boolean})],Ia.prototype,"thumbnailConfig",void 0),p([l({attribute:!0,type:Boolean,reflect:!0})],Ia.prototype,"mini",void 0),p([l({attribute:!1,hasChanged:y})],Ia.prototype,"cameraIDs",void 0),p([l({attribute:!1})],Ia.prototype,"cameraManager",void 0),p([l({attribute:!1})],Ia.prototype,"cardWideConfig",void 0),p([l({attribute:!1})],Ia.prototype,"itemClickAction",void 0),p([b()],Ia.prototype,"_panBehavior",void 0),Ia=p([h("frigate-card-timeline-core")],Ia);let Aa=class extends d{render(){return this.timelineConfig?u`
<frigate-card-timeline-core
.hass=${this.hass}
.view=${this.view}
.timelineConfig=${this.timelineConfig}
.thumbnailConfig=${this.timelineConfig.controls.thumbnails}
.cameraManager=${this.cameraManager}
.cardWideConfig=${this.cardWideConfig}
.itemClickAction=${"none"===this.timelineConfig.controls.thumbnails.mode?"play":"select"}
>
</frigate-card-timeline-core>
`:u``}static get styles(){return v(":host {\n width: 100%;\n height: 100%;\n display: block;\n}")}};p([l({attribute:!1})],Aa.prototype,"hass",void 0),p([l({attribute:!1})],Aa.prototype,"view",void 0),p([l({attribute:!1})],Aa.prototype,"timelineConfig",void 0),p([l({attribute:!1})],Aa.prototype,"cameraManager",void 0),p([l({attribute:!1})],Aa.prototype,"cardWideConfig",void 0),Aa=p([h("frigate-card-timeline")],Aa);export{Aa as FrigateCardTimeline};