diff --git a/app/views/timer_sessions/_timer_container.html.erb b/app/views/timer_sessions/_timer_container.html.erb index e3361ea..42ec069 100644 --- a/app/views/timer_sessions/_timer_container.html.erb +++ b/app/views/timer_sessions/_timer_container.html.erb @@ -1,4 +1,8 @@ -
+
<% active_timer_session = timer_session %> <%= labelled_form_for(active_timer_session, @@ -80,14 +84,20 @@ <% end %>
<% elsif !timer_session.persisted? && User.current.allowed_to_globally?(action: :create, controller: 'time_tracker') %> - <%= f.button :start, type: :submit, value: :start, data: { name: 'timer-start' }, name: :commit do %> - <%= t('timer_sessions.timer.start') %> - <%= sprite_icon('add') %> - <% end %> - <%= f.button :start, type: :submit, value: :continue_last_session, data: { name: 'timer-continue' }, class: 'ml-3', name: :commit do %> - <%= t('timer_sessions.timer.continue_last_session') %> - <%= sprite_icon('add') %> - <% end %> +
+ <%= f.button :start, type: :submit, value: :start, data: { name: 'timer-start' }, name: :commit do %> + <%= t('timer_sessions.timer.start') %> + <%= sprite_icon('add') %> + <% end %> + <%= f.button :start, type: :submit, value: :continue_last_session, data: { name: 'timer-continue' }, name: :commit do %> + <%= t('timer_sessions.timer.continue_last_session') %> + <%= sprite_icon('add') %> + <% end %> + +
<% end %> <% end %> diff --git a/assets.src/src/redmine-tracky/controllers/form-controller.ts b/assets.src/src/redmine-tracky/controllers/form-controller.ts index 33a5876..59e1d7d 100644 --- a/assets.src/src/redmine-tracky/controllers/form-controller.ts +++ b/assets.src/src/redmine-tracky/controllers/form-controller.ts @@ -9,6 +9,10 @@ export default class extends Controller { declare readonly absolutInputTarget: HTMLInputElement declare readonly descriptionTarget: HTMLInputElement declare readonly issueTargets: Element[] + declare readonly shareCopiedValue: string + declare readonly sharePrefilledValue: string + declare readonly shareIgnoredValue: string + declare readonly sessionActiveValue: boolean private connected = false @@ -21,8 +25,20 @@ export default class extends Controller { 'absolutInput', ] + static values = { + shareCopied: String, + sharePrefilled: String, + shareIgnored: String, + sessionActive: Boolean, + } + public connect() { this.connected = true + if (this.sessionActiveValue) { + this.showShareIgnoredNotice() + } else { + this.prefillFieldsFromURL() + } } public disconnect() { @@ -67,6 +83,83 @@ export default class extends Controller { this.dispatchUpdate(form) } + public share(event: Event) { + event.preventDefault() + const parts: string[] = [] + const issueIds = this.extractIssueIds() + const comments = this.descriptionTarget.value + const timerStart = this.startTarget.value + const timerEnd = this.endTarget.value + + issueIds.forEach((id) => parts.push(`issue_ids[]=${encodeURIComponent(id)}`)) + if (comments) parts.push(`comments=${encodeURIComponent(comments)}`) + if (timerStart) parts.push(`timer_start=${encodeURIComponent(timerStart)}`) + if (timerEnd) parts.push(`timer_end=${encodeURIComponent(timerEnd)}`) + + const query = parts.length > 0 ? `?${parts.join('&')}` : '' + const url = `${window.location.origin}${window.location.pathname}${query}` + + navigator.clipboard.writeText(url).then(() => { + this.showFlash(this.shareCopiedValue, 'notice') + }) + } + + private prefillFieldsFromURL() { + const urlParams = new URLSearchParams(window.location.search) + + const prefilled = [ + this.prefillField(urlParams, 'comments', this.descriptionTarget), + this.prefillField(urlParams, 'timer_start', this.startTarget), + this.prefillField(urlParams, 'timer_end', this.endTarget), + ].some(Boolean) + + if (prefilled) { + this.showFlash(this.sharePrefilledValue, 'notice') + } + } + + private prefillField(urlParams: URLSearchParams, param: string, target: HTMLInputElement): boolean { + const value = urlParams.get(param) + if (!value) return false + + target.value = value + target.dispatchEvent(new Event('change')) + return true + } + + private showShareIgnoredNotice() { + if (!this.sessionActiveValue) return + + const urlParams = new URLSearchParams(window.location.search) + const hasShareParams = urlParams.has('comments') || + urlParams.has('timer_start') || + urlParams.has('timer_end') || + urlParams.getAll('issue_ids[]').some((v) => v !== '') + + if (hasShareParams) { + this.showFlash(this.shareIgnoredValue, 'warning') + } + } + + private showFlash(message: string, type: 'notice' | 'warning') { + const flashId = `flash_${type}` + const existing = document.getElementById(flashId) + if (existing) { + existing.textContent = message + existing.style.display = '' + return + } + + const container = document.getElementById('content') + if (!container) return + + const flash = document.createElement('div') + flash.id = flashId + flash.className = `flash ${type}` + flash.textContent = message + container.prepend(flash) + } + private extractIssueIds(): string[] { return ( this.issueTargets diff --git a/assets.src/src/redmine-tracky/controllers/issue-completion-controller.ts b/assets.src/src/redmine-tracky/controllers/issue-completion-controller.ts index 8155feb..d984ac4 100644 --- a/assets.src/src/redmine-tracky/controllers/issue-completion-controller.ts +++ b/assets.src/src/redmine-tracky/controllers/issue-completion-controller.ts @@ -18,7 +18,7 @@ export default class extends Controller { connect() { this.listenForInput() - this.fetchIssuesFromURL() + this.prefillFromURL() } private listenForInput() { @@ -43,7 +43,7 @@ export default class extends Controller { ) } - private fetchIssuesFromURL() { + private prefillFromURL() { const urlParams = new URLSearchParams(window.location.search) const issueIds = urlParams.getAll('issue_ids[]') diff --git a/assets.src/src/styles/timer_container.scss b/assets.src/src/styles/timer_container.scss index f79e992..3b2598c 100644 --- a/assets.src/src/styles/timer_container.scss +++ b/assets.src/src/styles/timer_container.scss @@ -3,6 +3,12 @@ column-count: 2; } + .starting-action-buttons { + display: flex; + flex-wrap: wrap; + gap: 0.5rem; + } + .timer-container button svg { stroke: #fff; } diff --git a/assets/javascripts/redmine-tracky.js b/assets/javascripts/redmine-tracky.js index afa4cdd..b931536 100644 --- a/assets/javascripts/redmine-tracky.js +++ b/assets/javascripts/redmine-tracky.js @@ -1 +1 @@ -(()=>{"use strict";var e={56(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},72(e){var t=[];function n(e){for(var n=-1,r=0;r{const i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function z(e,t,n){return $(e)&&e>=t&&e<=n}function B(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function H(e){return _(e)||null===e||""===e?void 0:parseInt(e,10)}function Y(e){return _(e)||null===e||""===e?void 0:parseFloat(e)}function W(e){if(!_(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function U(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Z(e){return e%4==0&&(e%100!=0||e%400==0)}function q(e){return Z(e)?366:365}function K(e,t){const n=(r=t-1)-12*Math.floor(r/12)+1;var r;return 2===n?Z(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function J(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function G(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Q(e){return e>99?e:e>60?1900+e:2e3+e}function X(e,t,n,r=null){const i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return s?s.value:null}function ee(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function te(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new l(`Invalid unit value ${e}`);return t}function ne(e,t){const n={};for(const r in e)if(R(e,r)){const i=e[r];if(null==i)continue;n[t(r)]=te(i)}return n}function re(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${B(n,2)}:${B(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${B(n,2)}${B(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ie(e){return function(e){return["hour","minute","second","millisecond"].reduce((t,n)=>(t[n]=e[n],t),{})}(e)}const ae=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,oe=["January","February","March","April","May","June","July","August","September","October","November","December"],se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],le=["J","F","M","A","M","J","J","A","S","O","N","D"];function ce(e){switch(e){case"narrow":return[...le];case"short":return[...se];case"long":return[...oe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ue=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],de=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],he=["M","T","W","T","F","S","S"];function fe(e){switch(e){case"narrow":return[...he];case"short":return[...de];case"long":return[...ue];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const me=["AM","PM"],pe=["Before Christ","Anno Domini"],ge=["BC","AD"],ye=["B","A"];function be(e){switch(e){case"narrow":return[...ye];case"short":return[...ge];case"long":return[...pe];default:return null}}function ve(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const we={D:f,DD:m,DDD:g,DDDD:y,t:b,tt:v,ttt:w,tttt:k,T:x,TT:D,TTT:M,TTTT:O,f:T,ff:E,fff:A,ffff:F,F:C,FF:S,FFF:I,FFFF:j};class ke{static create(e,t={}){return new ke(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let a=0;a0&&i.push({literal:r,val:n}),t=null,n="",r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:!1,val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r,val:n}),i}static macroTokenToFormatOpts(e){return we[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return B(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,n)=>this.loc.extract(e,t,n),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",o=(t,r)=>n?function(e,t){return ce(t)[e.month-1]}(e,t):i(r?{month:t}:{month:t,day:"numeric"},"month"),s=(t,r)=>n?function(e,t){return fe(t)[e.weekday-1]}(e,t):i(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{const n=ke.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},c=t=>n?function(e,t){return be(t)[e.year<0?0:1]}(e,t):i({era:t},"era");return ve(ke.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return n?function(e){return me[e.hour<12?0:1]}(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}})}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=ke.parseFormat(t),i=r.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]);return ve(r,(e=>t=>{const r=n(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...i.map(n).filter(e=>e))))}}class xe{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class De{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}}let Me=null;class Oe extends De{static get instance(){return null===Me&&(Me=new Oe),Me}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return X(e,t,n)}formatOffset(e,t){return re(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let Te={};const Ce={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let Ee={};class Se extends De{static create(e){return Ee[e]||(Ee[e]=new Se(e)),Ee[e]}static resetCache(){Ee={},Te={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=Se.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return X(e,t,n,this.name)}formatOffset(e,t){return re(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=(r=this.name,Te[r]||(Te[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Te[r]);var r;let[i,a,o,s,l,c,u]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e=0?h:1e3+h,(J({year:i,month:a,day:o,hour:24===l?0:l,minute:c,second:u,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ne=null;class Ae extends De{static get utcInstance(){return null===Ne&&(Ne=new Ae(0)),Ne}static instance(e){return 0===e?Ae.utcInstance:new Ae(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Ae(ee(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${re(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${re(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return re(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Ie extends De{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Fe(e,t){if(_(e)||null===e)return t;if(e instanceof De)return e;if("string"==typeof e){const n=e.toLowerCase();return"local"===n||"system"===n?t:"utc"===n||"gmt"===n?Ae.utcInstance:Ae.parseSpecifier(n)||Se.create(e)}return L(e)?Ae.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new Ie(e)}let je,_e=()=>Date.now(),Le="system",$e=null,Ve=null,Pe=null;class Re{static get now(){return _e}static set now(e){_e=e}static set defaultZone(e){Le=e}static get defaultZone(){return Fe(Le,Oe.instance)}static get defaultLocale(){return $e}static set defaultLocale(e){$e=e}static get defaultNumberingSystem(){return Ve}static set defaultNumberingSystem(e){Ve=e}static get defaultOutputCalendar(){return Pe}static set defaultOutputCalendar(e){Pe=e}static get throwOnInvalid(){return je}static set throwOnInvalid(e){je=e}static resetCaches(){Ge.resetCache(),Se.resetCache()}}let ze={},Be={};function He(e,t={}){const n=JSON.stringify([e,t]);let r=Be[n];return r||(r=new Intl.DateTimeFormat(e,t),Be[n]=r),r}let Ye={},We={},Ue=null;function Ze(e,t,n,r,i){const a=e.listingMode(n);return"error"===a?null:"en"===a?r(t):i(t)}class qe{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Ye[n];return r||(r=new Intl.NumberFormat(e,t),Ye[n]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return B(this.floor?Math.floor(e):U(e,3),this.padTo)}}class Ke{constructor(e,t,n){let r;if(this.opts=n,e.zone.isUniversal){const t=e.offset/60*-1,i=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&Se.create(i).valid?(r=i,this.dt=e):(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Zn.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name);const i={...this.opts};r&&(i.timeZone=r),this.dtf=He(t,i)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Je{constructor(e,t,n){this.opts={style:"long",...n},!t&&V()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let a=We[i];return a||(a=new Intl.RelativeTimeFormat(e,t),We[i]=a),a}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&a){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${i[e][0]}`;case-1:return n?"yesterday":`last ${i[e][0]}`;case 0:return n?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=1===s,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ge{static fromOpts(e){return Ge.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=!1){const i=e||Re.defaultLocale,a=i||(r?"en-US":Ue||(Ue=(new Intl.DateTimeFormat).resolvedOptions().locale,Ue)),o=t||Re.defaultNumberingSystem,s=n||Re.defaultOutputCalendar;return new Ge(a,o,s,i)}static resetCache(){Ue=null,Be={},Ye={},We={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Ge.create(e,t,n)}constructor(e,t,n,r){const[i,a,o]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const r=e.substring(0,t);try{n=He(e).resolvedOptions()}catch(e){n=He(r).resolvedOptions()}const{numberingSystem:i,calendar:a}=n;return[r,i,a]}}(e);this.locale=i,this.numberingSystem=t||a||null,this.outputCalendar=n||o||null,this.intl=function(e,t,n){return n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ge.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,n=!0){return Ze(this,e,n,ce,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=Zn.utc(2016,n,1);t.push(e(r))}return t}(e=>this.extract(e,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1,n=!0){return Ze(this,e,n,fe,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=Zn.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(e=!0){return Ze(this,void 0,e,()=>me,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Zn.utc(2016,11,13,9),Zn.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Ze(this,e,t,be,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Zn.utc(-40,1,1),Zn.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new qe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ke(e,this.intl,t)}relFormatter(e={}){return new Je(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let r=ze[n];return r||(r=new Intl.ListFormat(e,t),ze[n]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Qe(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Xe(...e){return t=>e.reduce(([e,n,r],i)=>{const[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function et(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function tt(...e){return(t,n)=>{const r={};let i;for(i=0;ivoid 0!==e&&(t||e&&u)?-e:e;return[{years:h(Y(n)),months:h(Y(r)),weeks:h(Y(i)),days:h(Y(a)),hours:h(Y(o)),minutes:h(Y(s)),seconds:h(Y(l),"-0"===l),milliseconds:h(W(c),d)}]}const yt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function bt(e,t,n,r,i,a,o){const s={year:2===t.length?Q(H(t)):H(t),month:se.indexOf(n)+1,day:H(r),hour:H(i),minute:H(a)};return o&&(s.second=H(o)),e&&(s.weekday=e.length>3?ue.indexOf(e)+1:de.indexOf(e)+1),s}const vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function wt(e){const[,t,n,r,i,a,o,s,l,c,u,d]=e,h=bt(t,i,r,n,a,o,s);let f;return f=l?yt[l]:c?0:ee(u,d),[h,new Ae(f)]}const kt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,xt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Dt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mt(e){const[,t,n,r,i,a,o,s]=e;return[bt(t,i,r,n,a,o,s),Ae.utcInstance]}function Ot(e){const[,t,n,r,i,a,o,s]=e;return[bt(t,s,n,r,i,a,o),Ae.utcInstance]}const Tt=Qe(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,at),Ct=Qe(/(\d{4})-?W(\d\d)(?:-?(\d))?/,at),Et=Qe(/(\d{4})-?(\d{3})/,at),St=Qe(it),Nt=Xe(function(e,t){return[{year:ut(e,t),month:ut(e,t+1,1),day:ut(e,t+2,1)},null,t+3]},dt,ht,ft),At=Xe(ot,dt,ht,ft),It=Xe(st,dt,ht,ft),Ft=Xe(dt,ht,ft),jt=Xe(dt),_t=Qe(/(\d{4})-(\d\d)-(\d\d)/,ct),Lt=Qe(lt),$t=Xe(dt,ht,ft),Vt={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Pt={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...Vt},Rt={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...Vt},zt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Bt=zt.slice(0).reverse();function Ht(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Wt(r)}function Yt(e,t,n,r,i){const a=e[i][n],o=t[n]/a,s=Math.sign(o)!==Math.sign(r[i])&&0!==r[i]&&Math.abs(o)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(o):Math.trunc(o);r[i]+=s,t[n]-=s*a}class Wt{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||Ge.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Rt:Pt,this.isLuxonDuration=!0}static fromMillis(e,t){return Wt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new l("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Wt({values:ne(e,Wt.normalizeUnit),loc:Ge.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(L(e))return Wt.fromMillis(e);if(Wt.isDuration(e))return e;if("object"==typeof e)return Wt.fromObject(e);throw new l(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return et(e,[pt,gt])}(e);return n?Wt.fromObject(n,t):Wt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return et(e,[mt,jt])}(e);return n?Wt.fromObject(n,t):Wt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new l("need to specify a reason the Duration is invalid");const n=e instanceof xe?e:new xe(e,t);if(Re.throwOnInvalid)throw new a(n);return new Wt({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new s(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?ke.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toHuman(e={}){const t=zt.map(t=>{const n=this.values[t];return _(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(n)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=U(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const n=this.shiftTo("hours","minutes","seconds","milliseconds");let r="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===n.seconds&&0===n.milliseconds||(r+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===n.milliseconds||(r+=".SSS"));let i=n.toFormat(r);return e.includePrefix&&(i="T"+i),i}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Wt.fromDurationLike(e),n={};for(const e of zt)(R(t.values,e)||R(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Ht(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Wt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=te(e(this.values[n],n));return Ht(this,{values:t},!0)}get(e){return this[Wt.normalizeUnit(e)]}set(e){return this.isValid?Ht(this,{values:{...this.values,...ne(e,Wt.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const r={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(r.conversionAccuracy=n),Ht(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return function(e,t){Bt.reduce((n,r)=>_(t[r])?n:(n&&Yt(e,t,n,t,r),r),null)}(this.matrix,e),Ht(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>Wt.normalizeUnit(e));const t={},n={},r=this.toObject();let i;for(const a of zt)if(e.indexOf(a)>=0){i=a;let e=0;for(const t in n)e+=this.matrix[t][a]*n[t],n[t]=0;L(r[a])&&(e+=r[a]);const o=Math.trunc(e);t[a]=o,n[a]=(1e3*e-1e3*o)/1e3;for(const e in r)zt.indexOf(e)>zt.indexOf(a)&&Yt(this.matrix,r,e,t,a)}else L(r[a])&&(n[a]=r[a]);for(const e in n)0!==n[e]&&(t[i]+=e===i?n[e]:n[e]/this.matrix[i][e]);return Ht(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Ht(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const n of zt)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Ut="Invalid Interval";class Zt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new l("need to specify a reason the Interval is invalid");const n=e instanceof xe?e:new xe(e,t);if(Re.throwOnInvalid)throw new i(n);return new Zt({invalid:n})}static fromDateTimes(e,t){const n=qn(e),r=qn(t),i=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?Zt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(qn).filter(e=>this.contains(e)).sort(),n=[];let{s:r}=this,i=0;for(;r+this.e?this.e:e;n.push(Zt.fromDateTimes(r,a)),r=a,i+=1}return n}splitBy(e){const t=Wt.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s:r}=this,i=1;const a=[];for(;re*i));n=+e>+this.e?this.e:e,a.push(Zt.fromDateTimes(r,n)),r=n,i+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e}equals(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e=n?null:Zt.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Zt.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),a=Array.prototype.concat(...i).sort((e,t)=>e.time-t.time);for(const e of a)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(Zt.fromDateTimes(t,e.time)),t=null);return Zt.merge(r)}difference(...e){return Zt.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ut}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ut}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ut}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ut}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ut}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Wt.invalid(this.invalidReason)}mapEndpoints(e){return Zt.fromDateTimes(e(this.s),e(this.e))}}class qt{static hasDST(e=Re.defaultZone){const t=Zn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Se.isValidZone(e)}static normalizeZone(e){return Fe(e,Re.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||Ge.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||Ge.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Ge.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Ge.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ge.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ge.create(t,null,"gregory").eras(e)}static features(){return{relative:V()}}}function Kt(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Wt.fromMillis(r).as("days"))}const Jt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Gt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Qt=Jt.hanidec.replace(/[\[|\]]/g,"").split("");function Xt({numberingSystem:e},t=""){return new RegExp(`${Jt[e||"latn"]}${t}`)}function en(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}const tn=`[ ${String.fromCharCode(160)}]`,nn=new RegExp(tn,"g");function rn(e){return e.replace(/\./g,"\\.?").replace(nn,tn)}function an(e){return e.replace(/\./g,"").replace(nn," ").toLowerCase()}function on(e,t){return null===e?null:{regex:RegExp(e.map(rn).join("|")),deser:([n])=>e.findIndex(e=>an(n)===an(e))+t}}function sn(e,t){return{regex:e,deser:([,e,t])=>ee(e,t),groups:t}}function ln(e){return{regex:e,deser:([e])=>e}}const cn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let un=null;function dn(e,t,n){const r=function(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const n=ke.macroTokenToFormatOpts(e.val);if(!n)return e;const r=ke.create(t,n).formatDateTimeParts((un||(un=Zn.fromMillis(1555555555555)),un)).map(e=>function(e,t,n){const{type:r,value:i}=e;if("literal"===r)return{literal:!0,val:i};const a=n[r];let o=cn[r];return"object"==typeof o&&(o=o[a]),o?{literal:!1,val:o}:void 0}(e,0,n));return r.includes(void 0)?e:r}(e,t)))}(ke.parseFormat(n),e),i=r.map(t=>function(e,t){const n=Xt(t),r=Xt(t,"{2}"),i=Xt(t,"{3}"),a=Xt(t,"{4}"),o=Xt(t,"{6}"),s=Xt(t,"{1,2}"),l=Xt(t,"{1,3}"),c=Xt(t,"{1,6}"),u=Xt(t,"{1,9}"),d=Xt(t,"{2,4}"),h=Xt(t,"{4,6}"),f=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},m=(m=>{if(e.literal)return f(m);switch(m.val){case"G":return on(t.eras("short",!1),0);case"GG":return on(t.eras("long",!1),0);case"y":return en(c);case"yy":case"kk":return en(d,Q);case"yyyy":case"kkkk":return en(a);case"yyyyy":return en(h);case"yyyyyy":return en(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return en(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return en(r);case"MMM":return on(t.months("short",!0,!1),1);case"MMMM":return on(t.months("long",!0,!1),1);case"LLL":return on(t.months("short",!1,!1),1);case"LLLL":return on(t.months("long",!1,!1),1);case"o":case"S":return en(l);case"ooo":case"SSS":return en(i);case"u":return ln(u);case"uu":return ln(s);case"uuu":case"E":case"c":return en(n);case"a":return on(t.meridiems(),0);case"EEE":return on(t.weekdays("short",!1,!1),1);case"EEEE":return on(t.weekdays("long",!1,!1),1);case"ccc":return on(t.weekdays("short",!0,!1),1);case"cccc":return on(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return sn(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return sn(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return ln(/[a-z_+-/]{1,256}?/i);default:return f(m)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=e,m}(t,e)),a=i.find(e=>e.invalidReason);if(a)return{input:t,tokens:r,invalidReason:a.invalidReason};{const[e,n]=function(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,e]}(i),a=RegExp(e,"i"),[s,l]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const i in n)if(R(n,i)){const a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}return[r,{}]}(t,a,n),[c,u,d]=l?function(e){let t,n=null;return _(e.z)||(n=Se.create(e.z)),_(e.Z)||(n||(n=new Ae(e.Z)),t=e.Z),_(e.q)||(e.M=3*(e.q-1)+1),_(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),_(e.u)||(e.S=W(e.u)),[Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{}),n,t]}(l):[null,null,void 0];if(R(l,"a")&&R(l,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:a,rawMatches:s,matches:l,result:c,zone:u,specificOffset:d}}}const hn=[0,31,59,90,120,151,181,212,243,273,304,334],fn=[0,31,60,91,121,152,182,213,244,274,305,335];function mn(e,t){return new xe("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function pn(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return 0===i?7:i}function gn(e,t,n){return n+(Z(e)?fn:hn)[t-1]}function yn(e,t){const n=Z(e)?fn:hn,r=n.findIndex(e=>eG(t)?(o=t+1,s=1):o=t,{weekYear:o,weekNumber:s,weekday:a,...ie(e)}}function vn(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=pn(t,1,4),a=q(t);let o,s=7*n+r-i-3;s<1?(o=t-1,s+=q(o)):s>a?(o=t+1,s-=q(t)):o=t;const{month:l,day:c}=yn(o,s);return{year:o,month:l,day:c,...ie(e)}}function wn(e){const{year:t,month:n,day:r}=e;return{year:t,ordinal:gn(t,n,r),...ie(e)}}function kn(e){const{year:t,ordinal:n}=e,{month:r,day:i}=yn(t,n);return{year:t,month:r,day:i,...ie(e)}}function xn(e){const t=$(e.year),n=z(e.month,1,12),r=z(e.day,1,K(e.year,e.month));return t?n?!r&&mn("day",e.day):mn("month",e.month):mn("year",e.year)}function Dn(e){const{hour:t,minute:n,second:r,millisecond:i}=e,a=z(t,0,23)||24===t&&0===n&&0===r&&0===i,o=z(n,0,59),s=z(r,0,59),l=z(i,0,999);return a?o?s?!l&&mn("millisecond",i):mn("second",r):mn("minute",n):mn("hour",t)}const Mn="Invalid DateTime",On=864e13;function Tn(e){return new xe("unsupported zone",`the zone "${e.name}" is not supported`)}function Cn(e){return null===e.weekData&&(e.weekData=bn(e.c)),e.weekData}function En(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Zn({...n,...t,old:n})}function Sn(e,t,n){let r=e-60*t*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;const a=n.offset(r);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}function Nn(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function An(e,t,n){return Sn(J(e),t,n)}function In(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:r,month:i,day:Math.min(e.c.day,K(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},o=Wt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=J(a);let[l,c]=Sn(s,n,e.zone);return 0!==o&&(l+=o,c=e.zone.offset(l)),{ts:l,o:c}}function Fn(e,t,n,r,i,a){const{setZone:o,zone:s}=n;if(e&&0!==Object.keys(e).length){const r=t||s,i=Zn.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}return Zn.invalid(new xe("unparsable",`the input "${i}" can't be parsed as ${r}`))}function jn(e,t,n=!0){return e.isValid?ke.create(Ge.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function _n(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=B(e.c.year,n?6:4),t?(r+="-",r+=B(e.c.month),r+="-",r+=B(e.c.day)):(r+=B(e.c.month),r+=B(e.c.day)),r}function Ln(e,t,n,r,i,a){let o=B(e.c.hour);return t?(o+=":",o+=B(e.c.minute),0===e.c.second&&n||(o+=":")):o+=B(e.c.minute),0===e.c.second&&n||(o+=B(e.c.second),0===e.c.millisecond&&r||(o+=".",o+=B(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!a?o+="Z":e.o<0?(o+="-",o+=B(Math.trunc(-e.o/60)),o+=":",o+=B(Math.trunc(-e.o%60))):(o+="+",o+=B(Math.trunc(e.o/60)),o+=":",o+=B(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}const $n={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Vn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Pn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Rn=["year","month","day","hour","minute","second","millisecond"],zn=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Bn=["year","ordinal","hour","minute","second","millisecond"];function Hn(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new s(e);return t}function Yn(e,t){const n=Fe(t.zone,Re.defaultZone),r=Ge.fromObject(t),i=Re.now();let a,o;if(_(e.year))a=i;else{for(const t of Rn)_(e[t])&&(e[t]=$n[t]);const t=xn(e)||Dn(e);if(t)return Zn.invalid(t);const r=n.offset(i);[a,o]=An(e,r,n)}return new Zn({ts:a,zone:n,loc:r,o})}function Wn(e,t,n){const r=!!_(n.round)||n.round,i=(e,i)=>(e=U(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)),a=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return i(a(n.unit),n.unit);for(const e of n.units){const t=a(e);if(Math.abs(t)>=1)return i(t,e)}return i(e>t?-0:0,n.units[n.units.length-1])}function Un(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}class Zn{constructor(e){const t=e.zone||Re.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new xe("invalid input"):null)||(t.isValid?null:Tn(t));this.ts=_(e.ts)?Re.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=Nn(this.ts,e),n=Number.isNaN(r.year)?new xe("invalid input"):null,r=n?null:r,i=n?null:e}this._zone=t,this.loc=e.loc||Ge.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new Zn({})}static local(){const[e,t]=Un(arguments),[n,r,i,a,o,s,l]=t;return Yn({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:l},e)}static utc(){const[e,t]=Un(arguments),[n,r,i,a,o,s,l]=t;return e.zone=Ae.utcInstance,Yn({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:l},e)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return Zn.invalid("invalid input");const i=Fe(t.zone,Re.defaultZone);return i.isValid?new Zn({ts:n,zone:i,loc:Ge.fromObject(t)}):Zn.invalid(Tn(i))}static fromMillis(e,t={}){if(L(e))return e<-On||e>On?Zn.invalid("Timestamp out of range"):new Zn({ts:e,zone:Fe(t.zone,Re.defaultZone),loc:Ge.fromObject(t)});throw new l(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(L(e))return new Zn({ts:1e3*e,zone:Fe(t.zone,Re.defaultZone),loc:Ge.fromObject(t)});throw new l("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=Fe(t.zone,Re.defaultZone);if(!n.isValid)return Zn.invalid(Tn(n));const r=Re.now(),i=_(t.specificOffset)?n.offset(r):t.specificOffset,a=ne(e,Hn),s=!_(a.ordinal),l=!_(a.year),c=!_(a.month)||!_(a.day),u=l||c,d=a.weekYear||a.weekNumber,h=Ge.fromObject(t);if((u||s)&&d)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&s)throw new o("Can't mix ordinal dates with month/day");const f=d||a.weekday&&!u;let m,p,g=Nn(r,i);f?(m=zn,p=Vn,g=bn(g)):s?(m=Bn,p=Pn,g=wn(g)):(m=Rn,p=$n);let y=!1;for(const e of m)_(a[e])?a[e]=y?p[e]:g[e]:y=!0;const b=f?function(e){const t=$(e.weekYear),n=z(e.weekNumber,1,G(e.weekYear)),r=z(e.weekday,1,7);return t?n?!r&&mn("weekday",e.weekday):mn("week",e.week):mn("weekYear",e.weekYear)}(a):s?function(e){const t=$(e.year),n=z(e.ordinal,1,q(e.year));return t?!n&&mn("ordinal",e.ordinal):mn("year",e.year)}(a):xn(a),v=b||Dn(a);if(v)return Zn.invalid(v);const w=f?vn(a):s?kn(a):a,[k,x]=An(w,i,n),D=new Zn({ts:k,zone:n,o:x,loc:h});return a.weekday&&u&&e.weekday!==D.weekday?Zn.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${D.toISO()}`):D}static fromISO(e,t={}){const[n,r]=function(e){return et(e,[Tt,Nt],[Ct,At],[Et,It],[St,Ft])}(e);return Fn(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return et(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[vt,wt])}(e);return Fn(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return et(e,[kt,Mt],[xt,Mt],[Dt,Ot])}(e);return Fn(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(_(e)||_(t))throw new l("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,a=Ge.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[o,s,c,u]=function(e,t,n){const{result:r,zone:i,specificOffset:a,invalidReason:o}=dn(e,t,n);return[r,i,a,o]}(a,e,t);return u?Zn.invalid(u):Fn(o,s,n,`format ${t}`,e,c)}static fromString(e,t,n={}){return Zn.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return et(e,[_t,Nt],[Lt,$t])}(e);return Fn(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new l("need to specify a reason the DateTime is invalid");const n=e instanceof xe?e:new xe(e,t);if(Re.throwOnInvalid)throw new r(n);return new Zn({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Cn(this).weekYear:NaN}get weekNumber(){return this.isValid?Cn(this).weekNumber:NaN}get weekday(){return this.isValid?Cn(this).weekday:NaN}get ordinal(){return this.isValid?wn(this.c).ordinal:NaN}get monthShort(){return this.isValid?qt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Z(this.year)}get daysInMonth(){return K(this.year,this.month)}get daysInYear(){return this.isValid?q(this.year):NaN}get weeksInWeekYear(){return this.isValid?G(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=ke.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Ae.instance(e),t)}toLocal(){return this.setZone(Re.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=Fe(e,Re.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=An(n,t,e)}return En(this,{ts:r,zone:e})}return Zn.invalid(Tn(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return En(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ne(e,Hn),n=!_(t.weekYear)||!_(t.weekNumber)||!_(t.weekday),r=!_(t.ordinal),i=!_(t.year),a=!_(t.month)||!_(t.day),s=i||a,l=t.weekYear||t.weekNumber;if((s||r)&&l)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&r)throw new o("Can't mix ordinal dates with month/day");let c;n?c=vn({...bn(this.c),...t}):_(t.ordinal)?(c={...this.toObject(),...t},_(t.day)&&(c.day=Math.min(K(c.year,c.month),c.day))):c=kn({...wn(this.c),...t});const[u,d]=An(c,this.o,this.zone);return En(this,{ts:u,o:d})}plus(e){return this.isValid?En(this,In(this,Wt.fromDurationLike(e))):this}minus(e){return this.isValid?En(this,In(this,Wt.fromDurationLike(e).negate())):this}startOf(e){if(!this.isValid)return this;const t={},n=Wt.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?ke.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Mn}toLocaleString(e=f,t={}){return this.isValid?ke.create(this.loc.clone(t),e).formatDateTime(this):Mn}toLocaleParts(e={}){return this.isValid?ke.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a="extended"===e;let o=_n(this,a);return o+="T",o+=Ln(this,a,t,n,r,i),o}toISODate({format:e="extended"}={}){return this.isValid?_n(this,"extended"===e):null}toISOWeekDate(){return jn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(r?"T":"")+Ln(this,"extended"===a,t,e,n,i):null}toRFC2822(){return jn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?_n(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),jn(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Mn}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Wt.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=(s=t,Array.isArray(s)?s:[s]).map(Wt.normalizeUnit),a=e.valueOf()>this.valueOf(),o=function(e,t,n,r){let[i,a,o,s]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Kt(e,t);return(n-n%7)/7}],["days",Kt]],i={};let a,o;for(const[s,l]of r)if(n.indexOf(s)>=0){a=s;let n=l(e,t);o=e.plus({[s]:n}),o>t?(e=e.plus({[s]:n-1}),n-=1):e=o,i[s]=n}return[e,i,o,a]}(e,t,n);const l=t-i,c=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(o0?Wt.fromMillis(l,r).shiftTo(...c).plus(u):u}(a?this:e,a?e:this,i,r);var s;return a?o.negate():o}diffNow(e="milliseconds",t={}){return this.diff(Zn.now(),e,t)}until(e){return this.isValid?Zt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const n=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t)<=n&&n<=r.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Zn.fromObject({},{zone:this.zone}),n=e.padding?thise.valueOf(),Math.min)}static max(...e){if(!e.every(Zn.isDateTime))throw new l("max requires all arguments be DateTimes");return P(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n;return dn(Ge.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Zn.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return f}static get DATE_MED(){return m}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return g}static get DATE_HUGE(){return y}static get TIME_SIMPLE(){return b}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return w}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return x}static get TIME_24_WITH_SECONDS(){return D}static get TIME_24_WITH_SHORT_OFFSET(){return M}static get TIME_24_WITH_LONG_OFFSET(){return O}static get DATETIME_SHORT(){return T}static get DATETIME_SHORT_WITH_SECONDS(){return C}static get DATETIME_MED(){return E}static get DATETIME_MED_WITH_SECONDS(){return S}static get DATETIME_MED_WITH_WEEKDAY(){return N}static get DATETIME_FULL(){return A}static get DATETIME_FULL_WITH_SECONDS(){return I}static get DATETIME_HUGE(){return F}static get DATETIME_HUGE_WITH_SECONDS(){return j}}function qn(e){if(Zn.isDateTime(e))return e;if(e&&e.valueOf&&L(e.valueOf()))return Zn.fromJSDate(e);if(e&&"object"==typeof e)return Zn.fromObject(e);throw new l(`Unknown datetime argument: ${e}, of type ${typeof e}`)}t.DateTime=Zn,t.Duration=Wt,t.FixedOffsetZone=Ae,t.IANAZone=Se,t.Info=qt,t.Interval=Zt,t.InvalidZone=Ie,t.Settings=Re,t.SystemZone=Oe,t.VERSION="2.5.2",t.Zone=De},314(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},319(e,t,n){n.d(t,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([e.id,'.flatpickr-calendar {\n background: transparent;\n opacity: 0;\n display: none;\n text-align: center;\n visibility: hidden;\n padding: 0;\n -webkit-animation: none;\n animation: none;\n direction: ltr;\n border: 0;\n font-size: 14px;\n line-height: 24px;\n border-radius: 5px;\n position: absolute;\n width: 307.875px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n background: #fff;\n -webkit-box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);\n box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);\n}\n.flatpickr-calendar.open,\n.flatpickr-calendar.inline {\n opacity: 1;\n max-height: 640px;\n visibility: visible;\n}\n.flatpickr-calendar.open {\n display: inline-block;\n z-index: 99999;\n}\n.flatpickr-calendar.animate.open {\n -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);\n animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);\n}\n.flatpickr-calendar.inline {\n display: block;\n position: relative;\n top: 2px;\n}\n.flatpickr-calendar.static {\n position: absolute;\n top: calc(100% + 2px);\n}\n.flatpickr-calendar.static.open {\n z-index: 999;\n display: block;\n}\n.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) {\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n}\n.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {\n -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n}\n.flatpickr-calendar .hasWeeks .dayContainer,\n.flatpickr-calendar .hasTime .dayContainer {\n border-bottom: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.flatpickr-calendar .hasWeeks .dayContainer {\n border-left: 0;\n}\n.flatpickr-calendar.hasTime .flatpickr-time {\n height: 40px;\n border-top: 1px solid #e6e6e6;\n}\n.flatpickr-calendar.noCalendar.hasTime .flatpickr-time {\n height: auto;\n}\n.flatpickr-calendar:before,\n.flatpickr-calendar:after {\n position: absolute;\n display: block;\n pointer-events: none;\n border: solid transparent;\n content: \'\';\n height: 0;\n width: 0;\n left: 22px;\n}\n.flatpickr-calendar.rightMost:before,\n.flatpickr-calendar.arrowRight:before,\n.flatpickr-calendar.rightMost:after,\n.flatpickr-calendar.arrowRight:after {\n left: auto;\n right: 22px;\n}\n.flatpickr-calendar.arrowCenter:before,\n.flatpickr-calendar.arrowCenter:after {\n left: 50%;\n right: 50%;\n}\n.flatpickr-calendar:before {\n border-width: 5px;\n margin: 0 -5px;\n}\n.flatpickr-calendar:after {\n border-width: 4px;\n margin: 0 -4px;\n}\n.flatpickr-calendar.arrowTop:before,\n.flatpickr-calendar.arrowTop:after {\n bottom: 100%;\n}\n.flatpickr-calendar.arrowTop:before {\n border-bottom-color: #e6e6e6;\n}\n.flatpickr-calendar.arrowTop:after {\n border-bottom-color: #fff;\n}\n.flatpickr-calendar.arrowBottom:before,\n.flatpickr-calendar.arrowBottom:after {\n top: 100%;\n}\n.flatpickr-calendar.arrowBottom:before {\n border-top-color: #e6e6e6;\n}\n.flatpickr-calendar.arrowBottom:after {\n border-top-color: #fff;\n}\n.flatpickr-calendar:focus {\n outline: 0;\n}\n.flatpickr-wrapper {\n position: relative;\n display: inline-block;\n}\n.flatpickr-months {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n}\n.flatpickr-months .flatpickr-month {\n background: transparent;\n color: rgba(0,0,0,0.9);\n fill: rgba(0,0,0,0.9);\n height: 34px;\n line-height: 1;\n text-align: center;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n.flatpickr-months .flatpickr-prev-month,\n.flatpickr-months .flatpickr-next-month {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-decoration: none;\n cursor: pointer;\n position: absolute;\n top: 0;\n height: 34px;\n padding: 10px;\n z-index: 3;\n color: rgba(0,0,0,0.9);\n fill: rgba(0,0,0,0.9);\n}\n.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,\n.flatpickr-months .flatpickr-next-month.flatpickr-disabled {\n display: none;\n}\n.flatpickr-months .flatpickr-prev-month i,\n.flatpickr-months .flatpickr-next-month i {\n position: relative;\n}\n.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,\n.flatpickr-months .flatpickr-next-month.flatpickr-prev-month {\n/*\n /*rtl:begin:ignore*/\n/*\n */\n left: 0;\n/*\n /*rtl:end:ignore*/\n/*\n */\n}\n/*\n /*rtl:begin:ignore*/\n/*\n /*rtl:end:ignore*/\n.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,\n.flatpickr-months .flatpickr-next-month.flatpickr-next-month {\n/*\n /*rtl:begin:ignore*/\n/*\n */\n right: 0;\n/*\n /*rtl:end:ignore*/\n/*\n */\n}\n/*\n /*rtl:begin:ignore*/\n/*\n /*rtl:end:ignore*/\n.flatpickr-months .flatpickr-prev-month:hover,\n.flatpickr-months .flatpickr-next-month:hover {\n color: #959ea9;\n}\n.flatpickr-months .flatpickr-prev-month:hover svg,\n.flatpickr-months .flatpickr-next-month:hover svg {\n fill: #f64747;\n}\n.flatpickr-months .flatpickr-prev-month svg,\n.flatpickr-months .flatpickr-next-month svg {\n width: 14px;\n height: 14px;\n}\n.flatpickr-months .flatpickr-prev-month svg path,\n.flatpickr-months .flatpickr-next-month svg path {\n -webkit-transition: fill 0.1s;\n transition: fill 0.1s;\n fill: inherit;\n}\n.numInputWrapper {\n position: relative;\n height: auto;\n}\n.numInputWrapper input,\n.numInputWrapper span {\n display: inline-block;\n}\n.numInputWrapper input {\n width: 100%;\n}\n.numInputWrapper input::-ms-clear {\n display: none;\n}\n.numInputWrapper input::-webkit-outer-spin-button,\n.numInputWrapper input::-webkit-inner-spin-button {\n margin: 0;\n -webkit-appearance: none;\n}\n.numInputWrapper span {\n position: absolute;\n right: 0;\n width: 14px;\n padding: 0 4px 0 2px;\n height: 50%;\n line-height: 50%;\n opacity: 0;\n cursor: pointer;\n border: 1px solid rgba(57,57,57,0.15);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.numInputWrapper span:hover {\n background: rgba(0,0,0,0.1);\n}\n.numInputWrapper span:active {\n background: rgba(0,0,0,0.2);\n}\n.numInputWrapper span:after {\n display: block;\n content: "";\n position: absolute;\n}\n.numInputWrapper span.arrowUp {\n top: 0;\n border-bottom: 0;\n}\n.numInputWrapper span.arrowUp:after {\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 4px solid rgba(57,57,57,0.6);\n top: 26%;\n}\n.numInputWrapper span.arrowDown {\n top: 50%;\n}\n.numInputWrapper span.arrowDown:after {\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid rgba(57,57,57,0.6);\n top: 40%;\n}\n.numInputWrapper span svg {\n width: inherit;\n height: auto;\n}\n.numInputWrapper span svg path {\n fill: rgba(0,0,0,0.5);\n}\n.numInputWrapper:hover {\n background: rgba(0,0,0,0.05);\n}\n.numInputWrapper:hover span {\n opacity: 1;\n}\n.flatpickr-current-month {\n font-size: 135%;\n line-height: inherit;\n font-weight: 300;\n color: inherit;\n position: absolute;\n width: 75%;\n left: 12.5%;\n padding: 7.48px 0 0 0;\n line-height: 1;\n height: 34px;\n display: inline-block;\n text-align: center;\n -webkit-transform: translate3d(0px, 0px, 0px);\n transform: translate3d(0px, 0px, 0px);\n}\n.flatpickr-current-month span.cur-month {\n font-family: inherit;\n font-weight: 700;\n color: inherit;\n display: inline-block;\n margin-left: 0.5ch;\n padding: 0;\n}\n.flatpickr-current-month span.cur-month:hover {\n background: rgba(0,0,0,0.05);\n}\n.flatpickr-current-month .numInputWrapper {\n width: 6ch;\n width: 7ch\\0;\n display: inline-block;\n}\n.flatpickr-current-month .numInputWrapper span.arrowUp:after {\n border-bottom-color: rgba(0,0,0,0.9);\n}\n.flatpickr-current-month .numInputWrapper span.arrowDown:after {\n border-top-color: rgba(0,0,0,0.9);\n}\n.flatpickr-current-month input.cur-year {\n background: transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: inherit;\n cursor: text;\n padding: 0 0 0 0.5ch;\n margin: 0;\n display: inline-block;\n font-size: inherit;\n font-family: inherit;\n font-weight: 300;\n line-height: inherit;\n height: auto;\n border: 0;\n border-radius: 0;\n vertical-align: initial;\n -webkit-appearance: textfield;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.flatpickr-current-month input.cur-year:focus {\n outline: 0;\n}\n.flatpickr-current-month input.cur-year[disabled],\n.flatpickr-current-month input.cur-year[disabled]:hover {\n font-size: 100%;\n color: rgba(0,0,0,0.5);\n background: transparent;\n pointer-events: none;\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months {\n appearance: menulist;\n background: transparent;\n border: none;\n border-radius: 0;\n box-sizing: border-box;\n color: inherit;\n cursor: pointer;\n font-size: inherit;\n font-family: inherit;\n font-weight: 300;\n height: auto;\n line-height: inherit;\n margin: -1px 0 0 0;\n outline: none;\n padding: 0 0 0 0.5ch;\n position: relative;\n vertical-align: initial;\n -webkit-box-sizing: border-box;\n -webkit-appearance: menulist;\n -moz-appearance: menulist;\n width: auto;\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months:focus,\n.flatpickr-current-month .flatpickr-monthDropdown-months:active {\n outline: none;\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months:hover {\n background: rgba(0,0,0,0.05);\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {\n background-color: transparent;\n outline: none;\n padding: 0;\n}\n.flatpickr-weekdays {\n background: transparent;\n text-align: center;\n overflow: hidden;\n width: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -webkit-align-items: center;\n -ms-flex-align: center;\n align-items: center;\n height: 28px;\n}\n.flatpickr-weekdays .flatpickr-weekdaycontainer {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\nspan.flatpickr-weekday {\n cursor: default;\n font-size: 90%;\n background: transparent;\n color: rgba(0,0,0,0.54);\n line-height: 1;\n margin: 0;\n text-align: center;\n display: block;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n font-weight: bolder;\n}\n.dayContainer,\n.flatpickr-weeks {\n padding: 1px 0 0 0;\n}\n.flatpickr-days {\n position: relative;\n overflow: hidden;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: start;\n -webkit-align-items: flex-start;\n -ms-flex-align: start;\n align-items: flex-start;\n width: 307.875px;\n}\n.flatpickr-days:focus {\n outline: 0;\n}\n.dayContainer {\n padding: 0;\n outline: 0;\n text-align: left;\n width: 307.875px;\n min-width: 307.875px;\n max-width: 307.875px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n display: -ms-flexbox;\n display: -webkit-box;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-wrap: wrap;\n flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n -ms-flex-pack: justify;\n -webkit-justify-content: space-around;\n justify-content: space-around;\n -webkit-transform: translate3d(0px, 0px, 0px);\n transform: translate3d(0px, 0px, 0px);\n opacity: 1;\n}\n.dayContainer + .dayContainer {\n -webkit-box-shadow: -1px 0 0 #e6e6e6;\n box-shadow: -1px 0 0 #e6e6e6;\n}\n.flatpickr-day {\n background: none;\n border: 1px solid transparent;\n border-radius: 150px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #393939;\n cursor: pointer;\n font-weight: 400;\n width: 14.2857143%;\n -webkit-flex-basis: 14.2857143%;\n -ms-flex-preferred-size: 14.2857143%;\n flex-basis: 14.2857143%;\n max-width: 39px;\n height: 39px;\n line-height: 39px;\n margin: 0;\n display: inline-block;\n position: relative;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n text-align: center;\n}\n.flatpickr-day.inRange,\n.flatpickr-day.prevMonthDay.inRange,\n.flatpickr-day.nextMonthDay.inRange,\n.flatpickr-day.today.inRange,\n.flatpickr-day.prevMonthDay.today.inRange,\n.flatpickr-day.nextMonthDay.today.inRange,\n.flatpickr-day:hover,\n.flatpickr-day.prevMonthDay:hover,\n.flatpickr-day.nextMonthDay:hover,\n.flatpickr-day:focus,\n.flatpickr-day.prevMonthDay:focus,\n.flatpickr-day.nextMonthDay:focus {\n cursor: pointer;\n outline: 0;\n background: #e6e6e6;\n border-color: #e6e6e6;\n}\n.flatpickr-day.today {\n border-color: #959ea9;\n}\n.flatpickr-day.today:hover,\n.flatpickr-day.today:focus {\n border-color: #959ea9;\n background: #959ea9;\n color: #fff;\n}\n.flatpickr-day.selected,\n.flatpickr-day.startRange,\n.flatpickr-day.endRange,\n.flatpickr-day.selected.inRange,\n.flatpickr-day.startRange.inRange,\n.flatpickr-day.endRange.inRange,\n.flatpickr-day.selected:focus,\n.flatpickr-day.startRange:focus,\n.flatpickr-day.endRange:focus,\n.flatpickr-day.selected:hover,\n.flatpickr-day.startRange:hover,\n.flatpickr-day.endRange:hover,\n.flatpickr-day.selected.prevMonthDay,\n.flatpickr-day.startRange.prevMonthDay,\n.flatpickr-day.endRange.prevMonthDay,\n.flatpickr-day.selected.nextMonthDay,\n.flatpickr-day.startRange.nextMonthDay,\n.flatpickr-day.endRange.nextMonthDay {\n background: #569ff7;\n -webkit-box-shadow: none;\n box-shadow: none;\n color: #fff;\n border-color: #569ff7;\n}\n.flatpickr-day.selected.startRange,\n.flatpickr-day.startRange.startRange,\n.flatpickr-day.endRange.startRange {\n border-radius: 50px 0 0 50px;\n}\n.flatpickr-day.selected.endRange,\n.flatpickr-day.startRange.endRange,\n.flatpickr-day.endRange.endRange {\n border-radius: 0 50px 50px 0;\n}\n.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),\n.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),\n.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {\n -webkit-box-shadow: -10px 0 0 #569ff7;\n box-shadow: -10px 0 0 #569ff7;\n}\n.flatpickr-day.selected.startRange.endRange,\n.flatpickr-day.startRange.startRange.endRange,\n.flatpickr-day.endRange.startRange.endRange {\n border-radius: 50px;\n}\n.flatpickr-day.inRange {\n border-radius: 0;\n -webkit-box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n}\n.flatpickr-day.flatpickr-disabled,\n.flatpickr-day.flatpickr-disabled:hover,\n.flatpickr-day.prevMonthDay,\n.flatpickr-day.nextMonthDay,\n.flatpickr-day.notAllowed,\n.flatpickr-day.notAllowed.prevMonthDay,\n.flatpickr-day.notAllowed.nextMonthDay {\n color: rgba(57,57,57,0.3);\n background: transparent;\n border-color: transparent;\n cursor: default;\n}\n.flatpickr-day.flatpickr-disabled,\n.flatpickr-day.flatpickr-disabled:hover {\n cursor: not-allowed;\n color: rgba(57,57,57,0.1);\n}\n.flatpickr-day.week.selected {\n border-radius: 0;\n -webkit-box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;\n box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;\n}\n.flatpickr-day.hidden {\n visibility: hidden;\n}\n.rangeMode .flatpickr-day {\n margin-top: 1px;\n}\n.flatpickr-weekwrapper {\n float: left;\n}\n.flatpickr-weekwrapper .flatpickr-weeks {\n padding: 0 12px;\n -webkit-box-shadow: 1px 0 0 #e6e6e6;\n box-shadow: 1px 0 0 #e6e6e6;\n}\n.flatpickr-weekwrapper .flatpickr-weekday {\n float: none;\n width: 100%;\n line-height: 28px;\n}\n.flatpickr-weekwrapper span.flatpickr-day,\n.flatpickr-weekwrapper span.flatpickr-day:hover {\n display: block;\n width: 100%;\n max-width: none;\n color: rgba(57,57,57,0.3);\n background: transparent;\n cursor: default;\n border: none;\n}\n.flatpickr-innerContainer {\n display: block;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n}\n.flatpickr-rContainer {\n display: inline-block;\n padding: 0;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.flatpickr-time {\n text-align: center;\n outline: 0;\n display: block;\n height: 0;\n line-height: 40px;\n max-height: 40px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n}\n.flatpickr-time:after {\n content: "";\n display: table;\n clear: both;\n}\n.flatpickr-time .numInputWrapper {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 40%;\n height: 40px;\n float: left;\n}\n.flatpickr-time .numInputWrapper span.arrowUp:after {\n border-bottom-color: #393939;\n}\n.flatpickr-time .numInputWrapper span.arrowDown:after {\n border-top-color: #393939;\n}\n.flatpickr-time.hasSeconds .numInputWrapper {\n width: 26%;\n}\n.flatpickr-time.time24hr .numInputWrapper {\n width: 49%;\n}\n.flatpickr-time input {\n background: transparent;\n -webkit-box-shadow: none;\n box-shadow: none;\n border: 0;\n border-radius: 0;\n text-align: center;\n margin: 0;\n padding: 0;\n height: inherit;\n line-height: inherit;\n color: #393939;\n font-size: 14px;\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-appearance: textfield;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.flatpickr-time input.flatpickr-hour {\n font-weight: bold;\n}\n.flatpickr-time input.flatpickr-minute,\n.flatpickr-time input.flatpickr-second {\n font-weight: 400;\n}\n.flatpickr-time input:focus {\n outline: 0;\n border: 0;\n}\n.flatpickr-time .flatpickr-time-separator,\n.flatpickr-time .flatpickr-am-pm {\n height: inherit;\n float: left;\n line-height: inherit;\n color: #393939;\n font-weight: bold;\n width: 2%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.flatpickr-time .flatpickr-am-pm {\n outline: 0;\n width: 18%;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n}\n.flatpickr-time input:hover,\n.flatpickr-time .flatpickr-am-pm:hover,\n.flatpickr-time input:focus,\n.flatpickr-time .flatpickr-am-pm:focus {\n background: #eee;\n}\n.flatpickr-input[readonly] {\n cursor: pointer;\n}\n@-webkit-keyframes fpFadeInDown {\n from {\n opacity: 0;\n -webkit-transform: translate3d(0, -20px, 0);\n transform: translate3d(0, -20px, 0);\n }\n to {\n opacity: 1;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n }\n}\n@keyframes fpFadeInDown {\n from {\n opacity: 0;\n -webkit-transform: translate3d(0, -20px, 0);\n transform: translate3d(0, -20px, 0);\n }\n to {\n opacity: 1;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n }\n}\n',""]);const s=o},338(e,t,n){n.r(t),n.d(t,{default:()=>y});var r=n(72),i=n.n(r),a=n(825),o=n.n(a),s=n(659),l=n.n(s),c=n(56),u=n.n(c),d=n(540),h=n.n(d),f=n(113),m=n.n(f),p=n(407),g={};g.styleTagTransform=m(),g.setAttributes=u(),g.insert=l().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=h(),i()(p.A,g);const y=p.A&&p.A.locals?p.A.locals:void 0},407(e,t,n){n.d(t,{A:()=>c});var r=n(601),i=n.n(r),a=n(314),o=n.n(a),s=n(319),l=o()(i());l.i(s.A),l.push([e.id,".redmine-tracky .timer-sessions-table td{text-align:left !important}.redmine-tracky .timer-sessions-table td.timer-session-table-issue a{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.redmine-tracky .timer-sessions-table td.timer-session-table-issue a:hover{white-space:normal}.redmine-tracky .timer-session-table-comments{overflow:auto;overflow-wrap:normal}.redmine-tracky .timer-session-table-actions{text-align:right !important}.redmine-tracky .gap-marker{position:relative;border-bottom:1px solid #fc8c12}.redmine-tracky .gap-marker.error-block:after{bottom:-2px;width:calc(100% + 1px);left:-1px}.redmine-tracky .hidden{display:none}.redmine-tracky .mb-3{margin-bottom:1rem !important}.redmine-tracky .mt-3{margin-top:1rem !important}.redmine-tracky .mr-3{margin-right:1rem !important}.redmine-tracky .ml-3{margin-left:1rem !important}.redmine-tracky .mx-auto{margin-left:auto;margin-right:auto}.redmine-tracky .error{color:#d74427}.redmine-tracky .w-20{width:20% !important}.redmine-tracky .w-25{width:25% !important}.redmine-tracky .w-30{width:30% !important}.redmine-tracky .w-40{width:40% !important}.redmine-tracky .w-50{width:50% !important}.redmine-tracky .w-75{width:75% !important}.redmine-tracky .w-100{width:100% !important}@media only screen and (max-width: 480px){.redmine-tracky [class*=w-]{width:100% !important}}.redmine-tracky .error-block{border-style:solid;border-color:#d74427;border-width:1.5px}.redmine-tracky .error-block-overlap{background-color:#fef9fa !important}.redmine-tracky .error-block-overlap:nth-child(odd){background-color:#fff3f3 !important}.redmine-tracky .error-block-overlap:nth-child(even){background-color:#fce4e6 !important}.redmine-tracky .timer-sessions-table{border-collapse:collapse}.redmine-tracky .timer-sessions-table>td{text-align:left;margin-left:5px}.redmine-tracky .text-center{text-align:center}.redmine-tracky .space-between{display:flex;-moz-box-pack:justify;justify-content:space-between;-moz-box-align:center;align-items:center}.redmine-tracky .h3{font-size:3rem}.redmine-tracky .left-text{text-align:left}.redmine-tracky .right-text{text-align:right !important}.redmine-tracky label{display:block;margin-bottom:.5rem}.redmine-tracky .text-muted{color:#6c757d !important}.redmine-tracky .form-text{display:block;margin-top:.25rem}.redmine-tracky small{font-size:80%;font-weight:400}.redmine-tracky .col-1{width:8.3333333333%}.redmine-tracky .col-2{width:16.6666666667%}.redmine-tracky .col-3{width:25%}.redmine-tracky .col-4{width:33.3333333333%}.redmine-tracky .col-5{width:41.6666666667%}.redmine-tracky .col-6{width:50%}.redmine-tracky .col-7{width:58.3333333333%}.redmine-tracky .col-8{width:66.6666666667%}.redmine-tracky .col-9{width:75%}.redmine-tracky .col-10{width:83.3333333333%}.redmine-tracky .col-11{width:91.6666666667%}.redmine-tracky .col-12{width:100%}@media only screen and (max-width: 768px){.redmine-tracky [class*=col-]{width:100%}}.redmine-tracky .float-right{float:right !important}.redmine-tracky .table-fixed{table-layout:fixed}.redmine-tracky .hyphens-auto{hyphens:auto}.redmine-tracky .times-container{column-count:2}.redmine-tracky .timer-container button svg{stroke:#fff}.redmine-tracky input:disabled,.redmine-tracky button:disabled{background-color:#e9ecef;opacity:1;cursor:default}",""]);const c=l},467(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),n(338);const i=n(891),a=r(n(799)),o=r(n(480)),s=r(n(877)),l=r(n(717)),c=r(n(155));window.Stimulus=i.Application.start(),window.Stimulus.register("form",a.default),window.Stimulus.register("timer",o.default),window.Stimulus.register("list",s.default),window.Stimulus.register("issue-completion",l.default),window.Stimulus.register("flatpickr",c.default)},480(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891),i=n(169);class a extends r.Controller{constructor(){super(...arguments),this.timeDiffFields=["hours","minutes","seconds"],this.timeDiffFormat="hh:mm:ss"}connect(){const e=this.startTarget.value,t=this.endTarget.value;if(document.title=e?"⏱️ Tracky":"❌ Tracky",e&&t){const e=this.timeDifference();this.updateTimerLabel(e)}else e&&this.startTicker()}disconnect(){this.stopTicker()}startTicker(){window.TimerInterval=setInterval(()=>{const e=this.timeDifference();this.updateTimerLabel(e)},1e3)}stopTicker(){window.TimerInterval&&clearInterval(window.TimerInterval)}timeDiffToString(e){const t=i.Duration.fromObject(e).toFormat("hh:mm:ss").replace(/-/g,"");return(Object.values(e).some(e=>e<0)?"-":"")+t}dateTimeFromTarget(e){const t=this.convertToDateTime(e.value);return t.isValid?t:this.adjustedDateTime()}timeDifference(){const e=this.dateTimeFromTarget(this.startTarget),t=this.dateTimeFromTarget(this.endTarget).diff(e,this.timeDiffFields);return this.timeDiffToString(t.values||{})}convertToDateTime(e){return i.DateTime.fromFormat(e,window.RedmineTracky.datetimeFormatJavascript)}updateTimerLabel(e){$(this.labelTarget).text(e)}adjustedDateTime(){return i.DateTime.local()}}a.targets=["start","end","label","description"],a.values={timezone:Number},t.default=a},540(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601(e){e.exports=function(e){return e[1]}},659(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},717(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891);class i extends r.Controller{connect(){this.listenForInput(),this.fetchIssuesFromURL()}listenForInput(){this.cleanup(),observeAutocompleteField(this.inputTarget.id,function(e,t){const n=window.RedmineTracky.issueCompletionPath,r={term:e.term,scope:"all"};$.get(n,r,null,"json").done(e=>t(e)).fail(()=>t([]))},{select:(e,t)=>(this.addIssue(t),this.cleanup(),!1)})}fetchIssuesFromURL(){new URLSearchParams(window.location.search).getAll("issue_ids[]").filter(e=>""!==e).forEach(e=>{const t=window.RedmineTracky.issueCompletionPath,n={term:e,scope:"all"};$.get(t,n,null,"json").done(e=>{const[t]=e;this.addIssue({item:t})}).fail(()=>{console.error(`Failed to fetch issue with ID: ${e}`)})})}addIssue(e){const t=this.application.getControllerForElementAndIdentifier(this.listAnchorTarget,"list");t?.addItem(e.item)}clearInput(){$(this.inputTarget).val("")}cleanup(){this.clearInput(),$(".ui-autocomplete").hide(),$(".ui-helper-hidden-accessible").hide()}}i.targets=["input","listAnchor"],i.values={update:Boolean},t.default=i},799(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891),i=n(169);class a extends r.Controller{constructor(){super(...arguments),this.connected=!1}connect(){this.connected=!0}disconnect(){this.connected=!1}absoluteTime(e){try{const e=parseFloat(this.absolutInputTarget.value),t=this.convertToDateTime(this.startTarget.value);if(e&&t.isValid){const n=t.plus({hours:e});this.endTarget.value=n.toFormat("dd.LL.yyyy HH:mm"),this.endTarget.dispatchEvent(new Event("change"))}}finally{this.absolutInputTarget.value=""}}issueTargetConnected(e){this.connected&&this.change()}issueTargetDisconnected(e){this.connected&&this.change()}change(){const e={timer_start:this.startTarget.value,timer_end:this.endTarget.value,comments:this.descriptionTarget.value,issue_ids:this.extractIssueIds()||[]};this.dispatchUpdate(e)}extractIssueIds(){return this.issueTargets.map(e=>e.getAttribute("data-issue-id")||"").filter(e=>null!==e)||[]}dispatchUpdate(e){this.hasStopButtonTarget&&$.ajax({type:"POST",url:window.RedmineTracky.trackerUpdatePath,data:{timer_session:e},async:!0})}convertToDateTime(e){return i.DateTime.fromFormat(e,window.RedmineTracky.datetimeFormatJavascript)}}a.targets=["description","start","stopButton","end","issue","absolutInput"],t.default=a},820(e,t,n){n.r(t),n.d(t,{default:()=>ie});var r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],i={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.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},a={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(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%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};const o=a;var s=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},l=function(e){return!0===e?1:0};function c(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var u=function(e){return e instanceof Array?e:[e]};function d(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function h(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,void 0!==n&&(r.textContent=n),r}function f(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function m(e,t){return t(e)?e:e.parentNode?m(e.parentNode,t):void 0}function p(e,t){var n=h("div","numInputWrapper"),r=h("input","numInput "+e),i=h("span","arrowUp"),a=h("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?r.type="number":(r.type="text",r.pattern="\\d*"),void 0!==t)for(var o in t)r.setAttribute(o,t[o]);return n.appendChild(r),n.appendChild(i),n.appendChild(a),n}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var y=function(){},b=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},v={D:y,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*l(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(r-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:y,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:y,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},w={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})"},k={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[k.w(e,t,n)]},F:function(e,t,n){return b(k.n(e,t,n)-1,!1,t)},G:function(e,t,n){return s(k.h(e,t,n))},H:function(e){return s(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[l(e.getHours()>11)]},M:function(e,t){return b(e.getMonth(),!0,t)},S:function(e){return s(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return s(e.getFullYear(),4)},d:function(e){return s(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return s(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return s(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},x=function(e){var t=e.config,n=void 0===t?i:t,r=e.l10n,o=void 0===r?a:r,s=e.isMobile,l=void 0!==s&&s;return function(e,t,r){var i=r||o;return void 0===n.formatDate||l?t.split("").map(function(t,r,a){return k[t]&&"\\"!==a[r-1]?k[t](e,i,n):"\\"!==t?t:""}).join(""):n.formatDate(e,t,i)}},D=function(e){var t=e.config,n=void 0===t?i:t,r=e.l10n,o=void 0===r?a:r;return function(e,t,r,a){if(0===e||e){var s,l=a||o,c=e;if(e instanceof Date)s=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)s=new Date(e);else if("string"==typeof e){var u=t||(n||i).dateFormat,d=String(e).trim();if("today"===d)s=new Date,r=!0;else if(n&&n.parseDate)s=n.parseDate(e,u);else if(/Z$/.test(d)||/GMT$/.test(d))s=new Date(e);else{for(var h=void 0,f=[],m=0,p=0,g="";m=0?new Date:new Date(n.config.minDate.getTime()),r=T(n.config);t.setHours(r.hours,r.minutes,r.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,r=g(e),i=r;void 0!==n.amPM&&r===n.amPM&&(n.amPM.textContent=n.l10n.amPM[l(n.amPM.textContent===n.l10n.amPM[0])]);var a=parseFloat(i.getAttribute("min")),o=parseFloat(i.getAttribute("max")),c=parseFloat(i.getAttribute("step")),u=parseInt(i.value,10),d=u+c*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==i.value&&2===i.value.length){var h=i===n.hourElement,f=i===n.minuteElement;do&&(d=i===n.hourElement?d-o-l(!n.amPM):a,f&&V(void 0,1,n.hourElement)),n.amPM&&h&&(1===c?d+u===23:Math.abs(d-u)>c)&&(n.amPM.textContent=n.l10n.amPM[l(n.amPM.textContent===n.l10n.amPM[0])]),i.value=s(d)}}(e);var i=n._input.value;S(),xe(),n._input.value!==i&&n._debouncedChange()}function S(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,r=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,a=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=r,t=n.amPM.textContent,r=e%12+12*l(t===n.l10n.amPM[1]));var o=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===M(n.latestSelectedDateObj,n.config.minDate,!0),s=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===M(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var c=O(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),u=O(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=O(r,i,a);if(d>u&&d=12)]),void 0!==n.secondElement&&(n.secondElement.value=s(r)))}function F(e){var t=g(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&X(n)}function j(e,t,r,i){return t instanceof Array?t.forEach(function(t){return j(e,t,r,i)}):e instanceof Array?e.forEach(function(e){return j(e,t,r,i)}):(e.addEventListener(t,r,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,r,i)}}))}function _(){ye("onChange")}function L(e,t){var r=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate=0&&M(e,n.selectedDates[1])<=0}(t)&&!ve(t)&&o.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend",""+n.config.getWeek(t)+""),ye("onDayCreate",o),o}function R(e){e.focus(),"range"===n.config.mode&&ie(e)}function z(e){for(var t=e>0?0:n.config.showMonths-1,r=e>0?n.config.showMonths:-1,i=t;i!=r;i+=e)for(var a=n.daysContainer.children[i],o=e>0?0:a.children.length-1,s=e>0?a.children.length:-1,l=o;l!=s;l+=e){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&ee(c.dateObj))return c}}function B(e,t){var r=a(),i=te(r||document.body),o=void 0!==e?e:i?r:void 0!==n.selectedDateElem&&te(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&te(n.todayDateElem)?n.todayDateElem:z(t>0?1:-1);void 0===o?n._input.focus():i?function(e,t){for(var r=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,a=t>0?1:-1,o=r-n.currentMonth;o!=i;o+=a)for(var s=n.daysContainer.children[o],l=r-n.currentMonth===o?e.$i+t:t<0?s.children.length-1:0,c=s.children.length,u=l;u>=0&&u0?c:-1);u+=a){var d=s.children[u];if(-1===d.className.indexOf("hidden")&&ee(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return R(d)}n.changeMonth(a),B(z(a),0)}(o,t):R(o)}function H(e,t){for(var r=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),a=n.utils.getDaysInMonth(t,e),o=window.document.createDocumentFragment(),s=n.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-r,d=0;u<=i;u++,d++)o.appendChild(P("flatpickr-day "+l,new Date(e,t-1,u),0,d));for(u=1;u<=a;u++,d++)o.appendChild(P("flatpickr-day",new Date(e,t,u),0,d));for(var f=a+1;f<=42-r&&(1===n.config.showMonths||d%7!=0);f++,d++)o.appendChild(P("flatpickr-day "+c,new Date(e,t+1,f%a),0,d));var m=h("div","dayContainer");return m.appendChild(o),m}function Y(){if(void 0!==n.daysContainer){f(n.daysContainer),n.weekNumbers&&f(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&en.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var r=h("option","flatpickr-monthDropdown-month");r.value=new Date(n.currentYear,t).getMonth().toString(),r.textContent=b(t,n.config.shorthandCurrentMonth,n.l10n),r.tabIndex=-1,n.currentMonth===t&&(r.selected=!0),n.monthsDropdownContainer.appendChild(r)}}}function U(){var e,t=h("div","flatpickr-month"),r=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=h("span","cur-month"):(n.monthsDropdownContainer=h("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),j(n.monthsDropdownContainer,"change",function(e){var t=g(e),r=parseInt(t.value,10);n.changeMonth(r-n.currentMonth),ye("onMonthChange")}),W(),e=n.monthsDropdownContainer);var i=p("cur-year",{tabindex:"-1"}),a=i.getElementsByTagName("input")[0];a.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&a.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(a.setAttribute("max",n.config.maxDate.getFullYear().toString()),a.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var o=h("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(i),r.appendChild(o),t.appendChild(r),{container:t,yearElement:a,monthElement:e}}function Z(){f(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=U();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function q(){n.weekdayContainer?f(n.weekdayContainer):n.weekdayContainer=h("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=h("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return K(),n.weekdayContainer}function K(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=E(n.l10n.weekdays.shorthand);e>0&&e\n "+t.join("")+"\n \n "}}function J(e,t){void 0===t&&(t=!0);var r=t?e:e-n.currentMonth;r<0&&!0===n._hidePrevMonthArrow||r>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=r,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,ye("onYearChange"),W()),Y(),ye("onMonthChange"),we())}function G(e){return n.calendarContainer.contains(e)}function Q(e){if(n.isOpen&&!n.config.inline){var t=g(e),r=G(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||r||G(e.relatedTarget)),a=!n.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&a&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&k(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function X(e){if(!(!e||n.config.minDate&&en.config.maxDate.getFullYear())){var t=e,r=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),r&&(n.redraw(),ye("onYearChange"),W())}}function ee(e,t){var r;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&M(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&M(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===i)return!1;for(var a=!!n.config.enable,o=null!==(r=n.config.enable)&&void 0!==r?r:n.config.disable,s=0,l=void 0;s=l.from.getTime()&&i.getTime()<=l.to.getTime())return a}return!a}function te(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function ne(e){var t=e.target===n._input,r=n._input.value.trimEnd()!==ke();!t||!r||e.relatedTarget&&G(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function re(t){var r=g(t),i=n.config.wrap?e.contains(r):r===n._input,o=n.config.allowInput,s=n.isOpen&&(!o||!i),l=n.config.inline&&i&&!o;if(13===t.keyCode&&i){if(o)return n.setDate(n._input.value,!0,r===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),r.blur();n.open()}else if(G(r)||s||l){var c=!!n.timeContainer&&n.timeContainer.contains(r);switch(t.keyCode){case 13:c?(t.preventDefault(),k(),de()):he(t);break;case 27:t.preventDefault(),de();break;case 8:case 46:i&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(c||i)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var u=a();if(void 0!==n.daysContainer&&(!1===o||u&&te(u))){var d=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),J(d),B(z(1),0)):B(void 0,d)}}break;case 38:case 40:t.preventDefault();var h=40===t.keyCode?1:-1;n.daysContainer&&void 0!==r.$i||r===n.input||r===n.altInput?t.ctrlKey?(t.stopPropagation(),X(n.currentYear-h),B(z(1),0)):c||B(void 0,7*h):r===n.currentYearElement?X(n.currentYear-h):n.config.enableTime&&(!c&&n.hourElement&&n.hourElement.focus(),k(t),n._debouncedChange());break;case 9:if(c){var f=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(e){return e}),m=f.indexOf(r);if(-1!==m){var p=f[m+(t.shiftKey?-1:1)];t.preventDefault(),(p||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(r)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&r===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],S(),xe();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],S(),xe()}(i||G(r))&&ye("onKeyDown",t)}function ie(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var r=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),a=Math.min(r,n.selectedDates[0].getTime()),o=Math.max(r,n.selectedDates[0].getTime()),s=!1,l=0,c=0,u=a;ua&&ul)?l=u:u>i&&(!c||u ."+t)).forEach(function(t){var a,o,u,d=t.dateObj.getTime(),h=l>0&&d0&&d>c;if(h)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)});s&&!h||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==e&&(e.classList.add(r<=n.selectedDates[0].getTime()?"startRange":"endRange"),ir&&d===i&&t.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=i,u=r,(a=d)>Math.min(o,u)&&a0||r.getMinutes()>0||r.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(e){return ee(e)}),n.selectedDates.length||"min"!==e||N(r),xe()),n.daysContainer&&(ue(),void 0!==r?n.currentYearElement[e]=r.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==r&&i.getFullYear()===r.getFullYear())}}function se(){return n.config.wrap?e.querySelector("[data-input]"):e}function le(){"object"!=typeof n.config.locale&&void 0===A.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=C(C({},A.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?A.l10ns[n.config.locale]:void 0),w.D="("+n.l10n.weekdays.shorthand.join("|")+")",w.l="("+n.l10n.weekdays.longhand.join("|")+")",w.M="("+n.l10n.months.shorthand.join("|")+")",w.F="("+n.l10n.months.longhand.join("|")+")",w.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===C(C({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===A.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=x(n),n.parseDate=D({config:n.config,l10n:n.l10n})}function ce(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){ye("onPreCalendarPosition");var t=e||n._positionElement,r=Array.prototype.reduce.call(n.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),i=n.calendarContainer.offsetWidth,a=n.config.position.split(" "),o=a[0],s=a.length>1?a[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===o||"below"!==o&&cr,h=window.pageYOffset+l.top+(u?-r-2:t.offsetHeight+2);if(d(n.calendarContainer,"arrowTop",!u),d(n.calendarContainer,"arrowBottom",u),!n.config.inline){var f=window.pageXOffset+l.left,m=!1,p=!1;"center"===s?(f-=(i-l.width)/2,m=!0):"right"===s&&(f-=i-l.width,p=!0),d(n.calendarContainer,"arrowLeft",!m&&!p),d(n.calendarContainer,"arrowCenter",m),d(n.calendarContainer,"arrowRight",p);var g=window.document.body.offsetWidth-(window.pageXOffset+l.right),y=f+i>window.document.body.offsetWidth,b=g+i>window.document.body.offsetWidth;if(d(n.calendarContainer,"rightMost",y),!n.config.static)if(n.calendarContainer.style.top=h+"px",y)if(b){var v=function(){for(var e=null,t=0;tn.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=r,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var o=ve(i);o?n.selectedDates.splice(parseInt(o),1):n.selectedDates.push(i)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==M(i,n.selectedDates[0],!0)&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(S(),a){var s=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),s&&(ye("onYearChange"),W()),ye("onMonthChange")}if(we(),Y(),xe(),a||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():R(r),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var l="single"===n.config.mode&&!n.config.enableTime,c="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(l||c)&&de()}_()}}n.parseDate=D({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=j,n._setHoursFromDate=N,n._positionCalendar=ce,n.changeMonth=J,n.changeYear=X,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var r=T(n.config);I(r.hours,r.minutes,r.seconds)}n.redraw(),e&&ye("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),ye("onClose")},n.onMouseOver=ie,n._createElement=h,n.createDay=P,n.destroy=function(){void 0!==n.config&&ye("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete n[e]}catch(e){}})},n.isEnabled=ee,n.jumpToDate=L,n.updateValue=xe,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var r=g(e);r&&r.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void ye("onOpen")}if(!n._input.disabled&&!n.config.inline){var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),ye("onOpen"),ce(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return n.hourElement.select()},50))}},n.redraw=ue,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var i in Object.assign(n.config,e),e)void 0!==fe[i]&&fe[i].forEach(function(e){return e()});else n.config[e]=t,void 0!==fe[e]?fe[e].forEach(function(e){return e()}):r.indexOf(e)>-1&&(n.config[e]=u(t));n.redraw(),xe(!0)},n.setDate=function(e,t,r){if(void 0===t&&(t=!1),void 0===r&&(r=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);me(e,r),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),L(void 0,t),N(),0===n.selectedDates.length&&n.clear(!1),xe(t),t&&ye("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var fe={locale:[le,K],showMonths:[Z,v,q],minDate:[L],maxDate:[L],positionElement:[ge],clickOpens:[function(){!0===n.config.clickOpens?(j(n._input,"focus",n.open),j(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function me(e,t){var r=[];if(e instanceof Array)r=e.map(function(e){return n.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)r=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":r=[n.parseDate(e,t)];break;case"multiple":r=e.split(n.config.conjunction).map(function(e){return n.parseDate(e,t)});break;case"range":r=e.split(n.l10n.rangeSeparator).map(function(e){return n.parseDate(e,t)})}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?r:r.filter(function(e){return e instanceof Date&&ee(e,!1)}),"range"===n.config.mode&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function pe(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(){n._positionElement=n.config.positionElement||n._input}function ye(e,t){if(void 0!==n.config){var r=n.config[e];if(void 0!==r&&r.length>0)for(var i=0;r[i]&&i1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=b(r.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=r.getMonth().toString(),e.value=r.getFullYear().toString()}),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYearn.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function ke(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(e){return n.formatDate(e,t)}).filter(function(e,t,r){return"range"!==n.config.mode||n.config.enableTime||r.indexOf(e)===t}).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function xe(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=ke(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=ke(n.config.altFormat)),!1!==e&&ye("onValueUpdate")}function De(e){var t=g(e),r=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);r||i?J(r?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],o=C(C({},JSON.parse(JSON.stringify(e.dataset||{}))),t),s={};n.config.parseDate=o.parseDate,n.config.formatDate=o.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=pe(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=pe(e)}});var l="time"===o.mode;if(!o.dateFormat&&(o.enableTime||l)){var c=A.defaultConfig.dateFormat||i.dateFormat;s.dateFormat=o.noCalendar||l?"H:i"+(o.enableSeconds?":S":""):c+" H:i"+(o.enableSeconds?":S":"")}if(o.altInput&&(o.enableTime||l)&&!o.altFormat){var d=A.defaultConfig.altFormat||i.altFormat;s.altFormat=o.noCalendar||l?"h:i"+(o.enableSeconds?":S K":" K"):d+" h:i"+(o.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:oe("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:oe("max")});var h=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:h("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:h("max")}),"time"===o.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,s,o);for(var f=0;f-1?n.config[p]=u(m[p]).map(y).concat(n.config[p]):void 0===o[p]&&(n.config[p]=m[p])}o.altInputClass||(n.config.altInputClass=se().className+" "+n.config.altInputClass),ye("onParseConfig")}(),le(),n.input=se(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=h(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),ge()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&me(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=h("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=h("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=h("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=h("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,Z(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(d(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(d(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],we(),n.monthNav)),n.innerContainer=h("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=h("div","flatpickr-weekwrapper");e.appendChild(h("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=h("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),r=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(r),n.weekNumbers=i,n.weekWrapper=r}n.rContainer=h("div","flatpickr-rContainer"),n.rContainer.appendChild(q()),n.daysContainer||(n.daysContainer=h("div","flatpickr-days"),n.daysContainer.tabIndex=-1),Y(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=T(n.config);n.timeContainer=h("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=h("span","flatpickr-time-separator",":"),r=p("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=r.getElementsByTagName("input")[0];var i=p("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=s(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=s(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(r),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var a=p("flatpickr-second");n.secondElement=a.getElementsByTagName("input")[0],n.secondElement.value=s(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(h("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(a)}return n.config.time_24hr||(n.amPM=h("span","flatpickr-am-pm",n.l10n.amPM[l((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),d(n.calendarContainer,"rangeMode","range"===n.config.mode),d(n.calendarContainer,"animate",!0===n.config.animate),d(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var a=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!a&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var o=h("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(o,n.element),o.appendChild(n.element),n.altInput&&o.appendChild(n.altInput),o.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),function(t){return j(t,"click",n[e])})}),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=h("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}j(n.mobileInput,"change",function(e){n.setDate(g(e).value,!1,n.mobileFormatStr),ye("onChange"),ye("onClose")})}();else{var e=c(ae,50);if(n._debouncedChange=c(_,300),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&j(n.daysContainer,"mouseover",function(e){"range"===n.config.mode&&ie(g(e))}),j(n._input,"keydown",re),void 0!==n.calendarContainer&&j(n.calendarContainer,"keydown",re),n.config.inline||n.config.static||j(window,"resize",e),void 0!==window.ontouchstart?j(window.document,"touchstart",Q):j(window.document,"mousedown",Q),j(window.document,"focus",Q,{capture:!0}),!0===n.config.clickOpens&&(j(n._input,"focus",n.open),j(n._input,"click",n.open)),void 0!==n.daysContainer&&(j(n.monthNav,"click",De),j(n.monthNav,["keyup","increment"],F),j(n.daysContainer,"click",he)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){j(n.timeContainer,["increment"],k),j(n.timeContainer,"blur",k,{capture:!0}),j(n.timeContainer,"click",$),j([n.hourElement,n.minuteElement],["focus","click"],function(e){return g(e).select()}),void 0!==n.secondElement&&j(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),void 0!==n.amPM&&j(n.amPM,"click",function(e){k(e)})}n.config.allowInput&&j(n._input,"blur",ne)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&N(n.config.noCalendar?n.latestSelectedDateObj:void 0),xe(!1)),v();var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&a&&ce(),ye("onReady")}(),n}function N(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),r=[],i=0;it.toUpperCase())}function R(e){return e.charAt(0).toUpperCase()+e.slice(1)}function z(e,t){const n=B(e);return Array.from(n.reduce((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach(t=>e.add(t)),e),new Set))}function B(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}function H([e,t]){return function(e,t){const n=`${i=e,i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}-value`,r=function(e){const t=function(e){const t=Y(e.type);if(t){const n=W(e.default);if(t!==n)throw new Error(`Type "${t}" must match the type of the default value. Given default value: "${e.default}" as "${n}"`);return t}}(e),n=W(e),r=Y(e),i=t||n||r;if(i)return i;throw new Error(`Unknown value type "${e}"`)}(t);var i;return{type:r,key:n,name:P(n),get defaultValue(){return function(e){const t=Y(e);if(t)return U[t];const n=e.default;return void 0!==n?n:e}(t)},get hasCustomDefaultValue(){return void 0!==W(t)},reader:Z[r],writer:q[r]||q.default}}(e,t)}function Y(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function W(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e(function(){this.a.call(this)});t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();const U={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Z={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError("Expected array");return t},boolean:e=>!("0"==e||"false"==e),number:e=>Number(e),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("Expected object");return t},string:e=>e},q={default:function(e){return`${e}`},array:K,object:K};function K(e){return JSON.stringify(e)}class J{constructor(e){this.context=e}static get shouldLoad(){return!0}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:i=!0,cancelable:a=!0}={}){const o=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:a});return t.dispatchEvent(o),o}}J.blessings=[function(e){return z(e,"classes").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${R(n)}Class`]:{get(){return this.classes.has(n)}}}));var n},{})},function(e){return z(e,"targets").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${R(n)}Target`]:{get(){return this.targets.has(n)}}}));var n},{})},function(e){const t=function(e,t){return B(e).reduce((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map(e=>[e,n[e]]):[]}(n,t)),e),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce((e,t)=>{const n=H(t),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})},{})}}};return t.reduce((e,t)=>Object.assign(e,function(e){const t=H(e),{key:n,name:r,reader:i,writer:a}=t;return{[r]:{get(){const e=this.data.get(n);return null!==e?i(e):t.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,a(e))}},[`has${R(r)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}(t)),n)}],J.targets=[],J.values={};const G=["altFormat","ariaDateFormat","dateFormat"],Q={string:["altInputClass","conjunction","mode","nextArrow","position","prevArrow","monthSelectorType"],boolean:["allowInput","altInput","animate","clickOpens","closeOnSelect","disableMobile","enableSeconds","enableTime","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate","maxTime","minTime","now"],array:["disable","enable","disableDaysOfWeek","enableDaysOfWeek"],number:["defaultHour","defaultMinute","defaultSeconds","hourIncrement","minuteIncrement","showMonths"],arrayOrString:["defaultDate"]},X=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],ee=["calendarContainer","currentYearElement","days","daysContainer","input","nextMonthNav","monthNav","prevMonthNav","rContainer","selectedDateElem","todayDateElem","weekdayContainer"],te={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%-l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"},ne=new RegExp(Object.keys(te).join("|").replace(new RegExp("\\^","g"),"\\^"),"g");let re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$(e,t)}(i,e);var t,n,r=V(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.apply(this,arguments)}return t=i,n=[{key:"initialize",value:function(){this.config={}}},{key:"connect",value:function(){this._initializeEvents(),this._initializeOptions(),this._initializeDateFormats(),this.fp=I(this.flatpickrElement,function(e){for(var t=1;t{if(this[e]){const n=`on${t=e,t.charAt(0).toUpperCase()+t.slice(1)}`;this.config[n]=this[e].bind(this)}var t})}},{key:"_initializeOptions",value:function(){Object.keys(Q).forEach(e=>{Q[e].forEach(t=>{const n=t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase();this.data.has(n)&&(this.config[t]=this[`_${e}`](n))})}),this._handleDaysOfWeek()}},{key:"_handleDaysOfWeek",value:function(){this.config.disableDaysOfWeek&&(this.config.disableDaysOfWeek=this._validateDaysOfWeek(this.config.disableDaysOfWeek),this.config.disable=[...this.config.disable||[],this._disable.bind(this)]),this.config.enableDaysOfWeek&&(this.config.enableDaysOfWeek=this._validateDaysOfWeek(this.config.enableDaysOfWeek),this.config.enable=[...this.config.enable||[],this._enable.bind(this)])}},{key:"_validateDaysOfWeek",value:function(e){return Array.isArray(e)?e.map(e=>parseInt(e)):(console.error("days of week must be a valid array"),[])}},{key:"_disable",value:function(e){return this.config.disableDaysOfWeek.includes(e.getDay())}},{key:"_enable",value:function(e){return this.config.enableDaysOfWeek.includes(e.getDay())}},{key:"_initializeDateFormats",value:function(){G.forEach(e=>{this.data.has(e)&&(this.config[e]=this.data.get(e).replace(ne,e=>te[e]))})}},{key:"_initializeElements",value:function(){ee.forEach(e=>{this[`${e}Target`]=this.fp[e]})}},{key:"_string",value:function(e){return this.data.get(e)}},{key:"_date",value:function(e){return this.data.get(e)}},{key:"_boolean",value:function(e){return!("0"==this.data.get(e)||"false"==this.data.get(e))}},{key:"_array",value:function(e){return JSON.parse(this.data.get(e))}},{key:"_number",value:function(e){return parseInt(this.data.get(e))}},{key:"_arrayOrString",value:function(e){const t=this.data.get(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"flatpickrElement",get:function(){return this.hasInstanceTarget&&this.instanceTarget||this.element}}],n&&F(t.prototype,n),i}(J);j(re,"targets",["instance"]);const ie=re},825(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},877(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891);class i extends r.Controller{addItem(e){this.tableTarget.querySelector("tbody").appendChild(this.buildItem(e))}removeItem({target:e}){const t=e;t.closest('[data-form-target="issue"]')?.remove()}buildItem(e){const t=this.tableTarget.querySelector("template").content.cloneNode(!0),n=t.querySelector("a"),r=t.querySelector("input");return n.href=`/issues/${e.id}`,n.innerHTML=`${e.project} - ${e.id}: `,r.id=`timer_session_issue_id_${e.id}`,r.value=e.id.toString(),t.querySelector("tr").setAttribute("data-issue-id",e.id.toString()),t.querySelector("[data-issue-subject]").innerHTML=e.subject,t}}i.targets=["table"],t.default=i},891(e,t,n){n.r(t),n.d(t,{Application:()=>Q,AttributeObserver:()=>w,Context:()=>$,Controller:()=>le,ElementObserver:()=>v,IndexedMultimap:()=>T,Multimap:()=>O,SelectorObserver:()=>C,StringMapObserver:()=>E,TokenListObserver:()=>S,ValueListObserver:()=>N,add:()=>k,defaultSchema:()=>J,del:()=>x,fetch:()=>D,prune:()=>M});class r{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{const n=e.index,r=t.index;return nr?1:0})}}class i{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:r}=e,i=this.fetchEventListenerMapForEventTarget(t),a=this.cacheKey(n,r);i.delete(a),0==i.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:r}=e;return this.fetchEventListener(t,n,r)}fetchEventListener(e,t,n){const r=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,n);let a=r.get(i);return a||(a=this.createEventListener(e,t,n),r.set(i,a)),a}createEventListener(e,t,n){const i=new r(e,t,n);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach(e=>{n.push(`${t[e]?"":"!"}${e}`)}),n.join(":")}}const a={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:n})=>!t||n===e.target},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function s(e){return e.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function l(e){return s(e.replace(/--/g,"-").replace(/__/g,"_"))}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function u(e){return e.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function d(e){return null!=e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const f=["meta","ctrl","alt","shift"];class m{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in p)return p[t](e)}(e)||g("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||g("missing identifier"),this.methodName=n.methodName||g("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(o)||[];let n=t[2],r=t[3];return r&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${r}`,r=""),{eventTarget:(i=t[4],"window"==i?window:"document"==i?document:void 0),eventName:n,eventOptions:t[7]?(a=t[7],a.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r};var i,a}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter(e=>!f.includes(e))[0];return!!n&&(h(this.keyMappings,n)||g(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:r}of Array.from(this.element.attributes)){const i=n.match(t),a=i&&i[1];a&&(e[s(a)]=y(r))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,i,a]=f.map(e=>t.includes(e));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==i||e.shiftKey!==a}}const p={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function g(e){throw new Error(e)}function y(e){try{return JSON.parse(e)}catch(t){return e}}class b{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:r}=this.context;let i=!0;for(const[a,o]of Object.entries(this.eventOptions))if(a in n){const s=n[a];i=i&&s({name:a,value:o,event:e,element:t,controller:r})}return i}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:r,element:i,index:a}=this,o={identifier:n,controller:r,element:i,index:a,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class v{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class w{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new v(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function k(e,t,n){D(e,t).add(n)}function x(e,t,n){D(e,t).delete(n),M(e,t)}function D(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function M(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class O{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e.concat(Array.from(t)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e+t.size,0)}add(e,t){k(this.valuesByKey,e,t)}delete(e,t){x(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(t=>t.has(e))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,n])=>n.has(e)).map(([e,t])=>e)}}class T extends O{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),k(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),x(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class C{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new v(e,this),this.delegate=n,this.matchesByElement=new O}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(t)).filter(e=>this.matchElement(e));return n.concat(r)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),r=this.matchesByElement.has(n,e);t&&!r?this.selectorMatched(e,n):!t&&r&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class E{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const r=this.element.getAttribute(e);if(this.stringMap.get(e)!=r&&this.stringMapValueChanged(r,n,t),null==r){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,r)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class S{constructor(e,t,n){this.attributeObserver=new w(e,t,this),this.delegate=n,this.tokensByElement=new O}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(e=>this.tokenMatched(e))}tokensUnmatched(e){e.forEach(e=>this.tokenUnmatched(e))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),r=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},(n,r)=>[e[r],t[r]])}(t,n).findIndex(([e,t])=>{return r=t,!((n=e)&&r&&n.index==r.index&&n.content==r.content);var n,r});return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter(e=>e.length).map((e,r)=>({element:t,attributeName:n,content:e,index:r}))}(e.getAttribute(t)||"",e,t)}}class N{constructor(e,t,n){this.tokenListObserver=new S(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class A{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new N(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new b(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){const t=m.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class I{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new E(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const r=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=r.writer(r.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const r=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,r.writer(this.receiver[e]),n):this.invokeChangedCallback(e,r.writer(r.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:r}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,r(n),void 0)}invokeChangedCallback(e,t,n){const r=`${e}Changed`,i=this.receiver[r];if("function"==typeof i){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let a=n;n&&(a=r.reader(n)),i.call(this.receiver,e,a)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${r.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{const n=this.valueDescriptorMap[t];e[n.name]=n}),e}hasValue(e){const t=`has${c(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class F{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new O}start(){this.tokenListObserver||(this.tokenListObserver=new S(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function j(e,t){const n=_(e);return Array.from(n.reduce((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach(t=>e.add(t)),e),new Set))}function _(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class L{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new O,this.outletElementsByName=new O,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const r=this.getOutlet(e,n);r&&this.connectOutlet(r,e,n)}selectorUnmatched(e,t,{outletName:n}){const r=this.getOutletFromMap(e,n);r&&this.disconnectOutlet(r,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),r=this.hasOutlet(e,t),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&r&&i&&e.matches(n)}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause(()=>this.delegate.outletConnected(e,t,n)))}disconnectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause(()=>this.delegate.outletDisconnected(e,t,n)))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new C(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new w(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){const e=new O;return this.router.modules.forEach(t=>{j(t.definition.controllerConstructor,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(t=>t.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class ${constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:i}=this;t=Object.assign({identifier:n,controller:r,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new A(this,this.dispatcher),this.valueObserver=new I(this,this.controller),this.targetObserver=new F(this,this),this.outletObserver=new L(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:r,controller:i,element:a}=this;n=Object.assign({identifier:r,controller:i,element:a},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}const V="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,P=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e(function(){this.a.call(this)});t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class R{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,function(e,t){const n=P(e),r=function(e,t){return V(t).reduce((n,r)=>{const i=function(e,t,n){const r=Object.getOwnPropertyDescriptor(e,n);if(!r||!("value"in r)){const e=Object.getOwnPropertyDescriptor(t,n).value;return r&&(e.get=r.get||e.get,e.set=r.set||e.set),e}}(e,t,r);return i&&Object.assign(n,{[r]:i}),n},{})}(e.prototype,t);return Object.defineProperties(n.prototype,r),n}(t,function(e){return j(e,"blessings").reduce((t,n)=>{const r=n(e);for(const e in r){const n=t[e]||{};t[e]=Object.assign(n,r[e])}return t},{})}(t)))};var t}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new $(this,e),this.contextsByScope.set(e,t)),t}}class z{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return(this.data.get(this.getDataKey(e))||"").match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class B{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${u(e)}`}}class H{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))}}function Y(e,t){return`[${e}~="${t}"]`}class W{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)],[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return Y(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(t=>this.deprecate(t,e))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return Y(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${i}="${t}". The ${r} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class U{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findOutlet(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllOutlets(t)],[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))}matchesElement(e,t,n){const r=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&r.split(" ").includes(n)}}class Z{constructor(e,t,n,r){this.targets=new W(this),this.classes=new z(this),this.data=new B(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new H(r),this.outlets=new U(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return Y(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Z(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class q{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new N(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let r=n.get(t);return r||(r=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,r)),r}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class K{constructor(e){this.application=e,this.scopeObserver=new q(this.element,this.schema,this),this.scopesByIdentifier=new O,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new R(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find(t=>t.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new Z(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.connectContextForScope(t))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.disconnectContextForScope(t))}}const J={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},G("abcdefghijklmnopqrstuvwxyz".split("").map(e=>[e,e]))),G("0123456789".split("").map(e=>[e,e])))};function G(e){return e.reduce((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n}),{})}class Q{constructor(e=document.documentElement,t=J){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new i(this),this.router=new K(this),this.actionDescriptorFilters=Object.assign({},a)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise(e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",()=>e()):e()}),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>this.router.unloadIdentifier(e))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var r;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(r=window.onerror)||void 0===r||r.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function X(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function ee(e,t,n){let r=X(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=X(e,t,n),r||void 0)}function te([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,r=`${u(t)}-value`,i=function(e){const{controller:t,token:n,typeDefinition:r}=e,i=function(e){const{controller:t,token:n,typeObject:r}=e,i=d(r.type),a=d(r.default),o=i&&a,s=i&&!a,l=!i&&a,c=ne(r.type),u=re(e.typeObject.default);if(s)return c;if(l)return u;if(c!==u)throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${r.default}" is of type "${u}".`);return o?c:void 0}({controller:t,token:n,typeObject:r}),a=re(r),o=ne(r),s=i||a||o;if(s)return s;throw new Error(`Unknown value type "${t?`${t}.${r}`:n}" for "${n}" value`)}(e);return{type:i,key:r,name:s(r),get defaultValue(){return function(e){const t=ne(e);if(t)return ie[t];const n=h(e,"default"),r=h(e,"type"),i=e;if(n)return i.default;if(r){const{type:e}=i,t=ne(e);if(t)return ie[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==re(n)},reader:ae[i],writer:oe[i]||oe.default}}({controller:n,token:e,typeDefinition:t})}function ne(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function re(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const ie={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ae={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${re(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${re(t)}"`);return t},string:e=>e},oe={default:function(e){return`${e}`},array:se,object:se};function se(e){return JSON.stringify(e)}class le{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:i=!0,cancelable:a=!0}={}){const o=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:a});return t.dispatchEvent(o),o}}le.blessings=[function(e){return j(e,"classes").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${c(n)}Class`]:{get(){return this.classes.has(n)}}}));var n},{})},function(e){return j(e,"targets").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${c(n)}Target`]:{get(){return this.targets.has(n)}}}));var n},{})},function(e){const t=function(e,t){return _(e).reduce((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map(e=>[e,n[e]]):[]}(n,t)),e),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce((e,t)=>{const n=te(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})},{})}}};return t.reduce((e,t)=>Object.assign(e,function(e){const t=te(e,void 0),{key:n,name:r,reader:i,writer:a}=t;return{[r]:{get(){const e=this.data.get(n);return null!==e?i(e):t.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,a(e))}},[`has${c(r)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}(t)),n)},function(e){return j(e,"outlets").reduce((e,t)=>Object.assign(e,function(e){const t=l(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=ee(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map(t=>{const n=ee(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)}).filter(e=>e):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${c(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t)),{})}],le.targets=[],le.outlets=[],le.values={}},990(){"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,n(467)})(); \ No newline at end of file +(()=>{"use strict";var e={56(e,t,n){e.exports=function(e){var t=n.nc;t&&e.setAttribute("nonce",t)}},72(e){var t=[];function n(e){for(var n=-1,r=0;r{const i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function R(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function z(e,t,n){return $(e)&&e>=t&&e<=n}function B(e,t=2){let n;return n=e<0?"-"+(""+-e).padStart(t,"0"):(""+e).padStart(t,"0"),n}function H(e){return _(e)||null===e||""===e?void 0:parseInt(e,10)}function Y(e){return _(e)||null===e||""===e?void 0:parseFloat(e)}function W(e){if(!_(e)&&null!==e&&""!==e){const t=1e3*parseFloat("0."+e);return Math.floor(t)}}function U(e,t,n=!1){const r=10**t;return(n?Math.trunc:Math.round)(e*r)/r}function Z(e){return e%4==0&&(e%100!=0||e%400==0)}function q(e){return Z(e)?366:365}function K(e,t){const n=(r=t-1)-12*Math.floor(r/12)+1;var r;return 2===n?Z(e+(t-n)/12)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function J(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(t.getUTCFullYear()-1900)),+t}function G(e){const t=(e+Math.floor(e/4)-Math.floor(e/100)+Math.floor(e/400))%7,n=e-1,r=(n+Math.floor(n/4)-Math.floor(n/100)+Math.floor(n/400))%7;return 4===t||3===r?53:52}function Q(e){return e>99?e:e>60?1900+e:2e3+e}function X(e,t,n,r=null){const i=new Date(e),a={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};r&&(a.timeZone=r);const o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>"timezonename"===e.type.toLowerCase());return s?s.value:null}function ee(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);const r=parseInt(t,10)||0;return 60*n+(n<0||Object.is(n,-0)?-r:r)}function te(e){const t=Number(e);if("boolean"==typeof e||""===e||Number.isNaN(t))throw new l(`Invalid unit value ${e}`);return t}function ne(e,t){const n={};for(const r in e)if(R(e,r)){const i=e[r];if(null==i)continue;n[t(r)]=te(i)}return n}function re(e,t){const n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?"+":"-";switch(t){case"short":return`${i}${B(n,2)}:${B(r,2)}`;case"narrow":return`${i}${n}${r>0?`:${r}`:""}`;case"techie":return`${i}${B(n,2)}${B(r,2)}`;default:throw new RangeError(`Value format ${t} is out of range for property format`)}}function ie(e){return function(e){return["hour","minute","second","millisecond"].reduce((t,n)=>(t[n]=e[n],t),{})}(e)}const ae=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/,oe=["January","February","March","April","May","June","July","August","September","October","November","December"],se=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],le=["J","F","M","A","M","J","J","A","S","O","N","D"];function ce(e){switch(e){case"narrow":return[...le];case"short":return[...se];case"long":return[...oe];case"numeric":return["1","2","3","4","5","6","7","8","9","10","11","12"];case"2-digit":return["01","02","03","04","05","06","07","08","09","10","11","12"];default:return null}}const ue=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],de=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],he=["M","T","W","T","F","S","S"];function fe(e){switch(e){case"narrow":return[...he];case"short":return[...de];case"long":return[...ue];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const me=["AM","PM"],pe=["Before Christ","Anno Domini"],ge=["BC","AD"],ye=["B","A"];function be(e){switch(e){case"narrow":return[...ye];case"short":return[...ge];case"long":return[...pe];default:return null}}function ve(e,t){let n="";for(const r of e)r.literal?n+=r.val:n+=t(r.val);return n}const we={D:f,DD:m,DDD:g,DDDD:y,t:b,tt:v,ttt:w,tttt:k,T:x,TT:D,TTT:M,TTTT:O,f:T,ff:E,fff:A,ffff:F,F:C,FF:S,FFF:I,FFFF:j};class ke{static create(e,t={}){return new ke(e,t)}static parseFormat(e){let t=null,n="",r=!1;const i=[];for(let a=0;a0&&i.push({literal:r,val:n}),t=null,n="",r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:!1,val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r,val:n}),i}static macroTokenToFormatOpts(e){return we[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return null===this.systemLoc&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTime(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).format()}formatDateTimeParts(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).formatToParts()}resolvedOptions(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t}).resolvedOptions()}num(e,t=0){if(this.opts.forceSimple)return B(e,t);const n={...this.opts};return t>0&&(n.padTo=t),this.loc.numberFormatter(n).format(e)}formatDateTimeFromString(e,t){const n="en"===this.loc.listingMode(),r=this.loc.outputCalendar&&"gregory"!==this.loc.outputCalendar,i=(t,n)=>this.loc.extract(e,t,n),a=t=>e.isOffsetFixed&&0===e.offset&&t.allowZ?"Z":e.isValid?e.zone.formatOffset(e.ts,t.format):"",o=(t,r)=>n?function(e,t){return ce(t)[e.month-1]}(e,t):i(r?{month:t}:{month:t,day:"numeric"},"month"),s=(t,r)=>n?function(e,t){return fe(t)[e.weekday-1]}(e,t):i(r?{weekday:t}:{weekday:t,month:"long",day:"numeric"},"weekday"),l=t=>{const n=ke.macroTokenToFormatOpts(t);return n?this.formatWithSystemDefault(e,n):t},c=t=>n?function(e,t){return be(t)[e.year<0?0:1]}(e,t):i({era:t},"era");return ve(ke.parseFormat(t),t=>{switch(t){case"S":return this.num(e.millisecond);case"u":case"SSS":return this.num(e.millisecond,3);case"s":return this.num(e.second);case"ss":return this.num(e.second,2);case"uu":return this.num(Math.floor(e.millisecond/10),2);case"uuu":return this.num(Math.floor(e.millisecond/100));case"m":return this.num(e.minute);case"mm":return this.num(e.minute,2);case"h":return this.num(e.hour%12==0?12:e.hour%12);case"hh":return this.num(e.hour%12==0?12:e.hour%12,2);case"H":return this.num(e.hour);case"HH":return this.num(e.hour,2);case"Z":return a({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return a({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return a({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return e.zone.offsetName(e.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return e.zone.offsetName(e.ts,{format:"long",locale:this.loc.locale});case"z":return e.zoneName;case"a":return n?function(e){return me[e.hour<12?0:1]}(e):i({hour:"numeric",hourCycle:"h12"},"dayperiod");case"d":return r?i({day:"numeric"},"day"):this.num(e.day);case"dd":return r?i({day:"2-digit"},"day"):this.num(e.day,2);case"c":case"E":return this.num(e.weekday);case"ccc":return s("short",!0);case"cccc":return s("long",!0);case"ccccc":return s("narrow",!0);case"EEE":return s("short",!1);case"EEEE":return s("long",!1);case"EEEEE":return s("narrow",!1);case"L":return r?i({month:"numeric",day:"numeric"},"month"):this.num(e.month);case"LL":return r?i({month:"2-digit",day:"numeric"},"month"):this.num(e.month,2);case"LLL":return o("short",!0);case"LLLL":return o("long",!0);case"LLLLL":return o("narrow",!0);case"M":return r?i({month:"numeric"},"month"):this.num(e.month);case"MM":return r?i({month:"2-digit"},"month"):this.num(e.month,2);case"MMM":return o("short",!1);case"MMMM":return o("long",!1);case"MMMMM":return o("narrow",!1);case"y":return r?i({year:"numeric"},"year"):this.num(e.year);case"yy":return r?i({year:"2-digit"},"year"):this.num(e.year.toString().slice(-2),2);case"yyyy":return r?i({year:"numeric"},"year"):this.num(e.year,4);case"yyyyyy":return r?i({year:"numeric"},"year"):this.num(e.year,6);case"G":return c("short");case"GG":return c("long");case"GGGGG":return c("narrow");case"kk":return this.num(e.weekYear.toString().slice(-2),2);case"kkkk":return this.num(e.weekYear,4);case"W":return this.num(e.weekNumber);case"WW":return this.num(e.weekNumber,2);case"o":return this.num(e.ordinal);case"ooo":return this.num(e.ordinal,3);case"q":return this.num(e.quarter);case"qq":return this.num(e.quarter,2);case"X":return this.num(Math.floor(e.ts/1e3));case"x":return this.num(e.ts);default:return l(t)}})}formatDurationFromString(e,t){const n=e=>{switch(e[0]){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":return"hour";case"d":return"day";case"w":return"week";case"M":return"month";case"y":return"year";default:return null}},r=ke.parseFormat(t),i=r.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]);return ve(r,(e=>t=>{const r=n(t);return r?this.num(e.get(r),t.length):t})(e.shiftTo(...i.map(n).filter(e=>e))))}}class xe{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}class De{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}}let Me=null;class Oe extends De{static get instance(){return null===Me&&(Me=new Oe),Me}get type(){return"system"}get name(){return(new Intl.DateTimeFormat).resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return X(e,t,n)}formatOffset(e,t){return re(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return"system"===e.type}get isValid(){return!0}}let Te={};const Ce={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};let Ee={};class Se extends De{static create(e){return Ee[e]||(Ee[e]=new Se(e)),Ee[e]}static resetCache(){Ee={},Te={}}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:e}).format(),!0}catch(e){return!1}}constructor(e){super(),this.zoneName=e,this.valid=Se.isValidZone(e)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return X(e,t,n,this.name)}formatOffset(e,t){return re(this.offset(e),t)}offset(e){const t=new Date(e);if(isNaN(t))return NaN;const n=(r=this.name,Te[r]||(Te[r]=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:r,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"})),Te[r]);var r;let[i,a,o,s,l,c,u]=n.formatToParts?function(e,t){const n=e.formatToParts(t),r=[];for(let e=0;e=0?h:1e3+h,(J({year:i,month:a,day:o,hour:24===l?0:l,minute:c,second:u,millisecond:0})-d)/6e4}equals(e){return"iana"===e.type&&e.name===this.name}get isValid(){return this.valid}}let Ne=null;class Ae extends De{static get utcInstance(){return null===Ne&&(Ne=new Ae(0)),Ne}static instance(e){return 0===e?Ae.utcInstance:new Ae(e)}static parseSpecifier(e){if(e){const t=e.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(t)return new Ae(ee(t[1],t[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return"fixed"}get name(){return 0===this.fixed?"UTC":`UTC${re(this.fixed,"narrow")}`}get ianaName(){return 0===this.fixed?"Etc/UTC":`Etc/GMT${re(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(e,t){return re(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return"fixed"===e.type&&e.fixed===this.fixed}get isValid(){return!0}}class Ie extends De{constructor(e){super(),this.zoneName=e}get type(){return"invalid"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return""}offset(){return NaN}equals(){return!1}get isValid(){return!1}}function Fe(e,t){if(_(e)||null===e)return t;if(e instanceof De)return e;if("string"==typeof e){const n=e.toLowerCase();return"local"===n||"system"===n?t:"utc"===n||"gmt"===n?Ae.utcInstance:Ae.parseSpecifier(n)||Se.create(e)}return L(e)?Ae.instance(e):"object"==typeof e&&e.offset&&"number"==typeof e.offset?e:new Ie(e)}let je,_e=()=>Date.now(),Le="system",$e=null,Ve=null,Pe=null;class Re{static get now(){return _e}static set now(e){_e=e}static set defaultZone(e){Le=e}static get defaultZone(){return Fe(Le,Oe.instance)}static get defaultLocale(){return $e}static set defaultLocale(e){$e=e}static get defaultNumberingSystem(){return Ve}static set defaultNumberingSystem(e){Ve=e}static get defaultOutputCalendar(){return Pe}static set defaultOutputCalendar(e){Pe=e}static get throwOnInvalid(){return je}static set throwOnInvalid(e){je=e}static resetCaches(){Ge.resetCache(),Se.resetCache()}}let ze={},Be={};function He(e,t={}){const n=JSON.stringify([e,t]);let r=Be[n];return r||(r=new Intl.DateTimeFormat(e,t),Be[n]=r),r}let Ye={},We={},Ue=null;function Ze(e,t,n,r,i){const a=e.listingMode(n);return"error"===a?null:"en"===a?r(t):i(t)}class qe{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;const{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){const t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=function(e,t={}){const n=JSON.stringify([e,t]);let r=Ye[n];return r||(r=new Intl.NumberFormat(e,t),Ye[n]=r),r}(e,t)}}format(e){if(this.inf){const t=this.floor?Math.floor(e):e;return this.inf.format(t)}return B(this.floor?Math.floor(e):U(e,3),this.padTo)}}class Ke{constructor(e,t,n){let r;if(this.opts=n,e.zone.isUniversal){const t=e.offset/60*-1,i=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;0!==e.offset&&Se.create(i).valid?(r=i,this.dt=e):(r="UTC",n.timeZoneName?this.dt=e:this.dt=0===e.offset?e:Zn.fromMillis(e.ts+60*e.offset*1e3))}else"system"===e.zone.type?this.dt=e:(this.dt=e,r=e.zone.name);const i={...this.opts};r&&(i.timeZone=r),this.dtf=He(t,i)}format(){return this.dtf.format(this.dt.toJSDate())}formatToParts(){return this.dtf.formatToParts(this.dt.toJSDate())}resolvedOptions(){return this.dtf.resolvedOptions()}}class Je{constructor(e,t,n){this.opts={style:"long",...n},!t&&V()&&(this.rtf=function(e,t={}){const{base:n,...r}=t,i=JSON.stringify([e,r]);let a=We[i];return a||(a=new Intl.RelativeTimeFormat(e,t),We[i]=a),a}(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):function(e,t,n="always",r=!1){const i={years:["year","yr."],quarters:["quarter","qtr."],months:["month","mo."],weeks:["week","wk."],days:["day","day","days"],hours:["hour","hr."],minutes:["minute","min."],seconds:["second","sec."]},a=-1===["hours","minutes","seconds"].indexOf(e);if("auto"===n&&a){const n="days"===e;switch(t){case 1:return n?"tomorrow":`next ${i[e][0]}`;case-1:return n?"yesterday":`last ${i[e][0]}`;case 0:return n?"today":`this ${i[e][0]}`}}const o=Object.is(t,-0)||t<0,s=Math.abs(t),l=1===s,c=i[e],u=r?l?c[1]:c[2]||c[1]:l?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}(t,e,this.opts.numeric,"long"!==this.opts.style)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}}class Ge{static fromOpts(e){return Ge.create(e.locale,e.numberingSystem,e.outputCalendar,e.defaultToEN)}static create(e,t,n,r=!1){const i=e||Re.defaultLocale,a=i||(r?"en-US":Ue||(Ue=(new Intl.DateTimeFormat).resolvedOptions().locale,Ue)),o=t||Re.defaultNumberingSystem,s=n||Re.defaultOutputCalendar;return new Ge(a,o,s,i)}static resetCache(){Ue=null,Be={},Ye={},We={}}static fromObject({locale:e,numberingSystem:t,outputCalendar:n}={}){return Ge.create(e,t,n)}constructor(e,t,n,r){const[i,a,o]=function(e){const t=e.indexOf("-u-");if(-1===t)return[e];{let n;const r=e.substring(0,t);try{n=He(e).resolvedOptions()}catch(e){n=He(r).resolvedOptions()}const{numberingSystem:i,calendar:a}=n;return[r,i,a]}}(e);this.locale=i,this.numberingSystem=t||a||null,this.outputCalendar=n||o||null,this.intl=function(e,t,n){return n||t?(e+="-u",n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=r,this.fastNumbersCached=null}get fastNumbers(){var e;return null==this.fastNumbersCached&&(this.fastNumbersCached=(!(e=this).numberingSystem||"latn"===e.numberingSystem)&&("latn"===e.numberingSystem||!e.locale||e.locale.startsWith("en")||"latn"===new Intl.DateTimeFormat(e.intl).resolvedOptions().numberingSystem)),this.fastNumbersCached}listingMode(){const e=this.isEnglish(),t=!(null!==this.numberingSystem&&"latn"!==this.numberingSystem||null!==this.outputCalendar&&"gregory"!==this.outputCalendar);return e&&t?"en":"intl"}clone(e){return e&&0!==Object.getOwnPropertyNames(e).length?Ge.create(e.locale||this.specifiedLocale,e.numberingSystem||this.numberingSystem,e.outputCalendar||this.outputCalendar,e.defaultToEN||!1):this}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1,n=!0){return Ze(this,e,n,ce,()=>{const n=t?{month:e,day:"numeric"}:{month:e},r=t?"format":"standalone";return this.monthsCache[r][e]||(this.monthsCache[r][e]=function(e){const t=[];for(let n=1;n<=12;n++){const r=Zn.utc(2016,n,1);t.push(e(r))}return t}(e=>this.extract(e,n,"month"))),this.monthsCache[r][e]})}weekdays(e,t=!1,n=!0){return Ze(this,e,n,fe,()=>{const n=t?{weekday:e,year:"numeric",month:"long",day:"numeric"}:{weekday:e},r=t?"format":"standalone";return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=function(e){const t=[];for(let n=1;n<=7;n++){const r=Zn.utc(2016,11,13+n);t.push(e(r))}return t}(e=>this.extract(e,n,"weekday"))),this.weekdaysCache[r][e]})}meridiems(e=!0){return Ze(this,void 0,e,()=>me,()=>{if(!this.meridiemCache){const e={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Zn.utc(2016,11,13,9),Zn.utc(2016,11,13,19)].map(t=>this.extract(t,e,"dayperiod"))}return this.meridiemCache})}eras(e,t=!0){return Ze(this,e,t,be,()=>{const t={era:e};return this.eraCache[e]||(this.eraCache[e]=[Zn.utc(-40,1,1),Zn.utc(2017,1,1)].map(e=>this.extract(e,t,"era"))),this.eraCache[e]})}extract(e,t,n){const r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new qe(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ke(e,this.intl,t)}relFormatter(e={}){return new Je(this.intl,this.isEnglish(),e)}listFormatter(e={}){return function(e,t={}){const n=JSON.stringify([e,t]);let r=ze[n];return r||(r=new Intl.ListFormat(e,t),ze[n]=r),r}(this.intl,e)}isEnglish(){return"en"===this.locale||"en-us"===this.locale.toLowerCase()||new Intl.DateTimeFormat(this.intl).resolvedOptions().locale.startsWith("en-us")}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}}function Qe(...e){const t=e.reduce((e,t)=>e+t.source,"");return RegExp(`^${t}$`)}function Xe(...e){return t=>e.reduce(([e,n,r],i)=>{const[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function et(e,...t){if(null==e)return[null,null];for(const[n,r]of t){const t=n.exec(e);if(t)return r(t)}return[null,null]}function tt(...e){return(t,n)=>{const r={};let i;for(i=0;ivoid 0!==e&&(t||e&&u)?-e:e;return[{years:h(Y(n)),months:h(Y(r)),weeks:h(Y(i)),days:h(Y(a)),hours:h(Y(o)),minutes:h(Y(s)),seconds:h(Y(l),"-0"===l),milliseconds:h(W(c),d)}]}const yt={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function bt(e,t,n,r,i,a,o){const s={year:2===t.length?Q(H(t)):H(t),month:se.indexOf(n)+1,day:H(r),hour:H(i),minute:H(a)};return o&&(s.second=H(o)),e&&(s.weekday=e.length>3?ue.indexOf(e)+1:de.indexOf(e)+1),s}const vt=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function wt(e){const[,t,n,r,i,a,o,s,l,c,u,d]=e,h=bt(t,i,r,n,a,o,s);let f;return f=l?yt[l]:c?0:ee(u,d),[h,new Ae(f)]}const kt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,xt=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Dt=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Mt(e){const[,t,n,r,i,a,o,s]=e;return[bt(t,i,r,n,a,o,s),Ae.utcInstance]}function Ot(e){const[,t,n,r,i,a,o,s]=e;return[bt(t,s,n,r,i,a,o),Ae.utcInstance]}const Tt=Qe(/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,at),Ct=Qe(/(\d{4})-?W(\d\d)(?:-?(\d))?/,at),Et=Qe(/(\d{4})-?(\d{3})/,at),St=Qe(it),Nt=Xe(function(e,t){return[{year:ut(e,t),month:ut(e,t+1,1),day:ut(e,t+2,1)},null,t+3]},dt,ht,ft),At=Xe(ot,dt,ht,ft),It=Xe(st,dt,ht,ft),Ft=Xe(dt,ht,ft),jt=Xe(dt),_t=Qe(/(\d{4})-(\d\d)-(\d\d)/,ct),Lt=Qe(lt),$t=Xe(dt,ht,ft),Vt={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},Pt={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...Vt},Rt={years:{quarters:4,months:12,weeks:52.1775,days:365.2425,hours:8765.82,minutes:525949.2,seconds:525949.2*60,milliseconds:525949.2*60*1e3},quarters:{months:3,weeks:13.044375,days:91.310625,hours:2191.455,minutes:131487.3,seconds:525949.2*60/4,milliseconds:7889237999.999999},months:{weeks:4.3481250000000005,days:30.436875,hours:730.485,minutes:43829.1,seconds:2629746,milliseconds:2629746e3},...Vt},zt=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Bt=zt.slice(0).reverse();function Ht(e,t,n=!1){const r={values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy};return new Wt(r)}function Yt(e,t,n,r,i){const a=e[i][n],o=t[n]/a,s=Math.sign(o)!==Math.sign(r[i])&&0!==r[i]&&Math.abs(o)<=1?function(e){return e<0?Math.floor(e):Math.ceil(e)}(o):Math.trunc(o);r[i]+=s,t[n]-=s*a}class Wt{constructor(e){const t="longterm"===e.conversionAccuracy||!1;this.values=e.values,this.loc=e.loc||Ge.create(),this.conversionAccuracy=t?"longterm":"casual",this.invalid=e.invalid||null,this.matrix=t?Rt:Pt,this.isLuxonDuration=!0}static fromMillis(e,t){return Wt.fromObject({milliseconds:e},t)}static fromObject(e,t={}){if(null==e||"object"!=typeof e)throw new l("Duration.fromObject: argument expected to be an object, got "+(null===e?"null":typeof e));return new Wt({values:ne(e,Wt.normalizeUnit),loc:Ge.fromObject(t),conversionAccuracy:t.conversionAccuracy})}static fromDurationLike(e){if(L(e))return Wt.fromMillis(e);if(Wt.isDuration(e))return e;if("object"==typeof e)return Wt.fromObject(e);throw new l(`Unknown duration argument ${e} of type ${typeof e}`)}static fromISO(e,t){const[n]=function(e){return et(e,[pt,gt])}(e);return n?Wt.fromObject(n,t):Wt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static fromISOTime(e,t){const[n]=function(e){return et(e,[mt,jt])}(e);return n?Wt.fromObject(n,t):Wt.invalid("unparsable",`the input "${e}" can't be parsed as ISO 8601`)}static invalid(e,t=null){if(!e)throw new l("need to specify a reason the Duration is invalid");const n=e instanceof xe?e:new xe(e,t);if(Re.throwOnInvalid)throw new a(n);return new Wt({invalid:n})}static normalizeUnit(e){const t={year:"years",years:"years",quarter:"quarters",quarters:"quarters",month:"months",months:"months",week:"weeks",weeks:"weeks",day:"days",days:"days",hour:"hours",hours:"hours",minute:"minutes",minutes:"minutes",second:"seconds",seconds:"seconds",millisecond:"milliseconds",milliseconds:"milliseconds"}[e?e.toLowerCase():e];if(!t)throw new s(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){const n={...t,floor:!1!==t.round&&!1!==t.floor};return this.isValid?ke.create(this.loc,n).formatDurationFromString(this,e):"Invalid Duration"}toHuman(e={}){const t=zt.map(t=>{const n=this.values[t];return _(n)?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...e,unit:t.slice(0,-1)}).format(n)}).filter(e=>e);return this.loc.listFormatter({type:"conjunction",style:e.listStyle||"narrow",...e}).format(t)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e="P";return 0!==this.years&&(e+=this.years+"Y"),0===this.months&&0===this.quarters||(e+=this.months+3*this.quarters+"M"),0!==this.weeks&&(e+=this.weeks+"W"),0!==this.days&&(e+=this.days+"D"),0===this.hours&&0===this.minutes&&0===this.seconds&&0===this.milliseconds||(e+="T"),0!==this.hours&&(e+=this.hours+"H"),0!==this.minutes&&(e+=this.minutes+"M"),0===this.seconds&&0===this.milliseconds||(e+=U(this.seconds+this.milliseconds/1e3,3)+"S"),"P"===e&&(e+="T0S"),e}toISOTime(e={}){if(!this.isValid)return null;const t=this.toMillis();if(t<0||t>=864e5)return null;e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...e};const n=this.shiftTo("hours","minutes","seconds","milliseconds");let r="basic"===e.format?"hhmm":"hh:mm";e.suppressSeconds&&0===n.seconds&&0===n.milliseconds||(r+="basic"===e.format?"ss":":ss",e.suppressMilliseconds&&0===n.milliseconds||(r+=".SSS"));let i=n.toFormat(r);return e.includePrefix&&(i="T"+i),i}toJSON(){return this.toISO()}toString(){return this.toISO()}toMillis(){return this.as("milliseconds")}valueOf(){return this.toMillis()}plus(e){if(!this.isValid)return this;const t=Wt.fromDurationLike(e),n={};for(const e of zt)(R(t.values,e)||R(this.values,e))&&(n[e]=t.get(e)+this.get(e));return Ht(this,{values:n},!0)}minus(e){if(!this.isValid)return this;const t=Wt.fromDurationLike(e);return this.plus(t.negate())}mapUnits(e){if(!this.isValid)return this;const t={};for(const n of Object.keys(this.values))t[n]=te(e(this.values[n],n));return Ht(this,{values:t},!0)}get(e){return this[Wt.normalizeUnit(e)]}set(e){return this.isValid?Ht(this,{values:{...this.values,...ne(e,Wt.normalizeUnit)}}):this}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n}={}){const r={loc:this.loc.clone({locale:e,numberingSystem:t})};return n&&(r.conversionAccuracy=n),Ht(this,r)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;const e=this.toObject();return function(e,t){Bt.reduce((n,r)=>_(t[r])?n:(n&&Yt(e,t,n,t,r),r),null)}(this.matrix,e),Ht(this,{values:e},!0)}shiftTo(...e){if(!this.isValid)return this;if(0===e.length)return this;e=e.map(e=>Wt.normalizeUnit(e));const t={},n={},r=this.toObject();let i;for(const a of zt)if(e.indexOf(a)>=0){i=a;let e=0;for(const t in n)e+=this.matrix[t][a]*n[t],n[t]=0;L(r[a])&&(e+=r[a]);const o=Math.trunc(e);t[a]=o,n[a]=(1e3*e-1e3*o)/1e3;for(const e in r)zt.indexOf(e)>zt.indexOf(a)&&Yt(this.matrix,r,e,t,a)}else L(r[a])&&(n[a]=r[a]);for(const e in n)0!==n[e]&&(t[i]+=e===i?n[e]:n[e]/this.matrix[i][e]);return Ht(this,{values:t},!0).normalize()}negate(){if(!this.isValid)return this;const e={};for(const t of Object.keys(this.values))e[t]=0===this.values[t]?0:-this.values[t];return Ht(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid)return!1;if(!this.loc.equals(e.loc))return!1;function t(e,t){return void 0===e||0===e?void 0===t||0===t:e===t}for(const n of zt)if(!t(this.values[n],e.values[n]))return!1;return!0}}const Ut="Invalid Interval";class Zt{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(e,t=null){if(!e)throw new l("need to specify a reason the Interval is invalid");const n=e instanceof xe?e:new xe(e,t);if(Re.throwOnInvalid)throw new i(n);return new Zt({invalid:n})}static fromDateTimes(e,t){const n=qn(e),r=qn(t),i=function(e,t){return e&&e.isValid?t&&t.isValid?te}isBefore(e){return!!this.isValid&&this.e<=e}contains(e){return!!this.isValid&&this.s<=e&&this.e>e}set({start:e,end:t}={}){return this.isValid?Zt.fromDateTimes(e||this.s,t||this.e):this}splitAt(...e){if(!this.isValid)return[];const t=e.map(qn).filter(e=>this.contains(e)).sort(),n=[];let{s:r}=this,i=0;for(;r+this.e?this.e:e;n.push(Zt.fromDateTimes(r,a)),r=a,i+=1}return n}splitBy(e){const t=Wt.fromDurationLike(e);if(!this.isValid||!t.isValid||0===t.as("milliseconds"))return[];let n,{s:r}=this,i=1;const a=[];for(;re*i));n=+e>+this.e?this.e:e,a.push(Zt.fromDateTimes(r,n)),r=n,i+=1}return a}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s=e.e}equals(e){return!(!this.isValid||!e.isValid)&&this.s.equals(e.s)&&this.e.equals(e.e)}intersection(e){if(!this.isValid)return this;const t=this.s>e.s?this.s:e.s,n=this.e=n?null:Zt.fromDateTimes(t,n)}union(e){if(!this.isValid)return this;const t=this.se.e?this.e:e.e;return Zt.fromDateTimes(t,n)}static merge(e){const[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(e){let t=null,n=0;const r=[],i=e.map(e=>[{time:e.s,type:"s"},{time:e.e,type:"e"}]),a=Array.prototype.concat(...i).sort((e,t)=>e.time-t.time);for(const e of a)n+="s"===e.type?1:-1,1===n?t=e.time:(t&&+t!==+e.time&&r.push(Zt.fromDateTimes(t,e.time)),t=null);return Zt.merge(r)}difference(...e){return Zt.xor([this].concat(e)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ut}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ut}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ut}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ut}toFormat(e,{separator:t=" – "}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ut}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):Wt.invalid(this.invalidReason)}mapEndpoints(e){return Zt.fromDateTimes(e(this.s),e(this.e))}}class qt{static hasDST(e=Re.defaultZone){const t=Zn.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return Se.isValidZone(e)}static normalizeZone(e){return Fe(e,Re.defaultZone)}static months(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||Ge.create(t,n,i)).months(e)}static monthsFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i="gregory"}={}){return(r||Ge.create(t,n,i)).months(e,!0)}static weekdays(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Ge.create(t,n,null)).weekdays(e)}static weekdaysFormat(e="long",{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||Ge.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return Ge.create(e).meridiems()}static eras(e="short",{locale:t=null}={}){return Ge.create(t,null,"gregory").eras(e)}static features(){return{relative:V()}}}function Kt(e,t){const n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),r=n(t)-n(e);return Math.floor(Wt.fromMillis(r).as("days"))}const Jt={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Gt={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},Qt=Jt.hanidec.replace(/[\[|\]]/g,"").split("");function Xt({numberingSystem:e},t=""){return new RegExp(`${Jt[e||"latn"]}${t}`)}function en(e,t=e=>e){return{regex:e,deser:([e])=>t(function(e){let t=parseInt(e,10);if(isNaN(t)){t="";for(let n=0;n=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}(e))}}const tn=`[ ${String.fromCharCode(160)}]`,nn=new RegExp(tn,"g");function rn(e){return e.replace(/\./g,"\\.?").replace(nn,tn)}function an(e){return e.replace(/\./g,"").replace(nn," ").toLowerCase()}function on(e,t){return null===e?null:{regex:RegExp(e.map(rn).join("|")),deser:([n])=>e.findIndex(e=>an(n)===an(e))+t}}function sn(e,t){return{regex:e,deser:([,e,t])=>ee(e,t),groups:t}}function ln(e){return{regex:e,deser:([e])=>e}}const cn={year:{"2-digit":"yy",numeric:"yyyyy"},month:{numeric:"M","2-digit":"MM",short:"MMM",long:"MMMM"},day:{numeric:"d","2-digit":"dd"},weekday:{short:"EEE",long:"EEEE"},dayperiod:"a",dayPeriod:"a",hour:{numeric:"h","2-digit":"hh"},minute:{numeric:"m","2-digit":"mm"},second:{numeric:"s","2-digit":"ss"}};let un=null;function dn(e,t,n){const r=function(e,t){return Array.prototype.concat(...e.map(e=>function(e,t){if(e.literal)return e;const n=ke.macroTokenToFormatOpts(e.val);if(!n)return e;const r=ke.create(t,n).formatDateTimeParts((un||(un=Zn.fromMillis(1555555555555)),un)).map(e=>function(e,t,n){const{type:r,value:i}=e;if("literal"===r)return{literal:!0,val:i};const a=n[r];let o=cn[r];return"object"==typeof o&&(o=o[a]),o?{literal:!1,val:o}:void 0}(e,0,n));return r.includes(void 0)?e:r}(e,t)))}(ke.parseFormat(n),e),i=r.map(t=>function(e,t){const n=Xt(t),r=Xt(t,"{2}"),i=Xt(t,"{3}"),a=Xt(t,"{4}"),o=Xt(t,"{6}"),s=Xt(t,"{1,2}"),l=Xt(t,"{1,3}"),c=Xt(t,"{1,6}"),u=Xt(t,"{1,9}"),d=Xt(t,"{2,4}"),h=Xt(t,"{4,6}"),f=e=>{return{regex:RegExp((t=e.val,t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&"))),deser:([e])=>e,literal:!0};var t},m=(m=>{if(e.literal)return f(m);switch(m.val){case"G":return on(t.eras("short",!1),0);case"GG":return on(t.eras("long",!1),0);case"y":return en(c);case"yy":case"kk":return en(d,Q);case"yyyy":case"kkkk":return en(a);case"yyyyy":return en(h);case"yyyyyy":return en(o);case"M":case"L":case"d":case"H":case"h":case"m":case"q":case"s":case"W":return en(s);case"MM":case"LL":case"dd":case"HH":case"hh":case"mm":case"qq":case"ss":case"WW":return en(r);case"MMM":return on(t.months("short",!0,!1),1);case"MMMM":return on(t.months("long",!0,!1),1);case"LLL":return on(t.months("short",!1,!1),1);case"LLLL":return on(t.months("long",!1,!1),1);case"o":case"S":return en(l);case"ooo":case"SSS":return en(i);case"u":return ln(u);case"uu":return ln(s);case"uuu":case"E":case"c":return en(n);case"a":return on(t.meridiems(),0);case"EEE":return on(t.weekdays("short",!1,!1),1);case"EEEE":return on(t.weekdays("long",!1,!1),1);case"ccc":return on(t.weekdays("short",!0,!1),1);case"cccc":return on(t.weekdays("long",!0,!1),1);case"Z":case"ZZ":return sn(new RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case"ZZZ":return sn(new RegExp(`([+-]${s.source})(${r.source})?`),2);case"z":return ln(/[a-z_+-/]{1,256}?/i);default:return f(m)}})(e)||{invalidReason:"missing Intl.DateTimeFormat.formatToParts support"};return m.token=e,m}(t,e)),a=i.find(e=>e.invalidReason);if(a)return{input:t,tokens:r,invalidReason:a.invalidReason};{const[e,n]=function(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,"")}$`,e]}(i),a=RegExp(e,"i"),[s,l]=function(e,t,n){const r=e.match(t);if(r){const e={};let t=1;for(const i in n)if(R(n,i)){const a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}return[r,{}]}(t,a,n),[c,u,d]=l?function(e){let t,n=null;return _(e.z)||(n=Se.create(e.z)),_(e.Z)||(n||(n=new Ae(e.Z)),t=e.Z),_(e.q)||(e.M=3*(e.q-1)+1),_(e.h)||(e.h<12&&1===e.a?e.h+=12:12===e.h&&0===e.a&&(e.h=0)),0===e.G&&e.y&&(e.y=-e.y),_(e.u)||(e.S=W(e.u)),[Object.keys(e).reduce((t,n)=>{const r=(e=>{switch(e){case"S":return"millisecond";case"s":return"second";case"m":return"minute";case"h":case"H":return"hour";case"d":return"day";case"o":return"ordinal";case"L":case"M":return"month";case"y":return"year";case"E":case"c":return"weekday";case"W":return"weekNumber";case"k":return"weekYear";case"q":return"quarter";default:return null}})(n);return r&&(t[r]=e[n]),t},{}),n,t]}(l):[null,null,void 0];if(R(l,"a")&&R(l,"H"))throw new o("Can't include meridiem when specifying 24-hour format");return{input:t,tokens:r,regex:a,rawMatches:s,matches:l,result:c,zone:u,specificOffset:d}}}const hn=[0,31,59,90,120,151,181,212,243,273,304,334],fn=[0,31,60,91,121,152,182,213,244,274,305,335];function mn(e,t){return new xe("unit out of range",`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function pn(e,t,n){const r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);const i=r.getUTCDay();return 0===i?7:i}function gn(e,t,n){return n+(Z(e)?fn:hn)[t-1]}function yn(e,t){const n=Z(e)?fn:hn,r=n.findIndex(e=>eG(t)?(o=t+1,s=1):o=t,{weekYear:o,weekNumber:s,weekday:a,...ie(e)}}function vn(e){const{weekYear:t,weekNumber:n,weekday:r}=e,i=pn(t,1,4),a=q(t);let o,s=7*n+r-i-3;s<1?(o=t-1,s+=q(o)):s>a?(o=t+1,s-=q(t)):o=t;const{month:l,day:c}=yn(o,s);return{year:o,month:l,day:c,...ie(e)}}function wn(e){const{year:t,month:n,day:r}=e;return{year:t,ordinal:gn(t,n,r),...ie(e)}}function kn(e){const{year:t,ordinal:n}=e,{month:r,day:i}=yn(t,n);return{year:t,month:r,day:i,...ie(e)}}function xn(e){const t=$(e.year),n=z(e.month,1,12),r=z(e.day,1,K(e.year,e.month));return t?n?!r&&mn("day",e.day):mn("month",e.month):mn("year",e.year)}function Dn(e){const{hour:t,minute:n,second:r,millisecond:i}=e,a=z(t,0,23)||24===t&&0===n&&0===r&&0===i,o=z(n,0,59),s=z(r,0,59),l=z(i,0,999);return a?o?s?!l&&mn("millisecond",i):mn("second",r):mn("minute",n):mn("hour",t)}const Mn="Invalid DateTime",On=864e13;function Tn(e){return new xe("unsupported zone",`the zone "${e.name}" is not supported`)}function Cn(e){return null===e.weekData&&(e.weekData=bn(e.c)),e.weekData}function En(e,t){const n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new Zn({...n,...t,old:n})}function Sn(e,t,n){let r=e-60*t*1e3;const i=n.offset(r);if(t===i)return[r,t];r-=60*(i-t)*1e3;const a=n.offset(r);return i===a?[r,i]:[e-60*Math.min(i,a)*1e3,Math.max(i,a)]}function Nn(e,t){const n=new Date(e+=60*t*1e3);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function An(e,t,n){return Sn(J(e),t,n)}function In(e,t){const n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+3*Math.trunc(t.quarters),a={...e.c,year:r,month:i,day:Math.min(e.c.day,K(r,i))+Math.trunc(t.days)+7*Math.trunc(t.weeks)},o=Wt.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as("milliseconds"),s=J(a);let[l,c]=Sn(s,n,e.zone);return 0!==o&&(l+=o,c=e.zone.offset(l)),{ts:l,o:c}}function Fn(e,t,n,r,i,a){const{setZone:o,zone:s}=n;if(e&&0!==Object.keys(e).length){const r=t||s,i=Zn.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}return Zn.invalid(new xe("unparsable",`the input "${i}" can't be parsed as ${r}`))}function jn(e,t,n=!0){return e.isValid?ke.create(Ge.create("en-US"),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function _n(e,t){const n=e.c.year>9999||e.c.year<0;let r="";return n&&e.c.year>=0&&(r+="+"),r+=B(e.c.year,n?6:4),t?(r+="-",r+=B(e.c.month),r+="-",r+=B(e.c.day)):(r+=B(e.c.month),r+=B(e.c.day)),r}function Ln(e,t,n,r,i,a){let o=B(e.c.hour);return t?(o+=":",o+=B(e.c.minute),0===e.c.second&&n||(o+=":")):o+=B(e.c.minute),0===e.c.second&&n||(o+=B(e.c.second),0===e.c.millisecond&&r||(o+=".",o+=B(e.c.millisecond,3))),i&&(e.isOffsetFixed&&0===e.offset&&!a?o+="Z":e.o<0?(o+="-",o+=B(Math.trunc(-e.o/60)),o+=":",o+=B(Math.trunc(-e.o%60))):(o+="+",o+=B(Math.trunc(e.o/60)),o+=":",o+=B(Math.trunc(e.o%60)))),a&&(o+="["+e.zone.ianaName+"]"),o}const $n={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Vn={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},Pn={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Rn=["year","month","day","hour","minute","second","millisecond"],zn=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Bn=["year","ordinal","hour","minute","second","millisecond"];function Hn(e){const t={year:"year",years:"year",month:"month",months:"month",day:"day",days:"day",hour:"hour",hours:"hour",minute:"minute",minutes:"minute",quarter:"quarter",quarters:"quarter",second:"second",seconds:"second",millisecond:"millisecond",milliseconds:"millisecond",weekday:"weekday",weekdays:"weekday",weeknumber:"weekNumber",weeksnumber:"weekNumber",weeknumbers:"weekNumber",weekyear:"weekYear",weekyears:"weekYear",ordinal:"ordinal"}[e.toLowerCase()];if(!t)throw new s(e);return t}function Yn(e,t){const n=Fe(t.zone,Re.defaultZone),r=Ge.fromObject(t),i=Re.now();let a,o;if(_(e.year))a=i;else{for(const t of Rn)_(e[t])&&(e[t]=$n[t]);const t=xn(e)||Dn(e);if(t)return Zn.invalid(t);const r=n.offset(i);[a,o]=An(e,r,n)}return new Zn({ts:a,zone:n,loc:r,o})}function Wn(e,t,n){const r=!!_(n.round)||n.round,i=(e,i)=>(e=U(e,r||n.calendary?0:2,!0),t.loc.clone(n).relFormatter(n).format(e,i)),a=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return i(a(n.unit),n.unit);for(const e of n.units){const t=a(e);if(Math.abs(t)>=1)return i(t,e)}return i(e>t?-0:0,n.units[n.units.length-1])}function Un(e){let t,n={};return e.length>0&&"object"==typeof e[e.length-1]?(n=e[e.length-1],t=Array.from(e).slice(0,e.length-1)):t=Array.from(e),[n,t]}class Zn{constructor(e){const t=e.zone||Re.defaultZone;let n=e.invalid||(Number.isNaN(e.ts)?new xe("invalid input"):null)||(t.isValid?null:Tn(t));this.ts=_(e.ts)?Re.now():e.ts;let r=null,i=null;if(!n)if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{const e=t.offset(this.ts);r=Nn(this.ts,e),n=Number.isNaN(r.year)?new xe("invalid input"):null,r=n?null:r,i=n?null:e}this._zone=t,this.loc=e.loc||Ge.create(),this.invalid=n,this.weekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new Zn({})}static local(){const[e,t]=Un(arguments),[n,r,i,a,o,s,l]=t;return Yn({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:l},e)}static utc(){const[e,t]=Un(arguments),[n,r,i,a,o,s,l]=t;return e.zone=Ae.utcInstance,Yn({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:l},e)}static fromJSDate(e,t={}){const n=(r=e,"[object Date]"===Object.prototype.toString.call(r)?e.valueOf():NaN);var r;if(Number.isNaN(n))return Zn.invalid("invalid input");const i=Fe(t.zone,Re.defaultZone);return i.isValid?new Zn({ts:n,zone:i,loc:Ge.fromObject(t)}):Zn.invalid(Tn(i))}static fromMillis(e,t={}){if(L(e))return e<-On||e>On?Zn.invalid("Timestamp out of range"):new Zn({ts:e,zone:Fe(t.zone,Re.defaultZone),loc:Ge.fromObject(t)});throw new l(`fromMillis requires a numerical input, but received a ${typeof e} with value ${e}`)}static fromSeconds(e,t={}){if(L(e))return new Zn({ts:1e3*e,zone:Fe(t.zone,Re.defaultZone),loc:Ge.fromObject(t)});throw new l("fromSeconds requires a numerical input")}static fromObject(e,t={}){e=e||{};const n=Fe(t.zone,Re.defaultZone);if(!n.isValid)return Zn.invalid(Tn(n));const r=Re.now(),i=_(t.specificOffset)?n.offset(r):t.specificOffset,a=ne(e,Hn),s=!_(a.ordinal),l=!_(a.year),c=!_(a.month)||!_(a.day),u=l||c,d=a.weekYear||a.weekNumber,h=Ge.fromObject(t);if((u||s)&&d)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(c&&s)throw new o("Can't mix ordinal dates with month/day");const f=d||a.weekday&&!u;let m,p,g=Nn(r,i);f?(m=zn,p=Vn,g=bn(g)):s?(m=Bn,p=Pn,g=wn(g)):(m=Rn,p=$n);let y=!1;for(const e of m)_(a[e])?a[e]=y?p[e]:g[e]:y=!0;const b=f?function(e){const t=$(e.weekYear),n=z(e.weekNumber,1,G(e.weekYear)),r=z(e.weekday,1,7);return t?n?!r&&mn("weekday",e.weekday):mn("week",e.week):mn("weekYear",e.weekYear)}(a):s?function(e){const t=$(e.year),n=z(e.ordinal,1,q(e.year));return t?!n&&mn("ordinal",e.ordinal):mn("year",e.year)}(a):xn(a),v=b||Dn(a);if(v)return Zn.invalid(v);const w=f?vn(a):s?kn(a):a,[k,x]=An(w,i,n),D=new Zn({ts:k,zone:n,o:x,loc:h});return a.weekday&&u&&e.weekday!==D.weekday?Zn.invalid("mismatched weekday",`you can't specify both a weekday of ${a.weekday} and a date of ${D.toISO()}`):D}static fromISO(e,t={}){const[n,r]=function(e){return et(e,[Tt,Nt],[Ct,At],[Et,It],[St,Ft])}(e);return Fn(n,r,t,"ISO 8601",e)}static fromRFC2822(e,t={}){const[n,r]=function(e){return et(function(e){return e.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}(e),[vt,wt])}(e);return Fn(n,r,t,"RFC 2822",e)}static fromHTTP(e,t={}){const[n,r]=function(e){return et(e,[kt,Mt],[xt,Mt],[Dt,Ot])}(e);return Fn(n,r,t,"HTTP",t)}static fromFormat(e,t,n={}){if(_(e)||_(t))throw new l("fromFormat requires an input string and a format");const{locale:r=null,numberingSystem:i=null}=n,a=Ge.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),[o,s,c,u]=function(e,t,n){const{result:r,zone:i,specificOffset:a,invalidReason:o}=dn(e,t,n);return[r,i,a,o]}(a,e,t);return u?Zn.invalid(u):Fn(o,s,n,`format ${t}`,e,c)}static fromString(e,t,n={}){return Zn.fromFormat(e,t,n)}static fromSQL(e,t={}){const[n,r]=function(e){return et(e,[_t,Nt],[Lt,$t])}(e);return Fn(n,r,t,"SQL",e)}static invalid(e,t=null){if(!e)throw new l("need to specify a reason the DateTime is invalid");const n=e instanceof xe?e:new xe(e,t);if(Re.throwOnInvalid)throw new r(n);return new Zn({invalid:n})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}get(e){return this[e]}get isValid(){return null===this.invalid}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?Cn(this).weekYear:NaN}get weekNumber(){return this.isValid?Cn(this).weekNumber:NaN}get weekday(){return this.isValid?Cn(this).weekday:NaN}get ordinal(){return this.isValid?wn(this.c).ordinal:NaN}get monthShort(){return this.isValid?qt.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?qt.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?qt.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?qt.weekdays("long",{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:"short",locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:"long",locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return!this.isOffsetFixed&&(this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset)}get isInLeapYear(){return Z(this.year)}get daysInMonth(){return K(this.year,this.month)}get daysInYear(){return this.isValid?q(this.year):NaN}get weeksInWeekYear(){return this.isValid?G(this.weekYear):NaN}resolvedLocaleOptions(e={}){const{locale:t,numberingSystem:n,calendar:r}=ke.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Ae.instance(e),t)}toLocal(){return this.setZone(Re.defaultZone)}setZone(e,{keepLocalTime:t=!1,keepCalendarTime:n=!1}={}){if((e=Fe(e,Re.defaultZone)).equals(this.zone))return this;if(e.isValid){let r=this.ts;if(t||n){const t=e.offset(this.ts),n=this.toObject();[r]=An(n,t,e)}return En(this,{ts:r,zone:e})}return Zn.invalid(Tn(e))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){return En(this,{loc:this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n})})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;const t=ne(e,Hn),n=!_(t.weekYear)||!_(t.weekNumber)||!_(t.weekday),r=!_(t.ordinal),i=!_(t.year),a=!_(t.month)||!_(t.day),s=i||a,l=t.weekYear||t.weekNumber;if((s||r)&&l)throw new o("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(a&&r)throw new o("Can't mix ordinal dates with month/day");let c;n?c=vn({...bn(this.c),...t}):_(t.ordinal)?(c={...this.toObject(),...t},_(t.day)&&(c.day=Math.min(K(c.year,c.month),c.day))):c=kn({...wn(this.c),...t});const[u,d]=An(c,this.o,this.zone);return En(this,{ts:u,o:d})}plus(e){return this.isValid?En(this,In(this,Wt.fromDurationLike(e))):this}minus(e){return this.isValid?En(this,In(this,Wt.fromDurationLike(e).negate())):this}startOf(e){if(!this.isValid)return this;const t={},n=Wt.normalizeUnit(e);switch(n){case"years":t.month=1;case"quarters":case"months":t.day=1;case"weeks":case"days":t.hour=0;case"hours":t.minute=0;case"minutes":t.second=0;case"seconds":t.millisecond=0}if("weeks"===n&&(t.weekday=1),"quarters"===n){const e=Math.ceil(this.month/3);t.month=3*(e-1)+1}return this.set(t)}endOf(e){return this.isValid?this.plus({[e]:1}).startOf(e).minus(1):this}toFormat(e,t={}){return this.isValid?ke.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):Mn}toLocaleString(e=f,t={}){return this.isValid?ke.create(this.loc.clone(t),e).formatDateTime(this):Mn}toLocaleParts(e={}){return this.isValid?ke.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e="extended",suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1}={}){if(!this.isValid)return null;const a="extended"===e;let o=_n(this,a);return o+="T",o+=Ln(this,a,t,n,r,i),o}toISODate({format:e="extended"}={}){return this.isValid?_n(this,"extended"===e):null}toISOWeekDate(){return jn(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a="extended"}={}){return this.isValid?(r?"T":"")+Ln(this,"extended"===a,t,e,n,i):null}toRFC2822(){return jn(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return jn(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?_n(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r="HH:mm:ss.SSS";return(t||e)&&(n&&(r+=" "),t?r+="z":e&&(r+="ZZ")),jn(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():Mn}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};const t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t="milliseconds",n={}){if(!this.isValid||!e.isValid)return Wt.invalid("created by diffing an invalid DateTime");const r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=(s=t,Array.isArray(s)?s:[s]).map(Wt.normalizeUnit),a=e.valueOf()>this.valueOf(),o=function(e,t,n,r){let[i,a,o,s]=function(e,t,n){const r=[["years",(e,t)=>t.year-e.year],["quarters",(e,t)=>t.quarter-e.quarter],["months",(e,t)=>t.month-e.month+12*(t.year-e.year)],["weeks",(e,t)=>{const n=Kt(e,t);return(n-n%7)/7}],["days",Kt]],i={};let a,o;for(const[s,l]of r)if(n.indexOf(s)>=0){a=s;let n=l(e,t);o=e.plus({[s]:n}),o>t?(e=e.plus({[s]:n-1}),n-=1):e=o,i[s]=n}return[e,i,o,a]}(e,t,n);const l=t-i,c=n.filter(e=>["hours","minutes","seconds","milliseconds"].indexOf(e)>=0);0===c.length&&(o0?Wt.fromMillis(l,r).shiftTo(...c).plus(u):u}(a?this:e,a?e:this,i,r);var s;return a?o.negate():o}diffNow(e="milliseconds",t={}){return this.diff(Zn.now(),e,t)}until(e){return this.isValid?Zt.fromDateTimes(this,e):this}hasSame(e,t){if(!this.isValid)return!1;const n=e.valueOf(),r=this.setZone(e.zone,{keepLocalTime:!0});return r.startOf(t)<=n&&n<=r.endOf(t)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(e={}){if(!this.isValid)return null;const t=e.base||Zn.fromObject({},{zone:this.zone}),n=e.padding?thise.valueOf(),Math.min)}static max(...e){if(!e.every(Zn.isDateTime))throw new l("max requires all arguments be DateTimes");return P(e,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){const{locale:r=null,numberingSystem:i=null}=n;return dn(Ge.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(e,t,n={}){return Zn.fromFormatExplain(e,t,n)}static get DATE_SHORT(){return f}static get DATE_MED(){return m}static get DATE_MED_WITH_WEEKDAY(){return p}static get DATE_FULL(){return g}static get DATE_HUGE(){return y}static get TIME_SIMPLE(){return b}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return w}static get TIME_WITH_LONG_OFFSET(){return k}static get TIME_24_SIMPLE(){return x}static get TIME_24_WITH_SECONDS(){return D}static get TIME_24_WITH_SHORT_OFFSET(){return M}static get TIME_24_WITH_LONG_OFFSET(){return O}static get DATETIME_SHORT(){return T}static get DATETIME_SHORT_WITH_SECONDS(){return C}static get DATETIME_MED(){return E}static get DATETIME_MED_WITH_SECONDS(){return S}static get DATETIME_MED_WITH_WEEKDAY(){return N}static get DATETIME_FULL(){return A}static get DATETIME_FULL_WITH_SECONDS(){return I}static get DATETIME_HUGE(){return F}static get DATETIME_HUGE_WITH_SECONDS(){return j}}function qn(e){if(Zn.isDateTime(e))return e;if(e&&e.valueOf&&L(e.valueOf()))return Zn.fromJSDate(e);if(e&&"object"==typeof e)return Zn.fromObject(e);throw new l(`Unknown datetime argument: ${e}, of type ${typeof e}`)}t.DateTime=Zn,t.Duration=Wt,t.FixedOffsetZone=Ae,t.IANAZone=Se,t.Info=qt,t.Interval=Zt,t.InvalidZone=Ie,t.Settings=Re,t.SystemZone=Oe,t.VERSION="2.5.2",t.Zone=De},314(e){e.exports=function(e){var t=[];return t.toString=function(){return this.map(function(t){var n="",r=void 0!==t[5];return t[4]&&(n+="@supports (".concat(t[4],") {")),t[2]&&(n+="@media ".concat(t[2]," {")),r&&(n+="@layer".concat(t[5].length>0?" ".concat(t[5]):""," {")),n+=e(t),r&&(n+="}"),t[2]&&(n+="}"),t[4]&&(n+="}"),n}).join("")},t.i=function(e,n,r,i,a){"string"==typeof e&&(e=[[null,e,void 0]]);var o={};if(r)for(var s=0;s0?" ".concat(u[5]):""," {").concat(u[1],"}")),u[5]=a),n&&(u[2]?(u[1]="@media ".concat(u[2]," {").concat(u[1],"}"),u[2]=n):u[2]=n),i&&(u[4]?(u[1]="@supports (".concat(u[4],") {").concat(u[1],"}"),u[4]=i):u[4]="".concat(i)),t.push(u))}},t}},319(e,t,n){n.d(t,{A:()=>s});var r=n(601),i=n.n(r),a=n(314),o=n.n(a)()(i());o.push([e.id,'.flatpickr-calendar {\n background: transparent;\n opacity: 0;\n display: none;\n text-align: center;\n visibility: hidden;\n padding: 0;\n -webkit-animation: none;\n animation: none;\n direction: ltr;\n border: 0;\n font-size: 14px;\n line-height: 24px;\n border-radius: 5px;\n position: absolute;\n width: 307.875px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -ms-touch-action: manipulation;\n touch-action: manipulation;\n background: #fff;\n -webkit-box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);\n box-shadow: 1px 0 0 #e6e6e6, -1px 0 0 #e6e6e6, 0 1px 0 #e6e6e6, 0 -1px 0 #e6e6e6, 0 3px 13px rgba(0,0,0,0.08);\n}\n.flatpickr-calendar.open,\n.flatpickr-calendar.inline {\n opacity: 1;\n max-height: 640px;\n visibility: visible;\n}\n.flatpickr-calendar.open {\n display: inline-block;\n z-index: 99999;\n}\n.flatpickr-calendar.animate.open {\n -webkit-animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);\n animation: fpFadeInDown 300ms cubic-bezier(0.23, 1, 0.32, 1);\n}\n.flatpickr-calendar.inline {\n display: block;\n position: relative;\n top: 2px;\n}\n.flatpickr-calendar.static {\n position: absolute;\n top: calc(100% + 2px);\n}\n.flatpickr-calendar.static.open {\n z-index: 999;\n display: block;\n}\n.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+1) .flatpickr-day.inRange:nth-child(7n+7) {\n -webkit-box-shadow: none !important;\n box-shadow: none !important;\n}\n.flatpickr-calendar.multiMonth .flatpickr-days .dayContainer:nth-child(n+2) .flatpickr-day.inRange:nth-child(7n+1) {\n -webkit-box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n box-shadow: -2px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n}\n.flatpickr-calendar .hasWeeks .dayContainer,\n.flatpickr-calendar .hasTime .dayContainer {\n border-bottom: 0;\n border-bottom-right-radius: 0;\n border-bottom-left-radius: 0;\n}\n.flatpickr-calendar .hasWeeks .dayContainer {\n border-left: 0;\n}\n.flatpickr-calendar.hasTime .flatpickr-time {\n height: 40px;\n border-top: 1px solid #e6e6e6;\n}\n.flatpickr-calendar.noCalendar.hasTime .flatpickr-time {\n height: auto;\n}\n.flatpickr-calendar:before,\n.flatpickr-calendar:after {\n position: absolute;\n display: block;\n pointer-events: none;\n border: solid transparent;\n content: \'\';\n height: 0;\n width: 0;\n left: 22px;\n}\n.flatpickr-calendar.rightMost:before,\n.flatpickr-calendar.arrowRight:before,\n.flatpickr-calendar.rightMost:after,\n.flatpickr-calendar.arrowRight:after {\n left: auto;\n right: 22px;\n}\n.flatpickr-calendar.arrowCenter:before,\n.flatpickr-calendar.arrowCenter:after {\n left: 50%;\n right: 50%;\n}\n.flatpickr-calendar:before {\n border-width: 5px;\n margin: 0 -5px;\n}\n.flatpickr-calendar:after {\n border-width: 4px;\n margin: 0 -4px;\n}\n.flatpickr-calendar.arrowTop:before,\n.flatpickr-calendar.arrowTop:after {\n bottom: 100%;\n}\n.flatpickr-calendar.arrowTop:before {\n border-bottom-color: #e6e6e6;\n}\n.flatpickr-calendar.arrowTop:after {\n border-bottom-color: #fff;\n}\n.flatpickr-calendar.arrowBottom:before,\n.flatpickr-calendar.arrowBottom:after {\n top: 100%;\n}\n.flatpickr-calendar.arrowBottom:before {\n border-top-color: #e6e6e6;\n}\n.flatpickr-calendar.arrowBottom:after {\n border-top-color: #fff;\n}\n.flatpickr-calendar:focus {\n outline: 0;\n}\n.flatpickr-wrapper {\n position: relative;\n display: inline-block;\n}\n.flatpickr-months {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n}\n.flatpickr-months .flatpickr-month {\n background: transparent;\n color: rgba(0,0,0,0.9);\n fill: rgba(0,0,0,0.9);\n height: 34px;\n line-height: 1;\n text-align: center;\n position: relative;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n overflow: hidden;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\n.flatpickr-months .flatpickr-prev-month,\n.flatpickr-months .flatpickr-next-month {\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n text-decoration: none;\n cursor: pointer;\n position: absolute;\n top: 0;\n height: 34px;\n padding: 10px;\n z-index: 3;\n color: rgba(0,0,0,0.9);\n fill: rgba(0,0,0,0.9);\n}\n.flatpickr-months .flatpickr-prev-month.flatpickr-disabled,\n.flatpickr-months .flatpickr-next-month.flatpickr-disabled {\n display: none;\n}\n.flatpickr-months .flatpickr-prev-month i,\n.flatpickr-months .flatpickr-next-month i {\n position: relative;\n}\n.flatpickr-months .flatpickr-prev-month.flatpickr-prev-month,\n.flatpickr-months .flatpickr-next-month.flatpickr-prev-month {\n/*\n /*rtl:begin:ignore*/\n/*\n */\n left: 0;\n/*\n /*rtl:end:ignore*/\n/*\n */\n}\n/*\n /*rtl:begin:ignore*/\n/*\n /*rtl:end:ignore*/\n.flatpickr-months .flatpickr-prev-month.flatpickr-next-month,\n.flatpickr-months .flatpickr-next-month.flatpickr-next-month {\n/*\n /*rtl:begin:ignore*/\n/*\n */\n right: 0;\n/*\n /*rtl:end:ignore*/\n/*\n */\n}\n/*\n /*rtl:begin:ignore*/\n/*\n /*rtl:end:ignore*/\n.flatpickr-months .flatpickr-prev-month:hover,\n.flatpickr-months .flatpickr-next-month:hover {\n color: #959ea9;\n}\n.flatpickr-months .flatpickr-prev-month:hover svg,\n.flatpickr-months .flatpickr-next-month:hover svg {\n fill: #f64747;\n}\n.flatpickr-months .flatpickr-prev-month svg,\n.flatpickr-months .flatpickr-next-month svg {\n width: 14px;\n height: 14px;\n}\n.flatpickr-months .flatpickr-prev-month svg path,\n.flatpickr-months .flatpickr-next-month svg path {\n -webkit-transition: fill 0.1s;\n transition: fill 0.1s;\n fill: inherit;\n}\n.numInputWrapper {\n position: relative;\n height: auto;\n}\n.numInputWrapper input,\n.numInputWrapper span {\n display: inline-block;\n}\n.numInputWrapper input {\n width: 100%;\n}\n.numInputWrapper input::-ms-clear {\n display: none;\n}\n.numInputWrapper input::-webkit-outer-spin-button,\n.numInputWrapper input::-webkit-inner-spin-button {\n margin: 0;\n -webkit-appearance: none;\n}\n.numInputWrapper span {\n position: absolute;\n right: 0;\n width: 14px;\n padding: 0 4px 0 2px;\n height: 50%;\n line-height: 50%;\n opacity: 0;\n cursor: pointer;\n border: 1px solid rgba(57,57,57,0.15);\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.numInputWrapper span:hover {\n background: rgba(0,0,0,0.1);\n}\n.numInputWrapper span:active {\n background: rgba(0,0,0,0.2);\n}\n.numInputWrapper span:after {\n display: block;\n content: "";\n position: absolute;\n}\n.numInputWrapper span.arrowUp {\n top: 0;\n border-bottom: 0;\n}\n.numInputWrapper span.arrowUp:after {\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-bottom: 4px solid rgba(57,57,57,0.6);\n top: 26%;\n}\n.numInputWrapper span.arrowDown {\n top: 50%;\n}\n.numInputWrapper span.arrowDown:after {\n border-left: 4px solid transparent;\n border-right: 4px solid transparent;\n border-top: 4px solid rgba(57,57,57,0.6);\n top: 40%;\n}\n.numInputWrapper span svg {\n width: inherit;\n height: auto;\n}\n.numInputWrapper span svg path {\n fill: rgba(0,0,0,0.5);\n}\n.numInputWrapper:hover {\n background: rgba(0,0,0,0.05);\n}\n.numInputWrapper:hover span {\n opacity: 1;\n}\n.flatpickr-current-month {\n font-size: 135%;\n line-height: inherit;\n font-weight: 300;\n color: inherit;\n position: absolute;\n width: 75%;\n left: 12.5%;\n padding: 7.48px 0 0 0;\n line-height: 1;\n height: 34px;\n display: inline-block;\n text-align: center;\n -webkit-transform: translate3d(0px, 0px, 0px);\n transform: translate3d(0px, 0px, 0px);\n}\n.flatpickr-current-month span.cur-month {\n font-family: inherit;\n font-weight: 700;\n color: inherit;\n display: inline-block;\n margin-left: 0.5ch;\n padding: 0;\n}\n.flatpickr-current-month span.cur-month:hover {\n background: rgba(0,0,0,0.05);\n}\n.flatpickr-current-month .numInputWrapper {\n width: 6ch;\n width: 7ch\\0;\n display: inline-block;\n}\n.flatpickr-current-month .numInputWrapper span.arrowUp:after {\n border-bottom-color: rgba(0,0,0,0.9);\n}\n.flatpickr-current-month .numInputWrapper span.arrowDown:after {\n border-top-color: rgba(0,0,0,0.9);\n}\n.flatpickr-current-month input.cur-year {\n background: transparent;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: inherit;\n cursor: text;\n padding: 0 0 0 0.5ch;\n margin: 0;\n display: inline-block;\n font-size: inherit;\n font-family: inherit;\n font-weight: 300;\n line-height: inherit;\n height: auto;\n border: 0;\n border-radius: 0;\n vertical-align: initial;\n -webkit-appearance: textfield;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.flatpickr-current-month input.cur-year:focus {\n outline: 0;\n}\n.flatpickr-current-month input.cur-year[disabled],\n.flatpickr-current-month input.cur-year[disabled]:hover {\n font-size: 100%;\n color: rgba(0,0,0,0.5);\n background: transparent;\n pointer-events: none;\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months {\n appearance: menulist;\n background: transparent;\n border: none;\n border-radius: 0;\n box-sizing: border-box;\n color: inherit;\n cursor: pointer;\n font-size: inherit;\n font-family: inherit;\n font-weight: 300;\n height: auto;\n line-height: inherit;\n margin: -1px 0 0 0;\n outline: none;\n padding: 0 0 0 0.5ch;\n position: relative;\n vertical-align: initial;\n -webkit-box-sizing: border-box;\n -webkit-appearance: menulist;\n -moz-appearance: menulist;\n width: auto;\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months:focus,\n.flatpickr-current-month .flatpickr-monthDropdown-months:active {\n outline: none;\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months:hover {\n background: rgba(0,0,0,0.05);\n}\n.flatpickr-current-month .flatpickr-monthDropdown-months .flatpickr-monthDropdown-month {\n background-color: transparent;\n outline: none;\n padding: 0;\n}\n.flatpickr-weekdays {\n background: transparent;\n text-align: center;\n overflow: hidden;\n width: 100%;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: center;\n -webkit-align-items: center;\n -ms-flex-align: center;\n align-items: center;\n height: 28px;\n}\n.flatpickr-weekdays .flatpickr-weekdaycontainer {\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n}\nspan.flatpickr-weekday {\n cursor: default;\n font-size: 90%;\n background: transparent;\n color: rgba(0,0,0,0.54);\n line-height: 1;\n margin: 0;\n text-align: center;\n display: block;\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n font-weight: bolder;\n}\n.dayContainer,\n.flatpickr-weeks {\n padding: 1px 0 0 0;\n}\n.flatpickr-days {\n position: relative;\n overflow: hidden;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-align: start;\n -webkit-align-items: flex-start;\n -ms-flex-align: start;\n align-items: flex-start;\n width: 307.875px;\n}\n.flatpickr-days:focus {\n outline: 0;\n}\n.dayContainer {\n padding: 0;\n outline: 0;\n text-align: left;\n width: 307.875px;\n min-width: 307.875px;\n max-width: 307.875px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n display: inline-block;\n display: -ms-flexbox;\n display: -webkit-box;\n display: -webkit-flex;\n display: flex;\n -webkit-flex-wrap: wrap;\n flex-wrap: wrap;\n -ms-flex-wrap: wrap;\n -ms-flex-pack: justify;\n -webkit-justify-content: space-around;\n justify-content: space-around;\n -webkit-transform: translate3d(0px, 0px, 0px);\n transform: translate3d(0px, 0px, 0px);\n opacity: 1;\n}\n.dayContainer + .dayContainer {\n -webkit-box-shadow: -1px 0 0 #e6e6e6;\n box-shadow: -1px 0 0 #e6e6e6;\n}\n.flatpickr-day {\n background: none;\n border: 1px solid transparent;\n border-radius: 150px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n color: #393939;\n cursor: pointer;\n font-weight: 400;\n width: 14.2857143%;\n -webkit-flex-basis: 14.2857143%;\n -ms-flex-preferred-size: 14.2857143%;\n flex-basis: 14.2857143%;\n max-width: 39px;\n height: 39px;\n line-height: 39px;\n margin: 0;\n display: inline-block;\n position: relative;\n -webkit-box-pack: center;\n -webkit-justify-content: center;\n -ms-flex-pack: center;\n justify-content: center;\n text-align: center;\n}\n.flatpickr-day.inRange,\n.flatpickr-day.prevMonthDay.inRange,\n.flatpickr-day.nextMonthDay.inRange,\n.flatpickr-day.today.inRange,\n.flatpickr-day.prevMonthDay.today.inRange,\n.flatpickr-day.nextMonthDay.today.inRange,\n.flatpickr-day:hover,\n.flatpickr-day.prevMonthDay:hover,\n.flatpickr-day.nextMonthDay:hover,\n.flatpickr-day:focus,\n.flatpickr-day.prevMonthDay:focus,\n.flatpickr-day.nextMonthDay:focus {\n cursor: pointer;\n outline: 0;\n background: #e6e6e6;\n border-color: #e6e6e6;\n}\n.flatpickr-day.today {\n border-color: #959ea9;\n}\n.flatpickr-day.today:hover,\n.flatpickr-day.today:focus {\n border-color: #959ea9;\n background: #959ea9;\n color: #fff;\n}\n.flatpickr-day.selected,\n.flatpickr-day.startRange,\n.flatpickr-day.endRange,\n.flatpickr-day.selected.inRange,\n.flatpickr-day.startRange.inRange,\n.flatpickr-day.endRange.inRange,\n.flatpickr-day.selected:focus,\n.flatpickr-day.startRange:focus,\n.flatpickr-day.endRange:focus,\n.flatpickr-day.selected:hover,\n.flatpickr-day.startRange:hover,\n.flatpickr-day.endRange:hover,\n.flatpickr-day.selected.prevMonthDay,\n.flatpickr-day.startRange.prevMonthDay,\n.flatpickr-day.endRange.prevMonthDay,\n.flatpickr-day.selected.nextMonthDay,\n.flatpickr-day.startRange.nextMonthDay,\n.flatpickr-day.endRange.nextMonthDay {\n background: #569ff7;\n -webkit-box-shadow: none;\n box-shadow: none;\n color: #fff;\n border-color: #569ff7;\n}\n.flatpickr-day.selected.startRange,\n.flatpickr-day.startRange.startRange,\n.flatpickr-day.endRange.startRange {\n border-radius: 50px 0 0 50px;\n}\n.flatpickr-day.selected.endRange,\n.flatpickr-day.startRange.endRange,\n.flatpickr-day.endRange.endRange {\n border-radius: 0 50px 50px 0;\n}\n.flatpickr-day.selected.startRange + .endRange:not(:nth-child(7n+1)),\n.flatpickr-day.startRange.startRange + .endRange:not(:nth-child(7n+1)),\n.flatpickr-day.endRange.startRange + .endRange:not(:nth-child(7n+1)) {\n -webkit-box-shadow: -10px 0 0 #569ff7;\n box-shadow: -10px 0 0 #569ff7;\n}\n.flatpickr-day.selected.startRange.endRange,\n.flatpickr-day.startRange.startRange.endRange,\n.flatpickr-day.endRange.startRange.endRange {\n border-radius: 50px;\n}\n.flatpickr-day.inRange {\n border-radius: 0;\n -webkit-box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n box-shadow: -5px 0 0 #e6e6e6, 5px 0 0 #e6e6e6;\n}\n.flatpickr-day.flatpickr-disabled,\n.flatpickr-day.flatpickr-disabled:hover,\n.flatpickr-day.prevMonthDay,\n.flatpickr-day.nextMonthDay,\n.flatpickr-day.notAllowed,\n.flatpickr-day.notAllowed.prevMonthDay,\n.flatpickr-day.notAllowed.nextMonthDay {\n color: rgba(57,57,57,0.3);\n background: transparent;\n border-color: transparent;\n cursor: default;\n}\n.flatpickr-day.flatpickr-disabled,\n.flatpickr-day.flatpickr-disabled:hover {\n cursor: not-allowed;\n color: rgba(57,57,57,0.1);\n}\n.flatpickr-day.week.selected {\n border-radius: 0;\n -webkit-box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;\n box-shadow: -5px 0 0 #569ff7, 5px 0 0 #569ff7;\n}\n.flatpickr-day.hidden {\n visibility: hidden;\n}\n.rangeMode .flatpickr-day {\n margin-top: 1px;\n}\n.flatpickr-weekwrapper {\n float: left;\n}\n.flatpickr-weekwrapper .flatpickr-weeks {\n padding: 0 12px;\n -webkit-box-shadow: 1px 0 0 #e6e6e6;\n box-shadow: 1px 0 0 #e6e6e6;\n}\n.flatpickr-weekwrapper .flatpickr-weekday {\n float: none;\n width: 100%;\n line-height: 28px;\n}\n.flatpickr-weekwrapper span.flatpickr-day,\n.flatpickr-weekwrapper span.flatpickr-day:hover {\n display: block;\n width: 100%;\n max-width: none;\n color: rgba(57,57,57,0.3);\n background: transparent;\n cursor: default;\n border: none;\n}\n.flatpickr-innerContainer {\n display: block;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n}\n.flatpickr-rContainer {\n display: inline-block;\n padding: 0;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n}\n.flatpickr-time {\n text-align: center;\n outline: 0;\n display: block;\n height: 0;\n line-height: 40px;\n max-height: 40px;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n overflow: hidden;\n display: -webkit-box;\n display: -webkit-flex;\n display: -ms-flexbox;\n display: flex;\n}\n.flatpickr-time:after {\n content: "";\n display: table;\n clear: both;\n}\n.flatpickr-time .numInputWrapper {\n -webkit-box-flex: 1;\n -webkit-flex: 1;\n -ms-flex: 1;\n flex: 1;\n width: 40%;\n height: 40px;\n float: left;\n}\n.flatpickr-time .numInputWrapper span.arrowUp:after {\n border-bottom-color: #393939;\n}\n.flatpickr-time .numInputWrapper span.arrowDown:after {\n border-top-color: #393939;\n}\n.flatpickr-time.hasSeconds .numInputWrapper {\n width: 26%;\n}\n.flatpickr-time.time24hr .numInputWrapper {\n width: 49%;\n}\n.flatpickr-time input {\n background: transparent;\n -webkit-box-shadow: none;\n box-shadow: none;\n border: 0;\n border-radius: 0;\n text-align: center;\n margin: 0;\n padding: 0;\n height: inherit;\n line-height: inherit;\n color: #393939;\n font-size: 14px;\n position: relative;\n -webkit-box-sizing: border-box;\n box-sizing: border-box;\n -webkit-appearance: textfield;\n -moz-appearance: textfield;\n appearance: textfield;\n}\n.flatpickr-time input.flatpickr-hour {\n font-weight: bold;\n}\n.flatpickr-time input.flatpickr-minute,\n.flatpickr-time input.flatpickr-second {\n font-weight: 400;\n}\n.flatpickr-time input:focus {\n outline: 0;\n border: 0;\n}\n.flatpickr-time .flatpickr-time-separator,\n.flatpickr-time .flatpickr-am-pm {\n height: inherit;\n float: left;\n line-height: inherit;\n color: #393939;\n font-weight: bold;\n width: 2%;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n user-select: none;\n -webkit-align-self: center;\n -ms-flex-item-align: center;\n align-self: center;\n}\n.flatpickr-time .flatpickr-am-pm {\n outline: 0;\n width: 18%;\n cursor: pointer;\n text-align: center;\n font-weight: 400;\n}\n.flatpickr-time input:hover,\n.flatpickr-time .flatpickr-am-pm:hover,\n.flatpickr-time input:focus,\n.flatpickr-time .flatpickr-am-pm:focus {\n background: #eee;\n}\n.flatpickr-input[readonly] {\n cursor: pointer;\n}\n@-webkit-keyframes fpFadeInDown {\n from {\n opacity: 0;\n -webkit-transform: translate3d(0, -20px, 0);\n transform: translate3d(0, -20px, 0);\n }\n to {\n opacity: 1;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n }\n}\n@keyframes fpFadeInDown {\n from {\n opacity: 0;\n -webkit-transform: translate3d(0, -20px, 0);\n transform: translate3d(0, -20px, 0);\n }\n to {\n opacity: 1;\n -webkit-transform: translate3d(0, 0, 0);\n transform: translate3d(0, 0, 0);\n }\n}\n',""]);const s=o},338(e,t,n){n.r(t),n.d(t,{default:()=>y});var r=n(72),i=n.n(r),a=n(825),o=n.n(a),s=n(659),l=n.n(s),c=n(56),u=n.n(c),d=n(540),h=n.n(d),f=n(113),m=n.n(f),p=n(407),g={};g.styleTagTransform=m(),g.setAttributes=u(),g.insert=l().bind(null,"head"),g.domAPI=o(),g.insertStyleElement=h(),i()(p.A,g);const y=p.A&&p.A.locals?p.A.locals:void 0},407(e,t,n){n.d(t,{A:()=>c});var r=n(601),i=n.n(r),a=n(314),o=n.n(a),s=n(319),l=o()(i());l.i(s.A),l.push([e.id,".redmine-tracky .timer-sessions-table td{text-align:left !important}.redmine-tracky .timer-sessions-table td.timer-session-table-issue a{display:block;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.redmine-tracky .timer-sessions-table td.timer-session-table-issue a:hover{white-space:normal}.redmine-tracky .timer-session-table-comments{overflow:auto;overflow-wrap:normal}.redmine-tracky .timer-session-table-actions{text-align:right !important}.redmine-tracky .gap-marker{position:relative;border-bottom:1px solid #fc8c12}.redmine-tracky .gap-marker.error-block:after{bottom:-2px;width:calc(100% + 1px);left:-1px}.redmine-tracky .hidden{display:none}.redmine-tracky .mb-3{margin-bottom:1rem !important}.redmine-tracky .mt-3{margin-top:1rem !important}.redmine-tracky .mr-3{margin-right:1rem !important}.redmine-tracky .ml-3{margin-left:1rem !important}.redmine-tracky .mx-auto{margin-left:auto;margin-right:auto}.redmine-tracky .error{color:#d74427}.redmine-tracky .w-20{width:20% !important}.redmine-tracky .w-25{width:25% !important}.redmine-tracky .w-30{width:30% !important}.redmine-tracky .w-40{width:40% !important}.redmine-tracky .w-50{width:50% !important}.redmine-tracky .w-75{width:75% !important}.redmine-tracky .w-100{width:100% !important}@media only screen and (max-width: 480px){.redmine-tracky [class*=w-]{width:100% !important}}.redmine-tracky .error-block{border-style:solid;border-color:#d74427;border-width:1.5px}.redmine-tracky .error-block-overlap{background-color:#fef9fa !important}.redmine-tracky .error-block-overlap:nth-child(odd){background-color:#fff3f3 !important}.redmine-tracky .error-block-overlap:nth-child(even){background-color:#fce4e6 !important}.redmine-tracky .timer-sessions-table{border-collapse:collapse}.redmine-tracky .timer-sessions-table>td{text-align:left;margin-left:5px}.redmine-tracky .text-center{text-align:center}.redmine-tracky .space-between{display:flex;-moz-box-pack:justify;justify-content:space-between;-moz-box-align:center;align-items:center}.redmine-tracky .h3{font-size:3rem}.redmine-tracky .left-text{text-align:left}.redmine-tracky .right-text{text-align:right !important}.redmine-tracky label{display:block;margin-bottom:.5rem}.redmine-tracky .text-muted{color:#6c757d !important}.redmine-tracky .form-text{display:block;margin-top:.25rem}.redmine-tracky small{font-size:80%;font-weight:400}.redmine-tracky .col-1{width:8.3333333333%}.redmine-tracky .col-2{width:16.6666666667%}.redmine-tracky .col-3{width:25%}.redmine-tracky .col-4{width:33.3333333333%}.redmine-tracky .col-5{width:41.6666666667%}.redmine-tracky .col-6{width:50%}.redmine-tracky .col-7{width:58.3333333333%}.redmine-tracky .col-8{width:66.6666666667%}.redmine-tracky .col-9{width:75%}.redmine-tracky .col-10{width:83.3333333333%}.redmine-tracky .col-11{width:91.6666666667%}.redmine-tracky .col-12{width:100%}@media only screen and (max-width: 768px){.redmine-tracky [class*=col-]{width:100%}}.redmine-tracky .float-right{float:right !important}.redmine-tracky .table-fixed{table-layout:fixed}.redmine-tracky .hyphens-auto{hyphens:auto}.redmine-tracky .times-container{column-count:2}.redmine-tracky .starting-action-buttons{display:flex;flex-wrap:wrap;gap:.5rem}.redmine-tracky .timer-container button svg{stroke:#fff}.redmine-tracky input:disabled,.redmine-tracky button:disabled{background-color:#e9ecef;opacity:1;cursor:default}",""]);const c=l},467(e,t,n){var r=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0}),n(338);const i=n(891),a=r(n(799)),o=r(n(480)),s=r(n(877)),l=r(n(717)),c=r(n(155));window.Stimulus=i.Application.start(),window.Stimulus.register("form",a.default),window.Stimulus.register("timer",o.default),window.Stimulus.register("list",s.default),window.Stimulus.register("issue-completion",l.default),window.Stimulus.register("flatpickr",c.default)},480(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891),i=n(169);class a extends r.Controller{constructor(){super(...arguments),this.timeDiffFields=["hours","minutes","seconds"],this.timeDiffFormat="hh:mm:ss"}connect(){const e=this.startTarget.value,t=this.endTarget.value;if(document.title=e?"⏱️ Tracky":"❌ Tracky",e&&t){const e=this.timeDifference();this.updateTimerLabel(e)}else e&&this.startTicker()}disconnect(){this.stopTicker()}startTicker(){window.TimerInterval=setInterval(()=>{const e=this.timeDifference();this.updateTimerLabel(e)},1e3)}stopTicker(){window.TimerInterval&&clearInterval(window.TimerInterval)}timeDiffToString(e){const t=i.Duration.fromObject(e).toFormat("hh:mm:ss").replace(/-/g,"");return(Object.values(e).some(e=>e<0)?"-":"")+t}dateTimeFromTarget(e){const t=this.convertToDateTime(e.value);return t.isValid?t:this.adjustedDateTime()}timeDifference(){const e=this.dateTimeFromTarget(this.startTarget),t=this.dateTimeFromTarget(this.endTarget).diff(e,this.timeDiffFields);return this.timeDiffToString(t.values||{})}convertToDateTime(e){return i.DateTime.fromFormat(e,window.RedmineTracky.datetimeFormatJavascript)}updateTimerLabel(e){$(this.labelTarget).text(e)}adjustedDateTime(){return i.DateTime.local()}}a.targets=["start","end","label","description"],a.values={timezone:Number},t.default=a},540(e){e.exports=function(e){var t=document.createElement("style");return e.setAttributes(t,e.attributes),e.insert(t,e.options),t}},601(e){e.exports=function(e){return e[1]}},659(e){var t={};e.exports=function(e,n){var r=function(e){if(void 0===t[e]){var n=document.querySelector(e);if(window.HTMLIFrameElement&&n instanceof window.HTMLIFrameElement)try{n=n.contentDocument.head}catch(e){n=null}t[e]=n}return t[e]}(e);if(!r)throw new Error("Couldn't find a style target. This probably means that the value for the 'insert' parameter is invalid.");r.appendChild(n)}},717(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891);class i extends r.Controller{connect(){this.listenForInput(),this.prefillFromURL()}listenForInput(){this.cleanup(),observeAutocompleteField(this.inputTarget.id,function(e,t){const n=window.RedmineTracky.issueCompletionPath,r={term:e.term,scope:"all"};$.get(n,r,null,"json").done(e=>t(e)).fail(()=>t([]))},{select:(e,t)=>(this.addIssue(t),this.cleanup(),!1)})}prefillFromURL(){new URLSearchParams(window.location.search).getAll("issue_ids[]").filter(e=>""!==e).forEach(e=>{const t=window.RedmineTracky.issueCompletionPath,n={term:e,scope:"all"};$.get(t,n,null,"json").done(e=>{const[t]=e;this.addIssue({item:t})}).fail(()=>{console.error(`Failed to fetch issue with ID: ${e}`)})})}addIssue(e){const t=this.application.getControllerForElementAndIdentifier(this.listAnchorTarget,"list");t?.addItem(e.item)}clearInput(){$(this.inputTarget).val("")}cleanup(){this.clearInput(),$(".ui-autocomplete").hide(),$(".ui-helper-hidden-accessible").hide()}}i.targets=["input","listAnchor"],i.values={update:Boolean},t.default=i},799(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891),i=n(169);class a extends r.Controller{constructor(){super(...arguments),this.connected=!1}connect(){this.connected=!0,this.sessionActiveValue?this.showShareIgnoredNotice():this.prefillFieldsFromURL()}disconnect(){this.connected=!1}absoluteTime(e){try{const e=parseFloat(this.absolutInputTarget.value),t=this.convertToDateTime(this.startTarget.value);if(e&&t.isValid){const n=t.plus({hours:e});this.endTarget.value=n.toFormat("dd.LL.yyyy HH:mm"),this.endTarget.dispatchEvent(new Event("change"))}}finally{this.absolutInputTarget.value=""}}issueTargetConnected(e){this.connected&&this.change()}issueTargetDisconnected(e){this.connected&&this.change()}change(){const e={timer_start:this.startTarget.value,timer_end:this.endTarget.value,comments:this.descriptionTarget.value,issue_ids:this.extractIssueIds()||[]};this.dispatchUpdate(e)}share(e){e.preventDefault();const t=[],n=this.extractIssueIds(),r=this.descriptionTarget.value,i=this.startTarget.value,a=this.endTarget.value;n.forEach(e=>t.push(`issue_ids[]=${encodeURIComponent(e)}`)),r&&t.push(`comments=${encodeURIComponent(r)}`),i&&t.push(`timer_start=${encodeURIComponent(i)}`),a&&t.push(`timer_end=${encodeURIComponent(a)}`);const o=t.length>0?`?${t.join("&")}`:"",s=`${window.location.origin}${window.location.pathname}${o}`;navigator.clipboard.writeText(s).then(()=>{this.showFlash(this.shareCopiedValue,"notice")})}prefillFieldsFromURL(){const e=new URLSearchParams(window.location.search);[this.prefillField(e,"comments",this.descriptionTarget),this.prefillField(e,"timer_start",this.startTarget),this.prefillField(e,"timer_end",this.endTarget)].some(Boolean)&&this.showFlash(this.sharePrefilledValue,"notice")}prefillField(e,t,n){const r=e.get(t);return!!r&&(n.value=r,n.dispatchEvent(new Event("change")),!0)}showShareIgnoredNotice(){if(!this.sessionActiveValue)return;const e=new URLSearchParams(window.location.search);(e.has("comments")||e.has("timer_start")||e.has("timer_end")||e.getAll("issue_ids[]").some(e=>""!==e))&&this.showFlash(this.shareIgnoredValue,"warning")}showFlash(e,t){const n=`flash_${t}`,r=document.getElementById(n);if(r)return r.textContent=e,void(r.style.display="");const i=document.getElementById("content");if(!i)return;const a=document.createElement("div");a.id=n,a.className=`flash ${t}`,a.textContent=e,i.prepend(a)}extractIssueIds(){return this.issueTargets.map(e=>e.getAttribute("data-issue-id")||"").filter(e=>null!==e)||[]}dispatchUpdate(e){this.hasStopButtonTarget&&$.ajax({type:"POST",url:window.RedmineTracky.trackerUpdatePath,data:{timer_session:e},async:!0})}convertToDateTime(e){return i.DateTime.fromFormat(e,window.RedmineTracky.datetimeFormatJavascript)}}a.targets=["description","start","stopButton","end","issue","absolutInput"],a.values={shareCopied:String,sharePrefilled:String,shareIgnored:String,sessionActive:Boolean},t.default=a},820(e,t,n){n.r(t),n.d(t,{default:()=>ie});var r=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],i={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:"object"==typeof window&&-1===window.navigator.userAgent.indexOf("MSIE"),ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return"undefined"!=typeof console&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.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},a={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(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%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};const o=a;var s=function(e,t){return void 0===t&&(t=2),("000"+e).slice(-1*t)},l=function(e){return!0===e?1:0};function c(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var u=function(e){return e instanceof Array?e:[e]};function d(e,t,n){if(!0===n)return e.classList.add(t);e.classList.remove(t)}function h(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,void 0!==n&&(r.textContent=n),r}function f(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function m(e,t){return t(e)?e:e.parentNode?m(e.parentNode,t):void 0}function p(e,t){var n=h("div","numInputWrapper"),r=h("input","numInput "+e),i=h("span","arrowUp"),a=h("span","arrowDown");if(-1===navigator.userAgent.indexOf("MSIE 9.0")?r.type="number":(r.type="text",r.pattern="\\d*"),void 0!==t)for(var o in t)r.setAttribute(o,t[o]);return n.appendChild(r),n.appendChild(i),n.appendChild(a),n}function g(e){try{return"function"==typeof e.composedPath?e.composedPath()[0]:e.target}catch(t){return e.target}}var y=function(){},b=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},v={D:y,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*l(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(1e3*parseFloat(t))},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+7*(r-1),0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:y,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:y,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},w={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})"},k={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[k.w(e,t,n)]},F:function(e,t,n){return b(k.n(e,t,n)-1,!1,t)},G:function(e,t,n){return s(k.h(e,t,n))},H:function(e){return s(e.getHours())},J:function(e,t){return void 0!==t.ordinal?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[l(e.getHours()>11)]},M:function(e,t){return b(e.getMonth(),!0,t)},S:function(e){return s(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return s(e.getFullYear(),4)},d:function(e){return s(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return s(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return s(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},x=function(e){var t=e.config,n=void 0===t?i:t,r=e.l10n,o=void 0===r?a:r,s=e.isMobile,l=void 0!==s&&s;return function(e,t,r){var i=r||o;return void 0===n.formatDate||l?t.split("").map(function(t,r,a){return k[t]&&"\\"!==a[r-1]?k[t](e,i,n):"\\"!==t?t:""}).join(""):n.formatDate(e,t,i)}},D=function(e){var t=e.config,n=void 0===t?i:t,r=e.l10n,o=void 0===r?a:r;return function(e,t,r,a){if(0===e||e){var s,l=a||o,c=e;if(e instanceof Date)s=new Date(e.getTime());else if("string"!=typeof e&&void 0!==e.toFixed)s=new Date(e);else if("string"==typeof e){var u=t||(n||i).dateFormat,d=String(e).trim();if("today"===d)s=new Date,r=!0;else if(n&&n.parseDate)s=n.parseDate(e,u);else if(/Z$/.test(d)||/GMT$/.test(d))s=new Date(e);else{for(var h=void 0,f=[],m=0,p=0,g="";m=0?new Date:new Date(n.config.minDate.getTime()),r=T(n.config);t.setHours(r.hours,r.minutes,r.seconds,t.getMilliseconds()),n.selectedDates=[t],n.latestSelectedDateObj=t}void 0!==e&&"blur"!==e.type&&function(e){e.preventDefault();var t="keydown"===e.type,r=g(e),i=r;void 0!==n.amPM&&r===n.amPM&&(n.amPM.textContent=n.l10n.amPM[l(n.amPM.textContent===n.l10n.amPM[0])]);var a=parseFloat(i.getAttribute("min")),o=parseFloat(i.getAttribute("max")),c=parseFloat(i.getAttribute("step")),u=parseInt(i.value,10),d=u+c*(e.delta||(t?38===e.which?1:-1:0));if(void 0!==i.value&&2===i.value.length){var h=i===n.hourElement,f=i===n.minuteElement;do&&(d=i===n.hourElement?d-o-l(!n.amPM):a,f&&V(void 0,1,n.hourElement)),n.amPM&&h&&(1===c?d+u===23:Math.abs(d-u)>c)&&(n.amPM.textContent=n.l10n.amPM[l(n.amPM.textContent===n.l10n.amPM[0])]),i.value=s(d)}}(e);var i=n._input.value;S(),xe(),n._input.value!==i&&n._debouncedChange()}function S(){if(void 0!==n.hourElement&&void 0!==n.minuteElement){var e,t,r=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,i=(parseInt(n.minuteElement.value,10)||0)%60,a=void 0!==n.secondElement?(parseInt(n.secondElement.value,10)||0)%60:0;void 0!==n.amPM&&(e=r,t=n.amPM.textContent,r=e%12+12*l(t===n.l10n.amPM[1]));var o=void 0!==n.config.minTime||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&0===M(n.latestSelectedDateObj,n.config.minDate,!0),s=void 0!==n.config.maxTime||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&0===M(n.latestSelectedDateObj,n.config.maxDate,!0);if(void 0!==n.config.maxTime&&void 0!==n.config.minTime&&n.config.minTime>n.config.maxTime){var c=O(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),u=O(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),d=O(r,i,a);if(d>u&&d=12)]),void 0!==n.secondElement&&(n.secondElement.value=s(r)))}function F(e){var t=g(e),n=parseInt(t.value)+(e.delta||0);(n/1e3>1||"Enter"===e.key&&!/[^\d]/.test(n.toString()))&&X(n)}function j(e,t,r,i){return t instanceof Array?t.forEach(function(t){return j(e,t,r,i)}):e instanceof Array?e.forEach(function(e){return j(e,t,r,i)}):(e.addEventListener(t,r,i),void n._handlers.push({remove:function(){return e.removeEventListener(t,r,i)}}))}function _(){ye("onChange")}function L(e,t){var r=void 0!==e?n.parseDate(e):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate=0&&M(e,n.selectedDates[1])<=0}(t)&&!ve(t)&&o.classList.add("inRange"),n.weekNumbers&&1===n.config.showMonths&&"prevMonthDay"!==e&&i%7==6&&n.weekNumbers.insertAdjacentHTML("beforeend",""+n.config.getWeek(t)+""),ye("onDayCreate",o),o}function R(e){e.focus(),"range"===n.config.mode&&ie(e)}function z(e){for(var t=e>0?0:n.config.showMonths-1,r=e>0?n.config.showMonths:-1,i=t;i!=r;i+=e)for(var a=n.daysContainer.children[i],o=e>0?0:a.children.length-1,s=e>0?a.children.length:-1,l=o;l!=s;l+=e){var c=a.children[l];if(-1===c.className.indexOf("hidden")&&ee(c.dateObj))return c}}function B(e,t){var r=a(),i=te(r||document.body),o=void 0!==e?e:i?r:void 0!==n.selectedDateElem&&te(n.selectedDateElem)?n.selectedDateElem:void 0!==n.todayDateElem&&te(n.todayDateElem)?n.todayDateElem:z(t>0?1:-1);void 0===o?n._input.focus():i?function(e,t){for(var r=-1===e.className.indexOf("Month")?e.dateObj.getMonth():n.currentMonth,i=t>0?n.config.showMonths:-1,a=t>0?1:-1,o=r-n.currentMonth;o!=i;o+=a)for(var s=n.daysContainer.children[o],l=r-n.currentMonth===o?e.$i+t:t<0?s.children.length-1:0,c=s.children.length,u=l;u>=0&&u0?c:-1);u+=a){var d=s.children[u];if(-1===d.className.indexOf("hidden")&&ee(d.dateObj)&&Math.abs(e.$i-u)>=Math.abs(t))return R(d)}n.changeMonth(a),B(z(a),0)}(o,t):R(o)}function H(e,t){for(var r=(new Date(e,t,1).getDay()-n.l10n.firstDayOfWeek+7)%7,i=n.utils.getDaysInMonth((t-1+12)%12,e),a=n.utils.getDaysInMonth(t,e),o=window.document.createDocumentFragment(),s=n.config.showMonths>1,l=s?"prevMonthDay hidden":"prevMonthDay",c=s?"nextMonthDay hidden":"nextMonthDay",u=i+1-r,d=0;u<=i;u++,d++)o.appendChild(P("flatpickr-day "+l,new Date(e,t-1,u),0,d));for(u=1;u<=a;u++,d++)o.appendChild(P("flatpickr-day",new Date(e,t,u),0,d));for(var f=a+1;f<=42-r&&(1===n.config.showMonths||d%7!=0);f++,d++)o.appendChild(P("flatpickr-day "+c,new Date(e,t+1,f%a),0,d));var m=h("div","dayContainer");return m.appendChild(o),m}function Y(){if(void 0!==n.daysContainer){f(n.daysContainer),n.weekNumbers&&f(n.weekNumbers);for(var e=document.createDocumentFragment(),t=0;t1||"dropdown"!==n.config.monthSelectorType)){var e=function(e){return!(void 0!==n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&en.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var t=0;t<12;t++)if(e(t)){var r=h("option","flatpickr-monthDropdown-month");r.value=new Date(n.currentYear,t).getMonth().toString(),r.textContent=b(t,n.config.shorthandCurrentMonth,n.l10n),r.tabIndex=-1,n.currentMonth===t&&(r.selected=!0),n.monthsDropdownContainer.appendChild(r)}}}function U(){var e,t=h("div","flatpickr-month"),r=window.document.createDocumentFragment();n.config.showMonths>1||"static"===n.config.monthSelectorType?e=h("span","cur-month"):(n.monthsDropdownContainer=h("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),j(n.monthsDropdownContainer,"change",function(e){var t=g(e),r=parseInt(t.value,10);n.changeMonth(r-n.currentMonth),ye("onMonthChange")}),W(),e=n.monthsDropdownContainer);var i=p("cur-year",{tabindex:"-1"}),a=i.getElementsByTagName("input")[0];a.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&a.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(a.setAttribute("max",n.config.maxDate.getFullYear().toString()),a.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var o=h("div","flatpickr-current-month");return o.appendChild(e),o.appendChild(i),r.appendChild(o),t.appendChild(r),{container:t,yearElement:a,monthElement:e}}function Z(){f(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var e=n.config.showMonths;e--;){var t=U();n.yearElements.push(t.yearElement),n.monthElements.push(t.monthElement),n.monthNav.appendChild(t.container)}n.monthNav.appendChild(n.nextMonthNav)}function q(){n.weekdayContainer?f(n.weekdayContainer):n.weekdayContainer=h("div","flatpickr-weekdays");for(var e=n.config.showMonths;e--;){var t=h("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(t)}return K(),n.weekdayContainer}function K(){if(n.weekdayContainer){var e=n.l10n.firstDayOfWeek,t=E(n.l10n.weekdays.shorthand);e>0&&e\n "+t.join("")+"\n \n "}}function J(e,t){void 0===t&&(t=!0);var r=t?e:e-n.currentMonth;r<0&&!0===n._hidePrevMonthArrow||r>0&&!0===n._hideNextMonthArrow||(n.currentMonth+=r,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,ye("onYearChange"),W()),Y(),ye("onMonthChange"),we())}function G(e){return n.calendarContainer.contains(e)}function Q(e){if(n.isOpen&&!n.config.inline){var t=g(e),r=G(t),i=!(t===n.input||t===n.altInput||n.element.contains(t)||e.path&&e.path.indexOf&&(~e.path.indexOf(n.input)||~e.path.indexOf(n.altInput))||r||G(e.relatedTarget)),a=!n.config.ignoredFocusElements.some(function(e){return e.contains(t)});i&&a&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement&&""!==n.input.value&&void 0!==n.input.value&&k(),n.close(),n.config&&"range"===n.config.mode&&1===n.selectedDates.length&&n.clear(!1))}}function X(e){if(!(!e||n.config.minDate&&en.config.maxDate.getFullYear())){var t=e,r=n.currentYear!==t;n.currentYear=t||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),r&&(n.redraw(),ye("onYearChange"),W())}}function ee(e,t){var r;void 0===t&&(t=!0);var i=n.parseDate(e,void 0,t);if(n.config.minDate&&i&&M(i,n.config.minDate,void 0!==t?t:!n.minDateHasTime)<0||n.config.maxDate&&i&&M(i,n.config.maxDate,void 0!==t?t:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&0===n.config.disable.length)return!0;if(void 0===i)return!1;for(var a=!!n.config.enable,o=null!==(r=n.config.enable)&&void 0!==r?r:n.config.disable,s=0,l=void 0;s=l.from.getTime()&&i.getTime()<=l.to.getTime())return a}return!a}function te(e){return void 0!==n.daysContainer&&-1===e.className.indexOf("hidden")&&-1===e.className.indexOf("flatpickr-disabled")&&n.daysContainer.contains(e)}function ne(e){var t=e.target===n._input,r=n._input.value.trimEnd()!==ke();!t||!r||e.relatedTarget&&G(e.relatedTarget)||n.setDate(n._input.value,!0,e.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function re(t){var r=g(t),i=n.config.wrap?e.contains(r):r===n._input,o=n.config.allowInput,s=n.isOpen&&(!o||!i),l=n.config.inline&&i&&!o;if(13===t.keyCode&&i){if(o)return n.setDate(n._input.value,!0,r===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),r.blur();n.open()}else if(G(r)||s||l){var c=!!n.timeContainer&&n.timeContainer.contains(r);switch(t.keyCode){case 13:c?(t.preventDefault(),k(),de()):he(t);break;case 27:t.preventDefault(),de();break;case 8:case 46:i&&!n.config.allowInput&&(t.preventDefault(),n.clear());break;case 37:case 39:if(c||i)n.hourElement&&n.hourElement.focus();else{t.preventDefault();var u=a();if(void 0!==n.daysContainer&&(!1===o||u&&te(u))){var d=39===t.keyCode?1:-1;t.ctrlKey?(t.stopPropagation(),J(d),B(z(1),0)):B(void 0,d)}}break;case 38:case 40:t.preventDefault();var h=40===t.keyCode?1:-1;n.daysContainer&&void 0!==r.$i||r===n.input||r===n.altInput?t.ctrlKey?(t.stopPropagation(),X(n.currentYear-h),B(z(1),0)):c||B(void 0,7*h):r===n.currentYearElement?X(n.currentYear-h):n.config.enableTime&&(!c&&n.hourElement&&n.hourElement.focus(),k(t),n._debouncedChange());break;case 9:if(c){var f=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(e){return e}),m=f.indexOf(r);if(-1!==m){var p=f[m+(t.shiftKey?-1:1)];t.preventDefault(),(p||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(r)&&t.shiftKey&&(t.preventDefault(),n._input.focus())}}if(void 0!==n.amPM&&r===n.amPM)switch(t.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],S(),xe();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],S(),xe()}(i||G(r))&&ye("onKeyDown",t)}function ie(e,t){if(void 0===t&&(t="flatpickr-day"),1===n.selectedDates.length&&(!e||e.classList.contains(t)&&!e.classList.contains("flatpickr-disabled"))){for(var r=e?e.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),i=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),a=Math.min(r,n.selectedDates[0].getTime()),o=Math.max(r,n.selectedDates[0].getTime()),s=!1,l=0,c=0,u=a;ua&&ul)?l=u:u>i&&(!c||u ."+t)).forEach(function(t){var a,o,u,d=t.dateObj.getTime(),h=l>0&&d0&&d>c;if(h)return t.classList.add("notAllowed"),void["inRange","startRange","endRange"].forEach(function(e){t.classList.remove(e)});s&&!h||(["startRange","inRange","endRange","notAllowed"].forEach(function(e){t.classList.remove(e)}),void 0!==e&&(e.classList.add(r<=n.selectedDates[0].getTime()?"startRange":"endRange"),ir&&d===i&&t.classList.add("endRange"),d>=l&&(0===c||d<=c)&&(o=i,u=r,(a=d)>Math.min(o,u)&&a0||r.getMinutes()>0||r.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(e){return ee(e)}),n.selectedDates.length||"min"!==e||N(r),xe()),n.daysContainer&&(ue(),void 0!==r?n.currentYearElement[e]=r.getFullYear().toString():n.currentYearElement.removeAttribute(e),n.currentYearElement.disabled=!!i&&void 0!==r&&i.getFullYear()===r.getFullYear())}}function se(){return n.config.wrap?e.querySelector("[data-input]"):e}function le(){"object"!=typeof n.config.locale&&void 0===A.l10ns[n.config.locale]&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=C(C({},A.l10ns.default),"object"==typeof n.config.locale?n.config.locale:"default"!==n.config.locale?A.l10ns[n.config.locale]:void 0),w.D="("+n.l10n.weekdays.shorthand.join("|")+")",w.l="("+n.l10n.weekdays.longhand.join("|")+")",w.M="("+n.l10n.months.shorthand.join("|")+")",w.F="("+n.l10n.months.longhand.join("|")+")",w.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")",void 0===C(C({},t),JSON.parse(JSON.stringify(e.dataset||{}))).time_24hr&&void 0===A.defaultConfig.time_24hr&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=x(n),n.parseDate=D({config:n.config,l10n:n.l10n})}function ce(e){if("function"!=typeof n.config.position){if(void 0!==n.calendarContainer){ye("onPreCalendarPosition");var t=e||n._positionElement,r=Array.prototype.reduce.call(n.calendarContainer.children,function(e,t){return e+t.offsetHeight},0),i=n.calendarContainer.offsetWidth,a=n.config.position.split(" "),o=a[0],s=a.length>1?a[1]:null,l=t.getBoundingClientRect(),c=window.innerHeight-l.bottom,u="above"===o||"below"!==o&&cr,h=window.pageYOffset+l.top+(u?-r-2:t.offsetHeight+2);if(d(n.calendarContainer,"arrowTop",!u),d(n.calendarContainer,"arrowBottom",u),!n.config.inline){var f=window.pageXOffset+l.left,m=!1,p=!1;"center"===s?(f-=(i-l.width)/2,m=!0):"right"===s&&(f-=i-l.width,p=!0),d(n.calendarContainer,"arrowLeft",!m&&!p),d(n.calendarContainer,"arrowCenter",m),d(n.calendarContainer,"arrowRight",p);var g=window.document.body.offsetWidth-(window.pageXOffset+l.right),y=f+i>window.document.body.offsetWidth,b=g+i>window.document.body.offsetWidth;if(d(n.calendarContainer,"rightMost",y),!n.config.static)if(n.calendarContainer.style.top=h+"px",y)if(b){var v=function(){for(var e=null,t=0;tn.currentMonth+n.config.showMonths-1)&&"range"!==n.config.mode;if(n.selectedDateElem=r,"single"===n.config.mode)n.selectedDates=[i];else if("multiple"===n.config.mode){var o=ve(i);o?n.selectedDates.splice(parseInt(o),1):n.selectedDates.push(i)}else"range"===n.config.mode&&(2===n.selectedDates.length&&n.clear(!1,!1),n.latestSelectedDateObj=i,n.selectedDates.push(i),0!==M(i,n.selectedDates[0],!0)&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()}));if(S(),a){var s=n.currentYear!==i.getFullYear();n.currentYear=i.getFullYear(),n.currentMonth=i.getMonth(),s&&(ye("onYearChange"),W()),ye("onMonthChange")}if(we(),Y(),xe(),a||"range"===n.config.mode||1!==n.config.showMonths?void 0!==n.selectedDateElem&&void 0===n.hourElement&&n.selectedDateElem&&n.selectedDateElem.focus():R(r),void 0!==n.hourElement&&void 0!==n.hourElement&&n.hourElement.focus(),n.config.closeOnSelect){var l="single"===n.config.mode&&!n.config.enableTime,c="range"===n.config.mode&&2===n.selectedDates.length&&!n.config.enableTime;(l||c)&&de()}_()}}n.parseDate=D({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=j,n._setHoursFromDate=N,n._positionCalendar=ce,n.changeMonth=J,n.changeYear=X,n.clear=function(e,t){if(void 0===e&&(e=!0),void 0===t&&(t=!0),n.input.value="",void 0!==n.altInput&&(n.altInput.value=""),void 0!==n.mobileInput&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,!0===t&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),!0===n.config.enableTime){var r=T(n.config);I(r.hours,r.minutes,r.seconds)}n.redraw(),e&&ye("onChange")},n.close=function(){n.isOpen=!1,n.isMobile||(void 0!==n.calendarContainer&&n.calendarContainer.classList.remove("open"),void 0!==n._input&&n._input.classList.remove("active")),ye("onClose")},n.onMouseOver=ie,n._createElement=h,n.createDay=P,n.destroy=function(){void 0!==n.config&&ye("onDestroy");for(var e=n._handlers.length;e--;)n._handlers[e].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var t=n.calendarContainer.parentNode;if(t.lastChild&&t.removeChild(t.lastChild),t.parentNode){for(;t.firstChild;)t.parentNode.insertBefore(t.firstChild,t);t.parentNode.removeChild(t)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(e){try{delete n[e]}catch(e){}})},n.isEnabled=ee,n.jumpToDate=L,n.updateValue=xe,n.open=function(e,t){if(void 0===t&&(t=n._positionElement),!0===n.isMobile){if(e){e.preventDefault();var r=g(e);r&&r.blur()}return void 0!==n.mobileInput&&(n.mobileInput.focus(),n.mobileInput.click()),void ye("onOpen")}if(!n._input.disabled&&!n.config.inline){var i=n.isOpen;n.isOpen=!0,i||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),ye("onOpen"),ce(t)),!0===n.config.enableTime&&!0===n.config.noCalendar&&(!1!==n.config.allowInput||void 0!==e&&n.timeContainer.contains(e.relatedTarget)||setTimeout(function(){return n.hourElement.select()},50))}},n.redraw=ue,n.set=function(e,t){if(null!==e&&"object"==typeof e)for(var i in Object.assign(n.config,e),e)void 0!==fe[i]&&fe[i].forEach(function(e){return e()});else n.config[e]=t,void 0!==fe[e]?fe[e].forEach(function(e){return e()}):r.indexOf(e)>-1&&(n.config[e]=u(t));n.redraw(),xe(!0)},n.setDate=function(e,t,r){if(void 0===t&&(t=!1),void 0===r&&(r=n.config.dateFormat),0!==e&&!e||e instanceof Array&&0===e.length)return n.clear(t);me(e,r),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),L(void 0,t),N(),0===n.selectedDates.length&&n.clear(!1),xe(t),t&&ye("onChange")},n.toggle=function(e){if(!0===n.isOpen)return n.close();n.open(e)};var fe={locale:[le,K],showMonths:[Z,v,q],minDate:[L],maxDate:[L],positionElement:[ge],clickOpens:[function(){!0===n.config.clickOpens?(j(n._input,"focus",n.open),j(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function me(e,t){var r=[];if(e instanceof Array)r=e.map(function(e){return n.parseDate(e,t)});else if(e instanceof Date||"number"==typeof e)r=[n.parseDate(e,t)];else if("string"==typeof e)switch(n.config.mode){case"single":case"time":r=[n.parseDate(e,t)];break;case"multiple":r=e.split(n.config.conjunction).map(function(e){return n.parseDate(e,t)});break;case"range":r=e.split(n.l10n.rangeSeparator).map(function(e){return n.parseDate(e,t)})}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(e)));n.selectedDates=n.config.allowInvalidPreload?r:r.filter(function(e){return e instanceof Date&&ee(e,!1)}),"range"===n.config.mode&&n.selectedDates.sort(function(e,t){return e.getTime()-t.getTime()})}function pe(e){return e.slice().map(function(e){return"string"==typeof e||"number"==typeof e||e instanceof Date?n.parseDate(e,void 0,!0):e&&"object"==typeof e&&e.from&&e.to?{from:n.parseDate(e.from,void 0),to:n.parseDate(e.to,void 0)}:e}).filter(function(e){return e})}function ge(){n._positionElement=n.config.positionElement||n._input}function ye(e,t){if(void 0!==n.config){var r=n.config[e];if(void 0!==r&&r.length>0)for(var i=0;r[i]&&i1||"static"===n.config.monthSelectorType?n.monthElements[t].textContent=b(r.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=r.getMonth().toString(),e.value=r.getFullYear().toString()}),n._hidePrevMonthArrow=void 0!==n.config.minDate&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYearn.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function ke(e){var t=e||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(e){return n.formatDate(e,t)}).filter(function(e,t,r){return"range"!==n.config.mode||n.config.enableTime||r.indexOf(e)===t}).join("range"!==n.config.mode?n.config.conjunction:n.l10n.rangeSeparator)}function xe(e){void 0===e&&(e=!0),void 0!==n.mobileInput&&n.mobileFormatStr&&(n.mobileInput.value=void 0!==n.latestSelectedDateObj?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=ke(n.config.dateFormat),void 0!==n.altInput&&(n.altInput.value=ke(n.config.altFormat)),!1!==e&&ye("onValueUpdate")}function De(e){var t=g(e),r=n.prevMonthNav.contains(t),i=n.nextMonthNav.contains(t);r||i?J(r?-1:1):n.yearElements.indexOf(t)>=0?t.select():t.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):t.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}return function(){n.element=n.input=e,n.isOpen=!1,function(){var a=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],o=C(C({},JSON.parse(JSON.stringify(e.dataset||{}))),t),s={};n.config.parseDate=o.parseDate,n.config.formatDate=o.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(e){n.config._enable=pe(e)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(e){n.config._disable=pe(e)}});var l="time"===o.mode;if(!o.dateFormat&&(o.enableTime||l)){var c=A.defaultConfig.dateFormat||i.dateFormat;s.dateFormat=o.noCalendar||l?"H:i"+(o.enableSeconds?":S":""):c+" H:i"+(o.enableSeconds?":S":"")}if(o.altInput&&(o.enableTime||l)&&!o.altFormat){var d=A.defaultConfig.altFormat||i.altFormat;s.altFormat=o.noCalendar||l?"h:i"+(o.enableSeconds?":S K":" K"):d+" h:i"+(o.enableSeconds?":S":"")+" K"}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:oe("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:oe("max")});var h=function(e){return function(t){n.config["min"===e?"_minTime":"_maxTime"]=n.parseDate(t,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:h("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:h("max")}),"time"===o.mode&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,s,o);for(var f=0;f-1?n.config[p]=u(m[p]).map(y).concat(n.config[p]):void 0===o[p]&&(n.config[p]=m[p])}o.altInputClass||(n.config.altInputClass=se().className+" "+n.config.altInputClass),ye("onParseConfig")}(),le(),n.input=se(),n.input?(n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=h(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),ge()):n.config.errorHandler(new Error("Invalid input element specified")),function(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var e=n.config.defaultDate||("INPUT"!==n.input.nodeName&&"TEXTAREA"!==n.input.nodeName||!n.input.placeholder||n.input.value!==n.input.placeholder?n.input.value:null);e&&me(e,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()0&&(n.latestSelectedDateObj=n.selectedDates[0]),void 0!==n.config.minTime&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),void 0!==n.config.maxTime&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}(),n.utils={getDaysInMonth:function(e,t){return void 0===e&&(e=n.currentMonth),void 0===t&&(t=n.currentYear),1===e&&(t%4==0&&t%100!=0||t%400==0)?29:n.l10n.daysInMonth[e]}},n.isMobile||function(){var e=window.document.createDocumentFragment();if(n.calendarContainer=h("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(e.appendChild((n.monthNav=h("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=h("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=h("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,Z(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(e){n.__hidePrevMonthArrow!==e&&(d(n.prevMonthNav,"flatpickr-disabled",e),n.__hidePrevMonthArrow=e)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(e){n.__hideNextMonthArrow!==e&&(d(n.nextMonthNav,"flatpickr-disabled",e),n.__hideNextMonthArrow=e)}}),n.currentYearElement=n.yearElements[0],we(),n.monthNav)),n.innerContainer=h("div","flatpickr-innerContainer"),n.config.weekNumbers){var t=function(){n.calendarContainer.classList.add("hasWeeks");var e=h("div","flatpickr-weekwrapper");e.appendChild(h("span","flatpickr-weekday",n.l10n.weekAbbreviation));var t=h("div","flatpickr-weeks");return e.appendChild(t),{weekWrapper:e,weekNumbers:t}}(),r=t.weekWrapper,i=t.weekNumbers;n.innerContainer.appendChild(r),n.weekNumbers=i,n.weekWrapper=r}n.rContainer=h("div","flatpickr-rContainer"),n.rContainer.appendChild(q()),n.daysContainer||(n.daysContainer=h("div","flatpickr-days"),n.daysContainer.tabIndex=-1),Y(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),e.appendChild(n.innerContainer)}n.config.enableTime&&e.appendChild(function(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var e=T(n.config);n.timeContainer=h("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var t=h("span","flatpickr-time-separator",":"),r=p("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=r.getElementsByTagName("input")[0];var i=p("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=i.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=s(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?e.hours:function(e){switch(e%24){case 0:case 12:return 12;default:return e%12}}(e.hours)),n.minuteElement.value=s(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():e.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(r),n.timeContainer.appendChild(t),n.timeContainer.appendChild(i),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var a=p("flatpickr-second");n.secondElement=a.getElementsByTagName("input")[0],n.secondElement.value=s(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():e.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(h("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(a)}return n.config.time_24hr||(n.amPM=h("span","flatpickr-am-pm",n.l10n.amPM[l((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}()),d(n.calendarContainer,"rangeMode","range"===n.config.mode),d(n.calendarContainer,"animate",!0===n.config.animate),d(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(e);var a=void 0!==n.config.appendTo&&void 0!==n.config.appendTo.nodeType;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!a&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):void 0!==n.config.appendTo&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var o=h("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(o,n.element),o.appendChild(n.element),n.altInput&&o.appendChild(n.altInput),o.appendChild(n.calendarContainer)}n.config.static||n.config.inline||(void 0!==n.config.appendTo?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}(),function(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(e){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+e+"]"),function(t){return j(t,"click",n[e])})}),n.isMobile)!function(){var e=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=h("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=e,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr="datetime-local"===e?"Y-m-d\\TH:i:S":"date"===e?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",void 0!==n.altInput&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(e){}j(n.mobileInput,"change",function(e){n.setDate(g(e).value,!1,n.mobileFormatStr),ye("onChange"),ye("onClose")})}();else{var e=c(ae,50);if(n._debouncedChange=c(_,300),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&j(n.daysContainer,"mouseover",function(e){"range"===n.config.mode&&ie(g(e))}),j(n._input,"keydown",re),void 0!==n.calendarContainer&&j(n.calendarContainer,"keydown",re),n.config.inline||n.config.static||j(window,"resize",e),void 0!==window.ontouchstart?j(window.document,"touchstart",Q):j(window.document,"mousedown",Q),j(window.document,"focus",Q,{capture:!0}),!0===n.config.clickOpens&&(j(n._input,"focus",n.open),j(n._input,"click",n.open)),void 0!==n.daysContainer&&(j(n.monthNav,"click",De),j(n.monthNav,["keyup","increment"],F),j(n.daysContainer,"click",he)),void 0!==n.timeContainer&&void 0!==n.minuteElement&&void 0!==n.hourElement){j(n.timeContainer,["increment"],k),j(n.timeContainer,"blur",k,{capture:!0}),j(n.timeContainer,"click",$),j([n.hourElement,n.minuteElement],["focus","click"],function(e){return g(e).select()}),void 0!==n.secondElement&&j(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),void 0!==n.amPM&&j(n.amPM,"click",function(e){k(e)})}n.config.allowInput&&j(n._input,"blur",ne)}}(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&N(n.config.noCalendar?n.latestSelectedDateObj:void 0),xe(!1)),v();var a=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&a&&ce(),ye("onReady")}(),n}function N(e,t){for(var n=Array.prototype.slice.call(e).filter(function(e){return e instanceof HTMLElement}),r=[],i=0;it.toUpperCase())}function R(e){return e.charAt(0).toUpperCase()+e.slice(1)}function z(e,t){const n=B(e);return Array.from(n.reduce((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach(t=>e.add(t)),e),new Set))}function B(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}function H([e,t]){return function(e,t){const n=`${i=e,i.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}-value`,r=function(e){const t=function(e){const t=Y(e.type);if(t){const n=W(e.default);if(t!==n)throw new Error(`Type "${t}" must match the type of the default value. Given default value: "${e.default}" as "${n}"`);return t}}(e),n=W(e),r=Y(e),i=t||n||r;if(i)return i;throw new Error(`Unknown value type "${e}"`)}(t);var i;return{type:r,key:n,name:P(n),get defaultValue(){return function(e){const t=Y(e);if(t)return U[t];const n=e.default;return void 0!==n?n:e}(t)},get hasCustomDefaultValue(){return void 0!==W(t)},reader:Z[r],writer:q[r]||q.default}}(e,t)}function Y(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function W(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e(function(){this.a.call(this)});t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();const U={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},Z={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError("Expected array");return t},boolean:e=>!("0"==e||"false"==e),number:e=>Number(e),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError("Expected object");return t},string:e=>e},q={default:function(e){return`${e}`},array:K,object:K};function K(e){return JSON.stringify(e)}class J{constructor(e){this.context=e}static get shouldLoad(){return!0}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:i=!0,cancelable:a=!0}={}){const o=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:a});return t.dispatchEvent(o),o}}J.blessings=[function(e){return z(e,"classes").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${R(n)}Class`]:{get(){return this.classes.has(n)}}}));var n},{})},function(e){return z(e,"targets").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${R(n)}Target`]:{get(){return this.targets.has(n)}}}));var n},{})},function(e){const t=function(e,t){return B(e).reduce((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map(e=>[e,n[e]]):[]}(n,t)),e),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce((e,t)=>{const n=H(t),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})},{})}}};return t.reduce((e,t)=>Object.assign(e,function(e){const t=H(e),{key:n,name:r,reader:i,writer:a}=t;return{[r]:{get(){const e=this.data.get(n);return null!==e?i(e):t.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,a(e))}},[`has${R(r)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}(t)),n)}],J.targets=[],J.values={};const G=["altFormat","ariaDateFormat","dateFormat"],Q={string:["altInputClass","conjunction","mode","nextArrow","position","prevArrow","monthSelectorType"],boolean:["allowInput","altInput","animate","clickOpens","closeOnSelect","disableMobile","enableSeconds","enableTime","inline","noCalendar","shorthandCurrentMonth","static","time_24hr","weekNumbers","wrap"],date:["maxDate","minDate","maxTime","minTime","now"],array:["disable","enable","disableDaysOfWeek","enableDaysOfWeek"],number:["defaultHour","defaultMinute","defaultSeconds","hourIncrement","minuteIncrement","showMonths"],arrayOrString:["defaultDate"]},X=["change","open","close","monthChange","yearChange","ready","valueUpdate","dayCreate"],ee=["calendarContainer","currentYearElement","days","daysContainer","input","nextMonthNav","monthNav","prevMonthNav","rContainer","selectedDateElem","todayDateElem","weekdayContainer"],te={"%Y":"Y","%y":"y","%C":"Y","%m":"m","%-m":"n","%_m":"n","%B":"F","%^B":"F","%b":"M","%^b":"M","%h":"M","%^h":"M","%d":"d","%-d":"j","%e":"j","%H":"H","%k":"H","%I":"h","%l":"h","%-l":"h","%P":"K","%p":"K","%M":"i","%S":"S","%A":"l","%a":"D","%w":"w"},ne=new RegExp(Object.keys(te).join("|").replace(new RegExp("\\^","g"),"\\^"),"g");let re=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&$(e,t)}(i,e);var t,n,r=V(i);function i(){return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,i),r.apply(this,arguments)}return t=i,n=[{key:"initialize",value:function(){this.config={}}},{key:"connect",value:function(){this._initializeEvents(),this._initializeOptions(),this._initializeDateFormats(),this.fp=I(this.flatpickrElement,function(e){for(var t=1;t{if(this[e]){const n=`on${t=e,t.charAt(0).toUpperCase()+t.slice(1)}`;this.config[n]=this[e].bind(this)}var t})}},{key:"_initializeOptions",value:function(){Object.keys(Q).forEach(e=>{Q[e].forEach(t=>{const n=t.replace(/([a-z])([A-Z])/g,"$1-$2").replace(/[\s_]+/g,"-").toLowerCase();this.data.has(n)&&(this.config[t]=this[`_${e}`](n))})}),this._handleDaysOfWeek()}},{key:"_handleDaysOfWeek",value:function(){this.config.disableDaysOfWeek&&(this.config.disableDaysOfWeek=this._validateDaysOfWeek(this.config.disableDaysOfWeek),this.config.disable=[...this.config.disable||[],this._disable.bind(this)]),this.config.enableDaysOfWeek&&(this.config.enableDaysOfWeek=this._validateDaysOfWeek(this.config.enableDaysOfWeek),this.config.enable=[...this.config.enable||[],this._enable.bind(this)])}},{key:"_validateDaysOfWeek",value:function(e){return Array.isArray(e)?e.map(e=>parseInt(e)):(console.error("days of week must be a valid array"),[])}},{key:"_disable",value:function(e){return this.config.disableDaysOfWeek.includes(e.getDay())}},{key:"_enable",value:function(e){return this.config.enableDaysOfWeek.includes(e.getDay())}},{key:"_initializeDateFormats",value:function(){G.forEach(e=>{this.data.has(e)&&(this.config[e]=this.data.get(e).replace(ne,e=>te[e]))})}},{key:"_initializeElements",value:function(){ee.forEach(e=>{this[`${e}Target`]=this.fp[e]})}},{key:"_string",value:function(e){return this.data.get(e)}},{key:"_date",value:function(e){return this.data.get(e)}},{key:"_boolean",value:function(e){return!("0"==this.data.get(e)||"false"==this.data.get(e))}},{key:"_array",value:function(e){return JSON.parse(this.data.get(e))}},{key:"_number",value:function(e){return parseInt(this.data.get(e))}},{key:"_arrayOrString",value:function(e){const t=this.data.get(e);try{return JSON.parse(t)}catch(e){return t}}},{key:"flatpickrElement",get:function(){return this.hasInstanceTarget&&this.instanceTarget||this.element}}],n&&F(t.prototype,n),i}(J);j(re,"targets",["instance"]);const ie=re},825(e){e.exports=function(e){if("undefined"==typeof document)return{update:function(){},remove:function(){}};var t=e.insertStyleElement(e);return{update:function(n){!function(e,t,n){var r="";n.supports&&(r+="@supports (".concat(n.supports,") {")),n.media&&(r+="@media ".concat(n.media," {"));var i=void 0!==n.layer;i&&(r+="@layer".concat(n.layer.length>0?" ".concat(n.layer):""," {")),r+=n.css,i&&(r+="}"),n.media&&(r+="}"),n.supports&&(r+="}");var a=n.sourceMap;a&&"undefined"!=typeof btoa&&(r+="\n/*# sourceMappingURL=data:application/json;base64,".concat(btoa(unescape(encodeURIComponent(JSON.stringify(a))))," */")),t.styleTagTransform(r,e,t.options)}(t,e,n)},remove:function(){!function(e){if(null===e.parentNode)return!1;e.parentNode.removeChild(e)}(t)}}}},877(e,t,n){Object.defineProperty(t,"__esModule",{value:!0});const r=n(891);class i extends r.Controller{addItem(e){this.tableTarget.querySelector("tbody").appendChild(this.buildItem(e))}removeItem({target:e}){const t=e;t.closest('[data-form-target="issue"]')?.remove()}buildItem(e){const t=this.tableTarget.querySelector("template").content.cloneNode(!0),n=t.querySelector("a"),r=t.querySelector("input");return n.href=`/issues/${e.id}`,n.innerHTML=`${e.project} - ${e.id}: `,r.id=`timer_session_issue_id_${e.id}`,r.value=e.id.toString(),t.querySelector("tr").setAttribute("data-issue-id",e.id.toString()),t.querySelector("[data-issue-subject]").innerHTML=e.subject,t}}i.targets=["table"],t.default=i},891(e,t,n){n.r(t),n.d(t,{Application:()=>Q,AttributeObserver:()=>w,Context:()=>$,Controller:()=>le,ElementObserver:()=>v,IndexedMultimap:()=>T,Multimap:()=>O,SelectorObserver:()=>C,StringMapObserver:()=>E,TokenListObserver:()=>S,ValueListObserver:()=>N,add:()=>k,defaultSchema:()=>J,del:()=>x,fetch:()=>D,prune:()=>M});class r{constructor(e,t,n){this.eventTarget=e,this.eventName=t,this.eventOptions=n,this.unorderedBindings=new Set}connect(){this.eventTarget.addEventListener(this.eventName,this,this.eventOptions)}disconnect(){this.eventTarget.removeEventListener(this.eventName,this,this.eventOptions)}bindingConnected(e){this.unorderedBindings.add(e)}bindingDisconnected(e){this.unorderedBindings.delete(e)}handleEvent(e){const t=function(e){if("immediatePropagationStopped"in e)return e;{const{stopImmediatePropagation:t}=e;return Object.assign(e,{immediatePropagationStopped:!1,stopImmediatePropagation(){this.immediatePropagationStopped=!0,t.call(this)}})}}(e);for(const e of this.bindings){if(t.immediatePropagationStopped)break;e.handleEvent(t)}}hasBindings(){return this.unorderedBindings.size>0}get bindings(){return Array.from(this.unorderedBindings).sort((e,t)=>{const n=e.index,r=t.index;return nr?1:0})}}class i{constructor(e){this.application=e,this.eventListenerMaps=new Map,this.started=!1}start(){this.started||(this.started=!0,this.eventListeners.forEach(e=>e.connect()))}stop(){this.started&&(this.started=!1,this.eventListeners.forEach(e=>e.disconnect()))}get eventListeners(){return Array.from(this.eventListenerMaps.values()).reduce((e,t)=>e.concat(Array.from(t.values())),[])}bindingConnected(e){this.fetchEventListenerForBinding(e).bindingConnected(e)}bindingDisconnected(e,t=!1){this.fetchEventListenerForBinding(e).bindingDisconnected(e),t&&this.clearEventListenersForBinding(e)}handleError(e,t,n={}){this.application.handleError(e,`Error ${t}`,n)}clearEventListenersForBinding(e){const t=this.fetchEventListenerForBinding(e);t.hasBindings()||(t.disconnect(),this.removeMappedEventListenerFor(e))}removeMappedEventListenerFor(e){const{eventTarget:t,eventName:n,eventOptions:r}=e,i=this.fetchEventListenerMapForEventTarget(t),a=this.cacheKey(n,r);i.delete(a),0==i.size&&this.eventListenerMaps.delete(t)}fetchEventListenerForBinding(e){const{eventTarget:t,eventName:n,eventOptions:r}=e;return this.fetchEventListener(t,n,r)}fetchEventListener(e,t,n){const r=this.fetchEventListenerMapForEventTarget(e),i=this.cacheKey(t,n);let a=r.get(i);return a||(a=this.createEventListener(e,t,n),r.set(i,a)),a}createEventListener(e,t,n){const i=new r(e,t,n);return this.started&&i.connect(),i}fetchEventListenerMapForEventTarget(e){let t=this.eventListenerMaps.get(e);return t||(t=new Map,this.eventListenerMaps.set(e,t)),t}cacheKey(e,t){const n=[e];return Object.keys(t).sort().forEach(e=>{n.push(`${t[e]?"":"!"}${e}`)}),n.join(":")}}const a={stop:({event:e,value:t})=>(t&&e.stopPropagation(),!0),prevent:({event:e,value:t})=>(t&&e.preventDefault(),!0),self:({event:e,value:t,element:n})=>!t||n===e.target},o=/^(?:(?:([^.]+?)\+)?(.+?)(?:\.(.+?))?(?:@(window|document))?->)?(.+?)(?:#([^:]+?))(?::(.+))?$/;function s(e){return e.replace(/(?:[_-])([a-z0-9])/g,(e,t)=>t.toUpperCase())}function l(e){return s(e.replace(/--/g,"-").replace(/__/g,"_"))}function c(e){return e.charAt(0).toUpperCase()+e.slice(1)}function u(e){return e.replace(/([A-Z])/g,(e,t)=>`-${t.toLowerCase()}`)}function d(e){return null!=e}function h(e,t){return Object.prototype.hasOwnProperty.call(e,t)}const f=["meta","ctrl","alt","shift"];class m{constructor(e,t,n,r){this.element=e,this.index=t,this.eventTarget=n.eventTarget||e,this.eventName=n.eventName||function(e){const t=e.tagName.toLowerCase();if(t in p)return p[t](e)}(e)||g("missing event name"),this.eventOptions=n.eventOptions||{},this.identifier=n.identifier||g("missing identifier"),this.methodName=n.methodName||g("missing method name"),this.keyFilter=n.keyFilter||"",this.schema=r}static forToken(e,t){return new this(e.element,e.index,function(e){const t=e.trim().match(o)||[];let n=t[2],r=t[3];return r&&!["keydown","keyup","keypress"].includes(n)&&(n+=`.${r}`,r=""),{eventTarget:(i=t[4],"window"==i?window:"document"==i?document:void 0),eventName:n,eventOptions:t[7]?(a=t[7],a.split(":").reduce((e,t)=>Object.assign(e,{[t.replace(/^!/,"")]:!/^!/.test(t)}),{})):{},identifier:t[5],methodName:t[6],keyFilter:t[1]||r};var i,a}(e.content),t)}toString(){const e=this.keyFilter?`.${this.keyFilter}`:"",t=this.eventTargetName?`@${this.eventTargetName}`:"";return`${this.eventName}${e}${t}->${this.identifier}#${this.methodName}`}shouldIgnoreKeyboardEvent(e){if(!this.keyFilter)return!1;const t=this.keyFilter.split("+");if(this.keyFilterDissatisfied(e,t))return!0;const n=t.filter(e=>!f.includes(e))[0];return!!n&&(h(this.keyMappings,n)||g(`contains unknown key filter: ${this.keyFilter}`),this.keyMappings[n].toLowerCase()!==e.key.toLowerCase())}shouldIgnoreMouseEvent(e){if(!this.keyFilter)return!1;const t=[this.keyFilter];return!!this.keyFilterDissatisfied(e,t)}get params(){const e={},t=new RegExp(`^data-${this.identifier}-(.+)-param$`,"i");for(const{name:n,value:r}of Array.from(this.element.attributes)){const i=n.match(t),a=i&&i[1];a&&(e[s(a)]=y(r))}return e}get eventTargetName(){return(e=this.eventTarget)==window?"window":e==document?"document":void 0;var e}get keyMappings(){return this.schema.keyMappings}keyFilterDissatisfied(e,t){const[n,r,i,a]=f.map(e=>t.includes(e));return e.metaKey!==n||e.ctrlKey!==r||e.altKey!==i||e.shiftKey!==a}}const p={a:()=>"click",button:()=>"click",form:()=>"submit",details:()=>"toggle",input:e=>"submit"==e.getAttribute("type")?"click":"input",select:()=>"change",textarea:()=>"input"};function g(e){throw new Error(e)}function y(e){try{return JSON.parse(e)}catch(t){return e}}class b{constructor(e,t){this.context=e,this.action=t}get index(){return this.action.index}get eventTarget(){return this.action.eventTarget}get eventOptions(){return this.action.eventOptions}get identifier(){return this.context.identifier}handleEvent(e){const t=this.prepareActionEvent(e);this.willBeInvokedByEvent(e)&&this.applyEventModifiers(t)&&this.invokeWithEvent(t)}get eventName(){return this.action.eventName}get method(){const e=this.controller[this.methodName];if("function"==typeof e)return e;throw new Error(`Action "${this.action}" references undefined method "${this.methodName}"`)}applyEventModifiers(e){const{element:t}=this.action,{actionDescriptorFilters:n}=this.context.application,{controller:r}=this.context;let i=!0;for(const[a,o]of Object.entries(this.eventOptions))if(a in n){const s=n[a];i=i&&s({name:a,value:o,event:e,element:t,controller:r})}return i}prepareActionEvent(e){return Object.assign(e,{params:this.action.params})}invokeWithEvent(e){const{target:t,currentTarget:n}=e;try{this.method.call(this.controller,e),this.context.logDebugActivity(this.methodName,{event:e,target:t,currentTarget:n,action:this.methodName})}catch(t){const{identifier:n,controller:r,element:i,index:a}=this,o={identifier:n,controller:r,element:i,index:a,event:e};this.context.handleError(t,`invoking action "${this.action}"`,o)}}willBeInvokedByEvent(e){const t=e.target;return!(e instanceof KeyboardEvent&&this.action.shouldIgnoreKeyboardEvent(e))&&!(e instanceof MouseEvent&&this.action.shouldIgnoreMouseEvent(e))&&(this.element===t||(t instanceof Element&&this.element.contains(t)?this.scope.containsElement(t):this.scope.containsElement(this.action.element)))}get controller(){return this.context.controller}get methodName(){return this.action.methodName}get element(){return this.scope.element}get scope(){return this.context.scope}}class v{constructor(e,t){this.mutationObserverInit={attributes:!0,childList:!0,subtree:!0},this.element=e,this.started=!1,this.delegate=t,this.elements=new Set,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,this.mutationObserverInit),this.refresh())}pause(e){this.started&&(this.mutationObserver.disconnect(),this.started=!1),e(),this.started||(this.mutationObserver.observe(this.element,this.mutationObserverInit),this.started=!0)}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started){const e=new Set(this.matchElementsInTree());for(const t of Array.from(this.elements))e.has(t)||this.removeElement(t);for(const t of Array.from(e))this.addElement(t)}}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){"attributes"==e.type?this.processAttributeChange(e.target,e.attributeName):"childList"==e.type&&(this.processRemovedNodes(e.removedNodes),this.processAddedNodes(e.addedNodes))}processAttributeChange(e,t){this.elements.has(e)?this.delegate.elementAttributeChanged&&this.matchElement(e)?this.delegate.elementAttributeChanged(e,t):this.removeElement(e):this.matchElement(e)&&this.addElement(e)}processRemovedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.processTree(e,this.removeElement)}}processAddedNodes(e){for(const t of Array.from(e)){const e=this.elementFromNode(t);e&&this.elementIsActive(e)&&this.processTree(e,this.addElement)}}matchElement(e){return this.delegate.matchElement(e)}matchElementsInTree(e=this.element){return this.delegate.matchElementsInTree(e)}processTree(e,t){for(const n of this.matchElementsInTree(e))t.call(this,n)}elementFromNode(e){if(e.nodeType==Node.ELEMENT_NODE)return e}elementIsActive(e){return e.isConnected==this.element.isConnected&&this.element.contains(e)}addElement(e){this.elements.has(e)||this.elementIsActive(e)&&(this.elements.add(e),this.delegate.elementMatched&&this.delegate.elementMatched(e))}removeElement(e){this.elements.has(e)&&(this.elements.delete(e),this.delegate.elementUnmatched&&this.delegate.elementUnmatched(e))}}class w{constructor(e,t,n){this.attributeName=t,this.delegate=n,this.elementObserver=new v(e,this)}get element(){return this.elementObserver.element}get selector(){return`[${this.attributeName}]`}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get started(){return this.elementObserver.started}matchElement(e){return e.hasAttribute(this.attributeName)}matchElementsInTree(e){const t=this.matchElement(e)?[e]:[],n=Array.from(e.querySelectorAll(this.selector));return t.concat(n)}elementMatched(e){this.delegate.elementMatchedAttribute&&this.delegate.elementMatchedAttribute(e,this.attributeName)}elementUnmatched(e){this.delegate.elementUnmatchedAttribute&&this.delegate.elementUnmatchedAttribute(e,this.attributeName)}elementAttributeChanged(e,t){this.delegate.elementAttributeValueChanged&&this.attributeName==t&&this.delegate.elementAttributeValueChanged(e,t)}}function k(e,t,n){D(e,t).add(n)}function x(e,t,n){D(e,t).delete(n),M(e,t)}function D(e,t){let n=e.get(t);return n||(n=new Set,e.set(t,n)),n}function M(e,t){const n=e.get(t);null!=n&&0==n.size&&e.delete(t)}class O{constructor(){this.valuesByKey=new Map}get keys(){return Array.from(this.valuesByKey.keys())}get values(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e.concat(Array.from(t)),[])}get size(){return Array.from(this.valuesByKey.values()).reduce((e,t)=>e+t.size,0)}add(e,t){k(this.valuesByKey,e,t)}delete(e,t){x(this.valuesByKey,e,t)}has(e,t){const n=this.valuesByKey.get(e);return null!=n&&n.has(t)}hasKey(e){return this.valuesByKey.has(e)}hasValue(e){return Array.from(this.valuesByKey.values()).some(t=>t.has(e))}getValuesForKey(e){const t=this.valuesByKey.get(e);return t?Array.from(t):[]}getKeysForValue(e){return Array.from(this.valuesByKey).filter(([t,n])=>n.has(e)).map(([e,t])=>e)}}class T extends O{constructor(){super(),this.keysByValue=new Map}get values(){return Array.from(this.keysByValue.keys())}add(e,t){super.add(e,t),k(this.keysByValue,t,e)}delete(e,t){super.delete(e,t),x(this.keysByValue,t,e)}hasValue(e){return this.keysByValue.has(e)}getKeysForValue(e){const t=this.keysByValue.get(e);return t?Array.from(t):[]}}class C{constructor(e,t,n,r){this._selector=t,this.details=r,this.elementObserver=new v(e,this),this.delegate=n,this.matchesByElement=new O}get started(){return this.elementObserver.started}get selector(){return this._selector}set selector(e){this._selector=e,this.refresh()}start(){this.elementObserver.start()}pause(e){this.elementObserver.pause(e)}stop(){this.elementObserver.stop()}refresh(){this.elementObserver.refresh()}get element(){return this.elementObserver.element}matchElement(e){const{selector:t}=this;if(t){const n=e.matches(t);return this.delegate.selectorMatchElement?n&&this.delegate.selectorMatchElement(e,this.details):n}return!1}matchElementsInTree(e){const{selector:t}=this;if(t){const n=this.matchElement(e)?[e]:[],r=Array.from(e.querySelectorAll(t)).filter(e=>this.matchElement(e));return n.concat(r)}return[]}elementMatched(e){const{selector:t}=this;t&&this.selectorMatched(e,t)}elementUnmatched(e){const t=this.matchesByElement.getKeysForValue(e);for(const n of t)this.selectorUnmatched(e,n)}elementAttributeChanged(e,t){const{selector:n}=this;if(n){const t=this.matchElement(e),r=this.matchesByElement.has(n,e);t&&!r?this.selectorMatched(e,n):!t&&r&&this.selectorUnmatched(e,n)}}selectorMatched(e,t){this.delegate.selectorMatched(e,t,this.details),this.matchesByElement.add(t,e)}selectorUnmatched(e,t){this.delegate.selectorUnmatched(e,t,this.details),this.matchesByElement.delete(t,e)}}class E{constructor(e,t){this.element=e,this.delegate=t,this.started=!1,this.stringMap=new Map,this.mutationObserver=new MutationObserver(e=>this.processMutations(e))}start(){this.started||(this.started=!0,this.mutationObserver.observe(this.element,{attributes:!0,attributeOldValue:!0}),this.refresh())}stop(){this.started&&(this.mutationObserver.takeRecords(),this.mutationObserver.disconnect(),this.started=!1)}refresh(){if(this.started)for(const e of this.knownAttributeNames)this.refreshAttribute(e,null)}processMutations(e){if(this.started)for(const t of e)this.processMutation(t)}processMutation(e){const t=e.attributeName;t&&this.refreshAttribute(t,e.oldValue)}refreshAttribute(e,t){const n=this.delegate.getStringMapKeyForAttribute(e);if(null!=n){this.stringMap.has(e)||this.stringMapKeyAdded(n,e);const r=this.element.getAttribute(e);if(this.stringMap.get(e)!=r&&this.stringMapValueChanged(r,n,t),null==r){const t=this.stringMap.get(e);this.stringMap.delete(e),t&&this.stringMapKeyRemoved(n,e,t)}else this.stringMap.set(e,r)}}stringMapKeyAdded(e,t){this.delegate.stringMapKeyAdded&&this.delegate.stringMapKeyAdded(e,t)}stringMapValueChanged(e,t,n){this.delegate.stringMapValueChanged&&this.delegate.stringMapValueChanged(e,t,n)}stringMapKeyRemoved(e,t,n){this.delegate.stringMapKeyRemoved&&this.delegate.stringMapKeyRemoved(e,t,n)}get knownAttributeNames(){return Array.from(new Set(this.currentAttributeNames.concat(this.recordedAttributeNames)))}get currentAttributeNames(){return Array.from(this.element.attributes).map(e=>e.name)}get recordedAttributeNames(){return Array.from(this.stringMap.keys())}}class S{constructor(e,t,n){this.attributeObserver=new w(e,t,this),this.delegate=n,this.tokensByElement=new O}get started(){return this.attributeObserver.started}start(){this.attributeObserver.start()}pause(e){this.attributeObserver.pause(e)}stop(){this.attributeObserver.stop()}refresh(){this.attributeObserver.refresh()}get element(){return this.attributeObserver.element}get attributeName(){return this.attributeObserver.attributeName}elementMatchedAttribute(e){this.tokensMatched(this.readTokensForElement(e))}elementAttributeValueChanged(e){const[t,n]=this.refreshTokensForElement(e);this.tokensUnmatched(t),this.tokensMatched(n)}elementUnmatchedAttribute(e){this.tokensUnmatched(this.tokensByElement.getValuesForKey(e))}tokensMatched(e){e.forEach(e=>this.tokenMatched(e))}tokensUnmatched(e){e.forEach(e=>this.tokenUnmatched(e))}tokenMatched(e){this.delegate.tokenMatched(e),this.tokensByElement.add(e.element,e)}tokenUnmatched(e){this.delegate.tokenUnmatched(e),this.tokensByElement.delete(e.element,e)}refreshTokensForElement(e){const t=this.tokensByElement.getValuesForKey(e),n=this.readTokensForElement(e),r=function(e,t){const n=Math.max(e.length,t.length);return Array.from({length:n},(n,r)=>[e[r],t[r]])}(t,n).findIndex(([e,t])=>{return r=t,!((n=e)&&r&&n.index==r.index&&n.content==r.content);var n,r});return-1==r?[[],[]]:[t.slice(r),n.slice(r)]}readTokensForElement(e){const t=this.attributeName;return function(e,t,n){return e.trim().split(/\s+/).filter(e=>e.length).map((e,r)=>({element:t,attributeName:n,content:e,index:r}))}(e.getAttribute(t)||"",e,t)}}class N{constructor(e,t,n){this.tokenListObserver=new S(e,t,this),this.delegate=n,this.parseResultsByToken=new WeakMap,this.valuesByTokenByElement=new WeakMap}get started(){return this.tokenListObserver.started}start(){this.tokenListObserver.start()}stop(){this.tokenListObserver.stop()}refresh(){this.tokenListObserver.refresh()}get element(){return this.tokenListObserver.element}get attributeName(){return this.tokenListObserver.attributeName}tokenMatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).set(e,n),this.delegate.elementMatchedValue(t,n))}tokenUnmatched(e){const{element:t}=e,{value:n}=this.fetchParseResultForToken(e);n&&(this.fetchValuesByTokenForElement(t).delete(e),this.delegate.elementUnmatchedValue(t,n))}fetchParseResultForToken(e){let t=this.parseResultsByToken.get(e);return t||(t=this.parseToken(e),this.parseResultsByToken.set(e,t)),t}fetchValuesByTokenForElement(e){let t=this.valuesByTokenByElement.get(e);return t||(t=new Map,this.valuesByTokenByElement.set(e,t)),t}parseToken(e){try{return{value:this.delegate.parseValueForToken(e)}}catch(e){return{error:e}}}}class A{constructor(e,t){this.context=e,this.delegate=t,this.bindingsByAction=new Map}start(){this.valueListObserver||(this.valueListObserver=new N(this.element,this.actionAttribute,this),this.valueListObserver.start())}stop(){this.valueListObserver&&(this.valueListObserver.stop(),delete this.valueListObserver,this.disconnectAllActions())}get element(){return this.context.element}get identifier(){return this.context.identifier}get actionAttribute(){return this.schema.actionAttribute}get schema(){return this.context.schema}get bindings(){return Array.from(this.bindingsByAction.values())}connectAction(e){const t=new b(this.context,e);this.bindingsByAction.set(e,t),this.delegate.bindingConnected(t)}disconnectAction(e){const t=this.bindingsByAction.get(e);t&&(this.bindingsByAction.delete(e),this.delegate.bindingDisconnected(t))}disconnectAllActions(){this.bindings.forEach(e=>this.delegate.bindingDisconnected(e,!0)),this.bindingsByAction.clear()}parseValueForToken(e){const t=m.forToken(e,this.schema);if(t.identifier==this.identifier)return t}elementMatchedValue(e,t){this.connectAction(t)}elementUnmatchedValue(e,t){this.disconnectAction(t)}}class I{constructor(e,t){this.context=e,this.receiver=t,this.stringMapObserver=new E(this.element,this),this.valueDescriptorMap=this.controller.valueDescriptorMap}start(){this.stringMapObserver.start(),this.invokeChangedCallbacksForDefaultValues()}stop(){this.stringMapObserver.stop()}get element(){return this.context.element}get controller(){return this.context.controller}getStringMapKeyForAttribute(e){if(e in this.valueDescriptorMap)return this.valueDescriptorMap[e].name}stringMapKeyAdded(e,t){const n=this.valueDescriptorMap[t];this.hasValue(e)||this.invokeChangedCallback(e,n.writer(this.receiver[e]),n.writer(n.defaultValue))}stringMapValueChanged(e,t,n){const r=this.valueDescriptorNameMap[t];null!==e&&(null===n&&(n=r.writer(r.defaultValue)),this.invokeChangedCallback(t,e,n))}stringMapKeyRemoved(e,t,n){const r=this.valueDescriptorNameMap[e];this.hasValue(e)?this.invokeChangedCallback(e,r.writer(this.receiver[e]),n):this.invokeChangedCallback(e,r.writer(r.defaultValue),n)}invokeChangedCallbacksForDefaultValues(){for(const{key:e,name:t,defaultValue:n,writer:r}of this.valueDescriptors)null==n||this.controller.data.has(e)||this.invokeChangedCallback(t,r(n),void 0)}invokeChangedCallback(e,t,n){const r=`${e}Changed`,i=this.receiver[r];if("function"==typeof i){const r=this.valueDescriptorNameMap[e];try{const e=r.reader(t);let a=n;n&&(a=r.reader(n)),i.call(this.receiver,e,a)}catch(e){throw e instanceof TypeError&&(e.message=`Stimulus Value "${this.context.identifier}.${r.name}" - ${e.message}`),e}}}get valueDescriptors(){const{valueDescriptorMap:e}=this;return Object.keys(e).map(t=>e[t])}get valueDescriptorNameMap(){const e={};return Object.keys(this.valueDescriptorMap).forEach(t=>{const n=this.valueDescriptorMap[t];e[n.name]=n}),e}hasValue(e){const t=`has${c(this.valueDescriptorNameMap[e].name)}`;return this.receiver[t]}}class F{constructor(e,t){this.context=e,this.delegate=t,this.targetsByName=new O}start(){this.tokenListObserver||(this.tokenListObserver=new S(this.element,this.attributeName,this),this.tokenListObserver.start())}stop(){this.tokenListObserver&&(this.disconnectAllTargets(),this.tokenListObserver.stop(),delete this.tokenListObserver)}tokenMatched({element:e,content:t}){this.scope.containsElement(e)&&this.connectTarget(e,t)}tokenUnmatched({element:e,content:t}){this.disconnectTarget(e,t)}connectTarget(e,t){var n;this.targetsByName.has(t,e)||(this.targetsByName.add(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause(()=>this.delegate.targetConnected(e,t)))}disconnectTarget(e,t){var n;this.targetsByName.has(t,e)&&(this.targetsByName.delete(t,e),null===(n=this.tokenListObserver)||void 0===n||n.pause(()=>this.delegate.targetDisconnected(e,t)))}disconnectAllTargets(){for(const e of this.targetsByName.keys)for(const t of this.targetsByName.getValuesForKey(e))this.disconnectTarget(t,e)}get attributeName(){return`data-${this.context.identifier}-target`}get element(){return this.context.element}get scope(){return this.context.scope}}function j(e,t){const n=_(e);return Array.from(n.reduce((e,n)=>(function(e,t){const n=e[t];return Array.isArray(n)?n:[]}(n,t).forEach(t=>e.add(t)),e),new Set))}function _(e){const t=[];for(;e;)t.push(e),e=Object.getPrototypeOf(e);return t.reverse()}class L{constructor(e,t){this.started=!1,this.context=e,this.delegate=t,this.outletsByName=new O,this.outletElementsByName=new O,this.selectorObserverMap=new Map,this.attributeObserverMap=new Map}start(){this.started||(this.outletDefinitions.forEach(e=>{this.setupSelectorObserverForOutlet(e),this.setupAttributeObserverForOutlet(e)}),this.started=!0,this.dependentContexts.forEach(e=>e.refresh()))}refresh(){this.selectorObserverMap.forEach(e=>e.refresh()),this.attributeObserverMap.forEach(e=>e.refresh())}stop(){this.started&&(this.started=!1,this.disconnectAllOutlets(),this.stopSelectorObservers(),this.stopAttributeObservers())}stopSelectorObservers(){this.selectorObserverMap.size>0&&(this.selectorObserverMap.forEach(e=>e.stop()),this.selectorObserverMap.clear())}stopAttributeObservers(){this.attributeObserverMap.size>0&&(this.attributeObserverMap.forEach(e=>e.stop()),this.attributeObserverMap.clear())}selectorMatched(e,t,{outletName:n}){const r=this.getOutlet(e,n);r&&this.connectOutlet(r,e,n)}selectorUnmatched(e,t,{outletName:n}){const r=this.getOutletFromMap(e,n);r&&this.disconnectOutlet(r,e,n)}selectorMatchElement(e,{outletName:t}){const n=this.selector(t),r=this.hasOutlet(e,t),i=e.matches(`[${this.schema.controllerAttribute}~=${t}]`);return!!n&&r&&i&&e.matches(n)}elementMatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementAttributeValueChanged(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}elementUnmatchedAttribute(e,t){const n=this.getOutletNameFromOutletAttributeName(t);n&&this.updateSelectorObserverForOutlet(n)}connectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)||(this.outletsByName.add(n,e),this.outletElementsByName.add(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause(()=>this.delegate.outletConnected(e,t,n)))}disconnectOutlet(e,t,n){var r;this.outletElementsByName.has(n,t)&&(this.outletsByName.delete(n,e),this.outletElementsByName.delete(n,t),null===(r=this.selectorObserverMap.get(n))||void 0===r||r.pause(()=>this.delegate.outletDisconnected(e,t,n)))}disconnectAllOutlets(){for(const e of this.outletElementsByName.keys)for(const t of this.outletElementsByName.getValuesForKey(e))for(const n of this.outletsByName.getValuesForKey(e))this.disconnectOutlet(n,t,e)}updateSelectorObserverForOutlet(e){const t=this.selectorObserverMap.get(e);t&&(t.selector=this.selector(e))}setupSelectorObserverForOutlet(e){const t=this.selector(e),n=new C(document.body,t,this,{outletName:e});this.selectorObserverMap.set(e,n),n.start()}setupAttributeObserverForOutlet(e){const t=this.attributeNameForOutletName(e),n=new w(this.scope.element,t,this);this.attributeObserverMap.set(e,n),n.start()}selector(e){return this.scope.outlets.getSelectorForOutletName(e)}attributeNameForOutletName(e){return this.scope.schema.outletAttributeForScope(this.identifier,e)}getOutletNameFromOutletAttributeName(e){return this.outletDefinitions.find(t=>this.attributeNameForOutletName(t)===e)}get outletDependencies(){const e=new O;return this.router.modules.forEach(t=>{j(t.definition.controllerConstructor,"outlets").forEach(n=>e.add(n,t.identifier))}),e}get outletDefinitions(){return this.outletDependencies.getKeysForValue(this.identifier)}get dependentControllerIdentifiers(){return this.outletDependencies.getValuesForKey(this.identifier)}get dependentContexts(){const e=this.dependentControllerIdentifiers;return this.router.contexts.filter(t=>e.includes(t.identifier))}hasOutlet(e,t){return!!this.getOutlet(e,t)||!!this.getOutletFromMap(e,t)}getOutlet(e,t){return this.application.getControllerForElementAndIdentifier(e,t)}getOutletFromMap(e,t){return this.outletsByName.getValuesForKey(t).find(t=>t.element===e)}get scope(){return this.context.scope}get schema(){return this.context.schema}get identifier(){return this.context.identifier}get application(){return this.context.application}get router(){return this.application.router}}class ${constructor(e,t){this.logDebugActivity=(e,t={})=>{const{identifier:n,controller:r,element:i}=this;t=Object.assign({identifier:n,controller:r,element:i},t),this.application.logDebugActivity(this.identifier,e,t)},this.module=e,this.scope=t,this.controller=new e.controllerConstructor(this),this.bindingObserver=new A(this,this.dispatcher),this.valueObserver=new I(this,this.controller),this.targetObserver=new F(this,this),this.outletObserver=new L(this,this);try{this.controller.initialize(),this.logDebugActivity("initialize")}catch(e){this.handleError(e,"initializing controller")}}connect(){this.bindingObserver.start(),this.valueObserver.start(),this.targetObserver.start(),this.outletObserver.start();try{this.controller.connect(),this.logDebugActivity("connect")}catch(e){this.handleError(e,"connecting controller")}}refresh(){this.outletObserver.refresh()}disconnect(){try{this.controller.disconnect(),this.logDebugActivity("disconnect")}catch(e){this.handleError(e,"disconnecting controller")}this.outletObserver.stop(),this.targetObserver.stop(),this.valueObserver.stop(),this.bindingObserver.stop()}get application(){return this.module.application}get identifier(){return this.module.identifier}get schema(){return this.application.schema}get dispatcher(){return this.application.dispatcher}get element(){return this.scope.element}get parentElement(){return this.element.parentElement}handleError(e,t,n={}){const{identifier:r,controller:i,element:a}=this;n=Object.assign({identifier:r,controller:i,element:a},n),this.application.handleError(e,`Error ${t}`,n)}targetConnected(e,t){this.invokeControllerMethod(`${t}TargetConnected`,e)}targetDisconnected(e,t){this.invokeControllerMethod(`${t}TargetDisconnected`,e)}outletConnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletConnected`,e,t)}outletDisconnected(e,t,n){this.invokeControllerMethod(`${l(n)}OutletDisconnected`,e,t)}invokeControllerMethod(e,...t){const n=this.controller;"function"==typeof n[e]&&n[e](...t)}}const V="function"==typeof Object.getOwnPropertySymbols?e=>[...Object.getOwnPropertyNames(e),...Object.getOwnPropertySymbols(e)]:Object.getOwnPropertyNames,P=(()=>{function e(e){function t(){return Reflect.construct(e,arguments,new.target)}return t.prototype=Object.create(e.prototype,{constructor:{value:t}}),Reflect.setPrototypeOf(t,e),t}try{return function(){const t=e(function(){this.a.call(this)});t.prototype.a=function(){},new t}(),e}catch(e){return e=>class extends e{}}})();class R{constructor(e,t){this.application=e,this.definition=function(e){return{identifier:e.identifier,controllerConstructor:(t=e.controllerConstructor,function(e,t){const n=P(e),r=function(e,t){return V(t).reduce((n,r)=>{const i=function(e,t,n){const r=Object.getOwnPropertyDescriptor(e,n);if(!r||!("value"in r)){const e=Object.getOwnPropertyDescriptor(t,n).value;return r&&(e.get=r.get||e.get,e.set=r.set||e.set),e}}(e,t,r);return i&&Object.assign(n,{[r]:i}),n},{})}(e.prototype,t);return Object.defineProperties(n.prototype,r),n}(t,function(e){return j(e,"blessings").reduce((t,n)=>{const r=n(e);for(const e in r){const n=t[e]||{};t[e]=Object.assign(n,r[e])}return t},{})}(t)))};var t}(t),this.contextsByScope=new WeakMap,this.connectedContexts=new Set}get identifier(){return this.definition.identifier}get controllerConstructor(){return this.definition.controllerConstructor}get contexts(){return Array.from(this.connectedContexts)}connectContextForScope(e){const t=this.fetchContextForScope(e);this.connectedContexts.add(t),t.connect()}disconnectContextForScope(e){const t=this.contextsByScope.get(e);t&&(this.connectedContexts.delete(t),t.disconnect())}fetchContextForScope(e){let t=this.contextsByScope.get(e);return t||(t=new $(this,e),this.contextsByScope.set(e,t)),t}}class z{constructor(e){this.scope=e}has(e){return this.data.has(this.getDataKey(e))}get(e){return this.getAll(e)[0]}getAll(e){return(this.data.get(this.getDataKey(e))||"").match(/[^\s]+/g)||[]}getAttributeName(e){return this.data.getAttributeNameForKey(this.getDataKey(e))}getDataKey(e){return`${e}-class`}get data(){return this.scope.data}}class B{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get(e){const t=this.getAttributeNameForKey(e);return this.element.getAttribute(t)}set(e,t){const n=this.getAttributeNameForKey(e);return this.element.setAttribute(n,t),this.get(e)}has(e){const t=this.getAttributeNameForKey(e);return this.element.hasAttribute(t)}delete(e){if(this.has(e)){const t=this.getAttributeNameForKey(e);return this.element.removeAttribute(t),!0}return!1}getAttributeNameForKey(e){return`data-${this.identifier}-${u(e)}`}}class H{constructor(e){this.warnedKeysByObject=new WeakMap,this.logger=e}warn(e,t,n){let r=this.warnedKeysByObject.get(e);r||(r=new Set,this.warnedKeysByObject.set(e,r)),r.has(t)||(r.add(t),this.logger.warn(n,e))}}function Y(e,t){return`[${e}~="${t}"]`}class W{constructor(e){this.scope=e}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findTarget(t)||this.findLegacyTarget(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllTargets(t),...this.findAllLegacyTargets(t)],[])}findTarget(e){const t=this.getSelectorForTargetName(e);return this.scope.findElement(t)}findAllTargets(e){const t=this.getSelectorForTargetName(e);return this.scope.findAllElements(t)}getSelectorForTargetName(e){return Y(this.schema.targetAttributeForScope(this.identifier),e)}findLegacyTarget(e){const t=this.getLegacySelectorForTargetName(e);return this.deprecate(this.scope.findElement(t),e)}findAllLegacyTargets(e){const t=this.getLegacySelectorForTargetName(e);return this.scope.findAllElements(t).map(t=>this.deprecate(t,e))}getLegacySelectorForTargetName(e){const t=`${this.identifier}.${e}`;return Y(this.schema.targetAttribute,t)}deprecate(e,t){if(e){const{identifier:n}=this,r=this.schema.targetAttribute,i=this.schema.targetAttributeForScope(n);this.guide.warn(e,`target:${t}`,`Please replace ${r}="${n}.${t}" with ${i}="${t}". The ${r} attribute is deprecated and will be removed in a future version of Stimulus.`)}return e}get guide(){return this.scope.guide}}class U{constructor(e,t){this.scope=e,this.controllerElement=t}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get schema(){return this.scope.schema}has(e){return null!=this.find(e)}find(...e){return e.reduce((e,t)=>e||this.findOutlet(t),void 0)}findAll(...e){return e.reduce((e,t)=>[...e,...this.findAllOutlets(t)],[])}getSelectorForOutletName(e){const t=this.schema.outletAttributeForScope(this.identifier,e);return this.controllerElement.getAttribute(t)}findOutlet(e){const t=this.getSelectorForOutletName(e);if(t)return this.findElement(t,e)}findAllOutlets(e){const t=this.getSelectorForOutletName(e);return t?this.findAllElements(t,e):[]}findElement(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))[0]}findAllElements(e,t){return this.scope.queryElements(e).filter(n=>this.matchesElement(n,e,t))}matchesElement(e,t,n){const r=e.getAttribute(this.scope.schema.controllerAttribute)||"";return e.matches(t)&&r.split(" ").includes(n)}}class Z{constructor(e,t,n,r){this.targets=new W(this),this.classes=new z(this),this.data=new B(this),this.containsElement=e=>e.closest(this.controllerSelector)===this.element,this.schema=e,this.element=t,this.identifier=n,this.guide=new H(r),this.outlets=new U(this.documentScope,t)}findElement(e){return this.element.matches(e)?this.element:this.queryElements(e).find(this.containsElement)}findAllElements(e){return[...this.element.matches(e)?[this.element]:[],...this.queryElements(e).filter(this.containsElement)]}queryElements(e){return Array.from(this.element.querySelectorAll(e))}get controllerSelector(){return Y(this.schema.controllerAttribute,this.identifier)}get isDocumentScope(){return this.element===document.documentElement}get documentScope(){return this.isDocumentScope?this:new Z(this.schema,document.documentElement,this.identifier,this.guide.logger)}}class q{constructor(e,t,n){this.element=e,this.schema=t,this.delegate=n,this.valueListObserver=new N(this.element,this.controllerAttribute,this),this.scopesByIdentifierByElement=new WeakMap,this.scopeReferenceCounts=new WeakMap}start(){this.valueListObserver.start()}stop(){this.valueListObserver.stop()}get controllerAttribute(){return this.schema.controllerAttribute}parseValueForToken(e){const{element:t,content:n}=e;return this.parseValueForElementAndIdentifier(t,n)}parseValueForElementAndIdentifier(e,t){const n=this.fetchScopesByIdentifierForElement(e);let r=n.get(t);return r||(r=this.delegate.createScopeForElementAndIdentifier(e,t),n.set(t,r)),r}elementMatchedValue(e,t){const n=(this.scopeReferenceCounts.get(t)||0)+1;this.scopeReferenceCounts.set(t,n),1==n&&this.delegate.scopeConnected(t)}elementUnmatchedValue(e,t){const n=this.scopeReferenceCounts.get(t);n&&(this.scopeReferenceCounts.set(t,n-1),1==n&&this.delegate.scopeDisconnected(t))}fetchScopesByIdentifierForElement(e){let t=this.scopesByIdentifierByElement.get(e);return t||(t=new Map,this.scopesByIdentifierByElement.set(e,t)),t}}class K{constructor(e){this.application=e,this.scopeObserver=new q(this.element,this.schema,this),this.scopesByIdentifier=new O,this.modulesByIdentifier=new Map}get element(){return this.application.element}get schema(){return this.application.schema}get logger(){return this.application.logger}get controllerAttribute(){return this.schema.controllerAttribute}get modules(){return Array.from(this.modulesByIdentifier.values())}get contexts(){return this.modules.reduce((e,t)=>e.concat(t.contexts),[])}start(){this.scopeObserver.start()}stop(){this.scopeObserver.stop()}loadDefinition(e){this.unloadIdentifier(e.identifier);const t=new R(this.application,e);this.connectModule(t);const n=e.controllerConstructor.afterLoad;n&&n.call(e.controllerConstructor,e.identifier,this.application)}unloadIdentifier(e){const t=this.modulesByIdentifier.get(e);t&&this.disconnectModule(t)}getContextForElementAndIdentifier(e,t){const n=this.modulesByIdentifier.get(t);if(n)return n.contexts.find(t=>t.element==e)}proposeToConnectScopeForElementAndIdentifier(e,t){const n=this.scopeObserver.parseValueForElementAndIdentifier(e,t);n?this.scopeObserver.elementMatchedValue(n.element,n):console.error(`Couldn't find or create scope for identifier: "${t}" and element:`,e)}handleError(e,t,n){this.application.handleError(e,t,n)}createScopeForElementAndIdentifier(e,t){return new Z(this.schema,e,t,this.logger)}scopeConnected(e){this.scopesByIdentifier.add(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.connectContextForScope(e)}scopeDisconnected(e){this.scopesByIdentifier.delete(e.identifier,e);const t=this.modulesByIdentifier.get(e.identifier);t&&t.disconnectContextForScope(e)}connectModule(e){this.modulesByIdentifier.set(e.identifier,e),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.connectContextForScope(t))}disconnectModule(e){this.modulesByIdentifier.delete(e.identifier),this.scopesByIdentifier.getValuesForKey(e.identifier).forEach(t=>e.disconnectContextForScope(t))}}const J={controllerAttribute:"data-controller",actionAttribute:"data-action",targetAttribute:"data-target",targetAttributeForScope:e=>`data-${e}-target`,outletAttributeForScope:(e,t)=>`data-${e}-${t}-outlet`,keyMappings:Object.assign(Object.assign({enter:"Enter",tab:"Tab",esc:"Escape",space:" ",up:"ArrowUp",down:"ArrowDown",left:"ArrowLeft",right:"ArrowRight",home:"Home",end:"End",page_up:"PageUp",page_down:"PageDown"},G("abcdefghijklmnopqrstuvwxyz".split("").map(e=>[e,e]))),G("0123456789".split("").map(e=>[e,e])))};function G(e){return e.reduce((e,[t,n])=>Object.assign(Object.assign({},e),{[t]:n}),{})}class Q{constructor(e=document.documentElement,t=J){this.logger=console,this.debug=!1,this.logDebugActivity=(e,t,n={})=>{this.debug&&this.logFormattedMessage(e,t,n)},this.element=e,this.schema=t,this.dispatcher=new i(this),this.router=new K(this),this.actionDescriptorFilters=Object.assign({},a)}static start(e,t){const n=new this(e,t);return n.start(),n}async start(){await new Promise(e=>{"loading"==document.readyState?document.addEventListener("DOMContentLoaded",()=>e()):e()}),this.logDebugActivity("application","starting"),this.dispatcher.start(),this.router.start(),this.logDebugActivity("application","start")}stop(){this.logDebugActivity("application","stopping"),this.dispatcher.stop(),this.router.stop(),this.logDebugActivity("application","stop")}register(e,t){this.load({identifier:e,controllerConstructor:t})}registerActionOption(e,t){this.actionDescriptorFilters[e]=t}load(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>{e.controllerConstructor.shouldLoad&&this.router.loadDefinition(e)})}unload(e,...t){(Array.isArray(e)?e:[e,...t]).forEach(e=>this.router.unloadIdentifier(e))}get controllers(){return this.router.contexts.map(e=>e.controller)}getControllerForElementAndIdentifier(e,t){const n=this.router.getContextForElementAndIdentifier(e,t);return n?n.controller:null}handleError(e,t,n){var r;this.logger.error("%s\n\n%o\n\n%o",t,e,n),null===(r=window.onerror)||void 0===r||r.call(window,t,"",0,0,e)}logFormattedMessage(e,t,n={}){n=Object.assign({application:this},n),this.logger.groupCollapsed(`${e} #${t}`),this.logger.log("details:",Object.assign({},n)),this.logger.groupEnd()}}function X(e,t,n){return e.application.getControllerForElementAndIdentifier(t,n)}function ee(e,t,n){let r=X(e,t,n);return r||(e.application.router.proposeToConnectScopeForElementAndIdentifier(t,n),r=X(e,t,n),r||void 0)}function te([e,t],n){return function(e){const{token:t,typeDefinition:n}=e,r=`${u(t)}-value`,i=function(e){const{controller:t,token:n,typeDefinition:r}=e,i=function(e){const{controller:t,token:n,typeObject:r}=e,i=d(r.type),a=d(r.default),o=i&&a,s=i&&!a,l=!i&&a,c=ne(r.type),u=re(e.typeObject.default);if(s)return c;if(l)return u;if(c!==u)throw new Error(`The specified default value for the Stimulus Value "${t?`${t}.${n}`:n}" must match the defined type "${c}". The provided default value of "${r.default}" is of type "${u}".`);return o?c:void 0}({controller:t,token:n,typeObject:r}),a=re(r),o=ne(r),s=i||a||o;if(s)return s;throw new Error(`Unknown value type "${t?`${t}.${r}`:n}" for "${n}" value`)}(e);return{type:i,key:r,name:s(r),get defaultValue(){return function(e){const t=ne(e);if(t)return ie[t];const n=h(e,"default"),r=h(e,"type"),i=e;if(n)return i.default;if(r){const{type:e}=i,t=ne(e);if(t)return ie[t]}return e}(n)},get hasCustomDefaultValue(){return void 0!==re(n)},reader:ae[i],writer:oe[i]||oe.default}}({controller:n,token:e,typeDefinition:t})}function ne(e){switch(e){case Array:return"array";case Boolean:return"boolean";case Number:return"number";case Object:return"object";case String:return"string"}}function re(e){switch(typeof e){case"boolean":return"boolean";case"number":return"number";case"string":return"string"}return Array.isArray(e)?"array":"[object Object]"===Object.prototype.toString.call(e)?"object":void 0}const ie={get array(){return[]},boolean:!1,number:0,get object(){return{}},string:""},ae={array(e){const t=JSON.parse(e);if(!Array.isArray(t))throw new TypeError(`expected value of type "array" but instead got value "${e}" of type "${re(t)}"`);return t},boolean:e=>!("0"==e||"false"==String(e).toLowerCase()),number:e=>Number(e.replace(/_/g,"")),object(e){const t=JSON.parse(e);if(null===t||"object"!=typeof t||Array.isArray(t))throw new TypeError(`expected value of type "object" but instead got value "${e}" of type "${re(t)}"`);return t},string:e=>e},oe={default:function(e){return`${e}`},array:se,object:se};function se(e){return JSON.stringify(e)}class le{constructor(e){this.context=e}static get shouldLoad(){return!0}static afterLoad(e,t){}get application(){return this.context.application}get scope(){return this.context.scope}get element(){return this.scope.element}get identifier(){return this.scope.identifier}get targets(){return this.scope.targets}get outlets(){return this.scope.outlets}get classes(){return this.scope.classes}get data(){return this.scope.data}initialize(){}connect(){}disconnect(){}dispatch(e,{target:t=this.element,detail:n={},prefix:r=this.identifier,bubbles:i=!0,cancelable:a=!0}={}){const o=new CustomEvent(r?`${r}:${e}`:e,{detail:n,bubbles:i,cancelable:a});return t.dispatchEvent(o),o}}le.blessings=[function(e){return j(e,"classes").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Class`]:{get(){const{classes:e}=this;if(e.has(n))return e.get(n);{const t=e.getAttributeName(n);throw new Error(`Missing attribute "${t}"`)}}},[`${n}Classes`]:{get(){return this.classes.getAll(n)}},[`has${c(n)}Class`]:{get(){return this.classes.has(n)}}}));var n},{})},function(e){return j(e,"targets").reduce((e,t)=>{return Object.assign(e,(n=t,{[`${n}Target`]:{get(){const e=this.targets.find(n);if(e)return e;throw new Error(`Missing target element "${n}" for "${this.identifier}" controller`)}},[`${n}Targets`]:{get(){return this.targets.findAll(n)}},[`has${c(n)}Target`]:{get(){return this.targets.has(n)}}}));var n},{})},function(e){const t=function(e,t){return _(e).reduce((e,n)=>(e.push(...function(e,t){const n=e[t];return n?Object.keys(n).map(e=>[e,n[e]]):[]}(n,t)),e),[])}(e,"values"),n={valueDescriptorMap:{get(){return t.reduce((e,t)=>{const n=te(t,this.identifier),r=this.data.getAttributeNameForKey(n.key);return Object.assign(e,{[r]:n})},{})}}};return t.reduce((e,t)=>Object.assign(e,function(e){const t=te(e,void 0),{key:n,name:r,reader:i,writer:a}=t;return{[r]:{get(){const e=this.data.get(n);return null!==e?i(e):t.defaultValue},set(e){void 0===e?this.data.delete(n):this.data.set(n,a(e))}},[`has${c(r)}`]:{get(){return this.data.has(n)||t.hasCustomDefaultValue}}}}(t)),n)},function(e){return j(e,"outlets").reduce((e,t)=>Object.assign(e,function(e){const t=l(e);return{[`${t}Outlet`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t){const n=ee(this,t,e);if(n)return n;throw new Error(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`)}throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}Outlets`]:{get(){const t=this.outlets.findAll(e);return t.length>0?t.map(t=>{const n=ee(this,t,e);if(n)return n;console.warn(`The provided outlet element is missing an outlet controller "${e}" instance for host controller "${this.identifier}"`,t)}).filter(e=>e):[]}},[`${t}OutletElement`]:{get(){const t=this.outlets.find(e),n=this.outlets.getSelectorForOutletName(e);if(t)return t;throw new Error(`Missing outlet element "${e}" for host controller "${this.identifier}". Stimulus couldn't find a matching outlet element using selector "${n}".`)}},[`${t}OutletElements`]:{get(){return this.outlets.findAll(e)}},[`has${c(t)}Outlet`]:{get(){return this.outlets.has(e)}}}}(t)),{})}],le.targets=[],le.outlets=[],le.values={}},990(){"function"!=typeof Object.assign&&(Object.assign=function(e){for(var t=[],n=1;n{var t=e&&e.__esModule?()=>e.default:()=>e;return n.d(t,{a:t}),t},n.d=(e,t)=>{for(var r in t)n.o(t,r)&&!n.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},n.o=(e,t)=>Object.prototype.hasOwnProperty.call(e,t),n.r=e=>{"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.nc=void 0,n(467)})(); \ No newline at end of file diff --git a/config/locales/de.yml b/config/locales/de.yml index d516d56..675e4fd 100644 --- a/config/locales/de.yml +++ b/config/locales/de.yml @@ -73,6 +73,10 @@ de: timer: start: Start continue_last_session: Anschliessend Starten + share: Teilen + share_copied: Link in die Zwischenablage kopiert + share_prefilled: Session wurde von einem geteilten Link vorausgefüllt + share_ignored: Ein Timer läuft bereits. Die geteilten Parameter wurden ignoriert. stop: Stop cancel: Abbrechen date_placeholder: 'dd.mm.yyyy hh:mm' diff --git a/config/locales/en.yml b/config/locales/en.yml index 4a8b4d6..f8c063d 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -77,6 +77,10 @@ en: timer: start: Start continue_last_session: Start on end of last session + share: Share + share_copied: Link copied to clipboard + share_prefilled: Session was prefilled from a shared link + share_ignored: A timer is already running. Shared session parameters were ignored. stop: Stop cancel: Cancel date_placeholder: 'dd.mm.yyyy hh:mm' diff --git a/test/system/timer_management_test.rb b/test/system/timer_management_test.rb index c1be09d..7fc1200 100644 --- a/test/system/timer_management_test.rb +++ b/test/system/timer_management_test.rb @@ -119,6 +119,71 @@ class TimerManagementTest < ApplicationSystemTestCase assert_no_text Issue.second.subject end + test 'loading timer with comments from url' do + visit timer_sessions_path(comments: 'Meeting with team') + + assert_equal 'Meeting with team', find('#timer_session_comments').value + end + + test 'loading timer with timer_start from url' do + visit timer_sessions_path(timer_start: '01.01.2026 09:00') + + assert_equal '01.01.2026 09:00', find('#timer_session_timer_start').value + end + + test 'loading timer with timer_end from url' do + visit timer_sessions_path(timer_end: '01.01.2026 17:00') + + assert_equal '01.01.2026 17:00', find('#timer_session_timer_end').value + end + + test 'loading timer with all query params from url' do + visit timer_sessions_path( + issue_ids: [Issue.first.id], + comments: 'Sprint planning', + timer_start: '01.01.2026 09:00', + timer_end: '01.01.2026 10:00' + ) + + assert_text I18n.t('timer_sessions.timer.share_prefilled') + assert_text Issue.first.subject + assert_equal 'Sprint planning', find('#timer_session_comments').value + assert_equal '01.01.2026 09:00', find('#timer_session_timer_start').value + assert_equal '01.01.2026 10:00', find('#timer_session_timer_end').value + end + + test 'share button is visible and clickable' do + visit timer_sessions_path + + fill_in 'timer_session_comments', with: 'Pairing session' + + find('[data-name="timer-share"]', wait: 5).click + assert_text I18n.t('timer_sessions.timer.share_copied') + end + + test 'share button not visible when timer is active' do + FactoryBot.create(:timer_session, finished: false, user: User.current) + visit timer_sessions_path + + assert has_content?(I18n.t('timer_sessions.timer.stop')) + assert_no_selector('[data-name="timer-share"]') + end + + test 'shows only ignored notice when active session exists and url has params' do + FactoryBot.create(:timer_session, finished: false, user: User.current) + visit timer_sessions_path(comments: 'Meeting', issue_ids: [Issue.first.id]) + + assert_text I18n.t('timer_sessions.timer.share_ignored') + assert_no_text I18n.t('timer_sessions.timer.share_prefilled') + end + + test 'shows only prefilled notice when no active session and url has params' do + visit timer_sessions_path(comments: 'Sprint planning', timer_start: '01.01.2026 09:00') + + assert_text I18n.t('timer_sessions.timer.share_prefilled') + assert_no_text I18n.t('timer_sessions.timer.share_ignored') + end + test 'preserves filter parameters when stopping a timer' do filter_date = 1.week.ago.strftime('%Y-%m-%d') current_date = Date.today.strftime('%Y-%m-%d')