!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define("tile",t):(e=e||self).tile=t()}(this,function(){"use strict";var e="undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{};e.setTimeout,e.clearTimeout;var t=e.performance||{};t.now||t.mozNow||t.msNow||t.oNow||t.webkitNow,"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self&&self;function n(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function r(e,t){return e(t={exports:{}},t.exports),t.exports}var i=Object.getOwnPropertySymbols,a=Object.prototype.hasOwnProperty,s=Object.prototype.propertyIsEnumerable;var o=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map(function(e){return t[e]}).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach(function(e){r[e]=e}),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,r,o=function(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}(e),u=1;u2?n-2:0),i=2;i1?t-1:0),r=1;r2?n-2:0),i=2;i8)throw new Error("warningWithoutStack() currently supports at most 8 arguments.");if(!e){if("undefined"!=typeof console){var a=r.map(function(e){return""+e});a.unshift("Warning: "+t),Function.prototype.apply.call(console.error,console,a)}try{var s=0,o="Warning: "+t.replace(/%s/g,function(){return r[s++]});throw new Error(o)}catch(e){}}},D={};function Y(e,t){var n=e.constructor,r=n&&(n.displayName||n.name)||"ReactClass",i=r+"."+t;D[i]||(M(!1,"Can't call %s on a component that is not yet mounted. This is a no-op, but it might indicate a bug in your application. Instead, assign to `this.state` directly or define a `state = {};` class property with the desired state in the %s component.",t,r),D[i]=!0)}var O={isMounted:function(e){return!1},enqueueForceUpdate:function(e,t,n){Y(e,"forceUpdate")},enqueueReplaceState:function(e,t,n,r){Y(e,"replaceState")},enqueueSetState:function(e,t,n,r){Y(e,"setState")}},x={};function T(e,t,n){this.props=e,this.context=t,this.refs=x,this.updater=n||O}Object.freeze(x),T.prototype.isReactComponent={},T.prototype.setState=function(e,t){"object"!=typeof e&&"function"!=typeof e&&null!=e&&k(!1,"setState(...): takes an object of state variables to update or a function which returns an object of state variables."),this.updater.enqueueSetState(this,e,t,"setState")},T.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,"forceUpdate")};var P={isMounted:["isMounted","Instead, make sure to clean up subscriptions and pending requests in componentWillUnmount to prevent memory leaks."],replaceState:["replaceState","Refactor your code to use setState instead (see https://github.com/facebook/react/issues/3236)."]},C=function(e,t){Object.defineProperty(T.prototype,e,{get:function(){S(!1,"%s(...) is deprecated in plain JavaScript React classes. %s",t[0],t[1])}})};for(var N in P)P.hasOwnProperty(N)&&C(N,P[N]);function R(){}function E(e,t,n){this.props=e,this.context=t,this.refs=x,this.updater=n||O}R.prototype=T.prototype;var W=E.prototype=new R;W.constructor=E,t(W,T.prototype),W.isPureReactComponent=!0;var j={current:null},F={current:null},U=/^(.*)[\\\/]/,H=1;function L(e){if(null==e)return null;if("number"==typeof e.tag&&M(!1,"Received an unexpected object in getComponentName(). This is likely a bug in React. Please file an issue."),"function"==typeof e)return e.displayName||e.name||null;if("string"==typeof e)return e;switch(e){case f:return"ConcurrentMode";case s:return"Fragment";case a:return"Portal";case l:return"Profiler";case u:return"StrictMode";case m:return"Suspense"}if("object"==typeof e)switch(e.$$typeof){case d:return"Context.Consumer";case c:return"Context.Provider";case h:return r=e,i=e.render,o="ForwardRef",_=i.displayName||i.name||"",r.displayName||(""!==_?o+"("+_+")":o);case p:return L(e.type);case y:var t=(n=e)._status===H?n._result:null;if(t)return L(t)}var n,r,i,o,_;return null}var A={},V=null;function I(e){V=e}A.getCurrentStack=null,A.getStackAddendum=function(){var e="";if(V){var t=L(V.type),n=V._owner;e+=function(e,t,n){var r="";if(t){var i=t.fileName,a=i.replace(U,"");if(/^index\./.test(a)){var s=i.match(U);if(s){var o=s[1];o&&(a=o.replace(U,"")+"/"+a)}}r=" (at "+a+":"+t.lineNumber+")"}else n&&(r=" (created by "+n+")");return"\n in "+(e||"Unknown")+r}(t,V._source,n&&L(n.type))}var r=A.getCurrentStack;return r&&(e+=r()||""),e};var G={ReactCurrentDispatcher:j,ReactCurrentOwner:F,assign:t};t(G,{ReactDebugCurrentFrame:A,ReactComponentTreeHook:{}});var $=function(e,t){if(!e){for(var n=G.ReactDebugCurrentFrame.getStackAddendum(),r=arguments.length,i=Array(r>2?r-2:0),a=2;a1){for(var c=Array(l),d=0;d.")}return t}(t);if(!ve[n]){ve[n]=!0;var r="";e&&e._owner&&e._owner!==F.current&&(r=" It was passed a child from "+L(e._owner.type)+"."),I(e),$(!1,'Each child in a list should have a unique "key" prop.%s%s See https://fb.me/react-warning-keys for more information.',n,r),I(null)}}}function be(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n",a=" Did you accidentally export a JSX literal instead of a component?"):u=typeof e,$(!1,"React.createElement: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",u,a)}var l=K.apply(this,arguments);if(null==l)return l;if(r)for(var c=2;c is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Provider},set:function(e){n.Provider=e}},_currentValue:{get:function(){return n._currentValue},set:function(e){n._currentValue=e}},_currentValue2:{get:function(){return n._currentValue2},set:function(e){n._currentValue2=e}},_threadCount:{get:function(){return n._threadCount},set:function(e){n._threadCount=e}},Consumer:{get:function(){return r||(r=!0,$(!1,"Rendering is not supported and will be removed in a future major release. Did you mean to render instead?")),n.Consumer}}}),n.Consumer=a,n._currentRenderer=null,n._currentRenderer2=null,n},forwardRef:function(e){return null!=e&&e.$$typeof===p?M(!1,"forwardRef requires a render function but received a `memo` component. Instead of forwardRef(memo(...)), use memo(forwardRef(...))."):"function"!=typeof e?M(!1,"forwardRef requires a render function but was given %s.",null===e?"null":typeof e):0!==e.length&&2!==e.length&&M(!1,"forwardRef render functions accept exactly two parameters: props and ref. %s",1===e.length?"Did you forget to use the ref parameter?":"Any additional parameter will be undefined."),null!=e&&(null!=e.defaultProps||null!=e.propTypes)&&M(!1,"forwardRef render functions do not support propTypes or defaultProps. Did you accidentally pass a React component?"),{$$typeof:h,render:e}},lazy:function(e){var t={$$typeof:y,_ctor:e,_status:-1,_result:null},n=void 0,r=void 0;return Object.defineProperties(t,{defaultProps:{configurable:!0,get:function(){return n},set:function(e){$(!1,"React.lazy(...): It is not supported to assign `defaultProps` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),n=e,Object.defineProperty(t,"defaultProps",{enumerable:!0})}},propTypes:{configurable:!0,get:function(){return r},set:function(e){$(!1,"React.lazy(...): It is not supported to assign `propTypes` to a lazy component import. Either specify them where the component is defined, or create a wrapping component around it."),r=e,Object.defineProperty(t,"propTypes",{enumerable:!0})}}}),t},memo:function(e,t){return pe(e)||M(!1,"memo: The first argument must be a component. Instead received: %s",null===e?"null":typeof e),{$$typeof:p,type:e,compare:void 0===t?null:t}},useCallback:function(e,t){return ye().useCallback(e,t)},useContext:function(e,t){var n=ye();if(void 0!==t&&$(!1,"useContext() second argument is reserved for future use in React. Passing it is not supported. You passed: %s.%s",t,"number"==typeof t&&Array.isArray(arguments[2])?"\n\nDid you call array.map(useContext)? Calling Hooks inside a loop is not supported. Learn more at https://fb.me/rules-of-hooks":""),void 0!==e._context){var r=e._context;r.Consumer===e?$(!1,"Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be removed in a future major release. Did you mean to call useContext(Context) instead?"):r.Provider===e&&$(!1,"Calling useContext(Context.Provider) is not supported. Did you mean to call useContext(Context) instead?")}return n.useContext(e,t)},useEffect:function(e,t){return ye().useEffect(e,t)},useImperativeHandle:function(e,t,n){return ye().useImperativeHandle(e,t,n)},useDebugValue:function(e,t){return ye().useDebugValue(e,t)},useLayoutEffect:function(e,t){return ye().useLayoutEffect(e,t)},useMemo:function(e,t){return ye().useMemo(e,t)},useReducer:function(e,t,n){return ye().useReducer(e,t,n)},useRef:function(e){return ye().useRef(e)},useState:function(e){return ye().useState(e)},Fragment:s,StrictMode:u,Suspense:m,createElement:Se,cloneElement:function(e,n,r){for(var i=function(e,n,r){null==e&&k(!1,"React.cloneElement(...): The argument must be a React element, but you passed %s.",e);var i=void 0,a=t({},e.props),s=e.key,o=e.ref,u=e._self,l=e._source,c=e._owner;if(null!=n){J(n)&&(o=n.ref,c=F.current),Q(n)&&(s=""+n.key);var d=void 0;for(i in e.type&&e.type.defaultProps&&(d=e.type.defaultProps),n)z.call(n,i)&&!q.hasOwnProperty(i)&&(void 0===n[i]&&void 0!==d?a[i]=d[i]:a[i]=n[i])}var f=arguments.length-2;if(1===f)a.children=r;else if(f>1){for(var h=Array(f),m=0;m>>0,r=0;r0)for(n=0;n<_.length;n++)r=_[n],o(i=t[r])||(e[r]=i);return e}var v=!1;function w(e){g(this,e),this._d=new Date(null!=e._d?e._d.getTime():NaN),this.isValid()||(this._d=new Date(NaN)),!1===v&&(v=!0,i.updateOffset(this),v=!1)}function b(e){return e instanceof w||null!=e&&null!=e._isAMomentObject}function k(e){return e<0?Math.ceil(e)||0:Math.floor(e)}function S(e){var t=+e,n=0;return 0!==t&&isFinite(t)&&(n=k(t)),n}function M(e,t,n){var r,i=Math.min(e.length,t.length),a=Math.abs(e.length-t.length),s=0;for(r=0;r=0;return(a?n?"+":"":"-")+Math.pow(10,Math.max(0,i)).toString().substr(1)+r}var L=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|YYYYYY|YYYYY|YYYY|YY|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,A=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,V={},I={};function G(e,t,n,r){var i=r;"string"==typeof r&&(i=function(){return this[r]()}),e&&(I[e]=i),t&&(I[t[0]]=function(){return H(i.apply(this,arguments),t[1],t[2])}),n&&(I[n]=function(){return this.localeData().ordinal(i.apply(this,arguments),e)})}function $(e,t){return e.isValid()?(t=z(t,e.localeData()),V[t]=V[t]||function(e){var t,n,r,i=e.match(L);for(t=0,n=i.length;t=0&&A.test(e);)e=e.replace(A,r),A.lastIndex=0,n-=1;return e}var q=/\d/,Z=/\d\d/,B=/\d{3}/,J=/\d{4}/,Q=/[+-]?\d{6}/,X=/\d\d?/,K=/\d\d\d\d?/,ee=/\d\d\d\d\d\d?/,te=/\d{1,3}/,ne=/\d{1,4}/,re=/[+-]?\d{1,6}/,ie=/\d+/,ae=/[+-]?\d+/,se=/Z|[+-]\d\d:?\d\d/gi,oe=/Z|[+-]\d\d(?::?\d\d)?/gi,ue=/[0-9]{0,256}['a-z\u00A0-\u05FF\u0700-\uD7FF\uF900-\uFDCF\uFDF0-\uFF07\uFF10-\uFFEF]{1,256}|[\u0600-\u06FF\/]{1,256}(\s*?[\u0600-\u06FF]{1,256}){1,2}/i,le={};function ce(e,t,n){le[e]=P(t)?t:function(e,r){return e&&n?n:t}}function de(e,t){return d(le,e)?le[e](t._strict,t._locale):new RegExp(fe(e.replace("\\","").replace(/\\(\[)|\\(\])|\[([^\]\[]*)\]|\\(.)/g,function(e,t,n,r,i){return t||n||r||i})))}function fe(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var he={};function me(e,t){var n,r=t;for("string"==typeof e&&(e=[e]),u(t)&&(r=function(e,n){n[t]=S(e)}),n=0;n68?1900:2e3)};var xe,Te=Pe("FullYear",!0);function Pe(e,t){return function(n){return null!=n?(Ne(this,e,n),i.updateOffset(this,t),this):Ce(this,e)}}function Ce(e,t){return e.isValid()?e._d["get"+(e._isUTC?"UTC":"")+t]():NaN}function Ne(e,t,n){e.isValid()&&!isNaN(n)&&("FullYear"===t&&Oe(e.year())&&1===e.month()&&29===e.date()?e._d["set"+(e._isUTC?"UTC":"")+t](n,e.month(),Re(n,e.month())):e._d["set"+(e._isUTC?"UTC":"")+t](n))}function Re(e,t){if(isNaN(e)||isNaN(t))return NaN;var n,r=(t%(n=12)+n)%n;return e+=(t-r)/12,1===r?Oe(e)?29:28:31-r%7%2}xe=Array.prototype.indexOf?Array.prototype.indexOf:function(e){var t;for(t=0;t=0){var n=Array.prototype.slice.call(arguments);n[0]=e+400,t=new Date(Date.UTC.apply(null,n)),isFinite(t.getUTCFullYear())&&t.setUTCFullYear(e)}else t=new Date(Date.UTC.apply(null,arguments));return t}function Ie(e,t,n){var r=7+t-n,i=(7+Ve(e,0,r).getUTCDay()-t)%7;return-i+r-1}function Ge(e,t,n,r,i){var a,s,o=(7+n-r)%7,u=Ie(e,r,i),l=1+7*(t-1)+o+u;return l<=0?s=Ye(a=e-1)+l:l>Ye(e)?(a=e+1,s=l-Ye(e)):(a=e,s=l),{year:a,dayOfYear:s}}function $e(e,t,n){var r,i,a=Ie(e.year(),t,n),s=Math.floor((e.dayOfYear()-a-1)/7)+1;return s<1?(i=e.year()-1,r=s+ze(i,t,n)):s>ze(e.year(),t,n)?(r=s-ze(e.year(),t,n),i=e.year()+1):(i=e.year(),r=s),{week:r,year:i}}function ze(e,t,n){var r=Ie(e,t,n),i=Ie(e+1,t,n);return(Ye(e)-r+i)/7}function qe(e,t){return e.slice(t,7).concat(e.slice(0,t))}G("w",["ww",2],"wo","week"),G("W",["WW",2],"Wo","isoWeek"),E("week","w"),E("isoWeek","W"),U("week",5),U("isoWeek",5),ce("w",X),ce("ww",X,Z),ce("W",X),ce("WW",X,Z),pe(["w","ww","W","WW"],function(e,t,n,r){t[r.substr(0,1)]=S(e)}),G("d",0,"do","day"),G("dd",0,0,function(e){return this.localeData().weekdaysMin(this,e)}),G("ddd",0,0,function(e){return this.localeData().weekdaysShort(this,e)}),G("dddd",0,0,function(e){return this.localeData().weekdays(this,e)}),G("e",0,0,"weekday"),G("E",0,0,"isoWeekday"),E("day","d"),E("weekday","e"),E("isoWeekday","E"),U("day",11),U("weekday",11),U("isoWeekday",11),ce("d",X),ce("e",X),ce("E",X),ce("dd",function(e,t){return t.weekdaysMinRegex(e)}),ce("ddd",function(e,t){return t.weekdaysShortRegex(e)}),ce("dddd",function(e,t){return t.weekdaysRegex(e)}),pe(["dd","ddd","dddd"],function(e,t,n,r){var i=n._locale.weekdaysParse(e,r,n._strict);null!=i?t.d=i:m(n).invalidWeekday=e}),pe(["d","e","E"],function(e,t,n,r){t[r]=S(e)});var Ze="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Be="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),Je="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Qe=ue,Xe=ue,Ke=ue;function et(){function e(e,t){return t.length-e.length}var t,n,r,i,a,s=[],o=[],u=[],l=[];for(t=0;t<7;t++)n=h([2e3,1]).day(t),r=this.weekdaysMin(n,""),i=this.weekdaysShort(n,""),a=this.weekdays(n,""),s.push(r),o.push(i),u.push(a),l.push(r),l.push(i),l.push(a);for(s.sort(e),o.sort(e),u.sort(e),l.sort(e),t=0;t<7;t++)o[t]=fe(o[t]),u[t]=fe(u[t]),l[t]=fe(l[t]);this._weekdaysRegex=new RegExp("^("+l.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+u.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+o.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+s.join("|")+")","i")}function tt(){return this.hours()%12||12}function nt(e,t){G(e,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),t)})}function rt(e,t){return t._meridiemParse}G("H",["HH",2],0,"hour"),G("h",["hh",2],0,tt),G("k",["kk",2],0,function(){return this.hours()||24}),G("hmm",0,0,function(){return""+tt.apply(this)+H(this.minutes(),2)}),G("hmmss",0,0,function(){return""+tt.apply(this)+H(this.minutes(),2)+H(this.seconds(),2)}),G("Hmm",0,0,function(){return""+this.hours()+H(this.minutes(),2)}),G("Hmmss",0,0,function(){return""+this.hours()+H(this.minutes(),2)+H(this.seconds(),2)}),nt("a",!0),nt("A",!1),E("hour","h"),U("hour",13),ce("a",rt),ce("A",rt),ce("H",X),ce("h",X),ce("k",X),ce("HH",X,Z),ce("hh",X,Z),ce("kk",X,Z),ce("hmm",K),ce("hmmss",ee),ce("Hmm",K),ce("Hmmss",ee),me(["H","HH"],we),me(["k","kk"],function(e,t,n){var r=S(e);t[we]=24===r?0:r}),me(["a","A"],function(e,t,n){n._isPm=n._locale.isPM(e),n._meridiem=e}),me(["h","hh"],function(e,t,n){t[we]=S(e),m(n).bigHour=!0}),me("hmm",function(e,t,n){var r=e.length-2;t[we]=S(e.substr(0,r)),t[be]=S(e.substr(r)),m(n).bigHour=!0}),me("hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[we]=S(e.substr(0,r)),t[be]=S(e.substr(r,2)),t[ke]=S(e.substr(i)),m(n).bigHour=!0}),me("Hmm",function(e,t,n){var r=e.length-2;t[we]=S(e.substr(0,r)),t[be]=S(e.substr(r))}),me("Hmmss",function(e,t,n){var r=e.length-4,i=e.length-2;t[we]=S(e.substr(0,r)),t[be]=S(e.substr(r,2)),t[ke]=S(e.substr(i))});var it,at=Pe("Hours",!0),st={calendar:{sameDay:"[Today at] LT",nextDay:"[Tomorrow at] LT",nextWeek:"dddd [at] LT",lastDay:"[Yesterday at] LT",lastWeek:"[Last] dddd [at] LT",sameElse:"L"},longDateFormat:{LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"},invalidDate:"Invalid date",ordinal:"%d",dayOfMonthOrdinalParse:/\d{1,2}/,relativeTime:{future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",M:"a month",MM:"%d months",y:"a year",yy:"%d years"},months:We,monthsShort:je,week:{dow:0,doy:6},weekdays:Ze,weekdaysMin:Je,weekdaysShort:Be,meridiemParse:/[ap]\.?m?\.?/i},ot={},ut={};function lt(e){return e?e.toLowerCase().replace("_","-"):e}function ct(t){var r=null;if(!ot[t]&&e&&e.exports)try{r=it._abbr;var i=n;i("./locale/"+t),dt(r)}catch(e){}return ot[t]}function dt(e,t){var n;return e&&((n=o(t)?ht(e):ft(e,t))?it=n:"undefined"!=typeof console&&console.warn&&console.warn("Locale "+e+" not found. Did you forget to load it?")),it._abbr}function ft(e,t){if(null!==t){var n,r=st;if(t.abbr=e,null!=ot[e])T("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),r=ot[e]._config;else if(null!=t.parentLocale)if(null!=ot[t.parentLocale])r=ot[t.parentLocale]._config;else{if(null==(n=ct(t.parentLocale)))return ut[t.parentLocale]||(ut[t.parentLocale]=[]),ut[t.parentLocale].push({name:e,config:t}),null;r=n._config}return ot[e]=new N(C(r,t)),ut[e]&&ut[e].forEach(function(e){ft(e.name,e.config)}),dt(e),ot[e]}return delete ot[e],null}function ht(e){var t;if(e&&e._locale&&e._locale._abbr&&(e=e._locale._abbr),!e)return it;if(!a(e)){if(t=ct(e))return t;e=[e]}return function(e){for(var t,n,r,i,a=0;a0;){if(r=ct(i.slice(0,t).join("-")))return r;if(n&&n.length>=t&&M(i,n,!0)>=t-1)break;t--}a++}return it}(e)}function mt(e){var t,n=e._a;return n&&-2===m(e).overflow&&(t=n[ge]<0||n[ge]>11?ge:n[ve]<1||n[ve]>Re(n[_e],n[ge])?ve:n[we]<0||n[we]>24||24===n[we]&&(0!==n[be]||0!==n[ke]||0!==n[Se])?we:n[be]<0||n[be]>59?be:n[ke]<0||n[ke]>59?ke:n[Se]<0||n[Se]>999?Se:-1,m(e)._overflowDayOfYear&&(t<_e||t>ve)&&(t=ve),m(e)._overflowWeeks&&-1===t&&(t=Me),m(e)._overflowWeekday&&-1===t&&(t=De),m(e).overflow=t),e}function pt(e,t,n){return null!=e?e:null!=t?t:n}function yt(e){var t,n,r,a,s,o=[];if(!e._d){for(r=function(e){var t=new Date(i.now());return e._useUTC?[t.getUTCFullYear(),t.getUTCMonth(),t.getUTCDate()]:[t.getFullYear(),t.getMonth(),t.getDate()]}(e),e._w&&null==e._a[ve]&&null==e._a[ge]&&function(e){var t,n,r,i,a,s,o,u;if(null!=(t=e._w).GG||null!=t.W||null!=t.E)a=1,s=4,n=pt(t.GG,e._a[_e],$e(Ct(),1,4).year),r=pt(t.W,1),((i=pt(t.E,1))<1||i>7)&&(u=!0);else{a=e._locale._week.dow,s=e._locale._week.doy;var l=$e(Ct(),a,s);n=pt(t.gg,e._a[_e],l.year),r=pt(t.w,l.week),null!=t.d?((i=t.d)<0||i>6)&&(u=!0):null!=t.e?(i=t.e+a,(t.e<0||t.e>6)&&(u=!0)):i=a}r<1||r>ze(n,a,s)?m(e)._overflowWeeks=!0:null!=u?m(e)._overflowWeekday=!0:(o=Ge(n,r,i,a,s),e._a[_e]=o.year,e._dayOfYear=o.dayOfYear)}(e),null!=e._dayOfYear&&(s=pt(e._a[_e],r[_e]),(e._dayOfYear>Ye(s)||0===e._dayOfYear)&&(m(e)._overflowDayOfYear=!0),n=Ve(s,0,e._dayOfYear),e._a[ge]=n.getUTCMonth(),e._a[ve]=n.getUTCDate()),t=0;t<3&&null==e._a[t];++t)e._a[t]=o[t]=r[t];for(;t<7;t++)e._a[t]=o[t]=null==e._a[t]?2===t?1:0:e._a[t];24===e._a[we]&&0===e._a[be]&&0===e._a[ke]&&0===e._a[Se]&&(e._nextDay=!0,e._a[we]=0),e._d=(e._useUTC?Ve:function(e,t,n,r,i,a,s){var o;return e<100&&e>=0?(o=new Date(e+400,t,n,r,i,a,s),isFinite(o.getFullYear())&&o.setFullYear(e)):o=new Date(e,t,n,r,i,a,s),o}).apply(null,o),a=e._useUTC?e._d.getUTCDay():e._d.getDay(),null!=e._tzm&&e._d.setUTCMinutes(e._d.getUTCMinutes()-e._tzm),e._nextDay&&(e._a[we]=24),e._w&&void 0!==e._w.d&&e._w.d!==a&&(m(e).weekdayMismatch=!0)}}var _t=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gt=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([\+\-]\d\d(?::?\d\d)?|\s*Z)?)?$/,vt=/Z|[+-]\d\d(?::?\d\d)?/,wt=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/]],bt=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],kt=/^\/?Date\((\-?\d+)/i;function St(e){var t,n,r,i,a,s,o=e._i,u=_t.exec(o)||gt.exec(o);if(u){for(m(e).iso=!0,t=0,n=wt.length;t0&&m(e).unusedInput.push(s),o=o.slice(o.indexOf(n)+n.length),l+=n.length),I[a]?(n?m(e).empty=!1:m(e).unusedTokens.push(a),ye(a,n,e)):e._strict&&!n&&m(e).unusedTokens.push(a);m(e).charsLeftOver=u-l,o.length>0&&m(e).unusedInput.push(o),e._a[we]<=12&&!0===m(e).bigHour&&e._a[we]>0&&(m(e).bigHour=void 0),m(e).parsedDateParts=e._a.slice(0),m(e).meridiem=e._meridiem,e._a[we]=(c=e._locale,d=e._a[we],null==(f=e._meridiem)?d:null!=c.meridiemHour?c.meridiemHour(d,f):null!=c.isPM?((h=c.isPM(f))&&d<12&&(d+=12),h||12!==d||(d=0),d):d),yt(e),mt(e)}else Ot(e);else St(e);var c,d,f,h}function Tt(e){var t=e._i,n=e._f;return e._locale=e._locale||ht(e._l),null===t||void 0===n&&""===t?y({nullInput:!0}):("string"==typeof t&&(e._i=t=e._locale.preparse(t)),b(t)?new w(mt(t)):(l(t)?e._d=t:a(n)?function(e){var t,n,r,i,a;if(0===e._f.length)return m(e).invalidFormat=!0,void(e._d=new Date(NaN));for(i=0;ithis?this:e:y()});function Et(e,t){var n,r;if(1===t.length&&a(t[0])&&(t=t[0]),!t.length)return Ct();for(n=t[0],r=1;r=0?new Date(e+400,t,n)-un:new Date(e,t,n).valueOf()}function dn(e,t,n){return e<100&&e>=0?Date.UTC(e+400,t,n)-un:Date.UTC(e,t,n)}function fn(e,t){G(0,[e,e.length],0,t)}function hn(e,t,n,r,i){var a;return null==e?$e(this,r,i).year:(a=ze(e,r,i),t>a&&(t=a),function(e,t,n,r,i){var a=Ge(e,t,n,r,i),s=Ve(a.year,0,a.dayOfYear);return this.year(s.getUTCFullYear()),this.month(s.getUTCMonth()),this.date(s.getUTCDate()),this}.call(this,e,t,n,r,i))}G(0,["gg",2],0,function(){return this.weekYear()%100}),G(0,["GG",2],0,function(){return this.isoWeekYear()%100}),fn("gggg","weekYear"),fn("ggggg","weekYear"),fn("GGGG","isoWeekYear"),fn("GGGGG","isoWeekYear"),E("weekYear","gg"),E("isoWeekYear","GG"),U("weekYear",1),U("isoWeekYear",1),ce("G",ae),ce("g",ae),ce("GG",X,Z),ce("gg",X,Z),ce("GGGG",ne,J),ce("gggg",ne,J),ce("GGGGG",re,Q),ce("ggggg",re,Q),pe(["gggg","ggggg","GGGG","GGGGG"],function(e,t,n,r){t[r.substr(0,2)]=S(e)}),pe(["gg","GG"],function(e,t,n,r){t[r]=i.parseTwoDigitYear(e)}),G("Q",0,"Qo","quarter"),E("quarter","Q"),U("quarter",7),ce("Q",q),me("Q",function(e,t){t[ge]=3*(S(e)-1)}),G("D",["DD",2],"Do","date"),E("date","D"),U("date",9),ce("D",X),ce("DD",X,Z),ce("Do",function(e,t){return e?t._dayOfMonthOrdinalParse||t._ordinalParse:t._dayOfMonthOrdinalParseLenient}),me(["D","DD"],ve),me("Do",function(e,t){t[ve]=S(e.match(X)[0])});var mn=Pe("Date",!0);G("DDD",["DDDD",3],"DDDo","dayOfYear"),E("dayOfYear","DDD"),U("dayOfYear",4),ce("DDD",te),ce("DDDD",B),me(["DDD","DDDD"],function(e,t,n){n._dayOfYear=S(e)}),G("m",["mm",2],0,"minute"),E("minute","m"),U("minute",14),ce("m",X),ce("mm",X,Z),me(["m","mm"],be);var pn=Pe("Minutes",!1);G("s",["ss",2],0,"second"),E("second","s"),U("second",15),ce("s",X),ce("ss",X,Z),me(["s","ss"],ke);var yn,_n=Pe("Seconds",!1);for(G("S",0,0,function(){return~~(this.millisecond()/100)}),G(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),G(0,["SSS",3],0,"millisecond"),G(0,["SSSS",4],0,function(){return 10*this.millisecond()}),G(0,["SSSSS",5],0,function(){return 100*this.millisecond()}),G(0,["SSSSSS",6],0,function(){return 1e3*this.millisecond()}),G(0,["SSSSSSS",7],0,function(){return 1e4*this.millisecond()}),G(0,["SSSSSSSS",8],0,function(){return 1e5*this.millisecond()}),G(0,["SSSSSSSSS",9],0,function(){return 1e6*this.millisecond()}),E("millisecond","ms"),U("millisecond",16),ce("S",te,q),ce("SS",te,Z),ce("SSS",te,B),yn="SSSS";yn.length<=9;yn+="S")ce(yn,ie);function gn(e,t){t[Se]=S(1e3*("0."+e))}for(yn="S";yn.length<=9;yn+="S")me(yn,gn);var vn=Pe("Milliseconds",!1);G("z",0,0,"zoneAbbr"),G("zz",0,0,"zoneName");var wn=w.prototype;function bn(e){return e}wn.add=Xt,wn.calendar=function(e,t){var n=e||Ct(),r=Vt(n,this).startOf("day"),a=i.calendarFormat(this,r)||"sameElse",s=t&&(P(t[a])?t[a].call(this,n):t[a]);return this.format(s||this.localeData().calendar(a,this,Ct(n)))},wn.clone=function(){return new w(this)},wn.diff=function(e,t,n){var r,i,a;if(!this.isValid())return NaN;if(!(r=Vt(e,this)).isValid())return NaN;switch(i=6e4*(r.utcOffset()-this.utcOffset()),t=W(t)){case"year":a=en(this,r)/12;break;case"month":a=en(this,r);break;case"quarter":a=en(this,r)/3;break;case"second":a=(this-r)/1e3;break;case"minute":a=(this-r)/6e4;break;case"hour":a=(this-r)/36e5;break;case"day":a=(this-r-i)/864e5;break;case"week":a=(this-r-i)/6048e5;break;default:a=this-r}return n?a:k(a)},wn.endOf=function(e){var t;if(void 0===(e=W(e))||"millisecond"===e||!this.isValid())return this;var n=this._isUTC?dn:cn;switch(e){case"year":t=n(this.year()+1,0,1)-1;break;case"quarter":t=n(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":t=n(this.year(),this.month()+1,1)-1;break;case"week":t=n(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":t=n(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":t=n(this.year(),this.month(),this.date()+1)-1;break;case"hour":t=this._d.valueOf(),t+=on-ln(t+(this._isUTC?0:this.utcOffset()*sn),on)-1;break;case"minute":t=this._d.valueOf(),t+=sn-ln(t,sn)-1;break;case"second":t=this._d.valueOf(),t+=an-ln(t,an)-1}return this._d.setTime(t),i.updateOffset(this,!0),this},wn.format=function(e){e||(e=this.isUtc()?i.defaultFormatUtc:i.defaultFormat);var t=$(this,e);return this.localeData().postformat(t)},wn.from=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Ct(e).isValid())?qt({to:this,from:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},wn.fromNow=function(e){return this.from(Ct(),e)},wn.to=function(e,t){return this.isValid()&&(b(e)&&e.isValid()||Ct(e).isValid())?qt({from:this,to:e}).locale(this.locale()).humanize(!t):this.localeData().invalidDate()},wn.toNow=function(e){return this.to(Ct(),e)},wn.get=function(e){return P(this[e=W(e)])?this[e]():this},wn.invalidAt=function(){return m(this).overflow},wn.isAfter=function(e,t){var n=b(e)?e:Ct(e);return!(!this.isValid()||!n.isValid())&&("millisecond"===(t=W(t)||"millisecond")?this.valueOf()>n.valueOf():n.valueOf()9999?$(n,t?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):P(Date.prototype.toISOString)?t?this.toDate().toISOString():new Date(this.valueOf()+60*this.utcOffset()*1e3).toISOString().replace("Z",$(n,"Z")):$(n,t?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")},wn.inspect=function(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var e="moment",t="";this.isLocal()||(e=0===this.utcOffset()?"moment.utc":"moment.parseZone",t="Z");var n="["+e+'("]',r=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",i=t+'[")]';return this.format(n+r+"-MM-DD[T]HH:mm:ss.SSS"+i)},wn.toJSON=function(){return this.isValid()?this.toISOString():null},wn.toString=function(){return this.clone().locale("en").format("ddd MMM DD YYYY HH:mm:ss [GMT]ZZ")},wn.unix=function(){return Math.floor(this.valueOf()/1e3)},wn.valueOf=function(){return this._d.valueOf()-6e4*(this._offset||0)},wn.creationData=function(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}},wn.year=Te,wn.isLeapYear=function(){return Oe(this.year())},wn.weekYear=function(e){return hn.call(this,e,this.week(),this.weekday(),this.localeData()._week.dow,this.localeData()._week.doy)},wn.isoWeekYear=function(e){return hn.call(this,e,this.isoWeek(),this.isoWeekday(),1,4)},wn.quarter=wn.quarters=function(e){return null==e?Math.ceil((this.month()+1)/3):this.month(3*(e-1)+this.month()%3)},wn.month=Ue,wn.daysInMonth=function(){return Re(this.year(),this.month())},wn.week=wn.weeks=function(e){var t=this.localeData().week(this);return null==e?t:this.add(7*(e-t),"d")},wn.isoWeek=wn.isoWeeks=function(e){var t=$e(this,1,4).week;return null==e?t:this.add(7*(e-t),"d")},wn.weeksInYear=function(){var e=this.localeData()._week;return ze(this.year(),e.dow,e.doy)},wn.isoWeeksInYear=function(){return ze(this.year(),1,4)},wn.date=mn,wn.day=wn.days=function(e){if(!this.isValid())return null!=e?this:NaN;var t=this._isUTC?this._d.getUTCDay():this._d.getDay();return null!=e?(e=function(e,t){return"string"!=typeof e?e:isNaN(e)?"number"==typeof(e=t.weekdaysParse(e))?e:null:parseInt(e,10)}(e,this.localeData()),this.add(e-t,"d")):t},wn.weekday=function(e){if(!this.isValid())return null!=e?this:NaN;var t=(this.day()+7-this.localeData()._week.dow)%7;return null==e?t:this.add(e-t,"d")},wn.isoWeekday=function(e){if(!this.isValid())return null!=e?this:NaN;if(null!=e){var t=function(e,t){return"string"==typeof e?t.weekdaysParse(e)%7||7:isNaN(e)?null:e}(e,this.localeData());return this.day(this.day()%7?t:t-7)}return this.day()||7},wn.dayOfYear=function(e){var t=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==e?t:this.add(e-t,"d")},wn.hour=wn.hours=at,wn.minute=wn.minutes=pn,wn.second=wn.seconds=_n,wn.millisecond=wn.milliseconds=vn,wn.utcOffset=function(e,t,n){var r,a=this._offset||0;if(!this.isValid())return null!=e?this:NaN;if(null!=e){if("string"==typeof e){if(null===(e=At(oe,e)))return this}else Math.abs(e)<16&&!n&&(e*=60);return!this._isUTC&&t&&(r=It(this)),this._offset=e,this._isUTC=!0,null!=r&&this.add(r,"m"),a!==e&&(!t||this._changeInProgress?Qt(this,qt(e-a,"m"),1,!1):this._changeInProgress||(this._changeInProgress=!0,i.updateOffset(this,!0),this._changeInProgress=null)),this}return this._isUTC?a:It(this)},wn.utc=function(e){return this.utcOffset(0,e)},wn.local=function(e){return this._isUTC&&(this.utcOffset(0,e),this._isUTC=!1,e&&this.subtract(It(this),"m")),this},wn.parseZone=function(){if(null!=this._tzm)this.utcOffset(this._tzm,!1,!0);else if("string"==typeof this._i){var e=At(se,this._i);null!=e?this.utcOffset(e):this.utcOffset(0,!0)}return this},wn.hasAlignedHourOffset=function(e){return!!this.isValid()&&(e=e?Ct(e).utcOffset():0,(this.utcOffset()-e)%60==0)},wn.isDST=function(){return this.utcOffset()>this.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()},wn.isLocal=function(){return!!this.isValid()&&!this._isUTC},wn.isUtcOffset=function(){return!!this.isValid()&&this._isUTC},wn.isUtc=Gt,wn.isUTC=Gt,wn.zoneAbbr=function(){return this._isUTC?"UTC":""},wn.zoneName=function(){return this._isUTC?"Coordinated Universal Time":""},wn.dates=Y("dates accessor is deprecated. Use date instead.",mn),wn.months=Y("months accessor is deprecated. Use month instead",Ue),wn.years=Y("years accessor is deprecated. Use year instead",Te),wn.zone=Y("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",function(e,t){return null!=e?("string"!=typeof e&&(e=-e),this.utcOffset(e,t),this):-this.utcOffset()}),wn.isDSTShifted=Y("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",function(){if(!o(this._isDSTShifted))return this._isDSTShifted;var e={};if(g(e,this),(e=Tt(e))._a){var t=e._isUTC?h(e._a):Ct(e._a);this._isDSTShifted=this.isValid()&&M(e._a,t.toArray())>0}else this._isDSTShifted=!1;return this._isDSTShifted});var kn=N.prototype;function Sn(e,t,n,r){var i=ht(),a=h().set(r,t);return i[n](a,e)}function Mn(e,t,n){if(u(e)&&(t=e,e=void 0),e=e||"",null!=t)return Sn(e,t,n,"month");var r,i=[];for(r=0;r<12;r++)i[r]=Sn(e,r,n,"month");return i}function Dn(e,t,n,r){"boolean"==typeof e?(u(t)&&(n=t,t=void 0),t=t||""):(n=t=e,e=!1,u(t)&&(n=t,t=void 0),t=t||"");var i,a=ht(),s=e?a._week.dow:0;if(null!=n)return Sn(t,(n+s)%7,r,"day");var o=[];for(i=0;i<7;i++)o[i]=Sn(t,(i+s)%7,r,"day");return o}kn.calendar=function(e,t,n){var r=this._calendar[e]||this._calendar.sameElse;return P(r)?r.call(t,n):r},kn.longDateFormat=function(e){var t=this._longDateFormat[e],n=this._longDateFormat[e.toUpperCase()];return t||!n?t:(this._longDateFormat[e]=n.replace(/MMMM|MM|DD|dddd/g,function(e){return e.slice(1)}),this._longDateFormat[e])},kn.invalidDate=function(){return this._invalidDate},kn.ordinal=function(e){return this._ordinal.replace("%d",e)},kn.preparse=bn,kn.postformat=bn,kn.relativeTime=function(e,t,n,r){var i=this._relativeTime[n];return P(i)?i(e,t,n,r):i.replace(/%d/i,e)},kn.pastFuture=function(e,t){var n=this._relativeTime[e>0?"future":"past"];return P(n)?n(t):n.replace(/%s/i,t)},kn.set=function(e){var t,n;for(n in e)P(t=e[n])?this[n]=t:this["_"+n]=t;this._config=e,this._dayOfMonthOrdinalParseLenient=new RegExp((this._dayOfMonthOrdinalParse.source||this._ordinalParse.source)+"|"+/\d{1,2}/.source)},kn.months=function(e,t){return e?a(this._months)?this._months[e.month()]:this._months[(this._months.isFormat||Ee).test(t)?"format":"standalone"][e.month()]:a(this._months)?this._months:this._months.standalone},kn.monthsShort=function(e,t){return e?a(this._monthsShort)?this._monthsShort[e.month()]:this._monthsShort[Ee.test(t)?"format":"standalone"][e.month()]:a(this._monthsShort)?this._monthsShort:this._monthsShort.standalone},kn.monthsParse=function(e,t,n){var r,i,a;if(this._monthsParseExact)return function(e,t,n){var r,i,a,s=e.toLocaleLowerCase();if(!this._monthsParse)for(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[],r=0;r<12;++r)a=h([2e3,r]),this._shortMonthsParse[r]=this.monthsShort(a,"").toLocaleLowerCase(),this._longMonthsParse[r]=this.months(a,"").toLocaleLowerCase();return n?"MMM"===t?-1!==(i=xe.call(this._shortMonthsParse,s))?i:null:-1!==(i=xe.call(this._longMonthsParse,s))?i:null:"MMM"===t?-1!==(i=xe.call(this._shortMonthsParse,s))?i:-1!==(i=xe.call(this._longMonthsParse,s))?i:null:-1!==(i=xe.call(this._longMonthsParse,s))?i:-1!==(i=xe.call(this._shortMonthsParse,s))?i:null}.call(this,e,t,n);for(this._monthsParse||(this._monthsParse=[],this._longMonthsParse=[],this._shortMonthsParse=[]),r=0;r<12;r++){if(i=h([2e3,r]),n&&!this._longMonthsParse[r]&&(this._longMonthsParse[r]=new RegExp("^"+this.months(i,"").replace(".","")+"$","i"),this._shortMonthsParse[r]=new RegExp("^"+this.monthsShort(i,"").replace(".","")+"$","i")),n||this._monthsParse[r]||(a="^"+this.months(i,"")+"|^"+this.monthsShort(i,""),this._monthsParse[r]=new RegExp(a.replace(".",""),"i")),n&&"MMMM"===t&&this._longMonthsParse[r].test(e))return r;if(n&&"MMM"===t&&this._shortMonthsParse[r].test(e))return r;if(!n&&this._monthsParse[r].test(e))return r}},kn.monthsRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ae.call(this),e?this._monthsStrictRegex:this._monthsRegex):(d(this,"_monthsRegex")||(this._monthsRegex=Le),this._monthsStrictRegex&&e?this._monthsStrictRegex:this._monthsRegex)},kn.monthsShortRegex=function(e){return this._monthsParseExact?(d(this,"_monthsRegex")||Ae.call(this),e?this._monthsShortStrictRegex:this._monthsShortRegex):(d(this,"_monthsShortRegex")||(this._monthsShortRegex=He),this._monthsShortStrictRegex&&e?this._monthsShortStrictRegex:this._monthsShortRegex)},kn.week=function(e){return $e(e,this._week.dow,this._week.doy).week},kn.firstDayOfYear=function(){return this._week.doy},kn.firstDayOfWeek=function(){return this._week.dow},kn.weekdays=function(e,t){var n=a(this._weekdays)?this._weekdays:this._weekdays[e&&!0!==e&&this._weekdays.isFormat.test(t)?"format":"standalone"];return!0===e?qe(n,this._week.dow):e?n[e.day()]:n},kn.weekdaysMin=function(e){return!0===e?qe(this._weekdaysMin,this._week.dow):e?this._weekdaysMin[e.day()]:this._weekdaysMin},kn.weekdaysShort=function(e){return!0===e?qe(this._weekdaysShort,this._week.dow):e?this._weekdaysShort[e.day()]:this._weekdaysShort},kn.weekdaysParse=function(e,t,n){var r,i,a;if(this._weekdaysParseExact)return function(e,t,n){var r,i,a,s=e.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],r=0;r<7;++r)a=h([2e3,1]).day(r),this._minWeekdaysParse[r]=this.weekdaysMin(a,"").toLocaleLowerCase(),this._shortWeekdaysParse[r]=this.weekdaysShort(a,"").toLocaleLowerCase(),this._weekdaysParse[r]=this.weekdays(a,"").toLocaleLowerCase();return n?"dddd"===t?-1!==(i=xe.call(this._weekdaysParse,s))?i:null:"ddd"===t?-1!==(i=xe.call(this._shortWeekdaysParse,s))?i:null:-1!==(i=xe.call(this._minWeekdaysParse,s))?i:null:"dddd"===t?-1!==(i=xe.call(this._weekdaysParse,s))?i:-1!==(i=xe.call(this._shortWeekdaysParse,s))?i:-1!==(i=xe.call(this._minWeekdaysParse,s))?i:null:"ddd"===t?-1!==(i=xe.call(this._shortWeekdaysParse,s))?i:-1!==(i=xe.call(this._weekdaysParse,s))?i:-1!==(i=xe.call(this._minWeekdaysParse,s))?i:null:-1!==(i=xe.call(this._minWeekdaysParse,s))?i:-1!==(i=xe.call(this._weekdaysParse,s))?i:-1!==(i=xe.call(this._shortWeekdaysParse,s))?i:null}.call(this,e,t,n);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),r=0;r<7;r++){if(i=h([2e3,1]).day(r),n&&!this._fullWeekdaysParse[r]&&(this._fullWeekdaysParse[r]=new RegExp("^"+this.weekdays(i,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[r]=new RegExp("^"+this.weekdaysShort(i,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[r]=new RegExp("^"+this.weekdaysMin(i,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[r]||(a="^"+this.weekdays(i,"")+"|^"+this.weekdaysShort(i,"")+"|^"+this.weekdaysMin(i,""),this._weekdaysParse[r]=new RegExp(a.replace(".",""),"i")),n&&"dddd"===t&&this._fullWeekdaysParse[r].test(e))return r;if(n&&"ddd"===t&&this._shortWeekdaysParse[r].test(e))return r;if(n&&"dd"===t&&this._minWeekdaysParse[r].test(e))return r;if(!n&&this._weekdaysParse[r].test(e))return r}},kn.weekdaysRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||et.call(this),e?this._weekdaysStrictRegex:this._weekdaysRegex):(d(this,"_weekdaysRegex")||(this._weekdaysRegex=Qe),this._weekdaysStrictRegex&&e?this._weekdaysStrictRegex:this._weekdaysRegex)},kn.weekdaysShortRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||et.call(this),e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(d(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Xe),this._weekdaysShortStrictRegex&&e?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)},kn.weekdaysMinRegex=function(e){return this._weekdaysParseExact?(d(this,"_weekdaysRegex")||et.call(this),e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(d(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Ke),this._weekdaysMinStrictRegex&&e?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)},kn.isPM=function(e){return"p"===(e+"").toLowerCase().charAt(0)},kn.meridiem=function(e,t,n){return e>11?n?"pm":"PM":n?"am":"AM"},dt("en",{dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(e){var t=e%10,n=1===S(e%100/10)?"th":1===t?"st":2===t?"nd":3===t?"rd":"th";return e+n}}),i.lang=Y("moment.lang is deprecated. Use moment.locale instead.",dt),i.langData=Y("moment.langData is deprecated. Use moment.localeData instead.",ht);var Yn=Math.abs;function On(e,t,n,r){var i=qt(t,n);return e._milliseconds+=r*i._milliseconds,e._days+=r*i._days,e._months+=r*i._months,e._bubble()}function xn(e){return e<0?Math.floor(e):Math.ceil(e)}function Tn(e){return 4800*e/146097}function Pn(e){return 146097*e/4800}function Cn(e){return function(){return this.as(e)}}var Nn=Cn("ms"),Rn=Cn("s"),En=Cn("m"),Wn=Cn("h"),jn=Cn("d"),Fn=Cn("w"),Un=Cn("M"),Hn=Cn("Q"),Ln=Cn("y");function An(e){return function(){return this.isValid()?this._data[e]:NaN}}var Vn=An("milliseconds"),In=An("seconds"),Gn=An("minutes"),$n=An("hours"),zn=An("days"),qn=An("months"),Zn=An("years"),Bn=Math.round,Jn={ss:44,s:45,m:45,h:22,d:26,M:11},Qn=Math.abs;function Xn(e){return(e>0)-(e<0)||+e}function Kn(){if(!this.isValid())return this.localeData().invalidDate();var e,t,n=Qn(this._milliseconds)/1e3,r=Qn(this._days),i=Qn(this._months);e=k(n/60),t=k(e/60),n%=60,e%=60;var a=k(i/12),s=i%=12,o=r,u=t,l=e,c=n?n.toFixed(3).replace(/\.?0+$/,""):"",d=this.asSeconds();if(!d)return"P0D";var f=d<0?"-":"",h=Xn(this._months)!==Xn(d)?"-":"",m=Xn(this._days)!==Xn(d)?"-":"",p=Xn(this._milliseconds)!==Xn(d)?"-":"";return f+"P"+(a?h+a+"Y":"")+(s?h+s+"M":"")+(o?m+o+"D":"")+(u||l||c?"T":"")+(u?p+u+"H":"")+(l?p+l+"M":"")+(c?p+c+"S":"")}var er=jt.prototype;return er.isValid=function(){return this._isValid},er.abs=function(){var e=this._data;return this._milliseconds=Yn(this._milliseconds),this._days=Yn(this._days),this._months=Yn(this._months),e.milliseconds=Yn(e.milliseconds),e.seconds=Yn(e.seconds),e.minutes=Yn(e.minutes),e.hours=Yn(e.hours),e.months=Yn(e.months),e.years=Yn(e.years),this},er.add=function(e,t){return On(this,e,t,1)},er.subtract=function(e,t){return On(this,e,t,-1)},er.as=function(e){if(!this.isValid())return NaN;var t,n,r=this._milliseconds;if("month"===(e=W(e))||"quarter"===e||"year"===e)switch(t=this._days+r/864e5,n=this._months+Tn(t),e){case"month":return n;case"quarter":return n/3;case"year":return n/12}else switch(t=this._days+Math.round(Pn(this._months)),e){case"week":return t/7+r/6048e5;case"day":return t+r/864e5;case"hour":return 24*t+r/36e5;case"minute":return 1440*t+r/6e4;case"second":return 86400*t+r/1e3;case"millisecond":return Math.floor(864e5*t)+r;default:throw new Error("Unknown unit "+e)}},er.asMilliseconds=Nn,er.asSeconds=Rn,er.asMinutes=En,er.asHours=Wn,er.asDays=jn,er.asWeeks=Fn,er.asMonths=Un,er.asQuarters=Hn,er.asYears=Ln,er.valueOf=function(){return this.isValid()?this._milliseconds+864e5*this._days+this._months%12*2592e6+31536e6*S(this._months/12):NaN},er._bubble=function(){var e,t,n,r,i,a=this._milliseconds,s=this._days,o=this._months,u=this._data;return a>=0&&s>=0&&o>=0||a<=0&&s<=0&&o<=0||(a+=864e5*xn(Pn(o)+s),s=0,o=0),u.milliseconds=a%1e3,e=k(a/1e3),u.seconds=e%60,t=k(e/60),u.minutes=t%60,n=k(t/60),u.hours=n%24,s+=k(n/24),i=k(Tn(s)),o+=i,s-=xn(Pn(i)),r=k(o/12),o%=12,u.days=s,u.months=o,u.years=r,this},er.clone=function(){return qt(this)},er.get=function(e){return e=W(e),this.isValid()?this[e+"s"]():NaN},er.milliseconds=Vn,er.seconds=In,er.minutes=Gn,er.hours=$n,er.days=zn,er.weeks=function(){return k(this.days()/7)},er.months=qn,er.years=Zn,er.humanize=function(e){if(!this.isValid())return this.localeData().invalidDate();var t=this.localeData(),n=function(e,t,n){var r=qt(e).abs(),i=Bn(r.as("s")),a=Bn(r.as("m")),s=Bn(r.as("h")),o=Bn(r.as("d")),u=Bn(r.as("M")),l=Bn(r.as("y")),c=i<=Jn.ss&&["s",i]||i0,c[4]=n,function(e,t,n,r,i){return i.relativeTime(t||1,!!n,e,r)}.apply(null,c)}(this,!e,t);return e&&(n=t.pastFuture(+this,n)),t.postformat(n)},er.toISOString=Kn,er.toString=Kn,er.toJSON=Kn,er.locale=tn,er.localeData=rn,er.toIsoString=Y("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Kn),er.lang=nn,G("X",0,0,"unix"),G("x",0,0,"valueOf"),ce("x",ae),ce("X",/[+-]?\d+(\.\d{1,3})?/),me("X",function(e,t,n){n._d=new Date(1e3*parseFloat(e,10))}),me("x",function(e,t,n){n._d=new Date(S(e))}),i.version="2.24.0",t=Ct,i.fn=wn,i.min=function(){return Et("isBefore",[].slice.call(arguments,0))},i.max=function(){return Et("isAfter",[].slice.call(arguments,0))},i.now=function(){return Date.now?Date.now():+new Date},i.utc=h,i.unix=function(e){return Ct(1e3*e)},i.months=function(e,t){return Mn(e,t,"months")},i.isDate=l,i.locale=dt,i.invalid=y,i.duration=qt,i.isMoment=b,i.weekdays=function(e,t,n){return Dn(e,t,n,"weekdays")},i.parseZone=function(){return Ct.apply(null,arguments).parseZone()},i.localeData=ht,i.isDuration=Ft,i.monthsShort=function(e,t){return Mn(e,t,"monthsShort")},i.weekdaysMin=function(e,t,n){return Dn(e,t,n,"weekdaysMin")},i.defineLocale=ft,i.updateLocale=function(e,t){if(null!=t){var n,r,i=st;null!=(r=ct(e))&&(i=r._config),t=C(i,t),(n=new N(t)).parentLocale=ot[e],ot[e]=n,dt(e)}else null!=ot[e]&&(null!=ot[e].parentLocale?ot[e]=ot[e].parentLocale:null!=ot[e]&&delete ot[e]);return ot[e]},i.locales=function(){return O(ot)},i.weekdaysShort=function(e,t,n){return Dn(e,t,n,"weekdaysShort")},i.normalizeUnits=W,i.relativeTimeRounding=function(e){return void 0===e?Bn:"function"==typeof e&&(Bn=e,!0)},i.relativeTimeThreshold=function(e,t){return void 0!==Jn[e]&&(void 0===t?Jn[e]:(Jn[e]=t,"s"===e&&(Jn.ss=t-1),!0))},i.calendarFormat=function(e,t){var n=e.diff(t,"days",!0);return n<-6?"sameElse":n<-1?"lastWeek":n<0?"lastDay":n<1?"sameDay":n<2?"nextDay":n<7?"nextWeek":"sameElse"},i.prototype=wn,i.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},i}()}));const D="/Users/jtobin/src/urbit/pkg/interface/weather/tile/tile.js";class Y extends S{constructor(e){super(e),this.state={latlng:"",manualEntry:!1,error:!1};window.api}locationSubmit(){navigator.geolocation.getCurrentPosition(e=>{let t=`${e.coords.latitude},${e.coords.longitude}`;this.setState({latlng:t},e=>{console.log(e)},{maximumAge:1/0,timeout:1e4}),api.action("clock","json",t),api.action("weather","json",t),this.setState({manualEntry:!this.state.manualEntry})})}manualLocationSubmit(){event.preventDefault();let e=document.getElementById("gps").value.replace(/\s+/g,"");if(!/-?[0-9]+(?:\.[0-9]*)?,-?[0-9]+(?:\.[0-9]*)?/g.test(e))return this.setState({error:!0}),!1;{let t=e;this.setState({latlng:t},e=>{console.log(e)},{maximumAge:1/0,timeout:1e4}),api.action("clock","json",t),api.action("weather","json",t),this.setState({manualEntry:!this.state.manualEntry})}}setColors(e){let t={gradient1:"",gradient2:"",text:""};switch(e.daily.icon){case"clear-day":t={gradient1:"#A5CEF0",gradient2:"#FEF4E0",text:"black"};break;case"clear-night":t={gradient1:"#56668e",gradient2:"#000080",text:"white"};break;case"rain":t={gradient1:"#b1b2b3",gradient2:"#b0c7ff",text:"black"};break;case"snow":case"sleet":t={gradient1:"#eee",gradient2:"#f9f9f9",text:"black"};break;case"wind":case"fog":t={gradient1:"#eee",gradient2:"#fff",text:"black"};break;case"cloudy":t={gradient1:"#eee",gradient2:"#b1b2b3",text:"black"};break;case"partly-cloudy-day":t={gradient1:"#fcc440",gradient2:"#b1b2b3",text:"black"};break;case"partly-cloudy-night":t={gradient1:"#7f7f7f",gradient2:"#56668e",text:"white"};break;default:t={gradient1:"white",gradient2:"white",text:"black"}}return t}renderWrapper(e,t={gradient1:"white",gradient2:"white",text:"black"}){return k.createElement("div",{className:"relative "+t.text,style:{width:126,height:126,background:`linear-gradient(135deg, ${t.gradient1} 0%,`+`${t.gradient2} 45%, ${t.gradient2} 65%,`+`${t.gradient1} 100%)`},__self:this,__source:{fileName:D,lineNumber:118}},e)}renderManualEntry(){let e,t;return!0===this.state.error&&(t=k.createElement("p",{className:"f9 red2 pt1",__self:this,__source:{fileName:D,lineNumber:136}},"Please try again.")),"https:"===location.protocol&&(e=k.createElement("a",{className:"black white-d f9 absolute pointer",style:{right:8,top:8},onClick:()=>this.locationSubmit(),__self:this,__source:{fileName:D,lineNumber:141}},"Detect ->")),this.renderWrapper(k.createElement("div",{className:"pa2 w-100 h-100 bg-white bg-gray0-d black white-d b--black b--gray1-d ba",__self:this,__source:{fileName:D,lineNumber:147}},k.createElement("a",{className:"f9 black white-d pointer",onClick:()=>this.setState({manualEntry:!this.state.manualEntry}),__self:this,__source:{fileName:D,lineNumber:149}},"<-"),e,k.createElement("p",{className:"f9 pt2",__self:this,__source:{fileName:D,lineNumber:157}},"Please enter your"," ",k.createElement("a",{className:"black white-d",href:"https://latitudeandlongitude.org/",target:"_blank",__self:this,__source:{fileName:D,lineNumber:159}},"latitude and longitude"),"."),t,k.createElement("div",{className:"absolute",style:{left:8,bottom:8},__self:this,__source:{fileName:D,lineNumber:168}},k.createElement("form",{className:"flex",style:{marginBlockEnd:0},__self:this,__source:{fileName:D,lineNumber:169}},k.createElement("input",{id:"gps",className:"w-100 black white-d bg-transparent bn f9",type:"text",placeholder:"29.558107, -95.089023",onKeyDown:e=>{"Enter"===e.key&&(e.preventDefault(),this.manualLocationSubmit(e.target.value))},__self:this,__source:{fileName:D,lineNumber:170}}),k.createElement("input",{className:"bg-transparent black white-d bn pointer f9 flex-shrink-0",type:"submit",onClick:()=>this.manualLocationSubmit(),value:"->",__self:this,__source:{fileName:D,lineNumber:181}})))))}renderNoData(){return this.renderWrapper(k.createElement("div",{className:"pa2 w-100 h-100 b--black b--gray1-d ba bg-white bg-gray0-d black white-d",onClick:()=>this.setState({manualEntry:!this.state.manualEntry}),__self:this,__source:{fileName:D,lineNumber:195}},k.createElement("p",{className:"f9 absolute",style:{left:8,top:8},__self:this,__source:{fileName:D,lineNumber:199}},"Weather"),k.createElement("p",{className:"absolute w-100 flex-col f9",style:{verticalAlign:"bottom",bottom:8,left:8,cursor:"pointer"},__self:this,__source:{fileName:D,lineNumber:203}},"-> Set location")))}renderWithData(e,t){let n=e.currently,r=e.daily.data[0],i=M.unix(r.sunsetTime).format("h:mm a")||"";return this.renderWrapper(k.createElement("div",{className:"w-100 h-100 b--black b--gray1-d ba",style:{backdropFilter:"blur(80px)"},__self:this,__source:{fileName:D,lineNumber:218}},k.createElement("p",{className:"f9 absolute",style:{left:8,top:8},__self:this,__source:{fileName:D,lineNumber:220}},"Weather"),k.createElement("a",{className:"f9 absolute pointer",style:{right:8,top:8},onClick:()=>this.setState({manualEntry:!this.state.manualEntry}),__self:this,__source:{fileName:D,lineNumber:223}},"->"),k.createElement("div",{className:"w-100 absolute",style:{left:8,bottom:8},__self:this,__source:{fileName:D,lineNumber:231}},k.createElement("p",{className:"f9",__self:this,__source:{fileName:D,lineNumber:232}},n.summary),k.createElement("p",{className:"f9 pt1",__self:this,__source:{fileName:D,lineNumber:233}},Math.round(n.temperature),"°"),k.createElement("p",{className:"f9 pt1",__self:this,__source:{fileName:D,lineNumber:234}},"Sunset at ",i))),t)}render(){let e=this.props.data?this.props.data:{};if(!0===this.state.manualEntry)return this.renderManualEntry();if("currently"in e&&"daily"in e){let t=this.setColors(e);return this.renderWithData(e,t)}return this.renderNoData()}}return window.weatherTile=Y,Y});