diff --git a/build_mosaic.sh b/build_mosaic.sh index 812d20a..81aad6a 100755 --- a/build_mosaic.sh +++ b/build_mosaic.sh @@ -1,13 +1,17 @@ #!/bin/bash -weeks_ago="0" +end_date="2024-06-08" +offset=7 data_dir="chemba" # Parse command line arguments for arg in "$@"; do case $arg in - --weeks_ago=*) - weeks_ago="${arg#*=}" + --offset=*) + offset="${arg#*=}" + ;; + --end_date=*) + end_date="${arg#*=}" ;; --data_dir=*) data_dir="${arg#*=}" @@ -20,15 +24,16 @@ for arg in "$@"; do shift done -echo "Weeks ago: $weeks_ago" +echo "offset: $offset" +echo "end_date: $end_date" # Check if required arguments are set -if [ -z "$weeks_ago" ] || [ -z "$data_dir" ]; then - echo "Missing arguments. Use: build_mosiac.sh --weeks_ago=3 --data_dir=chemba" +if [ -z "$end_date" ] || [ -z "$data_dir" ] || [ -z "$offset" ]; then + echo "Missing arguments. Use: build_mosiac.sh --endate=2024-01-01 --offset=7 --data_dir=chemba" exit 1 fi -echo 2_CI_data_prep.R $weeks_ago $data_dir +echo 2_CI_data_prep.R $end_date $offset $data_dir cd ../r_app -Rscript 2_CI_data_prep.R $weeks_ago $data_dir \ No newline at end of file +Rscript 2_CI_data_prep.R $end_date $offset $data_dir \ No newline at end of file diff --git a/laravel_app/app/Jobs/ProjectMosiacGeneratorJob.php b/laravel_app/app/Jobs/ProjectMosiacGeneratorJob.php index 26a15ce..bcdba25 100644 --- a/laravel_app/app/Jobs/ProjectMosiacGeneratorJob.php +++ b/laravel_app/app/Jobs/ProjectMosiacGeneratorJob.php @@ -89,7 +89,7 @@ public function handle(): void $command = [ sprintf('%sbuild_mosaic.sh', $projectFolder), - sprintf('--end_date=%s', $this->mosaic->end_date), + sprintf('--end_date=%s', $this->mosaic->end_date->format('Y-m-d')), sprintf('--offset=%s', $this->mosaic->offset), sprintf('--data_dir=%s', $this->mosaic->project->download_path), ]; diff --git a/laravel_app/public/build/assets/app-a46f5c70.js b/laravel_app/public/build/assets/app-f1d6b98f.js similarity index 91% rename from laravel_app/public/build/assets/app-a46f5c70.js rename to laravel_app/public/build/assets/app-f1d6b98f.js index 0325f6a..d9a0c25 100644 --- a/laravel_app/public/build/assets/app-a46f5c70.js +++ b/laravel_app/public/build/assets/app-f1d6b98f.js @@ -9,7 +9,7 @@ const Xs="modulepreload",Qs=function(s){return"/build/"+s},Bo={},ta=function(a,e * Copyright 2020, Pusher * Released under the MIT licence. */(function(s,a){(function(l,f){s.exports=f()})(window,function(){return function(e){var l={};function f(p){if(l[p])return l[p].exports;var g=l[p]={i:p,l:!1,exports:{}};return e[p].call(g.exports,g,g.exports,f),g.l=!0,g.exports}return f.m=e,f.c=l,f.d=function(p,g,E){f.o(p,g)||Object.defineProperty(p,g,{enumerable:!0,get:E})},f.r=function(p){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(p,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(p,"__esModule",{value:!0})},f.t=function(p,g){if(g&1&&(p=f(p)),g&8||g&4&&typeof p=="object"&&p&&p.__esModule)return p;var E=Object.create(null);if(f.r(E),Object.defineProperty(E,"default",{enumerable:!0,value:p}),g&2&&typeof p!="string")for(var S in p)f.d(E,S,(function(U){return p[U]}).bind(null,S));return E},f.n=function(p){var g=p&&p.__esModule?function(){return p.default}:function(){return p};return f.d(g,"a",g),g},f.o=function(p,g){return Object.prototype.hasOwnProperty.call(p,g)},f.p="",f(f.s=2)}([function(e,l,f){var p=this&&this.__extends||function(){var T=function(R,F){return T=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(V,Q){V.__proto__=Q}||function(V,Q){for(var _t in Q)Q.hasOwnProperty(_t)&&(V[_t]=Q[_t])},T(R,F)};return function(R,F){T(R,F);function V(){this.constructor=R}R.prototype=F===null?Object.create(F):(V.prototype=F.prototype,new V)}}();Object.defineProperty(l,"__esModule",{value:!0});var g=256,E=function(){function T(R){R===void 0&&(R="="),this._paddingCharacter=R}return T.prototype.encodedLength=function(R){return this._paddingCharacter?(R+2)/3*4|0:(R*8+5)/6|0},T.prototype.encode=function(R){for(var F="",V=0;V>>3*6&63),F+=this._encodeByte(Q>>>2*6&63),F+=this._encodeByte(Q>>>1*6&63),F+=this._encodeByte(Q>>>0*6&63)}var _t=R.length-V;if(_t>0){var Q=R[V]<<16|(_t===2?R[V+1]<<8:0);F+=this._encodeByte(Q>>>3*6&63),F+=this._encodeByte(Q>>>2*6&63),_t===2?F+=this._encodeByte(Q>>>1*6&63):F+=this._paddingCharacter||"",F+=this._paddingCharacter||""}return F},T.prototype.maxDecodedLength=function(R){return this._paddingCharacter?R/4*3|0:(R*6+7)/8|0},T.prototype.decodedLength=function(R){return this.maxDecodedLength(R.length-this._getPaddingLength(R))},T.prototype.decode=function(R){if(R.length===0)return new Uint8Array(0);for(var F=this._getPaddingLength(R),V=R.length-F,Q=new Uint8Array(this.maxDecodedLength(V)),_t=0,bt=0,St=0,At=0,Lt=0,Ht=0,jt=0;bt>>4,Q[_t++]=Lt<<4|Ht>>>2,Q[_t++]=Ht<<6|jt,St|=At&g,St|=Lt&g,St|=Ht&g,St|=jt&g;if(bt>>4,St|=At&g,St|=Lt&g),bt>>2,St|=Ht&g),bt>>8&0-65-26+97,F+=51-R>>>8&26-97-52+48,F+=61-R>>>8&52-48-62+43,F+=62-R>>>8&62-43-63+47,String.fromCharCode(F)},T.prototype._decodeChar=function(R){var F=g;return F+=(42-R&R-44)>>>8&-g+R-43+62,F+=(46-R&R-48)>>>8&-g+R-47+63,F+=(47-R&R-58)>>>8&-g+R-48+52,F+=(64-R&R-91)>>>8&-g+R-65+0,F+=(96-R&R-123)>>>8&-g+R-97+26,F},T.prototype._getPaddingLength=function(R){var F=0;if(this._paddingCharacter){for(var V=R.length-1;V>=0&&R[V]===this._paddingCharacter;V--)F++;if(R.length<4||F>2)throw new Error("Base64Coder: incorrect padding")}return F},T}();l.Coder=E;var S=new E;function U(T){return S.encode(T)}l.encode=U;function C(T){return S.decode(T)}l.decode=C;var D=function(T){p(R,T);function R(){return T!==null&&T.apply(this,arguments)||this}return R.prototype._encodeByte=function(F){var V=F;return V+=65,V+=25-F>>>8&0-65-26+97,V+=51-F>>>8&26-97-52+48,V+=61-F>>>8&52-48-62+45,V+=62-F>>>8&62-45-63+95,String.fromCharCode(V)},R.prototype._decodeChar=function(F){var V=g;return V+=(44-F&F-46)>>>8&-g+F-45+62,V+=(94-F&F-96)>>>8&-g+F-95+63,V+=(47-F&F-58)>>>8&-g+F-48+52,V+=(64-F&F-91)>>>8&-g+F-65+0,V+=(96-F&F-123)>>>8&-g+F-97+26,V},R}(E);l.URLSafeCoder=D;var Z=new D;function J(T){return Z.encode(T)}l.encodeURLSafe=J;function I(T){return Z.decode(T)}l.decodeURLSafe=I,l.encodedLength=function(T){return S.encodedLength(T)},l.maxDecodedLength=function(T){return S.maxDecodedLength(T)},l.decodedLength=function(T){return S.decodedLength(T)}},function(e,l,f){Object.defineProperty(l,"__esModule",{value:!0});var p="utf8: invalid string",g="utf8: invalid source encoding";function E(C){for(var D=new Uint8Array(S(C)),Z=0,J=0;J>6,D[Z++]=128|I&63):I<55296?(D[Z++]=224|I>>12,D[Z++]=128|I>>6&63,D[Z++]=128|I&63):(J++,I=(I&1023)<<10,I|=C.charCodeAt(J)&1023,I+=65536,D[Z++]=240|I>>18,D[Z++]=128|I>>12&63,D[Z++]=128|I>>6&63,D[Z++]=128|I&63)}return D}l.encode=E;function S(C){for(var D=0,Z=0;Z=C.length-1)throw new Error(p);Z++,D+=4}else throw new Error(p)}return D}l.encodedLength=S;function U(C){for(var D=[],Z=0;Z=C.length)throw new Error(g);var T=C[++Z];if((T&192)!==128)throw new Error(g);J=(J&31)<<6|T&63,I=128}else if(J<240){if(Z>=C.length-1)throw new Error(g);var T=C[++Z],R=C[++Z];if((T&192)!==128||(R&192)!==128)throw new Error(g);J=(J&15)<<12|(T&63)<<6|R&63,I=2048}else if(J<248){if(Z>=C.length-2)throw new Error(g);var T=C[++Z],R=C[++Z],F=C[++Z];if((T&192)!==128||(R&192)!==128||(F&192)!==128)throw new Error(g);J=(J&15)<<18|(T&63)<<12|(R&63)<<6|F&63,I=65536}else throw new Error(g);if(J=55296&&J<=57343)throw new Error(g);if(J>=65536){if(J>1114111)throw new Error(g);J-=65536,D.push(String.fromCharCode(55296|J>>10)),J=56320|J&1023}}D.push(String.fromCharCode(J))}return D.join("")}l.decode=U},function(e,l,f){e.exports=f(3).default},function(e,l,f){f.r(l);class p{constructor(o,c){this.lastId=0,this.prefix=o,this.name=c}create(o){this.lastId++;var c=this.lastId,_=this.prefix+c,y=this.name+"["+c+"]",M=!1,N=function(){M||(o.apply(null,arguments),M=!0)};return this[c]=N,{number:c,id:_,name:y,callback:N}}remove(o){delete this[o.number]}}var g=new p("_pusher_script_","Pusher.ScriptReceivers"),E={VERSION:"8.4.0-rc2",PROTOCOL:7,wsPort:80,wssPort:443,wsPath:"",httpHost:"sockjs.pusher.com",httpPort:80,httpsPort:443,httpPath:"/pusher",stats_host:"stats.pusher.com",authEndpoint:"/pusher/auth",authTransport:"ajax",activityTimeout:12e4,pongTimeout:3e4,unavailableTimeout:1e4,userAuthentication:{endpoint:"/pusher/user-auth",transport:"ajax"},channelAuthorization:{endpoint:"/pusher/auth",transport:"ajax"},cdn_http:"http://js.pusher.com",cdn_https:"https://js.pusher.com",dependency_suffix:""},S=E;class U{constructor(o){this.options=o,this.receivers=o.receivers||g,this.loading={}}load(o,c,_){var y=this;if(y.loading[o]&&y.loading[o].length>0)y.loading[o].push(_);else{y.loading[o]=[_];var M=X.createScriptRequest(y.getPath(o,c)),N=y.receivers.create(function(j){if(y.receivers.remove(N),y.loading[o]){var it=y.loading[o];delete y.loading[o];for(var ht=function(Tt){Tt||M.cleanup()},dt=0;dt>>6)+kt(128|o&63):kt(224|o>>>12&15)+kt(128|o>>>6&63)+kt(128|o&63)},kn=function(h){return h.replace(/[^\x00-\x7F]/g,ae)},Ut=function(h){var o=[0,2,1][h.length%3],c=h.charCodeAt(0)<<16|(h.length>1?h.charCodeAt(1):0)<<8|(h.length>2?h.charCodeAt(2):0),_=[se.charAt(c>>>18),se.charAt(c>>>12&63),o>=2?"=":se.charAt(c>>>6&63),o>=1?"=":se.charAt(c&63)];return _.join("")},ze=window.btoa||function(h){return h.replace(/[\s\S]{1,3}/g,Ut)};class nt{constructor(o,c,_,y){this.clear=c,this.timer=o(()=>{this.timer&&(this.timer=y(this.timer))},_)}isRunning(){return this.timer!==null}ensureAborted(){this.timer&&(this.clear(this.timer),this.timer=null)}}var $e=nt;function et(h){window.clearTimeout(h)}function gt(h){window.clearInterval(h)}class xt extends $e{constructor(o,c){super(setTimeout,et,o,function(_){return c(),null})}}class Bt extends $e{constructor(o,c){super(setInterval,gt,o,function(_){return c(),_})}}var Ct={now(){return Date.now?Date.now():new Date().valueOf()},defer(h){return new xt(0,h)},method(h,...o){var c=Array.prototype.slice.call(arguments,1);return function(_){return _[h].apply(_,c.concat(arguments))}}},$=Ct;function K(h,...o){for(var c=0;c{window.console&&window.console.log&&window.console.log(o)}}debug(...o){this.log(this.globalLog,o)}warn(...o){this.log(this.globalLogWarn,o)}error(...o){this.log(this.globalLogError,o)}globalLogWarn(o){window.console&&window.console.warn?window.console.warn(o):this.globalLog(o)}globalLogError(o){window.console&&window.console.error?window.console.error(o):this.globalLogWarn(o)}log(o,...c){var _=Vt.apply(this,arguments);Ci.log?Ci.log(_):Ci.logToConsole&&o.bind(this)(_)}}var mt=new En,pn=function(h,o,c,_,y){(c.headers!==void 0||c.headersProvider!=null)&&mt.warn(`To send headers with the ${_.toString()} request, you must use AJAX, rather than JSONP.`);var M=h.nextAuthCallbackID.toString();h.nextAuthCallbackID++;var N=h.getDocument(),j=N.createElement("script");h.auth_callbacks[M]=function(dt){y(null,dt)};var it="Pusher.auth_callbacks['"+M+"']";j.src=c.endpoint+"?callback="+encodeURIComponent(it)+"&"+o;var ht=N.getElementsByTagName("head")[0]||N.documentElement;ht.insertBefore(j,ht.firstChild)},mn=pn;class Mn{constructor(o){this.src=o}send(o){var c=this,_="Error loading "+c.src;c.script=document.createElement("script"),c.script.id=o.id,c.script.src=c.src,c.script.type="text/javascript",c.script.charset="UTF-8",c.script.addEventListener?(c.script.onerror=function(){o.callback(_)},c.script.onload=function(){o.callback(null)}):c.script.onreadystatechange=function(){(c.script.readyState==="loaded"||c.script.readyState==="complete")&&o.callback(null)},c.script.async===void 0&&document.attachEvent&&/opera/i.test(navigator.userAgent)?(c.errorScript=document.createElement("script"),c.errorScript.id=o.id+"_error",c.errorScript.text=o.name+"('"+_+"');",c.script.async=c.errorScript.async=!1):c.script.async=!0;var y=document.getElementsByTagName("head")[0];y.insertBefore(c.script,y.firstChild),c.errorScript&&y.insertBefore(c.errorScript,c.script.nextSibling)}cleanup(){this.script&&(this.script.onload=this.script.onerror=null,this.script.onreadystatechange=null),this.script&&this.script.parentNode&&this.script.parentNode.removeChild(this.script),this.errorScript&&this.errorScript.parentNode&&this.errorScript.parentNode.removeChild(this.errorScript),this.script=null,this.errorScript=null}}class On{constructor(o,c){this.url=o,this.data=c}send(o){if(!this.request){var c=fn(this.data),_=this.url+"/"+o.number+"?"+c;this.request=X.createScriptRequest(_),this.request.send(o)}}cleanup(){this.request&&this.request.cleanup()}}var Dn=function(h,o){return function(c,_){var y="http"+(o?"s":"")+"://",M=y+(h.host||h.options.host)+h.options.path,N=X.createJSONPRequest(M,c),j=X.ScriptReceivers.create(function(it,ht){g.remove(j),N.cleanup(),ht&&ht.host&&(h.host=ht.host),_&&_(it,ht)});N.send(j)}},An={name:"jsonp",getAgent:Dn},In=An;function on(h,o,c){var _=h+(o.useTLS?"s":""),y=o.useTLS?o.hostTLS:o.hostNonTLS;return _+"://"+y+c}function Be(h,o){var c="/app/"+h,_="?protocol="+S.PROTOCOL+"&client=js&version="+S.VERSION+(o?"&"+o:"");return c+_}var vt={getInitial:function(h,o){var c=(o.httpPath||"")+Be(h,"flash=false");return on("ws",o,c)}},_n={getInitial:function(h,o){var c=(o.httpPath||"/pusher")+Be(h);return on("http",o,c)}},be={getInitial:function(h,o){return on("http",o,o.httpPath||"/pusher")},getPath:function(h,o){return Be(h)}};class ri{constructor(){this._callbacks={}}get(o){return this._callbacks[Se(o)]}add(o,c,_){var y=Se(o);this._callbacks[y]=this._callbacks[y]||[],this._callbacks[y].push({fn:c,context:_})}remove(o,c,_){if(!o&&!c&&!_){this._callbacks={};return}var y=o?[Se(o)]:Xe(this._callbacks);c||_?this.removeCallback(y,c,_):this.removeAllCallbacks(y)}removeCallback(o,c,_){Jt(o,function(y){this._callbacks[y]=en(this._callbacks[y]||[],function(M){return c&&c!==M.fn||_&&_!==M.context}),this._callbacks[y].length===0&&delete this._callbacks[y]},this)}removeAllCallbacks(o){Jt(o,function(c){delete this._callbacks[c]},this)}}function Se(h){return"_"+h}class Gt{constructor(o){this.callbacks=new ri,this.global_callbacks=[],this.failThrough=o}bind(o,c,_){return this.callbacks.add(o,c,_),this}bind_global(o){return this.global_callbacks.push(o),this}unbind(o,c,_){return this.callbacks.remove(o,c,_),this}unbind_global(o){return o?(this.global_callbacks=en(this.global_callbacks||[],c=>c!==o),this):(this.global_callbacks=[],this)}unbind_all(){return this.unbind(),this.unbind_global(),this}emit(o,c,_){for(var y=0;y0)for(var y=0;y{this.onError(c),this.changeState("closed")}),!1}return this.bindListeners(),mt.debug("Connecting",{transport:this.name,url:o}),this.changeState("connecting"),!0}close(){return this.socket?(this.socket.close(),!0):!1}send(o){return this.state==="open"?($.defer(()=>{this.socket&&this.socket.send(o)}),!0):!1}ping(){this.state==="open"&&this.supportsPing()&&this.socket.ping()}onOpen(){this.hooks.beforeOpen&&this.hooks.beforeOpen(this.socket,this.hooks.urls.getPath(this.key,this.options)),this.changeState("open"),this.socket.onopen=void 0}onError(o){this.emit("error",{type:"WebSocketError",error:o}),this.timeline.error(this.buildTimelineMessage({error:o.toString()}))}onClose(o){o?this.changeState("closed",{code:o.code,reason:o.reason,wasClean:o.wasClean}):this.changeState("closed"),this.unbindListeners(),this.socket=void 0}onMessage(o){this.emit("message",o)}onActivity(){this.emit("activity")}bindListeners(){this.socket.onopen=()=>{this.onOpen()},this.socket.onerror=o=>{this.onError(o)},this.socket.onclose=o=>{this.onClose(o)},this.socket.onmessage=o=>{this.onMessage(o)},this.supportsPing()&&(this.socket.onactivity=()=>{this.onActivity()})}unbindListeners(){this.socket&&(this.socket.onopen=void 0,this.socket.onerror=void 0,this.socket.onclose=void 0,this.socket.onmessage=void 0,this.supportsPing()&&(this.socket.onactivity=void 0))}changeState(o,c){this.state=o,this.timeline.info(this.buildTimelineMessage({state:o,params:c})),this.emit(o,c)}buildTimelineMessage(o){return K({cid:this.id},o)}}class we{constructor(o){this.hooks=o}isSupported(o){return this.hooks.isSupported(o)}createConnection(o,c,_,y){return new ee(this.hooks,o,c,_,y)}}var oi=new we({urls:vt,handlesActivityChecks:!1,supportsPing:!1,isInitialized:function(){return!!X.getWebSocketAPI()},isSupported:function(){return!!X.getWebSocketAPI()},getSocket:function(h){return X.createWebSocket(h)}}),m={urls:_n,handlesActivityChecks:!1,supportsPing:!0,isInitialized:function(){return!0}},v=K({getSocket:function(h){return X.HTTPFactory.createStreamingSocket(h)}},m),w=K({getSocket:function(h){return X.HTTPFactory.createPollingSocket(h)}},m),k={isSupported:function(){return X.isXHRSupported()}},z=new we(K({},v,k)),H=new we(K({},w,k)),rt={ws:oi,xhr_streaming:z,xhr_polling:H},q=rt,st=new we({file:"sockjs",urls:be,handlesActivityChecks:!0,supportsPing:!1,isSupported:function(){return!0},isInitialized:function(){return window.SockJS!==void 0},getSocket:function(h,o){return new window.SockJS(h,null,{js_path:D.getPath("sockjs",{useTLS:o.useTLS}),ignore_null_origin:o.ignoreNullOrigin})},beforeOpen:function(h,o){h.send(JSON.stringify({path:o}))}}),Y={isSupported:function(h){var o=X.isXDRSupported(h.useTLS);return o}},G=new we(K({},v,Y)),B=new we(K({},w,Y));q.xdr_streaming=G,q.xdr_polling=B,q.sockjs=st;var $t=q;class Ft extends Gt{constructor(){super();var o=this;window.addEventListener!==void 0&&(window.addEventListener("online",function(){o.emit("online")},!1),window.addEventListener("offline",function(){o.emit("offline")},!1))}isOnline(){return window.navigator.onLine===void 0?!0:window.navigator.onLine}}var ke=new Ft;class xe{constructor(o,c,_){this.manager=o,this.transport=c,this.minPingDelay=_.minPingDelay,this.maxPingDelay=_.maxPingDelay,this.pingDelay=void 0}createConnection(o,c,_,y){y=K({},y,{activityTimeout:this.pingDelay});var M=this.transport.createConnection(o,c,_,y),N=null,j=function(){M.unbind("open",j),M.bind("closed",it),N=$.now()},it=ht=>{if(M.unbind("closed",it),ht.code===1002||ht.code===1003)this.manager.reportDeath();else if(!ht.wasClean&&N){var dt=$.now()-N;dt<2*this.maxPingDelay&&(this.manager.reportDeath(),this.pingDelay=Math.max(dt/2,this.minPingDelay))}};return M.bind("open",j),M}isSupported(o){return this.manager.isAlive()&&this.transport.isSupported(o)}}const sn={decodeMessage:function(h){try{var o=JSON.parse(h.data),c=o.data;if(typeof c=="string")try{c=JSON.parse(o.data)}catch{}var _={event:o.event,channel:o.channel,data:c};return o.user_id&&(_.user_id=o.user_id),_}catch(y){throw{type:"MessageParseError",error:y,data:h.data}}},encodeMessage:function(h){return JSON.stringify(h)},processHandshake:function(h){var o=sn.decodeMessage(h);if(o.event==="pusher:connection_established"){if(!o.data.activity_timeout)throw"No activity timeout specified in handshake";return{action:"connected",id:o.data.socket_id,activityTimeout:o.data.activity_timeout*1e3}}else{if(o.event==="pusher:error")return{action:this.getCloseAction(o.data),error:this.getCloseError(o.data)};throw"Invalid handshake"}},getCloseAction:function(h){return h.code<4e3?h.code>=1002&&h.code<=1004?"backoff":null:h.code===4e3?"tls_only":h.code<4100?"refused":h.code<4200?"backoff":h.code<4300?"retry":"refused"},getCloseError:function(h){return h.code!==1e3&&h.code!==1001?{type:"PusherError",data:{code:h.code,message:h.reason||h.message}}:null}};var ne=sn;class Le extends Gt{constructor(o,c){super(),this.id=o,this.transport=c,this.activityTimeout=c.activityTimeout,this.bindListeners()}handlesActivityChecks(){return this.transport.handlesActivityChecks()}send(o){return this.transport.send(o)}send_event(o,c,_){var y={event:o,data:c};return _&&(y.channel=_),mt.debug("Event sent",y),this.send(ne.encodeMessage(y))}ping(){this.transport.supportsPing()?this.transport.ping():this.send_event("pusher:ping",{})}close(){this.transport.close()}bindListeners(){var o={message:_=>{var y;try{y=ne.decodeMessage(_)}catch(M){this.emit("error",{type:"MessageParseError",error:M,data:_.data})}if(y!==void 0){switch(mt.debug("Event recd",y),y.event){case"pusher:error":this.emit("error",{type:"PusherError",data:y.data});break;case"pusher:ping":this.emit("ping");break;case"pusher:pong":this.emit("pong");break}this.emit("message",y)}},activity:()=>{this.emit("activity")},error:_=>{this.emit("error",_)},closed:_=>{c(),_&&_.code&&this.handleCloseEvent(_),this.transport=null,this.emit("closed")}},c=()=>{Wt(o,(_,y)=>{this.transport.unbind(y,_)})};Wt(o,(_,y)=>{this.transport.bind(y,_)})}handleCloseEvent(o){var c=ne.getCloseAction(o),_=ne.getCloseError(o);_&&this.emit("error",_),c&&this.emit(c,{action:c,error:_})}}class Rn{constructor(o,c){this.transport=o,this.callback=c,this.bindListeners()}close(){this.unbindListeners(),this.transport.close()}bindListeners(){this.onMessage=o=>{this.unbindListeners();var c;try{c=ne.processHandshake(o)}catch(_){this.finish("error",{error:_}),this.transport.close();return}c.action==="connected"?this.finish("connected",{connection:new Le(c.id,this.transport),activityTimeout:c.activityTimeout}):(this.finish(c.action,{error:c.error}),this.transport.close())},this.onClosed=o=>{this.unbindListeners();var c=ne.getCloseAction(o)||"backoff",_=ne.getCloseError(o);this.finish(c,{error:_})},this.transport.bind("message",this.onMessage),this.transport.bind("closed",this.onClosed)}unbindListeners(){this.transport.unbind("message",this.onMessage),this.transport.unbind("closed",this.onClosed)}finish(o,c){this.callback(K({transport:this.transport,action:o},c))}}class si{constructor(o,c){this.timeline=o,this.options=c||{}}send(o,c){this.timeline.isEmpty()||this.timeline.send(X.TimelineTransport.getAgent(this,o),c)}}class gn extends Gt{constructor(o,c){super(function(_,y){mt.debug("No callbacks on "+o+" for "+_)}),this.name=o,this.pusher=c,this.subscribed=!1,this.subscriptionPending=!1,this.subscriptionCancelled=!1}authorize(o,c){return c(null,{auth:""})}trigger(o,c){if(o.indexOf("client-")!==0)throw new R("Event '"+o+"' does not start with 'client-'");if(!this.subscribed){var _=I.buildLogSuffix("triggeringClientEvents");mt.warn(`Client event triggered before channel 'subscription_succeeded' event . ${_}`)}return this.pusher.send_event(o,c,this.name)}disconnect(){this.subscribed=!1,this.subscriptionPending=!1}handleEvent(o){var c=o.event,_=o.data;if(c==="pusher_internal:subscription_succeeded")this.handleSubscriptionSucceededEvent(o);else if(c==="pusher_internal:subscription_count")this.handleSubscriptionCountEvent(o);else if(c.indexOf("pusher_internal:")!==0){var y={};this.emit(c,_,y)}}handleSubscriptionSucceededEvent(o){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):this.emit("pusher:subscription_succeeded",o.data)}handleSubscriptionCountEvent(o){o.data.subscription_count&&(this.subscriptionCount=o.data.subscription_count),this.emit("pusher:subscription_count",o.data)}subscribe(){this.subscribed||(this.subscriptionPending=!0,this.subscriptionCancelled=!1,this.authorize(this.pusher.connection.socket_id,(o,c)=>{o?(this.subscriptionPending=!1,mt.error(o.toString()),this.emit("pusher:subscription_error",Object.assign({},{type:"AuthError",error:o.message},o instanceof Lt?{status:o.status}:{}))):this.pusher.send_event("pusher:subscribe",{auth:c.auth,channel_data:c.channel_data,channel:this.name})}))}unsubscribe(){this.subscribed=!1,this.pusher.send_event("pusher:unsubscribe",{channel:this.name})}cancelSubscription(){this.subscriptionCancelled=!0}reinstateSubscription(){this.subscriptionCancelled=!1}}class vn extends gn{authorize(o,c){return this.pusher.config.channelAuthorizer({channelName:this.name,socketId:o},c)}}class ai{constructor(){this.reset()}get(o){return Object.prototype.hasOwnProperty.call(this.members,o)?{id:o,info:this.members[o]}:null}each(o){Wt(this.members,(c,_)=>{o(this.get(_))})}setMyID(o){this.myID=o}onSubscription(o){this.members=o.presence.hash,this.count=o.presence.count,this.me=this.get(this.myID)}addMember(o){return this.get(o.user_id)===null&&this.count++,this.members[o.user_id]=o.user_info,this.get(o.user_id)}removeMember(o){var c=this.get(o.user_id);return c&&(delete this.members[o.user_id],this.count--),c}reset(){this.members={},this.count=0,this.myID=null,this.me=null}}var Nn=function(h,o,c,_){function y(M){return M instanceof c?M:new c(function(N){N(M)})}return new(c||(c=Promise))(function(M,N){function j(dt){try{ht(_.next(dt))}catch(Tt){N(Tt)}}function it(dt){try{ht(_.throw(dt))}catch(Tt){N(Tt)}}function ht(dt){dt.done?M(dt.value):y(dt.value).then(j,it)}ht((_=_.apply(h,o||[])).next())})};class ui extends vn{constructor(o,c){super(o,c),this.members=new ai}authorize(o,c){super.authorize(o,(_,y)=>Nn(this,void 0,void 0,function*(){if(!_)if(y=y,y.channel_data!=null){var M=JSON.parse(y.channel_data);this.members.setMyID(M.user_id)}else if(yield this.pusher.user.signinDonePromise,this.pusher.user.user_data!=null)this.members.setMyID(this.pusher.user.user_data.id);else{let N=I.buildLogSuffix("authorizationEndpoint");mt.error(`Invalid auth response for channel '${this.name}', expected 'channel_data' field. ${N}, or the user should be signed in.`),c("Invalid auth response");return}c(_,y)}))}handleEvent(o){var c=o.event;if(c.indexOf("pusher_internal:")===0)this.handleInternalEvent(o);else{var _=o.data,y={};o.user_id&&(y.user_id=o.user_id),this.emit(c,_,y)}}handleInternalEvent(o){var c=o.event,_=o.data;switch(c){case"pusher_internal:subscription_succeeded":this.handleSubscriptionSucceededEvent(o);break;case"pusher_internal:subscription_count":this.handleSubscriptionCountEvent(o);break;case"pusher_internal:member_added":var y=this.members.addMember(_);this.emit("pusher:member_added",y);break;case"pusher_internal:member_removed":var M=this.members.removeMember(_);M&&this.emit("pusher:member_removed",M);break}}handleSubscriptionSucceededEvent(o){this.subscriptionPending=!1,this.subscribed=!0,this.subscriptionCancelled?this.pusher.unsubscribe(this.name):(this.members.onSubscription(o.data),this.emit("pusher:subscription_succeeded",this.members))}disconnect(){this.members.reset(),super.disconnect()}}var zn=f(1),ci=f(0);class Cr extends vn{constructor(o,c,_){super(o,c),this.key=null,this.nacl=_}authorize(o,c){super.authorize(o,(_,y)=>{if(_){c(_,y);return}let M=y.shared_secret;if(!M){c(new Error(`No shared_secret key in auth payload for encrypted channel: ${this.name}`),null);return}this.key=Object(ci.decode)(M),delete y.shared_secret,c(null,y)})}trigger(o,c){throw new bt("Client events are not currently supported for encrypted channels")}handleEvent(o){var c=o.event,_=o.data;if(c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0){super.handleEvent(o);return}this.handleEncryptedEvent(c,_)}handleEncryptedEvent(o,c){if(!this.key){mt.debug("Received encrypted event before key has been retrieved from the authEndpoint");return}if(!c.ciphertext||!c.nonce){mt.error("Unexpected format for encrypted event, expected object with `ciphertext` and `nonce` fields, got: "+c);return}let _=Object(ci.decode)(c.ciphertext);if(_.length{if(N){mt.error(`Failed to make a request to the authEndpoint: ${j}. Unable to fetch new key, so dropping encrypted event`);return}if(M=this.nacl.secretbox.open(_,y,this.key),M===null){mt.error("Failed to decrypt event with new key. Dropping encrypted event");return}this.emit(o,this.getDataToEmit(M))});return}this.emit(o,this.getDataToEmit(M))}getDataToEmit(o){let c=Object(zn.decode)(o);try{return JSON.parse(c)}catch{return c}}}class Pr extends Gt{constructor(o,c){super(),this.state="initialized",this.connection=null,this.key=o,this.options=c,this.timeline=this.options.timeline,this.usingTLS=this.options.useTLS,this.errorCallbacks=this.buildErrorCallbacks(),this.connectionCallbacks=this.buildConnectionCallbacks(this.errorCallbacks),this.handshakeCallbacks=this.buildHandshakeCallbacks(this.errorCallbacks);var _=X.getNetwork();_.bind("online",()=>{this.timeline.info({netinfo:"online"}),(this.state==="connecting"||this.state==="unavailable")&&this.retryIn(0)}),_.bind("offline",()=>{this.timeline.info({netinfo:"offline"}),this.connection&&this.sendActivityCheck()}),this.updateStrategy()}switchCluster(o){this.key=o,this.updateStrategy(),this.retryIn(0)}connect(){if(!(this.connection||this.runner)){if(!this.strategy.isSupported()){this.updateState("failed");return}this.updateState("connecting"),this.startConnecting(),this.setUnavailableTimer()}}send(o){return this.connection?this.connection.send(o):!1}send_event(o,c,_){return this.connection?this.connection.send_event(o,c,_):!1}disconnect(){this.disconnectInternally(),this.updateState("disconnected")}isUsingTLS(){return this.usingTLS}startConnecting(){var o=(c,_)=>{c?this.runner=this.strategy.connect(0,o):_.action==="error"?(this.emit("error",{type:"HandshakeError",error:_.error}),this.timeline.error({handshakeError:_.error})):(this.abortConnecting(),this.handshakeCallbacks[_.action](_))};this.runner=this.strategy.connect(0,o)}abortConnecting(){this.runner&&(this.runner.abort(),this.runner=null)}disconnectInternally(){if(this.abortConnecting(),this.clearRetryTimer(),this.clearUnavailableTimer(),this.connection){var o=this.abandonConnection();o.close()}}updateStrategy(){this.strategy=this.options.getStrategy({key:this.key,timeline:this.timeline,useTLS:this.usingTLS})}retryIn(o){this.timeline.info({action:"retry",delay:o}),o>0&&this.emit("connecting_in",Math.round(o/1e3)),this.retryTimer=new xt(o||0,()=>{this.disconnectInternally(),this.connect()})}clearRetryTimer(){this.retryTimer&&(this.retryTimer.ensureAborted(),this.retryTimer=null)}setUnavailableTimer(){this.unavailableTimer=new xt(this.options.unavailableTimeout,()=>{this.updateState("unavailable")})}clearUnavailableTimer(){this.unavailableTimer&&this.unavailableTimer.ensureAborted()}sendActivityCheck(){this.stopActivityCheck(),this.connection.ping(),this.activityTimer=new xt(this.options.pongTimeout,()=>{this.timeline.error({pong_timed_out:this.options.pongTimeout}),this.retryIn(0)})}resetActivityCheck(){this.stopActivityCheck(),this.connection&&!this.connection.handlesActivityChecks()&&(this.activityTimer=new xt(this.activityTimeout,()=>{this.sendActivityCheck()}))}stopActivityCheck(){this.activityTimer&&this.activityTimer.ensureAborted()}buildConnectionCallbacks(o){return K({},o,{message:c=>{this.resetActivityCheck(),this.emit("message",c)},ping:()=>{this.send_event("pusher:pong",{})},activity:()=>{this.resetActivityCheck()},error:c=>{this.emit("error",c)},closed:()=>{this.abandonConnection(),this.shouldRetry()&&this.retryIn(1e3)}})}buildHandshakeCallbacks(o){return K({},o,{connected:c=>{this.activityTimeout=Math.min(this.options.activityTimeout,c.activityTimeout,c.connection.activityTimeout||1/0),this.clearUnavailableTimer(),this.setConnection(c.connection),this.socket_id=this.connection.id,this.updateState("connected",{socket_id:this.socket_id})}})}buildErrorCallbacks(){let o=c=>_=>{_.error&&this.emit("error",{type:"WebSocketError",error:_.error}),c(_)};return{tls_only:o(()=>{this.usingTLS=!0,this.updateStrategy(),this.retryIn(0)}),refused:o(()=>{this.disconnect()}),backoff:o(()=>{this.retryIn(1e3)}),retry:o(()=>{this.retryIn(0)})}}setConnection(o){this.connection=o;for(var c in this.connectionCallbacks)this.connection.bind(c,this.connectionCallbacks[c]);this.resetActivityCheck()}abandonConnection(){if(this.connection){this.stopActivityCheck();for(var o in this.connectionCallbacks)this.connection.unbind(o,this.connectionCallbacks[o]);var c=this.connection;return this.connection=null,c}}updateState(o,c){var _=this.state;if(this.state=o,_!==o){var y=o;y==="connected"&&(y+=" with new socket ID "+c.socket_id),mt.debug("State changed",_+" -> "+y),this.timeline.info({state:o,params:c}),this.emit("state_change",{previous:_,current:o}),this.emit(o,c)}}shouldRetry(){return this.state==="connecting"||this.state==="connected"}}class Tr{constructor(){this.channels={}}add(o,c){return this.channels[o]||(this.channels[o]=Sr(o,c)),this.channels[o]}all(){return Qe(this.channels)}find(o){return this.channels[o]}remove(o){var c=this.channels[o];return delete this.channels[o],c}disconnect(){Wt(this.channels,function(o){o.disconnect()})}}function Sr(h,o){if(h.indexOf("private-encrypted-")===0){if(o.config.nacl)return Xt.createEncryptedChannel(h,o,o.config.nacl);let c="Tried to subscribe to a private-encrypted- channel but no nacl implementation available",_=I.buildLogSuffix("encryptedChannelSupport");throw new bt(`${c}. ${_}`)}else{if(h.indexOf("private-")===0)return Xt.createPrivateChannel(h,o);if(h.indexOf("presence-")===0)return Xt.createPresenceChannel(h,o);if(h.indexOf("#")===0)throw new F('Cannot create a channel with name "'+h+'".');return Xt.createChannel(h,o)}}var hi={createChannels(){return new Tr},createConnectionManager(h,o){return new Pr(h,o)},createChannel(h,o){return new gn(h,o)},createPrivateChannel(h,o){return new vn(h,o)},createPresenceChannel(h,o){return new ui(h,o)},createEncryptedChannel(h,o,c){return new Cr(h,o,c)},createTimelineSender(h,o){return new si(h,o)},createHandshake(h,o){return new Rn(h,o)},createAssistantToTheTransportManager(h,o,c){return new xe(h,o,c)}},Xt=hi;class li{constructor(o){this.options=o||{},this.livesLeft=this.options.lives||1/0}getAssistant(o){return Xt.createAssistantToTheTransportManager(this,o,{minPingDelay:this.options.minPingDelay,maxPingDelay:this.options.maxPingDelay})}isAlive(){return this.livesLeft>0}reportDeath(){this.livesLeft-=1}}class Ee{constructor(o,c){this.strategies=o,this.loop=!!c.loop,this.failFast=!!c.failFast,this.timeout=c.timeout,this.timeoutLimit=c.timeoutLimit}isSupported(){return Te(this.strategies,$.method("isSupported"))}connect(o,c){var _=this.strategies,y=0,M=this.timeout,N=null,j=(it,ht)=>{ht?c(null,ht):(y=y+1,this.loop&&(y=y%_.length),y<_.length?(M&&(M=M*2,this.timeoutLimit&&(M=Math.min(M,this.timeoutLimit))),N=this.tryStrategy(_[y],o,{timeout:M,failFast:this.failFast},j)):c(!0))};return N=this.tryStrategy(_[y],o,{timeout:M,failFast:this.failFast},j),{abort:function(){N.abort()},forceMinPriority:function(it){o=it,N&&N.forceMinPriority(it)}}}tryStrategy(o,c,_,y){var M=null,N=null;return _.timeout>0&&(M=new xt(_.timeout,function(){N.abort(),y(!0)})),N=o.connect(c,function(j,it){j&&M&&M.isRunning()&&!_.failFast||(M&&M.ensureAborted(),y(j,it))}),{abort:function(){M&&M.ensureAborted(),N.abort()},forceMinPriority:function(j){N.forceMinPriority(j)}}}}class Fe{constructor(o){this.strategies=o}isSupported(){return Te(this.strategies,$.method("isSupported"))}connect(o,c){return lt(this.strategies,o,function(_,y){return function(M,N){if(y[_].error=M,M){wt(y)&&c(!0);return}Jt(y,function(j){j.forceMinPriority(N.transport.priority)}),c(null,N)}})}}function lt(h,o,c){var _=tn(h,function(y,M,N,j){return y.connect(o,c(M,j))});return{abort:function(){Jt(_,Bn)},forceMinPriority:function(y){Jt(_,function(M){M.forceMinPriority(y)})}}}function wt(h){return rn(h,function(o){return!!o.error})}function Bn(h){!h.error&&!h.aborted&&(h.abort(),h.aborted=!0)}class an{constructor(o,c,_){this.strategy=o,this.transports=c,this.ttl=_.ttl||1800*1e3,this.usingTLS=_.useTLS,this.timeline=_.timeline}isSupported(){return this.strategy.isSupported()}connect(o,c){var _=this.usingTLS,y=fi(_),M=y&&y.cacheSkipCount?y.cacheSkipCount:0,N=[this.strategy];if(y&&y.timestamp+this.ttl>=$.now()){var j=this.transports[y.transport];j&&(["ws","wss"].includes(y.transport)||M>3?(this.timeline.info({cached:!0,transport:y.transport,latency:y.latency}),N.push(new Ee([j],{timeout:y.latency*2+1e3,failFast:!0}))):M++)}var it=$.now(),ht=N.pop().connect(o,function dt(Tt,cn){Tt?(Pt(_),N.length>0?(it=$.now(),ht=N.pop().connect(o,dt)):c(Tt)):(at(_,cn.transport.name,$.now()-it,M),c(null,cn))});return{abort:function(){ht.abort()},forceMinPriority:function(dt){o=dt,ht&&ht.forceMinPriority(dt)}}}}function Me(h){return"pusherTransport"+(h?"TLS":"NonTLS")}function fi(h){var o=X.getLocalStorage();if(o)try{var c=o[Me(h)];if(c)return JSON.parse(c)}catch{Pt(h)}return null}function at(h,o,c,_){var y=X.getLocalStorage();if(y)try{y[Me(h)]=ye({timestamp:$.now(),transport:o,latency:c,cacheSkipCount:_})}catch{}}function Pt(h){var o=X.getLocalStorage();if(o)try{delete o[Me(h)]}catch{}}class un{constructor(o,{delay:c}){this.strategy=o,this.options={delay:c}}isSupported(){return this.strategy.isSupported()}connect(o,c){var _=this.strategy,y,M=new xt(this.options.delay,function(){y=_.connect(o,c)});return{abort:function(){M.ensureAborted(),y&&y.abort()},forceMinPriority:function(N){o=N,y&&y.forceMinPriority(N)}}}}class Oe{constructor(o,c,_){this.test=o,this.trueBranch=c,this.falseBranch=_}isSupported(){var o=this.test()?this.trueBranch:this.falseBranch;return o.isSupported()}connect(o,c){var _=this.test()?this.trueBranch:this.falseBranch;return _.connect(o,c)}}class ie{constructor(o){this.strategy=o}isSupported(){return this.strategy.isSupported()}connect(o,c){var _=this.strategy.connect(o,function(y,M){M&&_.abort(),c(y,M)});return _}}function yn(h){return function(){return h.isSupported()}}var Fn=function(h,o,c){var _={};function y(Tn,Fr,Ae,Vn,Zr){var Jn=c(h,Tn,Fr,Ae,Vn,Zr);return _[Tn]=Jn,Jn}var M=Object.assign({},o,{hostNonTLS:h.wsHost+":"+h.wsPort,hostTLS:h.wsHost+":"+h.wssPort,httpPath:h.wsPath}),N=Object.assign({},M,{useTLS:!0}),j=Object.assign({},o,{hostNonTLS:h.httpHost+":"+h.httpPort,hostTLS:h.httpHost+":"+h.httpsPort,httpPath:h.httpPath}),it={loop:!0,timeout:15e3,timeoutLimit:6e4},ht=new li({minPingDelay:1e4,maxPingDelay:h.activityTimeout}),dt=new li({lives:2,minPingDelay:1e4,maxPingDelay:h.activityTimeout}),Tt=y("ws","ws",3,M,ht),cn=y("wss","ws",3,N,ht),zr=y("sockjs","sockjs",1,j),Vi=y("xhr_streaming","xhr_streaming",1,j,dt),Ji=y("xdr_streaming","xdr_streaming",1,j,dt),Gi=y("xhr_polling","xhr_polling",1,j),ce=y("xdr_polling","xdr_polling",1,j),We=new Ee([Tt],it),Br=new Ee([cn],it),Pe=new Ee([zr],it),Ki=new Ee([new Oe(yn(Vi),Vi,Ji)],it),qe=new Ee([new Oe(yn(Gi),Gi,ce)],it),$i=new Ee([new Oe(yn(Ki),new Fe([Ki,new un(qe,{delay:4e3})]),qe)],it),Ye=new Oe(yn($i),$i,Pe),Yn;return o.useTLS?Yn=new Fe([We,new un(Ye,{delay:2e3})]):Yn=new Fe([We,new un(Br,{delay:2e3}),new un(Ye,{delay:5e3})]),new an(new ie(new Oe(yn(Tt),Yn,Ye)),_,{ttl:18e5,timeline:o.timeline,useTLS:o.useTLS})},Ze=Fn,Et=function(){var h=this;h.timeline.info(h.buildTimelineMessage({transport:h.name+(h.options.useTLS?"s":"")})),h.hooks.isInitialized()?h.changeState("initialized"):h.hooks.file?(h.changeState("initializing"),D.load(h.hooks.file,{useTLS:h.options.useTLS},function(o,c){h.hooks.isInitialized()?(h.changeState("initialized"),c(!0)):(o&&h.onError(o),h.onClose(),c(!1))})):h.onClose()},He={getRequest:function(h){var o=new window.XDomainRequest;return o.ontimeout=function(){h.emit("error",new V),h.close()},o.onerror=function(c){h.emit("error",c),h.close()},o.onprogress=function(){o.responseText&&o.responseText.length>0&&h.onChunk(200,o.responseText)},o.onload=function(){o.responseText&&o.responseText.length>0&&h.onChunk(200,o.responseText),h.emit("finished",200),h.close()},o},abortRequest:function(h){h.ontimeout=h.onerror=h.onprogress=h.onload=null,h.abort()}},bn=He;const wn=256*1024;class di extends Gt{constructor(o,c,_){super(),this.hooks=o,this.method=c,this.url=_}start(o){this.position=0,this.xhr=this.hooks.getRequest(this),this.unloader=()=>{this.close()},X.addUnloadListener(this.unloader),this.xhr.open(this.method,this.url,!0),this.xhr.setRequestHeader&&this.xhr.setRequestHeader("Content-Type","application/json"),this.xhr.send(o)}close(){this.unloader&&(X.removeUnloadListener(this.unloader),this.unloader=null),this.xhr&&(this.hooks.abortRequest(this.xhr),this.xhr=null)}onChunk(o,c){for(;;){var _=this.advanceBuffer(c);if(_)this.emit("chunk",{status:o,data:_});else break}this.isBufferTooLong(c)&&this.emit("buffer_too_long")}advanceBuffer(o){var c=o.slice(this.position),_=c.indexOf(` -`);return _!==-1?(this.position+=_+1,c.slice(0,_)):null}isBufferTooLong(o){return this.position===o.length&&o.length>wn}}var je;(function(h){h[h.CONNECTING=0]="CONNECTING",h[h.OPEN=1]="OPEN",h[h.CLOSED=3]="CLOSED"})(je||(je={}));var Ce=je,pi=1;class Zn{constructor(o,c){this.hooks=o,this.session=Hn(1e3)+"/"+kr(8),this.location=mi(c),this.readyState=Ce.CONNECTING,this.openStream()}send(o){return this.sendRaw(JSON.stringify([o]))}ping(){this.hooks.sendHeartbeat(this)}close(o,c){this.onClose(o,c,!0)}sendRaw(o){if(this.readyState===Ce.OPEN)try{return X.createSocketRequest("POST",xn(_i(this.location,this.session))).start(o),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(o,c,_){this.closeStream(),this.readyState=Ce.CLOSED,this.onclose&&this.onclose({code:o,reason:c,wasClean:_})}onChunk(o){if(o.status===200){this.readyState===Ce.OPEN&&this.onActivity();var c,_=o.data.slice(0,1);switch(_){case"o":c=JSON.parse(o.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(o.data.slice(1)||"[]");for(var y=0;y{this.onChunk(o)}),this.stream.bind("finished",o=>{this.hooks.onFinished(this,o)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(o){$.defer(()=>{this.onError(o),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function mi(h){var o=/([^\?]*)\/*(\??.*)/.exec(h);return{base:o[1],queryString:o[2]}}function _i(h,o){return h.base+"/"+o+"/xhr_send"}function xn(h){var o=h.indexOf("?")===-1?"?":"&";return h+o+"t="+ +new Date+"&n="+pi++}function Ri(h,o){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(h);return c[1]+o+c[3]}function Hn(h){return X.randomInt(h)}function kr(h){for(var o=[],c=0;c0&&h.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&h.onChunk(c.status,c.responseText),h.emit("finished",c.status),h.close();break}},c},abortRequest:function(h){h.onreadystatechange=null,h.abort()}},yi=vi,Ue={createStreamingSocket(h){return this.createSocket(yt,h)},createPollingSocket(h){return this.createSocket(gi,h)},createSocket(h,o){return new ot(h,o)},createXHR(h,o){return this.createRequest(yi,h,o)},createRequest(h,o,c){return new di(h,o,c)}},jn=Ue;jn.createXDR=function(h,o){return this.createRequest(bn,h,o)};var Cn=jn,Rt={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:g,DependenciesReceivers:C,getDefaultStrategy:Ze,Transports:$t,transportConnectionInitializer:Et,HTTPFactory:Cn,TimelineTransport:In,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(h){window.Pusher=h;var o=()=>{this.onDocumentBody(h.ready)};window.JSON?o():D.load("json2",{},o)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:jt,jsonp:mn}},onDocumentBody(h){document.body?h():setTimeout(()=>{this.onDocumentBody(h)},0)},createJSONPRequest(h,o){return new On(h,o)},createScriptRequest(h){return new Mn(h)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var h=this.getXHRAPI();return new h},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return ke},createWebSocket(h){var o=this.getWebSocketAPI();return new o(h)},createSocketRequest(h,o){if(this.isXHRSupported())return this.HTTPFactory.createXHR(h,o);if(this.isXDRSupported(o.indexOf("https:")===0))return this.HTTPFactory.createXDR(h,o);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var h=this.getXHRAPI();return!!h&&new h().withCredentials!==void 0},isXDRSupported(h){var o=h?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===o},addUnloadListener(h){window.addEventListener!==void 0?window.addEventListener("unload",h,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",h)},removeUnloadListener(h){window.addEventListener!==void 0?window.removeEventListener("unload",h,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",h)},randomInt(h){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*h)}},X=Rt,Un;(function(h){h[h.ERROR=3]="ERROR",h[h.INFO=6]="INFO",h[h.DEBUG=7]="DEBUG"})(Un||(Un={}));var Pn=Un;class Lr{constructor(o,c,_){this.key=o,this.session=c,this.events=[],this.options=_||{},this.sent=0,this.uniqueID=0}log(o,c){o<=this.options.level&&(this.events.push(K({},c,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(o){this.log(Pn.ERROR,o)}info(o){this.log(Pn.INFO,o)}debug(o){this.log(Pn.DEBUG,o)}isEmpty(){return this.events.length===0}send(o,c){var _=K({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],o(_,(y,M)=>{y||this.sent++,c&&c(y,M)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class zi{constructor(o,c,_,y){this.name=o,this.priority=c,this.transport=_,this.options=y||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(o,c){if(this.isSupported()){if(this.priority{_||(dt(),M?M.close():y.close())},forceMinPriority:Tt=>{_||this.priority{var c="socket_id="+encodeURIComponent(h.socketId);for(var _ in o.params)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(o.params[_]);if(o.paramsProvider!=null){let y=o.paramsProvider();for(var _ in y)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(y[_])}return c};var Fi=h=>{if(typeof X.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(o,c)=>{const _=ue(o,h);X.getAuthorizers()[h.transport](X,_,h,T.UserAuthentication,c)}};const Or=(h,o)=>{var c="socket_id="+encodeURIComponent(h.socketId);c+="&channel_name="+encodeURIComponent(h.channelName);for(var _ in o.params)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(o.params[_]);if(o.paramsProvider!=null){let y=o.paramsProvider();for(var _ in y)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(y[_])}return c};var Dr=h=>{if(typeof X.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(o,c)=>{const _=Or(o,h);X.getAuthorizers()[h.transport](X,_,h,T.ChannelAuthorization,c)}};const Hi=(h,o,c)=>{const _={authTransport:o.transport,authEndpoint:o.endpoint,auth:{params:o.params,headers:o.headers}};return(y,M)=>{const N=h.channel(y.channelName);c(N,_).authorize(y.socketId,M)}};function ji(h,o){let c={activityTimeout:h.activityTimeout||S.activityTimeout,cluster:h.cluster,httpPath:h.httpPath||S.httpPath,httpPort:h.httpPort||S.httpPort,httpsPort:h.httpsPort||S.httpsPort,pongTimeout:h.pongTimeout||S.pongTimeout,statsHost:h.statsHost||S.stats_host,unavailableTimeout:h.unavailableTimeout||S.unavailableTimeout,wsPath:h.wsPath||S.wsPath,wsPort:h.wsPort||S.wsPort,wssPort:h.wssPort||S.wssPort,enableStats:Rr(h),httpHost:Ar(h),useTLS:me(h),wsHost:bi(h),userAuthenticator:De(h),channelAuthorizer:Wi(h,o)};return"disabledTransports"in h&&(c.disabledTransports=h.disabledTransports),"enabledTransports"in h&&(c.enabledTransports=h.enabledTransports),"ignoreNullOrigin"in h&&(c.ignoreNullOrigin=h.ignoreNullOrigin),"timelineParams"in h&&(c.timelineParams=h.timelineParams),"nacl"in h&&(c.nacl=h.nacl),c}function Ar(h){return h.httpHost?h.httpHost:h.cluster?`sockjs-${h.cluster}.pusher.com`:S.httpHost}function bi(h){return h.wsHost?h.wsHost:Ir(h.cluster)}function Ir(h){return`ws-${h}.pusher.com`}function me(h){return X.getProtocol()==="https:"?!0:h.forceTLS!==!1}function Rr(h){return"enableStats"in h?h.enableStats:"disableStats"in h?!h.disableStats:!1}const wi=h=>"customHandler"in h&&h.customHandler!=null;function De(h){const o=Object.assign(Object.assign({},S.userAuthentication),h.userAuthentication);return wi(o)?o.customHandler:Fi(o)}function Ui(h,o){let c;if("channelAuthorization"in h)c=Object.assign(Object.assign({},S.channelAuthorization),h.channelAuthorization);else if(c={transport:h.authTransport||S.authTransport,endpoint:h.authEndpoint||S.authEndpoint},"auth"in h&&("params"in h.auth&&(c.params=h.auth.params),"headers"in h.auth&&(c.headers=h.auth.headers)),"authorizer"in h)return{customHandler:Hi(o,c,h.authorizer)};return c}function Wi(h,o){const c=Ui(h,o);return wi(c)?c.customHandler:Dr(c)}class xi extends Gt{constructor(o){super(function(c,_){mt.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=o,this.bindWatchlistInternalEvent()}handleEvent(o){o.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",o=>{var c=o.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(o)})}}function Nr(){let h,o;return{promise:new Promise((_,y)=>{h=_,o=y}),resolve:h,reject:o}}var qi=Nr;class Yi extends Gt{constructor(o){super(function(c,_){mt.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,_)=>{if(c){mt.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:_.auth,user_data:_.user_data})},this.pusher=o,this.pusher.connection.bind("state_change",({previous:c,current:_})=>{c!=="connected"&&_==="connected"&&this._signin(),c==="connected"&&_!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new xi(o),this.pusher.connection.bind("message",c=>{var _=c.event;_==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(o){try{this.user_data=JSON.parse(o.user_data)}catch{mt.error(`Failed parsing user data after signin: ${o.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){mt.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const o=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new gn(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,_)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,_)}),o(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:o,resolve:c,reject:_}=qi();o.done=!1;const y=()=>{o.done=!0};o.then(y).catch(y),this.signinDonePromise=o,this._signinDoneResolve=c}}class Nt{static ready(){Nt.isReady=!0;for(var o=0,c=Nt.instances.length;oX.getDefaultStrategy(this.config,y,Bi);this.connection=Xt.createConnectionManager(this.key,{getStrategy:_,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",y=>{var M=y.event,N=M.indexOf("pusher_internal:")===0;if(y.channel){var j=this.channel(y.channel);j&&j.handleEvent(y)}N||this.global_emitter.emit(y.event,y.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",y=>{mt.warn(y)}),Nt.instances.push(this),this.timeline.info({instances:Nt.instances.length}),this.user=new Yi(this),Nt.isReady&&this.connect()}switchCluster(o){const{appKey:c,cluster:_}=o;this.key=c,this.options=Object.assign(Object.assign({},this.options),{cluster:_}),this.config=ji(this.options,this),this.connection.switchCluster(this.key)}channel(o){return this.channels.find(o)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var o=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new Bt(6e4,function(){c.send(o)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(o,c,_){return this.global_emitter.bind(o,c,_),this}unbind(o,c,_){return this.global_emitter.unbind(o,c,_),this}bind_global(o){return this.global_emitter.bind_global(o),this}unbind_global(o){return this.global_emitter.unbind_global(o),this}unbind_all(o){return this.global_emitter.unbind_all(),this}subscribeAll(){var o;for(o in this.channels.channels)this.channels.channels.hasOwnProperty(o)&&this.subscribe(o)}subscribe(o){var c=this.channels.add(o,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(o){var c=this.channels.find(o);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(o),c&&c.subscribed&&c.unsubscribe())}send_event(o,c,_){return this.connection.send_event(o,c,_)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Nt.instances=[],Nt.isReady=!1,Nt.logToConsole=!1,Nt.Runtime=X,Nt.ScriptReceivers=X.ScriptReceivers,Nt.DependenciesReceivers=X.DependenciesReceivers,Nt.auth_callbacks=X.auth_callbacks;var Ci=l.default=Nt;function Pi(h){if(h==null)throw"You must pass your app key when you instantiate Pusher."}X.setup(Nt)}])})})(Ts);var Mu=Ts.exports;const Ou=Eu(Mu);window.Pusher=Ou;window.Echo=new ku({broadcaster:"reverb",key:"9rnhjstdgjdjyxymmj1k",wsHost:"smartcane.sobit.nl",wsPort:"8080",wssPort:"8080",forceTLS:!0,enabledTransports:["ws","wss"]});window.axios=_u;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var Gr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Qn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(s){return typeof console<"u"&&console.warn(s)},getWeek:function(s){var a=new Date(s.getTime());a.setHours(0,0,0,0),a.setDate(a.getDate()+3-(a.getDay()+6)%7);var e=new Date(a.getFullYear(),0,4);return 1+Math.round(((a.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Di={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(s){var a=s%100;if(a>3&&a<21)return"th";switch(a%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},oe=function(s,a){return a===void 0&&(a=2),("000"+s).slice(a*-1)},ge=function(s){return s===!0?1:0};function Qo(s,a){var e;return function(){var l=this,f=arguments;clearTimeout(e),e=setTimeout(function(){return s.apply(l,f)},a)}}var Kr=function(s){return s instanceof Array?s:[s]};function te(s,a,e){if(e===!0)return s.classList.add(a);s.classList.remove(a)}function pt(s,a,e){var l=window.document.createElement(s);return a=a||"",e=e||"",l.className=a,e!==void 0&&(l.textContent=e),l}function ar(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function Ss(s,a){if(a(s))return s;if(s.parentNode)return Ss(s.parentNode,a)}function ur(s,a){var e=pt("div","numInputWrapper"),l=pt("input","numInput "+s),f=pt("span","arrowUp"),p=pt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?l.type="number":(l.type="text",l.pattern="\\d*"),a!==void 0)for(var g in a)l.setAttribute(g,a[g]);return e.appendChild(l),e.appendChild(f),e.appendChild(p),e}function he(s){try{if(typeof s.composedPath=="function"){var a=s.composedPath();return a[0]}return s.target}catch{return s.target}}var $r=function(){},_r=function(s,a,e){return e.months[a?"shorthand":"longhand"][s]},Du={D:$r,F:function(s,a,e){s.setMonth(e.months.longhand.indexOf(a))},G:function(s,a){s.setHours((s.getHours()>=12?12:0)+parseFloat(a))},H:function(s,a){s.setHours(parseFloat(a))},J:function(s,a){s.setDate(parseFloat(a))},K:function(s,a,e){s.setHours(s.getHours()%12+12*ge(new RegExp(e.amPM[1],"i").test(a)))},M:function(s,a,e){s.setMonth(e.months.shorthand.indexOf(a))},S:function(s,a){s.setSeconds(parseFloat(a))},U:function(s,a){return new Date(parseFloat(a)*1e3)},W:function(s,a,e){var l=parseInt(a),f=new Date(s.getFullYear(),0,2+(l-1)*7,0,0,0,0);return f.setDate(f.getDate()-f.getDay()+e.firstDayOfWeek),f},Y:function(s,a){s.setFullYear(parseFloat(a))},Z:function(s,a){return new Date(a)},d:function(s,a){s.setDate(parseFloat(a))},h:function(s,a){s.setHours((s.getHours()>=12?12:0)+parseFloat(a))},i:function(s,a){s.setMinutes(parseFloat(a))},j:function(s,a){s.setDate(parseFloat(a))},l:$r,m:function(s,a){s.setMonth(parseFloat(a)-1)},n:function(s,a){s.setMonth(parseFloat(a)-1)},s:function(s,a){s.setSeconds(parseFloat(a))},u:function(s,a){return new Date(parseFloat(a))},w:$r,y:function(s,a){s.setFullYear(2e3+parseFloat(a))}},Sn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Ei={Z:function(s){return s.toISOString()},D:function(s,a,e){return a.weekdays.shorthand[Ei.w(s,a,e)]},F:function(s,a,e){return _r(Ei.n(s,a,e)-1,!1,a)},G:function(s,a,e){return oe(Ei.h(s,a,e))},H:function(s){return oe(s.getHours())},J:function(s,a){return a.ordinal!==void 0?s.getDate()+a.ordinal(s.getDate()):s.getDate()},K:function(s,a){return a.amPM[ge(s.getHours()>11)]},M:function(s,a){return _r(s.getMonth(),!0,a)},S:function(s){return oe(s.getSeconds())},U:function(s){return s.getTime()/1e3},W:function(s,a,e){return e.getWeek(s)},Y:function(s){return oe(s.getFullYear(),4)},d:function(s){return oe(s.getDate())},h:function(s){return s.getHours()%12?s.getHours()%12:12},i:function(s){return oe(s.getMinutes())},j:function(s){return s.getDate()},l:function(s,a){return a.weekdays.longhand[s.getDay()]},m:function(s){return oe(s.getMonth()+1)},n:function(s){return s.getMonth()+1},s:function(s){return s.getSeconds()},u:function(s){return s.getTime()},w:function(s){return s.getDay()},y:function(s){return String(s.getFullYear()).substring(2)}},ks=function(s){var a=s.config,e=a===void 0?Qn:a,l=s.l10n,f=l===void 0?Di:l,p=s.isMobile,g=p===void 0?!1:p;return function(E,S,U){var C=U||f;return e.formatDate!==void 0&&!g?e.formatDate(E,S,C):S.split("").map(function(D,Z,J){return Ei[D]&&J[Z-1]!=="\\"?Ei[D](E,C,e):D!=="\\"?D:""}).join("")}},ao=function(s){var a=s.config,e=a===void 0?Qn:a,l=s.l10n,f=l===void 0?Di:l;return function(p,g,E,S){if(!(p!==0&&!p)){var U=S||f,C,D=p;if(p instanceof Date)C=new Date(p.getTime());else if(typeof p!="string"&&p.toFixed!==void 0)C=new Date(p);else if(typeof p=="string"){var Z=g||(e||Qn).dateFormat,J=String(p).trim();if(J==="today")C=new Date,E=!0;else if(e&&e.parseDate)C=e.parseDate(p,Z);else if(/Z$/.test(J)||/GMT$/.test(J))C=new Date(p);else{for(var I=void 0,T=[],R=0,F=0,V="";RMath.min(a,e)&&s=0?new Date:new Date(e.config.minDate.getTime()),w=Qr(e.config);v.setHours(w.hours,w.minutes,w.seconds,v.getMilliseconds()),e.selectedDates=[v],e.latestSelectedDateObj=v}m!==void 0&&m.type!=="blur"&&oi(m);var k=e._input.value;D(),ee(),e._input.value!==k&&e._debouncedChange()}function U(m,v){return m%12+12*ge(v===e.l10n.amPM[1])}function C(m){switch(m%24){case 0:case 12:return 12;default:return m%12}}function D(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var m=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,v=(parseInt(e.minuteElement.value,10)||0)%60,w=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(m=U(m,e.amPM.textContent));var k=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&le(e.latestSelectedDateObj,e.config.minDate,!0)===0,z=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&le(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var H=Xr(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),rt=Xr(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),q=Xr(m,v,w);if(q>rt&&q=12)]),e.secondElement!==void 0&&(e.secondElement.value=oe(w)))}function I(m){var v=he(m),w=parseInt(v.value)+(m.delta||0);(w/1e3>1||m.key==="Enter"&&!/[^\d]/.test(w.toString()))&&Vt(w)}function T(m,v,w,k){if(v instanceof Array)return v.forEach(function(z){return T(m,z,w,k)});if(m instanceof Array)return m.forEach(function(z){return T(z,v,w,k)});m.addEventListener(v,w,k),e._handlers.push({remove:function(){return m.removeEventListener(v,w,k)}})}function R(){vt("onChange")}function F(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(w){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+w+"]"),function(k){return T(k,"click",e[w])})}),e.isMobile){on();return}var m=Qo(tn,50);if(e._debouncedChange=Qo(R,Nu),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&T(e.daysContainer,"mouseover",function(w){e.config.mode==="range"&&Jt(he(w))}),T(e._input,"keydown",Qe),e.calendarContainer!==void 0&&T(e.calendarContainer,"keydown",Qe),!e.config.inline&&!e.config.static&&T(window,"resize",m),window.ontouchstart!==void 0?T(window.document,"touchstart",K):T(window.document,"mousedown",K),T(window.document,"focus",K,{capture:!0}),e.config.clickOpens===!0&&(T(e._input,"focus",e.open),T(e._input,"click",e.open)),e.daysContainer!==void 0&&(T(e.monthNav,"click",we),T(e.monthNav,["keyup","increment"],I),T(e.daysContainer,"click",En)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var v=function(w){return he(w).select()};T(e.timeContainer,["increment"],S),T(e.timeContainer,"blur",S,{capture:!0}),T(e.timeContainer,"click",Q),T([e.hourElement,e.minuteElement],["focus","click"],v),e.secondElement!==void 0&&T(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&T(e.amPM,"click",function(w){S(w)})}e.config.allowInput&&T(e._input,"blur",Xe)}function V(m,v){var w=m!==void 0?e.parseDate(m):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate1),e.calendarContainer.appendChild(m);var z=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!z&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var H=pt("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(H,e.element),H.appendChild(e.element),e.altInput&&H.appendChild(e.altInput),H.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function St(m,v,w,k){var z=It(v,!0),H=pt("span",m,v.getDate().toString());return H.dateObj=v,H.$i=k,H.setAttribute("aria-label",e.formatDate(v,e.config.ariaDateFormat)),m.indexOf("hidden")===-1&&le(v,e.now)===0&&(e.todayDateElem=H,H.classList.add("today"),H.setAttribute("aria-current","date")),z?(H.tabIndex=-1,be(v)&&(H.classList.add("selected"),e.selectedDateElem=H,e.config.mode==="range"&&(te(H,"startRange",e.selectedDates[0]&&le(v,e.selectedDates[0],!0)===0),te(H,"endRange",e.selectedDates[1]&&le(v,e.selectedDates[1],!0)===0),m==="nextMonthDay"&&H.classList.add("inRange")))):H.classList.add("flatpickr-disabled"),e.config.mode==="range"&&ri(v)&&!be(v)&&H.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&m!=="prevMonthDay"&&k%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend",""+e.config.getWeek(v)+""),vt("onDayCreate",H),H}function At(m){m.focus(),e.config.mode==="range"&&Jt(m)}function Lt(m){for(var v=m>0?0:e.config.showMonths-1,w=m>0?e.config.showMonths:-1,k=v;k!=w;k+=m)for(var z=e.daysContainer.children[k],H=m>0?0:z.children.length-1,rt=m>0?z.children.length:-1,q=H;q!=rt;q+=m){var st=z.children[q];if(st.className.indexOf("hidden")===-1&&It(st.dateObj))return st}}function Ht(m,v){for(var w=m.className.indexOf("Month")===-1?m.dateObj.getMonth():e.currentMonth,k=v>0?e.config.showMonths:-1,z=v>0?1:-1,H=w-e.currentMonth;H!=k;H+=z)for(var rt=e.daysContainer.children[H],q=w-e.currentMonth===H?m.$i+v:v<0?rt.children.length-1:0,st=rt.children.length,Y=q;Y>=0&&Y0?st:-1);Y+=z){var G=rt.children[Y];if(G.className.indexOf("hidden")===-1&&It(G.dateObj)&&Math.abs(m.$i-Y)>=Math.abs(v))return At(G)}e.changeMonth(z),jt(Lt(z),0)}function jt(m,v){var w=p(),k=Wt(w||document.body),z=m!==void 0?m:k?w:e.selectedDateElem!==void 0&&Wt(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Wt(e.todayDateElem)?e.todayDateElem:Lt(v>0?1:-1);z===void 0?e._input.focus():k?Ht(z,v):At(z)}function zt(m,v){for(var w=(new Date(m,v,1).getDay()-e.l10n.firstDayOfWeek+7)%7,k=e.utils.getDaysInMonth((v-1+12)%12,m),z=e.utils.getDaysInMonth(v,m),H=window.document.createDocumentFragment(),rt=e.config.showMonths>1,q=rt?"prevMonthDay hidden":"prevMonthDay",st=rt?"nextMonthDay hidden":"nextMonthDay",Y=k+1-w,G=0;Y<=k;Y++,G++)H.appendChild(St("flatpickr-day "+q,new Date(m,v-1,Y),Y,G));for(Y=1;Y<=z;Y++,G++)H.appendChild(St("flatpickr-day",new Date(m,v,Y),Y,G));for(var B=z+1;B<=42-w&&(e.config.showMonths===1||G%7!==0);B++,G++)H.appendChild(St("flatpickr-day "+st,new Date(m,v+1,B%z),B,G));var $t=pt("div","dayContainer");return $t.appendChild(H),$t}function kt(){if(e.daysContainer!==void 0){ar(e.daysContainer),e.weekNumbers&&ar(e.weekNumbers);for(var m=document.createDocumentFragment(),v=0;v1||e.config.monthSelectorType!=="dropdown")){var m=function(k){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&ke.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var v=0;v<12;v++)if(m(v)){var w=pt("option","flatpickr-monthDropdown-month");w.value=new Date(e.currentYear,v).getMonth().toString(),w.textContent=_r(v,e.config.shorthandCurrentMonth,e.l10n),w.tabIndex=-1,e.currentMonth===v&&(w.selected=!0),e.monthsDropdownContainer.appendChild(w)}}}function ae(){var m=pt("div","flatpickr-month"),v=window.document.createDocumentFragment(),w;e.config.showMonths>1||e.config.monthSelectorType==="static"?w=pt("span","cur-month"):(e.monthsDropdownContainer=pt("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),T(e.monthsDropdownContainer,"change",function(rt){var q=he(rt),st=parseInt(q.value,10);e.changeMonth(st-e.currentMonth),vt("onMonthChange")}),se(),w=e.monthsDropdownContainer);var k=ur("cur-year",{tabindex:"-1"}),z=k.getElementsByTagName("input")[0];z.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&z.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(z.setAttribute("max",e.config.maxDate.getFullYear().toString()),z.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var H=pt("div","flatpickr-current-month");return H.appendChild(w),H.appendChild(k),v.appendChild(H),m.appendChild(v),{container:m,yearElement:z,monthElement:w}}function kn(){ar(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var m=e.config.showMonths;m--;){var v=ae();e.yearElements.push(v.yearElement),e.monthElements.push(v.monthElement),e.monthNav.appendChild(v.container)}e.monthNav.appendChild(e.nextMonthNav)}function Ut(){return e.monthNav=pt("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=pt("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=pt("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,kn(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(m){e.__hidePrevMonthArrow!==m&&(te(e.prevMonthNav,"flatpickr-disabled",m),e.__hidePrevMonthArrow=m)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(m){e.__hideNextMonthArrow!==m&&(te(e.nextMonthNav,"flatpickr-disabled",m),e.__hideNextMonthArrow=m)}}),e.currentYearElement=e.yearElements[0],Se(),e.monthNav}function ze(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var m=Qr(e.config);e.timeContainer=pt("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var v=pt("span","flatpickr-time-separator",":"),w=ur("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=w.getElementsByTagName("input")[0];var k=ur("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=k.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=oe(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?m.hours:C(m.hours)),e.minuteElement.value=oe(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():m.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(w),e.timeContainer.appendChild(v),e.timeContainer.appendChild(k),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var z=ur("flatpickr-second");e.secondElement=z.getElementsByTagName("input")[0],e.secondElement.value=oe(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():m.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(pt("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(z)}return e.config.time_24hr||(e.amPM=pt("span","flatpickr-am-pm",e.l10n.amPM[ge((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function nt(){e.weekdayContainer?ar(e.weekdayContainer):e.weekdayContainer=pt("div","flatpickr-weekdays");for(var m=e.config.showMonths;m--;){var v=pt("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(v)}return $e(),e.weekdayContainer}function $e(){if(e.weekdayContainer){var m=e.l10n.firstDayOfWeek,v=ts(e.l10n.weekdays.shorthand);m>0&&mwn}}var je;(function(h){h[h.CONNECTING=0]="CONNECTING",h[h.OPEN=1]="OPEN",h[h.CLOSED=3]="CLOSED"})(je||(je={}));var Ce=je,pi=1;class Zn{constructor(o,c){this.hooks=o,this.session=Hn(1e3)+"/"+kr(8),this.location=mi(c),this.readyState=Ce.CONNECTING,this.openStream()}send(o){return this.sendRaw(JSON.stringify([o]))}ping(){this.hooks.sendHeartbeat(this)}close(o,c){this.onClose(o,c,!0)}sendRaw(o){if(this.readyState===Ce.OPEN)try{return X.createSocketRequest("POST",xn(_i(this.location,this.session))).start(o),!0}catch{return!1}else return!1}reconnect(){this.closeStream(),this.openStream()}onClose(o,c,_){this.closeStream(),this.readyState=Ce.CLOSED,this.onclose&&this.onclose({code:o,reason:c,wasClean:_})}onChunk(o){if(o.status===200){this.readyState===Ce.OPEN&&this.onActivity();var c,_=o.data.slice(0,1);switch(_){case"o":c=JSON.parse(o.data.slice(1)||"{}"),this.onOpen(c);break;case"a":c=JSON.parse(o.data.slice(1)||"[]");for(var y=0;y{this.onChunk(o)}),this.stream.bind("finished",o=>{this.hooks.onFinished(this,o)}),this.stream.bind("buffer_too_long",()=>{this.reconnect()});try{this.stream.start()}catch(o){$.defer(()=>{this.onError(o),this.onClose(1006,"Could not start streaming",!1)})}}closeStream(){this.stream&&(this.stream.unbind_all(),this.stream.close(),this.stream=null)}}function mi(h){var o=/([^\?]*)\/*(\??.*)/.exec(h);return{base:o[1],queryString:o[2]}}function _i(h,o){return h.base+"/"+o+"/xhr_send"}function xn(h){var o=h.indexOf("?")===-1?"?":"&";return h+o+"t="+ +new Date+"&n="+pi++}function Ri(h,o){var c=/(https?:\/\/)([^\/:]+)((\/|:)?.*)/.exec(h);return c[1]+o+c[3]}function Hn(h){return X.randomInt(h)}function kr(h){for(var o=[],c=0;c0&&h.onChunk(c.status,c.responseText);break;case 4:c.responseText&&c.responseText.length>0&&h.onChunk(c.status,c.responseText),h.emit("finished",c.status),h.close();break}},c},abortRequest:function(h){h.onreadystatechange=null,h.abort()}},yi=vi,Ue={createStreamingSocket(h){return this.createSocket(yt,h)},createPollingSocket(h){return this.createSocket(gi,h)},createSocket(h,o){return new ot(h,o)},createXHR(h,o){return this.createRequest(yi,h,o)},createRequest(h,o,c){return new di(h,o,c)}},jn=Ue;jn.createXDR=function(h,o){return this.createRequest(bn,h,o)};var Cn=jn,Rt={nextAuthCallbackID:1,auth_callbacks:{},ScriptReceivers:g,DependenciesReceivers:C,getDefaultStrategy:Ze,Transports:$t,transportConnectionInitializer:Et,HTTPFactory:Cn,TimelineTransport:In,getXHRAPI(){return window.XMLHttpRequest},getWebSocketAPI(){return window.WebSocket||window.MozWebSocket},setup(h){window.Pusher=h;var o=()=>{this.onDocumentBody(h.ready)};window.JSON?o():D.load("json2",{},o)},getDocument(){return document},getProtocol(){return this.getDocument().location.protocol},getAuthorizers(){return{ajax:jt,jsonp:mn}},onDocumentBody(h){document.body?h():setTimeout(()=>{this.onDocumentBody(h)},0)},createJSONPRequest(h,o){return new On(h,o)},createScriptRequest(h){return new Mn(h)},getLocalStorage(){try{return window.localStorage}catch{return}},createXHR(){return this.getXHRAPI()?this.createXMLHttpRequest():this.createMicrosoftXHR()},createXMLHttpRequest(){var h=this.getXHRAPI();return new h},createMicrosoftXHR(){return new ActiveXObject("Microsoft.XMLHTTP")},getNetwork(){return ke},createWebSocket(h){var o=this.getWebSocketAPI();return new o(h)},createSocketRequest(h,o){if(this.isXHRSupported())return this.HTTPFactory.createXHR(h,o);if(this.isXDRSupported(o.indexOf("https:")===0))return this.HTTPFactory.createXDR(h,o);throw"Cross-origin HTTP requests are not supported"},isXHRSupported(){var h=this.getXHRAPI();return!!h&&new h().withCredentials!==void 0},isXDRSupported(h){var o=h?"https:":"http:",c=this.getProtocol();return!!window.XDomainRequest&&c===o},addUnloadListener(h){window.addEventListener!==void 0?window.addEventListener("unload",h,!1):window.attachEvent!==void 0&&window.attachEvent("onunload",h)},removeUnloadListener(h){window.addEventListener!==void 0?window.removeEventListener("unload",h,!1):window.detachEvent!==void 0&&window.detachEvent("onunload",h)},randomInt(h){return Math.floor(function(){return(window.crypto||window.msCrypto).getRandomValues(new Uint32Array(1))[0]/Math.pow(2,32)}()*h)}},X=Rt,Un;(function(h){h[h.ERROR=3]="ERROR",h[h.INFO=6]="INFO",h[h.DEBUG=7]="DEBUG"})(Un||(Un={}));var Pn=Un;class Lr{constructor(o,c,_){this.key=o,this.session=c,this.events=[],this.options=_||{},this.sent=0,this.uniqueID=0}log(o,c){o<=this.options.level&&(this.events.push(K({},c,{timestamp:$.now()})),this.options.limit&&this.events.length>this.options.limit&&this.events.shift())}error(o){this.log(Pn.ERROR,o)}info(o){this.log(Pn.INFO,o)}debug(o){this.log(Pn.DEBUG,o)}isEmpty(){return this.events.length===0}send(o,c){var _=K({session:this.session,bundle:this.sent+1,key:this.key,lib:"js",version:this.options.version,cluster:this.options.cluster,features:this.options.features,timeline:this.events},this.options.params);return this.events=[],o(_,(y,M)=>{y||this.sent++,c&&c(y,M)}),!0}generateUniqueID(){return this.uniqueID++,this.uniqueID}}class zi{constructor(o,c,_,y){this.name=o,this.priority=c,this.transport=_,this.options=y||{}}isSupported(){return this.transport.isSupported({useTLS:this.options.useTLS})}connect(o,c){if(this.isSupported()){if(this.priority{_||(dt(),M?M.close():y.close())},forceMinPriority:Tt=>{_||this.priority{var c="socket_id="+encodeURIComponent(h.socketId);for(var _ in o.params)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(o.params[_]);if(o.paramsProvider!=null){let y=o.paramsProvider();for(var _ in y)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(y[_])}return c};var Fi=h=>{if(typeof X.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(o,c)=>{const _=ue(o,h);X.getAuthorizers()[h.transport](X,_,h,T.UserAuthentication,c)}};const Or=(h,o)=>{var c="socket_id="+encodeURIComponent(h.socketId);c+="&channel_name="+encodeURIComponent(h.channelName);for(var _ in o.params)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(o.params[_]);if(o.paramsProvider!=null){let y=o.paramsProvider();for(var _ in y)c+="&"+encodeURIComponent(_)+"="+encodeURIComponent(y[_])}return c};var Dr=h=>{if(typeof X.getAuthorizers()[h.transport]>"u")throw`'${h.transport}' is not a recognized auth transport`;return(o,c)=>{const _=Or(o,h);X.getAuthorizers()[h.transport](X,_,h,T.ChannelAuthorization,c)}};const Hi=(h,o,c)=>{const _={authTransport:o.transport,authEndpoint:o.endpoint,auth:{params:o.params,headers:o.headers}};return(y,M)=>{const N=h.channel(y.channelName);c(N,_).authorize(y.socketId,M)}};function ji(h,o){let c={activityTimeout:h.activityTimeout||S.activityTimeout,cluster:h.cluster,httpPath:h.httpPath||S.httpPath,httpPort:h.httpPort||S.httpPort,httpsPort:h.httpsPort||S.httpsPort,pongTimeout:h.pongTimeout||S.pongTimeout,statsHost:h.statsHost||S.stats_host,unavailableTimeout:h.unavailableTimeout||S.unavailableTimeout,wsPath:h.wsPath||S.wsPath,wsPort:h.wsPort||S.wsPort,wssPort:h.wssPort||S.wssPort,enableStats:Rr(h),httpHost:Ar(h),useTLS:me(h),wsHost:bi(h),userAuthenticator:De(h),channelAuthorizer:Wi(h,o)};return"disabledTransports"in h&&(c.disabledTransports=h.disabledTransports),"enabledTransports"in h&&(c.enabledTransports=h.enabledTransports),"ignoreNullOrigin"in h&&(c.ignoreNullOrigin=h.ignoreNullOrigin),"timelineParams"in h&&(c.timelineParams=h.timelineParams),"nacl"in h&&(c.nacl=h.nacl),c}function Ar(h){return h.httpHost?h.httpHost:h.cluster?`sockjs-${h.cluster}.pusher.com`:S.httpHost}function bi(h){return h.wsHost?h.wsHost:Ir(h.cluster)}function Ir(h){return`ws-${h}.pusher.com`}function me(h){return X.getProtocol()==="https:"?!0:h.forceTLS!==!1}function Rr(h){return"enableStats"in h?h.enableStats:"disableStats"in h?!h.disableStats:!1}const wi=h=>"customHandler"in h&&h.customHandler!=null;function De(h){const o=Object.assign(Object.assign({},S.userAuthentication),h.userAuthentication);return wi(o)?o.customHandler:Fi(o)}function Ui(h,o){let c;if("channelAuthorization"in h)c=Object.assign(Object.assign({},S.channelAuthorization),h.channelAuthorization);else if(c={transport:h.authTransport||S.authTransport,endpoint:h.authEndpoint||S.authEndpoint},"auth"in h&&("params"in h.auth&&(c.params=h.auth.params),"headers"in h.auth&&(c.headers=h.auth.headers)),"authorizer"in h)return{customHandler:Hi(o,c,h.authorizer)};return c}function Wi(h,o){const c=Ui(h,o);return wi(c)?c.customHandler:Dr(c)}class xi extends Gt{constructor(o){super(function(c,_){mt.debug(`No callbacks on watchlist events for ${c}`)}),this.pusher=o,this.bindWatchlistInternalEvent()}handleEvent(o){o.data.events.forEach(c=>{this.emit(c.name,c)})}bindWatchlistInternalEvent(){this.pusher.connection.bind("message",o=>{var c=o.event;c==="pusher_internal:watchlist_events"&&this.handleEvent(o)})}}function Nr(){let h,o;return{promise:new Promise((_,y)=>{h=_,o=y}),resolve:h,reject:o}}var qi=Nr;class Yi extends Gt{constructor(o){super(function(c,_){mt.debug("No callbacks on user for "+c)}),this.signin_requested=!1,this.user_data=null,this.serverToUserChannel=null,this.signinDonePromise=null,this._signinDoneResolve=null,this._onAuthorize=(c,_)=>{if(c){mt.warn(`Error during signin: ${c}`),this._cleanup();return}this.pusher.send_event("pusher:signin",{auth:_.auth,user_data:_.user_data})},this.pusher=o,this.pusher.connection.bind("state_change",({previous:c,current:_})=>{c!=="connected"&&_==="connected"&&this._signin(),c==="connected"&&_!=="connected"&&(this._cleanup(),this._newSigninPromiseIfNeeded())}),this.watchlist=new xi(o),this.pusher.connection.bind("message",c=>{var _=c.event;_==="pusher:signin_success"&&this._onSigninSuccess(c.data),this.serverToUserChannel&&this.serverToUserChannel.name===c.channel&&this.serverToUserChannel.handleEvent(c)})}signin(){this.signin_requested||(this.signin_requested=!0,this._signin())}_signin(){this.signin_requested&&(this._newSigninPromiseIfNeeded(),this.pusher.connection.state==="connected"&&this.pusher.config.userAuthenticator({socketId:this.pusher.connection.socket_id},this._onAuthorize))}_onSigninSuccess(o){try{this.user_data=JSON.parse(o.user_data)}catch{mt.error(`Failed parsing user data after signin: ${o.user_data}`),this._cleanup();return}if(typeof this.user_data.id!="string"||this.user_data.id===""){mt.error(`user_data doesn't contain an id. user_data: ${this.user_data}`),this._cleanup();return}this._signinDoneResolve(),this._subscribeChannels()}_subscribeChannels(){const o=c=>{c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.pusher.connection.state==="connected"&&c.subscribe()};this.serverToUserChannel=new gn(`#server-to-user-${this.user_data.id}`,this.pusher),this.serverToUserChannel.bind_global((c,_)=>{c.indexOf("pusher_internal:")===0||c.indexOf("pusher:")===0||this.emit(c,_)}),o(this.serverToUserChannel)}_cleanup(){this.user_data=null,this.serverToUserChannel&&(this.serverToUserChannel.unbind_all(),this.serverToUserChannel.disconnect(),this.serverToUserChannel=null),this.signin_requested&&this._signinDoneResolve()}_newSigninPromiseIfNeeded(){if(!this.signin_requested||this.signinDonePromise&&!this.signinDonePromise.done)return;const{promise:o,resolve:c,reject:_}=qi();o.done=!1;const y=()=>{o.done=!0};o.then(y).catch(y),this.signinDonePromise=o,this._signinDoneResolve=c}}class Nt{static ready(){Nt.isReady=!0;for(var o=0,c=Nt.instances.length;oX.getDefaultStrategy(this.config,y,Bi);this.connection=Xt.createConnectionManager(this.key,{getStrategy:_,timeline:this.timeline,activityTimeout:this.config.activityTimeout,pongTimeout:this.config.pongTimeout,unavailableTimeout:this.config.unavailableTimeout,useTLS:!!this.config.useTLS}),this.connection.bind("connected",()=>{this.subscribeAll(),this.timelineSender&&this.timelineSender.send(this.connection.isUsingTLS())}),this.connection.bind("message",y=>{var M=y.event,N=M.indexOf("pusher_internal:")===0;if(y.channel){var j=this.channel(y.channel);j&&j.handleEvent(y)}N||this.global_emitter.emit(y.event,y.data)}),this.connection.bind("connecting",()=>{this.channels.disconnect()}),this.connection.bind("disconnected",()=>{this.channels.disconnect()}),this.connection.bind("error",y=>{mt.warn(y)}),Nt.instances.push(this),this.timeline.info({instances:Nt.instances.length}),this.user=new Yi(this),Nt.isReady&&this.connect()}switchCluster(o){const{appKey:c,cluster:_}=o;this.key=c,this.options=Object.assign(Object.assign({},this.options),{cluster:_}),this.config=ji(this.options,this),this.connection.switchCluster(this.key)}channel(o){return this.channels.find(o)}allChannels(){return this.channels.all()}connect(){if(this.connection.connect(),this.timelineSender&&!this.timelineSenderTimer){var o=this.connection.isUsingTLS(),c=this.timelineSender;this.timelineSenderTimer=new Bt(6e4,function(){c.send(o)})}}disconnect(){this.connection.disconnect(),this.timelineSenderTimer&&(this.timelineSenderTimer.ensureAborted(),this.timelineSenderTimer=null)}bind(o,c,_){return this.global_emitter.bind(o,c,_),this}unbind(o,c,_){return this.global_emitter.unbind(o,c,_),this}bind_global(o){return this.global_emitter.bind_global(o),this}unbind_global(o){return this.global_emitter.unbind_global(o),this}unbind_all(o){return this.global_emitter.unbind_all(),this}subscribeAll(){var o;for(o in this.channels.channels)this.channels.channels.hasOwnProperty(o)&&this.subscribe(o)}subscribe(o){var c=this.channels.add(o,this);return c.subscriptionPending&&c.subscriptionCancelled?c.reinstateSubscription():!c.subscriptionPending&&this.connection.state==="connected"&&c.subscribe(),c}unsubscribe(o){var c=this.channels.find(o);c&&c.subscriptionPending?c.cancelSubscription():(c=this.channels.remove(o),c&&c.subscribed&&c.unsubscribe())}send_event(o,c,_){return this.connection.send_event(o,c,_)}shouldUseTLS(){return this.config.useTLS}signin(){this.user.signin()}}Nt.instances=[],Nt.isReady=!1,Nt.logToConsole=!1,Nt.Runtime=X,Nt.ScriptReceivers=X.ScriptReceivers,Nt.DependenciesReceivers=X.DependenciesReceivers,Nt.auth_callbacks=X.auth_callbacks;var Ci=l.default=Nt;function Pi(h){if(h==null)throw"You must pass your app key when you instantiate Pusher."}X.setup(Nt)}])})})(Ts);var Mu=Ts.exports;const Ou=Eu(Mu);window.Pusher=Ou;window.Echo=new ku({broadcaster:"reverb",key:"9rnhjstdgjdjyxymmj1k",wsHost:"smartcane.test",wsPort:"8080",wssPort:"8080",forceTLS:!1,enabledTransports:["ws","wss"]});window.axios=_u;window.axios.defaults.headers.common["X-Requested-With"]="XMLHttpRequest";var Gr=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],Qn={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(s){return typeof console<"u"&&console.warn(s)},getWeek:function(s){var a=new Date(s.getTime());a.setHours(0,0,0,0),a.setDate(a.getDate()+3-(a.getDay()+6)%7);var e=new Date(a.getFullYear(),0,4);return 1+Math.round(((a.getTime()-e.getTime())/864e5-3+(e.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},Di={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(s){var a=s%100;if(a>3&&a<21)return"th";switch(a%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},oe=function(s,a){return a===void 0&&(a=2),("000"+s).slice(a*-1)},ge=function(s){return s===!0?1:0};function Qo(s,a){var e;return function(){var l=this,f=arguments;clearTimeout(e),e=setTimeout(function(){return s.apply(l,f)},a)}}var Kr=function(s){return s instanceof Array?s:[s]};function te(s,a,e){if(e===!0)return s.classList.add(a);s.classList.remove(a)}function pt(s,a,e){var l=window.document.createElement(s);return a=a||"",e=e||"",l.className=a,e!==void 0&&(l.textContent=e),l}function ar(s){for(;s.firstChild;)s.removeChild(s.firstChild)}function Ss(s,a){if(a(s))return s;if(s.parentNode)return Ss(s.parentNode,a)}function ur(s,a){var e=pt("div","numInputWrapper"),l=pt("input","numInput "+s),f=pt("span","arrowUp"),p=pt("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?l.type="number":(l.type="text",l.pattern="\\d*"),a!==void 0)for(var g in a)l.setAttribute(g,a[g]);return e.appendChild(l),e.appendChild(f),e.appendChild(p),e}function he(s){try{if(typeof s.composedPath=="function"){var a=s.composedPath();return a[0]}return s.target}catch{return s.target}}var $r=function(){},_r=function(s,a,e){return e.months[a?"shorthand":"longhand"][s]},Du={D:$r,F:function(s,a,e){s.setMonth(e.months.longhand.indexOf(a))},G:function(s,a){s.setHours((s.getHours()>=12?12:0)+parseFloat(a))},H:function(s,a){s.setHours(parseFloat(a))},J:function(s,a){s.setDate(parseFloat(a))},K:function(s,a,e){s.setHours(s.getHours()%12+12*ge(new RegExp(e.amPM[1],"i").test(a)))},M:function(s,a,e){s.setMonth(e.months.shorthand.indexOf(a))},S:function(s,a){s.setSeconds(parseFloat(a))},U:function(s,a){return new Date(parseFloat(a)*1e3)},W:function(s,a,e){var l=parseInt(a),f=new Date(s.getFullYear(),0,2+(l-1)*7,0,0,0,0);return f.setDate(f.getDate()-f.getDay()+e.firstDayOfWeek),f},Y:function(s,a){s.setFullYear(parseFloat(a))},Z:function(s,a){return new Date(a)},d:function(s,a){s.setDate(parseFloat(a))},h:function(s,a){s.setHours((s.getHours()>=12?12:0)+parseFloat(a))},i:function(s,a){s.setMinutes(parseFloat(a))},j:function(s,a){s.setDate(parseFloat(a))},l:$r,m:function(s,a){s.setMonth(parseFloat(a)-1)},n:function(s,a){s.setMonth(parseFloat(a)-1)},s:function(s,a){s.setSeconds(parseFloat(a))},u:function(s,a){return new Date(parseFloat(a))},w:$r,y:function(s,a){s.setFullYear(2e3+parseFloat(a))}},Sn={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},Ei={Z:function(s){return s.toISOString()},D:function(s,a,e){return a.weekdays.shorthand[Ei.w(s,a,e)]},F:function(s,a,e){return _r(Ei.n(s,a,e)-1,!1,a)},G:function(s,a,e){return oe(Ei.h(s,a,e))},H:function(s){return oe(s.getHours())},J:function(s,a){return a.ordinal!==void 0?s.getDate()+a.ordinal(s.getDate()):s.getDate()},K:function(s,a){return a.amPM[ge(s.getHours()>11)]},M:function(s,a){return _r(s.getMonth(),!0,a)},S:function(s){return oe(s.getSeconds())},U:function(s){return s.getTime()/1e3},W:function(s,a,e){return e.getWeek(s)},Y:function(s){return oe(s.getFullYear(),4)},d:function(s){return oe(s.getDate())},h:function(s){return s.getHours()%12?s.getHours()%12:12},i:function(s){return oe(s.getMinutes())},j:function(s){return s.getDate()},l:function(s,a){return a.weekdays.longhand[s.getDay()]},m:function(s){return oe(s.getMonth()+1)},n:function(s){return s.getMonth()+1},s:function(s){return s.getSeconds()},u:function(s){return s.getTime()},w:function(s){return s.getDay()},y:function(s){return String(s.getFullYear()).substring(2)}},ks=function(s){var a=s.config,e=a===void 0?Qn:a,l=s.l10n,f=l===void 0?Di:l,p=s.isMobile,g=p===void 0?!1:p;return function(E,S,U){var C=U||f;return e.formatDate!==void 0&&!g?e.formatDate(E,S,C):S.split("").map(function(D,Z,J){return Ei[D]&&J[Z-1]!=="\\"?Ei[D](E,C,e):D!=="\\"?D:""}).join("")}},ao=function(s){var a=s.config,e=a===void 0?Qn:a,l=s.l10n,f=l===void 0?Di:l;return function(p,g,E,S){if(!(p!==0&&!p)){var U=S||f,C,D=p;if(p instanceof Date)C=new Date(p.getTime());else if(typeof p!="string"&&p.toFixed!==void 0)C=new Date(p);else if(typeof p=="string"){var Z=g||(e||Qn).dateFormat,J=String(p).trim();if(J==="today")C=new Date,E=!0;else if(e&&e.parseDate)C=e.parseDate(p,Z);else if(/Z$/.test(J)||/GMT$/.test(J))C=new Date(p);else{for(var I=void 0,T=[],R=0,F=0,V="";RMath.min(a,e)&&s=0?new Date:new Date(e.config.minDate.getTime()),w=Qr(e.config);v.setHours(w.hours,w.minutes,w.seconds,v.getMilliseconds()),e.selectedDates=[v],e.latestSelectedDateObj=v}m!==void 0&&m.type!=="blur"&&oi(m);var k=e._input.value;D(),ee(),e._input.value!==k&&e._debouncedChange()}function U(m,v){return m%12+12*ge(v===e.l10n.amPM[1])}function C(m){switch(m%24){case 0:case 12:return 12;default:return m%12}}function D(){if(!(e.hourElement===void 0||e.minuteElement===void 0)){var m=(parseInt(e.hourElement.value.slice(-2),10)||0)%24,v=(parseInt(e.minuteElement.value,10)||0)%60,w=e.secondElement!==void 0?(parseInt(e.secondElement.value,10)||0)%60:0;e.amPM!==void 0&&(m=U(m,e.amPM.textContent));var k=e.config.minTime!==void 0||e.config.minDate&&e.minDateHasTime&&e.latestSelectedDateObj&&le(e.latestSelectedDateObj,e.config.minDate,!0)===0,z=e.config.maxTime!==void 0||e.config.maxDate&&e.maxDateHasTime&&e.latestSelectedDateObj&&le(e.latestSelectedDateObj,e.config.maxDate,!0)===0;if(e.config.maxTime!==void 0&&e.config.minTime!==void 0&&e.config.minTime>e.config.maxTime){var H=Xr(e.config.minTime.getHours(),e.config.minTime.getMinutes(),e.config.minTime.getSeconds()),rt=Xr(e.config.maxTime.getHours(),e.config.maxTime.getMinutes(),e.config.maxTime.getSeconds()),q=Xr(m,v,w);if(q>rt&&q=12)]),e.secondElement!==void 0&&(e.secondElement.value=oe(w)))}function I(m){var v=he(m),w=parseInt(v.value)+(m.delta||0);(w/1e3>1||m.key==="Enter"&&!/[^\d]/.test(w.toString()))&&Vt(w)}function T(m,v,w,k){if(v instanceof Array)return v.forEach(function(z){return T(m,z,w,k)});if(m instanceof Array)return m.forEach(function(z){return T(z,v,w,k)});m.addEventListener(v,w,k),e._handlers.push({remove:function(){return m.removeEventListener(v,w,k)}})}function R(){vt("onChange")}function F(){if(e.config.wrap&&["open","close","toggle","clear"].forEach(function(w){Array.prototype.forEach.call(e.element.querySelectorAll("[data-"+w+"]"),function(k){return T(k,"click",e[w])})}),e.isMobile){on();return}var m=Qo(tn,50);if(e._debouncedChange=Qo(R,Nu),e.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&T(e.daysContainer,"mouseover",function(w){e.config.mode==="range"&&Jt(he(w))}),T(e._input,"keydown",Qe),e.calendarContainer!==void 0&&T(e.calendarContainer,"keydown",Qe),!e.config.inline&&!e.config.static&&T(window,"resize",m),window.ontouchstart!==void 0?T(window.document,"touchstart",K):T(window.document,"mousedown",K),T(window.document,"focus",K,{capture:!0}),e.config.clickOpens===!0&&(T(e._input,"focus",e.open),T(e._input,"click",e.open)),e.daysContainer!==void 0&&(T(e.monthNav,"click",we),T(e.monthNav,["keyup","increment"],I),T(e.daysContainer,"click",En)),e.timeContainer!==void 0&&e.minuteElement!==void 0&&e.hourElement!==void 0){var v=function(w){return he(w).select()};T(e.timeContainer,["increment"],S),T(e.timeContainer,"blur",S,{capture:!0}),T(e.timeContainer,"click",Q),T([e.hourElement,e.minuteElement],["focus","click"],v),e.secondElement!==void 0&&T(e.secondElement,"focus",function(){return e.secondElement&&e.secondElement.select()}),e.amPM!==void 0&&T(e.amPM,"click",function(w){S(w)})}e.config.allowInput&&T(e._input,"blur",Xe)}function V(m,v){var w=m!==void 0?e.parseDate(m):e.latestSelectedDateObj||(e.config.minDate&&e.config.minDate>e.now?e.config.minDate:e.config.maxDate&&e.config.maxDate1),e.calendarContainer.appendChild(m);var z=e.config.appendTo!==void 0&&e.config.appendTo.nodeType!==void 0;if((e.config.inline||e.config.static)&&(e.calendarContainer.classList.add(e.config.inline?"inline":"static"),e.config.inline&&(!z&&e.element.parentNode?e.element.parentNode.insertBefore(e.calendarContainer,e._input.nextSibling):e.config.appendTo!==void 0&&e.config.appendTo.appendChild(e.calendarContainer)),e.config.static)){var H=pt("div","flatpickr-wrapper");e.element.parentNode&&e.element.parentNode.insertBefore(H,e.element),H.appendChild(e.element),e.altInput&&H.appendChild(e.altInput),H.appendChild(e.calendarContainer)}!e.config.static&&!e.config.inline&&(e.config.appendTo!==void 0?e.config.appendTo:window.document.body).appendChild(e.calendarContainer)}function St(m,v,w,k){var z=It(v,!0),H=pt("span",m,v.getDate().toString());return H.dateObj=v,H.$i=k,H.setAttribute("aria-label",e.formatDate(v,e.config.ariaDateFormat)),m.indexOf("hidden")===-1&&le(v,e.now)===0&&(e.todayDateElem=H,H.classList.add("today"),H.setAttribute("aria-current","date")),z?(H.tabIndex=-1,be(v)&&(H.classList.add("selected"),e.selectedDateElem=H,e.config.mode==="range"&&(te(H,"startRange",e.selectedDates[0]&&le(v,e.selectedDates[0],!0)===0),te(H,"endRange",e.selectedDates[1]&&le(v,e.selectedDates[1],!0)===0),m==="nextMonthDay"&&H.classList.add("inRange")))):H.classList.add("flatpickr-disabled"),e.config.mode==="range"&&ri(v)&&!be(v)&&H.classList.add("inRange"),e.weekNumbers&&e.config.showMonths===1&&m!=="prevMonthDay"&&k%7===6&&e.weekNumbers.insertAdjacentHTML("beforeend",""+e.config.getWeek(v)+""),vt("onDayCreate",H),H}function At(m){m.focus(),e.config.mode==="range"&&Jt(m)}function Lt(m){for(var v=m>0?0:e.config.showMonths-1,w=m>0?e.config.showMonths:-1,k=v;k!=w;k+=m)for(var z=e.daysContainer.children[k],H=m>0?0:z.children.length-1,rt=m>0?z.children.length:-1,q=H;q!=rt;q+=m){var st=z.children[q];if(st.className.indexOf("hidden")===-1&&It(st.dateObj))return st}}function Ht(m,v){for(var w=m.className.indexOf("Month")===-1?m.dateObj.getMonth():e.currentMonth,k=v>0?e.config.showMonths:-1,z=v>0?1:-1,H=w-e.currentMonth;H!=k;H+=z)for(var rt=e.daysContainer.children[H],q=w-e.currentMonth===H?m.$i+v:v<0?rt.children.length-1:0,st=rt.children.length,Y=q;Y>=0&&Y0?st:-1);Y+=z){var G=rt.children[Y];if(G.className.indexOf("hidden")===-1&&It(G.dateObj)&&Math.abs(m.$i-Y)>=Math.abs(v))return At(G)}e.changeMonth(z),jt(Lt(z),0)}function jt(m,v){var w=p(),k=Wt(w||document.body),z=m!==void 0?m:k?w:e.selectedDateElem!==void 0&&Wt(e.selectedDateElem)?e.selectedDateElem:e.todayDateElem!==void 0&&Wt(e.todayDateElem)?e.todayDateElem:Lt(v>0?1:-1);z===void 0?e._input.focus():k?Ht(z,v):At(z)}function zt(m,v){for(var w=(new Date(m,v,1).getDay()-e.l10n.firstDayOfWeek+7)%7,k=e.utils.getDaysInMonth((v-1+12)%12,m),z=e.utils.getDaysInMonth(v,m),H=window.document.createDocumentFragment(),rt=e.config.showMonths>1,q=rt?"prevMonthDay hidden":"prevMonthDay",st=rt?"nextMonthDay hidden":"nextMonthDay",Y=k+1-w,G=0;Y<=k;Y++,G++)H.appendChild(St("flatpickr-day "+q,new Date(m,v-1,Y),Y,G));for(Y=1;Y<=z;Y++,G++)H.appendChild(St("flatpickr-day",new Date(m,v,Y),Y,G));for(var B=z+1;B<=42-w&&(e.config.showMonths===1||G%7!==0);B++,G++)H.appendChild(St("flatpickr-day "+st,new Date(m,v+1,B%z),B,G));var $t=pt("div","dayContainer");return $t.appendChild(H),$t}function kt(){if(e.daysContainer!==void 0){ar(e.daysContainer),e.weekNumbers&&ar(e.weekNumbers);for(var m=document.createDocumentFragment(),v=0;v1||e.config.monthSelectorType!=="dropdown")){var m=function(k){return e.config.minDate!==void 0&&e.currentYear===e.config.minDate.getFullYear()&&ke.config.maxDate.getMonth())};e.monthsDropdownContainer.tabIndex=-1,e.monthsDropdownContainer.innerHTML="";for(var v=0;v<12;v++)if(m(v)){var w=pt("option","flatpickr-monthDropdown-month");w.value=new Date(e.currentYear,v).getMonth().toString(),w.textContent=_r(v,e.config.shorthandCurrentMonth,e.l10n),w.tabIndex=-1,e.currentMonth===v&&(w.selected=!0),e.monthsDropdownContainer.appendChild(w)}}}function ae(){var m=pt("div","flatpickr-month"),v=window.document.createDocumentFragment(),w;e.config.showMonths>1||e.config.monthSelectorType==="static"?w=pt("span","cur-month"):(e.monthsDropdownContainer=pt("select","flatpickr-monthDropdown-months"),e.monthsDropdownContainer.setAttribute("aria-label",e.l10n.monthAriaLabel),T(e.monthsDropdownContainer,"change",function(rt){var q=he(rt),st=parseInt(q.value,10);e.changeMonth(st-e.currentMonth),vt("onMonthChange")}),se(),w=e.monthsDropdownContainer);var k=ur("cur-year",{tabindex:"-1"}),z=k.getElementsByTagName("input")[0];z.setAttribute("aria-label",e.l10n.yearAriaLabel),e.config.minDate&&z.setAttribute("min",e.config.minDate.getFullYear().toString()),e.config.maxDate&&(z.setAttribute("max",e.config.maxDate.getFullYear().toString()),z.disabled=!!e.config.minDate&&e.config.minDate.getFullYear()===e.config.maxDate.getFullYear());var H=pt("div","flatpickr-current-month");return H.appendChild(w),H.appendChild(k),v.appendChild(H),m.appendChild(v),{container:m,yearElement:z,monthElement:w}}function kn(){ar(e.monthNav),e.monthNav.appendChild(e.prevMonthNav),e.config.showMonths&&(e.yearElements=[],e.monthElements=[]);for(var m=e.config.showMonths;m--;){var v=ae();e.yearElements.push(v.yearElement),e.monthElements.push(v.monthElement),e.monthNav.appendChild(v.container)}e.monthNav.appendChild(e.nextMonthNav)}function Ut(){return e.monthNav=pt("div","flatpickr-months"),e.yearElements=[],e.monthElements=[],e.prevMonthNav=pt("span","flatpickr-prev-month"),e.prevMonthNav.innerHTML=e.config.prevArrow,e.nextMonthNav=pt("span","flatpickr-next-month"),e.nextMonthNav.innerHTML=e.config.nextArrow,kn(),Object.defineProperty(e,"_hidePrevMonthArrow",{get:function(){return e.__hidePrevMonthArrow},set:function(m){e.__hidePrevMonthArrow!==m&&(te(e.prevMonthNav,"flatpickr-disabled",m),e.__hidePrevMonthArrow=m)}}),Object.defineProperty(e,"_hideNextMonthArrow",{get:function(){return e.__hideNextMonthArrow},set:function(m){e.__hideNextMonthArrow!==m&&(te(e.nextMonthNav,"flatpickr-disabled",m),e.__hideNextMonthArrow=m)}}),e.currentYearElement=e.yearElements[0],Se(),e.monthNav}function ze(){e.calendarContainer.classList.add("hasTime"),e.config.noCalendar&&e.calendarContainer.classList.add("noCalendar");var m=Qr(e.config);e.timeContainer=pt("div","flatpickr-time"),e.timeContainer.tabIndex=-1;var v=pt("span","flatpickr-time-separator",":"),w=ur("flatpickr-hour",{"aria-label":e.l10n.hourAriaLabel});e.hourElement=w.getElementsByTagName("input")[0];var k=ur("flatpickr-minute",{"aria-label":e.l10n.minuteAriaLabel});if(e.minuteElement=k.getElementsByTagName("input")[0],e.hourElement.tabIndex=e.minuteElement.tabIndex=-1,e.hourElement.value=oe(e.latestSelectedDateObj?e.latestSelectedDateObj.getHours():e.config.time_24hr?m.hours:C(m.hours)),e.minuteElement.value=oe(e.latestSelectedDateObj?e.latestSelectedDateObj.getMinutes():m.minutes),e.hourElement.setAttribute("step",e.config.hourIncrement.toString()),e.minuteElement.setAttribute("step",e.config.minuteIncrement.toString()),e.hourElement.setAttribute("min",e.config.time_24hr?"0":"1"),e.hourElement.setAttribute("max",e.config.time_24hr?"23":"12"),e.hourElement.setAttribute("maxlength","2"),e.minuteElement.setAttribute("min","0"),e.minuteElement.setAttribute("max","59"),e.minuteElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(w),e.timeContainer.appendChild(v),e.timeContainer.appendChild(k),e.config.time_24hr&&e.timeContainer.classList.add("time24hr"),e.config.enableSeconds){e.timeContainer.classList.add("hasSeconds");var z=ur("flatpickr-second");e.secondElement=z.getElementsByTagName("input")[0],e.secondElement.value=oe(e.latestSelectedDateObj?e.latestSelectedDateObj.getSeconds():m.seconds),e.secondElement.setAttribute("step",e.minuteElement.getAttribute("step")),e.secondElement.setAttribute("min","0"),e.secondElement.setAttribute("max","59"),e.secondElement.setAttribute("maxlength","2"),e.timeContainer.appendChild(pt("span","flatpickr-time-separator",":")),e.timeContainer.appendChild(z)}return e.config.time_24hr||(e.amPM=pt("span","flatpickr-am-pm",e.l10n.amPM[ge((e.latestSelectedDateObj?e.hourElement.value:e.config.defaultHour)>11)]),e.amPM.title=e.l10n.toggleTitle,e.amPM.tabIndex=-1,e.timeContainer.appendChild(e.amPM)),e.timeContainer}function nt(){e.weekdayContainer?ar(e.weekdayContainer):e.weekdayContainer=pt("div","flatpickr-weekdays");for(var m=e.config.showMonths;m--;){var v=pt("div","flatpickr-weekdaycontainer");e.weekdayContainer.appendChild(v)}return $e(),e.weekdayContainer}function $e(){if(e.weekdayContainer){var m=e.l10n.firstDayOfWeek,v=ts(e.l10n.weekdays.shorthand);m>0&&m `+v.join("")+` diff --git a/laravel_app/public/build/manifest.json b/laravel_app/public/build/manifest.json index feaf20c..e41f521 100644 --- a/laravel_app/public/build/manifest.json +++ b/laravel_app/public/build/manifest.json @@ -57,7 +57,7 @@ "dynamicImports": [ "resources/js/alpine.js" ], - "file": "assets/app-a46f5c70.js", + "file": "assets/app-f1d6b98f.js", "isEntry": true, "src": "resources/js/app.js" } diff --git a/r_app/2_CI_data_prep.R b/r_app/2_CI_data_prep.R index 17a2c37..38cf09c 100644 --- a/r_app/2_CI_data_prep.R +++ b/r_app/2_CI_data_prep.R @@ -14,17 +14,29 @@ library(exactextractr) library(readxl) #funcion CI_prep package -date_list <- function(weeks_in_the_paste){ - week <- week(Sys.Date()- weeks(weeks_in_the_paste) ) - year <- year(Sys.Date()- weeks(weeks_in_the_paste) ) - days_filter <- Sys.Date() - weeks(weeks_in_the_paste) - days(0:6) - - return(c("week" = week, - "year" = year, - "days_filter" = list(days_filter))) - +date_list <- function(end_date, offset){ + offset <- as.numeric(offset) - 1 + end_date <- as.Date(end_date) + start_date <- end_date - lubridate::days(offset) + + week <- week(start_date) + year <- year(start_date) + days_filter <- seq(from = start_date, to = end_date, by = "day") + + return(list("week" = week, "year" = year, "days_filter" = days_filter)) } +# date_list <- function(weeks_in_the_paste){ +# week <- week(Sys.Date()- weeks(weeks_in_the_paste) ) +# year <- year(Sys.Date()- weeks(weeks_in_the_paste) ) +# days_filter <- Sys.Date() - weeks(weeks_in_the_paste) - days(0:6) +# +# return(c("week" = week, +# "year" = year, +# "days_filter" = list(days_filter))) +# +# } + CI_func <- function(x, drop_layers = FALSE){ CI <- x[[4]]/x[[2]]-1 add(x) <- CI @@ -461,16 +473,18 @@ if (length(args) == 0) { } # Converteer het eerste argument naar een numerieke waarde -weeks_ago <- as.numeric(args[1]) +end_date <- as.Date(args[1]) + +offset <- as.numeric(args[2]) # Controleer of weeks_ago een geldig getal is -if (is.na(weeks_ago)) { +if (is.na(offset)) { # stop("Het argument is geen geldig getal") - weeks_ago <- 0 + offset <- 7 } # Converteer het tweede argument naar een string waarde -project_dir <- as.character(args[2]) +project_dir <- as.character(args[3]) # Controleer of data_dir een geldige waarde is if (!is.character(project_dir)) { @@ -508,10 +522,13 @@ dir.create(here(daily_vrt)) dir.create(merged_final) dir.create(harvest_dir) +week <- week(end_date) + #weeks_ago = 0 # Creating weekly mosaic -dates <- date_list(weeks_ago) +#dates <- date_list(weeks_ago) +dates <- date_list(end_date, offset) print(dates) #load pivot geojson # pivot_sf_q <- st_read(here(data_dir, "pivot.geojson")) %>% dplyr::select(pivot, pivot_quadrant) %>% vect() diff --git a/r_app/Rplots.pdf b/r_app/Rplots.pdf index e269924..5562fc0 100644 Binary files a/r_app/Rplots.pdf and b/r_app/Rplots.pdf differ