1import{al as he,am as be,an as de,ao as Xi,ap as Ye,aq as ni,ar as $i,as as Pi,at as p,au as Ne,av as es,aw as Ni}from"./generated-flow-imports.520a588e.js";import{i as ts}from"./indexhtml.0abbcea3.js";function is(e,i){he(2,arguments);var n=be(e),a=de(i);return isNaN(a)?new Date(NaN):(a&&n.setDate(n.getDate()+a),n)}function ss(e,i){he(2,arguments);var n=be(e),a=de(i);if(isNaN(a))return new Date(NaN);if(!a)return n;var s=n.getDate(),c=new Date(n.getTime());c.setMonth(n.getMonth()+a+1,0);var l=c.getDate();return s>=l?c:(n.setFullYear(c.getFullYear(),c.getMonth(),s),n)}var ns=36e5;function rs(e,i){he(2,arguments);var n=de(i);return Xi(e,n*ns)}function yt(e){he(1,arguments);var i=be(e);return i.setHours(0,0,0,0),i}function ri(e,i){he(2,arguments);var n=yt(e),a=yt(i);return n.getTime()===a.getTime()}function Yt(e){he(1,arguments);var i=be(e);return i.setHours(23,59,59,999),i}function as(e,i){var n;he(1,arguments);var a=e||{},s=be(a.start),c=be(a.end),l=s.getTime(),u=c.getTime();if(!(l<=u))throw new RangeError("Invalid interval");var f=[],w=s;w.setMinutes(0,0,0);var y=Number((n=i==null?void 0:i.step)!==null&&n!==void 0?n:1);if(y<1||isNaN(y))throw new RangeError("`options.step` must be a number greater than 1");for(;w.getTime()<=u;)f.push(be(w)),w=rs(w,y);return f}function st(e,i){var n,a;he(1,arguments);var s=be(e);if(isNaN(s.getTime()))throw new RangeError("Invalid time value");var c=String((n=i==null?void 0:i.format)!==null&&n!==void 0?n:"extended"),l=String((a=i==null?void 0:i.representation)!==null&&a!==void 0?a:"complete");if(c!=="extended"&&c!=="basic")throw new RangeError("format must be 'extended' or 'basic'");if(l!=="date"&&l!=="time"&&l!=="complete")throw new RangeError("representation must be 'date', 'time', or 'complete'");var u="",f="",w=c==="extended"?"-":"",y=c==="extended"?":":"";if(l!=="time"){var M=Ye(s.getDate(),2),E=Ye(s.getMonth()+1,2),F=Ye(s.getFullYear(),4);
1u="".concat(F).concat(w).concat(E).concat(w).concat(M)}if(l!=="date"){var $=s.getTimezoneOffset();if($!==0){var O=Math.abs($),R=Ye(Math.floor(O/60),2),W=Ye(O%60,2),z=$<0?"+":"-";f="".concat(z).concat(R,":").concat(W)}else f="Z";var V=Ye(s.getHours(),2),se=Ye(s.getMinutes(),2),le=Ye(s.getSeconds(),2),te=u===""?"":"T",re=[V,se,le].join(y);u="".concat(u).concat(te).concat(re).concat(f)}return u}function os(e){he(1,arguments);var i=be(e),n=i.getFullYear(),a=i.getMonth(),s=new Date(0);return s.setFullYear(n,a+1,0),s.setHours(0,0,0,0),s.getDate()}function ls(e){return he(1,arguments),ri(e,Date.now())}function _i(e,i){he(2,arguments);var n=be(e).getTime(),a=be(i.start).getTime(),s=be(i.end).getTime();if(!(a<=s))throw new RangeError("Invalid interval");return n>=a&&n<=s}function cs(e,i){he(2,arguments);var n=de(i);return is(e,-n)}function ds(e){return he(1,arguments),Math.floor(e*ni)}function ke(e,i){var n;he(1,arguments);var a=de((n=i==null?void 0:i.additionalDigits)!==null&&n!==void 0?n:2);if(a!==2&&a!==1&&a!==0)throw new RangeError("additionalDigits must be 0, 1 or 2");if(!(typeof e=="string"||Object.prototype.toString.call(e)==="[object String]"))return new Date(NaN);var s=ms(e),c;if(s.date){var l=fs(s.date,a);c=gs(l.restDateString,l.year)}if(!c||isNaN(c.getTime()))return new Date(NaN);var u=c.getTime(),f=0,w;if(s.time&&(f=vs(s.time),isNaN(f)))return new Date(NaN);if(s.timezone){if(w=ys(s.timezone),isNaN(w))return new Date(NaN)}else{var y=new Date(u+f),M=new Date(0);return M.setFullYear(y.getUTCFullYear(),y.getUTCMonth(),y.getUTCDate()),M.setHours(y.getUTCHours(),y.getUTCMinutes(),y.getUTCSeconds(),y.getUTCMilliseconds()),M}return new Date(u+f+w)}var Tt={dateTimeDelimiter:/[T ]/,timeZoneDelimiter:/[Z ]/i,timezone:/([Z+-].*)$/},hs=/^-?(?:(\d{3})|(\d{2})(?:-?(\d{2}))?|W(\d{2})(?:-?(\d{1}))?|)$/,us=/^(\d{2}(?:[.,]\d*)?)(?::?(\d{2}(?:[.,]\d*)?))?(?::?(\d{2}(?:[.,]\d*)?))?$/,ps=/^([+-])(\d{2})(?::?(\d{2}))?$/;function ms(e){var i={},n=e.split(Tt.dateTimeDelimiter),a;if(n.length>2)return i;if(/:/.test(n[0])?a=n[0]:(i.date=n[0],a=n[1],Tt.timeZoneDelimiter.test(i.date)&&(i.date=e.split(Tt.timeZoneDelimiter)[0],a=e.substr(i.date.length,e.length))),a){var s=Tt.timezone.exec(a);s?(i.time=a.replace(s[1],""),i.timezone=s[1]):i.time=a}return i}function fs(e,i){var n=new RegExp("^(?:(\\d{4}|[+-]\\d{"+(4+i)+"})|(\\d{2}|[+-]\\d{"+(2+i)+"})$)"),a=e.match(n);if(!a)return{year:NaN,restDateString:""};var s=a[1]?parseInt(a[1]):null,c=a[2]?parseInt(a[2]):null;return{year:c===null?s:c*100,restDateString:e.slice((a[1]||a[2]).length)}}function gs(e,i){if(i===null)return new Date(NaN);var n=e.match(hs);if(!n)return new Date(NaN);var a=!!n[4],s=pt(n[1]),c=pt(n[2])-1,l=pt(n[3]),u=pt(n[4]),f=pt(n[5])-1;if(a)return Ms(i,u,f)?ws(i,u,f):new Date(NaN);var w=new Date(0);return!bs(i,c,l)||!Ss(i,s)?new Date(NaN):(w.setUTCFullYear(i,c,Math.max(s,l)),w)}function pt(e){return e?parseInt(e):1}function vs(e){var i=e.match(us);if(!i)return NaN;var n=qt(i[1]),a=qt(i[2]),s=qt(i[3]);return xs(n,a,s)?n*$i+a*ni+s*1e3:NaN}function qt(e){return e&&parseFloat(e.replace(",","."))||0}function ys(e){if(e==="Z")return 0;var i=e.match(ps);if(!i)return 0;var n=i[1]==="+"?-1:1,a=parseInt(i[2]),s=i[3]&&parseInt(i[3])||0;return ks(a,s)?n*(a*$i+s*ni):NaN}function ws(e,i,n){var a=new Date(0);a.setUTCFullYear(e,0,4);var s=a.getUTCDay()||7,c=(i-1)*7+n+1-s;return a.setUTCDate(a.getUTCDate()+c),a}var Ds=[31,null,31,30,31,30,31,31,30,31,30,31];function Ai(e){return e%400===0||e%4===0&&e%100!==0}function bs(e,i,n){return i>=0&&i<=11&&n>=1&&n<=(Ds[i]||(Ai(e)?29:28))}function Ss(e,i){return i>=1&&i<=(Ai(e)?366:365)}function Ms(e,i,n){return i>=1&&i<=53&&n>=0&&n<=6}function xs(e,i,n){return e===24?i===0&&n===0:n>=0&&n<60&&i>=0&&i<60&&e>=0&&e<25}function ks(e,i){return i>=0&&i<=59}function Cs(e,i){he(2,arguments);var n=be(e),a=de(i),s=n.getFullYear(),c=n.getDate(),l=new Date(0);l.setFullYear(s,a,15),l.setHours(0,0,0,0);var u=os(l);return n.setMonth(a,Math.min(c,u)),n}function Is(e,i){if(he(2,arguments),Pi(i)!=="object"||i===null)throw new RangeError("values parameter must be an object");var n=be(e);return isNaN(n.getTime())?new Date(NaN):(i.year!=null&&n.setFullYear(i.year),i.month!=null&&(n=Cs(n,i.month)),i.date!=null&&n.setDate(de(i.date)),i.hours!=null&&n.setHours(de(i.hours)),i.minutes!=null&&n.setMinutes(de(i.minutes)),i.seconds!=null&&n.setSeconds(de(i.seconds)),i.milliseconds!=null&&n.setMilliseconds(de(i.milliseconds)),n)}function Ts(e,i){he(2,arguments);var n=de(i);return ss(e,-n)}function wt(e,i){if(he(2,arguments),!i||Pi(i)!=="object")return new Date(NaN);var n=i.years?de(i.years):0,a=i.months?de(i.months):0,s=i.weeks?de(i.weeks):0,c=i.days?de(i.days):0,l=i.hours?de(i.hours):0,u=i.minutes?de(i.minutes):0,f=i.seconds?de(i.seconds):0,w=Ts(e,a+n*12),y=cs(w,c+s*7),M=u+l*60,E=f+M*60,F=E*1e3,$=new Date(y.getTime()-F);return $}const qn=ts``;(function(e,i){typeof exports=="object"&&typeof module<"u"?i(exports):typeof define=="function"&&define.amd?define(["exports"],i):i((e=typeof globalThis<"u"?globalThis:e||self).noUiSlider={})})(globalThis,function(e){function i(r){return typeof r=="object"&&typeof r.to=="function"}function n(r){r.parentElement.removeChild(r)}function a(r){return r!=null}function s(r){r.preventDefault()}function c(r){return typeof r=="number"&&!isNaN(r)&&isFinite(r)}function l(r,t,h){0<h&&(y(r,t),setTimeout(function(){M(r,t)},h))}function u(r){return Math.max(Math.min(r,100),0)}function f(r){return Array.isArray(r)?r:[r]}function w(r){return r=(r=String(r)).split("."),1<r.length?r[1].length:0}function y(r,t){r.classList&&!/\s/.test(t)?r.classList.add(t):r.className+=" "+t}function M(r,t){r.classList&&!/\s/.test(t)?r.classList.remove(t):r.className=r.className.replace(new RegExp("(^|\\b)"+t.split(" ").join("|")+"(\\b|$)","gi")," ")}function E(r){var t=window.pageXOffset!==void 0,h=(r.compatMode||"")==="CSS1Compat";return{x:t?window.pageXOffset:(h?r.documentElement:r.body).scrollLeft,y:t?window.pageYOffset:(h?r.documentElement:r.body).scrollTop}}function F(r,t){return 100/(t-r)}function $(r,t,h){return 100*t/(r[h+1]-r[h])}function O(r,t){for(var h=1;r>=t[h];)h+=1;return h}function R(k,t,h){if(h>=k.slice(-1)[0])return 100;var T=O(h,k),g=k[T-1],C=k[T],k=t[T-1],T=t[T];return k+(h=h,$(C=[g,C],C[0]<0?h+Math.abs(C[0]):h-C[0],0)/F(k,T))}function W(r,t,h,g){if(g===100)return g;var C=O(g,r),k=r[C-1],T=r[C];return h?(T-k)/2<g-k?T:k:t[C-1]?r[C-1]+(r=g-r[C-1],C=t[C-1],Math.round(r/C)*C):g}e.PipsMode=void 0,(v=e.PipsMode||(e.PipsMode={})).Range="range",v.Steps="steps",v.Positions="positions",v.Count="count",v.Values="values",e.PipsType=void 0,(v=e.PipsType||(e.PipsType={}))[v.None=-1]="None",v[v.NoValue=0]="NoValue",v[v.LargeValue=1]="LargeValue",v[v.SmallValue=2]="SmallValue";var z=(V.prototype.getDistance=function(r){for(var t=[],h=0;h<this.xNumSteps.length-1;h++)t[h]=$(this.xVal,r,h);return t},V.prototype.getAbsoluteDistance=function(r,t,h){var g=0;if(r<this.xPct[this.xPct.length-1])for(;r>this.xPct[g+1];)g++;else r===this.xPct[this.xPct.length-1]&&(g=this.xPct.length-2);h||r!==this.xPct[g+1]||g++;for(var C,k=1,T=(t=t===null?[]:t)[g],N=0,K=0,G=0,Y=h?(r-this.xPct[g])/(this.xPct[g+1]-this.xPct[g]):(this.xPct[g+1]-r)/(this.xPct[g+1]-this.xPct[g]);0<T;)C=this.xPct[g+1+G]-this.xPct[g+G],100<t[g+G]*k+100-100*Y?(N=C*Y,k=(T-100*Y)/t[g+G],Y=1):(N=t[g+G]*C/100*k,k=0),h?(K-=N,1<=this.xPct.length+G&&G--):(K+=N,1<=this.xPct.length-G&&G++),T=t[g+G]*k;return r+K},V.prototype.toStepping=function(r){return r=R(this.xVal,this.xPct,r)},V.prototype.fromStepping=function(r){return function(T,h,g){if(100<=g)return T.
1slice(-1)[0];var N=O(g,h),C=T[N-1],k=T[N],T=h[N-1],N=h[N];return(g-T)*F(T,N)*((k=[C,k])[1]-k[0])/100+k[0]}(this.xVal,this.xPct,r)},V.prototype.getStep=function(r){return r=W(this.xPct,this.xSteps,this.snap,r)},V.prototype.getDefaultStep=function(r,t,h){var g=O(r,this.xPct);return(r===100||t&&r===this.xPct[g-1])&&(g=Math.max(g-1,1)),(this.xVal[g]-this.xVal[g-1])/h},V.prototype.getNearbySteps=function(r){return r=O(r,this.xPct),{stepBefore:{startValue:this.xVal[r-2],step:this.xNumSteps[r-2],highestStep:this.xHighestCompleteStep[r-2]},thisStep:{startValue:this.xVal[r-1],step:this.xNumSteps[r-1],highestStep:this.xHighestCompleteStep[r-1]},stepAfter:{startValue:this.xVal[r],step:this.xNumSteps[r],highestStep:this.xHighestCompleteStep[r]}}},V.prototype.countStepDecimals=function(){var r=this.xNumSteps.map(w);return Math.max.apply(null,r)},V.prototype.hasNoSize=function(){return this.xVal[0]===this.xVal[this.xVal.length-1]},V.prototype.convert=function(r){return this.getStep(this.toStepping(r))},V.prototype.handleEntryPoint=function(r,t){if(r=r==="min"?0:r==="max"?100:parseFloat(r),!c(r)||!c(t[0]))throw new Error("noUiSlider: 'range' value isn't numeric.");this.xPct.push(r),this.xVal.push(t[0]),t=Number(t[1]),r?this.xSteps.push(!isNaN(t)&&t):isNaN(t)||(this.xSteps[0]=t),this.xHighestCompleteStep.push(0)},V.prototype.handleStepPoint=function(r,t){t&&(this.xVal[r]!==this.xVal[r+1]?(this.xSteps[r]=$([this.xVal[r],this.xVal[r+1]],t,0)/F(this.xPct[r],this.xPct[r+1]),t=(this.xVal[r+1]-this.xVal[r])/this.xNumSteps[r],t=Math.ceil(Number(t.toFixed(3))-1),t=this.xVal[r]+this.xNumSteps[r]*t,this.xHighestCompleteStep[r]=t):this.xSteps[r]=this.xHighestCompleteStep[r]=this.xVal[r])},V);function V(r,t,h){var g;this.xPct=[],this.xVal=[],this.xSteps=[],this.xNumSteps=[],this.xHighestCompleteStep=[],this.xSteps=[h||!1],this.xNumSteps=[!1],this.snap=t;var C=[];for(Object.keys(r).forEach(function(k){C.push([f(r[k]),k])}),C.sort(function(k,T){return k[0][0]-T[0][0]}),g=0;g<C.length;g++)this.handleEntryPoint(C[g][1],C[g][0]);for(this.xNumSteps=this.xSteps.slice(0),g=0;g<this.xNumSteps.length;g++)this.handleStepPoint(g,this.xNumSteps[g])}var se={to:function(r){return r===void 0?"":r.toFixed(2)},from:Number},le={target:"target",base:"base",origin:"origin",handle:"handle",handleLower:"handle-lower",handleUpper:"handle-upper",touchArea:"touch-area",horizontal:"horizontal",vertical:"vertical",background:"background",connect:"connect",connects:"connects",ltr:"ltr",rtl:"rtl",textDirectionLtr:"txt-dir-ltr",textDirectionRtl:"txt-dir-rtl",draggable:"draggable",drag:"state-drag",tap:"state-tap",active:"active",tooltip:"tooltip",pips:"pips",pipsHorizontal:"pips-horizontal",pipsVertical:"pips-vertical",marker:"marker",markerHorizontal:"marker-horizontal",markerVertical:"marker-vertical",markerNormal:"marker-normal",markerLarge:"marker-large",markerSub:"marker-sub",value:"value",valueHorizontal:"value-horizontal",valueVertical:"value-vertical",valueNormal:"value-normal",valueLarge:"value-large",valueSub:"value-sub"},te={tooltips:".__tooltips",aria:".__aria"};function re(r,t){if(!c(t))throw new Error("noUiSlider: 'step' is not numeric.");r.singleStep=t}function Te(r,t){if(!c(t))throw new Error("noUiSlider: 'keyboardPageMultiplier' is not numeric.");r.keyboardPageMultiplier=t}function Le(r,t){if(!c(t))throw new Error("noUiSlider: 'keyboardMultiplier' is not numeric.");r.keyboardMultiplier=t}function nt(r,t){if(!c(t))throw new Error("noUiSlider: 'keyboardDefaultStep' is not numeric.");r.keyboardDefaultStep=t}function fe(r,t){if(typeof t!="object"||Array.isArray(t))throw new Error("noUiSlider: 'range' is not an object.");if(t.min===void 0||t.max===void 0)throw new Error("noUiSlider: Missing 'min' or 'max' in 'range'.");r.spectrum=new z(t,r.snap||!1,r.singleStep)}function rt(r,t){if(t=f(t),!Array.isArray(t)||!t.length)throw new Error("noUiSlider: 'start' option is incorrect.");r.handles=t.length,r.start=t}function Fe(r,t){if(typeof t!="boolean")throw new Error("noUiSlider: 'snap' option must be a boolean.");r.snap=t}function ge(r,t){if(typeof t!="boolean")throw new Error("noUiSlider: 'animate' option must be a boolean.");r.animate=t}function ye(r,t){if(typeof t!="number")throw new Error("noUiSlider: 'animationDuration' option must be a number.");r.animationDuration=t}function We(r,t){var h,g=[!1];if(t==="lower"?t=[!0,!1]:t==="upper"&&(t=[!1,!0]),t===!0||t===!1){for(h=1;h<r.handles;h++)g.push(t);g.push(!1)}else{if(!Array.isArray(t)||!t.length||t.length!==r.handles+1)throw new Error("noUiSlider: 'connect' option doesn't match handle count.");g=t}r.connect=g}function Re(r,t){switch(t){case"horizontal":r.ort=0;break;case"vertical":r.ort=1;break;default:throw new Error("noUiSlider: 'orientation' option is invali
1d.")}}function Ge(r,t){if(!c(t))throw new Error("noUiSlider: 'margin' option must be numeric.");t!==0&&(r.margin=r.spectrum.getDistance(t))}function Se(r,t){if(!c(t))throw new Error("noUiSlider: 'limit' option must be numeric.");if(r.limit=r.spectrum.getDistance(t),!r.limit||r.handles<2)throw new Error("noUiSlider: 'limit' option is only supported on linear sliders with 2 or more handles.")}function at(r,t){var h;if(!c(t)&&!Array.isArray(t))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(Array.isArray(t)&&t.length!==2&&!c(t[0])&&!c(t[1]))throw new Error("noUiSlider: 'padding' option must be numeric or array of exactly 2 numbers.");if(t!==0){for(Array.isArray(t)||(t=[t,t]),r.padding=[r.spectrum.getDistance(t[0]),r.spectrum.getDistance(t[1])],h=0;h<r.spectrum.xNumSteps.length-1;h++)if(r.padding[0][h]<0||r.padding[1][h]<0)throw new Error("noUiSlider: 'padding' option must be a positive number(s).");var g=t[0]+t[1],t=r.spectrum.xVal[0];if(1<g/(r.spectrum.xVal[r.spectrum.xVal.length-1]-t))throw new Error("noUiSlider: 'padding' option must not exceed 100% of the range.")}}function Me(r,t){switch(t){case"ltr":r.dir=0;break;case"rtl":r.dir=1;break;default:throw new Error("noUiSlider: 'direction' option was not recognized.")}}function ot(r,Y){if(typeof Y!="string")throw new Error("noUiSlider: 'behaviour' must be a string containing options.");var h=0<=Y.indexOf("tap"),g=0<=Y.indexOf("drag"),C=0<=Y.indexOf("fixed"),k=0<=Y.indexOf("snap"),T=0<=Y.indexOf("hover"),N=0<=Y.indexOf("unconstrained"),K=0<=Y.indexOf("invert-connects"),G=0<=Y.indexOf("drag-all"),Y=0<=Y.indexOf("smooth-steps");if(C){if(r.handles!==2)throw new Error("noUiSlider: 'fixed' behaviour must be used with 2 handles");Ge(r,r.start[1]-r.start[0])}if(K&&r.handles!==2)throw new Error("noUiSlider: 'invert-connects' behaviour must be used with 2 handles");if(N&&(r.margin||r.limit))throw new Error("noUiSlider: 'unconstrained' behaviour cannot be used with margin or limit");r.events={tap:h||k,drag:g,dragAll:G,smoothSteps:Y,fixed:C,snap:k,hover:T,unconstrained:N,invertConnects:K}}function qe(r,t){if(t!==!1)if(t===!0||i(t)){r.tooltips=[];for(var h=0;h<r.handles;h++)r.tooltips.push(t)}else{if((t=f(t)).length!==r.handles)throw new Error("noUiSlider: must pass a formatter for all handles.");t.forEach(function(g){if(typeof g!="boolean"&&!i(g))throw new Error("noUiSlider: 'tooltips' must be passed a formatter or 'false'.")}),r.tooltips=t}}function U(r,t){if(t.length!==r.handles)throw new Error("noUiSlider: must pass a attributes for all handles.");r.handleAttributes=t}function ue(r,t){if(!i(t))throw new Error("noUiSlider: 'ariaFormat' requires 'to' method.");r.ariaFormat=t}function we(r,t){if(!i(h=t)||typeof h.from!="function")throw new Error("noUiSlider: 'format' requires 'to' and 'from' methods.");var h;r.format=t}function Ke(r,t){if(typeof t!="boolean")throw new Error("noUiSlider: 'keyboardSupport' option must be a boolean.");r.keyboardSupport=t}function ve(r,t){r.documentElement=t}function Ee(r,t){if(typeof t!="string"&&t!==!1)throw new Error("noUiSlider: 'cssPrefix' must be a string or `false`.");r.cssPrefix=t}function S(r,t){if(typeof t!="object")throw new Error("noUiSlider: 'cssClasses' must be an object.");typeof r.cssPrefix=="string"?(r.cssClasses={},Object.keys(t).forEach(function(h){r.cssClasses[h]=r.cssPrefix+t[h]})):r.cssClasses=t}function o(r){var t={margin:null,limit:null,padding:null,animate:!0,animationDuration:300,ariaFormat:se,format:se},h={step:{r:!1,t:re},keyboardPageMultiplier:{r:!1,t:Te},keyboardMultiplier:{r:!1,t:Le},keyboardDefaultStep:{r:!1,t:nt},start:{r:!0,t:rt},connect:{r:!0,t:We},direction:{r:!0,t:Me},snap:{r:!1,t:Fe},animate:{r:!1,t:ge},animationDuration:{r:!1,t:ye},range:{r:!0,t:fe},orientation:{r:!1,t:Re},margin:{r:!1,t:Ge},limit:{r:!1,t:Se},padding:{r:!1,t:at},behaviour:{r:!0,t:ot},ariaFormat:{r:!1,t:ue},format:{r:!1,t:we},tooltips:{r:!1,t:qe},keyboardSupport:{r:!0,t:Ke},documentElement:{r:!1,t:ve},cssPrefix:{r:!0,t:Ee},cssClasses:{r:!0,t:S},handleAttributes:{r:!1,t:U}},g={connect:!1,direction:"ltr",behaviour:"tap",orientation:"horizontal",keyboardSupport:!0,cssPrefix:"noUi-",cssClasse
1s:le,keyboardPageMultiplier:5,keyboardMultiplier:1,keyboardDefaultStep:10};r.format&&!r.ariaFormat&&(r.ariaFormat=r.format),Object.keys(h).forEach(function(T){if(a(r[T])||g[T]!==void 0)h[T].t(t,(a(r[T])?r:g)[T]);else if(h[T].r)throw new Error("noUiSlider: '"+T+"' is required.")}),t.pips=r.pips;var k=document.createElement("div"),C=k.style.msTransform!==void 0,k=k.style.transform!==void 0;return t.transformRule=k?"transform":C?"msTransform":"webkitTransform",t.style=[["left","top"],["right","bottom"]][t.dir][t.ort],t}function m(r,t,h){var g,C,k,T,N,K,G=window.navigator.pointerEnabled?{start:"pointerdown",move:"pointermove",end:"pointerup"}:window.navigator.msPointerEnabled?{start:"MSPointerDown",move:"MSPointerMove",end:"MSPointerUp"}:{start:"mousedown touchstart",move:"mousemove touchmove",end:"mouseup touchend"},Y=window.CSS&&CSS.supports&&CSS.supports("touch-action","none")&&function(){var D=!1;try{var b=Object.defineProperty({},"passive",{get:function(){D=!0}});window.addEventListener("test",null,b)}catch{}return D}(),ie=r,J=t.spectrum,pe=[],X=[],ae=[],Ze=0,De={},Xe=!1,Je=r.ownerDocument,Mt=t.documentElement||Je.documentElement,xt=Je.body,Ui=Je.dir==="rtl"||t.ort===1?0:100;function Oe(D,b){var x=Je.createElement("div");return b&&y(x,b),D.appendChild(x),x}function ji(I,b){var x,I=Oe(I,t.cssClasses.origin),P=Oe(I,t.cssClasses.handle);return Oe(P,t.cssClasses.touchArea),P.setAttribute("data-handle",String(b)),t.keyboardSupport&&(P.setAttribute("tabindex","0"),P.addEventListener("keydown",function(_){return function(Z,A){if(ci()||At(A))return!1;var ce=["Left","Right"],Q=["Down","Up"],j=["PageDown","PageUp"],xe=["Home","End"];t.dir&&!t.ort?ce.reverse():t.ort&&!t.dir&&(Q.reverse(),j.reverse());var H=Z.key.replace("Arrow",""),B=H===j[0],q=H===j[1],j=H===Q[0]||H===ce[0]||B,Q=H===Q[1]||H===ce[1]||q,ce=H===xe[0],xe=H===xe[1];if(!(j||Q||ce||xe))return!0;if(Z.preventDefault(),Q||j){var ne=j?0:1,ne=wi(A)[ne];if(ne===null)return!1;ne===!1&&(ne=J.getDefaultStep(X[A],j,t.keyboardDefaultStep)),ne*=q||B?t.keyboardPageMultiplier:t.keyboardMultiplier,ne=Math.max(ne,1e-7),ne*=j?-1:1,ne=pe[A]+ne}else ne=xe?t.spectrum.xVal[t.spectrum.xVal.length-1]:t.spectrum.xVal[0];return tt(A,J.toStepping(ne),!0,!0),oe("slide",A),oe("update",A),oe("change",A),oe("set",A),!1}(_,b)})),t.handleAttributes!==void 0&&(x=t.handleAttributes[b],Object.keys(x).forEach(function(_){P.setAttribute(_,x[_])})),P.setAttribute("role","slider"),P.setAttribute("aria-orientation",t.ort?"vertical":"horizontal"),b===0?y(P,t.cssClasses.handleLower):b===t.handles-1&&y(P,t.cssClasses.handleUpper),I.handle=P,I}function _t(D,b){return!!b&&Oe(D,t.cssClasses.connect)}function qi(D,b){return!(!t.tooltips||!t.tooltips[b])&&Oe(D.firstChild,t.cssClasses.tooltip)}function ci(){return ie.hasAttribute("disabled")}function At(D){return k[D].hasAttribute("disabled")}function Rt(){K&&(dt("update"+te.tooltips),K.forEach(function(D){D&&n(D)}),K=null)}function di(){Rt(),K=k.map(qi),zt("update"+te.tooltips,function(D,b,x){K&&t.tooltips&&K[b]!==!1&&(D=D[b],t.tooltips[b]!==!0&&(D=t.tooltips[b].to(x[b])),K[b].innerHTML=D)})}function hi(D,b){return D.map(function(x){return J.fromStepping(b?J.getStep(x):x)})}function Ki(D){var b=function(H){if(H.mode===e.PipsMode.Range||H.mode===e.PipsMode.Steps)return J.xVal;if(H.mode!==e.PipsMode.Count)return H.mode===e.PipsMode.Positions?hi(H.values,H.stepped):H.mode===e.PipsMode.Values?H.stepped?H.values.map(function(Q){return J.fromStepping(J.getStep(J.toStepping(Q)))}):H.values:[];if(H.values<2)throw new Error("noUiSlider: 'values' (>= 2) required for mode 'count'.");for(var B=H.values-1,q=100/B,j=[];B--;)j[B]=B*q;return j.push(100),hi(j,H.stepped)}(D),x={},I=J.xVal[0],P=J.xVal[J.xVal.length-1],_=!1,Z=!1,A=0;return(b=b.slice().sort(function(H,B){return H-B}).filter(function(H){return!this[H]&&(this[H]=!0)},{}))[0]!==I&&(b.unshift(I),_=!0),b[b.length-1]!==P&&(b.push(P),Z=!0),b.forEach(function($e,B){var q,j,Q,ce,xe,ne,it,He,$e=$e,lt=b[B+1],bi=D.mode===e.PipsMode.Steps,ut=(ut=bi?J.xNumSteps[B]:ut)||lt-$e;for(lt===void 0&&(lt=$e),ut=Math.max(ut,1e-7),q=$e;q<=lt;q=Number((q+ut).toFixed(7))){for(ne=(ce=(Q=J.toStepping(q))-A)/(D.density||1),He=ce/(it=Math.round(ne)),j=1;j<=it;j+=1)x[(xe=A+j*He).toFixed(5)]=[J.fromStepping(xe),0];
1ne=-1<b.indexOf(q)?e.PipsType.LargeValue:bi?e.PipsType.SmallValue:e.PipsType.NoValue,!B&&_&&q!==lt&&(ne=0),q===lt&&Z||(x[Q.toFixed(5)]=[q,ne]),A=Q}}),x}function Ji(D,b,x){var I,P=Je.createElement("div"),_=((I={})[e.PipsType.None]="",I[e.PipsType.NoValue]=t.cssClasses.valueNormal,I[e.PipsType.LargeValue]=t.cssClasses.valueLarge,I[e.PipsType.SmallValue]=t.cssClasses.valueSub,I),Z=((I={})[e.PipsType.None]="",I[e.PipsType.NoValue]=t.cssClasses.markerNormal,I[e.PipsType.LargeValue]=t.cssClasses.markerLarge,I[e.PipsType.SmallValue]=t.cssClasses.markerSub,I),A=[t.cssClasses.valueHorizontal,t.cssClasses.valueVertical],H=[t.cssClasses.markerHorizontal,t.cssClasses.markerVertical];function B(q,j){var Q=j===t.cssClasses.value;return j+" "+(Q?A:H)[t.ort]+" "+(Q?_:Z)[q]}return y(P,t.cssClasses.pips),y(P,t.ort===0?t.cssClasses.pipsHorizontal:t.cssClasses.pipsVertical),Object.keys(D).forEach(function(q){var j,Q,ce;Q=D[j=q][0],ce=D[q][1],(ce=b?b(Q,ce):ce)!==e.PipsType.None&&((q=Oe(P,!1)).className=B(ce,t.cssClasses.marker),q.style[t.style]=j+"%",ce>e.PipsType.NoValue&&((q=Oe(P,!1)).className=B(ce,t.cssClasses.value),q.setAttribute("data-value",String(Q)),q.style[t.style]=j+"%",q.innerHTML=String(x.to(Q))))}),P}function Ot(){N&&(n(N),N=null)}function Ht(I){Ot();var b=Ki(I),x=I.filter,I=I.format||{to:function(P){return String(Math.round(P))}};return N=ie.appendChild(Ji(b,x,I))}function ui(){var D=g.getBoundingClientRect(),b="offset"+["Width","Height"][t.ort];return t.ort===0?D.width||g[b]:D.height||g[b]}function et(D,b,x,I){function P(Z){var A,H=function(B,q,j){var Q=B.type.indexOf("touch")===0,ce=B.type.indexOf("mouse")===0,xe=B.type.indexOf("pointer")===0,ne=0,it=0;if(B.type.indexOf("MSPointer")===0&&(xe=!0),B.type==="mousedown"&&!B.buttons&&!B.touches)return!1;if(Q){var He=function($e){return $e=$e.target,$e===j||j.contains($e)||B.composed&&B.composedPath().shift()===j};if(B.type==="touchstart"){if(Q=Array.prototype.filter.call(B.touches,He),1<Q.length)return!1;ne=Q[0].pageX,it=Q[0].pageY}else{if(He=Array.prototype.find.call(B.changedTouches,He),!He)return!1;ne=He.pageX,it=He.pageY}}return q=q||E(Je),(ce||xe)&&(ne=B.clientX+q.x,it=B.clientY+q.y),B.pageOffset=q,B.points=[ne,it],B.cursor=ce||xe,B}(Z,I.pageOffset,I.target||b);return!!H&&!(ci()&&!I.doNotReject)&&(A=ie,Z=t.cssClasses.tap,!((A.classList?A.classList.contains(Z):new RegExp("\\b"+Z+"\\b").test(A.className))&&!I.doNotReject)&&!(D===G.start&&H.buttons!==void 0&&1<H.buttons)&&(!I.hover||!H.buttons)&&(Y||H.preventDefault(),H.calcPoint=H.points[t.ort],void x(H,I)))}var _=[];return D.split(" ").forEach(function(Z){b.addEventListener(Z,P,!!Y&&{passive:!0}),_.push([Z,P])}),_}function pi(D){var b,x,I=u(I=100*(D-(I=g,b=t.ort,x=I.getBoundingClientRect(),I=(D=I.ownerDocument).documentElement,D=E(D),/webkit.*Chrome.*Mobile/i.test(navigator.userAgent)&&(D.x=0),b?x.top+D.y-I.clientTop:x.left+D.x-I.clientLeft))/ui());return t.dir?100-I:I}function Yi(D,b){D.type==="mouseout"&&D.target.nodeName==="HTML"&&D.relatedTarget===null&&Vt(D,b)}function Qi(D,b){if(navigator.appVersion.indexOf("MSIE 9")===-1&&D.buttons===0&&b.buttonsProperty!==0)return Vt(D,b);D=(t.dir?-1:1)*(D.calcPoint-b.startCalcPoint),fi(0<D,100*D/b.baseSize,b.locations,b.handleNumbers,b.connect)}function Vt(D,b){b.handle&&(M(b.handle,t.cssClasses.active),--Ze),b.listeners.forEach(function(x){Mt.removeEventListener(x[0],x[1])}),Ze===0&&(M(ie,t.cssClasses.drag),jt(),D.cursor&&(xt.style.cursor="",xt.removeEventListener("selectstart",s))),t.events.smoothSteps&&(b.handleNumbers.forEach(function(x){tt(x,X[x],!0,!0,!1,!1)}),b.handleNumbers.forEach(function(x){oe("update",x)})),b.handleNumbers.forEach(function(x){oe("change",x),oe("set",x),oe("end",x)})}function Bt(D,b){var x,I,P,_;b.handleNumbers.some(At)||(b.handleNumbers.length===1&&(_=k[b.handleNumbers[0]].children[0],Ze+=1,y(_,t.cssClasses.active)),D.stopPropagation(),I=et(G.move,Mt,Qi,{target:D.target,handle:_,connect:b.connect,listeners:x=[],startCalcPoint:D.calcPoint,baseSize:ui(),pageOffset:D.pageOffset,handleNumbers:b.handleNumbers,buttonsProperty:D.buttons,locations:X.slice()}),P=et(G.end,Mt,Vt,{target:D.target,handle:_,listeners:x,doNotReject:!0,handleNumbers:b.handleNumbers}),_=et("mouseout",Mt,Yi,{target:D.target,handle:_,listeners:x,doNotReject:!0,handleNumbers:b.handleNumbers}),x.push.apply(x,I.concat(P,_)),D.cursor&&(xt.style.cursor=getComputedStyle(D.target).cursor,1<k.length&&y(ie,t.cssClasse
1s.drag),xt.addEventListener("selectstart",s,!1)),b.handleNumbers.forEach(function(Z){oe("start",Z)}))}function Wi(D){D.stopPropagation();var b,x,I,P=pi(D.calcPoint),_=(b=P,I=!(x=100),k.forEach(function(Z,A){var H,B;At(A)||(H=X[A],((B=Math.abs(H-b))<x||B<=x&&H<b||B===100&&x===100)&&(I=A,x=B))}),I);_!==!1&&(t.events.snap||l(ie,t.cssClasses.tap,t.animationDuration),tt(_,P,!0,!0),jt(),oe("slide",_,!0),oe("update",_,!0),t.events.snap?Bt(D,{handleNumbers:[_]}):(oe("change",_,!0),oe("set",_,!0)))}function Gi(b){var b=pi(b.calcPoint),b=J.getStep(b),x=J.fromStepping(b);Object.keys(De).forEach(function(I){I.split(".")[0]==="hover"&&De[I].forEach(function(P){P.call(It,x)})})}function mi(D){D.fixed||k.forEach(function(b,x){et(G.start,b.children[0],Bt,{handleNumbers:[x]})}),D.tap&&et(G.start,g,Wi,{}),D.hover&&et(G.move,g,Gi,{hover:!0}),D.drag&&T.forEach(function(b,x){var I,P,_,Z,A;b!==!1&&x!==0&&x!==T.length-1&&(I=k[x-1],P=k[x],_=[b],Z=[I,P],A=[x-1,x],y(b,t.cssClasses.draggable),D.fixed&&(_.push(I.children[0]),_.push(P.children[0])),D.dragAll&&(Z=k,A=ae),_.forEach(function(H){et(G.start,H,Bt,{handles:Z,handleNumbers:A,connect:b})}))})}function zt(D,b){De[D]=De[D]||[],De[D].push(b),D.split(".")[0]==="update"&&k.forEach(function(x,I){oe("update",I)})}function dt(D){var b=D&&D.split(".")[0],x=b?D.substring(b.length):D;Object.keys(De).forEach(function(I){var P=I.split(".")[0],_=I.substring(P.length);b&&b!==P||x&&x!==_||((P=_)!==te.aria&&P!==te.tooltips||x===_)&&delete De[I]})}function oe(D,b,x){Object.keys(De).forEach(function(I){var P=I.split(".")[0];
1D===P&&De[I].forEach(function(_){_.call(It,pe.map(t.format.to),b,pe.slice(),x||!1,X.slice(),It)})})}function kt(D,b,x,I,P,_,Z){var A;return 1<k.length&&!t.events.unconstrained&&(I&&0<b&&(A=J.getAbsoluteDistance(D[b-1],t.margin,!1),x=Math.max(x,A)),P&&b<k.length-1&&(A=J.getAbsoluteDistance(D[b+1],t.margin,!0),x=Math.min(x,A))),1<k.length&&t.limit&&(I&&0<b&&(A=J.getAbsoluteDistance(D[b-1],t.limit,!1),x=Math.min(x,A)),P&&b<k.length-1&&(A=J.getAbsoluteDistance(D[b+1],t.limit,!0),x=Math.max(x,A))),t.padding&&(b===0&&(A=J.getAbsoluteDistance(0,t.padding[0],!1),x=Math.max(x,A)),b===k.length-1&&(A=J.getAbsoluteDistance(100,t.padding[1],!0),x=Math.min(x,A))),!((x=u(x=Z?x:J.getStep(x)))===D[b]&&!_)&&x}function Ut(D,b){var x=t.ort;return(x?b:D)+", "+(x?D:b)}function fi(D,b,x,I,P){var _=x.slice(),Z=I[0],A=t.events.smoothSteps,H=[!D,D],B=[D,!D];I=I.slice(),D&&I.reverse(),1<I.length?I.forEach(function(j,Q){Q=kt(_,j,_[j]+b,H[Q],B[Q],!1,A),Q===!1?b=0:(b=Q-_[j],_[j]=Q)}):H=B=[!0];var q=!1;I.forEach(function(j,Q){q=tt(j,x[j]+b,H[Q],B[Q],!1,A)||q}),q&&(I.forEach(function(j){oe("update",j),oe("slide",j)}),P!=null&&oe("drag",Z))}function gi(D,b){return t.dir?100-D-b:D}function Zi(D,b){if(X[D]=b,pe[D]=J.fromStepping(b),b="translate("+Ut(gi(b,0)-Ui+"%","0")+")",k[D].style[t.transformRule]=b,t.events.invertConnects&&1<X.length&&(b=X.every(function(x,I,P){return I===0||x>=P[I-1]}),Xe!==!b))return Xe=!Xe,We(t,t.connect.map(function(x){return!x})),void Di();ht(D),ht(D+1),Xe&&(ht(D-1),ht(D+2))}function jt(){ae.forEach(function(D){var b=50<X[D]?-1:1,b=3+(k.length+b*D);k[D].style.zIndex=String(b)})}function tt(D,b,x,I,P,_){return(b=P?b:kt(X,D,b,x,I,!1,_))!==!1&&(Zi(D,b),!0)}function ht(D){var b,x,I;T[D]&&(b=X.slice(),Xe&&b.sort(function(P,_){return P-_}),I=100,x="translate("+Ut(gi(x=(x=0)!==D?b[D-1]:x,I=(I=D!==T.length-1?b[D]:I)-x)+"%","0")+")",I="scale("+Ut(I/100,"1")+")",T[D].style[t.transformRule]=x+" "+I)}function vi(D,b){return D===null||D===!1||D===void 0?X[b]:(typeof D=="number"&&(D=String(D)),(D=(D=t.format.from(D))!==!1?J.toStepping(D):D)===!1||isNaN(D)?X[b]:D)}function Ct(P,b,x){var I=f(P),P=X[0]===void 0;b=b===void 0||b,t.animate&&!P&&l(ie,t.cssClasses.tap,t.animationDuration),ae.forEach(function(A){tt(A,vi(I[A],A),!0,!1,x)});var _,Z=ae.length===1?0:1;for(P&&J.hasNoSize()&&(x=!0,X[0]=0,1<ae.length&&(_=100/(ae.length-1),ae.forEach(function(A){X[A]=A*_})));Z<ae.length;++Z)ae.forEach(function(A){tt(A,X[A],!0,!0,x)});jt(),ae.forEach(function(A){oe("update",A),I[A]!==null&&b&&oe("set",A)})}function yi(D){return(D=D===void 0?!1:D)?pe.length===1?pe[0]:pe.slice(0):(D=pe.map(t.format.to),D.length===1?D[0]:D)}function wi(_){var b=X[_],x=J.getNearbySteps(b),I=pe[_],P=x.thisStep.step,_=null;return t.snap?[I-x.stepBefore.startValue||null,x.stepAfter.startValue-I||null]:(P!==!1&&I+P>x.stepAfter.startValue&&(P=x.stepAfter.startValue-I),_=I>x.thisStep.startValue?x.thisStep.step:x.stepBefore.step!==!1&&I-x.stepBefore.highestStep,b===100?P=null:b===0&&(_=null),b=J.countStepDecimals(),P!==null&&P!==!1&&(P=Number(P.toFixed(b))),[_=_!==null&&_!==!1?Number(_.toFixed(b)):_,P])}function Di(){for(;C.firstChild;)C.removeChild(C.firstChild);for(var D=0;D<=t.handles;D++)T[D]=_t(C,t.connect[D]),ht(D);mi({drag:t.events.drag,fixed:!0})}y(r=ie,t.cssClasses.target),t.dir===0?y(r,t.cssClasses.ltr):y(r,t.cssClasses.rtl),t.ort===0?y(r,t.cssClasses.horizontal):y(r,t.cssClasses.vertical),y(r,getComputedStyle(r).direction==="rtl"?t.cssClasses.textDirectionRtl:t.cssClasses.textDirectionLtr),g=Oe(r,t.cssClasses.base),function(D,b){C=Oe(b,t.cssClasses.connects),k=[],(T=[]).push(_t(C,D[0]));for(var x=0;x<t.handles;x++)k.push(ji(b,x)),ae[x]=x,T.push(_t(C,D[x+1]))}(t.connect,g),mi(t.events),Ct(t.start),t.pips&&Ht(t.pips),t.tooltips&&di(),dt("update"+te.aria),zt("update"+te.aria,function(D,b,x,I,P){ae.forEach(function(A){var Z=k[A],H=kt(X,A,0,!0,!0,!0),B=kt(X,A,100,!0,!0,!0),q=P[A],A=String(t.ariaFormat.to(x[A])),H=J.fromStepping(H).toFixed(1),B=J.fromStepping(B).toFixed(1),q=J.fromStepping(q).toFixed(1);Z.children[0].setAttribute("aria-valuemin",H),Z.children[0].setAttribute("aria-valuemax",B),Z.children[0].setAttribute("aria-valuenow",q),Z.children[0].setAttribute("aria-valuetext",A)})});var It={destroy:function(){for(dt(te.aria),dt(te.tooltips),Object.keys(t.cssClasse
1s).forEach(function(D){M(ie,t.cssClasses[D])});ie.firstChild;)ie.removeChild(ie.firstChild);delete ie.noUiSlider},steps:function(){return ae.map(wi)},on:zt,off:dt,get:yi,set:Ct,setHandle:function(D,b,x,I){if(!(0<=(D=Number(D))&&D<ae.length))throw new Error("noUiSlider: invalid handle number, got: "+D);tt(D,vi(b,D),!0,!0,I),oe("update",D),x&&oe("set",D)},reset:function(D){Ct(t.start,D)},disable:function(D){D!=null?(k[D].setAttribute("disabled",""),k[D].handle.removeAttribute("tabindex")):(ie.setAttribute("disabled",""),k.forEach(function(b){b.handle.removeAttribute("tabindex")}))},enable:function(D){D!=null?(k[D].removeAttribute("disabled"),k[D].handle.setAttribute("tabindex","0")):(ie.removeAttribute("disabled"),k.forEach(function(b){b.removeAttribute("disabled"),b.handle.setAttribute("tabindex","0")}))},__moveHandles:function(D,b,x){fi(D,b,X,x)},options:h,updateOptions:function(D,b){var x=yi(),I=["margin","limit","padding","range","animate","snap","step","format","pips","tooltips","connect"];I.forEach(function(_){D[_]!==void 0&&(h[_]=D[_])});var P=o(h);I.forEach(function(_){D[_]!==void 0&&(t[_]=P[_])}),J=P.spectrum,t.margin=P.margin,t.limit=P.limit,t.padding=P.padding,t.pips?Ht(t.pips):Ot(),(t.tooltips?di:Rt)(),X=[],Ct(a(D.start)?D.start:x,b),D.connect&&Di()},target:ie,removePips:Ot,removeTooltips:Rt,getPositions:function(){return X.slice()},getTooltips:function(){return K},getOrigins:function(){return k},pips:Ht};return It}function d(r,t){if(!r||!r.nodeName)throw new Error("noUiSlider: create requires a single element, got: "+r);if(r.noUiSlider)throw new Error("noUiSlider: Slider was already initialized.");return t=m(r,o(t),t),r.noUiSlider=t}var v={__spectrum:z,cssClasses:le,create:d};e.create=d,e.cssClasses=le,e.default=v,Object.defineProperty(e,"__esModule",{value:!0})});const Ls={template:` 2 <div class="range-slider" ref="rangeSlider"></div> 3 `,props:["time","slider"],data(){return{icons:{clock1:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.42 0 8-3.58 8-8s-3.58-8-8-8s-8 3.58-8 8s3.58 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10C6.47 22 2 17.5 2 12S6.5 2 12 2m3.3 5.8l-3 5.2H11V7h1.5v2.65l1.5-2.6z"/></svg>',clock2:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.42 0 8-3.58 8-8s-3.58-8-8-8s-8 3.58-8 8s3.58 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10C6.47 22 2 17.5 2 12S6.5 2 12 2m.5 11H11V7h1.5v4.26l3.7-2.13l.75 1.3z"/></svg>',clock3:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m5 9.5V13h-6V7h1.5v4.5z"/></svg>',clock4:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m5 11.9l-.7 1.3l-5.3-2.9V7h1.5v4.4z"/></svg>',clock5:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m3.3 14.2L14 17l-3-5.2V7h1.5v4.4z"/></svg>',clock6:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m.5 5v10H11V7z"/></svg>',clock7:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m.5 5v5.2L9.8 17l-1.3-.8l2.5-4.4V7z"/></svg>',clock8:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m.5 10.8l-4.8 2.8l-.7-1.4l4-2.3V7h1.5z"/></svg>',clock9:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m.5 5v6H7v-1.5h4V7z"/></svg>',clock10:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" >
3<path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m.5 11H11l-4-2.3l.8-1.3l3.3 1.9V7h1.5v6Z"/></svg>',clock11:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.4 0 8-3.6 8-8s-3.6-8-8-8s-8 3.6-8 8s3.6 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10S2 17.5 2 12S6.5 2 12 2m.5 5v6H11L8.5 8.6l1.3-.8L11 10V7z"/></svg>',clock12:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M12 20c4.42 0 8-3.58 8-8s-3.58-8-8-8s-8 3.58-8 8s3.58 8 8 8m0-18c5.5 0 10 4.5 10 10s-4.5 10-10 10C6.47 22 2 17.5 2 12S6.5 2 12 2m.5 11.03H11V7h1.5z"/></svg>'}}},mounted(){this.initSlider()},beforeUnmount(){var e;(e=this.sliderLocal)==null||e.destroy(),this.$refs.rangeSlider.innerHTML="",this.sliderLocal=null,this.$emit("update:slider",null)},methods:{initSlider(){const e=this.$refs.rangeSlider;this.sliderLocal=noUiSlider.create(e,this.getSliderOptions(new Date,"init")),this.$emit("update:slider",this.sliderLocal),this.$nextTick(()=>{this.pipsClickEvent(e),this.sliderLocal.on("update.one",i=>{i=p.map(i,n=>p.floor(n)),this.$emit("update:time",i)})})},update(e){this.sliderLocal.updateOptions(this.getSliderOptions(e)),this.pipsClickEvent(this.$refs.rangeSlider)},getSliderOptions(e,i){const n={min:(()=>{const f=wt(e,{days:1});return yt(f).getTime()})(),max:(()=>Yt(e).getTime())()},a={to:f=>{const w=Ne(f,"P",{locale:this.$locale}),y=Ne(f,"p",{locale:this.$locale}),M=parseInt(Ne(f,"h",{locale:this.$locale}),10),F=[null,this.icons.clock1,this.icons.clock2,this.icons.clock3,this.icons.clock4,this.icons.clock5,this.icons.clock6,this.icons.clock7,this.icons.clock8,this.icons.clock9,this.icons.clock10,this.icons.clock11,this.icons.clock12][M];return` 4 <div class="no-ui-slider-tooltip-wrapper"> 5 <span class="date">${w}</span> 6 <strong class="time"> 7 <span class="icon" data-hour="${M}">${F}</span> 8 <span class="text">${y}</span> 9 </strong> 10 </div> 11 `}},s={orientation:"vertical",connect:!0,behaviour:"tap-drag"};let c,l;if(i)c=yt(e),l=Yt(e);else{const f=this.sliderLocal.get().map(parseFloat),w=new Date(p.first(f)),y=new Date(p.last(f)),M=(F,$)=>Is($,{hours:F.getHours(),minutes:F.getMinutes(),seconds:F.getSeconds(),milliseconds:F.getMilliseconds()}),E=ri(w,y);c=M(w,E?e:wt(e,{days:1})),l=M(y,e)}const u={start:[c,l],tooltips:[a,a],range:n,step:ds(15),pips:{mode:"positions",values:(()=>{const f=as({start:n.min,end:n.max}),w=n.max-n.min;return f.map(y=>(y.getTime()-n.min)/w*100)})(),density:.5,format:{to:f=>{const w=ls(f),y=Ne(f,"H",{locale:this.$locale}),M=[];if(w&&M.push("is-today"),y=="0"){const E=Ne(f,"cccccc",{locale:this.$locale});return M.push("is-new-day"),`<span class="${M.join(" ")}">${y} <strong>${E}</strong></span>`}else return`<span class="${M.join(" ")}">${y}</span>`}}}};return i?p.assign(s,u):u},pipsClickEvent(e){const i=e.querySelectorAll(".noUi-value"),n=this.sliderLocal;p.each(i,a=>{a.addEventListener("click",()=>{const s=Number(a.getAttribute("data-value"));if(isNaN(s))return;const[c,l]=n.get().map(Number),u=Math.abs(c-s),f=Math.abs(l-s),w=u<f?0:1,y=[null,null];y[w]=s,n.set(y)})})}}},Es={template:` 12 <button class="button replay-controls" @click="startReplay"> 13 14 <div class="play" v-html="icons.play" v-show="!playing"></div> 15 <div class="pause" v-html="icons.pause" v-show="playing"></div> 16 17 </button> 18 `,props:["slider","playing","time"],data(){return{icons:{pause:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M14 19h4V5h-4M6 19h4V5H6z"/></svg>',play:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" ><path fill="currentColor" d="M8 5.14v14l11-7z"/></svg>'},replay:{interval:{minutesPerSecond:70}}}},mounted(){},methods:{startReplay(){if(this.playing){clearInterval(this.playing),this.$emit("update:playing",!1);return}let e=null,i=!1,n=!1;const a=parseFloat(this.slider.options.step),s=parseFloat(this.slider.options.range.min),c=parseFloat(this.slider.options.range.max),l=this.replay.interval.minutesPerSecond,f=a/6e4/l*1e3,w=setInterval(()=>{let[y,M]=this.slider.get().map(parseFloat);e||(e=M-y),i?(M+=a,M-y>=e&&(i=!1)):n?(y+=a,M-y<=a&&(y=s,M=s,n=!1,i=!0)):(y+=a,M+=a,M>=c&&(n=!0));const E=[y,M];this.slider.set(E),this.$emit("update:time",E)},f);this.$emit("update:playing",w)}}};var Ri={exports:{}};(function(e,i){(function(n,a){e.exports=a()})(es,function(){return function(){var n={d:function(S,o){for(var m in o)n.o(o,m)&&!n.o(S,m)&&Object.defineProperty(S,m,{enumerable:!0,get:o[m]})},o:function(S,o){return Object.prototype.hasOwnProperty.call(S,o)}},a={};n.d(a,{default:function(){return ve}});var s={days:"days",months:"months",years:"years",day:"day",month:"month",year:"year",eventChangeViewDate:"changeViewDate",eventChangeCurrentView:"changeCurrentView",eventChangeFocusDate:"changeFocusDate",eventChangeSelectedDate:"changeSelectedDate",eventChangeTime:"changeTime",eventChangeLastSelectedDate:"changeLastSelectedDate",actionSelectDate:"selectDate",actionUnselectDate:"unselectDate",cssClassWeekend:"-weekend-"},c={classes:"",inline:!1,locale:{days:["\u0412\u043E\u0441\u043A\u0440\u0435\u0441\u0435\u043D\u044C\u0435","\u041F\u043E\u043D\u0435\u0434\u0435\u043B\u044C\u043D\u0438\u043A","\u0412\u0442\u043E\u0440\u043D\u0438\u043A","\u0421\u0440\u0435\u0434\u0430","\u0427\u0435\u0442\u0432\u0435\u0440\u0433","\u041F\u044F\u0442\u043D\u0438\u0446\u0430","\u0421\u0443\u0431\u0431\u043E\u0442\u0430"],daysShort:["\u0412\u043E\u0441","\u041F\u043E\u043D","\u0412\u0442\u043E","\u0421\u0440\u0435","\u0427\u0435\u0442","\u041F\u044F\u0442","\u0421\u0443\u0431"],daysMin:["\u0412\u0441","\u041F\u043D","\u0412\u0442","\u0421\u0440","\u0427\u0442","\u041F\u0442","\u0421\u0431"],months:["\u042F\u043D\u0432\u0430\u0440\u044C","\u0424\u0435\u0432\u0440\u0430\u043B\u044C","\u041C\u0430\u0440\u0442","\u0410\u043F\u0440\u0435\u043B\u044C","\u041C\u0430\u0439","\u0418\u044E\u043D\u044C","\u0418\u044E\u043B\u044C","\u0410\u0432\u0433\u0443\u0441\u0442","\u0421\u0435\u043D\u0442\u044F\u0431\u0440\u044C","\u041E\u043A\u0442\u044F\u0431\u0440\u044C","\u041D\u043E\u044F\u0431\u0440\u044C","\u0414\u0435\u043A\u0430\u0431\u0440\u044C"],monthsShort:["\u042F\u043D\u0432","\u0424\u0435\u0432","\u041C\u0430\u0440","\u0410\u043F\u0440","\u041C\u0430\u0439","\u0418\u044E\u043D","\u0418\u044E\u043B","\u0410\u0432\u0433","\u0421\u0435\u043D","\u041E\u043A\u0442","\u041D\u043E\u044F","\u0414\u0435\u043A"],today:"\u0421\u0435\u0433\u043E\u0434\u043D\u044F",clear:"\u041E\u0447\u0438\u0441\u0442\u0438\u0442\u044C",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},startDate:new Date,firstDay:"",weekends:[6,0],dateFormat:"",altField:"",altFieldDateFormat:"T",toggleSelected:!0,keyboardNav:!0,selectedDates:!1,container:"",isMobile:!1,visible:!1,position:"bottom left",offset:12,view:s.days,minView:s.days,showOtherMonths:!0,selectOtherMonths:!0,moveToOtherMonthsOnSelect:!0,showOtherYears:!0,selectOtherYears:!0,moveToOtherYearsOnSelect:!0,minDate:"",maxDate:"",disableNavWhenOutOfRange:!0,multipleDates:!1,multipleDatesSeparator:", ",range:!1,dynamicRange:!0,buttons:!1,monthsField:"monthsShort",showEvent:"focus",autoClose:!1,fixedHeight:!1,prevHtml:'<svg><path d="M 17,12 l -5,5 l 5,5"></path></svg>',nextHtml:'<svg><path d="M 14,12 l 5,5 l -5,5"></path></svg>',navTitles:{days:"MMMM, <i>yyyy</i>",months:"yyyy",years:"yyyy1 - yyyy2"},timepicker:!1,onlyTimepicker:!1,dateTimeSeparator:" ",timeFormat:"",minHours:0,maxHours:24,minMinutes:0,maxMinutes:59,hoursStep:1,minutesStep:1,onSelect:!1,onChangeViewDate:!1,onChangeView:!1,onRenderCell:!1,onShow:!1,onHide:!1,onClickDayName:!1};function l(S){let o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:document;return typeof S=="string"?o.querySelector(S):S}function u(){let{tagName:S="div",className:o="",innerHtml:m="",id:d="",attrs:v={}}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=document.createElement(S);return o&&r.classList.add(...o.split(" ")),d&&(r.id=d),m&&(r.innerHTML=m),v&&f(r,v),r}function f(S,o){for(let[m,d]of Object.entries(o))d!==void 0&&S.setAttribute(m,d);return S}function w(S){return new Date(S.getFullYear(),S.getMonth()+1,0).getDate()}function y(S){let o=S.getHours(),{hours:m,dayPeriod:d}=M(o);return{year:S.getFullYear(),month:S.getMonth(),fullMonth:S.getMonth()+1<10?"0"+(S.getMonth()+1):S.getMonth()+1,date:S.getDate(),fullDate:S.getDate()<10?"0"+S.getDate():S.getDate(),day:S.getDay(),hours:o,fullHours:E(o),hours12:m,dayPeriod:d,fullHours12:E(m),minutes:S.getMinutes(),fullMinutes:S.getMinutes()<10?"0"+S.getMinutes():S.getMinutes()}}function M(S){return{dayPeriod:S>11?"pm":"am",hours:S%12==0?12:S%12}}function E(S){return S<10?"0"+S:S}function F(S){let o=10*Math.floor(S.getFullYear()/10);return[o,o+9]}function $(){let S=[];for(var o=arguments.length,m=new Array(o),d=0;d<o;d++)m[d]=arguments[d];return m.forEach(v=>{if(typeof v=="object")for(let r in v)v[r]&&S.push(r);else v&&S.push(v)}),S.join(" ")}function O(S,o){let m=arguments.length>2&&arguments[2]!==void 0?arguments[2]:s.days;if(!S||!o)return!1;let d=y(S),v=y(o);return{[s.days]:d.date===v.date&&d.month===v.month&&d.year===v.year,[s.months]:d.month===v.month&&d.year===v.year,[s.years]:d.year===v.year}[m]}function R(S,o,m){let d=z(S,!1).getTime(),v=z(o,!1).getTime();return m?d>=v:d>v}function W(S,o){return!R(S,o,!0)}function z(S){let o=!(arguments.length>1&&arguments[1]!==void 0)||arguments[1],m=new Date(S.getTime());return typeof o!="boolean"||o||function(d){d.setHours(0,0,0,0)}(m),m}
18function V(S,o,m){S.length?S.forEach(d=>{d.addEventListener(o,m)}):S.addEventListener(o,m)}function se(S,o){return!(!S||S===document||S instanceof DocumentFragment)&&(S.matches(o)?S:se(S.parentNode,o))}function le(S,o,m){return S>m?m:S<o?o:S}function te(S){for(var o=arguments.length,m=new Array(o>1?o-1:0),d=1;d<o;d++)m[d-1]=arguments[d];return m.filter(v=>v).forEach(v=>{for(let[r,t]of Object.entries(v))if(t!==void 0&&t.toString()==="[object Object]"){let h=S[r]!==void 0?S[r].toString():void 0,g=t.toString(),C=Array.isArray(t)?[]:{};S[r]=S[r]?h!==g?C:S[r]:C,te(S[r],t)}else S[r]=t}),S}function re(S){let o=S;return S instanceof Date||(typeof S=="string"&&/^\d{4}-\d{2}-\d{2}$/.test(S)&&(S+="T00:00:00"),o=new Date(S)),isNaN(o.getTime())&&(console.log(`Unable to convert value "${S}" to Date object`),o=!1),o}function Te(S){let o="\\s|\\.|-|/|\\\\|,|\\$|\\!|\\?|:|;";return new RegExp("(^|>|"+o+")("+S+")($|<|"+o+")","g")}function Le(S,o,m){return(o=function(d){var v=function(r,t){if(typeof r!="object"||r===null)return r;var h=r[Symbol.toPrimitive];if(h!==void 0){var g=h.call(r,"string");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(d);return typeof v=="symbol"?v:String(v)}(o))in S?Object.defineProperty(S,o,{value:m,enumerable:!0,configurable:!0,writable:!0}):S[o]=m,S}class nt{constructor(){let{type:o,date:m,dp:d,opts:v,body:r}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Le(this,"focus",()=>{this.$cell.classList.add("-focus-"),this.focused=!0}),Le(this,"removeFocus",()=>{this.$cell.classList.remove("-focus-"),this.focused=!1}),Le(this,"select",()=>{this.$cell.classList.add("-selected-"),this.selected=!0}),Le(this,"removeSelect",()=>{this.$cell.classList.remove("-selected-","-range-from-","-range-to-"),this.selected=!1}),Le(this,"onChangeSelectedDate",()=>{this.isDisabled||(this._handleSelectedStatus(),this.opts.range&&this._handleRangeStatus())}),Le(this,"onChangeFocusDate",t=>{if(!t)return void(this.focused&&this.removeFocus());let h=O(t,this.date,this.type);h?this.focus():!h&&this.focused&&this.removeFocus(),this.opts.range&&this._handleRangeStatus()}),Le(this,"render",()=>(this.$cell.innerHTML=this._getHtml(),this._handleClasses(),this.$cell)),this.type=o,this.singleType=this.type.slice(0,-1),this.date=m,this.dp=d,this.opts=v,this.body=r,this.customData=!1,this.init()}init(){var o,m;let{onRenderCell:d}=this.opts;d&&(this.customData=d({date:this.date,cellType:this.singleType,datepicker:this.dp})),this._createElement(),this._bindDatepickerEvents(),(o=this.customData)!==null&&o!==void 0&&o.disabled?this.dp.disableDate(this.date):((m=this.customData)===null||m===void 0?void 0:m.disabled)===!1&&this.dp.enableDate(this.date)}_bindDatepickerEvents(){this.dp.on(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(s.eventChangeFocusDate,this.onChangeFocusDate)}unbindDatepickerEvents(){this.dp.off(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(s.eventChangeFocusDate,this.onChangeFocusDate)}_createElement(){var o;let{year:m,month:d,fullMonth:v,date:r,fullDate:t}=y(this.date),h=((o=this.customData)===null||o===void 0?void 0:o.attrs)||{};this.$cell=u({attrs:{"data-year":m,"data-month":d,"data-date":r,"data-iso-date":`${m}-${v}-${t}`,...h}}),this.$cell.adpCell=this}_getClassName(){var o;let m=new Date,{selectOtherMonths:d,selectOtherYears:v}=this.opts,{minDate:r,maxDate:t,isDateDisabled:h}=this.dp,{day:g}=y(this.date),C=this._isOutOfMinMaxRange(),k=h(this.date),T=$("air-datepicker-cell",`-${this.singleType}-`,{"-current-":O(m,this.date,this.type),"-min-date-":r&&O(r,this.date,this.type),"-max-date-":t&&O(t,this.date,this.type)}),N="";switch(this.type){case s.days:N=$({"-weekend-":this.dp.isWeekend(g),"-other-month-":this.isOtherMonth,"-disabled-":this.isOtherMonth&&!d||C||k});break;case s.months:N=$({"-disabled-":C});break;
18case s.years:N=$({"-other-decade-":this.isOtherDecade,"-disabled-":C||this.isOtherDecade&&!v})}return $(T,N,(o=this.customData)===null||o===void 0?void 0:o.classes).split(" ")}_getHtml(){var o;let{year:m,month:d,date:v}=y(this.date),{showOtherMonths:r,showOtherYears:t}=this.opts;if((o=this.customData)!==null&&o!==void 0&&o.html)return this.customData.html;switch(this.type){case s.days:return!r&&this.isOtherMonth?"":v;case s.months:return this.dp.locale[this.opts.monthsField][d];case s.years:return!t&&this.isOtherDecade?"":m}}_isOutOfMinMaxRange(){let{minDate:o,maxDate:m}=this.dp,{type:d,date:v}=this,{month:r,year:t,date:h}=y(v),g=d===s.days,C=d===s.years,k=!!o&&new Date(t,C?o.getMonth():r,g?h:o.getDate()),T=!!m&&new Date(t,C?m.getMonth():r,g?h:m.getDate());return o&&m?W(k,o)||R(T,m):o?W(k,o):m?R(T,m):void 0}destroy(){this.unbindDatepickerEvents()}_handleRangeStatus(){const{selectedDates:o,focusDate:m,rangeDateTo:d,rangeDateFrom:v}=this.dp,r=o.length;if(this.$cell.classList.remove("-range-from-","-range-to-","-in-range-"),!r)return;let t=v,h=d;if(r===1&&m){const N=R(m,o[0]);t=N?o[0]:m,h=N?m:o[0]}let g=$({"-in-range-":t&&h&&(C=this.date,k=t,T=h,R(C,k)&&W(C,T)),"-range-from-":t&&O(this.date,t,this.type),"-range-to-":h&&O(this.date,h,this.type)});var C,k,T;g&&this.$cell.classList.add(...g.split(" "))}_handleSelectedStatus(){let o=this.dp._checkIfDateIsSelected(this.date,this.type);o?this.select():!o&&this.selected&&this.removeSelect()}_handleInitialFocusStatus(){O(this.dp.focusDate,this.date,this.type)&&this.focus()}_handleClasses(){this.$cell.setAttribute("class",""),this._handleInitialFocusStatus(),this.dp.hasSelectedDates&&(this._handleSelectedStatus(),this.dp.opts.range&&this._handleRangeStatus()),this.$cell.classList.add(...this._getClassName())}get isDisabled(){return this.$cell.matches(".-disabled-")}get isOtherMonth(){return this.dp.isOtherMonth(this.date)}get isOtherDecade(){return this.dp.isOtherDecade(this.date)}}function fe(S,o,m){return(o=function(d){var v=function(r,t){if(typeof r!="object"||r===null)return r;var h=r[Symbol.toPrimitive];if(h!==void 0){var g=h.call(r,"string");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(d);return typeof v=="symbol"?v:String(v)}(o))in S?Object.defineProperty(S,o,{value:m,enumerable:!0,configurable:!0,writable:!0}):S[o]=m,S}let rt={[s.days]:`<div class="air-datepicker-body--day-names"></div><div class="air-datepicker-body--cells -${s.days}-"></div>`,[s.months]:`<div class="air-datepicker-body--cells -${s.months}-"></div>`,[s.years]:`<div class="air-datepicker-body--cells -${s.years}-"></div>`};const Fe=".air-datepicker-cell";class ge{constructor(o){let{dp:m,type:d,opts:v}=o;fe(this,"handleClick",r=>{let t=r.target.closest(Fe).adpCell;if(t.isDisabled)return;if(!this.dp.isMinViewReached)return void this.dp.down();let h=this.dp._checkIfDateIsSelected(t.date,t.type);h?this.dp._handleAlreadySelectedDates(h,t.date):this.dp.selectDate(t.date)}),fe(this,"handleDayNameClick",r=>{let t=r.target.getAttribute("data-day-index");this.opts.onClickDayName({dayIndex:Number(t),datepicker:this.dp})}),fe(this,"onChangeCurrentView",r=>{r!==this.type?this.hide():(this.show(),this.render())}),fe(this,"onMouseOverCell",r=>{let t=se(r.target,Fe);this.dp.setFocusDate(!!t&&t.adpCell.date)}),fe(this,"onMouseOutCell",()=>{this.dp.setFocusDate(!1)}),fe(this,"onClickBody",r=>{let{onClickDayName:t}=this.opts,h=r.target;h.closest(Fe)&&this.handleClick(r),t&&h.closest(".air-datepicker-body--day-name")&&this.handleDayNameClick(r)}),fe(this,"onMouseDown",r=>{this.pressed=!0;let t=se(r.target,Fe),h=t&&t.adpCell;O(h.date,this.dp.rangeDateFrom)&&(this.rangeFromFocused=!0),O(h.date,this.dp.rangeDateTo)&&(this.rangeToFocused=!0)}),fe(this,"onMouseMove",r=>{if(!this.pressed||!this.dp.isMinViewReached)return;r.preventDefault();let t=se(r.target,Fe),h=t&&t.adpCell,{selectedDates:g,rangeDateTo:C,rangeDateFrom:k}=this.dp;if(!h||h.isDisabled)return;let{date:T}=h;if(g.length===2){if(this.rangeFromFocused&&!R(T,C)){let{hours:N,minutes:K}=y(k);T.setHours(N),T.setMinutes(K),this.dp.rangeDateFrom=T,this.dp.replaceDate(k,T)}if(this.rangeToFocused&&!W(T,k)){let{hours:N,minutes:K}=y(C);T.setHours(N),T.setMinutes(K),this.dp.rangeDateTo=T,this.dp.replaceDate(C,T)}}}),fe(this,"onMouseUp",()=>{this.pressed=!1,this.rangeFromFocused=!1,this.rangeToFocused=!1}),fe(this,"onChangeViewDate",(r,t)=>{if(!this.isVisible)return;let h=F(r),g=F(t);switch(this.dp.currentView){case s.days:if(O(r,t,s.months))return;break;case s.months:if(O(r,t,s.years))return;break;case s.years:if(h[0]===g[0]&&h[1]===g[1])return}this.render()}),fe(this,"render",()=>
18{this.destroyCells(),this._generateCells(),this.cells.forEach(r=>{this.$cells.appendChild(r.render())})}),this.dp=m,this.type=d,this.opts=v,this.cells=[],this.$el="",this.pressed=!1,this.isVisible=!0,this.init()}init(){this._buildBaseHtml(),this.type===s.days&&this.renderDayNames(),this.render(),this._bindEvents(),this._bindDatepickerEvents()}_bindEvents(){let{range:o,dynamicRange:m}=this.opts;V(this.$el,"mouseover",this.onMouseOverCell),V(this.$el,"mouseout",this.onMouseOutCell),V(this.$el,"click",this.onClickBody),o&&m&&(V(this.$el,"mousedown",this.onMouseDown),V(this.$el,"mousemove",this.onMouseMove),V(window.document,"mouseup",this.onMouseUp))}_bindDatepickerEvents(){this.dp.on(s.eventChangeViewDate,this.onChangeViewDate),this.dp.on(s.eventChangeCurrentView,this.onChangeCurrentView)}_buildBaseHtml(){this.$el=u({className:`air-datepicker-body -${this.type}-`,innerHtml:rt[this.type]}),this.$names=l(".air-datepicker-body--day-names",this.$el),this.$cells=l(".air-datepicker-body--cells",this.$el)}_getDayNamesHtml(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.dp.locale.firstDay,m="",d=this.dp.isWeekend,{onClickDayName:v}=this.opts,r=o,t=0;for(;t<7;){let h=r%7;m+=`<div class="${$("air-datepicker-body--day-name",{[s.cssClassWeekend]:d(h),"-clickable-":!!v})}" data-day-index='${h}'>${this.dp.locale.daysMin[h]}</div>`,t++,r++}return m}renderDayNames(){this.$names.innerHTML=this._getDayNamesHtml()}_generateCell(o){let{type:m,dp:d,opts:v}=this;return new nt({type:m,dp:d,opts:v,date:o,body:this})}_generateCells(){ge.getDatesFunction(this.type)(this.dp,o=>{this.cells.push(this._generateCell(o))})}show(){this.isVisible=!0,this.$el.classList.remove("-hidden-")}hide(){this.isVisible=!1,this.$el.classList.add("-hidden-")}destroyCells(){this.cells.forEach(o=>o.destroy()),this.cells=[],this.$cells.innerHTML=""}destroy(){this.destroyCells(),this.dp.off(s.eventChangeViewDate,this.onChangeViewDate),this.dp.off(s.eventChangeCurrentView,this.onChangeCurrentView)}static getDaysDates(o,m){let{viewDate:d,opts:{fixedHeight:v},locale:{firstDay:r}}=o,t=w(d),{year:h,month:g}=y(d),C=new Date(h,g,1),k=new Date(h,g,t),T=C.getDay()-r,N=6-k.getDay()+r;T=T<0?T+7:T,N=N>6?N-7:N;let K=function(ae,Ze){let{year:De,month:Xe,date:Je}=y(ae);return new Date(De,Xe,Je-Ze)}(C,T),G=t+T+N,Y=K.getDate(),{year:ie,month:J}=y(K),pe=0;v&&(G=42);const X=[];for(;pe<G;){let ae=new Date(ie,J,Y+pe);m&&m(ae),X.push(ae),pe++}return X}static getMonthsDates(o,m){let{year:d}=o.parsedViewDate,v=0,r=[];for(;v<12;){const t=new Date(d,v);r.push(t),m&&m(t),v++}return r}static getYearsDates(o,m){let d=F(o.viewDate),v=d[0]-1,r=d[1]+1,t=v,h=[];for(;t<=r;){const g=new Date(t,0);h.push(g),m&&m(g),t++}return h}static getDatesFunction(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s.days;return{[s.days]:ge.getDaysDates,[s.months]:ge.getMonthsDates,[s.years]:ge.getYearsDates}[o]}}function ye(S,o,m){return(o=function(d){var v=function(r,t){if(typeof r!="object"||r===null)return r;var h=r[Symbol.toPrimitive];if(h!==void 0){var g=h.call(r,"string");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(d);return typeof v=="symbol"?v:String(v)}(o))in S?Object.defineProperty(S,o,{value:m,enumerable:!0,configurable:!0,writable:!0}):S[o]=m,S}class We{constructor(o){let{dp:m,opts:d}=o;ye(this,"onClickNav",v=>{let r=se(v.target,".air-datepicker-nav--action");if(!r)return;let t=r.dataset.action;this.dp[t]()}),ye(this,"onChangeViewDate",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),ye(this,"onChangeCurrentView",()=>{this.render(),this._resetNavStatus(),this.handleNavStatus()}),ye(this,"onClickNavTitle",()=>{this.dp.isFinalView||this.dp.up()}),ye(this,"update",()=>{let{prevHtml:v,nextHtml:r}=this.opts;this.$prev.innerHTML=v,this.$next.innerHTML=r,this._resetNavStatus(),this.render(),this.handleNavStatus()}),ye(this,"renderDelay",()=>{setTimeout(this.render)}),ye(this,"render",()=>{this.$title.innerHTML=this._getTitle(),function(v,r){for(let t in r)r[t]?v.classList.add(t):v.classList.remove(t)}(this.$title,{"-disabled-":this.dp.isFinalView})}),this.dp=m,this.opts=d,this.init()}init(){this._createElement(),this._buildBaseHtml(),this._defineDOM(),this.render(),this.handleNavStatus(),this._bindEvents(),this._bindDatepickerEvents()}_defineDOM(){this.$title=l(".air-datepicker-nav--title",this.$el),this.$prev=l('[data-action="prev"]',this.$el),this.$next=l('[data-action="next"]',this.$el)}_bindEvents(){this.$el.addEventListener("click",this.onClickNav),this.$title.addEventListener("click",this.onClickNavTitle)}_bindDatepickerEvents(){this.dp.on(s.eventChangeViewDate,this.onChangeViewDate),this.dp.on(s.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.on(s.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.on(s.eventChangeTime,this.render))}destroy(){this.dp.off(s.eventChangeViewDate,this.onChangeViewDate),this.dp.off(s.eventChangeCurrentView,this.onChangeCurrentView),this.isNavIsFunction&&(this.dp.off(s.eventChangeSelectedDate,this.renderDelay),this.dp.opts.timepicker&&this.dp.off(s.eventChangeTime,this.render))}_createElement(){this.$el=u({tagName:"nav",className:"air-datepicker-nav"})}_getTitle(){let{dp:o,opts:m}=this,d=m.navTitles[o.currentView];return typeof d=="function"?d(o):o.formatDate(o.viewDate,d)}handleNavStatus(){let{disableNavWhenOutOfRange:o}=this.opts,{minDate:m,maxDate:d}=this.dp;if(!m&&!d||!o)return;let{year:v,month:r}=this.dp.parsedViewDate,t=!!m&&y(m),h=!!d&&y(d);switch(this.dp.currentView){case s.days:m&&t.month>=r&&t.year>=v&&this._disableNav("prev"),d&&h.month<=r&&h.year<=v&&this._disableNav("next");break;case s.months:m&&t.year>=v&&this._disableNav("prev"),d&&h.year<=v&&this._disableNav("next");break;case s.years:{let g=F(this.dp.viewDate);m&&t.year>=g[0]&&this._disableNav("prev"),d&&h.year<=g[1]&&this._disableNav("next");break}}}_disableNav(o){l('[data-action="'+o+'"]',this.$el).classList.add("-disabled-")}_resetNavStatus(){(function(o){for(var m=arguments.length,d=new Array(m>1?m-1:0),v=1;v<m;v++)d[v-1]=arguments[v];o.length?o.forEach(r=>{r.classList.remove(...d)}):o.classList.remove(...d)})(this.$el.querySelectorAll(".air-datepicker-nav--action"),"-disabled-")}_buildBaseHtml(){let{prevHtml:o,nextHtml:m}=this.opts;this.$el.innerHTML=`<div class="air-datepicker-nav--action" data-action="prev">${o}</div><div class="air-datepicker-nav--title"></div><div class="air-datepicker-nav--action" data-action="next">${m}</div>`}get isNavIsFunction(){let{navTitles:o}=this.opts;return Object.keys(o).find(m=>typeof o[m]=="function")}}var Re={today:{content:S=>S.locale.today,onClick:S=>S.setViewDate(new Date)},clear:{content:S=>S.locale.clear,onClick:S=>S.clear()}};class Ge{constructor(o){let{dp:m,opts:d}=o;this.dp=m,this.opts=d,this.init()}init(){this.createElement(),this.render()}createElement(){this.$el=u({className:"air-datepicker-buttons"})}destroy(){this.$el.parentNode.removeChild(this.$el)}clearHtml(){return this.$el.innerHTML="",this}generateButtons(){let{buttons:o}=this.opts;Array.isArray(o)||(o=[o]),o.forEach(m=>{let d=m;typeof m=="string"&&Re[m]&&(d=Re[m]);let v=this.createButton(d);d.onClick&&this.attachEventToButton(v,d.onClick),this.$el.appendChild(v)})}attachEventToButton(o,m){o.addEventListener("click",()=>{m(this.dp)})}createButton(o){let{content:m,className:d,tagName:v="button",attrs:r={}}=o;return u({tagName:v,innerHtml:`<span tabindex='-1'>${typeof m=="function"?m(this.dp):m}</span>`,className:$("air-datepicker-button",d),attrs:r})}render(){this.generateButtons()}}function Se(S,o,m){return(o=function(d){var v=function(r,t){if(typeof r!="object"||r===null)return r;var h=r[Symbol.toPrimitive];if(h!==void 0){var g=h.call(r,"string");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(d);return typeof v=="symbol"?v:String(v)}(o))in S?Object.defineProperty(S,o,{value:m,enumerable:!0,configurable:!0,writable:!0}):S[o]=m,S}class at{constructor(){let{opts:o,dp:m}=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Se(this,"toggleTimepickerIsActive",v=>{this.dp.timepickerIsActive=v}),Se(this,"onChangeSelectedDate",v=>{let{date:r,updateTime:t=!1}=v;r&&(this.setMinMaxTime(r),this.setCurrentTime(!!t&&r),this.addTimeToDate(r))}),Se(this,"onChangeLastSelectedDate",v=>{v&&(this.setTime(v),this.render())}),Se(this,"onChangeInputRange",v=>{let r=v.target;this[r.getAttribute("name")]=r.value,this.updateText(),this.dp.trigger(s.eventChangeTime,{hours:this.hours,minutes:this.minutes})}),Se(this,"onMouseEnterLeave",v=>{let r=v.target.getAttribute("name"),t=this.$minutesText;r==="hours"&&(t=this.$hoursText),t.classList.toggle("-focus-")}),Se(this,"onFocus",()=>{this.toggleTimepickerIsActive(!0)}),Se(this,"onBlur",()=>{this.toggleTimepickerIsActive(!1)}),this.opts=o,this.dp=m;let{timeFormat:d}=this.dp.locale;
18d&&(d.match(Te("h"))||d.match(Te("hh")))&&(this.ampm=!0),this.init()}init(){this.setTime(this.dp.lastSelectedDate||this.dp.viewDate),this.createElement(),this.buildHtml(),this.defineDOM(),this.render(),this.bindDatepickerEvents(),this.bindDOMEvents()}bindDatepickerEvents(){this.dp.on(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.on(s.eventChangeLastSelectedDate,this.onChangeLastSelectedDate)}bindDOMEvents(){let o="input";navigator.userAgent.match(/trident/gi)&&(o="change"),V(this.$ranges,o,this.onChangeInputRange),V(this.$ranges,"mouseenter",this.onMouseEnterLeave),V(this.$ranges,"mouseleave",this.onMouseEnterLeave),V(this.$ranges,"focus",this.onFocus),V(this.$ranges,"mousedown",this.onFocus),V(this.$ranges,"blur",this.onBlur)}createElement(){this.$el=u({className:$("air-datepicker-time",{"-am-pm-":this.dp.ampm})})}destroy(){this.dp.off(s.eventChangeSelectedDate,this.onChangeSelectedDate),this.dp.off(s.eventChangeLastSelectedDate,this.onChangeLastSelectedDate),this.$el.parentNode.removeChild(this.$el)}buildHtml(){let{ampm:o,hours:m,displayHours:d,minutes:v,minHours:r,minMinutes:t,maxHours:h,maxMinutes:g,dayPeriod:C,opts:{hoursStep:k,minutesStep:T}}=this;this.$el.innerHTML=`<div class="air-datepicker-time--current"> <span class="air-datepicker-time--current-hours">${E(d)}</span> <span class="air-datepicker-time--current-colon">:</span> <span class="air-datepicker-time--current-minutes">${E(v)}</span> `+(o?`<span class='air-datepicker-time--current-ampm'>${C}</span>`:"")+`</div><div class="air-datepicker-time--sliders"> <div class="air-datepicker-time--row"> <input type="range" name="hours" value="${m}" min="${r}" max="${h}" step="${k}"/> </div> <div class="air-datepicker-time--row"> <input type="range" name="minutes" value="${v}" min="${t}" max="${g}" step="${T}"/> </div></div>`}defineDOM(){let o=m=>l(m,this.$el);this.$ranges=this.$el.querySelectorAll('[type="range"]'),this.$hours=o('[name="hours"]'),this.$minutes=o('[name="minutes"]'),this.$hoursText=o(".air-datepicker-time--current-hours"),this.$minutesText=o(".air-datepicker-time--current-minutes"),this.$ampm=o(".air-datepicker-time--current-ampm")}setTime(o){this.setMinMaxTime(o),this.setCurrentTime(o)}addTimeToDate(o){o&&(o.setHours(this.hours),o.setMinutes(this.minutes))}setMinMaxTime(o){if(this.setMinMaxTimeFromOptions(),o){let{minDate:m,maxDate:d}=this.dp;m&&O(o,m)&&this.setMinTimeFromMinDate(m),d&&O(o,d)&&this.setMaxTimeFromMaxDate(d)}}setCurrentTime(o){let{hours:m,minutes:d}=o?y(o):this;this.hours=le(m,this.minHours,this.maxHours),this.minutes=le(d,this.minMinutes,this.maxMinutes)}setMinMaxTimeFromOptions(){let{minHours:o,minMinutes:m,maxHours:d,maxMinutes:v}=this.opts;this.minHours=le(o,0,23),this.minMinutes=le(m,0,59),this.maxHours=le(d,0,23),this.maxMinutes=le(v,0,59)}setMinTimeFromMinDate(o){let{lastSelectedDate:m}=this.dp;this.minHours=o.getHours(),m&&m.getHours()>o.getHours()?this.minMinutes=this.opts.minMinutes:this.minMinutes=o.getMinutes()}setMaxTimeFromMaxDate(o){let{lastSelectedDate:m}=this.dp;this.maxHours=o.getHours(),m&&m.getHours()<o.getHours()?this.maxMinutes=this.opts.maxMinutes:this.maxMinutes=o.getMinutes()}updateSliders(){f(this.$hours,{min:this.minHours,max:this.maxHours}).value=this.hours,f(this.$minutes,{min:this.minMinutes,max:this.maxMinutes}).value=this.minutes}updateText(){this.$hoursText.innerHTML=E(this.displayHours),this.$minutesText.innerHTML=E(this.minutes),this.ampm&&(this.$ampm.innerHTML=this.dayPeriod)}set hours(o){this._hours=o;let{hours:m,dayPeriod:d}=M(o);this.displayHours=this.ampm?m:o,this.dayPeriod=d}get hours(){return this._hours}render(){this.updateSliders(),this.updateText()}}function Me(S,o,m){return(o=function(d){var v=function(r,t){if(typeof r!="object"||r===null)return r;var h=r[Symbol.toPrimitive];if(h!==void 0){var g=h.call(r,"string");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(d);return typeof v=="symbol"?v:String(v)}(o))in S?Object.defineProperty(S,o,{value:m,enumerable:!0,configurable:!0,writable:!0}):S[o]=m,S}
18class ot{constructor(o){let{dp:m,opts:d}=o;Me(this,"pressedKeys",new Set),Me(this,"hotKeys",new Map([[[["Control","ArrowRight"],["Control","ArrowUp"]],v=>v.month++],[[["Control","ArrowLeft"],["Control","ArrowDown"]],v=>v.month--],[[["Shift","ArrowRight"],["Shift","ArrowUp"]],v=>v.year++],[[["Shift","ArrowLeft"],["Shift","ArrowDown"]],v=>v.year--],[[["Alt","ArrowRight"],["Alt","ArrowUp"]],v=>v.year+=10],[[["Alt","ArrowLeft"],["Alt","ArrowDown"]],v=>v.year-=10],[["Control","Shift","ArrowUp"],(v,r)=>r.up()]])),Me(this,"handleHotKey",v=>{let r=this.hotKeys.get(v),t=y(this.getInitialFocusDate());r(t,this.dp);let{year:h,month:g,date:C}=t,k=w(new Date(h,g));k<C&&(C=k);let T=this.dp.getClampedDate(new Date(h,g,C));this.dp.setFocusDate(T,{viewDateTransition:!0})}),Me(this,"isHotKeyPressed",()=>{let v=!1,r=this.pressedKeys.size,t=h=>this.pressedKeys.has(h);for(let[h]of this.hotKeys){if(v)break;if(Array.isArray(h[0]))h.forEach(g=>{v||r!==g.length||(v=g.every(t)&&h)});else{if(r!==h.length)continue;v=h.every(t)&&h}}return v}),Me(this,"isArrow",v=>v>=37&&v<=40),Me(this,"onKeyDown",v=>{if(!this.dp.visible&&!this.dp.treatAsInline)return;let{key:r,which:t}=v,{dp:h,dp:{focusDate:g},opts:C}=this;this.registerKey(r);let k=this.isHotKeyPressed();if(k)return v.preventDefault(),void this.handleHotKey(k);if(this.isArrow(t))return v.preventDefault(),void this.focusNextCell(r);if(r==="Enter"){if(h.currentView!==C.minView)return void h.down();if(g){let T=h._checkIfDateIsSelected(g);return void(T?h._handleAlreadySelectedDates(T,g):h.selectDate(g))}}r==="Escape"&&this.dp.hide()}),Me(this,"onKeyUp",v=>{this.removeKey(v.key)}),this.dp=m,this.opts=d,this.init()}init(){this.bindKeyboardEvents()}bindKeyboardEvents(){let{$el:o}=this.dp;o.addEventListener("keydown",this.onKeyDown),o.addEventListener("keyup",this.onKeyUp)}destroy(){let{$el:o}=this.dp;o.removeEventListener("keydown",this.onKeyDown),o.removeEventListener("keyup",this.onKeyUp),this.hotKeys=null,this.pressedKeys=null}getInitialFocusDate(){let{focusDate:o,currentView:m,selectedDates:d,parsedViewDate:{year:v,month:r}}=this.dp,t=o||d[d.length-1];if(!t)switch(m){case s.days:t=new Date(v,r,new Date().getDate());break;case s.months:t=new Date(v,r,1);break;case s.years:t=new Date(v,0,1)}return t}focusNextCell(o){let m=this.getInitialFocusDate(),{currentView:d}=this.dp,{days:v,months:r,years:t}=s,h=y(m),g=h.year,C=h.month,k=h.date;switch(o){case"ArrowLeft":d===v&&(k-=1),d===r&&(C-=1),d===t&&(g-=1);break;case"ArrowUp":d===v&&(k-=7),d===r&&(C-=3),d===t&&(g-=4);break;case"ArrowRight":d===v&&(k+=1),d===r&&(C+=1),d===t&&(g+=1);break;case"ArrowDown":d===v&&(k+=7),d===r&&(C+=3),d===t&&(g+=4)}let T=this.dp.getClampedDate(new Date(g,C,k));this.dp.setFocusDate(T,{viewDateTransition:!0})}registerKey(o){this.pressedKeys.add(o)}removeKey(o){this.pressedKeys.delete(o)}}let qe={on(S,o){this.__events||(this.__events={}),this.__events[S]?this.__events[S].push(o):this.__events[S]=[o]},off(S,o){this.__events&&this.__events[S]&&(this.__events[S]=this.__events[S].filter(m=>m!==o))},removeAllEvents(){this.__events={}},trigger(S){for(var o=arguments.length,m=new Array(o>1?o-1:0),d=1;d<o;d++)m[d-1]=arguments[d];this.__events&&this.__events[S]&&this.__events[S].forEach(v=>{v(...m)})}};function U(S,o,m){return(o=function(d){var v=function(r,t){if(typeof r!="object"||r===null)return r;var h=r[Symbol.toPrimitive];if(h!==void 0){var g=h.call(r,"string");if(typeof g!="object")return g;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(r)}(d);return typeof v=="symbol"?v:String(v)}(o))in S?Object.defineProperty(S,o,{value:m,enumerable:!0,configurable:!0,writable:!0}):S[o]=m,S}let ue="",we="",Ke=!1;class ve{static buildGlobalContainer(o){Ke=!0,ue=u({className:o,id:o}),l("body").appendChild(ue)}constructor(o,m){var d=this;if(U(this,"viewIndexes",[s.days,s.months,s.years]),U(this,"next",()=>{let{year:t,month:h}=this.parsedViewDate;switch(this.currentView){case s.days:this.setViewDate(new Date(t,h+1,1));break;case s.months:this.setViewDate(new Date(t+1,h,1));break;case s.years:this.setViewDate(new Date(t+10,0,1))}}),U(this,"prev",()=>{let{year:t,month:h}=this.parsedViewDate;switch(this.currentView){case s.days:this.setViewDate(new Date(t,h-1,1));break;case s.months:this.setViewDate(new Date(t-1,h,1));break;case s.years:this.setViewDate(new Date(t-10,0,1))}}),U(this,"_finishHide",()=>{this.hideAnimation=!1,this._destroyComponents(),this.$container.removeChild(this.$datepicker)}),U(this,"setPosition",function(t){let h=arguments.length>1&&arguments[1]!==void 0&&arguments[1];if(typeof(t=t||d.opts.position)=="function")return void(d.customHide=t({$datepicker:d.$datepicker,$target:d.$el,$pointer:d.$pointer,isViewChange:h,done:d._finishHide}));let g,C,{isMobile:k}=d.opts,T=d.$el.getBoundingClientRect(),N=d.$el.getBoundingClientRect(),K=d.$datepicker.offsetParent,G=d.$el.offsetParent,Y=d.$datepicker.getBoundingClientRect(),ie=t.split(" "),J=window.scrollY,pe=window.scrollX,X=d.opts.offset,ae=ie[0],Ze=ie[1];if(k)d.$datepicker.style.cssText="left: 50%; top: 50%";else{if(K===G&&K!==document.body&&(N={top:d.$el.offsetTop,left:d.$el.offsetLeft,width:T.width,height:d.$el.offsetHeight},J=0,pe=0),K!==G&&K!==document.body){let De=K.getBoundingClientRect();
18N={top:T.top-De.top,left:T.left-De.left,width:T.width,height:T.height},J=0,pe=0}switch(ae){case"top":g=N.top-Y.height-X;break;case"right":C=N.left+N.width+X;break;case"bottom":g=N.top+N.height+X;break;case"left":C=N.left-Y.width-X}switch(Ze){case"top":g=N.top;break;case"right":C=N.left+N.width-Y.width;break;case"bottom":g=N.top+N.height-Y.height;break;case"left":C=N.left;break;case"center":/left|right/.test(ae)?g=N.top+N.height/2-Y.height/2:C=N.left+N.width/2-Y.width/2}d.$datepicker.style.cssText=`left: ${C+pe}px; top: ${g+J}px`}}),U(this,"_setInputValue",()=>{let{opts:t,$altField:h,locale:{dateFormat:g}}=this,{altFieldDateFormat:C,altField:k}=t;k&&h&&(h.value=this._getInputValue(C)),this.$el.value=this._getInputValue(g),this.$el.dispatchEvent(new Event("change"))}),U(this,"_getInputValue",t=>{let{selectedDates:h,opts:g}=this,{multipleDates:C,multipleDatesSeparator:k}=g;if(!h.length)return"";let T=typeof t=="function",N=T?t(C?h:h[0]):h.map(K=>this.formatDate(K,t));return N=T?N:N.join(k),N}),U(this,"_checkIfDateIsSelected",function(t){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s.days,g=!1;return d.selectedDates.some(C=>{let k=O(t,C,h);return g=k&&C,k}),g}),U(this,"_scheduleCallAfterTransition",t=>{this._cancelScheduledCall(),t&&t(!1),this._onTransitionEnd=()=>{t&&t(!0)},this.$datepicker.addEventListener("transitionend",this._onTransitionEnd,{once:!0})}),U(this,"_cancelScheduledCall",()=>{this.$datepicker.removeEventListener("transitionend",this._onTransitionEnd)}),U(this,"setViewDate",t=>{if(!((t=re(t))instanceof Date)||O(t,this.viewDate))return;let h=this.viewDate;this.viewDate=t;let{onChangeViewDate:g}=this.opts;if(g){let{month:C,year:k}=this.parsedViewDate;g({month:C,year:k,decade:this.curDecade})}this.trigger(s.eventChangeViewDate,t,h)}),U(this,"setFocusDate",function(t){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};(!t||(t=re(t))instanceof Date)&&(d.focusDate=t,d.trigger(s.eventChangeFocusDate,t,h))}),U(this,"setCurrentView",function(t){let h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(d.viewIndexes.includes(t)){if(d.currentView=t,d.elIsInput&&d.visible&&d.setPosition(void 0,!0),d.trigger(s.eventChangeCurrentView,t),!d.views[t]){let g=d.views[t]=new ge({dp:d,opts:d.opts,type:t});d.shouldUpdateDOM&&d.$content.appendChild(g.$el)}d.opts.onChangeView&&!h.silent&&d.opts.onChangeView(t)}}),U(this,"_updateLastSelectedDate",t=>{this.lastSelectedDate=t,this.trigger(s.eventChangeLastSelectedDate,t)}),U(this,"destroy",()=>{if(this.isDestroyed)return;let{showEvent:t,isMobile:h}=this.opts,g=this.$datepicker.parentNode;g&&g.removeChild(this.$datepicker),this.$el.removeEventListener(t,this._onFocus),this.$el.removeEventListener("blur",this._onBlur),window.removeEventListener("resize",this._onResize),h&&this._removeMobileAttributes(),this.keyboardNav&&this.keyboardNav.destroy(),this.views=null,this.nav=null,this.$datepicker=null,this.opts={},this.$customContainer=null,this.viewDate=null,this.focusDate=null,this.selectedDates=[],this.rangeDateFrom=null,this.rangeDateTo=null,this.isDestroyed=!0}),U(this,"update",function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},h=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},g=te({},d.opts),{silent:C}=h;te(d.opts,t);let{timepicker:k,buttons:T,range:N,selectedDates:K,isMobile:G}=d.opts,Y=d.visible||d.treatAsInline;d._createMinMaxDates(),d._limitViewDateByMaxMinDates(),d._handleLocale(),K&&(d.selectedDates=[],d.selectDate(K,{silent:C})),t.view&&d.setCurrentView(t.view,{silent:C}),d._setInputValue(),g.range&&!N?(d.rangeDateTo=!1,d.rangeDateFrom=!1):!g.range&&N&&d.selectedDates.length&&(d.rangeDateFrom=d.selectedDates[0],d.rangeDateTo=d.selectedDates[1]),g.timepicker&&!k?(Y&&d.timepicker.destroy(),d.timepicker=!1,d.$timepicker.parentNode.removeChild(d.$timepicker)):!g.timepicker&&k&&d._addTimepicker(),!g.buttons&&T?d._addButtons():g.buttons&&!T?(d.buttons.destroy(),d.$buttons.parentNode.removeChild(d.$buttons)):Y&&g.buttons&&T&&d.buttons.clearHtml().render(),!g.isMobile&&G?(d.treatAsInline||we||d._createMobileOverlay(),d._addMobileAttributes(),d.visible&&d._showMobileOverlay()):g.isMobile&&!G&&(d._removeMobileAttributes(),d.visible&&(we.classList.remove("-active-"),typeof d.opts.position!="function"&&d.setPosition())),Y&&(d.nav.update(
18),d.views[d.currentView].render(),d.currentView===s.days&&d.views[d.currentView].renderDayNames())}),U(this,"disableDate",(t,h)=>{(Array.isArray(t)?t:[t]).forEach(g=>{let C=re(g);if(!C)return;let k=h?"delete":"add";this.disabledDates[k](this.formatDate(C,"yyyy-MM-dd"));let T=this.getCell(C,this.currentViewSingular);T&&T.adpCell.render()},[])}),U(this,"enableDate",t=>{this.disableDate(t,!0)}),U(this,"isDateDisabled",t=>{let h=re(t);return this.disabledDates.has(this.formatDate(h,"yyyy-MM-dd"))}),U(this,"isOtherMonth",t=>{let{month:h}=y(t);return h!==this.parsedViewDate.month}),U(this,"isOtherYear",t=>{let{year:h}=y(t);return h!==this.parsedViewDate.year}),U(this,"isOtherDecade",t=>{let{year:h}=y(t),[g,C]=F(this.viewDate);return h<g||h>C}),U(this,"_onChangeSelectedDate",t=>{let{silent:h}=t;setTimeout(()=>{this._setInputValue(),this.opts.onSelect&&!h&&this._triggerOnSelect()})}),U(this,"_onChangeFocusedDate",function(t){let{viewDateTransition:h}=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!t)return;let g=!1;h&&(g=d.isOtherMonth(t)||d.isOtherYear(t)||d.isOtherDecade(t)),g&&d.setViewDate(t),d.opts.onFocus&&d.opts.onFocus({datepicker:d,date:t})}),U(this,"_onChangeTime",t=>{let{hours:h,minutes:g}=t,C=new Date,{lastSelectedDate:k,opts:{onSelect:T}}=this,N=k;k||(N=C);let K=this.getCell(N,this.currentViewSingular),G=K&&K.adpCell;G&&G.isDisabled||(N.setHours(h),N.setMinutes(g),k?(this._setInputValue(),T&&this._triggerOnSelect()):this.selectDate(N))}),U(this,"_onFocus",t=>{this.visible||this.show()}),U(this,"_onBlur",t=>{this.inFocus||!this.visible||this.opts.isMobile||this.hide()}),U(this,"_onMouseDown",t=>{this.inFocus=!0}),U(this,"_onMouseUp",t=>{this.inFocus=!1,this.$el.focus()}),U(this,"_onResize",()=>{this.visible&&typeof this.opts.position!="function"&&this.setPosition()}),U(this,"_onClickOverlay",()=>{this.visible&&this.hide()}),U(this,"getViewDates",function(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:s.days;return ge.getDatesFunction(t)(d)}),U(this,"isWeekend",t=>this.opts.weekends.includes(t)),U(this,"getClampedDate",t=>{let{minDate:h,maxDate:g}=this,C=t;return g&&R(t,g)?C=g:h&&W(t,h)&&(C=h),C}),this.$el=l(o),!this.$el)return;this.$datepicker=u({className:"air-datepicker"}),this.opts=te({},c,m),this.$customContainer=!!this.opts.container&&l(this.opts.container),this.$altField=l(this.opts.altField||!1);let{view:v,startDate:r}=this.opts;r||(this.opts.startDate=new Date),this.$el.nodeName==="INPUT"&&(this.elIsInput=!0),this.inited=!1,this.visible=!1,this.viewDate=re(this.opts.startDate),this.focusDate=!1,this.initialReadonly=this.$el.getAttribute("readonly"),this.customHide=!1,this.currentView=v,this.selectedDates=[],this.disabledDates=new Set,this.isDestroyed=!1,this.views={},this.keys=[],this.rangeDateFrom="",this.rangeDateTo="",this.timepickerIsActive=!1,this.treatAsInline=this.opts.inline||!this.elIsInput,this.init()}init(){let{opts:o,treatAsInline:m,opts:{inline:d,isMobile:v,selectedDates:r,keyboardNav:t,onlyTimepicker:h}}=this,g=l("body");(!Ke||Ke&&ue&&!g.contains(ue))&&!d&&this.elIsInput&&!this.$customContainer&&ve.buildGlobalContainer(ve.defaultGlobalContainerId),!v||we||m||this._createMobileOverlay(),this._handleLocale(),this._bindSubEvents(),this._createMinMaxDates(),this._limitViewDateByMaxMinDates(),this.elIsInput&&(d||this._bindEvents(),t&&!h&&(this.keyboardNav=new ot({dp:this,opts:o}))),r&&this.selectDate(r,{silent:!0}),this.opts.visible&&!m&&this.show(),v&&!m&&this.$el.setAttribute("readonly",!0),m&&this._createComponents()}_createMobileOverlay(){we=u({className:"air-datepicker-overlay"}),ue.appendChild(we)}_createComponents(){let{opts:o,treatAsInline:m,opts:{inline:d,buttons:v,timepicker:r,position:t,classes:h,onlyTimepicker:g,isMobile:C}}=this;this._buildBaseHtml(),this.elIsInput&&(d||this._setPositionClasses(t)),!d&&this.elIsInput||this.$datepicker.classList.add("-inline-"),h&&this.$datepicker.classList.add(...h.split(" ")),g&&this.$datepicker.classList.add("-only-timepicker-"),C&&!m&&this._addMobileAttributes(),this.views[this.currentView]=new ge({dp:this,type:this.currentView,opts:o}),this.nav=new We({dp:this,opts:o}),r&&this._addTimepicker(),v&&this._addButtons(),this.$content.appendChild(this.views[this.currentView].$el),this.$nav.appendChild(this.nav.$el)}_destroyComponents(){for(let o in this.views)this.views[o].destroy();this.views={},this.nav.destroy(),this.timepicker&&this.timepicker.destroy()}_addMobileAttributes(){we.addEventListener("click",this._onClickOverlay),this.$datepicker.classList.add("-is-mobile-"),this.$el.setAttribute("readonly",!0)}_removeMobileAttributes(){we.removeEventListener("click",this._onClickOverlay),this.$datepicker.classList.remove("-is-mobile-"),this.initialReadonly||this.initialReadonly===""||this.$el.removeAttribute("readonly")}_createMinMaxDates(){let{minDate:o,maxDate:m}=this.opts;this.minDate=!!o&&re(o),this.maxDate=!!m&&re(m)}_addTimepicker(){this.$timepicker=u({className:"air-datepicker--time"}),this.$datepicker.appendChild(this.$timepicker),this.timepicker=new at({d
18p:this,opts:this.opts}),this.$timepicker.appendChild(this.timepicker.$el)}_addButtons(){this.$buttons=u({className:"air-datepicker--buttons"}),this.$datepicker.appendChild(this.$buttons),this.buttons=new Ge({dp:this,opts:this.opts}),this.$buttons.appendChild(this.buttons.$el)}_bindSubEvents(){this.on(s.eventChangeSelectedDate,this._onChangeSelectedDate),this.on(s.eventChangeFocusDate,this._onChangeFocusedDate),this.on(s.eventChangeTime,this._onChangeTime)}_buildBaseHtml(){let{inline:o}=this.opts;var m,d;this.elIsInput?o?(m=this.$datepicker,(d=this.$el).parentNode.insertBefore(m,d.nextSibling)):this.$container.appendChild(this.$datepicker):this.$el.appendChild(this.$datepicker),this.$datepicker.innerHTML='<i class="air-datepicker--pointer"></i><div class="air-datepicker--navigation"></div><div class="air-datepicker--content"></div>',this.$content=l(".air-datepicker--content",this.$datepicker),this.$pointer=l(".air-datepicker--pointer",this.$datepicker),this.$nav=l(".air-datepicker--navigation",this.$datepicker)}_handleLocale(){let{locale:o,dateFormat:m,firstDay:d,timepicker:v,onlyTimepicker:r,timeFormat:t,dateTimeSeparator:h}=this.opts;var g;this.locale=(g=o,JSON.parse(JSON.stringify(g))),m&&(this.locale.dateFormat=m),t!==void 0&&t!==""&&(this.locale.timeFormat=t);let{timeFormat:C}=this.locale;if(d!==""&&(this.locale.firstDay=d),v&&typeof m!="function"){let k=C?h:"";this.locale.dateFormat=[this.locale.dateFormat,C||""].join(k)}r&&typeof m!="function"&&(this.locale.dateFormat=this.locale.timeFormat)}_setPositionClasses(o){if(typeof o=="function")return void this.$datepicker.classList.add("-custom-position-");let m=(o=o.split(" "))[0],d=`air-datepicker -${m}-${o[1]}- -from-${m}-`;this.$datepicker.classList.add(...d.split(" "))}_bindEvents(){this.$el.addEventListener(this.opts.showEvent,this._onFocus),this.$el.addEventListener("blur",this._onBlur),this.$datepicker.addEventListener("mousedown",this._onMouseDown),this.$datepicker.addEventListener("mouseup",this._onMouseUp),window.addEventListener("resize",this._onResize)}_limitViewDateByMaxMinDates(){let{viewDate:o,minDate:m,maxDate:d}=this;d&&R(o,d)&&this.setViewDate(d),m&&W(o,m)&&this.setViewDate(m)}formatDate(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.viewDate,m=arguments.length>1?arguments[1]:void 0;if(o=re(o),!(o instanceof Date))return;let d=m,v=this.locale,r=y(o),t=r.dayPeriod,h=F(o),g=ve.replacer,C={T:o.getTime(),m:r.minutes,mm:r.fullMinutes,h:r.hours12,hh:r.fullHours12,H:r.hours,HH:r.fullHours,aa:t,AA:t.toUpperCase(),E:v.daysShort[r.day],EEEE:v.days[r.day],d:r.date,dd:r.fullDate,M:r.month+1,MM:r.fullMonth,MMM:v.monthsShort[r.month],MMMM:v.months[r.month],yy:r.year.toString().slice(-2),yyyy:r.year,yyyy1:h[0],yyyy2:h[1]};for(let[k,T]of Object.entries(C))d=g(d,Te(k),T);return d}down(o){this._handleUpDownActions(o,"down")}up(o){this._handleUpDownActions(o,"up")}selectDate(o){let m,d=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},{currentView:v,parsedViewDate:r,selectedDates:t}=this,{updateTime:h,silent:g}=d,{moveToOtherMonthsOnSelect:C,moveToOtherYearsOnSelect:k,multipleDates:T,range:N,autoClose:K,onBeforeSelect:G}=this.opts,Y=t.length;if(Array.isArray(o))return o.forEach(ie=>{this.selectDate(ie,d)}),new Promise(ie=>{setTimeout(ie)});if((o=re(o))instanceof Date){if(G&&!g&&!G({date:o,datepicker:this}))return Promise.resolve();if(v===s.days&&o.getMonth()!==r.month&&C&&(m=new Date(o.getFullYear(),o.getMonth(),1)),v===s.years&&o.getFullYear()!==r.year&&k&&(m=new Date(o.getFullYear(),0,1)),m&&this.setViewDate(m),T&&!N){if(Y===T)return;this._checkIfDateIsSelected(o)||t.push(o)}else if(N)switch(Y){case 1:t.push(o),this.rangeDateTo||(this.rangeDateTo=o),R(this.rangeDateFrom,this.rangeDateTo)&&(this.rangeDateTo=this.rangeDateFrom,this.rangeDateFrom=o),this.selectedDates=[this.rangeDateFrom,this.rangeDateTo];break;case 2:this.selectedDates=[o],this.rangeDateFrom=o,this.rangeDateTo="";break;default:this.selectedDates=[o],this.rangeDateFrom=o}else this.selectedDates=[o];return this.trigger(s.eventChangeSelectedDate,{action:s.actionSelectDate,silent:d==null?void 0:d.silent,date:o,updateTime:h}),this._updateLastSelectedDate(o),K&&!this.timepickerIsActive&&this.visible&&(T||N?N&&Y===1&&this.hide():this.hide()),new Promise(ie=>{setTimeout(ie)})}}unselectDate(o){let m=this.selectedDates,d=this;if((o=re(o))instanceof Date)return m.some((v,r)=>{if(O(v,o))return m.splice(r,1),d.selectedDates.length?(d.rangeDateTo="",d.rangeDateFrom=m[0],d._updateLastSelectedDate(d.selectedDates[d.selectedDates.length-1])):(d.rangeDateFrom="",d.rangeDateTo="",d._updateLastSelectedDate(!1)),this.trigger(s.eventChangeSelectedDate,{action:s.actionUnselectDate,date:o}),!0})}replaceDate(o,m){let d=this.selectedDates.find(r=>O(r,o,this.currentView)),v=this.selectedDates.indexOf(d);v<0||O(this.selectedDates[v],m,this.currentView)||(this.selectedDates[v]=m,this.trigger(s.eventChangeSelectedDate,{action:s.actionSelectDate,date:m,updateTime:!0}),this._updateLastSelectedDate(m))}clear(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};return this.selectedDates=[],this.rangeDateFrom=!1,this.rangeDateTo=!1,this.lastSelectedDate=!1,this.trigger(s.eventChangeSelectedDate,{action:s.actionUnselectDate,silent:o.silent}),new Promise(m=>{setTimeout(m)}
18)}show(){let{onShow:o,isMobile:m}=this.opts;this._cancelScheduledCall(),this.visible||this.hideAnimation||this._createComponents(),this.setPosition(this.opts.position),this.$datepicker.classList.add("-active-"),this.visible=!0,o&&this._scheduleCallAfterTransition(o),m&&this._showMobileOverlay()}hide(){let{onHide:o,isMobile:m}=this.opts,d=this._hasTransition();this.visible=!1,this.hideAnimation=!0,this.$datepicker.classList.remove("-active-"),this.customHide&&this.customHide(),this.elIsInput&&this.$el.blur(),this._scheduleCallAfterTransition(v=>{!this.customHide&&(v&&d||!v&&!d)&&this._finishHide(),o&&o(v)}),m&&we.classList.remove("-active-")}_triggerOnSelect(){let o=[],m=[],{selectedDates:d,locale:v,opts:{onSelect:r,multipleDates:t,range:h}}=this,g=t||h,C=typeof v.dateFormat=="function";d.length&&(o=d.map(z),m=C?t?v.dateFormat(o):o.map(k=>v.dateFormat(k)):o.map(k=>this.formatDate(k,v.dateFormat))),r({date:g?o:o[0],formattedDate:g?m:m[0],datepicker:this})}_handleAlreadySelectedDates(o,m){let{selectedDates:d,rangeDateFrom:v,rangeDateTo:r}=this,{range:t,toggleSelected:h}=this.opts,g=d.length,C=typeof h=="function"?h({datepicker:this,date:m}):h,k=Boolean(t&&g===1&&o),T=k?z(m):m;t&&!C&&(g!==2&&this.selectDate(T),g===2&&O(v,r))||(C?this.unselectDate(T):this._updateLastSelectedDate(k?T:o))}_handleUpDownActions(o,m){if(!((o=re(o||this.focusDate||this.viewDate))instanceof Date))return;let d=m==="up"?this.viewIndex+1:this.viewIndex-1;d>2&&(d=2),d<0&&(d=0),this.setViewDate(new Date(o.getFullYear(),o.getMonth(),1)),this.setCurrentView(this.viewIndexes[d])}getCell(o){let m=arguments.length>1&&arguments[1]!==void 0?arguments[1]:s.day;if(!((o=re(o))instanceof Date))return;let{year:d,month:v,date:r}=y(o),t=`[data-year="${d}"]`,h=`[data-month="${v}"]`,g={[s.day]:`${t}${h}[data-date="${r}"]`,[s.month]:`${t}${h}`,[s.year]:`${t}`};return this.views[this.currentView]?this.views[this.currentView].$el.querySelector(g[m]):void 0}_showMobileOverlay(){we.classList.add("-active-")}_hasTransition(){return window.getComputedStyle(this.$datepicker).getPropertyValue("transition-duration").split(", ").reduce((o,m)=>parseFloat(m)+o,0)>0}get shouldUpdateDOM(){return this.visible||this.treatAsInline}get parsedViewDate(){return y(this.viewDate)}get currentViewSingular(){return this.currentView.slice(0,-1)}get curDecade(){return F(this.viewDate)}get viewIndex(){return this.viewIndexes.indexOf(this.currentView)}get isFinalView(){return this.currentView===s.years}get hasSelectedDates(){return this.selectedDates.length>0}get isMinViewReached(){return this.currentView===this.opts.minView||this.currentView===s.days}get $container(){return this.$customContainer||ue}static replacer(o,m,d){return o.replace(m,function(v,r,t,h){return r+d+h})}}var Ee;return U(ve,"defaults",c),U(ve,"version","3.6.0"),U(ve,"defaultGlobalContainerId","air-datepicker-global-container"),Ee=ve.prototype,Object.assign(Ee,qe),a.default}()})})(Ri);const Fs=Ri.exports,Oi={template:` 19 <div class="custom-date-picker-wrapper" ref="datepicker"></div> 20 `,props:{date:null,emitInitial:{type:Boolean,default:!0}},data(){return{fittyInstances:[],storage:null,currentDate:null}},mounted(){this.initDatePicker()},beforeUnmount(){var e;this._customClickHandler&&((e=this.$refs.datepicker)==null||e.removeEventListener("click",this._customClickHandler,{capture:!0})),this.airDatepicker&&(this.airDatepicker.destroy(),this.airDatepicker=null)},methods:{async initDatePicker(){const e={fi:{days:["Sunnuntai","Maanantai","Tiistai","Keskiviikko","Torstai","Perjantai","Lauantai"],daysShort:["Su","Ma","Ti","Ke","To","Pe","La"],daysMin:["Su","Ma","Ti","Ke","To","Pe","La"],months:["Tammikuu","Helmikuu","Maaliskuu","Huhtikuu","Toukokuu","Kes\xE4kuu","Hein\xE4kuu","Elokuu","Syyskuu","Lokakuu","Marraskuu","Joulukuu"],monthsShort:["Tammi","Helmi","Maalis","Huhti","Touko","Kes\xE4","Hein\xE4","Elo","Syys","Loka","Marras","Joulu"],today:"T\xE4n\xE4\xE4n",clear:"Tyhjenn\xE4",dateFormat:"dd.MM.yyyy",timeFormat:"HH:mm",firstDay:1},en:{days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],daysShort:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],daysMin:["Su","Mo","Tu","We","Th","Fr","Sa"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],today:"Today",clear:"Clear",dateFormat:"MM/dd/yyyy",timeFormat:"hh:mm aa",firstDay:0},sv:{days:["S\xF6ndag","M\xE5ndag","Tisdag","Onsdag","Torsdag","Fredag","L\xF6rdag"],daysShort:["S\xF6n","M\xE5n","Tis","Ons","Tor","Fre","L\xF6r"],daysMin:["S\xF6","M\xE5","Ti","On","To","Fr","L\xF6"],months:["Januari","Februari","Mars","April","Maj","Juni","Juli","Augusti","September","Oktober","November","December"],monthsShort:["Jan","Feb","Mar","Apr","Maj","Jun","Jul","Aug","Sep","Okt","Nov","Dec"],today:"I dag",clear:"Nollst\xE4ll",dateFormat:"yyyy-MM-dd",timeFormat:"HH:mm",firstDay:1}};if(this.emitInitial){this.storage=this.$storage("map-route-date-time-filter",{session:!0});const n=this.storage.get("date"),a=n&&Ni(ke(n))?ke(n):null;this.currentDate=a||new Date,this.$emit("update:date",this.currentDate),await this.$nextTick()}else this.currentDate=this.date||new Date;const i=this.airDatepicker=new Fs(this.$refs.datepicker,{isMobile:!1,autoClose:!0,maxDate:new Date,locale:e[this.$language],startDate:this.currentDate,selectedDates:this.currentDate,toggleSelected:!1,multipleDates:!1,onSelect:n=>{this.currentDate=n.date,this.$emit("update:date",n.date),this.storage&&this.storage.update({date:st(n.date)})},buttons:[{className:"secondary",content:n=>n.locale.today||"Today",onClick:n=>{const a=new Date;n.selectDate(a),this.emitIfUnchanged(a)}}]});this.emitInitial&&i.selectDate(this.currentDate),this._customClickHandler=n=>{const a=n.target.closest(".air-datepicker-cell.-day-");if(!a||a.classList.contains("-disabled-"))return;const{year:s,month:c,date:l}=a.dataset;s===void 0||c===void 0||l===void 0||this.emitIfUnchanged(new Date(Number(s),Number(c),Number(l)))},this.$refs.datepicker.addEventListener("click",this._customClickHandler,{capture:!0})},emitIfUnchanged(e){this.currentDate&&ri(e,this.currentDate)&&(this.currentDate=e,this.$emit("update:date",e))}}};(function(){function e(n,a){try{const s=JSON.parse(n.dataset.nodeData);return s[a]||s.name||""}catch(s){return console.error("Quercus.js: Error parsing node data for display name:",s),"Unnamed Node"}}class i{constructor(a){this.options={containerId:null,data:[],searchEnabled:!1,searchPlaceholder:"Search tree...",initiallyExpanded:!1,multiSelectEnabled:!1,onSelectionChange:null,onRenderNode:null,showSelectAllButton:!1,showInvertSelectionButton:!1,showExpandCollapseAllButtons:!1,nodeSelectionEnabled:!0,cascadeSelectChildren:!1,checkboxSelectionEnabled:!1,nodeNameKey:"name"},Object.assign(this.options,a),this.treeviewContainer=null,this.treeSearchInput=null,this.selectedNodes=new Set,this.selectAllButton=null,this.invertSelectionButton=null,this.expandAllButton=null,this.collapseAllButton=null,this._initialExpansionStates=new Map,this._initialize()}_initialize(){if(!this.options.containerId){console.error("Quercus.js: containerId is required.");return}if(this.treeviewContainer=document.getElementById(this.options.containerId),!this.treeviewContainer){console.error(`Quercus.js: Element with ID '${this.options.containerId}' not found.`);return}if(this.treeviewContainer.classList.add("custom-treeview-wrapper"),this._createControls(),this._renderTree(this.options.data,this.treeviewContainer),this.options.initiallyExpanded?this.treeviewContainer.querySelectorAll("li.has-children").forEach(a=>{a.classList.add("expanded");const s=a.querySelector(".treeview-expander");s&&(s.textContent="-");const c=a.querySelector("ul");c&&(c.style.height="auto")}):this.treeviewContainer.querySelectorAll("li.has-children").forEach(a=>{a.classList.remove("expanded");const s=a.querySelector(".treeview-expander");s&&(s.textContent="+");const c=a.querySelector("ul");c&&(c.style.height="")}
20),this.options.nodeSelectionEnabled){const a=[],s=c=>{c.forEach(l=>{l.selected&&(l.selectable===void 0||l.selectable===!0)&&a.push(l.id),l.children&&s(l.children)})};s(this.options.data),a.forEach(c=>{const l=this.treeviewContainer.querySelector(`[data-id="${c}"]`);l&&this._selectNode(l,!0)})}}_getAllDescendants(a){const s=[],c=[a];let l=0;for(;l<c.length;){const f=c[l++].querySelector("ul");f&&Array.from(f.children).forEach(w=>{s.push(w),c.push(w)})}return s}_createControls(){if(this.options.searchEnabled){const s=document.createElement("div");s.classList.add("treeview-search-input-wrapper"),this.treeviewContainer.appendChild(s),this.treeSearchInput=document.createElement("input"),this.treeSearchInput.type="text",this.treeSearchInput.id=`treeSearch-${this.options.containerId}`,this.treeSearchInput.placeholder=this.options.searchPlaceholder,this.treeSearchInput.classList.add("treeview-search-input"),s.appendChild(this.treeSearchInput);const c=document.createElement("span");c.classList.add("treeview-search-clear"),c.textContent="\u2715",s.appendChild(c),this.treeSearchInput.addEventListener("input",l=>{this._searchTree(l.target.value),l.target.value.length>0?c.style.display="block":c.style.display="none"}),c.addEventListener("click",()=>{this.treeSearchInput.value="",this._searchTree(""),c.style.display="none"}),this.treeSearchInput.value.length===0&&(c.style.display="none")}const a=document.createElement("div");a.classList.add("treeview-button-container"),this.options.showSelectAllButton&&this.options.multiSelectEnabled&&this.options.nodeSelectionEnabled&&!this.options.cascadeSelectChildren&&(this.selectAllButton=document.createElement("button"),this.selectAllButton.classList.add("treeview-control-button","treeview-select-all"),this.selectAllButton.textContent="Select All",a.appendChild(this.selectAllButton),this.selectAllButton.addEventListener("click",()=>this._toggleSelectAll())),this.options.showInvertSelectionButton&&this.options.multiSelectEnabled&&this.options.nodeSelectionEnabled&&!this.options.cascadeSelectChildren&&(this.invertSelectionButton=document.createElement("button"),this.invertSelectionButton.classList.add("treeview-control-button","treeview-invert-selection"),this.invertSelectionButton.textContent="Invert Selection",a.appendChild(this.invertSelectionButton),this.invertSelectionButton.addEventListener("click",()=>this.invertSelection())),this.options.showExpandCollapseAllButtons&&(this.expandAllButton=document.createElement("button"),this.expandAllButton.classList.add("treeview-control-button","treeview-expand-all"),this.expandAllButton.textContent="Expand All",a.appendChild(this.expandAllButton),this.expandAllButton.addEventListener("click",()=>
20this._expandAll()),this.collapseAllButton=document.createElement("button"),this.collapseAllButton.classList.add("treeview-control-button","treeview-collapse-all"),this.collapseAllButton.textContent="Collapse All",a.appendChild(this.collapseAllButton),this.collapseAllButton.addEventListener("click",()=>this._collapseAll())),a.children.length>0&&this.treeviewContainer.appendChild(a)}_toggleSelectAll(){if(!this.options.nodeSelectionEnabled){console.warn("Quercus.js: Node selection is disabled, cannot select/deselect all nodes.");return}if(!this.options.multiSelectEnabled){console.warn("Quercus.js: Select All/Deselect All requires multi-select to be enabled.");return}if(this.options.cascadeSelectChildren){console.warn("Quercus.js: Select All/Deselect All is not applicable when cascading selection is enabled.");return}const a=Array.from(this.treeviewContainer.querySelectorAll("li")).filter(l=>{try{const u=JSON.parse(l.dataset.nodeData);return u.selectable===void 0||u.selectable===!0}catch(u){return console.error("Quercus.js: Error parsing node data for selectable check:",u),!0}}),s=this.selectedNodes.size,c=s===0||s<a.length;a.forEach(l=>{const u=l.querySelector(".treeview-checkbox");c?this.selectedNodes.has(l)||(this.selectedNodes.add(l),l.classList.add("selected"),u&&(u.checked=!0)):this.selectedNodes.has(l)&&(this.selectedNodes.delete(l),l.classList.remove("selected"),u&&(u.checked=!1))}),this.selectAllButton&&(this.selectAllButton.textContent=c?"Deselect All":"Select All"),this._triggerSelectionChange()}_expandAll(){this.treeviewContainer.querySelectorAll("li.has-children").forEach(s=>{if(!s.classList.contains("expanded")){s.classList.add("expanded");const c=s.querySelector(".treeview-expander");c&&(c.textContent="-");const l=s.querySelector("ul");l&&(l.style.height="0px",requestAnimationFrame(()=>{l.style.height=`${l.scrollHeight}px`}),l.addEventListener("transitionend",function u(){l.removeEventListener("transitionend",u),l.style.height="auto"},{once:!0}))}})}_collapseAll(){const a=this.treeviewContainer.querySelectorAll("li.has-children");for(let s=a.length-1;s>=0;s--){const c=a[s];if(c.classList.contains("expanded")){c.classList.remove("expanded");const l=c.querySelector(".treeview-expander");l&&(l.textContent="+");const u=c.querySelector("ul");u&&(u.style.height=`${u.scrollHeight}px`,requestAnimationFrame(()=>{u.style.height="0px"}),u.addEventListener("transitionend",function f(){u.removeEventListener("transitionend",f),u.style.height=""},{once:!0}))}}}_renderTree(a,s){const c=document.createElement("ul");s.appendChild(c),a.forEach(l=>{const u=document.createElement("li");u.dataset.id=l.id,u.dataset.nodeData=JSON.stringify(l);const f=document.createElement("div");f.classList.add("treeview-node-content");const w=l.selectable===void 0||l.selectable===!0;if(w||f.classList.add("not-selectable"),typeof this.options.onRenderNode=="function")try{this.options.onRenderNode(l,f)}catch(M){console.error("Quercus.js: Error in custom node renderer:",M);const E=document.createElement("span");E.classList.add("treeview-node-text"),E.textContent=l[this.options.nodeNameKey]||l.name,f.appendChild(E)}else{const M=document.createElement("span");M.classList.add("treeview-node-text"),M.textContent=l[this.options.nodeNameKey]||l.name,f.appendChild(M)}let y;if(l.children&&l.children.length>0?(u.classList.add("has-children"),y=document.createElement("span"),y.classList.add("treeview-expander"),y.textContent=this.options.initiallyExpanded?"-":"+"):(y=document.createElement("span"),y.classList.add("treeview-expander-placeholder")),f.prepend(y),this.options.checkboxSelectionEnabled){const M=document.createElement("input");M.type="checkbox",M.classList.add("treeview-checkbox"),M.id=`checkbox-${l.id}`,M.disabled=!w,this.selectedNodes.has(u)&&(M.checked=!0),M.addEventListener("change",E=>{this._selectNode(u,E.target.checked)}),f.insertBefore(M,y.nextSibling)}u.appendChild(f),l.children&&l.children.length>0&&(this._renderTree(l.children,u),y.addEventListener("click",M=>{const E=u.querySelector("ul");E&&(u.classList.contains("expanded")?(u.classList.remove("expanded"),y.textContent="+",E.style.height=`${E.scrollHeight}px`,requestAnimationFrame(()=>{E.style.height="0px"}
20),E.addEventListener("transitionend",function F(){E.removeEventListener("transitionend",F),E.style.height=""},{once:!0})):(u.classList.add("expanded"),y.textContent="-",E.style.height="0px",requestAnimationFrame(()=>{E.style.height=`${E.scrollHeight}px`}),E.addEventListener("transitionend",function F(){E.removeEventListener("transitionend",F),E.style.height="auto"},{once:!0}))),M.stopPropagation()})),this.options.nodeSelectionEnabled&&!this.options.checkboxSelectionEnabled&&w?f.addEventListener("click",M=>{M.target.classList.contains("treeview-expander")||this._selectNode(u,!u.classList.contains("selected")),M.stopPropagation()}):(!this.options.nodeSelectionEnabled||!w)&&(f.style.cursor="default"),c.appendChild(u)})}_selectNode(a,s=null){if(!this.options.nodeSelectionEnabled){console.warn("Quercus.js: Attempted to select a node while selection is disabled.");return}let c;try{c=JSON.parse(a.dataset.nodeData)}catch(u){console.error("Quercus.js: Error parsing node data for selection check:",u);return}if(c.selectable===!1){console.warn(`Quercus.js: Node '${c[this.options.nodeNameKey]||c.name}' (ID: ${c.id}) is not selectable.`);return}const l=a.querySelector(".treeview-checkbox");if(s===null&&(s=!this.selectedNodes.has(a),l&&(s=l.checked)),this.options.cascadeSelectChildren)if(s)if(this.options.multiSelectEnabled){const u=this._getAllDescendants(a);[a,...u].forEach(f=>{let w;try{w=JSON.parse(f.dataset.nodeData)}catch(y){console.error("Quercus.js: Error parsing descendant node data for selection:",y);return}if(w.selectable===void 0||w.selectable===!0){this.selectedNodes.add(f),f.classList.add("selected");const y=f.querySelector(".treeview-checkbox");y&&(y.checked=!0)}})}else this.selectedNodes.forEach(f=>f.classList.remove("selected")),this.selectedNodes.clear(),this.options.checkboxSelectionEnabled&&this.treeviewContainer.querySelectorAll(".treeview-checkbox").forEach(f=>f.checked=!1),this.selectedNodes.add(a),a.classList.add("selected"),l&&(l.checked=!0),this._getAllDescendants(a).forEach(f=>{let w;try{w=JSON.parse(f.dataset.nodeData)}catch(y){console.error("Quercus.js: Error parsing descendant node data for selection:",y);return}if(w.selectable===void 0||w.selectable===!0){this.selectedNodes.add(f),f.classList.add("selected");const y=f.querySelector(".treeview-checkbox");y&&(y.checked=!0)}});else{const u=this._getAllDescendants(a);[a,...u].forEach(f=>{this.selectedNodes.delete(f),f.classList.remove("selected");const w=f.querySelector(".treeview-checkbox");w&&(w.checked=!1)})}else if(this.options.multiSelectEnabled)s?(this.selectedNodes.add(a),a.classList.add("selected"),l&&(l.checked=!0)):(this.selectedNodes.delete(a),a.classList.remove("selected"),l&&(l.checked=!1));else{const u=this.selectedNodes.has(a)&&this.selectedNodes.size===1;this.selectedNodes.forEach(f=>f.classList.remove("selected")),this.selectedNodes.clear(),this.options.checkboxSelectionEnabled&&this.treeviewContainer.querySelectorAll(".treeview-checkbox").forEach(f=>f.checked=!1),s&&!u&&(this.selectedNodes.add(a),a.classList.add("selected"),l&&(l.checked=!0))}this._triggerSelectionChange()}_triggerSelectionChange(){if(typeof this.options.onSelectionChange=="function"){const a=Array.from(this.selectedNodes).map(s=>{try{return JSON.parse(s.dataset.nodeData)}catch(c){return console.error("Quercus.js: Error parsing selected node data:",c),{id:s.dataset.id,name:e(s,this.options.nodeNameKey)}}});this.options.onSelectionChange(a)}if(this.selectAllButton&&this.options.multiSelectEnabled&&this.options.nodeSelectionEnabled&&!this.options.cascadeSelectChildren){const a=Array.from(this.treeviewContainer.querySelectorAll("li")).filter(c=>{try{const l=JSON.parse(c.dataset.nodeData);return l.selectable===void 0||l.selectable===!0}catch{return!1}}),s=a.length>0&&this.selectedNodes.size===a.length;this.selectAllButton.textContent=s?"Deselect All":"Select All"}}_searchTree(a){const s=this.treeviewContainer.querySelectorAll("li"),c=this.treeviewContainer.querySelectorAll("li.has-children");if(a===""){s.forEach(f=>{f.classList.remove("hidden","highlight")}),c.forEach(f=>{const w=f.dataset.id,y=f.querySelector(".treeview-expander"),M=f.querySelector("ul");this._initialExpansionStates.has(w)?this._initialExpansionStates.get(w)?(f.classList.add("expanded"),y&&(y.textContent="-"),M&&(M.style.height="auto")):f.classList.contains("expanded")?(f.classList.remove("expanded"),y&&(y.textContent="+"),M&&(M.style.height=`${M.scrollHeight}px`,requestAnimationFrame(()=>{M.style.height="0px"}),M.addEventListener("transitionend",function F(){M.removeEventListener("transitionend",F),M.style.height=""},{once:!0}))):M&&(M.style.height=""):this.options.initiallyExpanded?(f.classList.add("expanded"),y&&(y.textContent="-"),M&&(M.style.height="auto")):(f.classList.remove("expanded"),y&&(y.textContent="+"),M&&(M.style.height=""))}),this._initialExpansionStates.clear();return}
20this._initialExpansionStates.size===0&&c.forEach(f=>{const w=f.dataset.id;this._initialExpansionStates.set(w,f.classList.contains("expanded"))});const l=new Set,u=new Set;s.forEach(f=>{f.classList.remove("highlight"),f.classList.add("hidden");const w=f.querySelector("ul"),y=f.querySelector(".treeview-expander");w&&(w.style.height="0px",f.classList.remove("expanded"),y&&(y.textContent="+"))}),s.forEach(f=>{const w=JSON.parse(f.dataset.nodeData);if((w[this.options.nodeNameKey]||w.name||"").toLowerCase().includes(a.toLowerCase())){l.add(f),f.classList.add("highlight");let M=f.closest("ul");for(;M&&M!==this.treeviewContainer;){const E=M.closest("li");E&&u.add(E),M=M.parentElement.closest("ul")}}}),l.forEach(f=>{f.classList.remove("hidden");let w=f;for(;w.parentElement&&w.parentElement.tagName==="UL";)w.parentElement.classList.remove("hidden-by-parent"),w=w.parentElement}),u.forEach(f=>{f.classList.remove("hidden"),f.classList.add("expanded");const w=f.querySelector("ul"),y=f.querySelector(".treeview-expander");w&&(w.style.height="auto"),y&&(y.textContent="-")})}setData(a){if(this.options.data=a,this.treeviewContainer.innerHTML="",this.selectedNodes.clear(),this._initialExpansionStates.clear(),this._createControls(),this._renderTree(this.options.data,this.treeviewContainer),this.options.initiallyExpanded?this.treeviewContainer.querySelectorAll("li.has-children").forEach(s=>{s.classList.add("expanded");const c=s.querySelector(".treeview-expander");c&&(c.textContent="-");const l=s.querySelector("ul");l&&(l.style.height="auto")}):this.treeviewContainer.querySelectorAll("li.has-children").forEach(s=>{s.classList.remove("expanded");const c=s.querySelector(".treeview-expander");c&&(c.textContent="+");const l=s.querySelector("ul");l&&(l.style.height="")}),this.options.nodeSelectionEnabled){const s=[],c=l=>{l.forEach(u=>{u.selected&&(u.selectable===void 0||u.selectable===!0)&&s.push(u.id),u.children&&c(u.children)})};c(this.options.data),s.forEach(l=>{const u=this.treeviewContainer.querySelector(`[data-id="${l}"]`);u&&this._selectNode(u,!0)})}}selectNodeById(a,s=!0){if(!this.options.nodeSelectionEnabled){console.warn(`Quercus.js: Cannot programmatically select node '${a}'. Node selection is disabled.`);return}const c=this.treeviewContainer.querySelector(`[data-id="${a}"]`);if(c){let l;try{l=JSON.parse(c.dataset.nodeData)}catch(u){console.error("Quercus.js: Error parsing node data for programmatic selection check:",u);return}if(l.selectable===!1&&s){console.warn(`Quercus.js: Node '${l[this.options.nodeNameKey]||l.name}' (ID: ${l.id}) is not selectable; cannot select programmatically.`);return}this._selectNode(c,s)}else console.warn(`Quercus.js: Node with ID '${a}' not found for programmatic selection.`)}getSelectedNode(){return this.getSelectedNodes()}getSelectedNodes(){return Array.from(this.selectedNodes).map(s=>{try{return JSON.parse(s.dataset.nodeData)}catch(c){return console.error("Quercus.js: Error parsing selected node data:",c),{id:s.dataset.id,name:e(s,this.options.nodeNameKey)}}})}search(a){this.options.searchEnabled&&this.treeSearchInput&&(this.treeSearchInput.value=a),this._searchTree(a)}getSelectedNodesAndChildrenValues(a){const s=[],c=new Set,l=u=>{if(!u||c.has(u))return;c.add(u);try{const w=JSON.parse(u.dataset.nodeData);w&&Object.prototype.hasOwnProperty.call(w,a)&&s.push(w[a])}catch(w){console.error("Quercus.js: Error parsing node data for value collection:",w)}const f=u.querySelector("ul");f&&Array.from(f.children).forEach(w=>{l(w)})};return this.selectedNodes.forEach(u=>{l(u)}),s}invertSelection(){if(!this.options.nodeSelectionEnabled){console.warn("Quercus.js: Node selection is disabled, cannot invert selection.");return}if(!this.options.multiSelectEnabled){console.warn("Quercus.js: Invert Selection requires multi-select to be enabled.");return}if(this.options.cascadeSelectChildren){console.warn("Quercus.js: Invert Selection is not applicable when cascading selection is enabled.");return}const a=Array.from(this.treeviewContainer.querySelectorAll("li")).filter(l=>{try{const u=JSON.parse(l.dataset.nodeData);return u.selectable===void 0||u.selectable===!0}catch(u){return console.error("Quercus.js: Error parsing node data for selectable check during invert:",u),!1}}),s=[],c=[];
20if(a.forEach(l=>{this.selectedNodes.has(l)?c.push(l):s.push(l)}),c.forEach(l=>{this.selectedNodes.delete(l),l.classList.remove("selected");const u=l.querySelector(".treeview-checkbox");u&&(u.checked=!1)}),s.forEach(l=>{this.selectedNodes.add(l),l.classList.add("selected");const u=l.querySelector(".treeview-checkbox");u&&(u.checked=!0)}),this.selectAllButton&&this.options.multiSelectEnabled&&this.options.nodeSelectionEnabled&&!this.options.cascadeSelectChildren){const l=a.length>0&&this.selectedNodes.size===a.length;this.selectAllButton.textContent=l?"Deselect All":"Select All"}this._triggerSelectionChange()}}window.Treeview=i})();const $s={template:` 21 <div id="map-router-date-time-filtering-treeview"></div> 22 `,props:["selectedItems"],data(){return{nameDelimiter:" || ",quercus:null}},mounted(){this.init()},beforeUnmount(){this.$emit("update:selectedItems",[]),this.quercus=null},methods:{init(){const e=p.get(this.$devicesList,"values")||[],i=this.renameKeys(e,{keyMap:{description:"name",values:"children"},callback:n=>{p.get(n,"children.length")&&p.set(n,"selectable",!1),p.set(n,"selected",!1),p.set(n,"description",n.name),p.set(n,"name",n.name+this.nameDelimiter+n.id)}});this.quercus=new Treeview({containerId:"map-router-date-time-filtering-treeview",data:i,searchEnabled:!0,initiallyExpanded:!1,multiSelectEnabled:!0,searchPlaceholder:this.$translate("search"),onSelectionChange:n=>{this.$emit("update:selectedItems",n)},onRenderNode:(n,a)=>{const s=document.createElement("span");s.classList.add("treeview-node-text","custom-node-name");const c=p.split(n.name,this.nameDelimiter),l=p.first(c),u=p.last(c),f=document.createElement("span");f.classList.add("name"),f.textContent=l||"",s.appendChild(f);const w=document.createElement("span");w.classList.add("id"),w.textContent=u?`(${u})`:"",s.appendChild(w),a.appendChild(s)}})},renameKeys(e,i={}){const n=i.keyMap||{},a=i.childKey||"values";return p.map(e,s=>{const c={};return p.each(s,(l,u)=>{const f=n[u]||u;u===a&&p.isArray(l)?c[f]=this.renameKeys(l,i):c[f]=l,p.invoke(i,"callback",c)}),c})},deselectAll(){!this.quercus||p.each(this.quercus.getSelectedNodes(),e=>this.quercus.selectNodeById(e.id,!1))}}};var ai={},Ae={};Object.defineProperty(Ae,"__esModule",{value:!0});Ae.degToRad=Ps;Ae.radToDeg=Ns;Ae.knotsToMeterPerSecond=_s;Ae.meterPerSecondToKnots=As;Ae.knotsToKmPerHour=Rs;Ae.kmPerHourToKnots=Os;function Ps(e){return e*Math.PI/180}function Ns(e){return e*180/Math.PI}function _s(e){return e*.514444}function As(e){return e/.514444}function Rs(e){return e*1.852}function Os(e){return e/1.852}var ee={},Hs=function(e,i){for(var n=e[0],a=e[1],s=!1,c=0,l=i.length-1;c<i.length;l=c++){var u=i[c][0],f=i[c][1],w=i[l][0],y=i[l][1],M=f>a!=y>a&&n<(w-u)*(a-f)/(y-f)+u;M&&(s=!s)}return s};
22Object.defineProperty(ee,"__esModule",{value:!0});ee.EARTH_RADIUS=void 0;ee.isEqual=Us;ee.isLatLon=Be;ee.isLatLng=ze;ee.isLatitudeLongitude=Ue;ee.isLonLatTuple=je;ee.getLocationType=Nt;ee.createLocation=Dt;ee.toLatLon=js;ee.toLatLng=qs;ee.toLatitudeLongitude=Ks;ee.toLonLatTuple=Wt;ee.getLongitude=Ce;ee.getLatitude=Ie;ee.moveTo=Gt;ee.headingDistanceTo=oi;ee.headingTo=Js;ee.distanceTo=Hi;ee.insideBoundingBox=Ys;ee.insidePolygon=Qs;ee.insideCircle=Ws;ee.normalizeHeading=Gs;ee.normalizeLatitude=mt;ee.normalizeLongitude=ft;ee.normalizeLocation=Zs;ee.average=Xs;ee.getBoundingBox=en;var Vs=Hs,Bs=zs(Vs),_e=Ae;function zs(e){return e&&e.__esModule?e:{default:e}}function Lt(e){if(Array.isArray(e)){for(var i=0,n=Array(e.length);i<e.length;i++)n[i]=e[i];return n}else return Array.from(e)}var Qt=ee.EARTH_RADIUS=6378137;function Us(e,i){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0;return e&&i?Math.abs(Ie(e)-Ie(i))<=n&&Math.abs(Ce(e)-Ce(i))<=n:!1}function Be(e){return!!e&&typeof e.lat=="number"&&typeof e.lon=="number"}function ze(e){return!!e&&typeof e.lat=="number"&&typeof e.lng=="number"}function Ue(e){return!!e&&typeof e.latitude=="number"&&typeof e.longitude=="number"}function je(e){return Array.isArray(e)&&typeof e[0]=="number"&&typeof e[1]=="number"}function Nt(e){if(je(e))return"LonLatTuple";if(Be(e))return"LatLon";if(ze(e))return"LatLng";if(Ue(e))return"LatitudeLongitude";throw new Error("Unknown location format "+JSON.stringify(e))}function Dt(e,i,n){if(n==="LonLatTuple")return[i,e];if(n==="LatLon")return{lat:e,lon:i};if(n==="LatLng")return{lat:e,lng:i};if(n==="LatitudeLongitude")return{latitude:e,longitude:i};throw new Error("Unknown location format "+JSON.stringify(location))}function js(e){if(je(e))return{lat:e[1],lon:e[0]};if(Be(e))return{lat:e.lat,lon:e.lon};if(ze(e))return{lat:e.lat,lon:e.lng};if(Ue(e))return{lat:e.latitude,lon:e.longitude};throw new Error("Unknown location format "+JSON.stringify(e))}function qs(e){if(je(e))return{lat:e[1],lng:e[0]};if(Be(e))return{lat:e.lat,lng:e.lon};if(ze(e))return{lat:e.lat,lng:e.lng};if(Ue(e))return{lat:e.latitude,lng:e.longitude};throw new Error("Unknown location format "+JSON.stringify(e))}function Ks(e){if(je(e))return{latitude:e[1],longitude:e[0]};if(Be(e))return{latitude:e.lat,longitude:e.lon};if(ze(e))return{latitude:e.lat,longitude:e.lng};if(Ue(e))return{latitude:e.latitude,longitude:e.longitude};throw new Error("Unknown location format "+JSON.stringify(e))}function Wt(e){if(je(e))return[e[0],e[1]];if(Be(e))return[e.lon,e.lat];if(ze(e))return[e.lng,e.lat];if(Ue(e))return[e.longitude,e.latitude];throw new Error("Unknown location format "+JSON.stringify(e))}function Ce(e){if(je(e))return e[0];if(Be(e))return e.lon;if(ze(e))return e.lng;if(Ue(e))return e.longitude;throw new Error("Unknown location format "+JSON.stringify(e))}function Ie(e){if(je(e))return e[1];if(Be(e)||ze(e))return e.lat;if(Ue(e))return e.latitude;throw new Error("Unknown location format "+JSON.stringify(e))}function Gt(e,i){var n=Ie(e),a=Ce(e),s=i.heading,c=i.distance,l=c*Math.cos((0,_e.degToRad)(s))/Qt,u=c*Math.sin((0,_e.degToRad)(s))/(Qt*Math.cos((0,_e.degToRad)(n)));return Dt(n+(0,_e.radToDeg)(l),a+(0,_e.radToDeg)(u),Nt(e))}function oi(e,i){var n=Ie(e),a=Ce(e),s=Ie(i),c=Ce(i),l=(0,_e.degToRad)(n),u=(0,_e.degToRad)(s),f=(0,_e.degToRad)(s-n),w=(0,_e.degToRad)(c-a),y=Math.sin(f/2)*Math.sin(f/2)+Math.cos(l)*Math.cos(u)*Math.sin(w/2)*Math.sin(w/2),M=2*Math.atan2(Math.sqrt(y),Math.sqrt(1-y)),E=Qt*M,F=Math.sin(w)*Math.cos(u),$=Math.cos(l)*Math.sin(u)-Math.sin(l)*Math.cos(u)*Math.cos(w),O=(0,_e.radToDeg)(Math.atan2(F,$));return{distance:E,heading:O}}function Js(e,i){return oi(e,i).heading}function Hi(e,i){return oi(e,i).distance}function Ys(e,i){var n=Ie(e),a=Ce(e),s=Ce(i.topLeft),c=Ie(i.topLeft),l=Ce(i.bottomRight),u=Ie(i.bottomRight),f=Math.min(c,u),w=Math.max(c,u),y=Math.min(s,l),M=Math.max(s,l);return a>=y&&a<=M&&n>=f&&n<=w}function Qs(e,i){if(!i||!Array.isArray(i))throw new TypeError("Invalid polygon. Array with locations expected");if(i.length===0)throw new TypeError("Invalid polygon. Non-empty Array expected");return(0,Bs.default)(Wt(e),i.map(Wt))}function Ws(e,i,n){return Hi(i,e)<=n}function Gs(e){var i=e%360;return i<0&&(i+=360),i>=360&&(i-=360),i}function mt(e){return Math.asin(Math.sin(e/180*Math.PI))*(180/Math.PI)}function ft(e){var i=e%360;return i>180&&(i-=360),i<=-180&&(i+=360),i}function Zs(e){if(je(e))return[ft(e[0]),mt(e[1])];if(Be(e))return{lat:mt(e.lat),lon:ft(e.lon)};if(ze(e))return{lat:mt(e.lat),lng:ft(e.lng)};if(Ue(e))return{latitude:mt(e.latitude),longitude:ft(e.longitude)};throw new Error("Unknown location format "+JSON.stringify(e))}function Xs(e){if(!Array.isArray(e)||e.length===0)return null;var i=e[0],n=Si(e.map(Ie)),a=Si(e.map(Ce));return Dt(n,a,Nt(i))}function en(e){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;if(!Array.isArray(e)||e.length===0)return{topLeft:null,bottomRight:null};var n=Nt(e[0]),a=Math.max.apply(Math,Lt(e.map(Ie))),s=Math.min.apply(Math,Lt(e.map(Ce))),c=Math.min.apply(Math,Lt(e.map(Ie))),l=Math.max.apply(Math,Lt(e.map(Ce))),u=Dt(a,s,n),f=Dt(c,l,n);if(i===null||i===0)return{topLeft:u,bottomRight:f};var w=Math.SQRT2*i;return{topLeft:Gt(u,{heading:315,distance:w}),bottomRight:Gt(f,{heading:135,distance:w})}}function Si(e){return tn(e)/e.length}function tn(e){return e.reduce(function(i,n){return i+n},0)}var St={};
22Object.defineProperty(St,"__esModule",{value:!0});St.cpa=rn;St.cpaTime=li;St.cpaDistance=Vi;var sn=ee,ct=Ae,nn=1e-8;function rn(e,i){var n=(0,sn.headingDistanceTo)(e.location,i.location),a=n.distance,s=n.heading,c=a*Math.sin((0,ct.degToRad)(s)),l=a*Math.cos((0,ct.degToRad)(s)),u={position:{x:0,y:0},vector:{x:e.speed*Math.sin((0,ct.degToRad)(e.heading)),y:e.speed*Math.cos((0,ct.degToRad)(e.heading))}},f={position:{x:c,y:l},vector:{x:i.speed*Math.sin((0,ct.degToRad)(i.heading)),y:i.speed*Math.cos((0,ct.degToRad)(i.heading))}};return{time:li(u,f),distance:Vi(u,f)}}function li(e,i){var n=Xt(e.vector,i.vector),a=Zt(n,n);if(a<nn)return 0;var s=Xt(e.position,i.position);return-Zt(s,n)/a}function Vi(e,i){var n=li(e,i),a=Mi(e.position,xi(n,e.vector)),s=Mi(i.position,xi(n,i.vector));return an(a,s)}function Zt(e,i){return e.x*i.x+e.y*i.y}function Mi(e,i){return{x:e.x+i.x,y:e.y+i.y}}function xi(e,i){return{x:e*i.x,y:e*i.y}}function Xt(e,i){return{x:e.x-i.x,y:e.y-i.y}}function an(e,i){return on(Xt(e,i))}function on(e){return Math.sqrt(Zt(e,e))}(function(e){Object.defineProperty(e,"__esModule",{value:!0});var i=Ae;
22Object.keys(i).forEach(function(s){s==="default"||s==="__esModule"||Object.defineProperty(e,s,{enumerable:!0,get:function(){return i[s]}})});var n=ee;Object.keys(n).forEach(function(s){s==="default"||s==="__esModule"||Object.defineProperty(e,s,{enumerable:!0,get:function(){return n[s]}})});var a=St;Object.defineProperty(e,"cpa",{enumerable:!0,get:function(){return a.cpa}})})(ai);const Ft=[[-90,-180],[-90,180],[90,180],[90,-180]];function bt(e,i,n=64){const s=e.lat*Math.PI/180,c=e.lng*Math.PI/180,l=i/6371e3,u=[];for(let f=0;f<=n;f++){const w=f/n*2*Math.PI,y=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(w)),M=c+Math.atan2(Math.sin(w)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(y));u.push([y*180/Math.PI,M*180/Math.PI])}return u}function ln(e,i){const a=i.lat*Math.PI/180,s=(e[1]-i.lat)*Math.PI/180;return[(e[0]-i.lng)*Math.PI/180*6371e3*Math.cos(a),s*6371e3]}function cn(e){if(!e||e.length<2)return 0;let i=0;for(let n=1;n<e.length;n++){const a={lat:e[n-1][1],lon:e[n-1][0]},s={lat:e[n][1],lon:e[n][0]};i+=ai.distanceTo(a,s)}return i}function dn(e,i,n){const a=i[0]-e[0],s=i[1]-e[1],c=a*a+s*s;if(c===0)return[];const l=2*(e[0]*a+e[1]*s),u=e[0]*e[0]+e[1]*e[1]-n*n,f=l*l-4*c*u;if(f<=0)return[];const w=Math.sqrt(f),y=(-l-w)/(2*c),M=(-l+w)/(2*c);return[y,M].filter(E=>E>0&&E<1).sort((E,F)=>E-F)}function Et(e,i,n,a,s){const c=[e[0]+s*(i[0]-e[0]),e[1]+s*(i[1]-e[1])];let l;if(n&&a){const u=new Date(n).getTime(),f=new Date(a).getTime();l=new Date(u+s*(f-u)).toISOString()}else l=n||a;return{coordinate:c,timestamp:l}}function hn(e,i,n,a){if(!e||e.length<2)return[];const s=e.map(w=>ln(w,n)),c=w=>Math.sqrt(w[0]*w[0]+w[1]*w[1]),l=[];let u={coordinates:[],timestamps:[]};const f=()=>{u.coordinates.length>1&&l.push(u),u={coordinates:[],timestamps:[]}};c(s[0])<=a&&(u.coordinates.push(e[0]),u.timestamps.push(i?i[0]:void 0));for(let w=0;w<e.length-1;w++){const y=s[w],M=s[w+1],E=c(y)<=a,F=c(M)<=a,$=dn(y,M,a),O=e[w],R=e[w+1],W=i?i[w]:void 0,z=i?i[w+1]:void 0;if(E&&F)u.coordinates.push(R),u.timestamps.push(z);else if(E&&!F){if($.length){const{coordinate:V,timestamp:se}=Et(O,R,W,z,$[0]);u.coordinates.push(V),u.timestamps.push(se)}f()}else if(!E&&F){if($.length){const{coordinate:V,timestamp:se}=Et(O,R,W,z,$[0]);u.coordinates.push(V),u.timestamps.push(se)}u.coordinates.push(R),u.timestamps.push(z)}else if(!E&&!F&&$.length===2){const V=Et(O,R,W,z,$[0]),se=Et(O,R,W,z,$[1]);l.push({coordinates:[V.coordinate,se.coordinate],timestamps:[V.timestamp,se.timestamp]})}}return f(),l}const me={mask:"radius-filter-mask",boundary:"radius-filter-boundary",grabHandle:"radius-filter-grab-handle",moveHandle:"radius-filter-move-handle",moveGrip:"radius-filter-move-grip",resizeGrip:"radius-filter-resize-grip",sweep:"radius-filter-sweep"},ei=24;function un(e){return 1-Math.pow(1-e,3)}function pn(e){const i=e&&e.originalEvent&&e.originalEvent.target;return!!(i&&i.closest&&i.closest(".leaflet-marker-icon, .leaflet-interactive"))}let $t=!1;function mn(){const e=$t;return $t=!1,e}const ki=new WeakMap;function fn(e,i){let n=ki.get(i);return n||(n=e.svg({pane:"overlayPane"}),ki.set(i,n)),n}const Ci="radius-filter-mask-pane",Ii=new WeakMap;function gn(e,i){let n=Ii.get(i);if(!n){const a=i.createPane(Ci);a.style.zIndex=398,n=e.svg({pane:Ci,padding:5}),Ii.set(i,n)}return n}const Ti="radius-filter-move-handle-pane",Li=new WeakMap;function vn(e,i){let n=Li.get(i);if(!n){const a=i.createPane(Ti);a.style.zIndex=399,n=e.svg({pane:Ti}),Li.set(i,n)}return n}const Pt="radius-filter-move-grip-pane";function yn(e){let i=e.getPane(Pt);return i||(i=e.createPane(Pt),i.style.zIndex=650),i}const gt=165,vt=195;function Pe(e,i,n){const s=e.lat*Math.PI/180,c=e.lng*Math.PI/180,l=Math.max(i,.1)/6371e3,u=n*Math.PI/180,f=Math.asin(Math.sin(s)*Math.cos(l)+Math.cos(s)*Math.sin(l)*Math.cos(u)),w=c+Math.atan2(Math.sin(u)*Math.sin(l)*Math.cos(s),Math.cos(l)-Math.sin(s)*Math.sin(f));return{lat:f*180/Math.PI,lng:w*180/Math.PI}}function wn(e,i,n,a){const s=bt(n,Math.max(a,.1)),c=fn(e,i),l=e.polygon([Ft,s],{customId:me.mask,className:"radius-filter-mask",stroke:!1,fill:!0,fillColor:"#000",fillOpacity:.45,fillRule:"evenodd",interactive:!1,renderer:gn(e,i)}),u=e.circle(n,{customId:me.boundary,className:"radius-filter-boundary",radius:Math.max(a,.1),c
22olor:"#00e5ff",weight:2,dashArray:"6 8",fill:!1,interactive:!1}),f=e.circle(n,{customId:me.grabHandle,className:"radius-filter-grab-handle",radius:Math.max(a,.1),weight:ei,opacity:0,fill:!1,interactive:!0,bubblingMouseEvents:!1,renderer:c}),w=e.circle(n,{customId:me.moveHandle,className:"radius-filter-move-handle",radius:Math.max(a-ei/2,.1),stroke:!1,fill:!0,fillOpacity:0,interactive:!1,bubblingMouseEvents:!1,renderer:vn(e,i)}),y=e.marker(Pe(n,a,gt),{customId:me.moveGrip,interactive:!0,bubblingMouseEvents:!1,pane:Pt,icon:e.divIcon({className:"radius-filter-move-grip-icon",html:'<div class="radius-filter-move-grip"></div>',iconSize:[28,28],iconAnchor:[14,14]})}),M=e.marker(Pe(n,a,vt),{customId:me.resizeGrip,interactive:!0,bubblingMouseEvents:!1,pane:Pt,icon:e.divIcon({className:"radius-filter-resize-grip-icon",html:'<div class="radius-filter-resize-grip"></div>',iconSize:[28,28],iconAnchor:[14,14]})});yn(i);const E=ti?"radius-filter-sweep-icon radius-filter-sweep-active":"radius-filter-sweep-icon",F=e.marker(n,{customId:me.sweep,interactive:!1,pane:"overlayPane",icon:e.divIcon({className:E,html:'<div class="radius-filter-sweep"></div>',iconSize:[0,0],iconAnchor:[0,0]})});return{maskLayer:l,boundaryLayer:u,grabHandleLayer:f,moveHandleLayer:w,moveGripLayer:y,resizeGripLayer:M,sweepLayer:F}}function Dn(e,i,n,a,s,c,l,u,f,w,{onDrag:y,onDragEnd:M,onMove:E,onMoveEnd:F}={}){let $=e.latLng(w.lat,w.lng);const O=i.getContainer();let R=null,W=null,z=null,V=null,se=!1,le=null,te=!1;const re=()=>{const t=R||W;O.classList.toggle("radius-filter-resizing",t==="resize"),O.classList.toggle("radius-filter-moving",t==="move")};let Te=null;const Le=()=>{se=!1,Te=null,z!=null&&y&&y(z),V!=null&&E&&E(V)},nt=()=>{se||(se=!0,Te=requestAnimationFrame(Le))},fe=()=>{Te!=null&&cancelAnimationFrame(Te),Te=null,se=!1,z=null,V=null},rt=t=>{te=!0,t=Math.max(t,.1),a.setRadius(t),s.setRadius(t),l.setLatLng(Pe({lat:$.lat,lng:$.lng},t,gt)),u.setLatLng(Pe({lat:$.lat,lng:$.lng},t,vt)),n.setLatLngs([Ft,bt($,t)]),z=t,nt()},Fe=t=>{te=!0,$=t,a.setLatLng(t),s.setLatLng(t),c.setLatLng(t),l.setLatLng(Pe({lat:t.lat,lng:t.lng},a.getRadius(),gt)),u.setLatLng(Pe({lat:t.lat,lng:t.lng},a.getRadius(),vt)),n.setLatLngs([Ft,bt(t,a.getRadius())]),f.setLatLng(t),V={lat:t.lat,lng:t.lng},nt()},ge=t=>{if(!R)return;const h=i.mouseEventToLatLng(t);!h||(R==="resize"?rt($.distanceTo(h)):R==="move"&&Fe(e.latLng(h.lat-le.lat,h.lng-le.lng)))},ye=t=>{if(!R)return;const h=R;R=null,fe(),re(),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",ye),i.dragging.enable(),$t=!0;const g=i.mouseEventToLatLng(t),C=g?Math.max($.distanceTo(g),.1):a.getRadius();te&&h==="resize"&&M?M(C):te&&h==="move"&&F&&F({lat:$.lat,lng:$.lng})},We=(t,h)=>{R=t,te=!1,le=t==="move"?{lat:h.lat-$.lat,lng:h.lng-$.lng}:null,z=null,V=null,re(),i.dragging.disable(),document.addEventListener("mousemove",ge),document.addEventListener("mouseup",ye)},Re=t=>h=>{e.DomEvent.stopPropagation(h),We(t,h.latlng)},Ge=Re("resize"),Se=Re("move"),at=Re("move"),Me=Re("resize"),ot=t=>()=>{W=R?W:t,re()},qe=ot("resize"),U=ot("move"),ue=()=>{W=null,re()};s.on("mousedown",Ge),s.on("mouseover",qe),s.on("mouseout",ue),c.on("mousedown",Se),c.on("mouseover",U),c.on("mouseout",ue),l.on("mousedown",at),l.on("mouseover",U),l.on("mouseout",ue),u.on("mousedown",Me),u.on("mouseover",qe),u.on("mouseout",ue);const we=()=>{const t=Math.max(a.getRadius(),.1);l.setLatLng(Pe($,t,gt)),u.setLatLng(Pe($,t,vt)),l.update(),u.update()};i.on("zoomend",we);const Ke=t=>i.mouseEventToLatLng(t),ve=t=>{if(!R||!t.touches.length)return;t.preventDefault();const h=Ke(t.touches[0]);R==="resize"?rt($.distanceTo(h)):Fe(e.latLng(h.lat-le.lat,h.lng-le.lng))},Ee=t=>{if(!R)return;document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee);const h=R;R=null,fe(),re(),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",ye),i.dragging.enable(),$t=!0,te&&h==="resize"&&M?M(a.getRadius()):te&&h==="move"&&F&&F({lat:$.lat,lng:$.lng})},S=t=>h=>{!h.touches.length||(h.preventDefault(),h.stopPropagation(),We(t,Ke(h.touches[0])),document.addEventListener("touchmove",ve,{passive:!1}),document.addEventListener("touchend",Ee),document.addEventListener("touchcancel",Ee))},o=S("resize"),m=S("move"),d=S("move"),v=S("resize"),r=[[s,o],[c,m],[l,d],[u,v]];return r.forEach(([t,h])=>{const g=t.getElement();g&&g.addEventListener("touchstart",h,{passive:!1})}),()=>{s.off("mousedown",Ge),s.off("mouseover",qe),s.off("mouseout",ue),c.off("mousedown",Se),c.off("mouseover",U),c.off("mouseout",ue),l.off("mousedown",at),l.off("mouseover",U),l.off("mouseout",ue),u.off("mousedown",Me),u.off("mouseover",qe),u.off("mouseout",ue),document.removeEventListener("mousemove",ge),document.removeEventListener("mouseup",ye),i.off("zoomend",we),r.forEach(([t,h])=>{const g=t.getElement();g&&g.removeEventListener("touchstart",h)}),document.removeEventListener("touchmove",ve),document.removeEventListener("touchend",Ee),document.removeEventListener("touchcancel",Ee),O.classList.remove("radius-filter-resizing","radius-filter-moving"),R&&i.dragging.enable()}}function bn(e,i,n){const a=e.marker(n,{interactive:!1,icon:e.divIcon({className:"radius-filter-ripple-icon",html:'<div class="radius-filter-ripple"></div>',iconSize:[0,0]})}).addTo(i),s=()=>i.removeLayer(a),c=i.getContainer().querySelector(".radius-filter-ripple");c?c.addEventListener("animationend",s,{once:!0}):setTimeout(s,1e3)}let Qe={point:null,cleanupDrag:null},ti=!1;function Ve(e,i){let n=null;return e.eachLayer(a=>{a.options&&a.options.customId===i&&(n=a)}),n}function Sn(e,i,n,a,s={}){if(a=Math.max(a,.1),Qe.point&&n.lat===Qe.point.lat&&n.lng===Qe.point.lng){const F=Ve(i,me.mask),$=Ve(i,me.boundary),O=Ve(i,me.grabHandle),R=Ve(i,me.moveHandle),W=Ve(i,me.moveGrip),z=Ve(i,me.resizeGrip),V=Ve(i,me.sweep);if(F&&$&&O&&R&&W&&z&&V)return $.setRadius(a),O.setRadius(a),R.setRadius(Math.max(a-ei/2,.1)),W.setLatLng(Pe(n,a,gt)),z.setLatLng(Pe(n,a,vt)),F.setLatLngs([Ft,bt(n,a)]),V.setLatLng(n),{maskLayer:F,boundaryLayer:$,grabHandleLayer:O,moveHandleLayer:R,moveGripLayer:W,resizeGripLayer:z,sweepLayer:V}}ii(i);const{maskLayer:l,boundaryLayer:u,grabHandleLayer:f,moveHandleLayer:w,moveGripLayer:y,resizeGripLayer:M,sweepLayer:E}=wn(e,i,n,a);return l.addTo(i),E.addTo(i),u.addTo(i),w.addTo(i),f.addTo(i),y.addTo(i),M.addTo(i),Qe.point=n,Qe.cleanupDrag=Dn(e,i,l,u,f,w,y,M,E,n,s),{maskLayer:l,boundaryLayer:u,grabHandleLayer:f,moveHandleLayer:w,moveGripLayer:y,resizeGripLayer:M,sweepLayer:E}}function Mn(e,i){const n=Ve(e,me.sweep);if(!n)return;const a=n.getElement();if(!a)return;const s=i*2,c=a.querySelector(".radius-filter-sweep");!c||(c.style.width=`${s}px`,c.style.height=`${s}px`,c.style.left=`${-i}px`,c.style.top=`${-i}px`)}function xn(e,i){if(ti=!!i,!e)return;const n=Ve(e,me.sweep),a=n&&n.getElement();!a||a.classList.toggle("radius-filter-sweep-active",ti)}function ii(e){if(!e)return;Qe.cleanupDrag&&Qe.cleanupDrag(),Qe={point:null,cleanupDrag:null};const i=Object.values(me),n=[];e.eachLayer(a=>{i.includes(a.options&&a.options.customId)&&n.push(a)}
22),n.forEach(a=>e.removeLayer(a))}function Kt({collection:e,point:i,radius:n}={}){if(!i||!e)return e;const a=p.flatMap(e.features,(s,c)=>{if(p.get(s,"geometry.type")==="Point"){const M=p.get(s,"geometry.coordinates");return M?ai.insideCircle({lat:i.lat,lon:i.lng},{lat:M[1],lon:M[0]},n)?[s]:[]:[]}const l=p.get(s,"geometry.coordinates")||[],u=p.get(s,"properties.timestamps"),f=hn(l,u,i,n),y=`${p.get(s,"properties.deviceId")}__${c}`;return f.map((M,E)=>({...s,geometry:{...s.geometry,coordinates:M.coordinates},properties:{...s.properties,timestamps:M.timestamps,_routeId:y,_pathId:`${y}__${E}`}}))});return{...e,features:a}}function kn({collection:e,deviceId:i,routeId:n,pathId:a}={}){if(a){const c=p.filter(e.features,l=>String(p.get(l,"properties._pathId"))===String(a));return{...e,features:c}}if(n){const c=p.filter(e.features,l=>String(p.get(l,"properties._routeId"))===String(n));return{...e,features:c}}if(!i)return e;const s=p.filter(e.features,c=>{const l=p.get(c,"properties.deviceId");return!p.isNil(l)&&String(l)===String(i)});return{...e,features:s}}function Cn(e,i){const n=new Date(e).getTime(),a=new Date(i).getTime();return!p.isFinite(n)||!p.isFinite(a)?null:Math.max(a-n,0)}const In=4;function Jt(e){const i=["timestamps","deviceId","deviceDescription","area","_style","_routeId","_pathId","distance","ID","Nimi","title"],n=p.map(e,c=>p.get(c,"properties")||{}),a=p.uniq(p.flatMap(n,p.keys)),s={};return p.each(a,c=>{if(i.includes(c))return;const l=p.uniq(p.compact(p.flatMap(n,u=>Bi(u[c]))));if(!!l.length){if(l.length>In){s[c]=`${l.length} \xD7`;return}s[c]=l.join(", ")}}),s}function Bi(e){if(p.isNil(e)||e==="")return[];if(p.isArray(e))return p.compact(p.flatMap(e,n=>Bi(n)));if(p.isPlainObject(e)){const n=e.description||e.name||e.id;return n?[String(n)]:[]}if(p.isObject(e))return[];const i=String(e).trim();return i?/^[[{]\s*[\]}]$/.test(i)?[]:[i]:[]}function Ei(e){const i=p.get(e,"features")||[];if(!i.length)return[];const n=p.groupBy(i,"properties.deviceId"),a=p.map(n,(s,c)=>{const l=p.groupBy(s,w=>p.get(w,"properties._routeId")||null),u=p.compact(p.map(l,(w,y)=>{const M=p.groupBy(w,R=>p.get(R,"properties._pathId")||null),E=p.compact(p.map(M,(R,W)=>{const z=p.flatMap(R,te=>p.castArray(p.get(te,"properties.timestamps"))).filter(Boolean).sort();if(!z.length)return null;const V=p.first(z),se=p.last(z),le=p.sumBy(R,te=>cn(p.get(te,"geometry.coordinates")));return{pathId:W==="null"?null:W,features:R,startTime:V,endTime:se,distanceMeters:le,durationMs:Cn(V,se),pointCount:z.length,properties:Jt(R)}}));if(!E.length)return null;const F=p.sortBy(E,"startTime"),$=p.first(F).startTime,O=p.max(p.map(F,"endTime"));return{routeId:y==="null"?null:y,features:w,paths:F,startTime:$,endTime:O,distanceMeters:p.sumBy(F,"distanceMeters"),durationMs:p.sumBy(F,"durationMs"),pointCount:p.sumBy(F,"pointCount"),properties:Jt(w)}}));if(!u.length)return null;const f=p.sortBy(u,"startTime");return{deviceId:c,description:p.get(s[0],"properties.deviceDescription")||c,features:s,routes:f,startTime:p.first(f).startTime,endTime:p.max(p.map(f,"endTime")),distanceMeters:p.sumBy(f,"distanceMeters"),durationMs:p.sumBy(f,"durationMs"),pointCount:p.sumBy(f,"pointCount"),properties:Jt(s)}});return p.sortBy(p.compact(a),"startTime")}function Tn(e,i,n,a){if(!i||!n||!a)return null;const s=i.latLngToContainerPoint(e.latLng(n.lat,n.lng)),[c,l]=bt(n,a,1)[0],u=i.latLngToContainerPoint(e.latLng(c,l)),f=s.distanceTo(u),w=i.getSize();return{center:{x:s.x,y:s.y},radiusPixels:f,mapSize:{width:w.x,height:w.y}}}function Ln(e,i,n){const a=Math.min(n.width,n.height),s=Math.max(70,Math.min(200,a*.13)),c=156543.03392*Math.cos(e.lat*Math.PI/180)/Math.pow(2,i),l=5e3,u=Math.min(60*c,l),f=s*c;return Math.max(u,Math.min(l,f))}const si=new WeakMap;function En(e,i,n,a){const s=a.x-n.x,c=a.y-n.y,l=s*s+c*c;if(l===0)return{t:0,point:n,dist:i.distanceTo(n)};let u=((i.x-n.x)*s+(i.y-n.y)*c)/l;u=Math.max(0,Math.min(1,u));const f=e.point(n.x+u*s,n.y+u*c);return{t:u,point:f,dist:i.distanceTo(f)}}function Fn(e,i,n,a){const s=p.get(n,"properties.timestamps");if(!s||s.length<2)return null;
22const c=a.latlng||a.layerPoint&&i.layerPointToLatLng(a.layerPoint)||a.containerPoint&&i.containerPointToLatLng(a.containerPoint);if(!c)return null;const l=i.latLngToContainerPoint(c),u=n.geometry.coordinates,f=u.map(z=>i.latLngToContainerPoint(e.latLng(z[1],z[0]))),w=p.range(f.length-1).map(z=>({...En(e,l,f[z],f[z+1]),index:z})),y=p.minBy(w,"dist");if(!y)return null;const M=u[y.index],E=u[y.index+1],F=e.latLng(M[1]+y.t*(E[1]-M[1]),M[0]+y.t*(E[0]-M[0])),$=s[y.index],O=s[y.index+1];let R="";if($&&O){const z=new Date($).getTime(),V=new Date(O).getTime();R=Ne(new Date(z+y.t*(V-z)),"pp")}else($||O)&&(R=Ne(new Date($||O),"pp"));const W=p.get(n,"properties.deviceDescription")||p.get(n,"properties.deviceId")||"";return{latLng:F,timeText:R,deviceDescription:W}}function Fi(e,i,n,a){if(!i)return;const s=Fn(e,i,a,n);if(!s)return;let c=si.get(i);c||(c=e.tooltip({className:"route-time-tooltip",direction:"top",offset:e.point(0,-10),permanent:!0}),si.set(i,c));const l=s.deviceDescription?`<div class="route-time-tooltip__device">${s.deviceDescription}</div>`:"";c.setLatLng(s.latLng).setContent(` 23 <div class="route-time-tooltip__content"> 24 <div class="route-time-tooltip__time">${s.timeText}</div> 25 ${l} 26 </div> 27 `),i.hasLayer(c)||c.addTo(i)}function $n(e){if(!e)return;const i=si.get(e);i&&e.hasLayer(i)&&i.remove()}const Pn=3,Nn="#000000",_n="#ffffff";function An(e,i,n,a){if(!i)return;const s=p.isPlainObject(a)?a.deviceId:a,c=p.isPlainObject(a)?a.routeId:null,l=p.isPlainObject(a)?a.pathId:null;let u=null;if(i.eachLayer(y=>{y instanceof e.GeoJSON&&y.options.customId===n&&(u=y)}),!u)return;const f=new Set,w=new Set;u.eachLayer(y=>{const M=p.get(y,"feature.properties.deviceId");if(!M||y.feature.geometry.type==="Point")return;const E=p.get(y,"feature.properties._routeId"),F=p.get(y,"feature.properties._pathId");(l?String(F)===String(l):c?String(E)===String(c):String(M)===String(s))?(u.resetStyle(y),y.setStyle(Rn(y)),y.bringToFront&&y.bringToFront(),f.add(String(E)),F&&w.add(String(F))):u.resetStyle(y)}),u.eachLayer(y=>{if(y.feature.geometry.type!=="Point")return;const M=p.get(y,"feature.properties._routeId"),E=p.get(y,"feature.properties._pathId");(l?w.has(String(E)):f.has(String(M)))&&y.bringToFront&&y.bringToFront()})}function Rn(e){const n=(p.get(e,"feature.properties._style")||{}).weight||e.options.weight||3,a=!!p.get(e,"feature.lineStroke");return{weight:n*Pn,opacity:1,color:a?Nn:_n}}function zi({collection:e,timeRange:i}={}){if(!e||!e.features)return e;i=p.isPlainObject(i)?i:p.zipObject(["start","end"],i);const n=i.start,a=i.end;let s=p.map(e.features,c=>{const l={coordinates:p.get(c,"geometry.coordinates"),timestamps:p.get(c,"properties.timestamps")},u=p.zip(l.coordinates,l.timestamps),f=p.filter(u,([M,E])=>{if(p.isNil(E))return;const F=ke(E);return _i(F,{start:new Date(n),end:new Date(a)})});if(p.isEmpty(f))return null;const[w,y]=p.unzip(f);return{...c,geometry:{...c.geometry,coordinates:w},properties:{...c.properties,timestamps:y}}});return s=p.compact(s),{...e,features:s}}const On={checkBold:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83z"/></svg>',truck:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 640 512"><path fill="currentColor" d="M48 0C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h16c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V287.6H544V192l-64-96H384v288c0 53 43 96 96 96s96-43 96-96h32c17.7 0 32-14.3 32-32s-14.3-32-32-32V287.6H544V192l-64-96H384V48c0-26.5-21.5-48-48-48H48zM544 192h32v95.6H544V192zm-64 0v95.6h-32V192h32zm-96 0v95.6h-32V192h32zM160 464a48 48 0 1 1 0-96 48 48 0 0 1 0 96zm368-48a48 48 0 1 1-96 0 48 48 0 0 1 96 0z"/></svg>',closeThick:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12z"/></svg>',arrowRightThin:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24">
27<path fill="currentColor" d="M14 16.94v-4H5.08l-.03-2.01H14V6.94l5 5z"/></svg>',calendar:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M19 19H5V8h14m-3-7v2H8V1H6v2H5c-1.11 0-2 .89-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V5a2 2 0 0 0-2-2h-1V1m-1 11h-5v5h5z"/></svg>',spinner:'<svg xmlns="http://www.w3.org/2000/svg" width="1em" height="1em" viewBox="0 0 24 24"><path fill="currentColor" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path fill="currentColor" d="M12,4a8,8,0,0,1,7.89,6.7A1.53,1.53,0,0,0,21.38,12h0a1.5,1.5,0,0,0,1.48-1.75,11,11,0,0,0-21.72,0A1.5,1.5,0,0,0,2.62,12h0a1.53,1.53,0,0,0,1.49-1.3A8,8,0,0,1,12,4Z"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg>'},Hn={name:"RadiusFilterVehicleList",components:{"date-picker":Oi},template:` 28 <div 29 class="radius-filter-vehicle-list" 30 :class="[ dockSide ? 'dock-' + dockSide : null, { 'dragging': dragging } ]" 31 :style="dockStyle" 32 v-if="active" 33 ref="panel" 34 > 35 36 <h2 class="component-heading"> 37 <span class="spinner-icon" v-if="fetching && !pendingDate" v-html="icons.spinner"></span> 38 39 <span class="heading-text" v-if="pendingDate">{{ $translate('date') }}</span> 40 <template v-else-if="fetching && !vehicles.length"><span class="heading-text loading-text">{{ $translate('loading') }}<span class="loading-dots" aria-hidden="true"></span></span></template> 41 <span class="heading-text" v-else>{{ $translate('vehicles') }} ({{ vehicles.length }})</span> 42 43 <button 44 class="date-control-btn" 45 :class="{ 'inert': pendingDate }" 46 @click="!pendingDate && (datePickerOpen = !datePickerOpen)" 47 > 48 <span class="calendar-icon" v-html="icons.calendar"></span> 49 <span class="date-display-inline" v-if="selectedDate"> 50 <span class="day">{{ selectedDate.getDate() }}</span>.<span class="month">{{ selectedDate.getMonth() + 1 }}</span>.<span class="year">{{ selectedDate.getFullYear() }}</span> 51 </span> 52 </button> 53 54 <button class="clear-radius-filter-button" @click="$emit('clear')" v-html="icons.closeThick"></button> 55 </h2> 56 57 <div class="date-picker-wrapper" v-if="pendingDate || datePickerOpen"> 58 <date-picker :date="selectedDate" :emit-initial="false" @update:date="pendingDate ? $emit('date-selected', $event) : dateReselected($event)"></date-picker> 59 </div> 60 61 <template v-else-if="!(fetching && !vehicles.length)"> 62 63 <div class="vehicle-items" ref="vehicleItems"> 64 <div 65 class="vehicle-item" 66 v-for="vehicle in vehicles" 67 :key="vehicle.deviceId" 68 :data-device-id="vehicle.deviceId" 69 :class="{ 'expanded': expandedDeviceId === vehicle.deviceId, 'highlighted': highlightedDeviceId === vehicle.deviceId }" 70 @click="toggleExpanded(vehicle)" 71 @mouseenter="$emit('vehicle-hover', vehicle.deviceId)" 72 @mouseleave="$emit('vehicle-hover', null)" 73 > 74 75 <div class="vehicle-item-header"> 76 <span class="vehicle-check-icon" :class="{ 'checked': selectedDeviceId === vehicle.deviceId && !selectedRouteId && !selectedPathId }" v-html="icons.checkBold"></span> 77 <span class="vehicle-icon" v-html="icons.truck"></span> 78 <span class="description">{{ vehicle.description }}</span> 79 <span class="time-range"> 80 <span class="time"><span class="time-dot start-dot"></span>{{ formatTime(vehicle.startTime) }}</span> 81 <span class="arrow" v-html="icons.arrowRightThin"></span> 82 <span class="time"><span class="time-dot end-dot"></span>{{ formatTime(vehicle.endTime) }}</span> 83 </span> 84 </div> 85 86 <div class="vehicle-item-detail" v-if="expandedDeviceId === vehicle.deviceId"> 87 <div class="routes-list"> 88 <div 89 class="route-item" 90 v-for="(route, routeIndex) in vehicle.routes" 91 :key="route.routeId" 92 :class="{ 'highlighted': highlightedRouteId === route.routeId, 'selected': selectedRouteId === route.routeId && !selectedPathId }" 93 @click.stop="routeClicked(vehicle, route)" 94 @mouseenter="$emit('route-hover', { deviceId: vehicle.deviceId, routeId: route.routeId })" 95 @mouseleave="$emit('route-hover', null)" 96 > 97 <div class="route-item-header"> 98 <span class="route-check-icon" :class="{ 'checked': selectedRouteId === route.routeId && !selectedPathId }" v-html="icons.checkBold"></span> 99 <span class="route-label"> 100 {{ $translate('route') }} {{ routeIndex + 1 }} 101 <span class="route-distance">{{ formatDistance(route.distanceMeters) }}</span> 102 </span> 103 <span class="time-range" v-if="route.paths.length <= 1"> 104 <span class="time"><span class="time-dot start-dot"></span>{{ formatTime(route.startTime) }}</span> 105 <span class="arrow" v-html="icons.arrowRightThin"></span> 106 <span class="time"><span class="time-dot end-dot"></span>{{ formatTime(route.endTime) }}</span> 107 </span> 108 <span class="route-duration" v-else>{{ formatDuration(route.durationMs) }}</span> 109 </div> 110 <div class="route-properties" v-if="hasRouteProperties(vehicle, route)"> 111 <div class="detail-row" v-for="(value, key) in routeProperties(vehicle, route)" :key="key"> 112 <span class="label">{{ key }}</span> 113 <span class="value">{{ value }}</span> 114 </div> 115 </div> 116 <div class="paths-list" v-if="route.paths.length > 1"> 117 <div 118 class="path-item" 119 v-for="path in route.paths" 120 :key="path.pathId" 121 :class="{ 'highlighted': highlightedPathId === path.pathId, 'selected': selectedPathId === path.pathId }" 122 @click.stop="pathClicked(vehicle, route, path)" 123 @mouseenter="$emit('path-hover', { deviceId: vehicle.deviceId, routeId: route.routeId, pathId: path.pathId })" 124 @mouseleave="$emit('path-hover', null)" 125 > 126 <span class="path-check-icon" :class="{ 'checked': selectedPathId === path.pathId }" v-html="icons.checkBold"></span> 127 <span class="path-distance">{{ formatDistance(path.distanceMeters) }}</span> 128 <span class="time-range"> 129 <span class="time"><span class="time-dot start-dot"></span>{{ formatTime(path.startTime) }}</span> 130 <span class="arrow" v-html="icons.arrowRightThin"></span> 131 <span class="time"><span class="time-dot end-dot"></span>{{ formatTime(path.endTime) }}</span> 132 </span> 133 </div> 134 </div> 135 </div> 136 </div> 137 <div class="detail-row"> 138 <span class="label">{{ $translate('date') }}</span> 139 <span class="value">{{ formatDate(detailItem(vehicle).startTime) }}</span> 140 </div> 141 <div class="detail-row"> 142 <span class="label">{{ $translate('device_id') }}</span> 143 <span class="value">{{ vehicle.deviceId }}</span> 144 </div> 145 <div class="detail-row"> 146 <span class="label">{{ $translate('distance') }}</span> 147 <span class="value">{{ formatDistance(detailItem(vehicle).distanceMeters) }}</span> 148 </div> 149 <div class="detail-row"> 150 <span class="label">{{ $translate('duration') }}</span> 151 <span class="value">{{ formatDuration(detailItem(vehicle).durationMs) }}</span> 152 </div> 153 <div class="detail-row" v-for="(value, key) in detailItem(vehicle).properties" :key="key"> 154 <span class="label">{{ key }}</span> 155 <span class="value">{{ value }}</span> 156 </div> 157 </div> 158
159 </div> 160 </div> 161 162 </template> 163 164 </div> 165 `,props:{vehicles:{type:Array,default:()=>[]},screenPosition:{type:Object,default:null},highlightedDeviceId:{default:null},selectedDeviceId:{default:null},highlightedRouteId:{default:null},selectedRouteId:{default:null},highlightedPathId:{default:null},selectedPathId:{default:null},dragging:{type:Boolean,default:!1},fetching:{type:Boolean,default:!1},pendingDate:{type:Boolean,default:!1},selectedDate:{type:Date,default:null},active:{type:Boolean,default:!1},scrollTo:{type:Object,default:()=>({deviceId:null,token:0})}},emits:["vehicle-hover","vehicle-selected","route-hover","route-selected","path-hover","path-selected","date-selected","clear"],data(){return{icons:On,datePickerOpen:!1,panelSize:{width:0,height:0}}},mounted(){this.panelResizeObserver=new ResizeObserver(([e])=>{!e||(this.panelSize={width:e.contentRect.width,height:e.contentRect.height})}),this.observePanelIfPresent()},beforeUnmount(){p.invoke(this.panelResizeObserver,"disconnect")},computed:{expandedDeviceId(){return this.selectedDeviceId},dockSide(){const e=this.screenPosition;if(!e)return null;if(e.mapSize.height>e.mapSize.width){const s=e.center.y-e.radiusPixels,c=e.mapSize.height-(e.center.y+e.radiusPixels);return s>=c?"top":"bottom"}const n=e.center.x-e.radiusPixels,a=e.mapSize.width-(e.center.x+e.radiusPixels);return n>=a?"left":"right"},dockStyle(){const e=this.screenPosition;if(!e||!this.dockSide)return{};const i=12,n=20;if(this.dockSide==="left"||this.dockSide==="right"){const f=this.panelSize.height/2,w=e.center.y-f,y=e.mapSize.height-n-this.panelSize.height,M=p.clamp(w,n,Math.max(y,n));return{...this.dockSide==="left"?{right:`calc(100% - ${e.center.x-e.radiusPixels-i}px)`}:{left:`${e.center.x+e.radiusPixels+i}px`},top:`${M}px`,bottom:"auto"}}const a=this.panelSize.width/2,s=e.center.x-a,c=e.mapSize.width-n-this.panelSize.width,l=p.clamp(s,n,Math.max(c,n));return{...this.dockSide==="top"?{bottom:`calc(100% - ${e.center.y-e.radiusPixels-i}px)`}:{top:`${e.center.y+e.radiusPixels+i}px`},left:`${l}px`,right:"auto"}}},watch:{vehicles(e){const i=p.find(e,{deviceId:this.expandedDeviceId});if(this.expandedDeviceId&&!i){this.$emit("vehicle-selected",null);return}if(this.selectedRouteId){const n=i&&p.find(i.routes,{routeId:this.selectedRouteId});n?this.selectedPathId&&!p.some(n.paths,{pathId:this.selectedPathId})&&this.$emit("path-selected",{deviceId:this.expandedDeviceId,routeId:this.selectedRouteId,pathId:null}):this.$emit("route-selected",{deviceId:this.expandedDeviceId,routeId:null})}},active:{handler(){this.observePanelIfPresent()},flush:"post"},"vehicles.length":{handler(){this.observePanelIfPresent()},flush:"post"},fetching:{handler(){this.observePanelIfPresent()},flush:"post"},pendingDate:{handler(){this.observePanelIfPresent()},flush:"post"},datePickerOpen:{handler(){this.observePanelIfPresent()},flush:"post"},scrollTo:{handler(e){!e||!e.deviceId||this.scrollVehicleIntoView(e.deviceId)},flush:"post"}},methods:{observePanelIfPresent(){p.invoke(this.panelResizeObserver,"disconnect"),this.$refs.panel?this.panelResizeObserver.observe(this.$refs.panel):this.panelSize={width:0,height:0}},scrollVehicleIntoView(e){const i=this.$refs.vehicleItems,n=i&&i.querySelector(`.vehicle-item[data-device-id="${CSS.escape(String(e))}"]`);if(!i||!n)return;const a=i.scrollTop+(n.getBoundingClientRect().top-i.getBoundingClientRect().top);i.scrollTo({top:a,behavior:"smooth"})},dateReselected(e){this.datePickerOpen=!1,this.$emit("date-selected",e)},toggleExpanded(e){const i=this.expandedDeviceId===e.deviceId&&!this.selectedRouteId&&!this.selectedPathId;this.$emit("vehicle-selected",i?null:e.deviceId)},routeClicked(e,i){const n=this.selectedRouteId===i.routeId&&!this.selectedPathId;this.$emit("route-selected",{deviceId:e.deviceId,routeId:n?null:i.routeId})},pathClicked(e,i,n){const a=this.selectedPathId===n.pathId;this.$emit("path-selected",{deviceId:e.deviceId,routeId:i.routeId,pathId:a?null:n.pathId})},formatTime(e){return Ne(ke(e),"p")},formatDate(e){return Ne(ke(e),"P")},formatDateTime(e){return Ne(ke(e),"PPpp")},detailItem(e){const i=this.highlightedDeviceId===e.deviceId?this.highlightedRouteId:this.selectedRouteId;return p.find(e.routes,{routeId:i})||e},routeProperties(e,i){const n=e.properties||{};return p.omitBy(i.properties||{},(a,s)=>n[s]===a)},hasRouteProperties(e,i){return!p.isEmpty(this.routeProperties(e,i))},formatDistance(e){return p.isFinite(e)?e<1e3?`${Math.round(e)} m`:`${(e/1e3).toFixed(1)} km`:"-"},formatDuration(e){if(!p.isFinite(e))return"-";const i=Math.round(e/6e4);if(i<1)return`${Math.round(e/1e3)} s`;if(i<60)return`${i} min`;const n=Math.floor(i/60),a=i%60;return a?`${n} h ${a} min`:`${n} h`},formatSpeed(e){const i=e.distanceMeters,n=e.durationMs;if(!p.isFinite(i)||!p.isFinite(n)||n<=0)return null;const a=i/1e3/(n/36e5);return p.isFinite(a)?`${Math.round(a)} km/h`:null}}},Vn={name:"RadiusFilter",components:{"radius-filter-vehicle-list":Hn},template:` 166 <Teleport to=".map-wrapper"> 167 <radius-filter-vehicle-list 168 :vehicles="radiusFilteredVehicles" 169 :screen-position="radiusFilterScreenPosition" 170 :highlighted-device-id="highlightedDeviceId" 171 :selected-device-id="selectedDeviceId" 172 :highlighted-route-id="highlightedRouteId" 173 :selected-route-id="selectedRouteId" 174 :highlighted-path-id="highlightedPathId" 175 :selected-path-id="selectedPathId" 176 :dragging="radiusFilterDragging" 177 :fetching="fetching" 178 :pending-date="radiusFilter.pendingDate" 179 :selected-date="radiusFilter.date" 180 :active="!!radiusFilter.point" 181 :scroll-to="mapVehicleSelection" 182 @vehicle-hover="vehicleHoveredInList" 183 @vehicle-selected="vehicleSelected" 184 @route-hover="routeHoveredInList" 185 @route-selected="routeSelected" 186 @path-hover="pathHoveredInList" 187 @path-selected="pathSelected" 188 @date-selected="dateConfirmed" 189 @clear="clearRadiusFilter" 190 /> 191 </Teleport> 192 `,props:{allFeatures:{type:Object,default:null},timeRange:{type:Array,default:null}},emits:["update:point","update:allFeatures","date-changed","update:fetching","filter-changed"],data(){return{Leaflet:null,mapInstance:null,fetching:!1,fetchingFirstBatch:!1,fetchOneByOne:!1,radiusFilterScreenPosition:null,pathLayerName:null,listHoveredDeviceId:null,listHoveredRouteId:null,listHoveredPathId:null,mapHoveredDeviceId:null,mapHoveredRouteId:null,mapHoveredPathId:null,
192selectedDeviceId:null,selectedRouteId:null,selectedPathId:null,mapVehicleSelection:{deviceId:null,token:0},radiusFilter:{point:null,defaultRadiusMeters:150,manualRadiusMeters:null,animRadius:null,animPoint:null,animToken:0,lastDragRenderTime:0,moving:!1,resizing:!1,dateConfirmed:!1,pendingDate:!1,date:null},fetchedDates:new Set,fetchCheckQueued:!1,isFetchingMissingDates:!1,fetchSessionId:0}},watch:{"radiusFilter.point"(){this.radiusFilter.moving||this.animateRadiusFilter(),this.$emit("update:point",this.radiusFilter.point)},fetchingFirstBatch(e){xn(this.mapInstance,e)},mapHighlightDeviceId(e){this.highlightVehicleOnMap({deviceId:e,routeId:this.mapHighlightRouteId,pathId:this.mapHighlightPathId})},mapHighlightRouteId(e){this.highlightVehicleOnMap({deviceId:this.mapHighlightDeviceId,routeId:e,pathId:this.mapHighlightPathId})},mapHighlightPathId(e){this.highlightVehicleOnMap({deviceId:this.mapHighlightDeviceId,routeId:this.mapHighlightRouteId,pathId:e})},selectedDeviceId(){this.$emit("filter-changed")},selectedRouteId(){this.$emit("filter-changed")},selectedPathId(){this.$emit("filter-changed")},timeRange:{deep:!0,handler(){!this.radiusFilter.date||this.radiusFilter.pendingDate||(this.fetching?this.fetchCheckQueued=!0:this.fetchMissingDatesForTimeRange())}}},computed:{radiusFilterTargetRadius(){var e;return(e=this.radiusFilter.manualRadiusMeters)!=null?e:this.radiusFilter.defaultRadiusMeters},radiusFilteredVehicles(){const e=this.radiusFilter.point;if(!e||!p.get(this.allFeatures,"features.length"))return[];const i=this.timeRange,n=this.radiusFilterTargetRadius;let a=p.cloneDeep(this.allFeatures);return a=zi({collection:a,timeRange:i}),a=Kt({collection:a,point:e,radius:n}),Ei(a)},allRadiusFilteredVehicles(){const e=this.radiusFilter.point;if(!e||!p.get(this.allFeatures,"features.length"))return[];const i=this.radiusFilterTargetRadius;let n=p.cloneDeep(this.allFeatures);return n=Kt({collection:n,point:e,radius:i}),Ei(n)},highlightedDeviceId(){return this.listHoveredDeviceId||this.mapHoveredDeviceId||this.selectedDeviceId},highlightedRouteId(){return this.listHoveredRouteId||this.mapHoveredRouteId||this.selectedRouteId},highlightedPathId(){return this.listHoveredPathId||this.mapHoveredPathId||this.selectedPathId},mapHighlightDeviceId(){return this.listHoveredDeviceId||this.mapHoveredDeviceId},mapHighlightRouteId(){return this.listHoveredRouteId||this.mapHoveredRouteId},mapHighlightPathId(){return this.listHoveredPathId||this.mapHoveredPathId},radiusFilterDragging(){return this.radiusFilter.resizing||this.radiusFilter.moving},trackingDevicesList(){const e=p.get(this.$devicesList,"values")||[],i=[],n=a=>{p.each(a,s=>{p.get(s,"values.length")?n(s.values):i.push({id:s.id,description:s.description})})};return n(e),i}},mounted(){this.$emitter.on("leaflet-map-ready",this.onMapReady),this.$emitter.on("protieto-map-path-layer-added",this.onPathLayerAdded),this.$emitter._leafletMapReady?this.onMapReady(this.$emitter._leafletMapReady):this.$leaflet&&this.onMapReady({Leaflet:window.L,mapInstance:this.$leaflet})},beforeUnmount(){this.$emitter.off("leaflet-map-ready",this.onMapReady),this.$emitter.off("protieto-map-path-layer-added",this.onPathLayerAdded),this.detachMapListeners(),this.radiusFilter.animToken++,this.$emit("update:point",null),ii(this.mapInstance)},methods:{onMapReady({Leaflet:e,mapInstance:i}={}){this.Leaflet=e,this.mapInstance=i,i&&(i.on("click",this.onMapClick),i.on("move",this.updateScreenPosition),i.on("zoom",this.updateScreenPosition))},detachMapListeners(){!this.mapInstance||(this.mapInstance.off("click",this.onMapClick),this.mapInstance.off("move",this.updateScreenPosition),this.mapInstance.off("zoom",this.updateScreenPosition))},onMapClick(e){const i=mn();if(pn(e)||i)return;const n=this.radiusFilter.point;if(n&&e.latlng.distanceTo(n)<=this.radiusFilterTargetRadius)return;const{lat:a,lng:s}=e.latlng,c=this.mapInstance.getZoom(),l=this.mapInstance.getSize(),u={width:l.x,height:l.y};this.mapClicked({lat:a,lng:s,zoom:c,mapSize:u})},onPathLayerAdded({layerName:e,featureLayer:i}={}){this.pathLayerName=e,i.eachLayer(n=>{const a=n.feature;if(!a)return;const s=p.get(a,"properties.deviceId"),c=p.get(a,"properties._routeId"),l=p.get(a,"properties._pathId");!s||(n.on("mouseover",u=>{Fi(this.Leaflet,this.mapInstance,u,a),this.routeHoveredOnMap({deviceId:s,routeId:c,pathId:l})}),n.on("mousemove",u=>{Fi(this.Leaflet,this.mapInstance,u,a)}),n.on("mouseout",()=>{$n(this.mapInstance),this.routeHoveredOnMap(null)}),n.on("click",()=>{this.vehicleSelectedOnMap({deviceId:s,routeId:c,pathId:l})}))})},updateScreenPosition(){var n;if(!this.radiusFilter.point||!this.mapInstance){this.radiusFilterScreenPosition=null;return}const e=(n=this.radiusFilter.animRadius)!=null?n:this.radiusFilterTargetRadius,i=Tn(this.Leaflet,this.mapInstance,this.radiusFilter.point,e);this.radiusFilterScreenPosition=i,i&&Mn(this.mapInstance,i.radiusPixels)},highlightVehicleOnMap({deviceId:e,routeId:i,pathId:n}={}){!this.mapInstance||!this.pathLayerName||An(this.Leaflet,this.mapInstance,this.pathLayerName,{deviceId:e,routeId:i,pathId:n})},applyFilters(e){var a,s;const i=(a=this.radiusFilter.animRadius)!=null?a:this.radiusFilterTargetRadius,n=(s=this.radiusFilter.animPoint)!=null?s:this.radiusFilter.point;return e=Kt({collection:e,point:n,radius:i}
192),e=kn({collection:e,deviceId:this.selectedDeviceId,routeId:this.selectedRouteId,pathId:this.selectedPathId}),e},mapClicked({lat:e,lng:i,zoom:n,mapSize:a}={}){const s=p.isFinite(n)&&a?Ln({lat:e,lng:i},n,a):null;p.isFinite(s)&&(this.radiusFilter.defaultRadiusMeters=s),this.radiusFilter.manualRadiusMeters=null,this.radiusFilter.point={lat:e,lng:i},!this.radiusFilter.dateConfirmed&&(this.radiusFilter.pendingDate=!0)},async dateConfirmed(e){this.radiusFilter.pendingDate=!1,this.radiusFilter.date=e,this.radiusFilter.dateConfirmed=!0;const i=this.trackingDevicesList;this.fetchedDates.clear(),this.fetchCheckQueued=!1,this.fetchSessionId++,this.$emit("date-changed",e),this.$emit("update:allFeatures",null),this.fetching=!0,this.fetchingFirstBatch=!0,this.$emit("update:fetching",!0),this.fetchOneByOne?(await this.fetchDevicesOneByOne({devices:i,date:e}),this.markDateFetched(e)):await this.fetchDevices({devices:i,date:e})&&this.markDateFetched(e),this.fetchingFirstBatch=!1,await this.fetchMissingDatesForTimeRange(),this.fetching=!1,this.$emit("update:fetching",!1)},async fetchMissingDatesForTimeRange(){if(this.isFetchingMissingDates){this.fetchCheckQueued=!0;return}this.isFetchingMissingDates=!0;try{const e=this.trackingDevicesList;do{this.fetchCheckQueued=!1;const i=p.reject(this.getNeededDatesForTimeRange(),a=>this.isDateFetched(a));if(p.isEmpty(i))continue;const n=this.fetching;n||(this.fetching=!0,this.$emit("update:fetching",!0));for(const a of i)this.fetchOneByOne?(await this.fetchDevicesOneByOne({devices:e,date:a}),this.markDateFetched(a)):await this.fetchDevices({devices:e,date:a})&&this.markDateFetched(a);n||(this.fetching=!1,this.$emit("update:fetching",!1))}while(this.fetchCheckQueued)}finally{this.isFetchingMissingDates=!1}},getNeededDatesForTimeRange(){const e=this.radiusFilter.date;if(!e)return[];const i=wt(e,{days:1});return p.filter([e,i],n=>this.timeRangeNeedsDate(n))},timeRangeNeedsDate(e){const i=this.timeRange;if(!i||!i.length)return!1;const n=Number(p.first(i)),a=Number(p.last(i)),s=yt(e).getTime(),c=Yt(e).getTime();return n<c&&a>s},dateToIso(e){return st(e,{representation:"date"})},isDateFetched(e){return this.fetchedDates.has(this.dateToIso(e))},markDateFetched(e){this.fetchedDates.add(this.dateToIso(e))},async fetchDevices({devices:e,date:i}={}){const n=this.fetchSessionId;try{const a=this.$organizationId,s=st(i,{representation:"date"}),c=await this.fetchAllRoutes(a,s);return this.fetchSessionId!==n?!1:(this.mergeAllDevicesFeatureCollection(c,e),!0)}catch(a){return console.error("Error fetching device locations:",a.message),!1}},async fetchAllRoutes(e,i){let n=p(i).castArray().join(";");n=encodeURIComponent(n);const a=`/rest/geoconvert/prodoc.rest.geoconverter.movement_history.${e}/${n},all`;return(await axios.get(a,{timeout:this.$secondsToMs(120),responseType:"json"})).data},mergeFeatures(e){if(!p.get(e,"length"))return;const i=p.get(this.allFeatures,"features");this.$emit("update:allFeatures",{type:"FeatureCollection",features:p.concat(i||[],e)})},mergeAllDevicesFeatureCollection(e,i){const n=p.get(e,"features")||[];if(!n.length)return;const a=p.keyBy(i,c=>String(c.id)),s=p.filter(p.map(n,c=>{const l=a[String(p.get(c,"properties.ID"))];return l?{...c,properties:{...c.properties,deviceId:l.id,deviceDescription:l.description}}:null}));this.mergeFeatures(s)},async fetchDevicesOneByOne({devices:e,date:i}={}){try{await this.getLocationsPerDevice(e,{date:i,chunkSize:2,organization:this.$organizationId,onChunk:n=>this.mergePerDeviceFeatureCollections(n)})}catch(n){console.error("Error fetching device locations:",n.message)}},async getLocationsPerDevice(e,{chunkSize:i=5,date:n,organization:a,onChunk:s}={}){if(!e.length)return;const c=st(n,{representation:"date"}),l=p.chunk(e,i),u=[];for(const f of l){const w=await Promise.all(f.map(y=>axios.get(`/rest/geoconvert/prodoc.rest.geoconverter.movement_history.${a}/${c},${y.id}`,{timeout:this.$secondsToMs(30)}).then(M=>({device:y,data:M.data}))));u.push(...w),s&&s(w)}return u},mergePerDeviceFeatureCollections(e){const i=p.filter(e,"data.features.length");if(!i.length)return;const n=p.flatMap(i,({device:a,data:s})=>s.features.map(c=>({...c,properties:{...c.properties,deviceId:a.id,deviceDescription:a.description}})));this.mergeFeatures(n)},clearRadiusFilter(){this.radiusFilter.point=null,this.radiusFilter.dateConfirmed=!1,this.radiusFilter.manualRadiusMeters=null,this.radiusFilter.pendingDate=!1,this.radiusFilter.date=null,this.fetchedDates.clear(),this.fetchCheckQueued=!1,this.selectedDeviceId=null,this.listHoveredDeviceId=null,this.mapHoveredDeviceId=null}
192,radiusDragged({radius:e}={}){this.radiusFilter.resizing=!0,this.radiusFilter.animToken++,this.radiusFilter.animRadius=e,this.updateScreenPosition();const i=performance.now();i-this.radiusFilter.lastDragRenderTime<40||(this.radiusFilter.lastDragRenderTime=i,this.$emit("filter-changed"))},radiusDragEnded({radius:e}={}){this.radiusFilter.manualRadiusMeters=e,this.radiusFilter.animRadius=null,this.radiusFilter.resizing=!1,this.$emit("filter-changed"),this.updateScreenPosition()},radiusMoved({point:e}={}){this.radiusFilter.moving=!0,this.radiusFilter.animToken++,this.radiusFilter.animPoint=e,this.updateScreenPosition();const i=performance.now();i-this.radiusFilter.lastDragRenderTime<40||(this.radiusFilter.lastDragRenderTime=i,this.$emit("filter-changed"))},radiusMoveEnded({point:e}={}){this.radiusFilter.animPoint=null,this.radiusFilter.point=e,this.$emit("filter-changed"),this.updateScreenPosition(),this.$nextTick(()=>{this.radiusFilter.moving=!1})},routeHoveredOnMap(e){this.mapHoveredDeviceId=e?e.deviceId:null,this.mapHoveredRouteId=e?e.routeId:null,this.mapHoveredPathId=e?e.pathId:null},vehicleHoveredInList(e){this.listHoveredDeviceId=e,this.listHoveredRouteId=null,this.listHoveredPathId=null},vehicleSelected(e){this.selectedDeviceId=e,this.selectedRouteId=null,this.selectedPathId=null},routeHoveredInList(e){this.listHoveredDeviceId=e?e.deviceId:null,this.listHoveredRouteId=e?e.routeId:null,this.listHoveredPathId=null},routeSelected({deviceId:e,routeId:i}={}){this.selectedDeviceId=e,this.selectedRouteId=i,this.selectedPathId=null},pathHoveredInList(e){this.listHoveredDeviceId=e?e.deviceId:null,this.listHoveredRouteId=e?e.routeId:null,this.listHoveredPathId=e?e.pathId:null},pathSelected({deviceId:e,routeId:i,pathId:n}={}){this.selectedDeviceId=e,this.selectedRouteId=i,this.selectedPathId=n},vehicleSelectedOnMap({deviceId:e,routeId:i,pathId:n}={}){const a=p.find(this.radiusFilteredVehicles,{deviceId:e}),s=a&&i?p.find(a.routes,{routeId:i}):null,c=s&&s.paths.length>1;this.selectedDeviceId=e,this.selectedRouteId=i||null,this.selectedPathId=c&&n||null,this.mapVehicleSelection={deviceId:e,token:this.mapVehicleSelection.token+1}},animateRadiusFilter(){const e=this.radiusFilter.point,i=++this.radiusFilter.animToken;if(!e){this.radiusFilter.animRadius=null,this.$emit("filter-changed"),ii(this.mapInstance),this.updateScreenPosition();return}const n=this.radiusFilterTargetRadius,a=900,s=40,c=performance.now();let l=0;const u={onDrag:w=>this.radiusDragged({radius:w}),onDragEnd:w=>this.radiusDragEnded({radius:w}),onMove:w=>this.radiusMoved({point:w}),onMoveEnd:w=>this.radiusMoveEnded({point:w})};bn(this.Leaflet,this.mapInstance,e);const f=w=>{if(i!==this.radiusFilter.animToken)return;const y=Math.min((w-c)/a,1),M=Math.max(n*un(y),.1);this.radiusFilter.animRadius=M,Sn(this.Leaflet,this.mapInstance,e,M,u),this.updateScreenPosition(),(y===1||w-l>=s)&&(l=w,this.$emit("filter-changed")),y<1?requestAnimationFrame(f):this.radiusFilter.animRadius=null};requestAnimationFrame(f)}}},Bn={async deviceSelected(){const e=this.datepicker.date,i=this.treeview.selectedItems;if(!Ni(e))throw console.trace(`Invalid date (${e}), aborting:`),new Error('Invalid "date" provided');this.$refs.rangeSlider.update(e),await this.$nextTick(),this.tooltip.open=!1,this.allFeatures=null,await this.updateLocalFeatureCollection(i,e),await this.$sleep(1),await this.updateLocalFeatureCollection(i,wt(e,{days:1}))},async updateLocalFeatureCollection(e,i){this.fetchingPaths=!0;try{const n=await this.getLocations(e,{date:i,chunkSize:2,organization:this.$organizationId}),a=p.filter(n,"data.features.length"),s={type:"FeatureCollection",features:p.flatMap(a,({device:l,data:u})=>(p.get(u,"features")||[]).map(w=>({...w,properties:{...w.properties,deviceId:l.id,deviceDescription:l.description||l.name||l.id}})))},c=p.get(this.allFeatures,"features");s.features=p.concat(c||[],s.features),this.allFeatures=s.features.length?s:null}catch(n){this.allFeatures=null,console.error("Error fetching device locations:",n.message)}this.allFeatures||(this.noResultsPing=!0),this.fetchingPaths=!1},featurePreprocess(e){const i=this.rangeslider.time;return e=zi({collection:e,timeRange:i}),this.$refs.radiusFilter&&(e=this.$refs.radiusFilter.applyFilters(e)),e.features=this.pathTimeFilter_processLines(e.features),e.features=JSON.parse(JSON.stringify(e.features)),e.features.forEac
192h(n=>{n.properties._style=this.getStyleFromWork(n)}),e.features},pathTimeFilter_processLines(e=[]){return p.flatMap(e,i=>{const n=p.get(i,"geometry.type");if(n==="LineString"||n==="MultiLineString"){const s=p.get(i,"geometry.coordinates"),c=p.get(i,"properties.timestamps"),l=p.get(i,"properties._routeId"),u=p.get(i,"properties._pathId"),f={type:"Feature",properties:{role:"start",timestamps:[p.first(c)],_routeId:l,_pathId:u},geometry:{type:"Point",coordinates:p.first(s)}},w={type:"Feature",properties:{role:"end",timestamps:[p.last(c)],_routeId:l,_pathId:u},geometry:{type:"Point",coordinates:p.last(s)}},y=p.cloneDeep(i);return y.lineStroke=!0,[y,i,f,w]}else return[i]})},getStyleFromWork(e){const i=p.keyBy(p.castArray(e.geometry.type));if(!(i.LineString||i.MultiLineString))return;let n={color:"black",weight:e.lineStroke?6:3};if(p.get(e,"properties.area")&&(n.color="white"),!e.lineStroke&&(n.color="#005ffb"),!this.routeStyles.length)return n;const c=p.get(e,"properties",{}),l=this.routeStyles;p.each(c,(w,y)=>{p.isPlainObject(p.first(w))&&p.some(w,F=>!p.isNil(p.get(F,"id"))&&!p.isNil(p.get(F,"description")))?p.each(w,F=>{u({id:F.id,description:F.description,breadcrumbs:!0})}):u({id:y,description:w})});function u({id:w,description:y}={}){const M=p.find(l,{id:w,description:y});if(!M)return;const E=e.lineStroke?"stroke":"fill",F=p.get(M,"values"),$=p.find(F,{id:E});if(!$)return;const O=p.get($,"values");if(!O){const R=p.get($,"description");f(R)||(n.color=R);return}p.each(O,R=>{const W=p.get(R,"id"),z=p.get(R,"description");f(z)||(n[W]=z)})}function f(w){return p.isNil(w)||p.trim(w)===""}return n},duplicateDataArray(e,i){const n=[st(wt(i,{days:1}),{representation:"date"}),st(i,{representation:"date"})];return p.flatMap(n,a=>e.map(s=>({...s,date:a})))},async getLocations(e,{chunkSize:i=5,date:n,organization:a}={}){if(this.debugDeviceIds&&(e=this.debugDeviceIds),!e.length)return;const s=st(n,{representation:"date"}),c=p.chunk(e,i),l=[];for(const u of c){const f=await Promise.all(u.map(w=>axios.get(`/rest/geoconvert/prodoc.rest.geoconverter.movement_history.${a}/${s},${w.id}`,{timeout:this.$secondsToMs(30)}).then(y=>({device:w,data:y.data}))));l.push(...f)}return l},debug_getCurrentDevices(){const e=this.organizationId;axios.get(`/rest/geoconvert/prodoc.rest.geoconverter.current_devices.${e}/all`).then(i=>{const n=p.get(i,"data.features");let a=p.map(n,"properties.ID");a=p.reject(a,s=>s=="null"),a=p.uniq(a),a=p.compact(a),a=p.map(a,s=>({id:s})),this.debugDeviceIds=a,this.$log.blue(this.debugDeviceIds,"debug devices ids with routes")})},removePathFromLeaflet(){this.$emitter.emit("protieto-map-path-time-filter",{action:"remove",id:this.leafletLayerName})},async debug_getLocalData(){try{this.allFeatures=p.get(await axios.get("/movement-history-2025-01-16-112360.json"),"data"),this.$store.commit("update",{key:"sticky.map.pathFilter.date",value:new Date("2025-01-16").getTime()}),this.renderInLeaflet("add"),setTimeout(()=>{this.$emitter.emit("map-move-to-location",{location:[64.2273,27.7285],zoom:11})},1e3)}catch(e){console.log(e),this.$store.state.devmode&&console.error(e)}}},zn={renderInLeaflet(e){if(e==="remove"){this.pathTimeFilter({action:e,id:this.leafletLayerName});return}const i=this.allFeatures;if(!p.get(i,"features.length"))return;const n=p.clone(i);n.features=this.featurePreprocess(n),this.pathTimeFilter({action:e,collection:n,id:this.leafletLayerName,timeRange:this.rangeslider.time})},throttled_renderInLeaflet:p.throttle(function(e){this.renderInLeaflet(e)},300,{leading:!1,trailing:!0}),pathTimeFilter({action:e={},collection:i,id:n,timeRange:a}={}){switch(e){case"add":this.pathTimeFilter_addFeatures({collection:i,id:n,timeRange:a});break;case"remove":this.pathTimeFilter_removeFeatures(n);break;case"filter":this.pathTimeFilter_showAndHide({collection:i,id:n,timeRange:a});break}},pathTimeFilter_addFeatures({collection:e,id:i,timeRange:n}={}){if(!this.$leaflet||(this.pathTimeFilter_removeFeatures(i),p.some(n,p.isNil)))return;const a=L.geoJSON(e,{customId:i,style:s=>this.$getFeatureStyle(s),onEachFeature:(s,c)=>c.customId=s.customId,pointToLayer:(s,c)=>{if(s.properties.role==="start")return L.circle(c,{radius:2,color:"#22c81d",fillColor:"#22c81d",fillOpacity:1});if(s.properties.role==="end")return L.circle(c,{radius:2,color:"#e93132",fillColor:"#e93132",fillOpacity:1})}}).addTo(this.$leaflet);
192this.$emitter.emit("protieto-map-path-layer-added",{layerName:i,featureLayer:a})},pathTimeFilter_removeFeatures(e){!this.$leaflet||this.$leaflet.eachLayer(i=>{i instanceof L.GeoJSON&&i.options.customId===e&&this.$leaflet.removeLayer(i)})},pathTimeFilter_showAndHide({collection:e,id:i,timeRange:n}={}){if(!this.$leaflet)return;n=p.isPlainObject(n)?n:p.zipObject(["start","end"],n);const a=n.start,s=n.end;let c=null;this.$leaflet.eachLayer(l=>{l instanceof L.GeoJSON&&l.options.customId===i&&(c=l)}),c&&c.eachLayer(l=>{const u=l.feature;l._originalCoords||(l._originalCoords=p.invoke(l,"getLatLngs")),l._originalStroke||(l._originalStroke=p.get(l,"options.stroke")),l._originalFill||(l._originalFill=p.get(l,"options.fill"));const f={coordinates:p.castArray(l._originalCoords),timestamps:p.get(u,"properties.timestamps")},w=p.zip(f.coordinates,f.timestamps),y=p.filter(w,([F,$])=>{if(p.isNil($))return;const O=ke($);return _i(O,{start:new Date(a),end:new Date(s)})}),[M,E]=p.unzip(y);p.get(M,"1")?(l.setLatLngs(l._originalCoords),l.setStyle({stroke:l._originalStroke,fill:l._originalFill})):l.setStyle({stroke:!1,fill:!1})})}},Kn={components:{"range-slider":Ls,"replay-controls":Es,"date-picker":Oi,treeview:$s,"radius-filter":Vn},template:` 193 <div 194 ref="innerWrap" 195 id="path-date-time-filter-app" 196 :class="{ 197 'playing': replay.playing, 198 'has-features-to-filter': hasFeaturesToFilter, 199 'no-features-to-filter': !hasFeaturesToFilter, 200 }" 201 > 202 203 <range-slider 204 ref="rangeSlider" 205 v-model:time="rangeslider.time" 206 v-model:slider="rangeslider.slider" 207 ></range-slider> 208 209 <div class="buttons-wrapper"> 210 211 <div class="mrdf-tooltip-btn-wrapper" v-if="!radiusFilterActive"> 212 <button class="open-tooltip-button" @click="tooltip.open = !tooltip.open"> 213 214 <div class="no-results" v-html="tooltip.button.icon.close" v-if="noResultsPing"></div> 215 <div class="loader" v-html="tooltip.button.icon.spinner" v-else-if="fetchingPaths"></div> 216 <div class="truck" v-html="tooltip.button.icon.truck" v-else></div> 217 218 </button> 219 220 <div 221 class="mrdf-tooltip" 222 ref="tooltip" 223 v-show="tooltip.open" 224 > 225 226 <button class="close-button top" v-html="tooltip.button.icon.close" @click="tooltip.open = false"></button> 227 228 <date-picker v-model:date="datepicker.date"></date-picker> 229 <treeview ref="treeview" v-model:selectedItems="treeview.selectedItems"></treeview> 230 231 <div class="flex-row stretch"> 232 <button class="close-button bottom secondary" @click="tooltip.open = false" v-translate:close></button> 233 <button v-if="treeview.selectedItems.length" class="deselect-button bottom secondary" @click="$refs.treeview.deselectAll()" v-translate:deselect_all></button> 234 <button class="select-button" @click="deviceSelected" :disabled="!treeview.selectedItems.length">{{ $translate('select') }} {{ selectedItemsStr }}</button> 235 </div> 236 237 </div> 238 </div> 239 240 <replay-controls 241 :slider="rangeslider.slider" 242 v-model:time="rangeslider.time" 243 v-model:playing="replay.playing" 244 ></replay-controls> 245 246 </div> 247 248 <radius-filter 249 ref="radiusFilter" 250 v-model:allFeatures="allFeatures" 251 :timeRange="rangeslider.time" 252 @update:point="radiusFilterActive = !!$event" 253 @update:fetching="fetchingPaths = $event" 254 @date-changed="onRadiusFilterDateChanged" 255 @filter-changed="onRadiusFilterChanged" 256 /> 257 258 </div> 259 `,data(){return{rangeslider:{slider:null,time:null,firstChange:!0},tooltip:{button:{icon:{truck:'<svg viewBox="0 0 640 512" width="1.5em" height="1.2em" ><path fill="currentColor" d="M624 352h-16V243.9c0-12.7-5.1-24.9-14.1-33.9L494 110.1c-9-9-21.2-14.1-33.9-14.1H416V48c0-26.5-21.5-48-48-48H48C21.5 0 0 21.5 0 48v320c0 26.5 21.5 48 48 48h16c0 53 43 96 96 96s96-43 96-96h128c0 53 43 96 96 96s96-43 96-96h48c8.8 0 16-7.2 16-16v-32c0-8.8-7.2-16-16-16M160 464c-26.5 0-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48m320 0c-26.5 0-48-21.5-48-48s21.5-48 48-48s48 21.5 48 48s-21.5 48-48 48m80-208H416V144h44.1l99.9 99.9z"/></svg>',spinner:'<svg viewBox="0 0 24 24" width="1.2em" height="1.2em" >
259<path fill="currentColor" d="M12,1A11,11,0,1,0,23,12,11,11,0,0,0,12,1Zm0,19a8,8,0,1,1,8-8A8,8,0,0,1,12,20Z" opacity=".25"/><path fill="currentColor" d="M10.14,1.16a11,11,0,0,0-9,8.92A1.59,1.59,0,0,0,2.46,12,1.52,1.52,0,0,0,4.11,10.7a8,8,0,0,1,6.66-6.61A1.42,1.42,0,0,0,12,2.69h0A1.57,1.57,0,0,0,10.14,1.16Z"><animateTransform attributeName="transform" dur="0.75s" repeatCount="indefinite" type="rotate" values="0 12 12;360 12 12"/></path></svg>',close:'<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" viewBox="0 0 16 16"><path fill="currentColor" d="M15.1 3.1L12.9.9L8 5.9L3.1.9L.9 3.1l5 4.9l-5 4.9l2.2 2.2l4.9-5l4.9 5l2.2-2.2l-5-4.9z" /></svg>'}},open:!1},treeview:{selectedItems:[]},datepicker:{date:null},replay:{playing:!1},allFeatures:null,leafletLayerName:"device-paths",fetchingPaths:!1,noResultsPing:!1,radiusFilterActive:!1}},watch:{"rangeslider.time"(e,i){if(this.rangeslider.firstChange!==!1||this.tooltip.open){this.rangeslider.firstChange=!1;return}p.invoke(this,this.replay.playing?"renderInLeaflet":"throttled_renderInLeaflet","add")},allFeatures(e){this.renderInLeaflet("add"),this.$nextTick(()=>this.updatePipActivity())},fetchingPaths(e){e||this.$nextTick(()=>this.updatePipActivity())},radiusFilterActive(){this.renderInLeaflet("remove"),this.allFeatures=null},noResultsPing(e){!e||setTimeout(()=>{this.noResultsPing=!1},this.$secondsToMs(.4))}},computed:{selectedItemsStr(){const e=this.treeview.selectedItems.length;return e?`(${e})`:""},routeStyles(){const e=p.find(p.get(this.$mapStyles,"values"),{id:"routestyles"});return p.get(e,"values")||[]},hasFeaturesToFilter(){return p.get(this.allFeatures,"features.length")}},beforeUnmount(){this.renderInLeaflet("remove")},methods:{...Bn,...zn,updatePipActivity(){var M,E;const e=(E=(M=this.$refs.rangeSlider)==null?void 0:M.$refs)==null?void 0:E.rangeSlider,i=this.rangeslider.slider;if(!e||!i)return;if(!p.get(this.allFeatures,"features.length")){this.clearPipActivity(e);return}const n=this.getActivityTimeRanges(),a=i.options.step,s=new Set;p.each(n,({startMs:F,endMs:$})=>{if(!isFinite(F)||!isFinite($))return;const O=Math.floor(F/a)*a,R=Math.floor($/a)*a;for(let W=O;W<=R;W+=a)s.add(W)});const c=i.options.range,l=c.min,f=c.max-l,w=e.querySelectorAll(".noUi-value");p.each(w,F=>{const $=Number(F.getAttribute("data-value"));if(isNaN($))return;const O=Math.round($/a)*a;F.classList.toggle("has-route-activity",s.has(O))});const y=e.querySelectorAll(".noUi-marker");p.each(y,F=>{const $=parseFloat(F.style.top||F.style.bottom);if(isNaN($))return;const O=l+$/100*f,R=Math.round(O/a)*a;F.classList.toggle("has-route-activity",s.has(R))})},getActivityTimeRanges(){const e=this.$refs.radiusFilter;if(this.radiusFilterActive&&e){const a=e.selectedDeviceId,s=e.selectedRouteId,c=e.selectedPathId,u=a||s||c?e.radiusFilteredVehicles||[]:e.allRadiusFilteredVehicles||[],f=[];return p.each(u,w=>{a&&String(w.deviceId)!==String(a)||p.each(w.routes,y=>{if(!(s&&y.routeId!==s)){if(c){const M=p.find(y.paths,{pathId:c});M&&f.push({startMs:ke(M.startTime).getTime(),endMs:ke(M.endTime).getTime()});return}f.push({startMs:ke(y.startTime).getTime(),endMs:ke(y.endTime).getTime()})}})}),f}const i=p.get(this.allFeatures,"features")||[],n=[];return p.each(i,a=>{const s=p.get(a,"properties.timestamps");if(!s||!s.length)return;let c=1/0,l=-1/0;p.each(s,u=>{if(p.isNil(u))return;const f=ke(u);if(!f||isNaN(f.getTime()))return;const w=f.getTime();w<c&&(c=w),w>l&&(l=w)}),isFinite(c)&&isFinite(l)&&n.push({startMs:c,endMs:l})}),n},onRadiusFilterChanged(){this.renderInLeaflet("add"),this.throttled_updatePipActivity()},onRadiusFilterDateChanged(e){this.$refs.rangeSlider.update(e),this.updatePipActivity()},throttled_updatePipActivity:p.throttle(function(){this.updatePipActivity()},200,{leading:!1,trailing:!0}),clearPipActivity(e){const i=e.querySelectorAll(".has-route-activity");p.each(i,n=>n.classList.remove("has-route-activity"))}}};export{Kn as default};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.