-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
1 lines (1 loc) · 42.2 KB
/
index.html
1
<!DOCTYPE html><html lang="en"><head><meta charset="utf-8"><title>FDP Calculator</title><meta name="description" content="Tools for Arabia Air Maroc"><meta name="viewport" content="width=device-width, initial-scale=1"><style>/*! normalize.css v8.0.1 | MIT License | github.com/necolas/normalize.css */html{line-height:1.15;-webkit-text-size-adjust:100%}body{margin:0}main{display:block}h1{font-size:2em;margin:.67em 0}hr{box-sizing:initial;height:0;overflow:visible}pre{font-family:monospace,monospace;font-size:1em}a{background-color:initial}abbr[title]{border-bottom:none;text-decoration:underline;-webkit-text-decoration:underline dotted;text-decoration:underline dotted}b,strong{font-weight:bolder}code,kbd,samp{font-family:monospace,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}img{border-style:none}button,input,optgroup,select,textarea{font-family:inherit;font-size:100%;line-height:1.15;margin:0}button,input{overflow:visible}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button}[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner,button::-moz-focus-inner{border-style:none;padding:0}[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring,button:-moz-focusring{outline:1px dotted ButtonText}fieldset{padding:.35em .75em .625em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}progress{vertical-align:initial}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}details{display:block}summary{display:list-item}[hidden],template{display:none}html{box-sizing:border-box;font-family:sans-serif}*,:after,:before{box-sizing:inherit}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}button{background:transparent;padding:0}button:focus{outline:1px dotted;outline:5px auto -webkit-focus-ring-color}fieldset,ol,ul{margin:0;padding:0}ol,ul{list-style:none}html{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;line-height:1.5}*,:after,:before{border:0 solid #e2e8f0}hr{border-top-width:1px}img{border-style:solid}textarea{resize:vertical}input::-webkit-input-placeholder,textarea::-webkit-input-placeholder{color:#a0aec0}input::-ms-input-placeholder,textarea::-ms-input-placeholder{color:#a0aec0}input::placeholder,textarea::placeholder{color:#a0aec0}[role=button],button{cursor:pointer}table{border-collapse:collapse}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}button,input,optgroup,select,textarea{padding:0;line-height:inherit;color:inherit}code,kbd,pre,samp{font-family:Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}.container{width:100%}@media (min-width:640px){.container{max-width:640px}}@media (min-width:768px){.container{max-width:768px}}@media (min-width:1024px){.container{max-width:1024px}}@media (min-width:1280px){.container{max-width:1280px}}.bg-gray-200{background-color:#edf2f7}.bg-green-400{background-color:#68d391}.bg-indigo-400{background-color:#7f9cf5}.hover\:bg-blue-900:hover{background-color:#2a4365}.focus\:bg-white:focus{background-color:#fff}.border-gray-400{border-color:#cbd5e0}.border-blue-900,.hover\:border-blue-900:hover{border-color:#2a4365}.rounded{border-radius:.25rem}.border-2{border-width:2px}.border-4{border-width:4px}.border-b-4{border-bottom-width:4px}.flex{display:-webkit-box;display:flex}.flex-col{-webkit-box-orient:vertical;-webkit-box-direction:normal;flex-direction:column}.items-center{-webkit-box-align:center;align-items:center}.justify-center{-webkit-box-pack:center;justify-content:center}.justify-between{-webkit-box-pack:justify;justify-content:space-between}.font-semibold{font-weight:600}.font-bold{font-weight:700}.my-3{margin-top:.75rem;margin-bottom:.75rem}.mx-3{margin-left:.75rem;margin-right:.75rem}.my-5{margin-top:1.25rem;margin-bottom:1.25rem}.my-12{margin-top:3rem;margin-bottom:3rem}.py-2{padding-top:.5rem;padding-bottom:.5rem}.px-4{padding-left:1rem;padding-right:1rem}.text-center{text-align:center}.text-white{color:#fff}.text-blue-900{color:#2a4365}.hover\:text-gray-200:hover{color:#edf2f7}.text-3xl{font-size:1.875rem}.uppercase{text-transform:uppercase}.normal-case{text-transform:none}.w-9\/12{width:75%}@media (min-width:1024px){.lg\:my-2{margin-top:.5rem;margin-bottom:.5rem}.lg\:my-4{margin-top:1rem;margin-bottom:1rem}.lg\:w-3\/12{width:25%}.lg\:w-4\/12{width:33.333333%}}</style></head><body class="bg-gray-200 text-blue-900"> <form class="flex flex-col items-center justify-center mx-3 my-12 uppercase"> <h1 class="text-3xl normal-case border-b-4 lg:my-4 border-gray-400"> FDP Calculator (MAC) </h1> <p class="w-9/12 lg:w-4/12 flex justify-between my-3 lg:my-2"> <label for="departure">Departure</label> <input type="time" id="departure" class="bg-gray-200 focus:bg-white border-2 border-blue-900"> </p> <p class="w-9/12 lg:w-4/12 flex justify-between my-3 lg:my-2"> <label for="arrival">Arrival</label> <input type="time" id="arrival" class="bg-gray-200 focus:bg-white border-2 border-blue-900"> </p> <p class="w-9/12 lg:w-4/12 flex justify-between my-3 lg:my-2"> <label for="sectors">Sectors</label> <select id="sectors" class="bg-gray-200 focus:bg-white border-2 border-blue-900"> <option value="2" selected="">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> </select> </p> <p class="flex justify-between w-9/12 lg:w-4/12 my-3 lg:my-2"> <label for="extension"> 1h Extension </label> <input type="checkbox" id="extension"> </p> <button id="calculate" class="w-9/12 lg:w-3/12 my-5 py-2 border-4 hover:border-blue-900 uppercase font-semibold hover:bg-blue-900 hover:text-gray-200"> Calculate </button> <div id="result"></div> </form> <script>parcelRequire=function(e){var r="function"==typeof parcelRequire&&parcelRequire,n="function"==typeof require&&require,i={};function u(e,u){if(e in i)return i[e];var t="function"==typeof parcelRequire&&parcelRequire;if(!u&&t)return t(e,!0);if(r)return r(e,!0);if(n&&"string"==typeof e)return n(e);var o=new Error("Cannot find module '"+e+"'");throw o.code="MODULE_NOT_FOUND",o}return u.register=function(e,r){i[e]=r},i=e(u),u.modules=i,u}(function (require) {function y(e,r){q(2,arguments);var $=z(e),t=A(r);return $.setDate($.getDate()+t),$}function A(r){if(null===r||!0===r||!1===r)return NaN;var t=Number(r);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function z(e){q(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"==typeof e&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):("string"!=typeof e&&"[object String]"!==t||"undefined"==typeof console||(console.warn("Starting with v2.0.0-beta.1 date-fns doesn't accept strings as arguments. Please use `parseISO` to parse strings. See: https://git.io/fjule"),console.warn(new Error().stack)),new Date(NaN))}function q(e,t){if(t.length<e)throw new TypeError(e+" argument"+e>1?"s":" required, but only "+t.length+" present")}function n(e,r){q(2,arguments);var $=z(e).getTime(),t=A(r);return new Date($+t)}var Q=36e5;function t(e,r){q(2,arguments);var $=A(r);return n(e,$*Q)}var C=6e4;function U(e){var $=new Date(e.getTime()),a=Math.ceil($.getTimezoneOffset());$.setSeconds(0,0);var t=$.getTime()%C;return a*C+t}var R=6e4;function w(e,r){q(2,arguments);var $=A(r);return n(e,$*R)}function D(e){q(1,arguments);var r=z(e);return!isNaN(r)}function S(e,r){q(2,arguments);var $=z(e),t=z(r);return $.getTime()-t.getTime()}var T=6e4;function x(e,r){q(2,arguments);var $=S(e,r)/T;return $>0?Math.floor($):Math.ceil($)}var i={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function V(o,e,t){var a;return t=t||{},a="string"==typeof i[o]?i[o]:1===e?i[o].one:i[o].other.replace("{{count}}",e),t.addSuffix?t.comparison>0?"in "+a:a+" ago":a}function r(t){return function(r){var e=r||{},$=e.width?String(e.width):t.defaultWidth;return t.formats[$]||t.formats[t.defaultWidth]}}var W={full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},X={full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},Y={full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},Z={date:r({formats:W,defaultWidth:"full"}),time:r({formats:X,defaultWidth:"full"}),dateTime:r({formats:Y,defaultWidth:"full"})};var $={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function _(e,t,a,o){return $[e]}function a(t){return function(a,e){var r,n=e||{};if("formatting"===(n.context?String(n.context):"standalone")&&t.formattingValues){var i=t.defaultFormattingWidth||t.defaultWidth,l=n.width?String(n.width):i;r=t.formattingValues[l]||t.formattingValues[i]}else{var u=t.defaultWidth,d=n.width?String(n.width):t.defaultWidth;r=t.values[d]||t.values[u]}return r[t.argumentCallback?t.argumentCallback(a):a]}}var aa={narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},ba={narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},ca={narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},da={narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},ea={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},fa={narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}};function ga(n,e){var a=Number(n),r=a%100;if(r>20||r<10)switch(r%10){case 1:return a+"st";case 2:return a+"nd";case 3:return a+"rd";}return a+"th"}var ha={ordinalNumber:ga,era:a({values:aa,defaultWidth:"wide"}),quarter:a({values:ba,defaultWidth:"wide",argumentCallback:function(n){return Number(n)-1}}),month:a({values:ca,defaultWidth:"wide"}),day:a({values:da,defaultWidth:"wide"}),dayPeriod:a({values:ea,defaultWidth:"wide",formattingValues:fa,defaultFormattingWidth:"wide"})};function ia(a){return function(t,e){var l=String(t),r=e||{},u=l.match(a.matchPattern);if(!u)return null;var n=u[0],v=l.match(a.parsePattern);if(!v)return null;var c=a.valueCallback?a.valueCallback(v[0]):v[0];return{value:c=r.valueCallback?r.valueCallback(c):c,rest:l.slice(n.length)}}}function e(t){return function(r,e){var a=String(r),n=e||{},l=n.width,u=l&&t.matchPatterns[l]||t.matchPatterns[t.defaultMatchWidth],$=a.match(u);if(!$)return null;var f,i=$[0],c=l&&t.parsePatterns[l]||t.parsePatterns[t.defaultParseWidth];return f="[object Array]"===Object.prototype.toString.call(c)?ka(c,function(t){return t.test(a)}):ja(c,function(t){return t.test(a)}),f=t.valueCallback?t.valueCallback(f):f,{value:f=n.valueCallback?n.valueCallback(f):f,rest:a.slice(i.length)}}}function ja(t,r){for(var e in t)if(t.hasOwnProperty(e)&&r(t[e]))return e}function ka(t,r){for(var e=0;e<t.length;e++)if(r(t[e]))return e}var la=/^(\d+)(th|st|nd|rd)?/i,ma=/\d+/i,na={narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},oa={any:[/^b/i,/^(a|c)/i]},pa={narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},qa={any:[/1/i,/2/i,/3/i,/4/i]},ra={narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},sa={narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},ta={narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},ua={narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},va={narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},wa={any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},xa={ordinalNumber:ia({matchPattern:la,parsePattern:ma,valueCallback:function(a){return parseInt(a,10)}}),era:e({matchPatterns:na,defaultMatchWidth:"wide",parsePatterns:oa,defaultParseWidth:"any"}),quarter:e({matchPatterns:pa,defaultMatchWidth:"wide",parsePatterns:qa,defaultParseWidth:"any",valueCallback:function(a){return a+1}}),month:e({matchPatterns:ra,defaultMatchWidth:"wide",parsePatterns:sa,defaultParseWidth:"any"}),day:e({matchPatterns:ta,defaultMatchWidth:"wide",parsePatterns:ua,defaultParseWidth:"any"}),dayPeriod:e({matchPatterns:va,defaultMatchWidth:"any",parsePatterns:wa,defaultParseWidth:"any"})};var ya={code:"en-US",formatDistance:V,formatLong:Z,formatRelative:_,localize:ha,match:xa,options:{weekStartsOn:0,firstWeekContainsDate:1}};function za(e,r){q(2,arguments);var $=A(r);return n(e,-$)}function l(e){q(1,arguments);var u=z(e),r=u.getUTCDay(),t=(r<1?7:0)+r-1;return u.setUTCDate(u.getUTCDate()-t),u.setUTCHours(0,0,0,0),u}function Aa(e){q(1,arguments);var r=Ba(e),$=new Date(0);return $.setUTCFullYear(r,0,4),$.setUTCHours(0,0,0,0),l($)}function Ba(e){q(1,arguments);var r=z(e),t=r.getUTCFullYear(),$=new Date(0);$.setUTCFullYear(t+1,0,4),$.setUTCHours(0,0,0,0);var u=l($),a=new Date(0);a.setUTCFullYear(t,0,4),a.setUTCHours(0,0,0,0);var i=l(a);return r.getTime()>=u.getTime()?t+1:r.getTime()>=i.getTime()?t:t-1}var Ca=6048e5;function Da(r){q(1,arguments);var e=z(r),$=l(e).getTime()-Aa(e).getTime();return Math.round($/Ca)+1}function k(e,t){q(1,arguments);var r=t||{},s=r.locale,$=s&&s.options&&s.options.weekStartsOn,n=null==$?0:A($),o=null==r.weekStartsOn?n:A(r.weekStartsOn);if(!(o>=0&&o<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var a=z(e),i=a.getUTCDay(),u=(i<o?7:0)+i-o;return a.setUTCDate(a.getUTCDate()-u),a.setUTCHours(0,0,0,0),a}function Ea(e,r){q(1,arguments);var t=r||{},$=t.locale,i=$&&$.options&&$.options.firstWeekContainsDate,a=null==i?1:A(i),o=null==t.firstWeekContainsDate?a:A(t.firstWeekContainsDate),n=E(e,r),s=new Date(0);return s.setUTCFullYear(n,0,o),s.setUTCHours(0,0,0,0),k(s,r)}function E(e,t){q(1,arguments);var r=z(e,t),$=r.getUTCFullYear(),i=t||{},a=i.locale,n=a&&a.options&&a.options.firstWeekContainsDate,o=null==n?1:A(n),s=null==i.firstWeekContainsDate?o:A(i.firstWeekContainsDate);if(!(s>=1&&s<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var l=new Date(0);l.setUTCFullYear($+1,0,s),l.setUTCHours(0,0,0,0);var u=k(l,t),b=new Date(0);b.setUTCFullYear($,0,s),b.setUTCHours(0,0,0,0);var p=k(b,t);return r.getTime()>=u.getTime()?$+1:r.getTime()>=p.getTime()?$:$-1}var Fa=6048e5;function Ga(e,r){q(1,arguments);var $=z(e),t=k($,r).getTime()-Ea($,r).getTime();return Math.round(t/Fa)+1}function F(t,e){switch(t){case"P":return e.date({width:"short"});case"PP":return e.date({width:"medium"});case"PPP":return e.date({width:"long"});case"PPPP":default:return e.date({width:"full"});}}function G(t,e){switch(t){case"p":return e.time({width:"short"});case"pp":return e.time({width:"medium"});case"ppp":return e.time({width:"long"});case"pppp":default:return e.time({width:"full"});}}function Ha(t,e){var r,a=t.match(/(P+)(p+)?/),i=a[1],d=a[2];if(!d)return F(t,e);switch(i){case"P":r=e.dateTime({width:"short"});break;case"PP":r=e.dateTime({width:"medium"});break;case"PPP":r=e.dateTime({width:"long"});break;case"PPPP":default:r=e.dateTime({width:"full"});}return r.replace("{{date}}",F(i,e)).replace("{{time}}",G(d,e))}var Ia={p:G,P:Ha};var Ja=["D","DD"],Ka=["YY","YYYY"];function La(e){return-1!==Ja.indexOf(e)}function Ma(e){return-1!==Ka.indexOf(e)}function H(e){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` for formatting years; see: https://git.io/fxCyr");if("YY"===e)throw new RangeError("Use `yy` instead of `YY` for formatting years; see: https://git.io/fxCyr");if("D"===e)throw new RangeError("Use `d` instead of `D` for formatting days of the month; see: https://git.io/fxCyr");if("DD"===e)throw new RangeError("Use `dd` instead of `DD` for formatting days of the month; see: https://git.io/fxCyr")}function Na(r,e){if(null==r)throw new TypeError("assign requires that input parameter not be null or undefined");for(var t in e=e||{})e.hasOwnProperty(t)&&(r[t]=e[t]);return r}function I(e,r){q(2,arguments);var $=z(e),i=z(r);return $.getTime()>i.getTime()}function Oa(e,r){q(2,arguments);var $=z(e),t=z(r);return $.getTime()<t.getTime()}function J(e,r){q(2,arguments);var t=r||{},$=z(e).getTime(),i=z(t.start).getTime(),a=z(t.end).getTime();if(!(i<=a))throw new RangeError("Invalid interval");return $>=i&&$<=a}function s(e,t,r){q(2,arguments);var $=r||{},n=$.locale,o=n&&n.options&&n.options.weekStartsOn,a=null==o?0:A(o),i=null==$.weekStartsOn?a:A($.weekStartsOn);if(!(i>=0&&i<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var f=z(e),s=A(t),j=((s%7+7)%7<i?7:0)+s-f.getUTCDay();return f.setUTCDate(f.getUTCDate()+j),f}function Pa(e,r){q(2,arguments);var t=A(r);t%7==0&&(t-=7);var $=z(e),x=((t%7+7)%7<1?7:0)+t-$.getUTCDay();return $.setUTCDate($.getUTCDate()+x),$}function Qa(e,r){q(2,arguments);var $=z(e),t=A(r),T=Da($)-t;return $.setUTCDate($.getUTCDate()-7*T),$}function Ra(e,r,$){q(2,arguments);var t=z(e),o=A(r),X=Ga(t,$)-o;return t.setUTCDate(t.getUTCDate()-7*X),t}var Sa=36e5,Ta=6e4,Ua=1e3,d={month:/^(1[0-2]|0?\d)/,date:/^(3[0-1]|[0-2]?\d)/,dayOfYear:/^(36[0-6]|3[0-5]\d|[0-2]?\d?\d)/,week:/^(5[0-3]|[0-4]?\d)/,hour23h:/^(2[0-3]|[0-1]?\d)/,hour24h:/^(2[0-4]|[0-1]?\d)/,hour11h:/^(1[0-1]|0?\d)/,hour12h:/^(1[0-2]|0?\d)/,minute:/^[0-5]?\d/,second:/^[0-5]?\d/,singleDigit:/^\d/,twoDigits:/^\d{1,2}/,threeDigits:/^\d{1,3}/,fourDigits:/^\d{1,4}/,anyDigitsSigned:/^-?\d+/,singleDigitSigned:/^-?\d/,twoDigitsSigned:/^-?\d{1,2}/,threeDigitsSigned:/^-?\d{1,3}/,fourDigitsSigned:/^-?\d{1,4}/},f={basicOptionalMinutes:/^([+-])(\d{2})(\d{2})?|Z/,basic:/^([+-])(\d{2})(\d{2})|Z/,basicOptionalSeconds:/^([+-])(\d{2})(\d{2})((\d{2}))?|Z/,extended:/^([+-])(\d{2}):(\d{2})|Z/,extendedOptionalSeconds:/^([+-])(\d{2}):(\d{2})(:(\d{2}))?|Z/};function b(t,e,r){var a=e.match(t);if(!a)return null;var i=parseInt(a[0],10);return{value:r?r(i):i,rest:e.slice(a[0].length)}}function g(t,e){var r=e.match(t);if(!r)return null;if("Z"===r[0])return{value:0,rest:e.slice(1)};var a="+"===r[1]?1:-1,i=r[2]?parseInt(r[2],10):0,n=r[3]?parseInt(r[3],10):0,s=r[5]?parseInt(r[5],10):0;return{value:a*(i*Sa+n*Ta+s*Ua),rest:e.slice(r[0].length)}}function K(t,e){return b(d.anyDigitsSigned,t,e)}function c(t,e,r){switch(t){case 1:return b(d.singleDigit,e,r);case 2:return b(d.twoDigits,e,r);case 3:return b(d.threeDigits,e,r);case 4:return b(d.fourDigits,e,r);default:return b(new RegExp("^\\d{1,"+t+"}"),e,r);}}function L(t,e,r){switch(t){case 1:return b(d.singleDigitSigned,e,r);case 2:return b(d.twoDigitsSigned,e,r);case 3:return b(d.threeDigitsSigned,e,r);case 4:return b(d.fourDigitsSigned,e,r);default:return b(new RegExp("^-?\\d{1,"+t+"}"),e,r);}}function u(t){switch(t){case"morning":return 4;case"evening":return 17;case"pm":case"noon":case"afternoon":return 12;case"am":case"midnight":case"night":default:return 0;}}function M(t,e){var r,a=e>0,i=a?e:1-e;if(i<=50)r=t||100;else{var n=i+50;r=t+100*Math.floor(n/100)-(t>=n%100?100:0)}return a?r:1-r}var Va=[31,28,31,30,31,30,31,31,30,31,30,31],Wa=[31,29,31,30,31,30,31,31,30,31,30,31];function N(t){return t%400==0||t%4==0&&t%100!=0}var Xa={G:{priority:140,parse:function(t,e,r,a){switch(e){case"G":case"GG":case"GGG":return r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});case"GGGGG":return r.era(t,{width:"narrow"});case"GGGG":default:return r.era(t,{width:"wide"})||r.era(t,{width:"abbreviated"})||r.era(t,{width:"narrow"});}},set:function(t,e,r,a){return e.era=r,t.setUTCFullYear(r,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["R","u","t","T"]},y:{priority:130,parse:function(t,e,r,a){var i=function(t){return{year:t,isTwoDigitYear:"yy"===e}};switch(e){case"y":return c(4,t,i);case"yo":return r.ordinalNumber(t,{unit:"year",valueCallback:i});default:return c(e.length,t,i);}},validate:function(t,e,r){return e.isTwoDigitYear||e.year>0},set:function(t,e,r,a){var i=t.getUTCFullYear();if(r.isTwoDigitYear){var n=M(r.year,i);return t.setUTCFullYear(n,0,1),t.setUTCHours(0,0,0,0),t}var s="era"in e&&1!==e.era?1-r.year:r.year;return t.setUTCFullYear(s,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","u","w","I","i","e","c","t","T"]},Y:{priority:130,parse:function(t,e,r,a){var i=function(t){return{year:t,isTwoDigitYear:"YY"===e}};switch(e){case"Y":return c(4,t,i);case"Yo":return r.ordinalNumber(t,{unit:"year",valueCallback:i});default:return c(e.length,t,i);}},validate:function(t,e,r){return e.isTwoDigitYear||e.year>0},set:function(t,e,r,a){var i=E(t,a);if(r.isTwoDigitYear){var n=M(r.year,i);return t.setUTCFullYear(n,0,a.firstWeekContainsDate),t.setUTCHours(0,0,0,0),k(t,a)}var s="era"in e&&1!==e.era?1-r.year:r.year;return t.setUTCFullYear(s,0,a.firstWeekContainsDate),t.setUTCHours(0,0,0,0),k(t,a)},incompatibleTokens:["y","R","u","Q","q","M","L","I","d","D","i","t","T"]},R:{priority:130,parse:function(t,e,r,a){return L("R"===e?4:e.length,t)},set:function(t,e,r,a){var i=new Date(0);return i.setUTCFullYear(r,0,4),i.setUTCHours(0,0,0,0),l(i)},incompatibleTokens:["G","y","Y","u","Q","q","M","L","w","d","D","e","c","t","T"]},u:{priority:130,parse:function(t,e,r,a){return L("u"===e?4:e.length,t)},set:function(t,e,r,a){return t.setUTCFullYear(r,0,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["G","y","Y","R","w","I","i","e","c","t","T"]},Q:{priority:120,parse:function(t,e,r,a){switch(e){case"Q":case"QQ":return c(e.length,t);case"Qo":return r.ordinalNumber(t,{unit:"quarter"});case"QQQ":return r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQQ":return r.quarter(t,{width:"narrow",context:"formatting"});case"QQQQ":default:return r.quarter(t,{width:"wide",context:"formatting"})||r.quarter(t,{width:"abbreviated",context:"formatting"})||r.quarter(t,{width:"narrow",context:"formatting"});}},validate:function(t,e,r){return e>=1&&e<=4},set:function(t,e,r,a){return t.setUTCMonth(3*(r-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","M","L","w","I","d","D","i","e","c","t","T"]},q:{priority:120,parse:function(t,e,r,a){switch(e){case"q":case"qq":return c(e.length,t);case"qo":return r.ordinalNumber(t,{unit:"quarter"});case"qqq":return r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});case"qqqqq":return r.quarter(t,{width:"narrow",context:"standalone"});case"qqqq":default:return r.quarter(t,{width:"wide",context:"standalone"})||r.quarter(t,{width:"abbreviated",context:"standalone"})||r.quarter(t,{width:"narrow",context:"standalone"});}},validate:function(t,e,r){return e>=1&&e<=4},set:function(t,e,r,a){return t.setUTCMonth(3*(r-1),1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","Q","M","L","w","I","d","D","i","e","c","t","T"]},M:{priority:110,parse:function(t,e,r,a){var i=function(t){return t-1};switch(e){case"M":return b(d.month,t,i);case"MM":return c(2,t,i);case"Mo":return r.ordinalNumber(t,{unit:"month",valueCallback:i});case"MMM":return r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});case"MMMMM":return r.month(t,{width:"narrow",context:"formatting"});case"MMMM":default:return r.month(t,{width:"wide",context:"formatting"})||r.month(t,{width:"abbreviated",context:"formatting"})||r.month(t,{width:"narrow",context:"formatting"});}},validate:function(t,e,r){return e>=0&&e<=11},set:function(t,e,r,a){return t.setUTCMonth(r,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","L","w","I","D","i","e","c","t","T"]},L:{priority:110,parse:function(t,e,r,a){var i=function(t){return t-1};switch(e){case"L":return b(d.month,t,i);case"LL":return c(2,t,i);case"Lo":return r.ordinalNumber(t,{unit:"month",valueCallback:i});case"LLL":return r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});case"LLLLL":return r.month(t,{width:"narrow",context:"standalone"});case"LLLL":default:return r.month(t,{width:"wide",context:"standalone"})||r.month(t,{width:"abbreviated",context:"standalone"})||r.month(t,{width:"narrow",context:"standalone"});}},validate:function(t,e,r){return e>=0&&e<=11},set:function(t,e,r,a){return t.setUTCMonth(r,1),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","w","I","D","i","e","c","t","T"]},w:{priority:100,parse:function(t,e,r,a){switch(e){case"w":return b(d.week,t);case"wo":return r.ordinalNumber(t,{unit:"week"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=1&&e<=53},set:function(t,e,r,a){return k(Ra(t,r,a),a)},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","i","t","T"]},I:{priority:100,parse:function(t,e,r,a){switch(e){case"I":return b(d.week,t);case"Io":return r.ordinalNumber(t,{unit:"week"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=1&&e<=53},set:function(t,e,r,a){return l(Qa(t,r,a),a)},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","e","c","t","T"]},d:{priority:90,parse:function(t,e,r,a){switch(e){case"d":return b(d.date,t);case"do":return r.ordinalNumber(t,{unit:"date"});default:return c(e.length,t);}},validate:function(t,e,r){var a=N(t.getUTCFullYear()),i=t.getUTCMonth();return a?e>=1&&e<=Wa[i]:e>=1&&e<=Va[i]},set:function(t,e,r,a){return t.setUTCDate(r),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","w","I","D","i","e","c","t","T"]},D:{priority:90,parse:function(t,e,r,a){switch(e){case"D":case"DD":return b(d.dayOfYear,t);case"Do":return r.ordinalNumber(t,{unit:"date"});default:return c(e.length,t);}},validate:function(t,e,r){return N(t.getUTCFullYear())?e>=1&&e<=366:e>=1&&e<=365},set:function(t,e,r,a){return t.setUTCMonth(0,r),t.setUTCHours(0,0,0,0),t},incompatibleTokens:["Y","R","q","Q","M","L","w","I","d","E","i","e","c","t","T"]},E:{priority:90,parse:function(t,e,r,a){switch(e){case"E":case"EE":case"EEE":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEEE":return r.day(t,{width:"narrow",context:"formatting"});case"EEEEEE":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"EEEE":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});}},validate:function(t,e,r){return e>=0&&e<=6},set:function(t,e,r,a){return(t=s(t,r,a)).setUTCHours(0,0,0,0),t},incompatibleTokens:["D","i","e","c","t","T"]},e:{priority:90,parse:function(t,e,r,a){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+a.weekStartsOn+6)%7+e};switch(e){case"e":case"ee":return c(e.length,t,i);case"eo":return r.ordinalNumber(t,{unit:"day",valueCallback:i});case"eee":return r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeeee":return r.day(t,{width:"narrow",context:"formatting"});case"eeeeee":return r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});case"eeee":default:return r.day(t,{width:"wide",context:"formatting"})||r.day(t,{width:"abbreviated",context:"formatting"})||r.day(t,{width:"short",context:"formatting"})||r.day(t,{width:"narrow",context:"formatting"});}},validate:function(t,e,r){return e>=0&&e<=6},set:function(t,e,r,a){return(t=s(t,r,a)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","c","t","T"]},c:{priority:90,parse:function(t,e,r,a){var i=function(t){var e=7*Math.floor((t-1)/7);return(t+a.weekStartsOn+6)%7+e};switch(e){case"c":case"cc":return c(e.length,t,i);case"co":return r.ordinalNumber(t,{unit:"day",valueCallback:i});case"ccc":return r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"ccccc":return r.day(t,{width:"narrow",context:"standalone"});case"cccccc":return r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});case"cccc":default:return r.day(t,{width:"wide",context:"standalone"})||r.day(t,{width:"abbreviated",context:"standalone"})||r.day(t,{width:"short",context:"standalone"})||r.day(t,{width:"narrow",context:"standalone"});}},validate:function(t,e,r){return e>=0&&e<=6},set:function(t,e,r,a){return(t=s(t,r,a)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","R","u","q","Q","M","L","I","d","D","E","i","e","t","T"]},i:{priority:90,parse:function(t,e,r,a){var i=function(t){return 0===t?7:t};switch(e){case"i":case"ii":return c(e.length,t);case"io":return r.ordinalNumber(t,{unit:"day"});case"iii":return r.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||r.day(t,{width:"short",context:"formatting",valueCallback:i})||r.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiii":return r.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiiiii":return r.day(t,{width:"short",context:"formatting",valueCallback:i})||r.day(t,{width:"narrow",context:"formatting",valueCallback:i});case"iiii":default:return r.day(t,{width:"wide",context:"formatting",valueCallback:i})||r.day(t,{width:"abbreviated",context:"formatting",valueCallback:i})||r.day(t,{width:"short",context:"formatting",valueCallback:i})||r.day(t,{width:"narrow",context:"formatting",valueCallback:i});}},validate:function(t,e,r){return e>=1&&e<=7},set:function(t,e,r,a){return(t=Pa(t,r,a)).setUTCHours(0,0,0,0),t},incompatibleTokens:["y","Y","u","q","Q","M","L","w","d","D","E","e","c","t","T"]},a:{priority:80,parse:function(t,e,r,a){switch(e){case"a":case"aa":case"aaa":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaaa":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"aaaa":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});}},set:function(t,e,r,a){return t.setUTCHours(u(r),0,0,0),t},incompatibleTokens:["b","B","H","K","k","t","T"]},b:{priority:80,parse:function(t,e,r,a){switch(e){case"b":case"bb":case"bbb":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbbb":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"bbbb":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});}},set:function(t,e,r,a){return t.setUTCHours(u(r),0,0,0),t},incompatibleTokens:["a","B","H","K","k","t","T"]},B:{priority:80,parse:function(t,e,r,a){switch(e){case"B":case"BB":case"BBB":return r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBBB":return r.dayPeriod(t,{width:"narrow",context:"formatting"});case"BBBB":default:return r.dayPeriod(t,{width:"wide",context:"formatting"})||r.dayPeriod(t,{width:"abbreviated",context:"formatting"})||r.dayPeriod(t,{width:"narrow",context:"formatting"});}},set:function(t,e,r,a){return t.setUTCHours(u(r),0,0,0),t},incompatibleTokens:["a","b","t","T"]},h:{priority:70,parse:function(t,e,r,a){switch(e){case"h":return b(d.hour12h,t);case"ho":return r.ordinalNumber(t,{unit:"hour"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=1&&e<=12},set:function(t,e,r,a){var i=t.getUTCHours()>=12;return i&&r<12?t.setUTCHours(r+12,0,0,0):i||12!==r?t.setUTCHours(r,0,0,0):t.setUTCHours(0,0,0,0),t},incompatibleTokens:["H","K","k","t","T"]},H:{priority:70,parse:function(t,e,r,a){switch(e){case"H":return b(d.hour23h,t);case"Ho":return r.ordinalNumber(t,{unit:"hour"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=0&&e<=23},set:function(t,e,r,a){return t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","K","k","t","T"]},K:{priority:70,parse:function(t,e,r,a){switch(e){case"K":return b(d.hour11h,t);case"Ko":return r.ordinalNumber(t,{unit:"hour"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=0&&e<=11},set:function(t,e,r,a){return t.getUTCHours()>=12&&r<12?t.setUTCHours(r+12,0,0,0):t.setUTCHours(r,0,0,0),t},incompatibleTokens:["a","b","h","H","k","t","T"]},k:{priority:70,parse:function(t,e,r,a){switch(e){case"k":return b(d.hour24h,t);case"ko":return r.ordinalNumber(t,{unit:"hour"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=1&&e<=24},set:function(t,e,r,a){var i=r<=24?r%24:r;return t.setUTCHours(i,0,0,0),t},incompatibleTokens:["a","b","h","H","K","t","T"]},m:{priority:60,parse:function(t,e,r,a){switch(e){case"m":return b(d.minute,t);case"mo":return r.ordinalNumber(t,{unit:"minute"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=0&&e<=59},set:function(t,e,r,a){return t.setUTCMinutes(r,0,0),t},incompatibleTokens:["t","T"]},s:{priority:50,parse:function(t,e,r,a){switch(e){case"s":return b(d.second,t);case"so":return r.ordinalNumber(t,{unit:"second"});default:return c(e.length,t);}},validate:function(t,e,r){return e>=0&&e<=59},set:function(t,e,r,a){return t.setUTCSeconds(r,0),t},incompatibleTokens:["t","T"]},S:{priority:30,parse:function(t,e,r,a){return c(e.length,t,function(t){return Math.floor(t*Math.pow(10,3-e.length))})},set:function(t,e,r,a){return t.setUTCMilliseconds(r),t},incompatibleTokens:["t","T"]},X:{priority:10,parse:function(t,e,r,a){switch(e){case"X":return g(f.basicOptionalMinutes,t);case"XX":return g(f.basic,t);case"XXXX":return g(f.basicOptionalSeconds,t);case"XXXXX":return g(f.extendedOptionalSeconds,t);case"XXX":default:return g(f.extended,t);}},set:function(t,e,r,a){return e.timestampIsSet?t:new Date(t.getTime()-r)},incompatibleTokens:["t","T","x"]},x:{priority:10,parse:function(t,e,r,a){switch(e){case"x":return g(f.basicOptionalMinutes,t);case"xx":return g(f.basic,t);case"xxxx":return g(f.basicOptionalSeconds,t);case"xxxxx":return g(f.extendedOptionalSeconds,t);case"xxx":default:return g(f.extended,t);}},set:function(t,e,r,a){return e.timestampIsSet?t:new Date(t.getTime()-r)},incompatibleTokens:["t","T","X"]},t:{priority:40,parse:function(t,e,r,a){return K(t)},set:function(t,e,r,a){return[new Date(1e3*r),{timestampIsSet:!0}]},incompatibleTokens:"*"},T:{priority:20,parse:function(t,e,r,a){return K(t)},set:function(t,e,r,a){return[new Date(r),{timestampIsSet:!0}]},incompatibleTokens:"*"}};var Ya=10,Za=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,$a=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,_a=/^'([^]*?)'?$/,ab=/''/g,bb=/\S/,cb=/[a-zA-Z]/;function h(e,r,t,n){q(3,arguments);var a=String(e),p=String(r),i=n||{},o=i.locale||ya;if(!o.match)throw new RangeError("locale must contain match property");var $=o.options&&o.options.firstWeekContainsDate,s=null==$?1:A($),l=null==i.firstWeekContainsDate?s:A(i.firstWeekContainsDate);if(!(l>=1&&l<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var u=o.options&&o.options.weekStartsOn,c=null==u?0:A(u),y=null==i.weekStartsOn?c:A(i.weekStartsOn);if(!(y>=0&&y<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(""===p)return""===a?z(t):new Date(NaN);var g,m={firstWeekContainsDate:l,weekStartsOn:y,locale:o},d=[{priority:Ya,set:db,index:0}],f=p.match($a).map(function(e){var r=e[0];return"p"===r||"P"===r?(0,Ia[r])(e,o.formatLong,m):e}).join("").match(Za),v=[];for(g=0;g<f.length;g++){var h=f[g];!i.useAdditionalWeekYearTokens&&Ma(h)&&H(h),!i.useAdditionalDayOfYearTokens&&La(h)&&H(h);var T=h[0],x=Xa[T];if(x){var k=x.incompatibleTokens;if(Array.isArray(k)){for(var w=void 0,E=0;E<v.length;E++){var R=v[E].token;if(-1!==k.indexOf(R)||R===T){w=v[E];break}}if(w)throw new RangeError("The format string mustn't contain `".concat(w.fullToken,"` and `").concat(h,"` at the same time"))}else if("*"===x.incompatibleTokens&&v.length)throw new RangeError("The format string mustn't contain `".concat(h,"` and any other token at the same time"));v.push({token:T,fullToken:h});var b=x.parse(a,h,o.match,m);if(!b)return new Date(NaN);d.push({priority:x.priority,set:x.set,validate:x.validate,value:b.value,index:d.length}),a=b.rest}else{if(T.match(cb))throw new RangeError("Format string contains an unescaped latin alphabet character `"+T+"`");if("''"===h?h="'":"'"===T&&(h=eb(h)),0!==a.indexOf(h))return new Date(NaN);a=a.slice(h.length)}}if(a.length>0&&bb.test(a))return new Date(NaN);var D=d.map(function(e){return e.priority}).sort(function(e,r){return r-e}).filter(function(e,r,t){return t.indexOf(e)===r}).map(function(e){return d.filter(function(r){return r.priority===e}).reverse()}).map(function(e){return e[0]}),N=z(t);if(isNaN(N))return new Date(NaN);var I=za(N,U(N)),S={};for(g=0;g<D.length;g++){var O=D[g];if(O.validate&&!O.validate(I,O.value,m))return new Date(NaN);var C=O.set(I,S,O.value,m);C[0]?(I=C[0],Na(S,C[1])):I=C}return I}function db(e,r){if(r.timestampIsSet)return e;var t=new Date(0);return t.setFullYear(e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()),t.setHours(e.getUTCHours(),e.getUTCMinutes(),e.getUTCSeconds(),e.getUTCMilliseconds()),t}function eb(e){return e.match(_a)[1].replace(ab,"'")}function v(e,r){q(2,arguments);var $=A(r);return w(e,-$)}var B=function(){var e,r,t,a=!1,$=780;function i(e){var t=arguments.length>1&&void 0!==arguments[1]&&arguments[1],a=h(e,"H:mm",new Date);if(!D(a))throw new TypeError("INVALID arrival time");r=t?y(a,1):a}return{init:function(r,a,$){var n=h(r,"H:mm",new Date),o=h(a,"H:mm",new Date);!function(r){var t=h(r,"H:mm",new Date);if(!D(t))throw new TypeError("INVALID departure time");e=t}(r),I(n,o)?i(a,!0):i(a),function(e){if("string"==typeof e){if(""==e)throw new TypeError("INVALID number of sectors");if(e=Number(e),Number.isNaN(e))throw new TypeError("INVALID number of sectors")}if("number"!=typeof e)throw new TypeError("INVALID number of sectors");if(!Number.isInteger(e))throw new TypeError("INVALID number of sectors");if(e<1||e>6)throw new RangeError("Number of sectors should be between 1 and 6");t=0|e}($)},info:function(){return Object.freeze({DepartureTime:e,ArrivalTime:r,NumberOfSectors:t,IsExtended:a})},setExtension:function(e){if("boolean"!=typeof e)throw new TypeError("Stat should be a boolean");a=e},calculate:function(){if(null==e||null==r||null==t)throw new Error("Nothing to calculate yet, call init() first!");var i,n,o,s,c,m,p=a?60:0,u=w(v(v(v(v(w(e,$),(n=Object.freeze({start:e,end:w(e,$)}),o=e.getDate()==r.getDate()&&r.getDate()==n.end.getDate(),s=o?h("2:00","H:mm",new Date):y(h("2:00","H:mm",new Date),1),c=o?h("6:00","H:mm",new Date):y(h("6:00","H:mm",new Date),1),m=Object.freeze({start:s,end:c}),J(n.start,m)?(i=x(c,n.start))>120?120:i:J(n.end,m)?x(n.end,s)/2:Oa(n.start,s)&&I(n.end,c)?x(c,s)/2:0)),60),30),function(){if(t<3)return 0;for(var e=0,r=3;r<=6&&(e+=30,r!=t);++r);return e}()),p),f=x(r,e);return{lastArrival:u,lastDeparture:v(u,f)}}}}();var fb=document.querySelector("#calculate"),m=document.querySelector("#result"),j=!0,O="",P=function(a){return"\n <p class=\"py-2\">--- Last Time of ".concat(j?"Arrival":"Departure"," ---</p>\n <p class=\"py-2\">\n ").concat(j?a.lastArrival.getHours():a.lastDeparture.getHours(),":").concat(j?a.lastArrival.getMinutes():a.lastDeparture.getMinutes()," ( UTC )\n </p>\n <p class=\"py-2\">\n ").concat(j?t(a.lastArrival,1).getHours():t(a.lastDeparture,1).getHours(),":").concat(j?a.lastArrival.getMinutes():a.lastDeparture.getMinutes()," ( LOCAL )\n </p>\n ")},o=["my-12","font-bold","px-4","text-white","rounded","text-center","bg-indigo-400"],p=["my-12","font-bold","px-4","text-white","rounded","text-center","bg-green-400"];function gb(a){try{var r,e,$,t,s=document.querySelector("#departure"),v=document.querySelector("#arrival"),l=document.querySelector("#sectors"),i=document.querySelector("#extension"),u=s.value,n=v.value,c=l.value,d=i.checked;if(B.init(u,n,c),B.setExtension(d),O=B.calculate(),m.innerHTML=P(O),j)(r=m.classList).remove.apply(r,p),(e=m.classList).add.apply(e,o);else($=m.classList).remove.apply($,o),(t=m.classList).add.apply(t,p)}catch(o){alert(o.message)}finally{a.preventDefault()}}function hb(a){var r,e,$,t;(j=!j,this.innerHTML=P(O),j)?((r=this.classList).remove.apply(r,p),(e=this.classList).add.apply(e,o)):(($=this.classList).remove.apply($,o),(t=this.classList).add.apply(t,p))}fb.addEventListener("click",gb),m.addEventListener("click",hb);return{"QvaY":{}};});</script> </body></html>