From 8ffc67205afe6d7764abe85f57ac53e5aa8c8ead Mon Sep 17 00:00:00 2001 From: Oliver Harris Date: Mon, 23 Oct 2023 21:43:24 +0100 Subject: [PATCH] Updates --- assets/{index-37ab3cee.js => index-dacb2b8d.js} | 2 +- index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{index-37ab3cee.js => index-dacb2b8d.js} (99%) diff --git a/assets/index-37ab3cee.js b/assets/index-dacb2b8d.js similarity index 99% rename from assets/index-37ab3cee.js rename to assets/index-dacb2b8d.js index 18afc19..3bc765d 100644 --- a/assets/index-37ab3cee.js +++ b/assets/index-dacb2b8d.js @@ -56,7 +56,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho `+f.join("")+` `}}function K(){t.calendarContainer.classList.add("hasWeeks");var s=ue("div","flatpickr-weekwrapper");s.appendChild(ue("span","flatpickr-weekday",t.l10n.weekAbbreviation));var f=ue("div","flatpickr-weeks");return s.appendChild(f),{weekWrapper:s,weekNumbers:f}}function C(s,f){f===void 0&&(f=!0);var w=f?s:s-t.currentMonth;w<0&&t._hidePrevMonthArrow===!0||w>0&&t._hideNextMonthArrow===!0||(t.currentMonth+=w,(t.currentMonth<0||t.currentMonth>11)&&(t.currentYear+=t.currentMonth>11?1:-1,t.currentMonth=(t.currentMonth+12)%12,ne("onYearChange"),me()),Re(),ne("onMonthChange"),En())}function D(s,f){if(s===void 0&&(s=!0),f===void 0&&(f=!0),t.input.value="",t.altInput!==void 0&&(t.altInput.value=""),t.mobileInput!==void 0&&(t.mobileInput.value=""),t.selectedDates=[],t.latestSelectedDateObj=void 0,f===!0&&(t.currentYear=t._initialDate.getFullYear(),t.currentMonth=t._initialDate.getMonth()),t.config.enableTime===!0){var w=ga(t.config),k=w.hours,I=w.minutes,F=w.seconds;x(k,I,F)}t.redraw(),s&&ne("onChange")}function P(){t.isOpen=!1,t.isMobile||(t.calendarContainer!==void 0&&t.calendarContainer.classList.remove("open"),t._input!==void 0&&t._input.classList.remove("active")),ne("onClose")}function _(){t.config!==void 0&&ne("onDestroy");for(var s=t._handlers.length;s--;)t._handlers[s].remove();if(t._handlers=[],t.mobileInput)t.mobileInput.parentNode&&t.mobileInput.parentNode.removeChild(t.mobileInput),t.mobileInput=void 0;else if(t.calendarContainer&&t.calendarContainer.parentNode)if(t.config.static&&t.calendarContainer.parentNode){var f=t.calendarContainer.parentNode;if(f.lastChild&&f.removeChild(f.lastChild),f.parentNode){for(;f.firstChild;)f.parentNode.insertBefore(f.firstChild,f);f.parentNode.removeChild(f)}}else t.calendarContainer.parentNode.removeChild(t.calendarContainer);t.altInput&&(t.input.type="text",t.altInput.parentNode&&t.altInput.parentNode.removeChild(t.altInput),delete t.altInput),t.input&&(t.input.type=t.input._type,t.input.classList.remove("flatpickr-input"),t.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(w){try{delete t[w]}catch{}})}function $(s){return t.calendarContainer.contains(s)}function Q(s){if(t.isOpen&&!t.config.inline){var f=Ct(s),w=$(f),k=f===t.input||f===t.altInput||t.element.contains(f)||s.path&&s.path.indexOf&&(~s.path.indexOf(t.input)||~s.path.indexOf(t.altInput)),I=!k&&!w&&!$(s.relatedTarget),F=!t.config.ignoredFocusElements.some(function(X){return X.contains(f)});I&&F&&(t.config.allowInput&&t.setDate(t._input.value,!1,t.config.altInput?t.config.altFormat:t.config.dateFormat),t.timeContainer!==void 0&&t.minuteElement!==void 0&&t.hourElement!==void 0&&t.input.value!==""&&t.input.value!==void 0&&u(),t.close(),t.config&&t.config.mode==="range"&&t.selectedDates.length===1&&t.clear(!1))}}function we(s){if(!(!s||t.config.minDate&&st.config.maxDate.getFullYear())){var f=s,w=t.currentYear!==f;t.currentYear=f||t.currentYear,t.config.maxDate&&t.currentYear===t.config.maxDate.getFullYear()?t.currentMonth=Math.min(t.config.maxDate.getMonth(),t.currentMonth):t.config.minDate&&t.currentYear===t.config.minDate.getFullYear()&&(t.currentMonth=Math.max(t.config.minDate.getMonth(),t.currentMonth)),w&&(t.redraw(),ne("onYearChange"),me())}}function pe(s,f){var w;f===void 0&&(f=!0);var k=t.parseDate(s,void 0,f);if(t.config.minDate&&k&&kt(k,t.config.minDate,f!==void 0?f:!t.minDateHasTime)<0||t.config.maxDate&&k&&kt(k,t.config.maxDate,f!==void 0?f:!t.maxDateHasTime)>0)return!1;if(!t.config.enable&&t.config.disable.length===0)return!0;if(k===void 0)return!1;for(var I=!!t.config.enable,F=(w=t.config.enable)!==null&&w!==void 0?w:t.config.disable,X=0,U=void 0;X=U.from.getTime()&&k.getTime()<=U.to.getTime())return I}return!I}function Ge(s){return t.daysContainer!==void 0?s.className.indexOf("hidden")===-1&&s.className.indexOf("flatpickr-disabled")===-1&&t.daysContainer.contains(s):!1}function wt(s){var f=s.target===t._input,w=t._input.value.trimEnd()!==$r();f&&w&&!(s.relatedTarget&&$(s.relatedTarget))&&t.setDate(t._input.value,!0,s.target===t.altInput?t.config.altFormat:t.config.dateFormat)}function He(s){var f=Ct(s),w=t.config.wrap?e.contains(f):f===t._input,k=t.config.allowInput,I=t.isOpen&&(!k||!w),F=t.config.inline&&w&&!k;if(s.keyCode===13&&w){if(k)return t.setDate(t._input.value,!0,f===t.altInput?t.config.altFormat:t.config.dateFormat),t.close(),f.blur();t.open()}else if($(f)||I||F){var X=!!t.timeContainer&&t.timeContainer.contains(f);switch(s.keyCode){case 13:X?(s.preventDefault(),u(),St()):Pe(s);break;case 27:s.preventDefault(),St();break;case 8:case 46:w&&!t.config.allowInput&&(s.preventDefault(),t.clear());break;case 37:case 39:if(!X&&!w){s.preventDefault();var U=o();if(t.daysContainer!==void 0&&(k===!1||U&&Ge(U))){var J=s.keyCode===39?1:-1;s.ctrlKey?(s.stopPropagation(),C(J),W(j(1),0)):W(void 0,J)}}else t.hourElement&&t.hourElement.focus();break;case 38:case 40:s.preventDefault();var b=s.keyCode===40?1:-1;t.daysContainer&&f.$i!==void 0||f===t.input||f===t.altInput?s.ctrlKey?(s.stopPropagation(),we(t.currentYear-b),W(j(1),0)):X||W(void 0,b*7):f===t.currentYearElement?we(t.currentYear-b):t.config.enableTime&&(!X&&t.hourElement&&t.hourElement.focus(),u(s),t._debouncedChange());break;case 9:if(X){var G=[t.hourElement,t.minuteElement,t.secondElement,t.amPM].concat(t.pluginElements).filter(function(Et){return Et}),de=G.indexOf(f);if(de!==-1){var Xt=G[de+(s.shiftKey?-1:1)];s.preventDefault(),(Xt||t._input).focus()}}else!t.config.noCalendar&&t.daysContainer&&t.daysContainer.contains(f)&&s.shiftKey&&(s.preventDefault(),t._input.focus());break}}if(t.amPM!==void 0&&f===t.amPM)switch(s.key){case t.l10n.amPM[0].charAt(0):case t.l10n.amPM[0].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[0],h(),un();break;case t.l10n.amPM[1].charAt(0):case t.l10n.amPM[1].charAt(0).toLowerCase():t.amPM.textContent=t.l10n.amPM[1],h(),un();break}(w||$(f))&&ne("onKeyDown",s)}function Pt(s,f){if(f===void 0&&(f="flatpickr-day"),!(t.selectedDates.length!==1||s&&(!s.classList.contains(f)||s.classList.contains("flatpickr-disabled")))){for(var w=s?s.dateObj.getTime():t.days.firstElementChild.dateObj.getTime(),k=t.parseDate(t.selectedDates[0],void 0,!0).getTime(),I=Math.min(w,t.selectedDates[0].getTime()),F=Math.max(w,t.selectedDates[0].getTime()),X=!1,U=0,J=0,b=I;bI&&bU)?U=b:b>k&&(!J||b ."+f));G.forEach(function(de){var Xt=de.dateObj,Et=Xt.getTime(),Wr=U>0&&Et0&&Et>J;if(Wr){de.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(ur){de.classList.remove(ur)});return}else if(X&&!Wr)return;["startRange","inRange","endRange","notAllowed"].forEach(function(ur){de.classList.remove(ur)}),s!==void 0&&(s.classList.add(w<=t.selectedDates[0].getTime()?"startRange":"endRange"),kw&&Et===k&&de.classList.add("endRange"),Et>=U&&(J===0||Et<=J)&&s1(Et,k,w)&&de.classList.add("inRange"))})}}function B(){t.isOpen&&!t.config.static&&!t.config.inline&&V()}function ie(s,f){if(f===void 0&&(f=t._positionElement),t.isMobile===!0){if(s){s.preventDefault();var w=Ct(s);w&&w.blur()}t.mobileInput!==void 0&&(t.mobileInput.focus(),t.mobileInput.click()),ne("onOpen");return}else if(t._input.disabled||t.config.inline)return;var k=t.isOpen;t.isOpen=!0,k||(t.calendarContainer.classList.add("open"),t._input.classList.add("active"),ne("onOpen"),V(f)),t.config.enableTime===!0&&t.config.noCalendar===!0&&t.config.allowInput===!1&&(s===void 0||!t.timeContainer.contains(s.relatedTarget))&&setTimeout(function(){return t.hourElement.select()},50)}function Z(s){return function(f){var w=t.config["_"+s+"Date"]=t.parseDate(f,t.config.dateFormat),k=t.config["_"+(s==="min"?"max":"min")+"Date"];w!==void 0&&(t[s==="min"?"minDateHasTime":"maxDateHasTime"]=w.getHours()>0||w.getMinutes()>0||w.getSeconds()>0),t.selectedDates&&(t.selectedDates=t.selectedDates.filter(function(I){return pe(I)}),!t.selectedDates.length&&s==="min"&&S(w),un()),t.daysContainer&&(Ke(),w!==void 0?t.currentYearElement[s]=w.getFullYear().toString():t.currentYearElement.removeAttribute(s),t.currentYearElement.disabled=!!k&&w!==void 0&&k.getFullYear()===w.getFullYear())}}function oe(){var s=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],f=Ze(Ze({},JSON.parse(JSON.stringify(e.dataset||{}))),n),w={};t.config.parseDate=f.parseDate,t.config.formatDate=f.formatDate,Object.defineProperty(t.config,"enable",{get:function(){return t.config._enable},set:function(G){t.config._enable=ct(G)}}),Object.defineProperty(t.config,"disable",{get:function(){return t.config._disable},set:function(G){t.config._disable=ct(G)}});var k=f.mode==="time";if(!f.dateFormat&&(f.enableTime||k)){var I=_e.defaultConfig.dateFormat||Nr.dateFormat;w.dateFormat=f.noCalendar||k?"H:i"+(f.enableSeconds?":S":""):I+" H:i"+(f.enableSeconds?":S":"")}if(f.altInput&&(f.enableTime||k)&&!f.altFormat){var F=_e.defaultConfig.altFormat||Nr.altFormat;w.altFormat=f.noCalendar||k?"h:i"+(f.enableSeconds?":S K":" K"):F+(" h:i"+(f.enableSeconds?":S":"")+" K")}Object.defineProperty(t.config,"minDate",{get:function(){return t.config._minDate},set:Z("min")}),Object.defineProperty(t.config,"maxDate",{get:function(){return t.config._maxDate},set:Z("max")});var X=function(G){return function(de){t.config[G==="min"?"_minTime":"_maxTime"]=t.parseDate(de,"H:i:S")}};Object.defineProperty(t.config,"minTime",{get:function(){return t.config._minTime},set:X("min")}),Object.defineProperty(t.config,"maxTime",{get:function(){return t.config._maxTime},set:X("max")}),f.mode==="time"&&(t.config.noCalendar=!0,t.config.enableTime=!0),Object.assign(t.config,w,f);for(var U=0;U-1?t.config[b]=pa(J[b]).map(l).concat(t.config[b]):typeof f[b]>"u"&&(t.config[b]=J[b])}f.altInputClass||(t.config.altInputClass=se().className+" "+t.config.altInputClass),ne("onParseConfig")}function se(){return t.config.wrap?e.querySelector("[data-input]"):e}function nt(){typeof t.config.locale!="object"&&typeof _e.l10ns[t.config.locale]>"u"&&t.config.errorHandler(new Error("flatpickr: invalid locale "+t.config.locale)),t.l10n=Ze(Ze({},_e.l10ns.default),typeof t.config.locale=="object"?t.config.locale:t.config.locale!=="default"?_e.l10ns[t.config.locale]:void 0),Qn.D="("+t.l10n.weekdays.shorthand.join("|")+")",Qn.l="("+t.l10n.weekdays.longhand.join("|")+")",Qn.M="("+t.l10n.months.shorthand.join("|")+")",Qn.F="("+t.l10n.months.longhand.join("|")+")",Qn.K="("+t.l10n.amPM[0]+"|"+t.l10n.amPM[1]+"|"+t.l10n.amPM[0].toLowerCase()+"|"+t.l10n.amPM[1].toLowerCase()+")";var s=Ze(Ze({},n),JSON.parse(JSON.stringify(e.dataset||{})));s.time_24hr===void 0&&_e.defaultConfig.time_24hr===void 0&&(t.config.time_24hr=t.l10n.time_24hr),t.formatDate=Dh(t),t.parseDate=vu({config:t.config,l10n:t.l10n})}function V(s){if(typeof t.config.position=="function")return void t.config.position(t,s);if(t.calendarContainer!==void 0){ne("onPreCalendarPosition");var f=s||t._positionElement,w=Array.prototype.reduce.call(t.calendarContainer.children,function(jh,Fh){return jh+Fh.offsetHeight},0),k=t.calendarContainer.offsetWidth,I=t.config.position.split(" "),F=I[0],X=I.length>1?I[1]:null,U=f.getBoundingClientRect(),J=window.innerHeight-U.bottom,b=F==="above"||F!=="below"&&Jw,G=window.pageYOffset+U.top+(b?-w-2:f.offsetHeight+2);if(rt(t.calendarContainer,"arrowTop",!b),rt(t.calendarContainer,"arrowBottom",b),!t.config.inline){var de=window.pageXOffset+U.left,Xt=!1,Et=!1;X==="center"?(de-=(k-U.width)/2,Xt=!0):X==="right"&&(de-=k-U.width,Et=!0),rt(t.calendarContainer,"arrowLeft",!Xt&&!Et),rt(t.calendarContainer,"arrowCenter",Xt),rt(t.calendarContainer,"arrowRight",Et);var Wr=window.document.body.offsetWidth-(window.pageXOffset+U.right),ur=de+k>window.document.body.offsetWidth,Nh=Wr+k>window.document.body.offsetWidth;if(rt(t.calendarContainer,"rightMost",ur),!t.config.static)if(t.calendarContainer.style.top=G+"px",!ur)t.calendarContainer.style.left=de+"px",t.calendarContainer.style.right="auto";else if(!Nh)t.calendarContainer.style.left="auto",t.calendarContainer.style.right=Wr+"px";else{var Ml=q();if(Ml===void 0)return;var Ph=window.document.body.offsetWidth,Mh=Math.max(0,Ph/2-k/2),Ah=".flatpickr-calendar.centerMost:before",Rh=".flatpickr-calendar.centerMost:after",Ih=Ml.cssRules.length,Lh="{left:"+U.left+"px;right:auto;}";rt(t.calendarContainer,"rightMost",!1),rt(t.calendarContainer,"centerMost",!0),Ml.insertRule(Ah+","+Rh+Lh,Ih),t.calendarContainer.style.left=Mh+"px",t.calendarContainer.style.right="auto"}}}}function q(){for(var s=null,f=0;ft.currentMonth+t.config.showMonths-1)&&t.config.mode!=="range";if(t.selectedDateElem=k,t.config.mode==="single")t.selectedDates=[I];else if(t.config.mode==="multiple"){var X=Xe(I);X?t.selectedDates.splice(parseInt(X),1):t.selectedDates.push(I)}else t.config.mode==="range"&&(t.selectedDates.length===2&&t.clear(!1,!1),t.latestSelectedDateObj=I,t.selectedDates.push(I),kt(I,t.selectedDates[0],!0)!==0&&t.selectedDates.sort(function(G,de){return G.getTime()-de.getTime()}));if(h(),F){var U=t.currentYear!==I.getFullYear();t.currentYear=I.getFullYear(),t.currentMonth=I.getMonth(),U&&(ne("onYearChange"),me()),ne("onMonthChange")}if(En(),Re(),un(),!F&&t.config.mode!=="range"&&t.config.showMonths===1?N(k):t.selectedDateElem!==void 0&&t.hourElement===void 0&&t.selectedDateElem&&t.selectedDateElem.focus(),t.hourElement!==void 0&&t.hourElement!==void 0&&t.hourElement.focus(),t.config.closeOnSelect){var J=t.config.mode==="single"&&!t.config.enableTime,b=t.config.mode==="range"&&t.selectedDates.length===2&&!t.config.enableTime;(J||b)&&St()}z()}}var Qe={locale:[nt,Y],showMonths:[Ie,a,L],minDate:[p],maxDate:[p],positionElement:[Ue],clickOpens:[function(){t.config.clickOpens===!0?(g(t._input,"focus",t.open),g(t._input,"click",t.open)):(t._input.removeEventListener("focus",t.open),t._input.removeEventListener("click",t.open))}]};function an(s,f){if(s!==null&&typeof s=="object"){Object.assign(t.config,s);for(var w in s)Qe[w]!==void 0&&Qe[w].forEach(function(k){return k()})}else t.config[s]=f,Qe[s]!==void 0?Qe[s].forEach(function(k){return k()}):da.indexOf(s)>-1&&(t.config[s]=pa(f));t.redraw(),un(!0)}function ge(s,f){var w=[];if(s instanceof Array)w=s.map(function(k){return t.parseDate(k,f)});else if(s instanceof Date||typeof s=="number")w=[t.parseDate(s,f)];else if(typeof s=="string")switch(t.config.mode){case"single":case"time":w=[t.parseDate(s,f)];break;case"multiple":w=s.split(t.config.conjunction).map(function(k){return t.parseDate(k,f)});break;case"range":w=s.split(t.l10n.rangeSeparator).map(function(k){return t.parseDate(k,f)});break}else t.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(s)));t.selectedDates=t.config.allowInvalidPreload?w:w.filter(function(k){return k instanceof Date&&pe(k,!1)}),t.config.mode==="range"&&t.selectedDates.sort(function(k,I){return k.getTime()-I.getTime()})}function Mt(s,f,w){if(f===void 0&&(f=!1),w===void 0&&(w=t.config.dateFormat),s!==0&&!s||s instanceof Array&&s.length===0)return t.clear(f);ge(s,w),t.latestSelectedDateObj=t.selectedDates[t.selectedDates.length-1],t.redraw(),p(void 0,f),S(),t.selectedDates.length===0&&t.clear(!1),un(f),f&&ne("onChange")}function ct(s){return s.slice().map(function(f){return typeof f=="string"||typeof f=="number"||f instanceof Date?t.parseDate(f,void 0,!0):f&&typeof f=="object"&&f.from&&f.to?{from:t.parseDate(f.from,void 0),to:t.parseDate(f.to,void 0)}:f}).filter(function(f){return f})}function At(){t.selectedDates=[],t.now=t.parseDate(t.config.now)||new Date;var s=t.config.defaultDate||((t.input.nodeName==="INPUT"||t.input.nodeName==="TEXTAREA")&&t.input.placeholder&&t.input.value===t.input.placeholder?null:t.input.value);s&&ge(s,t.config.dateFormat),t._initialDate=t.selectedDates.length>0?t.selectedDates[0]:t.config.minDate&&t.config.minDate.getTime()>t.now.getTime()?t.config.minDate:t.config.maxDate&&t.config.maxDate.getTime()0&&(t.latestSelectedDateObj=t.selectedDates[0]),t.config.minTime!==void 0&&(t.config.minTime=t.parseDate(t.config.minTime,"H:i")),t.config.maxTime!==void 0&&(t.config.maxTime=t.parseDate(t.config.maxTime,"H:i")),t.minDateHasTime=!!t.config.minDate&&(t.config.minDate.getHours()>0||t.config.minDate.getMinutes()>0||t.config.minDate.getSeconds()>0),t.maxDateHasTime=!!t.config.maxDate&&(t.config.maxDate.getHours()>0||t.config.maxDate.getMinutes()>0||t.config.maxDate.getSeconds()>0)}function be(){if(t.input=se(),!t.input){t.config.errorHandler(new Error("Invalid input element specified"));return}t.input._type=t.input.type,t.input.type="text",t.input.classList.add("flatpickr-input"),t._input=t.input,t.config.altInput&&(t.altInput=ue(t.input.nodeName,t.config.altInputClass),t._input=t.altInput,t.altInput.placeholder=t.input.placeholder,t.altInput.disabled=t.input.disabled,t.altInput.required=t.input.required,t.altInput.tabIndex=t.input.tabIndex,t.altInput.type="text",t.input.setAttribute("type","hidden"),!t.config.static&&t.input.parentNode&&t.input.parentNode.insertBefore(t.altInput,t.input.nextSibling)),t.config.allowInput||t._input.setAttribute("readonly","readonly"),Ue()}function Ue(){t._positionElement=t.config.positionElement||t._input}function Be(){var s=t.config.enableTime?t.config.noCalendar?"time":"datetime-local":"date";t.mobileInput=ue("input",t.input.className+" flatpickr-mobile"),t.mobileInput.tabIndex=1,t.mobileInput.type=s,t.mobileInput.disabled=t.input.disabled,t.mobileInput.required=t.input.required,t.mobileInput.placeholder=t.input.placeholder,t.mobileFormatStr=s==="datetime-local"?"Y-m-d\\TH:i:S":s==="date"?"Y-m-d":"H:i:S",t.selectedDates.length>0&&(t.mobileInput.defaultValue=t.mobileInput.value=t.formatDate(t.selectedDates[0],t.mobileFormatStr)),t.config.minDate&&(t.mobileInput.min=t.formatDate(t.config.minDate,"Y-m-d")),t.config.maxDate&&(t.mobileInput.max=t.formatDate(t.config.maxDate,"Y-m-d")),t.input.getAttribute("step")&&(t.mobileInput.step=String(t.input.getAttribute("step"))),t.input.type="hidden",t.altInput!==void 0&&(t.altInput.type="hidden");try{t.input.parentNode&&t.input.parentNode.insertBefore(t.mobileInput,t.input.nextSibling)}catch{}g(t.mobileInput,"change",function(f){t.setDate(Ct(f).value,!1,t.mobileFormatStr),ne("onChange"),ne("onClose")})}function ft(s){if(t.isOpen===!0)return t.close();t.open(s)}function ne(s,f){if(t.config!==void 0){var w=t.config[s];if(w!==void 0&&w.length>0)for(var k=0;w[k]&&k=0&&kt(s,t.selectedDates[1])<=0}function En(){t.config.noCalendar||t.isMobile||!t.monthNav||(t.yearElements.forEach(function(s,f){var w=new Date(t.currentYear,t.currentMonth,1);w.setMonth(t.currentMonth+f),t.config.showMonths>1||t.config.monthSelectorType==="static"?t.monthElements[f].textContent=tl(w.getMonth(),t.config.shorthandCurrentMonth,t.l10n)+" ":t.monthsDropdownContainer.value=w.getMonth().toString(),s.value=w.getFullYear().toString()}),t._hidePrevMonthArrow=t.config.minDate!==void 0&&(t.currentYear===t.config.minDate.getFullYear()?t.currentMonth<=t.config.minDate.getMonth():t.currentYeart.config.maxDate.getMonth():t.currentYear>t.config.maxDate.getFullYear()))}function $r(s){var f=s||(t.config.altInput?t.config.altFormat:t.config.dateFormat);return t.selectedDates.map(function(w){return t.formatDate(w,f)}).filter(function(w,k,I){return t.config.mode!=="range"||t.config.enableTime||I.indexOf(w)===k}).join(t.config.mode!=="range"?t.config.conjunction:t.l10n.rangeSeparator)}function un(s){s===void 0&&(s=!0),t.mobileInput!==void 0&&t.mobileFormatStr&&(t.mobileInput.value=t.latestSelectedDateObj!==void 0?t.formatDate(t.latestSelectedDateObj,t.mobileFormatStr):""),t.input.value=$r(t.config.dateFormat),t.altInput!==void 0&&(t.altInput.value=$r(t.config.altFormat)),s!==!1&&ne("onValueUpdate")}function _h(s){var f=Ct(s),w=t.prevMonthNav.contains(f),k=t.nextMonthNav.contains(f);w||k?C(w?-1:1):t.yearElements.indexOf(f)>=0?f.select():f.classList.contains("arrowUp")?t.changeYear(t.currentYear+1):f.classList.contains("arrowDown")&&t.changeYear(t.currentYear-1)}function Oh(s){s.preventDefault();var f=s.type==="keydown",w=Ct(s),k=w;t.amPM!==void 0&&w===t.amPM&&(t.amPM.textContent=t.l10n.amPM[Rt(t.amPM.textContent===t.l10n.amPM[0])]);var I=parseFloat(k.getAttribute("min")),F=parseFloat(k.getAttribute("max")),X=parseFloat(k.getAttribute("step")),U=parseInt(k.value,10),J=s.delta||(f?s.which===38?1:-1:0),b=U+X*J;if(typeof k.value<"u"&&k.value.length===2){var G=k===t.hourElement,de=k===t.minuteElement;bF&&(b=k===t.hourElement?b-F-Rt(!t.amPM):I,de&&E(void 0,1,t.hourElement)),t.amPM&&G&&(X===1?b+U===23:Math.abs(b-U)>X)&&(t.amPM.textContent=t.l10n.amPM[Rt(t.amPM.textContent===t.l10n.amPM[0])]),k.value=dt(b)}}return i(),t}function Pr(e,n){for(var t=Array.prototype.slice.call(e).filter(function(l){return l instanceof HTMLElement}),r=[],i=0;iC.length)&&(D=C.length);for(var P=0,_=new Array(D);P=0)&&Object.prototype.propertyIsEnumerable.call(C,_)&&(P[_]=C[_])}return P}function z(C,D){if(C==null)return{};var P={},_=Object.keys(C),$,Q;for(Q=0;Q<_.length;Q++)$=_[Q],!(D.indexOf($)>=0)&&(P[$]=C[$]);return P}function m(C,D){var P=Object.keys(C);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(C);D&&(_=_.filter(function($){return Object.getOwnPropertyDescriptor(C,$).enumerable})),P.push.apply(P,_)}return P}function p(C){for(var D=1;D"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Re(C){return Re=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},Re(C)}function me(C,D,P){return D in C?Object.defineProperty(C,D,{value:P,enumerable:!0,configurable:!0,writable:!0}):C[D]=P,C}var ze=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],Ie=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),Te=["onCreate","onDestroy"],st=r.default.func,L=function(C){R(P,C);var D=j(P);function P(){var _;v(this,P);for(var $=arguments.length,Q=new Array($),we=0;we<$;we++)Q[we]=arguments[we];return _=D.call.apply(D,[this].concat(Q)),me(W(_),"createFlatpickrInstance",function(){var pe=p({onClose:function(){_.node.blur&&_.node.blur()}},_.props.options);pe=Y(pe,_.props),_.flatpickr=(0,i.default)(_.node,pe),_.props.hasOwnProperty("value")&&_.flatpickr.setDate(_.props.value,!1);var Ge=_.props.onCreate;Ge&&Ge(_.flatpickr)}),me(W(_),"destroyFlatpickrInstance",function(){var pe=_.props.onDestroy;pe&&pe(_.flatpickr),_.flatpickr.destroy(),_.flatpickr=null}),me(W(_),"handleNodeChange",function(pe){_.node=pe,_.flatpickr&&(_.destroyFlatpickrInstance(),_.createFlatpickrInstance())}),_}return A(P,[{key:"componentDidUpdate",value:function($){var Q=this.props.options,we=$.options;Q=Y(Q,this.props),we=Y(we,$);for(var pe=Object.getOwnPropertyNames(Q),Ge=pe.length-1;Ge>=0;Ge--){var wt=pe[Ge],He=Q[wt];He!==we[wt]&&(ze.indexOf(wt)!==-1&&!Array.isArray(He)&&(He=[He]),this.flatpickr.set(wt,He))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&$.value&&Array.isArray($.value)&&this.props.value.every(function(Pt,B){$[B]}))&&this.props.value!==$.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var $=this.props,Q=$.options,we=$.defaultValue,pe=$.value,Ge=$.children,wt=$.render,He=g($,["options","defaultValue","value","children","render"]);return ze.forEach(function(Pt){delete He[Pt]}),Te.forEach(function(Pt){delete He[Pt]}),wt?wt(p(p({},He),{},{defaultValue:we,value:pe}),this.handleNodeChange):Q.wrap?t.default.createElement("div",y({},He,{ref:this.handleNodeChange}),Ge):t.default.createElement("input",y({},He,{defaultValue:we,ref:this.handleNodeChange}))}}]),P}(t.Component);me(L,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:Ie,onOpen:Ie,onClose:Ie,onMonthChange:Ie,onYearChange:Ie,onReady:Ie,onValueUpdate:Ie,onDayCreate:Ie,onCreate:st,onDestroy:st,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),me(L,"defaultProps",{options:{}});function Y(C,D){var P=p({},C);return ze.forEach(function(_){if(D.hasOwnProperty(_)){var $;P[_]&&!Array.isArray(P[_])?P[_]=[P[_]]:P[_]||(P[_]=[]);var Q=Array.isArray(D[_])?D[_]:[D[_]];($=P[_]).push.apply($,u(Q))}}),P}var K=L;e.default=K})(Eh);const g1=yu(Eh),v1="/rememrify/assets/queen-bee-602aa693.svg",y1=({loadData:e,dateRange:n,selectWholeWeek:t})=>M.jsxs("div",{id:"weekpicker",children:[e&&M.jsx("div",{className:"loading-overlay",children:M.jsx("div",{children:M.jsxs("span",{children:[M.jsx("div",{className:"load-chart",children:"Loading Chart..."}),M.jsx("div",{className:"floating",children:M.jsx("figure",{className:"bee-character",children:M.jsx("img",{className:"svg",src:v1,alt:"Queen Bee"})})})]})})}),M.jsx(g1,{value:n,options:{mode:"range",inline:!0,dateFormat:"d/m/y",minDate:new Date(1957,0,5),maxDate:new Date(2012,3,27),locale:{firstDayOfWeek:6}},onChange:r=>t(r)})]}),w1=({total:e,weekStart:n,tableOutput:t})=>M.jsxs("div",{className:"content",children:[M.jsxs("h2",{children:["UK Top ",e," Chart"]}),M.jsxs("div",{className:"spacer",children:["Week starting: ",M.jsx("strong",{children:n})]}),M.jsx("hr",{}),M.jsx("article",{id:"wikichart",children:t}),M.jsx("hr",{}),M.jsx("p",{children:"Note: Some results returned may not be completely precise!"})]}),S1=()=>{const n=d=>{const h=d[0],S=h.getDay()!==6?h.setDate(h.getDate()-(h.getDay()+1)):h.setDate(h.getDate()),x=h.getDay()!==5?h.setDate(h.getDate()+(5+(7-h.getDay()))%7):h.setDate(h.getDate());r([new Date(S),new Date(x)]),o(new Date(S).toLocaleDateString("en-GB"))},[t,r]=It.useState(),[i,o]=It.useState("");It.useEffect(()=>{if(window.location.hash){const d=window.location.hash.substring(1).replace("date=","").split("/"),h=d[2]+","+d[1]+","+d[0];return n([new Date(h)])}else return n([new Date(2e3,0,1)])},[]);const[l,a]=It.useState(!1),[u,c]=It.useState(null);return It.useEffect(()=>{c(null),i&&(window.location.hash=`date=${i}`,a(!0),Xc.get(`https://uk-charts-archive.wikia.com/api.php?action=parse&format=json&page=UK_Singles_%26_Album_Chart_(${i})`).then(d=>{const h=d.data.parse.text["*"],y=new DOMParser().parseFromString(h,"text/html").getElementsByTagName("table")[0],g=[],z=[];(()=>{const m=(E,A,R)=>{E.contains("song-row")&&(A&&(g.push(A.textContent),A.textContent&&(A.textContent=A.textContent.replace(/\//g," / "))),R&&(z.push(R.textContent),R.textContent&&(R.textContent=R.textContent.replace(/\//g," / "))))},p=E=>{const A=document.createElement("td"),R=document.createElement("table");R.style.width="100%";const N=document.createElement("tr");switch(N.classList.add("wrapper"),E.children.length){case 5:case 10:N.classList.add("five-columns"),m(E.classList,E.querySelector("td:nth-of-type(4)"),E.querySelector("td:nth-of-type(5)"));break;case 6:case 11:N.classList.add("six-columns"),m(E.classList,E.querySelector("td:nth-of-type(5)"),E.querySelector("td:nth-of-type(6)"));break;case 7:case 12:N.classList.add("seven-columns"),m(E.classList,E.querySelector("td:nth-of-type(6)"),E.querySelector("td:nth-of-type(7)"));break}return Array.from(E.children).forEach(j=>{N.appendChild(j)}),R.appendChild(N),A.appendChild(R),A},v=y.querySelector("tr:first-of-type");v&&(v.classList.add("info-row"),v.appendChild(p(v))),y.querySelectorAll("tr+tr").forEach((E,A)=>{E.classList.add("song-row"),A>=20?E.remove():E.appendChild(p(E))}),c(Vn(y.outerHTML))})(),(()=>{const m=p=>new Promise(v=>{const E=N=>{if(N)return N.replace("%","").replace(" &","+").replace(" And","+").split(" Ft")[0].replace(" Ft","+").split(" ft")[0].replace(" ft","+").split(" Ft.")[0].replace(" Ft.","+").split(" ft.")[0].replace(" ft.","+").split(/\//g)[0].replace(/\//g,"+").replace(/\s+/g,"+").replace(/ *\([^)]*\) */g,"+").replace(/"/g,"'")},A=E(g[p]);let R=E(z[p]);if(R){const N=R.split("+");N.forEach((j,te)=>{(j.indexOf("*")!==-1||j.indexOf("{")!==-1||j.indexOf("}")!==-1)&&(N[te]="")}),R=N.join("+")}Xc.post("http://localhost:3001/",{spotifyUrl:`https://api.spotify.com/v1/search?q=${A}${R}&type=track&market=GB&limit=1`}).then(N=>{const j=N.data,te=W=>{const fe=document.querySelector(`#wikichart tr:nth-of-type(${p+2}) tr.wrapper`);fe&&fe.after(W)};if(!j.tracks.items[0])te((()=>{const fe=document.createElement("tr");return fe.classList.add("no-song-wrapper"),fe.innerHTML=`
+In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(C,D){if(C){if(typeof C=="string")return x(C,D);var P=Object.prototype.toString.call(C).slice(8,-1);if(P==="Object"&&C.constructor&&(P=C.constructor.name),P==="Map"||P==="Set")return Array.from(C);if(P==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(P))return x(C,D)}}function h(C){if(typeof Symbol<"u"&&Symbol.iterator in Object(C))return Array.from(C)}function S(C){if(Array.isArray(C))return x(C)}function x(C,D){(D==null||D>C.length)&&(D=C.length);for(var P=0,_=new Array(D);P=0)&&Object.prototype.propertyIsEnumerable.call(C,_)&&(P[_]=C[_])}return P}function z(C,D){if(C==null)return{};var P={},_=Object.keys(C),$,Q;for(Q=0;Q<_.length;Q++)$=_[Q],!(D.indexOf($)>=0)&&(P[$]=C[$]);return P}function m(C,D){var P=Object.keys(C);if(Object.getOwnPropertySymbols){var _=Object.getOwnPropertySymbols(C);D&&(_=_.filter(function($){return Object.getOwnPropertyDescriptor(C,$).enumerable})),P.push.apply(P,_)}return P}function p(C){for(var D=1;D"u"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch{return!1}}function Re(C){return Re=Object.setPrototypeOf?Object.getPrototypeOf:function(P){return P.__proto__||Object.getPrototypeOf(P)},Re(C)}function me(C,D,P){return D in C?Object.defineProperty(C,D,{value:P,enumerable:!0,configurable:!0,writable:!0}):C[D]=P,C}var ze=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],Ie=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),Te=["onCreate","onDestroy"],st=r.default.func,L=function(C){R(P,C);var D=j(P);function P(){var _;v(this,P);for(var $=arguments.length,Q=new Array($),we=0;we<$;we++)Q[we]=arguments[we];return _=D.call.apply(D,[this].concat(Q)),me(W(_),"createFlatpickrInstance",function(){var pe=p({onClose:function(){_.node.blur&&_.node.blur()}},_.props.options);pe=Y(pe,_.props),_.flatpickr=(0,i.default)(_.node,pe),_.props.hasOwnProperty("value")&&_.flatpickr.setDate(_.props.value,!1);var Ge=_.props.onCreate;Ge&&Ge(_.flatpickr)}),me(W(_),"destroyFlatpickrInstance",function(){var pe=_.props.onDestroy;pe&&pe(_.flatpickr),_.flatpickr.destroy(),_.flatpickr=null}),me(W(_),"handleNodeChange",function(pe){_.node=pe,_.flatpickr&&(_.destroyFlatpickrInstance(),_.createFlatpickrInstance())}),_}return A(P,[{key:"componentDidUpdate",value:function($){var Q=this.props.options,we=$.options;Q=Y(Q,this.props),we=Y(we,$);for(var pe=Object.getOwnPropertyNames(Q),Ge=pe.length-1;Ge>=0;Ge--){var wt=pe[Ge],He=Q[wt];He!==we[wt]&&(ze.indexOf(wt)!==-1&&!Array.isArray(He)&&(He=[He]),this.flatpickr.set(wt,He))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&$.value&&Array.isArray($.value)&&this.props.value.every(function(Pt,B){$[B]}))&&this.props.value!==$.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var $=this.props,Q=$.options,we=$.defaultValue,pe=$.value,Ge=$.children,wt=$.render,He=g($,["options","defaultValue","value","children","render"]);return ze.forEach(function(Pt){delete He[Pt]}),Te.forEach(function(Pt){delete He[Pt]}),wt?wt(p(p({},He),{},{defaultValue:we,value:pe}),this.handleNodeChange):Q.wrap?t.default.createElement("div",y({},He,{ref:this.handleNodeChange}),Ge):t.default.createElement("input",y({},He,{defaultValue:we,ref:this.handleNodeChange}))}}]),P}(t.Component);me(L,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:Ie,onOpen:Ie,onClose:Ie,onMonthChange:Ie,onYearChange:Ie,onReady:Ie,onValueUpdate:Ie,onDayCreate:Ie,onCreate:st,onDestroy:st,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),me(L,"defaultProps",{options:{}});function Y(C,D){var P=p({},C);return ze.forEach(function(_){if(D.hasOwnProperty(_)){var $;P[_]&&!Array.isArray(P[_])?P[_]=[P[_]]:P[_]||(P[_]=[]);var Q=Array.isArray(D[_])?D[_]:[D[_]];($=P[_]).push.apply($,u(Q))}}),P}var K=L;e.default=K})(Eh);const g1=yu(Eh),v1="/rememrify/assets/queen-bee-602aa693.svg",y1=({loadData:e,dateRange:n,selectWholeWeek:t})=>M.jsxs("div",{id:"weekpicker",children:[e&&M.jsx("div",{className:"loading-overlay",children:M.jsx("div",{children:M.jsxs("span",{children:[M.jsx("div",{className:"load-chart",children:"Loading Chart..."}),M.jsx("div",{className:"floating",children:M.jsx("figure",{className:"bee-character",children:M.jsx("img",{className:"svg",src:v1,alt:"Queen Bee"})})})]})})}),M.jsx(g1,{value:n,options:{mode:"range",inline:!0,dateFormat:"d/m/y",minDate:new Date(1957,0,5),maxDate:new Date(2012,3,27),locale:{firstDayOfWeek:6}},onChange:r=>t(r)})]}),w1=({total:e,weekStart:n,tableOutput:t})=>M.jsxs("div",{className:"content",children:[M.jsxs("h2",{children:["UK Top ",e," Chart"]}),M.jsxs("div",{className:"spacer",children:["Week starting: ",M.jsx("strong",{children:n})]}),M.jsx("hr",{}),M.jsx("article",{id:"wikichart",children:t}),M.jsx("hr",{}),M.jsx("p",{children:"Note: Some results returned may not be completely precise!"})]}),S1=()=>{const n=d=>{const h=d[0],S=h.getDay()!==6?h.setDate(h.getDate()-(h.getDay()+1)):h.setDate(h.getDate()),x=h.getDay()!==5?h.setDate(h.getDate()+(5+(7-h.getDay()))%7):h.setDate(h.getDate());r([new Date(S),new Date(x)]),o(new Date(S).toLocaleDateString("en-GB"))},[t,r]=It.useState(),[i,o]=It.useState("");It.useEffect(()=>{if(window.location.hash){const d=window.location.hash.substring(1).replace("date=","").split("/"),h=d[2]+","+d[1]+","+d[0];return n([new Date(h)])}else return n([new Date(2e3,0,1)])},[]);const[l,a]=It.useState(!1),[u,c]=It.useState(null);return It.useEffect(()=>{c(null),i&&(window.location.hash=`date=${i}`,a(!0),Xc.get(`https://uk-charts-archive.wikia.com/api.php?action=parse&format=json&page=UK_Singles_%26_Album_Chart_(${i})&origin=*`).then(d=>{const h=d.data.parse.text["*"],y=new DOMParser().parseFromString(h,"text/html").getElementsByTagName("table")[0],g=[],z=[];(()=>{const m=(E,A,R)=>{E.contains("song-row")&&(A&&(g.push(A.textContent),A.textContent&&(A.textContent=A.textContent.replace(/\//g," / "))),R&&(z.push(R.textContent),R.textContent&&(R.textContent=R.textContent.replace(/\//g," / "))))},p=E=>{const A=document.createElement("td"),R=document.createElement("table");R.style.width="100%";const N=document.createElement("tr");switch(N.classList.add("wrapper"),E.children.length){case 5:case 10:N.classList.add("five-columns"),m(E.classList,E.querySelector("td:nth-of-type(4)"),E.querySelector("td:nth-of-type(5)"));break;case 6:case 11:N.classList.add("six-columns"),m(E.classList,E.querySelector("td:nth-of-type(5)"),E.querySelector("td:nth-of-type(6)"));break;case 7:case 12:N.classList.add("seven-columns"),m(E.classList,E.querySelector("td:nth-of-type(6)"),E.querySelector("td:nth-of-type(7)"));break}return Array.from(E.children).forEach(j=>{N.appendChild(j)}),R.appendChild(N),A.appendChild(R),A},v=y.querySelector("tr:first-of-type");v&&(v.classList.add("info-row"),v.appendChild(p(v))),y.querySelectorAll("tr+tr").forEach((E,A)=>{E.classList.add("song-row"),A>=20?E.remove():E.appendChild(p(E))}),c(Vn(y.outerHTML))})(),(()=>{const m=p=>new Promise(v=>{const E=N=>{if(N)return N.replace("%","").replace(" &","+").replace(" And","+").split(" Ft")[0].replace(" Ft","+").split(" ft")[0].replace(" ft","+").split(" Ft.")[0].replace(" Ft.","+").split(" ft.")[0].replace(" ft.","+").split(/\//g)[0].replace(/\//g,"+").replace(/\s+/g,"+").replace(/ *\([^)]*\) */g,"+").replace(/"/g,"'")},A=E(g[p]);let R=E(z[p]);if(R){const N=R.split("+");N.forEach((j,te)=>{(j.indexOf("*")!==-1||j.indexOf("{")!==-1||j.indexOf("}")!==-1)&&(N[te]="")}),R=N.join("+")}Xc.post("http://localhost:3001/",{spotifyUrl:`https://api.spotify.com/v1/search?q=${A}${R}&type=track&market=GB&limit=1`}).then(N=>{const j=N.data,te=W=>{const fe=document.querySelector(`#wikichart tr:nth-of-type(${p+2}) tr.wrapper`);fe&&fe.after(W)};if(!j.tracks.items[0])te((()=>{const fe=document.createElement("tr");return fe.classList.add("no-song-wrapper"),fe.innerHTML=`
No song found on Spotify!
`,fe})());else if(j.tracks.items[0]){te((()=>{const Te=document.createElement("tr");return Te.classList.add("load-wrapper"),Te.innerHTML=`
Loading song...
diff --git a/index.html b/index.html index 402289a..b52c2de 100644 --- a/index.html +++ b/index.html @@ -35,7 +35,7 @@ --> - +