Files
2026-07-13 12:48:55 +08:00

2 lines
118 KiB
JavaScript

const e={second:!0,minute:!0,hour:!0,day:!0,week:!0,weekend:!0,month:!0,season:!0,quarter:!0,year:!0},t={wk:"week",min:"minute",sec:"second",weekend:"week"},a=function(e){let a=e.match("#Duration").text("normal");return a=a.replace(/s$/,""),t.hasOwnProperty(a)&&(a=t[a]),a},n={minute:!0},r=(e,t,a)=>{const[n,r]=e.split("/"),[i,o]=r.split(":");return Date.UTC(a,n-1,i,o)-36e5*t},i=(e,t,a,n,i)=>{const o=new Date(e).getUTCFullYear(),s=r(t,i,o),u=r(a,n,o);return e>=s&&e<u};var o={"9|s":"2/dili,2/jayapura","9|n":"2/chita,2/khandyga,2/pyongyang,2/seoul,2/tokyo,2/yakutsk,11/palau,japan,rok","9.5|s|04/06:03->10/05:04":"4/adelaide,4/broken_hill,4/south,4/yancowinna","9.5|s":"4/darwin,4/north","8|s|03/13:01->10/02:00":"12/casey","8|s":"2/kuala_lumpur,2/makassar,2/singapore,4/perth,2/ujung_pandang,4/west,singapore","8|n":"2/brunei,2/hong_kong,2/irkutsk,2/kuching,2/macau,2/manila,2/shanghai,2/taipei,2/ulaanbaatar,2/chongqing,2/chungking,2/harbin,2/macao,2/ulan_bator,2/choibalsan,hongkong,prc,roc","8.75|s":"4/eucla","7|s":"12/davis,2/jakarta,9/christmas","7|n":"2/bangkok,2/barnaul,2/hovd,2/krasnoyarsk,2/novokuznetsk,2/novosibirsk,2/phnom_penh,2/pontianak,2/ho_chi_minh,2/tomsk,2/vientiane,2/saigon","6|s":"12/vostok","6|n":"2/almaty,2/bishkek,2/dhaka,2/omsk,2/qyzylorda,2/qostanay,2/thimphu,2/urumqi,9/chagos,2/dacca,2/kashgar,2/thimbu","6.5|n":"2/yangon,9/cocos,2/rangoon","5|s":"12/mawson,9/kerguelen","5|n":"2/aqtau,2/aqtobe,2/ashgabat,2/atyrau,2/dushanbe,2/karachi,2/oral,2/samarkand,2/tashkent,2/yekaterinburg,9/maldives,2/ashkhabad","5.75|n":"2/kathmandu,2/katmandu","5.5|n":"2/kolkata,2/colombo,2/calcutta","4|s":"9/reunion","4|n":"2/baku,2/dubai,2/muscat,2/tbilisi,2/yerevan,8/astrakhan,8/samara,8/saratov,8/ulyanovsk,8/volgograd,9/mahe,9/mauritius,2/volgograd","4.5|n":"2/kabul","3|s":"12/syowa,9/antananarivo","3|n|04/25:02->10/30:24":"0/cairo,egypt","3|n|04/12:04->10/25:02":"2/gaza,2/hebron","3|n|03/30:05->10/26:04":"2/famagusta,2/nicosia,8/athens,8/bucharest,8/helsinki,8/kyiv,8/mariehamn,8/riga,8/sofia,8/tallinn,8/uzhgorod,8/vilnius,8/zaporozhye,8/nicosia,8/kiev,eet","3|n|03/30:04->10/26:03":"8/chisinau,8/tiraspol","3|n|03/30:02->10/25:24":"2/beirut","3|n|03/28:04->10/26:02":"2/jerusalem,2/tel_aviv,israel","3|n":"0/addis_ababa,0/asmara,0/asmera,0/dar_es_salaam,0/djibouti,0/juba,0/kampala,0/mogadishu,0/nairobi,2/aden,2/amman,2/baghdad,2/bahrain,2/damascus,2/kuwait,2/qatar,2/riyadh,8/istanbul,8/kirov,8/minsk,8/moscow,8/simferopol,9/comoro,9/mayotte,2/istanbul,turkey,w-su","3.5|n":"2/tehran,iran","2|s|03/30:04->10/26:02":"12/troll","2|s":"0/gaborone,0/harare,0/johannesburg,0/lubumbashi,0/lusaka,0/maputo,0/maseru,0/mbabane","2|n|03/30:04->10/26:03":"0/ceuta,arctic/longyearbyen,8/amsterdam,8/andorra,8/belgrade,8/berlin,8/bratislava,8/brussels,8/budapest,8/busingen,8/copenhagen,8/gibraltar,8/ljubljana,8/luxembourg,8/madrid,8/malta,8/monaco,8/oslo,8/paris,8/podgorica,8/prague,8/rome,8/san_marino,8/sarajevo,8/skopje,8/stockholm,8/tirane,8/vaduz,8/vatican,8/vienna,8/warsaw,8/zagreb,8/zurich,3/jan_mayen,poland,cet,met","2|n":"0/blantyre,0/bujumbura,0/khartoum,0/kigali,0/tripoli,8/kaliningrad,libya","1|s":"0/brazzaville,0/kinshasa,0/luanda,0/windhoek","1|n|03/30:03->10/26:02":"3/canary,3/faroe,3/madeira,8/dublin,8/guernsey,8/isle_of_man,8/jersey,8/lisbon,8/london,3/faeroe,eire,8/belfast,gb-eire,gb,portugal,wet","1|n":"0/algiers,0/bangui,0/douala,0/lagos,0/libreville,0/malabo,0/ndjamena,0/niamey,0/porto-novo,0/tunis","14|n":"11/kiritimati","13|s":"11/apia,11/tongatapu","13|n":"11/enderbury,11/kanton,11/fakaofo","12|s|04/06:03->09/28:04":"12/mcmurdo,11/auckland,12/south_pole,nz","12|s":"11/fiji","12|n":"2/anadyr,2/kamchatka,2/srednekolymsk,11/funafuti,11/kwajalein,11/majuro,11/nauru,11/tarawa,11/wake,11/wallis,kwajalein","12.75|s|04/06:03->04/06:02":"11/chatham,nz-chat","11|s|04/06:03->10/05:04":"12/macquarie","11|s":"11/bougainville","11|n":"2/magadan,2/sakhalin,11/efate,11/guadalcanal,11/kosrae,11/noumea,11/pohnpei,11/ponape","11.5|n|04/06:03->10/05:04":"11/norfolk","10|s|04/06:03->10/05:04":"4/currie,4/hobart,4/melbourne,4/sydney,4/act,4/canberra,4/nsw,4/tasmania,4/victoria","10|s":"12/dumontdurville,4/brisbane,4/lindeman,11/port_moresby,4/queensland","10|n":"2/ust-nera,2/vladivostok,11/guam,11/saipan,11/chuuk,11/truk,11/yap","10.5|s|04/06:01->10/05:02":"4/lord_howe,4/lhi","0|s|02/23:03->04/06:04":"0/casablanca,0/el_aaiun","0|n|03/30:02->10/26:01":"3/azores","0|n|03/30:01->10/25:24":"1/scoresbysund","0|n":"0/abidjan,0/accra,0/bamako,0/banjul,0/bissau,0/conakry,0/dakar,0/freetown,0/lome,0/monrovia,0/nouakchott,0/ouagadougou,0/sao_tome,1/danmarkshavn,3/reykjavik,3/st_helena,13/gmt,13/utc,0/timbuktu,13/greenwich,13/uct,13/universal,13/zulu,gmt-0,gmt+0,gmt0,greenwich,iceland,uct,universal,utc,zulu,13/unknown,factory","-9|n|03/09:04->11/02:02":"1/adak,1/atka,us/aleutian","-9|n":"11/gambier","-9.5|n":"11/marquesas","-8|n|03/09:04->11/02:02":"1/anchorage,1/juneau,1/metlakatla,1/nome,1/sitka,1/yakutat,us/alaska","-8|n":"11/pitcairn","-7|n|03/09:04->11/02:02":"1/los_angeles,1/santa_isabel,1/tijuana,1/vancouver,1/ensenada,6/pacific,10/bajanorte,us/pacific-new,us/pacific","-7|n":"1/creston,1/dawson,1/dawson_creek,1/fort_nelson,1/hermosillo,1/mazatlan,1/phoenix,1/whitehorse,6/yukon,10/bajasur,us/arizona,mst","-6|s|04/05:22->09/06:24":"11/easter,7/easterisland","-6|n|04/07:02->10/27:02":"1/merida","-6|n|03/09:04->11/02:02":"1/boise,1/cambridge_bay,1/denver,1/edmonton,1/inuvik,1/north_dakota,1/ojinaga,1/ciudad_juarez,1/yellowknife,1/shiprock,6/mountain,navajo,us/mountain","-6|n":"1/bahia_banderas,1/belize,1/chihuahua,1/costa_rica,1/el_salvador,1/guatemala,1/managua,1/mexico_city,1/monterrey,1/regina,1/swift_current,1/tegucigalpa,11/galapagos,6/east-saskatchewan,6/saskatchewan,10/general","-5|s":"1/lima,1/rio_branco,1/porto_acre,5/acre","-5|n|03/09:04->11/02:02":"1/chicago,1/matamoros,1/menominee,1/rainy_river,1/rankin_inlet,1/resolute,1/winnipeg,1/indiana/knox,1/indiana/tell_city,1/north_dakota/beulah,1/north_dakota/center,1/north_dakota/new_salem,1/knox_in,6/central,us/central,us/indiana-starke","-5|n":"1/bogota,1/cancun,1/cayman,1/coral_harbour,1/eirunepe,1/guayaquil,1/jamaica,1/panama,1/atikokan,jamaica,est","-4|s|04/05:24->09/07:02":"1/santiago,7/continental","-4|s|03/22:24->10/05:02":"1/asuncion","-4|s":"1/campo_grande,1/cuiaba,1/la_paz,1/manaus,5/west","-4|n|03/09:04->11/02:02":"1/detroit,1/grand_turk,1/indiana,1/indianapolis,1/iqaluit,1/kentucky,1/louisville,1/montreal,1/nassau,1/new_york,1/nipigon,1/pangnirtung,1/port-au-prince,1/thunder_bay,1/toronto,1/indiana/marengo,1/indiana/petersburg,1/indiana/vevay,1/indiana/vincennes,1/indiana/winamac,1/kentucky/monticello,1/fort_wayne,1/indiana/indianapolis,1/kentucky/louisville,6/eastern,us/east-indiana,us/eastern,us/michigan","-4|n|03/09:02->11/02:01":"1/havana,cuba","-4|n":"1/anguilla,1/antigua,1/aruba,1/barbados,1/blanc-sablon,1/boa_vista,1/caracas,1/curacao,1/dominica,1/grenada,1/guadeloupe,1/guyana,1/kralendijk,1/lower_princes,1/marigot,1/martinique,1/montserrat,1/port_of_spain,1/porto_velho,1/puerto_rico,1/santo_domingo,1/st_barthelemy,1/st_kitts,1/st_lucia,1/st_thomas,1/st_vincent,1/tortola,1/virgin","-3|s":"1/argentina,1/buenos_aires,1/catamarca,1/cordoba,1/fortaleza,1/jujuy,1/mendoza,1/montevideo,1/punta_arenas,1/sao_paulo,12/palmer,12/rothera,3/stanley,1/argentina/la_rioja,1/argentina/rio_gallegos,1/argentina/salta,1/argentina/san_juan,1/argentina/san_luis,1/argentina/tucuman,1/argentina/ushuaia,1/argentina/comodrivadavia,1/argentina/buenos_aires,1/argentina/catamarca,1/argentina/cordoba,1/argentina/jujuy,1/argentina/mendoza,1/argentina/rosario,1/rosario,5/east","-3|n|03/09:04->11/02:02":"1/glace_bay,1/goose_bay,1/halifax,1/moncton,1/thule,3/bermuda,6/atlantic","-3|n":"1/araguaina,1/bahia,1/belem,1/cayenne,1/maceio,1/paramaribo,1/recife,1/santarem","-2|n|03/09:04->11/02:02":"1/miquelon","-2|n":"1/noronha,3/south_georgia,5/denoronha","-2.5|n|03/09:04->11/02:02":"1/st_johns,6/newfoundland","-1|n|03/30:01->10/25:24":"1/nuuk,1/godthab","-1|n":"3/cape_verde","-11|n":"11/midway,11/niue,11/pago_pago,11/samoa,us/samoa","-10|n":"11/honolulu,11/johnston,11/rarotonga,11/tahiti,us/hawaii,hst"},s=["africa","america","asia","atlantic","australia","brazil","canada","chile","europe","indian","mexico","pacific","antarctica","etc"];let u={};Object.keys(o).forEach((e=>{let t=e.split("|"),a={offset:Number(t[0]),hem:t[1]};t[2]&&(a.dst=t[2]),o[e].split(",").forEach((e=>{e=e.replace(/(^[0-9]+)\//,((e,t)=>(t=Number(t),s[t]+"/"))),u[e]=a}))})),u.utc={offset:0,hem:"n"};for(let e=-14;e<=14;e+=.5){let t=e;t>0&&(t="+"+t);let a="etc/gmt"+t;u[a]={offset:-1*e,hem:"n"},a="utc/gmt"+t,u[a]={offset:-1*e,hem:"n"}}const d=/(-?[0-9]+)h(rs)?/i,l=/(-?[0-9]+)/,h=/utc([\-+]?[0-9]+)/i,m=/gmt([\-+]?[0-9]+)/i,c=function(e){return(e=Number(e))>=-13&&e<=13?"etc/gmt"+(e=((e*=-1)>0?"+":"")+e):null};let f=(()=>{let e=(()=>{if("undefined"==typeof Intl||void 0===Intl.DateTimeFormat)return null;let e=Intl.DateTimeFormat();if(void 0===e||void 0===e.resolvedOptions)return null;let t=e.resolvedOptions().timeZone;return t?t.toLowerCase():null})();return null===e?"utc":e})();const y=Object.keys(u).reduce(((e,t)=>{let a=t.split("/")[1]||"";return a=a.replace(/_/g," "),e[a]=t,e}),{}),p=(e,t)=>{if(!e)return t.hasOwnProperty(f)||(console.warn(`Unrecognized IANA id '${f}'. Setting fallback tz to UTC.`),f="utc"),f;"string"!=typeof e&&console.error("Timezone must be a string - recieved: '",e,"'\n");let a=e.trim();if(a=a.toLowerCase(),!0===t.hasOwnProperty(a))return a;if(a=(e=>(e=(e=(e=(e=(e=e.replace(/ time/g,"")).replace(/ (standard|daylight|summer)/g,"")).replace(/\b(east|west|north|south)ern/g,"$1")).replace(/\b(africa|america|australia)n/g,"$1")).replace(/\beuropean/g,"europe")).replace(/islands/g,"island"))(a),!0===t.hasOwnProperty(a))return a;if(!0===y.hasOwnProperty(a))return y[a];if(!0===/[0-9]/.test(a)){let e=function(e){let t=e.match(d);if(null!==t)return c(t[1]);if(t=e.match(h),null!==t)return c(t[1]);if(t=e.match(m),null!==t){let e=-1*Number(t[1]);return c(e)}return t=e.match(l),null!==t?c(t[1]):null}(a);if(e)return e}throw new Error("Spacetime: Cannot find timezone named: '"+e+"'. Please enter an IANA timezone id.")};function g(e){return e%4==0&&e%100!=0||e%400==0}function w(e){return"[object Date]"===Object.prototype.toString.call(e)&&!isNaN(e.valueOf())}function b(e){return"[object Object]"===Object.prototype.toString.call(e)}function k(e,t=2){return(e+="").length>=t?e:new Array(t-e.length+1).join("0")+e}function D(e){let t=e%10,a=e%100;return 1===t&&11!==a?e+"st":2===t&&12!==a?e+"nd":3===t&&13!==a?e+"rd":e+"th"}function v(e){return e=(e=String(e)).replace(/([0-9])(st|nd|rd|th)$/i,"$1"),parseInt(e,10)}function x(e=""){return"day"===(e=(e=(e=(e=e.toLowerCase().trim()).replace(/ies$/,"y")).replace(/s$/,"")).replace(/-/g,""))||"days"===e?"date":"min"===e||"mins"===e?"minute":e}function O(e){return"number"==typeof e?e:w(e)?e.getTime():e.epoch||0===e.epoch?e.epoch:null}function M(e,t){return!1===b(e)?t.clone().set(e):e}function _(e,t=""){const a=e>0?"+":"-",n=Math.abs(e);return`${a}${k(parseInt(""+n,10))}${t}${k(n%1*60)}`}const j={year:(new Date).getFullYear(),month:0,date:1};var $={parseArray:(e,t,a)=>{if(0===t.length)return e;let n=["year","month","date","hour","minute","second","millisecond"];for(let r=0;r<n.length;r++){let i=t[r]||a[n[r]]||j[n[r]]||0;e=e[n[r]](i)}return e},parseObject:(e,t,a)=>{if(0===Object.keys(t).length)return e;t=Object.assign({},j,a,t);let n=Object.keys(t);for(let r=0;r<n.length;r++){let i=n[r];if(void 0===e[i]||"function"!=typeof e[i])continue;if(null===t[i]||void 0===t[i]||""===t[i])continue;let o=t[i]||a[i]||j[i]||0;e=e[i](o)}return e},parseNumber:function(e,t){return t>0&&t<25e8&&!1===e.silent&&(console.warn(" - Warning: You are setting the date to January 1970."),console.warn(" - did input seconds instead of milliseconds?")),e.epoch=t,e}};const z=function(e){return e.epoch=Date.now(),Object.keys(e._today||{}).forEach((t=>{"function"==typeof e[t]&&(e=e[t](e._today[t]))})),e},T={now:e=>z(e),today:e=>z(e),tonight:e=>e=(e=z(e)).hour(18),tomorrow:e=>e=(e=(e=z(e)).add(1,"day")).startOf("day"),yesterday:e=>e=(e=(e=z(e)).subtract(1,"day")).startOf("day"),christmas:e=>{let t=z(e).year();return e=e.set([t,11,25,18,0,0])},"new years":e=>{let t=z(e).year();return e=e.set([t,11,31,18,0,0])}};T["new years eve"]=T["new years"];let V={millisecond:1,second:1e3,minute:6e4,hour:36e5,day:864e5};V.date=V.day,V.month=25488e5,V.week=6048e5,V.year=3154e7,Object.keys(V).forEach((e=>{V[e+"s"]=V[e]}));const S=(e,t,a,n,r)=>{let i=e.d[a]();if(i===t)return;let o=null===r?null:e.d[r](),s=e.epoch,u=t-i;e.epoch+=V[n]*u,"day"===n&&Math.abs(u)>28&&t<28&&(e.epoch+=V.hour),null!==r&&o!==e.d[r]()&&(e.epoch=s);const d=V[n]/2;for(;e.d[a]()<t;)e.epoch+=d;for(;e.d[a]()>t;)e.epoch-=d;null!==r&&o!==e.d[r]()&&(e.epoch=s)},q={year:{valid:e=>e>-4e3&&e<4e3,walkTo:(e,t)=>S(e,t,"getFullYear","year",null)},month:{valid:e=>e>=0&&e<=11,walkTo:(e,t)=>{let a=e.d,n=a.getMonth(),r=e.epoch,i=a.getFullYear();if(n===t)return;let o=t-n;for(e.epoch+=V.day*(28*o),i!==e.d.getFullYear()&&(e.epoch=r);e.d.getMonth()<t;)e.epoch+=V.day;for(;e.d.getMonth()>t;)e.epoch-=V.day}},date:{valid:e=>e>0&&e<=31,walkTo:(e,t)=>S(e,t,"getDate","day","getMonth")},hour:{valid:e=>e>=0&&e<24,walkTo:(e,t)=>S(e,t,"getHours","hour","getDate")},minute:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>S(e,t,"getMinutes","minute","getHours")},second:{valid:e=>e>=0&&e<60,walkTo:(e,t)=>{e.epoch=e.seconds(t).epoch}},millisecond:{valid:e=>e>=0&&e<1e3,walkTo:(e,t)=>{e.epoch=e.milliseconds(t).epoch}}},C=(e,t)=>{let a=Object.keys(q),n=e.clone();for(let r=0;r<a.length;r++){let i=a[r],o=t[i];if(void 0===o&&(o=n[i]()),"string"==typeof o&&(o=parseInt(o,10)),!q[i].valid(o))return e.epoch=null,void(!1===e.silent&&console.warn("invalid "+i+": "+o));q[i].walkTo(e,o)}},A=[31,28,31,30,31,30,31,31,30,31,30,31];let N=["jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"],E=["january","february","march","april","may","june","july","august","september","october","november","december"];function P(){return N}function Y(){return function(){const e={sep:8};for(let t=0;t<N.length;t++)e[N[t]]=t;for(let t=0;t<E.length;t++)e[E[t]]=t;return e}()}const B=(e,t)=>{if(!t)return e;t=t.trim().toLowerCase();let a=0;if(/^[+-]?[0-9]{2}:[0-9]{2}$/.test(t)&&(!0===/:00/.test(t)&&(t=t.replace(/:00/,"")),!0===/:30/.test(t)&&(t=t.replace(/:30/,".5"))),/^[+-]?[0-9]{4}$/.test(t)&&(t=t.replace(/30$/,".5")),a=parseFloat(t),Math.abs(a)>100&&(a/=100),0===a||"Z"===t||"z"===t)return e.tz="etc/gmt",e;a*=-1,a>=0&&(a="+"+a);let n="etc/gmt"+a;return e.timezones[n]&&(e.tz=n),e},H=(e,t="")=>{let a=(t=t.replace(/^\s+/,"").toLowerCase()).match(/([0-9]{1,2}):([0-9]{1,2}):?([0-9]{1,2})?[:.]?([0-9]{1,4})?/);if(null!==a){let[,n,r,i,o]=a;if(n=Number(n),n<0||n>24)return e.startOf("day");if(r=Number(r),a[2].length<2||r<0||r>59)return e.startOf("day");e=(e=(e=(e=e.hour(n)).minute(r)).seconds(i||0)).millisecond(function(e=""){return(e=String(e)).length>3?e=e.substring(0,3):1===e.length?e+="00":2===e.length&&(e+="0"),Number(e)||0}(o));let s=t.match(/[0-9] ?(am|pm)\b/);return null!==s&&s[1]&&(e=e.ampm(s[1])),e}if(a=t.match(/([0-9]+) ?(am|pm)/),null!==a&&a[1]){let t=Number(a[1]);return t>12||t<1?e.startOf("day"):e=(e=(e=e.hour(a[1]||0)).ampm(a[2])).startOf("hour")}return e=e.startOf("day")};let L=Y();const I=e=>{if(!0!==A.hasOwnProperty(e.month))return!1;if(1===e.month)return!!(g(e.year)&&e.date<=29)||e.date<=28;let t=A[e.month]||0;return e.date<=t},W=(e="",t)=>{if(e=e.trim(),!0===/^'[0-9][0-9]$/.test(e)){let t=Number(e.replace(/'/,""));return t>50?1900+t:2e3+t}let a=parseInt(e,10);return!a&&t&&(a=t.year),a=a||(new Date).getFullYear(),a},F=function(e){return"sept"===(e=e.toLowerCase().trim())?L.sep:L[e]};var J=[{reg:/^([0-9]{1,2})[-/.]([0-9]{1,2})[\-/.]?([0-9]{4})?( [0-9]{1,2}:[0-9]{2}:?[0-9]{0,2} ?(am|pm|gmt))?$/i,parse:(e,t)=>{let a=parseInt(t[1],10)-1,n=parseInt(t[2],10);(e.british||a>=12)&&(n=parseInt(t[1],10),a=parseInt(t[2],10)-1);let r={date:n,month:a,year:W(t[3],e._today)||(new Date).getFullYear()};return!1===I(r)?(e.epoch=null,e):(C(e,r),e=H(e,t[4]))}},{reg:/^([a-z]+)[\-/. ]([0-9]{1,2})[\-/. ]?([0-9]{4}|'[0-9]{2})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:F(t[1]),date:v(t[2]||"")};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2})( [0-9]{4})?( ([0-9:]+( ?am| ?pm| ?gmt)?))?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:F(t[1]),date:v(t[2]||"")};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{1,2}) ([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2})( \+[0-9]{4})?( [0-9]{4})?$/i,parse:(e,t)=>{let[,a,n,r,i,o]=t,s={year:W(o,e._today),month:F(a),date:v(n||"")};return!1===I(s)?(e.epoch=null,e):(C(e,s),e=B(e,i),e=H(e,r))}}],U=[{reg:/^([0-9]{4})[\-/]([0-9]{2})$/,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:1};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}},{reg:/^([a-z]+) ([0-9]{4})$/i,parse:(e,t)=>{let a={year:W(t[2],e._today),month:F(t[1]),date:e._today.date||1};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}},{reg:/^(q[0-9])( of)?( [0-9]{4})?/i,parse:(e,t)=>{let a=t[1]||"";e=e.quarter(a);let n=t[3]||"";return n&&(n=n.trim(),e=e.year(n)),e}},{reg:/^(spring|summer|winter|fall|autumn)( of)?( [0-9]{4})?/i,parse:(e,t)=>{let a=t[1]||"";e=e.season(a);let n=t[3]||"";return n&&(n=n.trim(),e=e.year(n)),e}},{reg:/^[0-9,]+ ?b\.?c\.?$/i,parse:(e,t)=>{let a=t[0]||"";a=a.replace(/^([0-9,]+) ?b\.?c\.?$/i,"-$1");let n=new Date,r={year:parseInt(a.trim(),10),month:n.getMonth(),date:n.getDate()};return!1===I(r)?(e.epoch=null,e):(C(e,r),e=H(e))}},{reg:/^[0-9,]+ ?(a\.?d\.?|c\.?e\.?)$/i,parse:(e,t)=>{let a=t[0]||"";a=a.replace(/,/g,"");let n=new Date,r={year:parseInt(a.trim(),10),month:n.getMonth(),date:n.getDate()};return!1===I(r)?(e.epoch=null,e):(C(e,r),e=H(e))}},{reg:/^[0-9]{4}( ?a\.?d\.?)?$/i,parse:(e,t)=>{let a=e._today;a.month&&!a.date&&(a.date=1);let n=new Date,r={year:W(t[0],a),month:a.month||n.getMonth(),date:a.date||n.getDate()};return!1===I(r)?(e.epoch=null,e):(C(e,r),e=H(e))}}],K=[].concat([{reg:/^(-?0{0,2}[0-9]{3,4})-([0-9]{1,2})-([0-9]{1,2})[T| ]([0-9.:]+)(Z|[0-9-+:]+)?$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:t[3]};return!1===I(a)?(e.epoch=null,e):(B(e,t[5]),C(e,a),e=H(e,t[4]))}},{reg:/^([0-9]{4})[\-/. ]([0-9]{1,2})[\-/. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:t[1],month:parseInt(t[2],10)-1,date:parseInt(t[3],10)};return a.month>=12&&(a.date=parseInt(t[2],10),a.month=parseInt(t[3],10)-1),!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}},{reg:/^([0-9]{4})[\-/. ]([a-z]+)[\-/. ]([0-9]{1,2})( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={year:W(t[1],e._today),month:F(t[2]),date:v(t[3]||"")};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}}],J,[{reg:/^([0-9]{1,2})[-/]([a-z]+)[\-/]?([0-9]{4})?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:F(t[2]),date:v(t[1]||"")};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=H(e,t[4]))}},{reg:/^([0-9]{1,2})( [a-z]+)( [0-9]{4}| '[0-9]{2})? ?([0-9]{1,2}:[0-9]{2}:?[0-9]{0,2} ?(am|pm|gmt))?$/i,parse:(e,t)=>{let a={year:W(t[3],e._today),month:F(t[2]),date:v(t[1])};return a.month&&!1!==I(a)?(C(e,a),e=H(e,t[4])):(e.epoch=null,e)}},{reg:/^([0-9]{1,2})[. \-/]([a-z]+)[. \-/]([0-9]{4})?( [0-9]{1,2}(:[0-9]{0,2})?(:[0-9]{0,3})? ?(am|pm)?)?$/i,parse:(e,t)=>{let a={date:Number(t[1]),month:F(t[2]),year:Number(t[3])};return!1===I(a)?(e.epoch=null,e):(C(e,a),e=e.startOf("day"),e=H(e,t[4]))}}],U);const{parseArray:Q,parseObject:R,parseNumber:G}=$,Z={year:(new Date).getFullYear(),month:0,date:1},X=(e,t)=>{let a=e._today||Z;if("number"==typeof t)return G(e,t);if(e.epoch=Date.now(),e._today&&b(e._today)&&Object.keys(e._today).length>0){let t=R(e,a,Z);t.isValid()&&(e.epoch=t.epoch)}return null==t||""===t?e:!0===w(t)?(e.epoch=t.getTime(),e):!0===function(e){return"[object Array]"===Object.prototype.toString.call(e)}(t)?e=Q(e,t,a):!0===b(t)?t.epoch?(e.epoch=t.epoch,e.tz=t.tz,e):e=R(e,t,a):"string"!=typeof t?e:(t=t.replace(/\b(mon|tues?|wed|wednes|thur?s?|fri|sat|satur|sun)(day)?\b/i,"").replace(/([0-9])(th|rd|st|nd)/,"$1").replace(/,/g,"").replace(/ +/g," ").trim(),!0===T.hasOwnProperty(t)?e=T[t](e):function(e,t,a){for(let n=0;n<K.length;n++){let r=t.match(K[n].reg);if(r){let t=K[n].parse(e,r,a);if(null!==t&&t.isValid())return t}}return!1===e.silent&&console.warn("Warning: couldn't parse date-string: '"+t+"'"),e.epoch=null,e}(e,t))};let ee=["sun","mon","tue","wed","thu","fri","sat"],te=["sunday","monday","tuesday","wednesday","thursday","friday","saturday"];function ae(){return ee}function ne(){return te}const re={mo:1,tu:2,we:3,th:4,fr:5,sa:6,su:7,tues:2,weds:3,wedn:3,thur:4,thurs:4};let ie=!0;const oe=e=>{let t=e.timezone().current.offset;return t?_(t,":"):"Z"},se=e=>ie?function(e){return e?e[0].toUpperCase()+e.substr(1):""}(e):e,ue={day:e=>se(e.dayName()),"day-short":e=>se(ae()[e.day()]),"day-number":e=>e.day(),"day-ordinal":e=>D(e.day()),"day-pad":e=>k(e.day()),date:e=>e.date(),"date-ordinal":e=>D(e.date()),"date-pad":e=>k(e.date()),month:e=>se(e.monthName()),"month-short":e=>se(P()[e.month()]),"month-number":e=>e.month(),"month-ordinal":e=>D(e.month()),"month-pad":e=>k(e.month()),"iso-month":e=>k(e.month()+1),year:e=>{let t=e.year();return t>0?t:(t=Math.abs(t),t+" BC")},"year-short":e=>{let t=e.year();return t>0?`'${String(e.year()).substr(2,4)}`:(t=Math.abs(t),t+" BC")},"iso-year":e=>{let t=e.year(),a=t<0,n=k(Math.abs(t),4);return a&&(n=k(n,6),n="-"+n),n},time:e=>e.time(),"time-24":e=>`${e.hour24()}:${k(e.minute())}`,hour:e=>e.hour12(),"hour-pad":e=>k(e.hour12()),"hour-24":e=>e.hour24(),"hour-24-pad":e=>k(e.hour24()),minute:e=>e.minute(),"minute-pad":e=>k(e.minute()),second:e=>e.second(),"second-pad":e=>k(e.second()),millisecond:e=>e.millisecond(),"millisecond-pad":e=>k(e.millisecond(),3),ampm:e=>e.ampm(),AMPM:e=>e.ampm().toUpperCase(),quarter:e=>"Q"+e.quarter(),season:e=>e.season(),era:e=>e.era(),json:e=>e.json(),timezone:e=>e.timezone().name,offset:e=>oe(e),numeric:e=>`${e.year()}/${k(e.month()+1)}/${k(e.date())}`,"numeric-us":e=>`${k(e.month()+1)}/${k(e.date())}/${e.year()}`,"numeric-uk":e=>`${k(e.date())}/${k(e.month()+1)}/${e.year()}`,"mm/dd":e=>`${k(e.month()+1)}/${k(e.date())}`,iso:e=>`${e.format("iso-year")}-${k(e.month()+1)}-${k(e.date())}T${k(e.h24())}:${k(e.minute())}:${k(e.second())}.${k(e.millisecond(),3)}${oe(e)}`,"iso-short":e=>{let t=k(e.month()+1),a=k(e.date());var n;return`${(n=e.year())>=0?k(n,4):"-"+k(n=Math.abs(n),4)}-${t}-${a}`},"iso-utc":e=>new Date(e.epoch).toISOString(),nice:e=>`${P()[e.month()]} ${D(e.date())}, ${e.time()}`,"nice-24":e=>`${P()[e.month()]} ${D(e.date())}, ${e.hour24()}:${k(e.minute())}`,"nice-year":e=>`${P()[e.month()]} ${D(e.date())}, ${e.year()}`,"nice-day":e=>`${ae()[e.day()]} ${se(P()[e.month()])} ${D(e.date())}`,"nice-full":e=>`${e.dayName()} ${se(e.monthName())} ${D(e.date())}, ${e.time()}`,"nice-full-24":e=>`${e.dayName()} ${se(e.monthName())} ${D(e.date())}, ${e.hour24()}:${k(e.minute())}`},de={"day-name":"day","month-name":"month","iso 8601":"iso","time-h24":"time-24","time-12":"time","time-h12":"time",tz:"timezone","day-num":"day-number","month-num":"month-number","month-iso":"iso-month","year-iso":"iso-year","nice-short":"nice","nice-short-24":"nice-24",mdy:"numeric-us",dmy:"numeric-uk",ymd:"numeric","yyyy/mm/dd":"numeric","mm/dd/yyyy":"numeric-us","dd/mm/yyyy":"numeric-us","little-endian":"numeric-uk","big-endian":"numeric","day-nice":"nice-day"};Object.keys(de).forEach((e=>ue[e]=ue[de[e]]));const le=(e,t="")=>{if(!0!==e.isValid())return"";if(ue.hasOwnProperty(t)){let a=ue[t](e)||"";return"json"!==t&&(a=String(a),"ampm"!==t.toLowerCase()&&(a=se(a))),a}if(-1!==t.indexOf("{")){let a=/\{(.+?)\}/g;return t=t.replace(a,((t,a)=>{if("AMPM"!==(a=a.trim())&&(a=a.toLowerCase()),ue.hasOwnProperty(a)){let t=String(ue[a](e));return"ampm"!==a.toLowerCase()?se(t):t}return""})),t}return e.format("iso-short")},he={G:e=>e.era(),GG:e=>e.era(),GGG:e=>e.era(),GGGG:e=>"AD"===e.era()?"Anno Domini":"Before Christ",y:e=>e.year(),yy:e=>k(Number(String(e.year()).substr(2,4))),yyy:e=>e.year(),yyyy:e=>e.year(),yyyyy:e=>"0"+e.year(),Q:e=>e.quarter(),QQ:e=>e.quarter(),QQQ:e=>e.quarter(),QQQQ:e=>e.quarter(),M:e=>e.month()+1,MM:e=>k(e.month()+1),MMM:e=>e.format("month-short"),MMMM:e=>e.format("month"),w:e=>e.week(),ww:e=>k(e.week()),d:e=>e.date(),dd:e=>k(e.date()),D:e=>e.dayOfYear(),DD:e=>k(e.dayOfYear()),DDD:e=>k(e.dayOfYear(),3),E:e=>e.format("day-short"),EE:e=>e.format("day-short"),EEE:e=>e.format("day-short"),EEEE:e=>e.format("day"),EEEEE:e=>e.format("day")[0],e:e=>e.day(),ee:e=>e.day(),eee:e=>e.format("day-short"),eeee:e=>e.format("day"),eeeee:e=>e.format("day")[0],a:e=>e.ampm().toUpperCase(),aa:e=>e.ampm().toUpperCase(),aaa:e=>e.ampm().toUpperCase(),aaaa:e=>e.ampm().toUpperCase(),h:e=>e.h12(),hh:e=>k(e.h12()),H:e=>e.hour(),HH:e=>k(e.hour()),m:e=>e.minute(),mm:e=>k(e.minute()),s:e=>e.second(),ss:e=>k(e.second()),SSS:e=>k(e.millisecond(),3),A:e=>e.epoch-e.startOf("day").epoch,z:e=>e.timezone().name,zz:e=>e.timezone().name,zzz:e=>e.timezone().name,zzzz:e=>e.timezone().name,Z:e=>_(e.timezone().current.offset),ZZ:e=>_(e.timezone().current.offset),ZZZ:e=>_(e.timezone().current.offset),ZZZZ:e=>_(e.timezone().current.offset,":")},me=(e,t,a)=>{let n=e,r=t;for(let i=0;i<a;i+=1)he[n]=he[r],n+=e,r+=t};me("q","Q",4),me("L","M",4),me("Y","y",4),me("c","e",4),me("k","H",2),me("K","h",2),me("S","s",2),me("v","z",4),me("V","Z",4);const ce=["year","season","quarter","month","week","day","quarterHour","hour","minute"],fe=function(e,t){let a=e.clone().startOf(t),n=e.clone().endOf(t).epoch-a.epoch,r=(e.epoch-a.epoch)/n;return parseFloat(r.toFixed(2))},ye=(e,t,a)=>{let n=0;for(e=e.clone();e.isBefore(t);)e=e.add(1,a),n+=1;return e.isAfter(t,a)&&(n-=1),n},pe=(e,t,a)=>e.isBefore(t)?ye(e,t,a):-1*ye(t,e,a),ge=function(e,t,a){t=M(t,e);let n=!1;if(e.isAfter(t)){let a=e;e=t,t=a,n=!0}let r=function(e,t){let a=t.epoch-e.epoch,n={milliseconds:a,seconds:parseInt(a/1e3,10)};n.minutes=parseInt(n.seconds/60,10),n.hours=parseInt(n.minutes/60,10);let r=e.clone();return n.years=((e,t)=>{let a=t.year()-e.year();return(e=e.year(t.year())).isAfter(t)&&(a-=1),a})(r,t),r=e.add(n.years,"year"),n.months=12*n.years,r=e.add(n.months,"month"),n.months+=pe(r,t,"month"),n.quarters=4*n.years,n.quarters+=parseInt(n.months%12/3,10),n.weeks=52*n.years,r=e.add(n.weeks,"week"),n.weeks+=pe(r,t,"week"),n.days=7*n.weeks,r=e.add(n.days,"day"),n.days+=pe(r,t,"day"),n}(e,t);return n&&(r=function(e){return Object.keys(e).forEach((t=>{e[t]*=-1})),e}(r)),a?(a=x(a),!0!==/s$/.test(a)&&(a+="s"),"dates"===a&&(a="days"),r[a]):r},we=e=>Math.abs(e)||0;let be={second:"second",seconds:"seconds",minute:"minute",minutes:"minutes",hour:"hour",hours:"hours",day:"day",days:"days",month:"month",months:"months",year:"year",years:"years"};function ke(e){return be[e]||""}let De="past",ve="future",xe="present",Oe="now",Me="almost",_e="over",je=e=>`${e} ago`,$e=e=>`in ${e}`;function ze(e){return je(e)}function Te(e){return $e(e)}function Ve(){return Oe}const Se={months:{almost:10,over:4},days:{almost:25,over:10},hours:{almost:20,over:8},minutes:{almost:50,over:20},seconds:{almost:50,over:20}};function qe(e,t){return 1===e?e+" "+ke(t.slice(0,-1)):e+" "+ke(t)}const Ce=function(e){let t=null,a=null,n=[],r=[];return Object.keys(e).forEach(((i,o,s)=>{const u=Math.abs(e[i]);if(0===u)return;n.push(u+i[0]);const d=qe(u,i);if(r.push(d),!t){if(t=d,a=d,o>4)return;const n=s[o+1],r=Math.abs(e[n]);r>Se[n].almost?(t=qe(u+1,i),a=Me+" "+t):r>Se[n].over&&(a=_e+" "+d)}})),{qualified:a,rounded:t,abbreviated:n,englishValues:r}},Ae=(e,t)=>{const a=function(e,t){const a=e.isBefore(t),n=a?t:e;let r=a?e:t;r=r.clone();const i={years:0,months:0,days:0,hours:0,minutes:0,seconds:0};return Object.keys(i).forEach((e=>{if(r.isSame(n,e))return;let t=r.diff(n,e);r=r.add(t,e),i[e]=t})),a&&Object.keys(i).forEach((e=>{0!==i[e]&&(i[e]*=-1)})),i}(e,t=M(t,e));if(!0===Object.keys(a).every((e=>!a[e])))return{diff:a,rounded:Ve(),qualified:Ve(),precise:Ve(),abbreviated:[],iso:"P0Y0M0DT0H0M0S",direction:xe};let n,r=ve,{rounded:i,qualified:o,englishValues:s,abbreviated:u}=Ce(a);n=s.splice(0,2).join(", "),!0===e.isAfter(t)?(i=ze(i),o=ze(o),n=ze(n),r=De):(i=Te(i),o=Te(o),n=Te(n));let d=function(e){let t="P";return t+=we(e.years)+"Y",t+=we(e.months)+"M",t+=we(e.days)+"DT",t+=we(e.hours)+"H",t+=we(e.minutes)+"M",t+=we(e.seconds)+"S",t}(a);return{diff:a,rounded:i,qualified:o,precise:n,abbreviated:u,iso:d,direction:r}};var Ne={north:[["spring",2,1],["summer",5,1],["fall",8,1],["autumn",8,1],["winter",11,1]],south:[["fall",2,1],["autumn",2,1],["winter",5,1],["spring",8,1],["summer",11,1]]},Ee=[null,[0,1],[3,1],[6,1],[9,1]];const Pe={second:e=>(C(e,{millisecond:0}),e),minute:e=>(C(e,{second:0,millisecond:0}),e),quarterhour:e=>{let t=e.minutes();return e=t>=45?e.minutes(45):t>=30?e.minutes(30):t>=15?e.minutes(15):e.minutes(0),C(e,{second:0,millisecond:0}),e},hour:e=>(C(e,{minute:0,second:0,millisecond:0}),e),day:e=>(C(e,{hour:0,minute:0,second:0,millisecond:0}),e),week:e=>{let t=e.clone();return(e=e.day(e._weekStart)).isAfter(t)&&(e=e.subtract(1,"week")),C(e,{hour:0,minute:0,second:0,millisecond:0}),e},month:e=>(C(e,{date:1,hour:0,minute:0,second:0,millisecond:0}),e),quarter:e=>{let t=e.quarter();return Ee[t]&&C(e,{month:Ee[t][0],date:Ee[t][1],hour:0,minute:0,second:0,millisecond:0}),e},season:e=>{let t=e.season(),a="north";"South"===e.hemisphere()&&(a="south");for(let n=0;n<Ne[a].length;n++)if(Ne[a][n][0]===t){let r=e.year();return"winter"===t&&e.month()<3&&(r-=1),C(e,{year:r,month:Ne[a][n][1],date:Ne[a][n][2],hour:0,minute:0,second:0,millisecond:0}),e}return e},year:e=>(C(e,{month:0,date:1,hour:0,minute:0,second:0,millisecond:0}),e),decade:e=>{let t=(e=e.startOf("year")).year(),a=10*parseInt(t/10,10);return e=e.year(a)},century:e=>{let t=(e=e.startOf("year")).year(),a=100*parseInt(t/100,10);return e=e.year(a)}};Pe.date=Pe.day;const Ye=function(e,t,a,n=1){if(!t||!a)return[];if(t=x(t),a=e.clone().set(a),e.isAfter(a)){let t=e;e=a,a=t}if(e.diff(a,t)<n)return[];let r=e.clone();if(function(e){return!!ae().find((t=>t===e))||!!ne().find((t=>t===e))}(t))r=r.next(t),t="week";else{r.startOf(t).isBefore(e)&&(r=r.next(t))}let i=[];for(;r.isBefore(a);)i.push(r),r=r.add(n,t);return i},Be=e=>{let t=e.timezones,a=e.tz;if(!1===t.hasOwnProperty(a)&&(a=p(e.tz,t)),null===a)return!1===e.silent&&console.warn("Warn: could not find given or local timezone - '"+e.tz+"'"),{current:{epochShift:0}};let n=t[a],r={name:(o=a,o=(o=(o=(o=(o=(o=(o=o[0].toUpperCase()+o.substr(1)).replace(/[/_-]([a-z])/gi,(e=>e.toUpperCase()))).replace(/_(of|es)_/i,(e=>e.toLowerCase()))).replace(/\/gmt/i,"/GMT")).replace(/\/Dumontdurville$/i,"/DumontDUrville")).replace(/\/Mcmurdo$/i,"/McMurdo")).replace(/\/Port-au-prince$/i,"/Port-au-Prince")),hasDst:Boolean(n.dst),default_offset:n.offset,hemisphere:"s"===n.hem?"South":"North",current:{}};var o,s;if(r.hasDst){let e=(s=n.dst)?s.split("->"):[];r.change={start:e[0],back:e[1]}}let u=n.offset,d=u;return!0===r.hasDst&&(d="North"===r.hemisphere?u-1:n.offset+1),!1===r.hasDst?(r.current.offset=u,r.current.isDST=!1):!0===i(e.epoch,r.change.start,r.change.back,u,d)?(r.current.offset=u,r.current.isDST="North"===r.hemisphere):(r.current.offset=d,r.current.isDST="South"===r.hemisphere),r},He=["century","decade","year","month","date","day","hour","minute","second","millisecond"],Le={set:function(e,t){let a=this.clone();return a=X(a,e),t&&(this.tz=p(t)),a},timezone:function(){return Be(this)},isDST:function(){return Be(this).current.isDST},hasDST:function(){return Be(this).hasDst},offset:function(){return 60*Be(this).current.offset},hemisphere:function(){return Be(this).hemisphere},format:function(e){return le(this,e)},unixFmt:function(e){return((e,t)=>{let a=t.split("");return a=function(e){for(let t=0;t<e.length;t+=1)if("'"===e[t])for(let a=t+1;a<e.length;a+=1){if(e[a]&&(e[t]+=e[a]),"'"===e[a]){e[a]=null;break}e[a]=null}return e.filter((e=>e))}(a),a=function(e){for(let t=0;t<e.length;t+=1){let a=e[t];for(let n=t+1;n<e.length&&e[n]===a;n+=1)e[t]+=e[n],e[n]=null}return(e=e.filter((e=>e))).map((e=>("''"===e&&(e="'"),e)))}(a),a.reduce(((t,a)=>(void 0!==he[a]?t+=he[a](e)||"":(/^'.+'$/.test(a)&&(a=a.replace(/'/g,"")),t+=a),t)),"")})(this,e)},startOf:function(e){return((e,t)=>{let a=e.clone();return t=x(t),Pe[t]?Pe[t](a):"summer"===t||"winter"===t?(a=a.season(t),Pe.season(a)):a})(this,e)},endOf:function(e){return((e,t)=>{let a=e.clone();return t=x(t),Pe[t]?(a=Pe[t](a),a=a.add(1,t),a=a.subtract(1,"millisecond"),a):a})(this,e)},leapYear:function(){return g(this.year())},progress:function(e){return((e,t)=>{if(t)return t=x(t),fe(e,t);let a={};return ce.forEach((t=>{a[t]=fe(e,t)})),a})(this,e)},nearest:function(e){return((e,t)=>{let a=e.progress();return"quarterhour"===(t=x(t))&&(t="quarterHour"),void 0!==a[t]?(a[t]>.5&&(e=e.add(1,t)),e=e.startOf(t)):!1===e.silent&&console.warn("no known unit '"+t+"'"),e})(this,e)},diff:function(e,t){return ge(this,e,t)},since:function(e){return e||(e=this.clone().set()),Ae(this,e)},next:function(e){return this.add(1,e).startOf(e)},last:function(e){return this.subtract(1,e).startOf(e)},isValid:function(){return!(!this.epoch&&0!==this.epoch)&&!isNaN(this.d.getTime())},goto:function(e){let t=this.clone();return t.tz=p(e,t.timezones),t},every:function(e,t,a){if("object"==typeof e&&"string"==typeof t){let a=t;t=e,e=a}return Ye(this,e,t,a)},isAwake:function(){let e=this.hour();return!(e<8||e>22)},isAsleep:function(){return!this.isAwake()},daysInMonth:function(){switch(this.month()){case 0:case 2:case 4:case 6:case 7:case 9:case 11:return 31;case 1:return this.leapYear()?29:28;case 3:case 5:case 8:case 10:return 30;default:throw new Error("Invalid Month state.")}},log:function(){return console.log(""),console.log(le(this,"nice-short")),this},logYear:function(){return console.log(""),console.log(le(this,"full-short")),this},json:function(){return He.reduce(((e,t)=>(e[t]=this[t](),e)),{})},debug:function(){let e=this.timezone(),t=this.format("MM")+" "+this.format("date-ordinal")+" "+this.year();return t+="\n - "+this.format("time"),console.log("\n\n",t+"\n - "+e.name+" ("+e.current.offset+")"),this},from:function(e){return(e=this.clone().set(e)).since(this)},fromNow:function(){return this.clone().set(Date.now()).since(this)},weekStart:function(e){if("number"==typeof e)return this._weekStart=e,this;if("string"==typeof e){e=e.toLowerCase().trim();let t=ae().indexOf(e);-1===t&&(t=ne().indexOf(e)),-1===t&&(t=1),this._weekStart=t}else console.warn("Spacetime Error: Cannot understand .weekStart() input:",e);return this}};Le.inDST=Le.isDST,Le.round=Le.nearest,Le.each=Le.every;const Ie=e=>("string"==typeof e&&(e=parseInt(e,10)),e),We=["year","month","date","hour","minute","second","millisecond"],Fe=(e,t,a)=>{let n=We.indexOf(a),r=We.slice(n,We.length);for(let a=0;a<r.length;a++){let n=t[r[a]]();e[r[a]](n)}return e},Je=function(e,t,a,n){return!0===a&&e.isBefore(t)?e=e.add(1,n):!1===a&&e.isAfter(t)&&(e=e.minus(1,n)),e},Ue=function(e,t,a){t=Ie(t);let n=e.clone(),r=(e.minute()-t)*V.minute;return e.epoch-=r,Fe(e,n,"second"),(e=Je(e,n,a,"hour")).epoch},Ke=function(e,t,a){(t=Ie(t))>=24?t=24:t<0&&(t=0);let n=e.clone(),r=e.hour()-t,i=r*V.hour;return e.epoch-=i,e.date()!==n.date()&&(e=n.clone(),r>1&&(r-=1),r<1&&(r+=1),i=r*V.hour,e.epoch-=i),C(e,{hour:t}),Fe(e,n,"minute"),(e=Je(e,n,a,"day")).epoch},Qe=function(e,t){return"string"==typeof t&&/^'[0-9]{2}$/.test(t)&&(t=t.replace(/'/,"").trim(),t=(t=Number(t))>30?1900+t:2e3+t),t=Ie(t),C(e,{year:t}),e.epoch};let Re="am",Ge="pm";const Ze={millisecond:function(e){if(void 0!==e){let t=this.clone();return t.epoch=function(e,t){t=Ie(t);let a=e.millisecond()-t;return e.epoch-a}(t,e),t}return this.d.getMilliseconds()},second:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=function(e,t,a){t=Ie(t);let n=e.clone(),r=(e.second()-t)*V.second;return e.epoch=e.epoch-r,(e=Je(e,n,a,"minute")).epoch}(a,e,t),a}return this.d.getSeconds()},minute:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=Ue(a,e,t),a}return this.d.getMinutes()},hour:function(e,t){let a=this.d;if(void 0!==e){let a=this.clone();return a.epoch=Ke(a,e,t),a}return a.getHours()},hourFloat:function(e,t){if(void 0!==e){let a=this.clone(),n=e%1;n*=60;let r=parseInt(e,10);return a.epoch=Ke(a,r,t),a.epoch=Ue(a,n,t),a}let a=this.d,n=a.getHours(),r=a.getMinutes();return r/=60,n+r},hour12:function(e,t){let a=this.d;if(void 0!==e){let a=this.clone(),n=(e=""+e).match(/^([0-9]+)(am|pm)$/);if(n){let e=parseInt(n[1],10);"pm"===n[2]&&(e+=12),a.epoch=Ke(a,e,t)}return a}let n=a.getHours();return n>12&&(n-=12),0===n&&(n=12),n},time:function(e,t){if(void 0!==e){let a=this.clone();return e=e.toLowerCase().trim(),a.epoch=function(e,t,a){let n=t.match(/([0-9]{1,2})[:h]([0-9]{1,2})(:[0-9]{1,2})? ?(am|pm)?/);if(!n){if(n=t.match(/([0-9]{1,2}) ?(am|pm)/),!n)return e.epoch;n.splice(2,0,"0"),n.splice(3,0,"")}let r=!1,i=parseInt(n[1],10),o=parseInt(n[2],10);o>=60&&(o=59),i>12&&(r=!0),!1===r&&("am"===n[4]&&12===i&&(i=0),"pm"===n[4]&&i<12&&(i+=12)),n[3]=n[3]||"",n[3]=n[3].replace(/:/,"");let s=parseInt(n[3],10)||0,u=e.clone();return e=(e=(e=(e=e.hour(i)).minute(o)).second(s)).millisecond(0),(e=Je(e,u,a,"day")).epoch}(a,e,t),a}return`${this.h12()}:${k(this.minute())}${this.ampm()}`},ampm:function(e,t){let a=Re,n=this.hour();if(n>=12&&(a=Ge),"string"!=typeof e)return a;let r=this.clone();return e=e.toLowerCase().trim(),n>=12&&"am"===e?(n-=12,r.hour(n,t)):n<12&&"pm"===e?(n+=12,r.hour(n,t)):r},dayTime:function(e,t){if(void 0!==e){const a={morning:"7:00",breakfast:"7:00",noon:"12:00",lunch:"12:00",afternoon:"14:00",evening:"18:00",dinner:"18:00",night:"23:00",midnight:"00:00"};let n=this.clone();return e=(e=e||"").toLowerCase(),!0===a.hasOwnProperty(e)&&(n=n.time(a[e],t)),n}let a=this.hour();return a<6?"night":a<12?"morning":a<17?"afternoon":a<22?"evening":"night"},iso:function(e){return void 0!==e?this.set(e):this.format("iso")}},Xe={date:function(e,t){if(void 0!==e){let a=this.clone();return(e=parseInt(e,10))&&(a.epoch=function(e,t,a){if((t=Ie(t))>28){let a=e.month(),n=A[a];1===a&&29===t&&g(e.year())&&(n=29),t>n&&(t=n)}t<=0&&(t=1);let n=e.clone();return C(e,{date:t}),(e=Je(e,n,a,"month")).epoch}(a,e,t)),a}return this.d.getDate()},day:function(e,t){if(void 0===e)return this.d.getDay();let a=this.clone(),n=e;"string"==typeof e&&(e=e.toLowerCase(),re.hasOwnProperty(e)?n=re[e]:(n=ae().indexOf(e),-1===n&&(n=ne().indexOf(e))));let r=this.d.getDay()-n;!0===t&&r>0&&(r-=7),!1===t&&r<0&&(r+=7);let i=this.subtract(r,"days");return C(i,{hour:a.hour(),minute:a.minute(),second:a.second()}),i},dayName:function(e,t){if(void 0===e)return ne()[this.day()];let a=this.clone();return a=a.day(e,t),a}},et=e=>e=(e=(e=e.minute(0)).second(0)).millisecond(1),tt={dayOfYear:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=function(e,t,a){t=Ie(t);let n=e.clone();return(t-=1)<=0?t=0:t>=365&&(t=g(e.year())?365:364),e=(e=e.startOf("year")).add(t,"day"),Fe(e,n,"hour"),(e=Je(e,n,a,"year")).epoch}(a,e,t),a}let a,n=0,r=this.d.getMonth();for(let e=1;e<=r;e++)a=new Date,a.setDate(1),a.setFullYear(this.d.getFullYear()),a.setHours(1),a.setMinutes(1),a.setMonth(e),a.setHours(-2),n+=a.getDate();return n+this.d.getDate()},week:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=function(e,t,a){let n=e.clone();return t=Ie(t),"december"===(e=(e=(e=e.month(0)).date(1)).day("monday")).monthName()&&e.date()>=28&&(e=e.add(1,"week")),t-=1,e=e.add(t,"weeks"),(e=Je(e,n,a,"year")).epoch}(this,e,t),a=et(a),a}let a=this.clone();a=a.month(0),a=a.date(1),a=et(a),a=a.day("monday"),11===a.month()&&a.date()>=25&&(a=a.add(1,"week"));let n=1;1===a.date()&&(n=0),a=a.minus(2,"hours");const r=this.epoch;if(a.epoch>r)return 1;let i=0,o=4*this.month();for(a.epoch+=V.week*o,i+=o;i<=52;i++){if(a.epoch>r)return i+n;a=a.add(1,"week")}return 52},month:function(e,t){if(void 0!==e){let a=this.clone();return a.epoch=function(e,t,a){"string"==typeof t&&("sept"===t&&(t="sep"),t=Y()[t.toLowerCase()]),(t=Ie(t))>=12&&(t=11),t<=0&&(t=0);let n=e.date();n>A[t]&&(n=A[t]);let r=e.clone();return C(e,{month:t,d:n}),(e=Je(e,r,a,"year")).epoch}(a,e,t),a}return this.d.getMonth()},monthName:function(e,t){if(void 0!==e){let a=this.clone();return a=a.month(e,t),a}return E[this.month()]},quarter:function(e,t){if(void 0!==e&&("string"==typeof e&&(e=e.replace(/^q/i,""),e=parseInt(e,10)),Ee[e])){let a=this.clone(),n=Ee[e][0];return a=a.month(n,t),a=a.date(1,t),a=a.startOf("day"),a}let a=this.d.getMonth();for(let e=1;e<Ee.length;e++)if(a<Ee[e][0])return e-1;return 4},season:function(e,t){let a="north";if("South"===this.hemisphere()&&(a="south"),void 0!==e){let n=this.clone();for(let r=0;r<Ne[a].length;r++)e===Ne[a][r][0]&&(n=n.month(Ne[a][r][1],t),n=n.date(1),n=n.startOf("day"));return n}let n=this.d.getMonth();for(let e=0;e<Ne[a].length-1;e++)if(n>=Ne[a][e][1]&&n<Ne[a][e+1][1])return Ne[a][e][0];return"north"===a?"winter":"summer"},year:function(e){if(void 0!==e){let t=this.clone();return t.epoch=Qe(t,e),t}return this.d.getFullYear()},era:function(e){if(void 0!==e){let t=this.clone();e=e.toLowerCase();let a=t.d.getFullYear();return"bc"===e&&a>0&&(t.epoch=Qe(t,-1*a)),"ad"===e&&a<0&&(t.epoch=Qe(t,-1*a)),t}return this.d.getFullYear()<0?"BC":"AD"},decade:function(e){if(void 0!==e){if(!(e=(e=(e=String(e)).replace(/([0-9])'?s$/,"$1")).replace(/([0-9])(th|rd|st|nd)/,"$1")))return console.warn("Spacetime: Invalid decade input"),this;2===e.length&&/[0-9][0-9]/.test(e)&&(e="19"+e);let t=Number(e);return isNaN(t)?this:(t=10*Math.floor(t/10),this.year(t))}return this.startOf("decade").year()},century:function(e){if(void 0!==e){"string"==typeof e&&(e=(e=(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1")).replace(/([0-9]+) ?(b\.?c\.?|a\.?d\.?)/i,((e,t,a)=>(a.match(/b\.?c\.?/i)&&(t="-"+t),t)))).replace(/c$/,""));let t=Number(e);return isNaN(e)?(console.warn("Spacetime: Invalid century input"),this):(0===t&&(t=1),t=t>=0?100*(t-1):100*(t+1),this.year(t))}let t=this.startOf("century").year();return t=Math.floor(t/100),t<0?t-1:t+1},millenium:function(e){if(void 0!==e){if("string"==typeof e&&(e=e.replace(/([0-9])(th|rd|st|nd)/,"$1"),e=Number(e),isNaN(e)))return console.warn("Spacetime: Invalid millenium input"),this;e>0&&(e-=1);let t=1e3*e;return 0===t&&(t=1),this.year(t)}let t=Math.floor(this.year()/1e3);return t>=0&&(t+=1),t}},at=Object.assign({},Ze,Xe,tt);at.milliseconds=at.millisecond,at.seconds=at.second,at.minutes=at.minute,at.hours=at.hour,at.hour24=at.hour,at.h12=at.hour12,at.h24=at.hour24,at.days=at.day;const nt=function(e,t){return 1===e&&g(t)?29:A[e]},rt=(e,t)=>{if(e.month>0){let a=parseInt(e.month/12,10);e.year=t.year()+a,e.month=e.month%12}else if(e.month<0){let a=Math.abs(e.month),n=parseInt(a/12,10);a%12!=0&&(n+=1),e.year=t.year()-n,e.month=e.month%12,e.month=e.month+12,12===e.month&&(e.month=0)}return e},it=(e,t,a)=>{let n=t.year(),r=t.month(),i=nt(r,n);for(;a>i;)a-=i,r+=1,r>=12&&(r-=12,n+=1),i=nt(r,n);return e.month=r,e.date=a,e},ot=(e,t,a)=>{e.year=t.year(),e.month=t.month();let n=t.date();for(e.date=n-Math.abs(a);e.date<1;){e.month-=1,e.month<0&&(e.month=11,e.year-=1);let t=nt(e.month,e.year);e.date+=t}return e},st=["millisecond","second","minute","hour","date","month"];let ut={second:st.slice(0,1),minute:st.slice(0,2),quarterhour:st.slice(0,2),hour:st.slice(0,3),date:st.slice(0,4),month:st.slice(0,4),quarter:st.slice(0,4),season:st.slice(0,4),year:st,decade:st,century:st};ut.week=ut.hour,ut.season=ut.date,ut.quarter=ut.date;const dt={year:!0,quarter:!0,season:!0,month:!0,week:!0,date:!0},lt={month:!0,quarter:!0,season:!0,year:!0},ht={millisecond:e=>e.epoch,second:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute(),e.second()].join("-"),minute:e=>[e.year(),e.month(),e.date(),e.hour(),e.minute()].join("-"),hour:e=>[e.year(),e.month(),e.date(),e.hour()].join("-"),day:e=>[e.year(),e.month(),e.date()].join("-"),week:e=>[e.year(),e.week()].join("-"),month:e=>[e.year(),e.month()].join("-"),quarter:e=>[e.year(),e.quarter()].join("-"),year:e=>e.year()};ht.date=ht.day;let mt=u;const ct=function(e,t,a={}){this.epoch=null,this.tz=p(t,mt),this.silent=void 0===a.silent||a.silent,this.british=a.dmy||a.british,this._weekStart=1,void 0!==a.weekStart&&(this._weekStart=a.weekStart),this._today={},void 0!==a.today&&(this._today=a.today),Object.defineProperty(this,"d",{get:function(){let e=(e=>{let t=e.timezones[e.tz];if(void 0===t)return console.warn("Warning: couldn't find timezone "+e.tz),0;if(void 0===t.dst)return t.offset;let a=t.offset,n=t.offset+1;"n"===t.hem&&(n=a-1);let r=t.dst.split("->");return!0===i(e.epoch,r[0],r[1],a,n)?a:n})(this),t=(new Date(this.epoch).getTimezoneOffset()||0)+60*e;t=60*t*1e3;let a=this.epoch+t;return new Date(a)}}),Object.defineProperty(this,"timezones",{get:()=>mt,set:e=>(mt=e,e)});let n=X(this,e);this.epoch=n.epoch,n.tz&&(this.tz=n.tz)};var ft;Object.keys(Le).forEach((e=>{ct.prototype[e]=Le[e]})),ct.prototype.clone=function(){return new ct(this.epoch,this.tz,{silent:this.silent,weekStart:this._weekStart,today:this._today,parsers:this.parsers})},ct.prototype.toLocalDate=function(){return this.toNativeDate()},ct.prototype.toNativeDate=function(){return new Date(this.epoch)},ft=ct,Object.keys(at).forEach((e=>{ft.prototype[e]=at[e]})),(e=>{e.prototype.add=function(e,t){let a=this.clone();if(!t||0===e)return a;let n=this.clone();if("millisecond"===(t=x(t)))return a.epoch+=e,a;"fortnight"===t&&(e*=2,t="week"),V[t]?a.epoch+=V[t]*e:"week"===t||"weekend"===t?a.epoch+=V.day*(7*e):"quarter"===t||"season"===t?a.epoch+=V.month*(3*e):"quarterhour"===t&&(a.epoch+=15*V.minute*e);let r={};if(ut[t]&&ut[t].forEach((e=>{r[e]=n[e]()})),dt[t]){const e=n.timezone().current.offset-a.timezone().current.offset;a.epoch+=3600*e*1e3}if("month"===t&&(r.month=n.month()+e,r=rt(r,n)),"week"===t){let t=n.date()+7*e;t<=28&&t>1&&(r.date=t)}if("weekend"===t&&"saturday"!==a.dayName())a=a.day("saturday",!0);else if("date"===t){if(e<0)r=ot(r,n,e);else{let t=n.date()+e;r=it(r,n,t)}0!==e&&n.isSame(a,"day")&&(r.date=n.date()+e)}else if("quarter"===t){if(r.month=n.month()+3*e,r.year=n.year(),r.month<0){let e=Math.floor(r.month/12),t=r.month+12*Math.abs(e);r.month=t,r.year+=e}else if(r.month>=12){let e=Math.floor(r.month/12);r.month=r.month%12,r.year+=e}r.date=n.date()}else if("year"===t){let t=n.year()+e,r=a.year();if(r<t){let t=Math.floor(e/4)||1;a.epoch+=Math.abs(V.day*t)}else if(r>t){let t=Math.floor(e/4)||1;a.epoch+=V.day*t}}else"decade"===t?r.year=a.year()+10:"century"===t&&(r.year=a.year()+100);if(lt[t]){let e=A[r.month];r.date=n.date(),r.date>e&&(r.date=e)}return Object.keys(r).length>1&&C(a,r),a},e.prototype.subtract=function(e,t){return this.clone().add(-1*e,t)},e.prototype.minus=e.prototype.subtract,e.prototype.plus=e.prototype.add})(ct),(e=>{e.prototype.isSame=function(t,a,n=!0){let r=this;if(!a)return null;if("string"==typeof t&&"object"==typeof a){let e=t;t=a,a=e}return"string"!=typeof t&&"number"!=typeof t||(t=new e(t,this.timezone.name)),a=a.replace(/s$/,""),!0===n&&r.tz!==t.tz&&((t=t.clone()).tz=r.tz),ht[a]?ht[a](r)===ht[a](t):null}})(ct),(e=>{const t={isAfter:function(e){let t=O(e=M(e,this));return null===t?null:this.epoch>t},isBefore:function(e){let t=O(e=M(e,this));return null===t?null:this.epoch<t},isEqual:function(e){let t=O(e=M(e,this));return null===t?null:this.epoch===t},isBetween:function(e,t,a=!1){e=M(e,this),t=M(t,this);let n=O(e);if(null===n)return null;let r=O(t);return null===r?null:a?this.isBetween(e,t)||this.isEqual(e)||this.isEqual(t):n<this.epoch&&this.epoch<r}};Object.keys(t).forEach((a=>{e.prototype[a]=t[a]}))})(ct),(e=>{const t={i18n:function(e){var t,a,n;return b(e.days)&&(t=e.days,ee=t.short||ee,te=t.long||te),b(e.months)&&function(e){N=e.short||N,E=e.long||E}(e.months),n=e.useTitleCase,"[object Boolean]"===Object.prototype.toString.call(n)&&(a=e.useTitleCase,ie=a),b(e.ampm)&&function(e){Re=e.am||Re,Ge=e.pm||Ge}(e.ampm),b(e.distance)&&function(e){je=e.pastDistance||je,$e=e.futureDistance||$e,De=e.past||De,ve=e.future||ve,xe=e.present||xe,Oe=e.now||Oe,Me=e.almost||Me,_e=e.over||_e}(e.distance),b(e.units)&&function(e={}){be={second:e.second||be.second,seconds:e.seconds||be.seconds,minute:e.minute||be.minute,minutes:e.minutes||be.minutes,hour:e.hour||be.hour,hours:e.hours||be.hours,day:e.day||be.day,days:e.days||be.days,month:e.month||be.month,months:e.months||be.months,year:e.year||be.year,years:e.years||be.years}}(e.units),this}};Object.keys(t).forEach((a=>{e.prototype[a]=t[a]}))})(ct);const yt=(e,t,a)=>new ct(e,t,a),pt=function(e){let t=e._today||{};return Object.keys(t).forEach((a=>{e=e[a](t[a])})),e};yt.now=(e,t)=>{let a=new ct((new Date).getTime(),e,t);return a=pt(a),a},yt.today=(e,t)=>{let a=new ct((new Date).getTime(),e,t);return a=pt(a),a.startOf("day")},yt.tomorrow=(e,t)=>{let a=new ct((new Date).getTime(),e,t);return a=pt(a),a.add(1,"day").startOf("day")},yt.yesterday=(e,t)=>{let a=new ct((new Date).getTime(),e,t);return a=pt(a),a.subtract(1,"day").startOf("day")},yt.extend=function(e={}){return Object.keys(e).forEach((t=>{ct.prototype[t]=e[t]})),this},yt.timezones=function(){return(new ct).timezones},yt.max=function(e,t){let a=new ct(null,e,t);return a.epoch=864e13,a},yt.min=function(e,t){let a=new ct(null,e,t);return a.epoch=-864e13,a},yt.whereIts=(e,t)=>{let a=new ct(null),n=new ct(null);a=a.time(e),n=t?n.time(t):a.add(59,"minutes");let r=a.hour(),i=n.hour();return Object.keys(a.timezones).filter((e=>{if(-1===e.indexOf("/"))return!1;let t=new ct(null,e),o=t.hour();return o>=r&&o<=i&&(!(o===r&&t.minute()<a.minute())&&!(o===i&&t.minute()>n.minute()))}))},yt.version="7.7.0",yt.plugin=yt.extend;const gt={daybreak:"7:00am",breakfast:"8:00am",morning:"9:00am",noon:"12:00pm",midday:"12:00pm",afternoon:"2:00pm",lunchtime:"12:00pm",evening:"6:00pm",dinnertime:"6:00pm",night:"8:00pm",eod:"10:00pm",midnight:"12:00am",am:"9:00am",pm:"5:00pm","early day":"8:00am","late at night":"11:00pm"},wt={quarter:15,half:30},bt=function(e){let t=e.time("6:00am");return e.isBefore(t)?e.ampm("pm"):e},kt=function(e,t){let a=e.match("(at|by|for|before|this|after)? #Time+");a=a.not("^(at|by|for|before|this|after)"),a=a.not("sharp"),a=a.not("on the dot");let n=yt.now(t.timezone),r=n.clone(),i=a.not("in? the").text("reduced");if(i=i.replace(/^@/,""),gt.hasOwnProperty(i))return{result:gt[i],m:a};let o=a.match("^#Cardinal oclock (am|pm)?");if(o.found&&(n=n.hour(o.text("reduced")),n=n.startOf("hour"),n.isValid()&&!n.isEqual(r))){let e=o.match("(am|pm)");return n=e.found?n.ampm(e.text("reduced")):bt(n),{result:n.time(),m:o}}if(o=a.match("(half|quarter|25|20|15|10|5) (past|after|to) #Cardinal"),o.found&&(n=function(e,t){let a=e.match("#Cardinal$"),n=e.not(a).match("(half|quarter|25|20|15|10|5)");a=a.text("reduced");let r=n.text("reduced");wt.hasOwnProperty(r)&&(r=wt[r]);let i=e.has("to");return t=(t=t.hour(a)).startOf("hour"),a<6&&(t=t.ampm("pm")),i?t.subtract(r,"minutes"):t.add(r,"minutes")}(o,n),n.isValid()&&!n.isEqual(r)))return n=bt(n),{result:n.time(),m:o};if(o=a.match("[<min>(half|quarter|25|20|15|10|5)] (past|after)"),o.found){let e=o.groups("min").text("reduced"),a=yt(t.today);if(wt.hasOwnProperty(e)&&(e=wt[e]),a=a.next("hour").startOf("hour").minute(e),a.isValid()&&!a.isEqual(r))return{result:a.time(),m:o}}if(o=a.match("[<min>(half|quarter|25|20|15|10|5)] to"),o.found){let e=o.groups("min").text("reduced"),a=yt(t.today);if(wt.hasOwnProperty(e)&&(e=wt[e]),a=a.next("hour").startOf("hour").minus(e,"minutes"),a.isValid()&&!a.isEqual(r))return{result:a.time(),m:o}}if(o=a.match("[<time>#Time] (in|at) the? [<desc>(morning|evening|night|nighttime)]"),o.found){let e=o.groups("time").text("normal");if(/^[0-9]{1,2}$/.test(e)?(n=n.hour(e),n=n.startOf("hour")):n=n.time(e),n.isValid()&&!n.isEqual(r)){let e=o.groups("desc").text("reduced");return"evening"!==e&&"night"!==e||(n=n.ampm("pm")),{result:n.time(),m:o}}}if(o=a.match("this? [<desc>(morning|evening|tonight)] at [<time>(#Cardinal|#Time)]"),o.found){let e=o.groups(),t=e.time.text("reduced");if(/^[0-9]{1,2}$/.test(t)?(n=n.hour(t),n=n.startOf("hour")):n=n.time(t),n.isValid()&&!n.isEqual(r)){let t=e.desc.text("reduced");return"morning"===t&&(n=n.ampm("am")),"evening"!==t&&"tonight"!==t||(n=n.ampm("pm")),{result:n.time(),m:o}}}if(o=a.match("^#Cardinal$"),o.found){let e=o.text("reduced");if(n=n.hour(e),n=n.startOf("hour"),n.isValid()&&!n.isEqual(r))return!1===/(am|pm)/i.test(e)&&(n=bt(n)),{result:n.time(),m:o}}let s=a.text("reduced");return n=n.time(s),n.isValid()&&!n.isEqual(r)?(!1===/(am|pm)/i.test(s)&&(n=bt(n)),{result:n.time(),m:a}):t.dayStart?{result:t.dayStart,m:e.none()}:{result:null,m:e.none()}},Dt="America/",vt="Asia/",xt="Europe/",Ot="Africa/",Mt="Australia/",_t="Pacific/",jt={"british summer time":xt+"London",bst:xt+"London","british time":xt+"London","britain time":xt+"London","irish summer time":xt+"Dublin","irish time":xt+"Dublin",ireland:xt+"Dublin","central european time":xt+"Berlin",cet:xt+"Berlin","central european summer time":xt+"Berlin",cest:xt+"Berlin","central europe":xt+"Berlin","eastern european time":xt+"Riga",eet:xt+"Riga","eastern european summer time":xt+"Riga",eest:xt+"Riga","eastern europe time":xt+"Riga","western european time":xt+"Lisbon","western european summer time":xt+"Lisbon","western europe":xt+"Lisbon","turkey standard time":xt+"Istanbul",trt:xt+"Istanbul","turkish time":xt+"Istanbul",etc:Ot+"Freetown",utc:Ot+"Freetown","greenwich standard time":Ot+"Freetown",gmt:Ot+"Freetown","east africa time":Ot+"Nairobi","east african time":Ot+"Nairobi","eastern africa time":Ot+"Nairobi","central africa time":Ot+"Khartoum","central african time":Ot+"Khartoum","south africa standard time":Ot+"Johannesburg",sast:Ot+"Johannesburg","southern africa":Ot+"Johannesburg","south african":Ot+"Johannesburg","west africa standard time":Ot+"Lagos","western africa time":Ot+"Lagos","west african time":Ot+"Lagos","australian central standard time":Mt+"Adelaide",acst:Mt+"Adelaide","australian central daylight time":Mt+"Adelaide",acdt:Mt+"Adelaide","australia central":Mt+"Adelaide","australian eastern standard time":Mt+"Brisbane",aest:Mt+"Brisbane","australian eastern daylight time":Mt+"Brisbane",aedt:Mt+"Brisbane","australia east":Mt+"Brisbane","australian western standard time":Mt+"Perth",awst:Mt+"Perth","australian western daylight time":Mt+"Perth",awdt:Mt+"Perth","australia west":Mt+"Perth","australian central western standard time":Mt+"Eucla",acwst:Mt+"Eucla","australia central west":Mt+"Eucla","lord howe standard time":Mt+"Lord_Howe",lhst:Mt+"Lord_Howe","lord howe daylight time":Mt+"Lord_Howe",lhdt:Mt+"Lord_Howe","russian standard time":xt+"Moscow",msk:xt+"Moscow",russian:xt+"Moscow","central standard time":Dt+"Chicago","central time":Dt+"Chicago",cst:Dt+"Havana","central daylight time":Dt+"Chicago",cdt:Dt+"Havana","mountain standard time":Dt+"Denver","mountain time":Dt+"Denver",mst:Dt+"Denver","mountain daylight time":Dt+"Denver",mdt:Dt+"Denver","atlantic standard time":Dt+"Halifax","atlantic time":Dt+"Halifax",ast:vt+"Baghdad","atlantic daylight time":Dt+"Halifax",adt:Dt+"Halifax","eastern standard time":Dt+"New_York",eastern:Dt+"New_York","eastern time":Dt+"New_York",est:Dt+"New_York","eastern daylight time":Dt+"New_York",edt:Dt+"New_York","pacific time":Dt+"Los_Angeles","pacific standard time":Dt+"Los_Angeles",pst:Dt+"Los_Angeles","pacific daylight time":Dt+"Los_Angeles",pdt:Dt+"Los_Angeles","alaskan standard time":Dt+"Anchorage","alaskan time":Dt+"Anchorage",ahst:Dt+"Anchorage","alaskan daylight time":Dt+"Anchorage",ahdt:Dt+"Anchorage","hawaiian standard time":_t+"Honolulu","hawaiian time":_t+"Honolulu",hst:_t+"Honolulu","aleutian time":_t+"Honolulu","hawaii time":_t+"Honolulu","newfoundland standard time":Dt+"St_Johns","newfoundland time":Dt+"St_Johns",nst:Dt+"St_Johns","newfoundland daylight time":Dt+"St_Johns",ndt:Dt+"St_Johns","brazil time":Dt+"Sao_Paulo",brt:Dt+"Sao_Paulo","brasília":Dt+"Sao_Paulo",brasilia:Dt+"Sao_Paulo","brazilian time":Dt+"Sao_Paulo","argentina time":Dt+"Buenos_Aires","argentinian time":Dt+"Buenos_Aires","amazon time":Dt+"Manaus",amt:Dt+"Manaus","amazonian time":Dt+"Manaus","easter island standard time":"Chile/Easterisland",east:"Chile/Easterisland","easter island summer time":"Chile/Easterisland",easst:"Chile/Easterisland","venezuelan standard time":Dt+"Caracas","venezuelan time":Dt+"Caracas",vet:Dt+"Caracas","venezuela time":Dt+"Caracas","paraguay time":Dt+"Asuncion",pyt:Dt+"Asuncion","paraguay summer time":Dt+"Asuncion",pyst:Dt+"Asuncion","cuba standard time":Dt+"Havana","cuba time":Dt+"Havana","cuba daylight time":Dt+"Havana","cuban time":Dt+"Havana","bolivia time":Dt+"La_Paz","bolivian time":Dt+"La_Paz","colombia time":Dt+"Bogota",cot:Dt+"Bogota","colombian time":Dt+"Bogota","acre time":Dt+"Eirunepe","peru time":Dt+"Lima","chile standard time":Dt+"Punta_Arenas","chile time":Dt+"Punta_Arenas",clst:Dt+"Punta_Arenas","chile summer time":Dt+"Punta_Arenas",cldt:Dt+"Punta_Arenas","uruguay time":Dt+"Montevideo",uyt:Dt+"Montevideo",ist:vt+"Jerusalem","arabic standard time":vt+"Baghdad","arabic time":vt+"Baghdad","arab time":vt+"Baghdad","iran standard time":vt+"Tehran","iran time":vt+"Tehran",irst:vt+"Tehran","iran daylight time":vt+"Tehran",irdt:vt+"Tehran",iranian:vt+"Tehran","pakistan standard time":vt+"Karachi","pakistan time":vt+"Karachi",pkt:vt+"Karachi","india standard time":vt+"Kolkata","indian time":vt+"Kolkata","indochina time":vt+"Bangkok",ict:vt+"Bangkok","south east asia":vt+"Bangkok","china standard time":vt+"Shanghai",ct:vt+"Shanghai","chinese time":vt+"Shanghai","alma-ata time":vt+"Almaty",almt:vt+"Almaty","oral time":vt+"Oral","orat time":vt+"Oral","yakutsk time":vt+"Yakutsk",yakt:vt+"Yakutsk","gulf standard time":vt+"Dubai","gulf time":vt+"Dubai",gst:vt+"Dubai",uae:vt+"Dubai","hong kong time":vt+"Hong_Kong",hkt:vt+"Hong_Kong","western indonesian time":vt+"Jakarta",wib:vt+"Jakarta","indonesia time":vt+"Jakarta","central indonesian time":vt+"Makassar",wita:vt+"Makassar","israel daylight time":vt+"Jerusalem",idt:vt+"Jerusalem","israel standard time":vt+"Jerusalem","israel time":vt+"Jerusalem",israeli:vt+"Jerusalem","krasnoyarsk time":vt+"Krasnoyarsk",krat:vt+"Krasnoyarsk","malaysia time":vt+"Kuala_Lumpur",myt:vt+"Kuala_Lumpur","singapore time":vt+"Singapore",sgt:vt+"Singapore","korea standard time":vt+"Seoul","korea time":vt+"Seoul",kst:vt+"Seoul","korean time":vt+"Seoul","uzbekistan time":vt+"Samarkand",uzt:vt+"Samarkand","vladivostok time":vt+"Vladivostok",vlat:vt+"Vladivostok","maldives time":"Indian/Maldives",mvt:"Indian/Maldives","mauritius time":"Indian/Mauritius",mut:"Indian/Mauritius","marshall islands time":_t+"Kwajalein",mht:_t+"Kwajalein","samoa standard time":_t+"Midway",sst:_t+"Midway","somoan time":_t+"Midway","chamorro standard time":_t+"Guam",chst:_t+"Guam","papua new guinea time":_t+"Bougainville",pgt:_t+"Bougainville"};let $t=yt().timezones,zt=Object.keys($t).reduce(((e,t)=>(e[t]=t,e)),{});var Tt=Object.assign({},jt,zt);const Vt=/(-?[0-9]+)h(rs)?/i,St=/(-?[0-9]+)/,qt=/utc([-+]?[0-9]+)/i,Ct=/gmt([-+]?[0-9]+)/i,At=function(e){return(e=Number(e))>-13&&e<13?"Etc/GMT"+(e=((e*=-1)>0?"+":"")+e):null},Nt=function(e){let t=e.match("#Timezone+");t=t.not("(in|for|by|near|at)");let a=t.text("reduced");if(Tt.hasOwnProperty(a))return{result:Tt[a],m:t};let n=function(e){let t=e.match(Vt);if(null!==t)return At(t[1]);if(t=e.match(qt),null!==t)return At(t[1]);if(t=e.match(Ct),null!==t){let e=-1*Number(t[1]);return At(e)}return t=e.match(St),null!==t?At(t[1]):null}(a);return n?{result:n,m:t}:{result:null,m:e.none()}},Et=function(t,r){let i=function(t){let n={},r=t.none(),i=t.match("#DateShift+");if(!1===i.found)return{res:n,m:r};if(i.match("#Cardinal #Duration").forEach((t=>{let r=t.match("#Cardinal").numbers().get()[0];if(r&&"number"==typeof r){let i=a(t);!0===e[i]&&(n[i]=r)}})),!0===i.has("(before|ago|hence|back)$")&&Object.keys(n).forEach((e=>n[e]*=-1)),r=i.match("#Cardinal #Duration"),i=i.not(r),r=i.match("[<unit>#Duration] [<dir>(after|before)]"),r.found){let e=r.groups("unit").text("reduced"),t=r.groups("dir").text("reduced");"after"===t?n[e]=1:"before"===t&&(n[e]=-1)}if(r=i.match("half (a|an) [#Duration]",0),r.found){let e=a(r);n[e]=.5}if(r=i.match("a (few|couple) [#Duration]",0),r.found){let e=a(r);n[e]=r.has("few")?3:2}return r=t.match("#DateShift+"),{result:n,m:r}}(t),o=i.result;i=function(e){let t=e.match("[<num>#Value] [<unit>#Duration+] (of|in)");if(t.found){let e=t.groups(),a=e.num.numbers().get()[0],r=e.unit.text("reduced"),i={unit:r,num:Number(a)||0};return n[r]||(i.num-=1),{result:i,m:t}}if(t=e.match("[<dir>(first|initial|last|final)] [<unit>#Duration+] (of|in)"),t.found){let e=t.groups(),a=e.dir.text("reduced");return"initial"===a&&(a="first"),"final"===a&&(a="last"),{result:{unit:e.unit.text("reduced"),dir:a},m:t}}return{result:null,m:e.none()}}(t=t.not(i.m));let s=i.result;t=t.not(i.m),i=Nt(t);let u=i.result;t=t.not(i.m),i=kt(t,r);let d=i.result;i=function(e){let t=e.match("#WeekDay");return t.found&&!e.has("^#WeekDay$")?e.has("(this|next|last) (next|upcoming|coming|past)? #WeekDay")?{result:null,m:e.none()}:{result:t.text("reduced"),m:t}:{result:null,m:e.none()}}(t=t.not(i.m));let l=i.result;i=function(e){let t=e.match("[(start|beginning) of] .",0);return t.found?{result:"start",m:t}:(t=e.match("[end of] .",0),t.found?{result:"end",m:t}:(t=e.match("[(middle|midpoint|center) of] .",0),t.found?{result:"middle",m:t}:{result:null,m:t}))}(t=t.not(i.m));let h=i.result;return i=function(e){if(e.has("(next|last|this)$"))return{result:null,m:e.none()};let t=e.match("^this? (next|upcoming|coming)");return t.found?{result:"next",m:t}:(t=e.match("^this? (past)"),t.found?{result:"this-past",m:t}:(t=e.match("^this? (last|previous)"),t.found?{result:"last",m:t}:(t=e.match("^(this|current)"),t.found?{result:"this",m:t}:{result:null,m:e.none()})))}(t=t.not(i.m)),{shift:o,counter:s,tz:u,time:d,weekDay:l,section:h,rel:i.result,doc:t=function(e){return(e=(e=(e=(e=(e=(e=e.not("[^the] !#Value",0)).not("#Preposition$")).not("#Conjunction$")).not("sharp")).not("on the dot")).not("^(on|of)")).not("(next|last|this)$")}(t=t.not(i.m))}};class Unit{constructor(e,t,a){this.unit=t||"day",this.setTime=!1;let n={};(a=a||{}).today&&(n={date:a.today.date(),month:a.today.month(),year:a.today.year()}),e&&"sept"===e.month&&(e.month="sep");let r=yt(e,a.timezone,{today:n,dmy:a.dmy});Object.defineProperty(this,"d",{enumerable:!1,writable:!0,value:r}),Object.defineProperty(this,"context",{enumerable:!1,writable:!0,value:a})}clone(){let e=new Unit(this.d,this.unit,this.context);return e.setTime=this.setTime,e}log(){return console.log("--"),this.d.log(),console.log("\n"),this}applyShift(e={}){return Object.keys(e).forEach((t=>{this.d=this.d.add(e[t],t),"hour"!==t&&"minute"!==t||(this.setTime=!0)})),this}applyTime(e){if(e){if(/^[0-9]{1,2}$/.test(e)?this.d=this.d.hour(e):this.d=this.d.time(e),!/[ap]m/.test(e)){let e=this.d.time("6:00am");this.d.isBefore(e)&&(this.d=this.d.ampm("pm"));let t=this.d.time("10:00pm");this.d.isAfter(t)&&(this.d=this.d.ampm("am"))}}else this.d=this.d.startOf("day");return this.setTime=!0,this}applyWeekDay(e){if(e){let t=this.d.epoch;this.d=this.d.day(e),this.d.epoch<t&&(this.d=this.d.add(1,"week"))}return this}applyRel(e){return"next"===e?this.next():"last"===e||"this-past"===e?this.last():this}applySection(e){return"start"===e?this.start():"end"===e?this.end():"middle"===e?this.middle():this}format(e){return this.d.format(e)}start(){return this.d=this.d.startOf(this.unit),this.context.dayStart&&(this.d=this.d.time(this.context.dayStart)),this}end(){if(this.d=this.d.endOf(this.unit),this.context.dayEnd){this.d=this.d.startOf("day");let e=this.d.time(this.context.dayEnd);if(e.isAfter(this.d))return this.d=e,this}return this}middle(){let e=this.d.diff(this.d.endOf(this.unit)),t=Math.round(e.minutes/2);return this.d=this.d.add(t,"minutes"),this}beforeEnd(){let e=this.d.startOf(this.unit).diff(this.d.endOf(this.unit)),t=Math.round(e.minutes/4);return this.d=this.d.endOf(this.unit),this.d=this.d.minus(t,"minutes"),this.context.dayStart&&(this.d=this.d.time(this.context.dayStart)),this}before(){return this.d=this.d.minus(1,this.unit),this.d=this.d.endOf(this.unit),this.context.dayEnd&&(this.d=this.d.time(this.context.dayEnd)),this}after(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf(this.unit),this}next(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,this.unit),this.d=this.d.startOf(this.unit),this}}class Day extends Unit{constructor(e,t,a){super(e,t,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}middle(){return this.d=this.d.time("10am"),this}beforeEnd(){return this.d=this.d.time("2pm"),this}}class CalendarDate extends Day{constructor(e,t,a){super(e,t,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}next(){return this.d=this.d.add(1,"year"),this}last(){return this.d=this.d.minus(1,"year"),this}}class WeekDay extends Day{constructor(e,t,a){super(e,t,a),this.unit="day",this.isWeekDay=!0,"string"==typeof e?(this.d=yt(a.today,a.timezone),this.d=this.d.day(e),this.d.isBefore(a.today)&&(this.d=this.d.add(7,"days"))):this.d=e,this.weekDay=this.d.dayName(),this.d.isValid()&&(this.d=this.d.startOf("day"))}next(){return this.d=this.d.add(7,"days"),this.d=this.d.day(this.weekDay),this}last(){return this.d=this.d.minus(7,"days"),this.d=this.d.day(this.weekDay),this}before(){return this.d=this.d.minus(1,"day"),this.d=this.d.endOf("day"),this.context.dayEnd&&(this.d=this.d.time(this.context.dayEnd)),this}applyRel(e){if("next"===e){let e=this.context.today.endOf("week").add(1,"week");return this.next(),this.d.isAfter(e)&&this.last(),this}if("this-past"===e)return this.last();if("last"===e){let e=this.context.today.startOf("week");return this.last(),!1===this.d.isBefore(e)&&this.last(),this}return this}}class Holiday extends CalendarDate{constructor(e,t,a){super(e,t,a),this.unit="day",this.d.isValid()&&(this.d=this.d.startOf("day"))}}class Hour extends Unit{constructor(e,t,a){super(e,t,a,!0),this.unit="hour",this.d.isValid()&&(this.d=this.d.startOf("hour"))}}class Minute extends Unit{constructor(e,t,a){super(e,t,a,!0),this.unit="minute",this.d.isValid()&&(this.d=this.d.startOf("minute"))}}class Moment extends Unit{constructor(e,t,a){super(e,t,a,!0),this.unit="millisecond"}}class Month extends Unit{constructor(e,t,a){super(e,t,a),this.unit="month",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf("month"),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf("month"),this}middle(){return this.d=this.d.add(15,"days"),this.d=this.d.startOf("day"),this}}class AnyQuarter extends Unit{constructor(e,t,a){super(e,t,a),this.unit="quarter",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}last(){return this.d=this.d.minus(1,"quarter"),this.d=this.d.startOf(this.unit),this}}class Quarter extends Unit{constructor(e,t,a){super(e,t,a),this.unit="quarter",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf(this.unit),this}}class Season extends Unit{constructor(e,t,a){super(e,t,a),this.unit="season",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}next(){return this.d=this.d.add(1,"year"),this.d=this.d.startOf(this.unit),this}last(){return this.d=this.d.minus(1,"year"),this.d=this.d.startOf(this.unit),this}}class Year extends Unit{constructor(e,t,a){super(e,t,a),this.unit="year",this.d.isValid()&&(this.d=this.d.startOf("year"))}}class Week extends Unit{constructor(e,t,a){super(e,t,a),this.unit="week",this.d.isValid()&&(this.d=this.d.startOf("week"))}clone(){return new Week(this.d,this.unit,this.context)}middle(){return this.d=this.d.add(2,"days"),this}beforeEnd(){return this.d=this.d.day("friday"),this}}class WeekEnd extends Unit{constructor(e,t,a){super(e,t,a),this.unit="week",this.d.isValid()&&(this.d=this.d.day("saturday"),this.d=this.d.startOf("day"))}start(){return this.d=this.d.day("saturday").startOf("day"),this}next(){return this.d=this.d.add(1,this.unit),this.d=this.d.startOf("weekend"),this}last(){return this.d=this.d.minus(1,this.unit),this.d=this.d.startOf("weekend"),this}}const Pt={today:e=>new Day(e.today,null,e),yesterday:e=>new Day(e.today.minus(1,"day"),null,e),tomorrow:e=>new Day(e.today.plus(1,"day"),null,e),eom:e=>{let t=e.today.endOf("month");return t=t.startOf("day"),new Day(t,null,e)},eoy:e=>{let t=e.today.endOf("year");return t=t.startOf("day"),new Day(t,null,e)},now:e=>new Moment(e.today,null,e)};Pt.tommorrow=Pt.tomorrow,Pt.tmrw=Pt.tomorrow,Pt.anytime=Pt.today,Pt.sometime=Pt.today;const Yt="january",Bt="february",Ht="march",Lt="april",It="may",Wt="july",Ft="august",Jt="september",Ut="october",Kt="november",Qt="december";var Rt={"new years eve":[Qt,31],"new years":[Yt,1],"new years day":[Yt,1],"inauguration day":[Yt,20],"australia day":[Yt,26],"national freedom day":[Bt,1],"groundhog day":[Bt,2],"rosa parks day":[Bt,4],"valentines day":[Bt,14],"saint valentines day":[Bt,14],"st valentines day ":[Bt,14],"saint patricks day":[Ht,17],"st patricks day":[Ht,17],"april fools":[Lt,1],"april fools day":[Lt,1],"emancipation day":[Lt,16],"tax day":[Lt,15],"labour day":[It,1],"cinco de mayo":[It,5],"national nurses day":[It,6],"harvey milk day":[It,22],"victoria day":[It,24],juneteenth:["june",19],"canada day":[Wt,1],"independence day":[Wt,4],"independents day":[Wt,4],"bastille day":[Wt,14],"purple heart day":[Ft,7],"womens equality day":[Ft,26],"16 de septiembre":[Jt,16],"dieciseis de septiembre":[Jt,16],"grito de dolores":[Jt,16],halloween:[Ut,31],"all hallows eve":[Ut,31],"day of the dead":[Ut,31],"dia de muertos":[Ut,31],"veterans day":[Kt,11],"st andrews day":[Kt,30],"saint andrews day":[Kt,30],"all saints day":[Kt,1],"all sts day":[Kt,1],"armistice day":[Kt,11],"rememberance day":[Kt,11],"christmas eve":[Qt,24],christmas:[Qt,25],xmas:[Qt,25],"boxing day":[Qt,26],"st stephens day":[Qt,26],"saint stephens day":[Qt,26],epiphany:[Yt,6],"orthodox christmas day":[Yt,7],"orthodox new year":[Yt,14],"assumption of mary":[Ft,15],"all souls day":[Kt,2],"feast of the immaculate conception":[Qt,8],"feast of our lady of guadalupe":[Qt,12],kwanzaa:[Qt,26],imbolc:[Bt,2],beltaine:[It,1],lughnassadh:[Ft,1],samhain:[Ut,31]};var Gt=function(e,t,a,n){if(Rt.hasOwnProperty(e)||Rt.hasOwnProperty(t)){let r=Rt[e]||Rt[t]||[],i=yt.now(n);if(i=i.year(a),i=i.startOf("year"),i=i.month(r[0]),i=i.date(r[1]),i.isValid())return i}return null};const Zt="october",Xt="november",ea="monday",ta="sunday";let aa={"martin luther king day":[3,ea,"january"],"presidents day":[3,ea,"february"],"commonwealth day":[2,ea,"march"],"mothers day":[2,ta,"may"],"fathers day":[3,ta,"june"],"labor day":[1,ea,"september"],"columbus day":[2,ea,Zt],"canadian thanksgiving":[2,ea,Zt],thanksgiving:[4,"thursday",Xt],"black friday":[4,"friday",Xt]};aa["turday day"]=aa.thanksgiving,aa["indigenous peoples day"]=aa["columbus day"],aa["mlk day"]=aa["martin luther king day"];var na=aa;var ra=function(e,t,a,n){if(na.hasOwnProperty(e)||na.hasOwnProperty(t)){let r=na[e]||na[t]||[],i=yt.now(n);i=i.year(a),i=i.month(r[2]),i=i.startOf("month");let o=i.month();if(i=i.day(r[1]),i.month()!==o&&(i=i.add(1,"week")),r[0]>1&&(i=i.add(r[0]-1,"week")),i.isValid())return i}return null};let ia={easter:0,"ash wednesday":-46,"palm sunday":7,"maundy thursday":-3,"good friday":-2,"holy saturday":-1,"easter saturday":-1,"easter monday":1,"ascension day":39,"whit sunday":49,"whit monday":50,"trinity sunday":65,"corpus christi":60,"mardi gras":-47};ia["easter sunday"]=ia.easter,ia.pentecost=ia["whit sunday"],ia.whitsun=ia["whit sunday"];var oa=ia;var sa=function(e){let t=Math.floor,a=e%19,n=t(e/100),r=(n-t(n/4)-t((8*n+13)/25)+19*a+15)%30,i=r-t(r/28)*(1-t(29/(r+1))*t((21-a)/11)),o=i-(e+t(e/4)+i+2-n+t(n/4))%7,s=3+t((o+40)/44),u=o+28-31*t(s/4);return s=4===s?"April":"March",s+" "+u};var ua=function(e,t,a,n){if(oa.hasOwnProperty(e)||oa.hasOwnProperty(t)){let r=oa[e]||oa[t]||[],i=sa(a);if(!i)return null;let o=yt(i,n);o=o.year(a);let s=o.add(r,"day");if(s.isValid())return s}return null};const da={spring:[2003,2007,2044,2048,2052,2056,2060,2064,2068,2072,2076,2077,2080,2081,2084,2085,2088,2089,2092,2093,2096,2097],summer:[2021,2016,2020,2024,2028,2032,2036,2040,2041,2044,2045,2048,2049,2052,2053,2056,2057,2060,2061,2064,2065,2068,2069,2070,2072,2073,2074,2076,2077,2078,2080,2081,2082,2084,2085,2086,2088,2089,2090,2092,2093,2094,2096,2097,2098,2099],fall:[2002,2003,2004,2006,2007,2010,2011,2014,2015,2018,2019,2022,2023,2026,2027,2031,2035,2039,2043,2047,2051,2055,2059,2092,2096],winter:[2002,2003,2006,2007,2011,2015,2019,2023,2027,2031,2035,2039,2043,2080,2084,2088,2092,2096]},la=[2080,2084,2088,2092,2096];var ha=function(e){let t={spring:"March 20 "+e,summer:"June 21 "+e,fall:"Sept 22 "+e,winter:"Dec 21 "+e};return-1!==da.spring.indexOf(e)&&(t.spring="March 19 "+e),-1!==da.summer.indexOf(e)&&(t.summer="June 20 "+e),-1!==da.fall.indexOf(e)&&(t.fall="Sept 21 "+e),-1!==da.winter.indexOf(e)&&(t.winter="Dec 22 "+e),-1!==la.indexOf(e)&&(t.winter="Dec 20 "+e),t};let ma={"spring equinox":"spring","summer solistice":"summer","fall equinox":"fall","winter solstice":"winter"};ma["march equinox"]=ma["spring equinox"],ma["vernal equinox"]=ma["spring equinox"],ma.ostara=ma["spring equinox"],ma["june solstice"]=ma["summer solistice"],ma.litha=ma["summer solistice"],ma["autumn equinox"]=ma["fall equinox"],ma["autumnal equinox"]=ma["fall equinox"],ma["september equinox"]=ma["fall equinox"],ma["sept equinox"]=ma["fall equinox"],ma.mabon=ma["fall equinox"],ma["december solstice"]=ma["winter solistice"],ma["dec solstice"]=ma["winter solistice"],ma.yule=ma["winter solistice"];var ca=ma;var fa=function(e,t,a,n){if(ca.hasOwnProperty(e)||ca.hasOwnProperty(t)){let r=ca[e]||ca[t],i=ha(a);if(!r||!i||!i[r])return null;let o=yt(i[r],n);if(o.isValid())return o}return null};var ya={"isra and miraj":"april 13","lailat al-qadr":"june 10","eid al-fitr":"june 15","id al-Fitr":"june 15","eid ul-Fitr":"june 15",ramadan:"may 16","eid al-adha":"sep 22",muharram:"sep 12","prophets birthday":"nov 21"};var pa=function(e,t,a,n){if(ya.hasOwnProperty(e)||ya.hasOwnProperty(t)){let r=ya[e]||ya[t]||[];if(!r)return null;let i=yt(r+" 2018",n),o=-10.64*(a-2018);if(i=i.add(o,"day"),i=i.startOf("day"),i=i.year(a),i.isValid())return i}return null};const ga=yt.now().year(),wa=function(e,t,a){t=t||ga,e=e||"";let n=(e=(e=(e=String(e)).trim().toLowerCase()).replace(/'s/,"s")).replace(/ day$/,"");n=n.replace(/^the /,""),n=n.replace(/^orthodox /,"");let r=Gt(e,n,t,a);return null!==r?r:(r=ra(e,n,t,a),null!==r?r:(r=ua(e,n,t,a),null!==r?r:(r=fa(e,n,t,a),null!==r?r:(r=pa(e,n,t,a),null!==r?r:null))))},ba={day:Day,hour:Hour,evening:Hour,second:Moment,milliscond:Moment,instant:Moment,minute:Minute,week:Week,weekend:WeekEnd,month:class AnyMonth extends Unit{constructor(e,t,a){super(e,t,a),this.unit="month",this.d.isValid()&&(this.d=this.d.startOf(this.unit))}},quarter:AnyQuarter,year:Year,season:Season,yr:Year,qtr:AnyQuarter,wk:Week,sec:Moment,hr:Hour};let ka=`^(${Object.keys(ba).join("|")})$`;const Da=function(e){return{date:e.today.date(),month:e.today.month(),year:e.today.year()}},va=function(e,t,a){let n=null;return n=n||function(e,t,a){let n=null;!1===e.found&&(null!==a.time&&(n=new Moment(t.today,null,t)),a.shift&&Object.keys(a.shift).length>0&&(n=a.shift.hour||a.shift.minute?new Moment(t.today,null,t):new Day(t.today,null,t)));let r=e.text("reduced");return!0===Pt.hasOwnProperty(r)?Pt[r](t):"next"===r&&a.shift&&Object.keys(a.shift).length>0?Pt.tomorrow(t):n}(e,t,a),n=n||function(e,t){let a=null,n=e.match("[<holiday>#Holiday+] [<year>#Year?]"),r=t.today.year();n.groups("year").found&&(r=Number(n.groups("year").text("reduced"))||r);let i=n.groups("holiday").text("reduced"),o=wa(i,r,t.timezone);return null!==o&&(o.isBefore(t.today)&&r===t.today.year()&&(o=wa(i,r+1,t.timezone)),a=new Holiday(o,null,t)),a}(e,t),n=n||function(e,t){let a=e.match(ka);if(!0===a.found){let e=a.text("reduced");if(ba.hasOwnProperty(e)){let a=ba[e];return a?new a(null,e,t):null}}if(a=e.match("^#WeekDay$"),!0===a.found){let e=a.text("reduced");return new WeekDay(e,null,t)}return null}(e,t),n=n||function(e,t){let a=e.match("(spring|summer|winter|fall|autumn) [<year>#Year?]");if(a.found){let a=e.text("reduced"),n=yt(a,t.timezone,{today:Da(t)}),r=new Season(n,null,t);if(!0===r.d.isValid())return r}if(a=e.match("[<q>#FinancialQuarter] [<year>#Year?]"),a.found){let e=a.groups("q").text("reduced"),n=yt(e,t.timezone,{today:Da(t)});if(a.groups("year")){let e=Number(a.groups("year").text())||t.today.year();n=n.year(e)}let r=new Quarter(n,null,t);if(!0===r.d.isValid())return r}if(a=e.match("[<q>#Value] quarter (of|in)? [<year>#Year?]"),a.found){let e=a.groups("q").text("reduced"),n=yt(`q${e}`,t.timezone,{today:Da(t)});if(a.groups("year")){let e=Number(a.groups("year").text())||t.today.year();n=n.year(e)}let r=new Quarter(n,null,t);if(!0===r.d.isValid())return r}if(a=e.match("^#Year$"),a.found){let a=e.text("reduced"),n=yt(null,t.timezone,{today:Da(t)});n=n.year(a);let r=new Year(n,null,t);if(!0===r.d.isValid())return r}return null}(e,t),n=n||function(e,t){let a=t.today.year(),n=e.match("[<date>#Value] of? [<month>#Month] [<year>#Year]");if(n.found||(n=e.match("[<month>#Month] the? [<date>#Value] [<year>#Year]")),n.found){let e={month:n.groups("month").text("reduced"),date:n.groups("date").text("reduced"),year:n.groups("year").text()||a},r=new CalendarDate(e,null,t);if(!0===r.d.isValid())return r}if(n=e.match("[<month>#Month] of? [<year>#Year]"),n.found){let e={month:n.groups("month").text("reduced"),year:n.groups("year").text("reduced")||a},r=new Month(e,null,t);if(!0===r.d.isValid())return r}if(n=e.match("[<month>#Month] [<date>#Value+]? of? the? [<rel>(this|next|last|current)] year"),n.found){let e=n.groups("rel").text("reduced"),r=a;"next"===e?r+=1:"last"===e&&(r-=1);let i={month:n.groups("month").text("reduced"),date:n.groups("date").numbers(0).get()[0],year:r};if(void 0===i.date){i.date=1;let e=new Month(i,null,t);if(!0===e.d.isValid())return e}let o=new CalendarDate(i,null,t);if(!0===o.d.isValid())return o}if(n=e.match("^the? [<date>#Value+]? of? [<rel>(this|next|last|current)] month"),n.found){let e=t.today.month(),a=n.groups("rel").text("reduced");"next"===a?e+=1:"last"===a&&(e-=1);let r={month:e,date:n.groups("date").numbers(0).get()[0]},i=new CalendarDate(r,null,t);if(!0===i.d.isValid())return i}if(n=e.match("[<date>#Value] of? [<month>#Month]"),n.found||(n=e.match("[<month>#Month] the? [<date>#Value]")),n.found){let e={month:n.groups("month").text("reduced"),date:n.groups("date").text("reduced"),year:t.today.year()},a=new CalendarDate(e,null,t);if(a.d.month()<t.today.month()&&(e.year+=1,a=new CalendarDate(e,null,t)),!0===a.d.isValid())return a}if(e.has("#Month")){let a={month:e.match("#Month").text("reduced"),date:1,year:t.today.year()},n=new Month(a,null,t);if(n.d.month()<t.today.month()&&(a.year+=1,n=new Month(a,null,t)),!0===n.d.isValid())return n}if(n=e.match("#WeekDay [<date>#Value]"),n.found){let e={month:t.today.month(),date:n.groups("date").text("reduced"),year:t.today.year()},a=new CalendarDate(e,null,t);if(!0===a.d.isValid())return a}if(n=e.match("the [<date>#Value]"),n.found){let e={month:t.today.month(),date:n.groups("date").text("reduced"),year:t.today.year()},a=new CalendarDate(e,null,t);if(!0===a.d.isValid())return a.d.isBefore(t.today)&&(a.d=a.d.add(1,"month")),a}if(n=e.match("/[0-9]{4}-[0-9]{2}-[0-9]{2}t[0-9]{2}:/"),n.found){let a=e.text("reduced"),n=new Moment(a,null,t);if(!0===n.d.isValid())return n}let r=e.text("reduced");if(!r)return new Moment(t.today,null,t);let i=new Day(r,null,t);return!1===i.d.isValid()?null:i}(e,t),n},xa={day:Day,week:Week,weekend:WeekEnd,month:Month,quarter:Quarter,season:Season,hour:Hour,minute:Minute},Oa=function(e,t,a){if(!e&&a.weekDay&&(e=new WeekDay(a.weekDay,null,t),a.weekDay=null),!e)return null;if(a.shift){let t=a.shift;e.applyShift(t),t.hour||t.minute?e=new Moment(e.d,null,e.context):(t.week||t.day||t.month)&&(e=new Day(e.d,null,e.context))}return a.weekDay&&"day"!==e.unit&&(e.applyWeekDay(a.weekDay),e=new WeekDay(e.d,null,e.context)),a.rel&&e.applyRel(a.rel),a.section&&e.applySection(a.section),a.time&&e.applyTime(a.time),a.counter&&a.counter.unit&&(e=function(e,t={}){let a=xa[t.unit];if(!a)return e;let n=e.d;"first"===t.dir||0===t.num?(n=e.start().d,n=n.startOf(t.unit)):"last"===t.dir?(n=n.endOf(e.unit),n="weekend"===t.unit?n.day("saturday",!1):n.startOf(t.unit)):t.num&&("weekend"===t.unit&&(n=n.day("saturday",!0).add(1,"day")),n=n.add(t.num,t.unit));let r=new a(n,null,e.context);return!0===r.d.isValid()?r:e}(e,a.counter)),e},Ma="undefined"!=typeof process&&process.env?process.env:self.env||{},_a=function(e,t){let a=Et(e,t);if(e=a.doc,(e=>{Ma.DEBUG_DATE&&(console.log(`\n==== '${e.doc.text()}' =====`),Object.keys(e).forEach((t=>{"doc"!==t&&e[t]&&console.log(t,e[t])})),e.doc.debug())})(a),a.tz){let e=(t=Object.assign({},t,{timezone:a.tz})).today.format("iso-short");t.today=t.today.goto(t.timezone).set(e)}let n=va(e,t,a);return n=Oa(n,t,a),n},ja={mon:"monday",tue:"tuesday",tues:"wednesday",wed:"wednesday",thu:"thursday",fri:"friday",sat:"saturday",sun:"sunday",monday:"monday",tuesday:"tuesday",wednesday:"wednesday",thursday:"thursday",friday:"friday",saturday:"saturday",sunday:"sunday"},$a=function(e){return e.match("(every|each)").found?"AND":e.match("(any|a)").found?"OR":null},za=function(e){let t=e.start,a=e.end;if(t.d.isAfter(a.d)){if(t.isWeekDay&&a.isWeekDay)return e.end.next(),e;let n=t;e.start=a,e.end=n}return e},Ta=function(e){let t=e.start,a=e.end;return t.d.isAfter(a.d)&&a.d.hour()<10&&(a.d=a.d.ampm("pm")),e};var Va=[{match:"[<from>#Time+] (to|until|upto|through|thru|and) [<to>#Time+ #Date+]",desc:"3pm to 4pm january 5th",parse:(e,t)=>{let a=e.groups("from"),n=e.groups("to"),r=_a(n,t);if(r){let e=r.clone();if(e.applyTime(a.text("implicit")),e){let t={start:e,end:r,unit:"time"};return!1===/(am|pm)/.test(n)&&(t=Ta(t)),t=za(t),t}}return null}},{match:"[<main>#Date+] from [<a>#Time] (to|until|upto|through|thru|and) [<b>#Time+]",desc:"january from 3pm to 4pm",parse:(e,t)=>{let a=e.groups("main"),n=e.groups("a"),r=e.groups("b");if(a=_a(a,t),a){a.applyTime(n.text("implicit"));let e=a.clone();if(e.applyTime(r.text("implicit")),e){let t={start:a,end:e,unit:"time"};return!1===/(am|pm)/.test(r.text())&&(t=Ta(t)),t=za(t),t}}return null}},{match:"[<from>#Date+] (to|until|upto|through|thru|and) [<to>#Time+]",desc:"january from 3pm to 4pm",parse:(e,t)=>{let a=e.groups("from"),n=e.groups("to");if(a=_a(a,t),a){let e=a.clone();if(e.applyTime(n.text("implicit")),e){let t={start:a,end:e,unit:"time"};return!1===/(am|pm)/.test(n.text())&&(t=Ta(t)),t=za(t),t}}return null}}],Sa=[{match:"^during? #Month+ (or|and) #Month [<year>#Year]?",desc:"march or june",parse:(e,t)=>{let a=e.match("^during? [#Month]",0);e=e.not("(or|and)");let n=_a(a,t);if(n){let r=[{start:n,end:n.clone().end(),unit:n.unit}],i=e.not(a);i.found&&i.match("#Month").forEach((e=>{let a=_a(e,t);r.push({start:a,end:a.clone().end(),unit:a.unit})}));let o=e.match("#Year$");return o.found&&(o=o.text("reduced"),r.forEach((e=>{e.start.d=e.start.d.year(o),e.end.d=e.end.d.year(o)}))),r}return null}},{match:"^#Month #Value+ (or|and)? #Value$",desc:"jan 5 or 8",parse:(e,t)=>{let a=(e=e.not("(or|and)")).match("^#Month #Value"),n=_a(a,t);if(n){let t=[{start:n,end:n.clone().end(),unit:n.unit}],r=e.not(a);return r.found&&r.match("#Value").forEach((e=>{let a=n.clone();a.d=a.d.date(e.text("reduced")),t.push({start:a,end:a.clone().end(),unit:a.unit})})),t}return null}},{match:"^#Month+ #Value #Value+$",desc:"jan 5 8",parse:(e,t)=>{let a=e.match("#Month"),n=e.match("#Year");e=e.not("#Year");let r=[];return e.match("#Value").forEach((e=>{let i=(e=e.clone()).prepend(a.text());n.found&&i.append(n);let o=_a(i,t);o&&r.push({start:o,end:o.clone().end(),unit:o.unit})})),r}},{match:"^#Value+ (or|and)? #Value of #Month #Year?$",desc:"5 or 8 of Jan",parse:(e,t)=>{let a=e.match("#Month"),n=e.match("#Year");e=e.not("#Year");let r=[];return e.match("#Value").forEach((e=>{let i=e.append(a);n.found&&i.append(n);let o=_a(i,t);o&&r.push({start:o,end:o.clone().end(),unit:o.unit})})),r}},{match:"^!(between|from|during)? [<from>#Date+] (and|or) [<to>#Date+]$",desc:"A or B",parse:(e,t)=>{let a=e.groups("from"),n=e.groups("to"),r=_a(a,t),i=_a(n,t);return r&&i?[{start:r,end:r.clone().end()},{start:i,end:i.clone().end()}]:null}}],qa=[{match:"between [<start>#Month] and [<end>#Month] [<year>#Year?]",desc:"between march and jan",parse:(e,t)=>{let{start:a,end:n,year:r}=e.groups(),i=r&&r.found?Number(r.text("reduced")):t.today.year(),o={month:a.text("reduced"),year:i},s=new Month(o,null,t).start();o={month:n.text("reduced"),year:i};let u=new Month(o,null,t).start();return s.d.isAfter(u.d)?{start:u,end:s}:{start:s,end:u}}},{match:"between [<start>.+] and [<end>.+]",desc:"between friday and sunday",parse:(e,t)=>{let a=e.groups("start");a=_a(a,t);let n=e.groups("end");return n=_a(n,t),a&&n?(n=n.before(),{start:a,end:n}):null}},{match:"[<from>#Month #Value] (to|through|thru) [<to>#Month #Value] [<year>#Year?]",desc:"june 5 to june 7",parse:(e,t)=>{let a=e.groups(),n=a.from;if(a.year&&(n=n.append(a.year)),n=_a(n,t),n){let e=a.to;if(a.year&&(e=e.append(a.year)),e=_a(e,t),e){return n.d.isAfter(e.d)&&(e.d=e.d.add(1,"year")),{start:n,end:e.end()}}}return null}},{match:"[<month>#Month] [<from>#Value] (to|through|thru) [<to>#Value] of? [<year>#Year]",desc:"january 5 to 7 1998",parse:(e,t)=>{let{month:a,from:n,to:r,year:i}=e.groups(),o=i.clone(),s=n.prepend(a).append(i);if(s=_a(s,t),s){let e=r.prepend(a).append(o);return e=_a(e,t),{start:s,end:e.end()}}return null}},{match:"[<from>#Value] (to|through|thru) [<to>#Value of? #Month #Date+?]",desc:"5 to 7 of january 1998",parse:(e,t)=>{let a=e.groups("to");if(a=_a(a,t),a){let t=e.groups("from"),n=a.clone();return n.d=n.d.date(t.text("implicit")),{start:n,end:a.end()}}return null}},{match:"[<from>#Month #Value] (to|through|thru) [<to>#Value]",desc:"january 5 to 7",parse:(e,t)=>{let a=e.groups("from");if(a=_a(a,t),a){let t=e.groups("to"),n=a.clone();return n.d=n.d.date(t.text("implicit")),{start:a,end:n.end()}}return null}},{match:"from? [<from>#Month] (to|until|upto|through|thru) [<to>#Month] [<year>#Year]",desc:"january to may 2020",parse:(e,t)=>{let a=e.groups("from"),n=e.groups("year").numbers().get()[0],r=e.groups("to");if(a=_a(a,t),r=_a(r,t),a.d=a.d.year(n),r.d=r.d.year(n),a&&r){let e={start:a,end:r.end()};return e=za(e),e}return null}},{match:"^in [<min>#Value] to [<max>#Value] [<unit>(days|weeks|months|years)]",desc:"in 2 to 4 weeks",parse:(e,t)=>{const{min:a,max:n,unit:r}=e.groups();let i=new CalendarDate(t.today,null,t),o=i.clone();const s=r.text("implicit");return i=i.applyShift({[s]:a.numbers().get()[0]}),o=o.applyShift({[s]:n.numbers().get()[0]}),{start:i,end:o.end()}}},{match:"[<min>#Value] to [<max>#Value] [<unit>(days|weeks|months|years)] (ago|before|earlier|prior)",desc:"2 to 4 weeks ago",parse:(e,t)=>{const{min:a,max:n,unit:r}=e.groups();let i=new CalendarDate(t.today,null,t),o=i.clone();const s=r.text("implicit");return i=i.applyShift({[s]:-n.numbers().get()[0]}),o=o.applyShift({[s]:-a.numbers().get()[0]}),{start:i,end:o.end()}}},{match:"^until [<to>#Date+]",desc:"until christmas",parse:(e,t)=>{let a=e.groups("to");if(a=_a(a,t),a){return{start:new CalendarDate(t.today,null,t),end:a.start()}}return null}},{match:"[<part>(1st|initial|2nd|latter)] half of [<month>#Month] [<year>#Year?]",desc:"second half of march",parse:(e,t)=>{const{part:a,month:n,year:r}=e.groups();let i={month:n.text("reduced"),date:1,year:r&&r.found?r.text("reduced"):t.today.year()},o=new Month(i,null,t);return a.has("(1st|initial)")?{start:o.start(),end:o.clone().middle()}:{start:o.middle(),end:o.clone().end()}}}];const Ca=function(e,t){return e=e.applyShift(t.punt)};const Aa=[].concat(Va,Sa,qa,[{match:"from? [<from>.+] (to|until|upto|through|thru) [<to>.+]",desc:"from A to B",parse:(e,t)=>{let a=e.groups("from"),n=e.groups("to");if(a=_a(a,t),n=_a(n,t),a&&n){let e={start:a,end:n.end()};return e=za(e),e}return null}},{match:"^due? (by|before) [.+]",desc:"before june",parse:(e,t)=>{e=e.group(0);let a=_a(e,t);if(a){let e=new Unit(t.today,null,t);return e.d.isAfter(a.d)&&(e=a.clone().applyShift({weeks:-2})),{start:e,end:a.clone().applyShift({day:-1}).end()}}return null}},{match:"^(on|in|at|@|during) [.+]",desc:"in june",parse:(e,t)=>{e=e.group(0);let a=_a(e,t);return a?{start:a,end:a.clone().end(),unit:a.unit}:null}},{match:"^(after|following) [.+]",desc:"after june",parse:(e,t)=>{e=e.group(0);let a=_a(e,t);return a?(a=a.after(),{start:a.clone(),end:Ca(a.clone(),t)}):null}},{match:"^(middle|center|midpoint) of [.+]",desc:"middle of",parse:(e,t)=>{e=e.group(0);let a=_a(e,t),n=a.clone().middle(),r=a.beforeEnd();return a?{start:n,end:r}:null}},{match:".+ after #Time+$",desc:"tuesday after 5pm",parse:(e,t)=>{let a=_a(e,t);if(a){return{start:a.clone(),end:a.end(),unit:"time"}}return null}},{match:".+ before #Time+$",desc:"tuesday before noon",parse:(e,t)=>{let a=_a(e,t);if(a){let e=a.clone(),t=a.start();if(a)return{start:t,end:e,unit:"time"}}return null}}]),Na="undefined"!=typeof process&&process.env?process.env:self.env||{},Ea=function(e,t){let a={start:null,end:null};if(!e.found)return a;let n=_a(e,t);if(n){let e=n.clone().end();a={start:n,end:e,unit:n.setTime?"time":n.unit}}return a},Pa=function(e,t){let a=function(e,t){let a=e.match("[<logic>(every|any|each)] [<skip>other?] [<unit>#Duration] (starting|beginning|commencing)?");if(a.found){let t={interval:{}},n=a.groups("unit").text("reduced");return t.interval[n]=1,t.choose=$a(a),a.groups("skip").found&&(t.interval[n]=2),e=e.remove(a),{repeat:t}}if(a=e.match("[<logic>(every|any|each)] [<num>#Value] [<unit>#Duration] (starting|beginning|commencing)?"),a.found){let t={interval:{}},n=a.groups("unit");n.nouns().toSingular();let r=n.text("reduced");return t.interval[r]=a.groups("num").numbers().get()[0],t.choose=$a(a),e=e.remove(a),{repeat:t}}if(a=e.match("[<logic>(every|any|each|a)] [<skip>other?] [<day>#WeekDay+] (starting|beginning|commencing)?"),a.found){let t={interval:{day:1},filter:{weekDays:{}}},n=a.groups("day").text("reduced");if(n=ja[n],n)return t.filter.weekDays[n]=!0,t.choose=$a(a),e=e.remove(a),{repeat:t}}if(a=e.match("[<logic>(every|any|each|a)] [<day>(weekday|week day|weekend|weekend day)] (starting|beginning|commencing)?"),a.found){let t={interval:{day:1},filter:{weekDays:{}}},n=a.groups("day");return n.has("(weekday|week day)")?t.filter.weekDays={monday:!0,tuesday:!0,wednesday:!0,thursday:!0,friday:!0}:n.has("(weekend|weekend day)")&&(t.filter.weekDays={saturday:!0,sunday:!0}),t.choose=$a(a),e=e.remove(a),{repeat:t}}if(a=e.match("[<day>(mondays|tuesdays|wednesdays|thursdays|fridays|saturdays|sundays)] (at|near|after)? [<time>#Time+?]"),a.found){let n={interval:{day:1},filter:{weekDays:{}}},r=a.groups("day").text("reduced");if(r=r.replace(/s$/,""),r=ja[r],r){n.filter.weekDays[r]=!0,n.choose="OR",e=e.remove(a);let i=a.groups("time");return i.found&&(n.time=kt(i,t)),{repeat:n}}}return null}(e,t)||{},n=function(e,t){for(let r=0;r<Aa.length;r+=1){let i=Aa[r],o=e.match(i.match);if(o.found){n=` ---[${i.desc}]---`,Na.DEBUG_DATE&&console.log(`\n  ${n} `);let e=i.parse(o,t);if(null!==e)return a=e,"[object Array]"!==Object.prototype.toString.call(a)&&(e=[e]),e}}var a,n;return null}(e,t);return n||(n=[Ea(e,t)]),n=n.map((e=>Object.assign({},a,e))),n.forEach((e=>{e.start&&e.end&&e.start.d.epoch>e.end.d.epoch&&(e.start=e.start.start())})),n},Ya=function(e,t){return!1===(t=t||{}).timezone&&(t.timezone="UTC"),t.today=t.today||yt.now(t.timezone),t.today=yt(t.today,t.timezone),e=function(e){return e.numbers||console.warn("\nCompromise warning: compromise/three must be used with compromise-dates plugin\n"),(e=e.clone()).numbers().toNumber(),e.contractions().expand(),e.replace("week end","weekend",!0).tag("Date"),e.replace("up to","upto",!0).tag("Date"),!1===e.has("once (a|an) #Duration")&&e.match("[(a|an)] #Duration",0).replaceWith("1",{tags:!0}).compute("lexicon"),e.match("@hasDash").insertAfter("to").tag("Date"),e}(e),Pa(e,t)},Ba=function(e){if(!e.start)return{start:null,end:null,timezone:null,duration:{}};let t=e.end?function(e){let t=e.end.d.add(1,"millisecond").since(e.start.d).diff;return delete t.milliseconds,delete t.seconds,t}(e):{};return{start:e.start.format("iso"),end:e.end?e.end.format("iso"):null,timezone:e.start.d.format("timezone"),duration:t}},Ha=function(e,t){let a=e.fromText(t),n=Ya(a,e.opts)[0];return n&&n.start&&n.start.d?n.start.d:null},La=function(e,t={}){e=function(e){let t=(e=e.clone()).match("#Time+").match("[<hour>#Cardinal] [<min>(thirty|fifteen)]");if(t.found){let e=t.groups("hour"),a=t.groups("min"),n=e.values().get()[0];if(n>0&&n<=12){let e=`${n}:${a.values().get()[0]}`;t.replaceWith(e)}}if(e.numbers){let t=e.numbers();t.toNumber(),t.toCardinal(!1)}else console.warn("Warning: compromise .numbers() not loaded.\n This plugin requires >= v14");return e.contractions&&e.contractions().expand(),e.adverbs().remove(),e.replace("week end","weekend",!0).tag("Date"),e.replace("up to","upto",!0).tag("Date"),!1===e.has("once (a|an) #Duration")&&e.match("[(a|an)] #Duration",0).replaceWith("1").compute("lexicon"),e.match("@hasDash").insertAfter("to").tag("Date"),e}(e);let a=kt(e,t);if(!a.result)return{time:null,"24h":null};let n=yt.now().time(a.result);return{time:a.result,"24h":n.format("time-24"),hour:n.hour(),minute:n.minute()}},Ia=(e,t)=>"number"==typeof t?e.eq(t):e,Wa={century:!0,day:!0,decade:!0,hour:!0,millisecond:!0,minute:!0,month:!0,second:!0,weekend:!0,week:!0,year:!0,quarter:!0,season:!0};let Fa={m:"minute",h:"hour",hr:"hour",min:"minute",sec:"second","week end":"weekend",wk:"week",yr:"year",qtr:"quarter"};Object.keys(Fa).forEach((e=>{Fa[e+"s"]=Fa[e]}));const Ja=function(e){let t={},a=e.match("#Value+ #Duration");if(a.found)a.forEach((e=>{let a=e.numbers().get()[0],n=e.terms().last().text("reduced");n=n.replace(/ies$/,"y"),n=n.replace(/s$/,""),Fa.hasOwnProperty(n)&&(n=Fa[n]),Wa.hasOwnProperty(n)&&null!==a&&(t[n]=a)}));else{if(e.match("(#Duration && /[0-9][a-z]+$/)").found){let a=e.text(),n=a.match(/([0-9]+)/),r=a.match(/([a-z]+)/);n&&r&&(n=n[0]||null,r=r[0]||null,Fa.hasOwnProperty(r)&&(r=Fa[r]),Wa.hasOwnProperty(r)&&null!==n&&(t[r]=Number(n)))}}return t},Ua="(start|end|middle|starting|ending|midpoint|beginning)",Ka=(e,t)=>{!0===e.found&&e.forEach((e=>{let a=e.text("reduced"),n=parseInt(a,10);n&&n>1e3&&n<3e3&&e.tag("Year",t)}))},Qa=(e,t)=>{!0===e.found&&e.forEach((e=>{let a=e.text("reduced"),n=parseInt(a,10);n&&n>1900&&n<2030&&e.tag("Year",t)}))},Ra=function(e,t){if(e.found){e.tag("Date",t),e.numbers().lessThan(31).ifNo("#Year").tag("#Time",t)}},Ga=["act","aft","akst","anat","art","azot","azt","bnt","bot","bt","cast","cat","cct","chast","chut","ckt","cvt","cxt","davt","eat","ect","fjt","fkst","fnt","gamt","get","gft","gilt","gyt","hast","hncu","hneg","hnnomx","hnog","hnpm","hnpmx","hntn","hovt","iot","irkt","jst","kgt","kost","lint","magt","mart","mawt","mmt","nct","nft","novt","npt","nrt","nut","nzst","omst","pet","pett","phot","phst","pont","pwt","ret","sakt","samt","sbt","sct","sret","srt","syot","taht","tft","tjt","tkt","tlt","tmt","tot","tvt","ulat","vut","wakt","wat","wet","wft","wit","wst","yekt"].reduce(((e,t)=>(e[t]=!0,e)),{}),Za="(in|by|before|during|on|until|after|of|within|all)",Xa="(last|next|this|previous|current|upcoming|coming)",en="(start|end|middle|starting|ending|midpoint|beginning|mid)",tn="(spring|summer|winter|fall|autumn)",an="(yesterday|today|tomorrow)";let nn=[{match:"in the (night|evening|morning|afternoon|day|daytime)",tag:"Time",reason:"in-the-night"},{match:"(#Value|#Time) (am|pm)",tag:"Time",reason:"value-ampm"},{match:"(tue|thu)",tag:"WeekDay",reason:"misc-weekday"},{match:"#Month #Date+",tag:"Date",reason:"correction-numberRange"},{match:"#Value of #Month",tag:"Date",unTag:"Time",reason:"value-of-month"},{match:"#Cardinal #Month",tag:"Date",reason:"cardinal-month"},{match:"#Month #Value (and|or|to)? #Value+",tag:"Date",reason:"value-to-value"},{match:"#Month the #Value",tag:"Date",reason:"month-the-value"},{match:"[(march|may)] to? #Date",group:0,tag:"Month",reason:"march-to"},{match:"^(march|may)$",tag:"Month",reason:"single-march"},{match:"#Month or #Month",tag:"Date",reason:"month-or-month"},{match:"(#WeekDay|#Month) #Value",ifNo:"#Money",tag:"Date",reason:"date-value"},{match:"#Value (#WeekDay|#Month)",ifNo:"#Money",tag:"Date",reason:"value-date"},{match:"#Value (#WeekDay|#Duration) back",tag:"#Date",reason:"3-back"},{match:"for #Value #Duration",tag:"Date",reason:"for-x-duration"},{match:"#Value #Duration (before|ago|hence|back)",tag:"Date",reason:"val-duration-past"},{match:`${Za}? #Value #Duration`,tag:"Date",reason:"value-duration"},{match:"in? #Value to #Value #Duration time?",tag:"Date",reason:"6-to-8-years"},{match:"#Value #Duration old",unTag:"Date",reason:"val-years-old"},{match:`${Za}? ${Xa} ${tn}`,tag:"Date",reason:"thisNext-season"},{match:`the? ${en} of ${tn}`,tag:"Date",reason:"section-season"},{match:`${tn} ${Za}? #Cardinal`,tag:"Date",reason:"season-year"},{match:"#Date the? #Ordinal",tag:"Date",reason:"correction"},{match:`${Xa} #Date`,tag:"Date",reason:"thisNext-date"},{match:"due? (by|before|after|until) #Date",tag:"Date",reason:"by"},{match:"(last|next|this|previous|current|upcoming|coming|the) #Date",tag:"Date",reason:"next-feb"},{match:`#Preposition? the? ${en} of #Date`,tag:"Date",reason:"section-of"},{match:"#Ordinal #Duration in #Date",tag:"Date",reason:"duration-in"},{match:"(early|late) (at|in)? the? #Date",tag:"Time",reason:"early-evening"},{match:"#Date [(by|before|after|at|@|about) #Cardinal]",group:0,tag:"Time",reason:"date-before-Cardinal"},{match:"#Date (#Preposition|to) #Date",ifNo:"#Duration",tag:"Date",reason:"date-prep-date"},{match:"(by|before|after|at|@|about) #Time",tag:"Time",reason:"preposition-time"},{match:"(in|after) /^[0-9]+(min|sec|wk)s?/",tag:"Date",reason:"shift-units"},{match:"#Date [(now|night|sometime)]",group:0,tag:"Time",reason:"date-now"},{match:"(from|starting|until|by) now",tag:"Date",reason:"for-now"},{match:"(each|every) night",tag:"Date",reason:"for-now"},{match:"#Date [(am|pm)]",group:0,tag:"Time",reason:"date-am"},{match:`[${en}] #Date`,group:0,tag:"Date",reason:"mid-sept"},{match:"#Month #Value to #Value of? #Year?",tag:"Date",reason:"june 5 to 7th"},{match:"#Value to #Value of? #Month #Year?",tag:"Date",reason:"5 to 7th june"},{match:"#Value #Duration of #Date",tag:"Date",reason:"third week of may"},{match:"#Value+ #Duration (after|before|into|later|afterwards|ago)?",tag:"Date",reason:"two days after"},{match:"#Value #Date",tag:"Date",reason:"two days"},{match:"#Date #Value",tag:"Date",reason:"june 5th"},{match:"#Date #Preposition #Value",tag:"Date",reason:"tuesday at 5"},{match:"#Date (after|before|during|on|in) #Value",tag:"Date",reason:"tomorrow before 3"},{match:"#Value (year|month|week|day) and a half",tag:"Date",reason:"a year and a half"},{match:"#Value and a half (years|months|weeks|days)",tag:"Date",reason:"5 and a half years"},{match:"on the #Ordinal",tag:"Date",reason:"on the fifth"},{match:"#Month #Value+ (and|or) #Value",tag:"Date",reason:"date-or-date"},{match:"#Value+ (and|or) #Value of #Month ",tag:"Date",reason:"date-and-date"},{match:"(spring|summer|winter|fall|autumn|springtime|wintertime|summertime)",tag:"Season",reason:"date-tag1"},{match:"(q1|q2|q3|q4)",tag:"FinancialQuarter",reason:"date-tag2"},{match:"(this|next|last|current) quarter",tag:"FinancialQuarter",reason:"date-tag3"},{match:"(this|next|last|current) season",tag:"Season",reason:"date-tag4"},{match:"#Date #Preposition #Date",tag:"Date",reason:"friday to sunday"},{match:"(once|twice) (a|an|each) #Date",tag:"Date",reason:"once a day"},{match:"a #Duration",tag:"Date",reason:"a year"},{match:"(between|from) #Date",tag:"Date",reason:"between x and y"},{match:"(to|until|upto) #Date",tag:"Date",reason:"between x and y2"},{match:"between #Date+ and #Date+",tag:"Date",reason:"between x and y3"},{match:"#Month and #Month #Year",tag:"Date",reason:"x and y4"},{match:"the? #Date after next one?",tag:"Date",reason:"day after next"},{match:"(about|approx|approximately|around) #Date",tag:"Date",reason:"approximately june"},{match:"(by|until|on|in|at|during|over|every|each|due) the? #Date",ifNo:"#PhrasalVerb",tag:"Date",reason:"until june"},{match:"(by|until|after|before|during|on|in|following|since) (next|this|last)? #Date",ifNo:"#PhrasalVerb",tag:"Date",reason:"until last june"},{match:"this? (last|next|past|this|previous|current|upcoming|coming|the) #Date",tag:"Date",reason:"next september"},{match:"(starting|beginning|ending) #Date",tag:"Date",reason:"starting this june"},{match:"the? (start|end|middle|beginning) of (last|next|this|the) #Date",tag:"Date",reason:"start of june"},{match:"(the|this) #Date",tag:"Date",reason:"this coming june"},{match:"#Date up to #Date",tag:"Date",reason:"january up to june"},{match:"#Cardinal oclock",tag:"Time",reason:"2 oclock"},{match:"#Value (in|at) the? (morning|evening|night|nighttime)",tag:"Time",reason:"3 in the morning"},{match:"(5|10|15|20|five|ten|fifteen|quarter|twenty|half) (after|past) #Cardinal",tag:"Time",reason:"ten to seven"},{match:"(at|by|before) (5|10|15|20|five|ten|fifteen|twenty|quarter|half) (after|past|to)",tag:"Time",reason:"at-20-past"},{match:"#Date [at #Cardinal]",group:0,ifNo:"#Year",tag:"Time",reason:" tuesday at 4"},{match:"half an (hour|minute|second)",tag:"Date",reason:"half an hour"},{match:"(in|for|by|near|at) #Timezone",tag:"Date",reason:"in eastern time"},{match:"#Time to #Time",tag:"Date",reason:"3pm to 4pm"},{match:"#Time [(sharp|on the dot)]",group:0,tag:"Time",reason:"4pm sharp"},{match:"(at|around|near|#Date) [#Cardinal (thirty|fifteen) (am|pm)?]",group:0,tag:"Time",reason:"around four thirty"},{match:"#Cardinal (thirty|fifteen) (am|pm)",tag:"Time",reason:"four thirty am"},{match:"[#Cardinal (thirty|fifteen)] #Date",group:0,tag:"Time",reason:"four thirty tomorrow"},{match:"(anytime|sometime) (before|after|near) [#Cardinal]",group:0,tag:"Time",reason:"antime-after-3"},{match:"(#Cardinal|a|an) #Duration (before|after|ago|from|hence|back)",tag:"DateShift",reason:"nine weeks frow now"},{match:"in (around|about|maybe|perhaps)? #Cardinal #Duration",tag:"DateShift",reason:"in two weeks"},{match:"in (a|an) #Duration",tag:"DateShift",reason:"in a week"},{match:"[(a|an) #Duration from] #Date",group:0,tag:"DateShift",reason:"an hour from now"},{match:"(a|an) #Duration ago",tag:"DateShift",reason:"a month ago"},{match:"in half (a|an) #Duration",tag:"DateShift",reason:"in half an hour"},{match:"in a (few|couple) of? #Duration",tag:"DateShift",reason:"in a few weeks"},{match:"[#Duration (after|before)] #Date",group:0,tag:"DateShift",reason:"day after tomorrow"},{match:"#Month #Ordinal and #Ordinal",tag:"Date",reason:"ord-and-ord"},{match:"every other #Duration",tag:"Date",reason:"every-other"},{match:"(every|any|each|a) (day|weekday|week day|weekend|weekend day)",tag:"Date",reason:"any-weekday"},{match:"(every|any|each|a) (#WeekDay)",tag:"Date",reason:"any-wednesday"},{match:"(every|any|each|a) (#Duration)",tag:"Date",reason:"any-week"},{match:"[(wed|sat)] (#Month|#Year|on|between|during|from)",group:0,tag:"WeekDay",reason:"wed"},{match:"^day$",unTag:"Date",reason:"spa-day"},{match:"(in|of|by|for)? (#Possessive && #Date)",unTag:"Date",reason:"tomorrows meeting"},{match:`${an} [#Value]$`,unTag:"Date",group:0,reason:"yesterday-7"},{match:`^[#Value] ${an}$`,group:0,unTag:"Date",reason:"7 yesterday"},{match:"on #Cardinal$",unTag:"Date",reason:"on 5"},{match:"[this] tomorrow",group:0,unTag:"Date",reason:"this-tomorrow"},{match:"(q1|q2|q3|q4) #Year",tag:"Date",reason:"q2 2016"},{match:"^[#Value] (this|next|last)",group:0,unTag:"Date",reason:"4 next"},{match:"(last|this|next) #Duration [#Value]",group:0,unTag:"Date",reason:"this month 7"},{match:"[!#Month] #Value (last|this|next) #Date",group:0,unTag:"Date",reason:"7 this month"},{match:"(in|over) the #Duration #Date+?",unTag:"Date",reason:"over-the-duration"},{match:"#Ordinal quarter of? #Year",unTag:"Fraction"},{match:"(from|by|before) now",unTag:"Time",tag:"Date"},{match:"#Value of? (this|next|last) #Date",tag:"Date"},{match:"(first|initial|second|latter) half of #Month",tag:"Date"}],rn=null;const on=function(e){let{world:t}=e;rn=rn||t.methods.one.buildNet(nn,t),e.sweep(rn)};var sn={dates:function(e){return e.cache(),on(e),on(e),function(e){e.match("(march|april|may) (and|to|or|through|until)? (march|april|may)").tag("Date").match("(march|april|may)").tag("Month","march|april|may");let t=e.if("#Cardinal");if(!0===t.found){let e=t.match("#Date #Value [#Cardinal]",0);Ka(e,"date-value-year"),e=t.match("#Date [#Cardinal]",0),Qa(e,"date-year"),e=t.match(`${Ua} of [#Cardinal]`),Qa(e,"section-year"),e=t.match("#Month #Value [#Cardinal]",0),Ka(e,"month-value-year"),e=t.match("#Month #Value to #Value [#Cardinal]",0),Ka(e,"month-range-year"),e=t.match("(in|of|by|during|before|starting|ending|for|year|since) [#Cardinal]",0),Ka(e,"in-year-1"),e=t.match("(q1|q2|q3|q4) [#Cardinal]",0),Ka(e,"in-year-2"),e=t.match("#Ordinal quarter of? [#Cardinal]",0),Ka(e,"in-year-3"),e=t.match("the year [#Cardinal]",0),Ka(e,"in-year-4"),e=t.match("it (is|was) [#Cardinal]",0),Qa(e,"in-year-5"),t.match(`${Ua} of #Year`).tag("Date");let a=t.match("between [#Cardinal] and [#Cardinal]");Ka(a.groups("0"),"between-year-and-year-1"),Ka(a.groups("1"),"between-year-and-year-2")}let a=e.match("^/^20[012][0-9]$/$");Qa(a,"2020-ish")}(e),function(e){let t=e.if("#Date");if(t.found){let a=t.if("#NumberRange");if(a.found){let e=a.match("[#NumberRange+] (on|by|at)? #WeekDay",0);Ra(e,"3-4-tuesday"),e=a.match("[#NumberRange+] (on|by|at)? #Month #Value",0),Ra(e,"3-4 mar 3"),e=a.match("[#NumberRange] to (#NumberRange && #Time)",0),Ra(e,"3-4pm"),e=a.match("(#NumberRange && #Time) to [#NumberRange]",0),Ra(e,"3pm-4")}let n=t.match("(from|between) #Cardinal and #Cardinal (in|on)? (#WeekDay|tomorrow|yesterday)");Ra(n,"from 9-5 tues"),n=e.match("#Cardinal to #Cardinal (#WeekDay|tomorrow|yesterday)"),Ra(n,"9-5 tues"),n=t.match("(from|between) [#NumericValue] (to|and) #Time",0).tag("Time","4-to-5pm"),Ra(n,"from 9-5pm"),n=t.match("(#WeekDay|tomorrow|yesterday) (from|between)? (#Cardinal|#Time) (and|to) (#Cardinal|#Time)"),Ra(n,"tues 3-5"),n=t.match("#Month #Value+ (from|between) [<time>(#Cardinal|#Time) (and|to) (#Cardinal|#Time)]").group("time"),Ra(n,"sep 4 from 9-5"),n=t.match("#Time to #Cardinal on? #Date"),Ra(n,"3pm-4 wed"),n=t.match("#Cardinal to #Time on? #Date"),Ra(n,"3-4pm wed"),n=t.match("#Cardinal to #Cardinal on? (#WeekDay|#Month #Value)"),Ra(n,"3-4 wed")}}(e),function(e){let t=e.match("#Time [#Acronym]",0);if(t.found){let e=t.text("reduced");!0===Ga[e]&&t.tag("Timezone","tz-abbr")}}(e),function(e){if(e.has("#Date")){let t=e.match("#Date+ by #Date+");t.found&&!t.has("^due")&&t.match("^#Date+").unTag("Date","by-monday");let a=e.match("#Date+");a.has("^between")&&!a.has("and .")&&a.unTag("Date","fix-tagger"),a.has("(minutes|seconds|weeks|hours|days|months)")&&!a.has("#Value #Duration")&&a.match("(minutes|seconds|weeks|hours|days|months)").unTag("Date","log-hours"),a.has("about #Holiday")&&a.match("about").unTag("#Date","about-thanksgiving"),a.match("#Date+").match("^the").unTag("Date")}}(e),e.uncache(),e.match("#Cardinal #Duration and? #DateShift").tag("DateShift","three days before"),e.match("#DateShift and #Cardinal #Duration").tag("DateShift","three days and two weeks"),e.match("#Time [(sharp|on the dot)]").tag("Time","4pm sharp"),e}};const un="America/",dn="Asia/",ln="Europe/",hn="Africa/",mn="Australia/",cn="Pacific/",fn={"british summer time":ln+"London",bst:ln+"London","british time":ln+"London","britain time":ln+"London","irish summer time":ln+"Dublin","irish time":ln+"Dublin","central european time":ln+"Berlin",cet:ln+"Berlin","central european summer time":ln+"Berlin",cest:ln+"Berlin","central europe":ln+"Berlin","eastern european time":ln+"Riga",eet:ln+"Riga","eastern european summer time":ln+"Riga",eest:ln+"Riga","eastern europe time":ln+"Riga","western european time":ln+"Lisbon","western european summer time":ln+"Lisbon","turkey standard time":ln+"Istanbul","turkish time":ln+"Istanbul",utc:hn+"Freetown","greenwich standard time":hn+"Freetown",gmt:hn+"Freetown","east africa time":hn+"Nairobi","east african time":hn+"Nairobi","eastern africa time":hn+"Nairobi","central africa time":hn+"Khartoum","central african time":hn+"Khartoum","south africa standard time":hn+"Johannesburg","west africa standard time":hn+"Lagos","western africa time":hn+"Lagos","west african time":hn+"Lagos","australian central standard time":mn+"Adelaide",acst:mn+"Adelaide","australian central daylight time":mn+"Adelaide",acdt:mn+"Adelaide","australian eastern standard time":mn+"Brisbane",aest:mn+"Brisbane","australian eastern daylight time":mn+"Brisbane",aedt:mn+"Brisbane","australian western standard time":mn+"Perth",awst:mn+"Perth","australian western daylight time":mn+"Perth",awdt:mn+"Perth","australian central western standard time":mn+"Eucla",acwst:mn+"Eucla","lord howe standard time":mn+"Lord_Howe",lhst:mn+"Lord_Howe","lord howe daylight time":mn+"Lord_Howe",lhdt:mn+"Lord_Howe","russian standard time":ln+"Moscow",msk:ln+"Moscow","central standard time":un+"Chicago","central time":un+"Chicago",cst:un+"Havana","central daylight time":un+"Chicago",cdt:un+"Havana","mountain standard time":un+"Denver","mountain time":un+"Denver",mst:un+"Denver","mountain daylight time":un+"Denver",mdt:un+"Denver","atlantic standard time":un+"Halifax","atlantic time":un+"Halifax",ast:dn+"Baghdad","atlantic daylight time":un+"Halifax",adt:un+"Halifax","eastern standard time":un+"New_York","eastern time":un+"New_York",est:un+"New_York","eastern daylight time":un+"New_York",edt:un+"New_York","pacific time":un+"Los_Angeles","pacific standard time":un+"Los_Angeles",pst:un+"Los_Angeles","pacific daylight time":un+"Los_Angeles",pdt:un+"Los_Angeles","alaskan standard time":un+"Anchorage","alaskan time":un+"Anchorage",ahst:un+"Anchorage","alaskan daylight time":un+"Anchorage",ahdt:un+"Anchorage","hawaiian standard time":cn+"Honolulu","hawaiian time":cn+"Honolulu",hst:cn+"Honolulu","aleutian time":cn+"Honolulu","hawaii time":cn+"Honolulu","newfoundland standard time":un+"St_Johns","newfoundland time":un+"St_Johns","newfoundland daylight time":un+"St_Johns","brazil time":un+"Sao_Paulo","brazilian time":un+"Sao_Paulo","argentina time":un+"Buenos_Aires","argentinian time":un+"Buenos_Aires","amazon time":un+"Manaus","amazonian time":un+"Manaus","easter island standard time":"Chile/Easterisland","easter island summer time":"Chile/Easterisland",easst:"Chile/Easterisland","venezuelan standard time":un+"Caracas","venezuelan time":un+"Caracas","venezuela time":un+"Caracas","paraguay time":un+"Asuncion","paraguay summer time":un+"Asuncion","cuba standard time":un+"Havana","cuba time":un+"Havana","cuba daylight time":un+"Havana","cuban time":un+"Havana","bolivia time":un+"La_Paz","bolivian time":un+"La_Paz","colombia time":un+"Bogota","colombian time":un+"Bogota","acre time":un+"Eirunepe","peru time":un+"Lima","chile standard time":un+"Punta_Arenas","chile time":un+"Punta_Arenas",clst:un+"Punta_Arenas","chile summer time":un+"Punta_Arenas",cldt:un+"Punta_Arenas","uruguay time":un+"Montevideo",uyt:un+"Montevideo","arabic standard time":dn+"Baghdad","iran standard time":dn+"Tehran","iran time":dn+"Tehran","iran daylight time":dn+"Tehran","pakistan standard time":dn+"Karachi","pakistan time":dn+"Karachi","india standard time":dn+"Kolkata","indian time":dn+"Kolkata","indochina time":dn+"Bangkok","china standard time":dn+"Shanghai","alma-ata time":dn+"Almaty","oral time":dn+"Oral","orat time":dn+"Oral","yakutsk time":dn+"Yakutsk",yakt:dn+"Yakutsk","gulf standard time":dn+"Dubai","gulf time":dn+"Dubai","hong kong time":dn+"Hong_Kong","western indonesian time":dn+"Jakarta","indonesia time":dn+"Jakarta","central indonesian time":dn+"Makassar","israel daylight time":dn+"Jerusalem","israel standard time":dn+"Jerusalem","israel time":dn+"Jerusalem","krasnoyarsk time":dn+"Krasnoyarsk","malaysia time":dn+"Kuala_Lumpur","singapore time":dn+"Singapore","korea standard time":dn+"Seoul","korea time":dn+"Seoul",kst:dn+"Seoul","korean time":dn+"Seoul","uzbekistan time":dn+"Samarkand","vladivostok time":dn+"Vladivostok","maldives time":"Indian/Maldives","mauritius time":"Indian/Mauritius","marshall islands time":cn+"Kwajalein","samoa standard time":cn+"Midway","somoan time":cn+"Midway","chamorro standard time":cn+"Guam","papua new guinea time":cn+"Bougainville"};let yn=yt().timezones,pn=Object.keys(yn).reduce(((e,t)=>(e[t]=t,e)),{});var gn=Object.assign({},fn,pn);let wn={"a couple":"Value",thur:"WeekDay",thurs:"WeekDay"};const bn=function(e,t){e.forEach((e=>{wn[e]=t}))};bn(Object.keys(gn),"Timezone"),bn(["weekday","summer","winter","autumn","all day","eod","eom","eoy","standard time","daylight time","tommorrow"],"Date"),bn(["centuries","century","day","days","decade","decades","hour","hours","hr","hrs","millisecond","milliseconds","minute","minutes","min","mins","month","months","seconds","sec","secs","week end","week ends","weekend","weekends","week","weeks","wk","wks","year","years","yr","yrs","quarter","qtr","qtrs","season","seasons"],"Duration"),bn(["all hallows eve","all saints day","all sts day","april fools","armistice day","australia day","bastille day","boxing day","canada day","christmas eve","christmas","cinco de mayo","day of the dead","dia de muertos","dieciseis de septiembre","emancipation day","grito de dolores","groundhog day","halloween","harvey milk day","inauguration day","independence day","independents day","juneteenth","labour day","national freedom day","national nurses day","new years eve","new years","purple heart day","rememberance day","rosa parks day","saint andrews day","saint patricks day","saint stephens day","saint valentines day","st andrews day","st patricks day","st stephens day","st valentines day ","valentines day","valentines","veterans day","victoria day","womens equality day","xmas","epiphany","orthodox christmas day","orthodox new year","assumption of mary","all souls day","feast of the immaculate conception","feast of our lady of guadalupe","kwanzaa","imbolc","beltaine","lughnassadh","samhain","martin luther king day","mlk day","presidents day","mardi gras","tax day","commonwealth day","mothers day","memorial day","fathers day","columbus day","indigenous peoples day","canadian thanksgiving","election day","thanksgiving","t-day","turkey day","black friday","cyber monday","ash wednesday","palm sunday","maundy thursday","good friday","holy saturday","easter","easter sunday","easter monday","orthodox good friday","orthodox holy saturday","orthodox easter","orthodox easter monday","ascension day","pentecost","whitsunday","whit sunday","whit monday","trinity sunday","corpus christi","advent","tu bishvat","tu bshevat","purim","passover","yom hashoah","lag baomer","shavuot","tisha bav","rosh hashana","yom kippur","sukkot","shmini atzeret","simchat torah","chanukah","hanukkah","isra and miraj","lailat al-qadr","eid al-fitr","id al-Fitr","eid ul-Fitr","ramadan","eid al-adha","muharram","the prophets birthday","ostara","march equinox","vernal equinox","litha","june solistice","summer solistice","mabon","september equinox","fall equinox","autumnal equinox","yule","december solstice","winter solstice","chinese new year","diwali"],"Holiday"),bn(["noon","midnight","morning","tonight","evening","afternoon","breakfast time","lunchtime","dinnertime","midday","eod","oclock","oclock","at night"],"Time");var kn=[[/^[0-9]+(min|sec|hr|d)s?$/i,"Duration","30min"],[/^[0-9]{4}-[0-9]{2}$/,"Date","2012-06"],[/^[0-9]{2}h[0-9]{2}$/i,"Time","13h30"],[/^@[0-9]+:[0-9]{2}$/,"Time","@5:30"],[/^@[1-9]+(am|pm)$/,"Time","@5pm"],[/^(?:0[1-9]|[12]\d|3[01])\/(?:0[1-9]|[12]\d|3[01])$/,"Date","03/02"]];const Dn=e=>e?yt(e).format("{nice-day} {year}"):"-",vn="",xn=e=>""+e+vn,On=e=>""+e+vn,Mn=e=>""+e+vn,_n=function(e){e.dates().forEach((e=>{let t=e.dates().get()[0];console.log("\n────────"),e.debug("highlight");let a="";t&&t.start&&(a=" "+xn(Dn(t.start))),t&&t.end&&(a+=Mn(" → ")+On(Dn(t.end))),console.log(a+"\n")}))};var jn={tags:{FinancialQuarter:{is:"Date",not:["Fraction"]},Season:{is:"Date"},Year:{is:"Date",not:["RomanNumeral"]},Holiday:{is:"Date",also:"Noun"},DateShift:{is:"Date",not:["Timezone","Holiday"]}},words:wn,compute:sn,api:function(e){!function(e){class Dates extends e{constructor(e,t,a,n={}){super(e,t,a),this.viewType="Dates",this.opts=Object.assign({},n)}get(e){let t=[];return this.forEach((e=>{Ya(e,this.opts).forEach((e=>{let a=Ba(e);a.start&&t.push(a)}))})),"number"==typeof e?t[e]:t}json(e={}){return this.map((t=>{let a=t.toView().json(e)[0]||{};if(e&&!1!==e.dates){let e=Ya(t,this.opts);e.length>0&&(a.dates=Ba(e[0]))}return a}),[])}format(e){let t=this.map((t=>{let a=Ya(t,this.opts)[0]||{};if(a.start){let n=a.start.d,r=n.format(e);if(a.end){let t=a.end.d;!1===n.isSame(t,"day")&&(r+=" to "+t.format(e))}t.replaceWith(r)}return t}));return new Dates(this.document,t.pointer,null,this.opts)}isBefore(e){let t=Ha(this,e);return this.filter((e=>{let a=Ya(e,this.opts)[0]||{};return a.start&&a.start.d&&a.start.d.isBefore(t)}))}isAfter(e){let t=Ha(this,e);return this.filter((e=>{let a=Ya(e,this.opts)[0]||{};return a.start&&a.start.d&&a.start.d.isAfter(t)}))}isSame(e,t){let a=Ha(this,t);return this.filter((t=>{let n=Ya(t,this.opts)[0]||{};return n.start&&n.start.d&&n.start.d.isSame(a,e)}))}}e.prototype.dates=function(e){let t=function(e){let t=e.match("#Date+");t=t.filter((e=>{let t=e.has("^#Duration+$")||e.has("^#Value #Duration+$");return!(!0!==t||!e.has("(#FinancialQuarter|quarter)"))||!1===t}));let a=t.match("[#Cardinal #Duration (in|on|this|next|during|for)] #Date",0);return a.found&&(t=t.not(a)),a=t.match("[#Cardinal #Duration] #WeekDay",0),a.found&&(t=t.not(a)),a=t.match("#Date [for #Value #Duration]$",0),a.found&&(t=t.not(a)),a=t.match("[#Cardinal #Duration] #Date",0),a.found&&!t.has("#Cardinal #Duration] (ago|from|before|after|back)")&&(t=t.not(a)),a=t.match("for #Cardinal #Duration"),a.found&&(t=t.not(a)),t=t.notIf("^one (#WeekDay|#Month)$"),t=function(e){let t=null;return e.has("^(between|within) #Date")?e:(e.has("#Month")&&(t=e.match("[#Month #Value] and? #Month",0).ifNo("@hasDash$"),t.found&&(e=e.splitAfter(t)),t=e.match("[#Value #Month] and? #Value #Month",0),t.found&&(e=e.splitAfter(t)),t=e.match("^[#Month] and? #Month #Ordinal?$",0),t.found&&(e=e.splitAfter(t)),t=e.match("[#Month #Value] #Month",0).ifNo("@hasDash$"),t.found&&(e=e.splitAfter(t))),e.has("#WeekDay")&&(t=e.match("^[#WeekDay] and? #WeekDay$",0).ifNo("@hasDash$"),t.found&&(e=e.splitAfter(t)),t=e.match("#WeekDay #WeekDay and? #WeekDay"),t.found&&(e=e.splitOn("#WeekDay")),t=e.match("[#WeekDay] (and|or|this|next)? #WeekDay",0).ifNo("@hasDash$"),t.found&&(e=e.splitAfter("#WeekDay"))),t=e.match("(this|next) #Duration [(today|tomorrow|yesterday)]",0),t.found&&(e=e.splitBefore(t)),t=e.match("[(today|tomorrow|yesterday)] #Value #Month",0),t.found&&(e=e.splitAfter(t)),t=e.match("[(today|tomorrow|yesterday)] (today|tomorrow|yesterday|#WeekDay)",0).ifNo("@hasDash$"),t.found&&(e=e.splitAfter(t)),t=e.match("#Year [and] #Year",0),t.found&&(e=e.splitAfter(t)),e=(e=e.not("^and")).not("and$"))}(t),t=t.notIf("(#Money|#Percentage)"),t=t.notIf("^per #Duration"),t}(this);return new Dates(this.document,t.pointer,null,e)}}(e),function(e){class Times extends e{constructor(e,t,a,n){super(e,t,a),this.viewType="Times",this.opts=n||{}}format(e){let t=this.map((t=>{let a=La(t)||{};if(a.time){let n=yt.now().time(a.time),r=a.time;r="24h"===e?n.format("time-24"):n.format(e),(t=t.not("#Preposition")).replaceWith(r)}return t}));return new Times(this.document,t.pointer,null,this.opts)}get(e){return Ia(this,e).map(La)}json(e={}){return this.map((t=>{let a=t.toView().json(e)[0]||{};return e&&!1!==e.time&&(a.time=La(t)),a}),[])}}e.prototype.times=function(e){let t=this.match("#Time+ (am|pm)?");return t=Ia(t,e),new Times(this.document,t.pointer)}}(e),function(e){class Durations extends e{constructor(e,t,a){super(e,t,a),this.context={}}json(e={}){return this.map((t=>{let a=t.toView().json(e)[0]||{};return e&&!1!==e.duration&&(a.duration=Ja(t)),a}),[])}get(e){let t=[];return this.forEach((e=>{let a=Ja(e);t.push(a)})),"number"==typeof e?t[e]:t}}e.prototype.durations=function(e){let t=this.match("#Value+ #Duration (and? #Value+ #Duration)?");return t=t.notIf("#DateShift"),"number"==typeof e&&(t=t.eq(e)),new Durations(this.document,t.pointer)}}(e)},mutate:e=>{e.model.two.regexText=e.model.two.regexText||[],e.model.two.regexText=e.model.two.regexText.concat(kn),e.methods.one.debug=e.methods.one.debug||{},e.methods.one.debug.dates=_n},hooks:["dates"],version:"3.7.1"};export{jn as default};