diff --git a/content/js/meteorogram/meteorogram.js b/content/js/meteorogram/meteorogram.js index 964ac9cc9303ecdf647f044375d3efe498ce0306..89bf1e22e3048741d04c4aa856e5f980263441a4 100644 --- a/content/js/meteorogram/meteorogram.js +++ b/content/js/meteorogram/meteorogram.js @@ -1 +1 @@ -!function(n){var r={};function i(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}i.m=n,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([function(t,Q,e){(function(V,Z){var J;!function(){function n(){}var t="object"==typeof self&&self.self===self&&self||"object"==typeof V&&V.global===V&&V||this||{},e=t._,r=Array.prototype,a=Object.prototype,p="undefined"!=typeof Symbol?Symbol.prototype:null,i=r.push,l=r.slice,f=a.toString,o=a.hasOwnProperty,s=Array.isArray,c=Object.keys,u=Object.create,d=function(t){return t instanceof d?t:this instanceof d?void(this._wrapped=t):new d(t)};Q.nodeType?t._=d:(!Z.nodeType&&Z.exports&&(Q=Z.exports=d),Q._=d),d.VERSION="1.9.1";function h(i,o,t){if(void 0===o)return i;switch(null==t?3:t){case 1:return function(t){return i.call(o,t)};case 3:return function(t,e,n){return i.call(o,t,e,n)};case 4:return function(t,e,n,r){return i.call(o,t,e,n,r)}}return function(){return i.apply(o,arguments)}}function v(t,e,n){return d.iteratee!==y?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?h(t,e,n):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)}var y;d.iteratee=y=function(t,e){return v(t,e,1/0)};function m(a,s){return s=null==s?a.length-1:+s,function(t,e){for(var n=Math.max(arguments.length-s,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+s];switch(s){case 0:return a.call(this,r);case 1:return a.call(this,t,r);case 2:return a.call(this,t,e,r)}var o=Array(s+1);for(i=0;i<s;i++)o[i]=arguments[i];return o[s]=r,a.apply(this,o)}}function g(t){if(!d.isObject(t))return{};if(u)return u(t);n.prototype=t;var e=new n;return n.prototype=null,e}function b(e){return function(t){return null==t?void 0:t[e]}}function x(t,e){return null!=t&&o.call(t,e)}function _(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function k(t){var e=T(t);return"number"==typeof e&&0<=e&&e<=w}var w=Math.pow(2,53)-1,T=b("length");d.each=d.forEach=function(t,e,n){var r,i;if(e=h(e,n),k(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=d.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},d.map=d.collect=function(t,e,n){e=v(e,n);for(var r=!k(t)&&d.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o};function M(l){return function(t,e,n,r){var i=3<=arguments.length;return function(t,e,n,r){var i=!k(t)&&d.keys(t),o=(i||t).length,a=0<l?0:o-1;for(r||(n=t[i?i[a]:a],a+=l);0<=a&&a<o;a+=l){var s=i?i[a]:a;n=e(n,t[s],s,t)}return n}(t,h(e,r,4),n,i)}}d.reduce=d.foldl=d.inject=M(1),d.reduceRight=d.foldr=M(-1),d.find=d.detect=function(t,e,n){var r=(k(t)?d.findIndex:d.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},d.filter=d.select=function(t,r,e){var i=[];return r=v(r,e),d.each(t,function(t,e,n){r(t,e,n)&&i.push(t)}),i},d.reject=function(t,e,n){return d.filter(t,d.negate(v(e)),n)},d.every=d.all=function(t,e,n){e=v(e,n);for(var r=!k(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},d.some=d.any=function(t,e,n){e=v(e,n);for(var r=!k(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},d.contains=d.includes=d.include=function(t,e,n,r){return k(t)||(t=d.values(t)),"number"==typeof n&&!r||(n=0),0<=d.indexOf(t,e,n)},d.invoke=m(function(t,n,r){var i,o;return d.isFunction(n)?o=n:d.isArray(n)&&(i=n.slice(0,-1),n=n[n.length-1]),d.map(t,function(t){var e=o;if(!e){if(i&&i.length&&(t=_(t,i)),null==t)return;e=t[n]}return null==e?e:e.apply(t,r)})}),d.pluck=function(t,e){return d.map(t,d.property(e))},d.where=function(t,e){return d.filter(t,d.matcher(e))},d.findWhere=function(t,e){return d.find(t,d.matcher(e))},d.max=function(t,r,e){var n,i,o=-1/0,a=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=k(t)?t:d.values(t)).length;s<l;s++)null!=(n=t[s])&&o<n&&(o=n);else r=v(r,e),d.each(t,function(t,e,n){i=r(t,e,n),(a<i||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},d.min=function(t,r,e){var n,i,o=1/0,a=1/0;if(null==r||"number"==typeof r&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=k(t)?t:d.values(t)).length;s<l;s++)null!=(n=t[s])&&n<o&&(o=n);else r=v(r,e),d.each(t,function(t,e,n){((i=r(t,e,n))<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},d.shuffle=function(t){return d.sample(t,1/0)},d.sample=function(t,e,n){if(null==e||n)return k(t)||(t=d.values(t)),t[d.random(t.length-1)];var r=k(t)?d.clone(t):d.values(t),i=T(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=d.random(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)},d.sortBy=function(t,r,e){var i=0;return r=v(r,e),d.pluck(d.map(t,function(t,e,n){return{value:t,index:i++,criteria:r(t,e,n)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(r<n||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};function j(a,e){return function(r,i,t){var o=e?[[],[]]:{};return i=v(i,t),d.each(r,function(t,e){var n=i(t,e,r);a(o,t,n)}),o}}d.groupBy=j(function(t,e,n){x(t,n)?t[n].push(e):t[n]=[e]}),d.indexBy=j(function(t,e,n){t[n]=e}),d.countBy=j(function(t,e,n){x(t,n)?t[n]++:t[n]=1});var S=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(t){return t?d.isArray(t)?l.call(t):d.isString(t)?t.match(S):k(t)?d.map(t,d.identity):d.values(t):[]},d.size=function(t){return null==t?0:k(t)?t.length:d.keys(t).length},d.partition=j(function(t,e,n){t[n?0:1].push(e)},!0),d.first=d.head=d.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:d.initial(t,t.length-e)},d.initial=function(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},d.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:d.rest(t,Math.max(0,t.length-e))},d.rest=d.tail=d.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},d.compact=function(t){return d.filter(t,Boolean)};var O=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,a=T(t);o<a;o++){var s=t[o];if(k(s)&&(d.isArray(s)||d.isArguments(s)))if(e)for(var l=0,c=s.length;l<c;)r[i++]=s[l++];else O(s,e,n,r),i=r.length;else n||(r[i++]=s)}return r};d.flatten=function(t,e){return O(t,e,!1)},d.without=m(function(t,e){return d.difference(t,e)}),d.uniq=d.unique=function(t,e,n,r){d.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=v(n,r));for(var i=[],o=[],a=0,s=T(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?d.contains(o,c)||(o.push(c),i.push(l)):d.contains(i,l)||i.push(l)}return i},d.union=m(function(t){return d.uniq(O(t,!0,!0))}),d.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=T(t);r<i;r++){var o=t[r];if(!d.contains(e,o)){var a;for(a=1;a<n&&d.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},d.difference=m(function(t,e){return e=O(e,!0,!0),d.filter(t,function(t){return!d.contains(e,t)})}),d.unzip=function(t){for(var e=t&&d.max(t,T).length||0,n=Array(e),r=0;r<e;r++)n[r]=d.pluck(t,r);return n},d.zip=m(d.unzip),d.object=function(t,e){for(var n={},r=0,i=T(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};function D(o){return function(t,e,n){e=v(e,n);for(var r=T(t),i=0<o?0:r-1;0<=i&&i<r;i+=o)if(e(t[i],i,t))return i;return-1}}d.findIndex=D(1),d.findLastIndex=D(-1),d.sortedIndex=function(t,e,n,r){for(var i=(n=v(n,r,1))(e),o=0,a=T(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o};function P(o,a,s){return function(t,e,n){var r=0,i=T(t);if("number"==typeof n)0<o?r=0<=n?n:Math.max(n+i,r):i=0<=n?Math.min(n+1,i):n+i+1;else if(s&&n&&i)return t[n=s(t,e)]===e?n:-1;if(e!=e)return 0<=(n=a(l.call(t,r,i),d.isNaN))?n+r:-1;for(n=0<o?r:i-1;0<=n&&n<i;n+=o)if(t[n]===e)return n;return-1}}d.indexOf=P(1,d.findIndex,d.sortedIndex),d.lastIndexOf=P(-1,d.findLastIndex),d.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},d.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(l.call(t,r,r+=e));return n};function I(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=g(t.prototype),a=t.apply(o,i);return d.isObject(a)?a:o}d.bind=m(function(e,n,r){if(!d.isFunction(e))throw new TypeError("Bind must be called on a function");var i=m(function(t){return I(e,i,n,this,r.concat(t))});return i}),d.partial=m(function(i,o){var a=d.partial.placeholder,s=function(){for(var t=0,e=o.length,n=Array(e),r=0;r<e;r++)n[r]=o[r]===a?arguments[t++]:o[r];for(;t<arguments.length;)n.push(arguments[t++]);return I(i,s,this,this,n)};return s}),(d.partial.placeholder=d).bindAll=m(function(t,e){var n=(e=O(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=d.bind(t[r],t)}}),d.memoize=function(r,i){var o=function(t){var e=o.cache,n=""+(i?i.apply(this,arguments):t);return x(e,n)||(e[n]=r.apply(this,arguments)),e[n]};return o.cache={},o},d.delay=m(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(n,r,i){var o,a,s,l,c=0;i||(i={});function u(){c=!1===i.leading?0:d.now(),o=null,l=n.apply(a,s),o||(a=s=null)}function t(){var t=d.now();c||!1!==i.leading||(c=t);var e=r-(t-c);return a=this,s=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),c=t,l=n.apply(a,s),o||(a=s=null)):o||!1===i.trailing||(o=setTimeout(u,e)),l}return t.cancel=function(){clearTimeout(o),c=0,o=a=s=null},t},d.debounce=function(n,r,i){function o(t,e){a=null,e&&(s=n.apply(t,e))}var a,s,t=m(function(t){if(a&&clearTimeout(a),i){var e=!a;a=setTimeout(o,r),e&&(s=n.apply(this,t))}else a=d.delay(o,r,this,t);return s});return t.cancel=function(){clearTimeout(a),a=null},t},d.wrap=function(t,e){return d.partial(e,t)},d.negate=function(t){return function(){return!t.apply(this,arguments)}},d.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},d.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},d.before=function(t,e){var n;return function(){return 0<--t&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},d.once=d.partial(d.before,2),d.restArguments=m;function E(t,e){var n=A.length,r=t.constructor,i=d.isFunction(r)&&r.prototype||a,o="constructor";for(x(t,o)&&!d.contains(e,o)&&e.push(o);n--;)(o=A[n])in t&&t[o]!==i[o]&&!d.contains(e,o)&&e.push(o)}var $=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];d.keys=function(t){if(!d.isObject(t))return[];if(c)return c(t);var e=[];for(var n in t)x(t,n)&&e.push(n);return $&&E(t,e),e},d.allKeys=function(t){if(!d.isObject(t))return[];var e=[];for(var n in t)e.push(n);return $&&E(t,e),e},d.values=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},d.mapObject=function(t,e,n){e=v(e,n);for(var r=d.keys(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o},d.pairs=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},d.invert=function(t){for(var e={},n=d.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},d.functions=d.methods=function(t){var e=[];for(var n in t)d.isFunction(t[n])&&e.push(n);return e.sort()};function C(l,c){return function(t){var e=arguments.length;if(c&&(t=Object(t)),e<2||null==t)return t;for(var n=1;n<e;n++)for(var r=arguments[n],i=l(r),o=i.length,a=0;a<o;a++){var s=i[a];c&&void 0!==t[s]||(t[s]=r[s])}return t}}d.extend=C(d.allKeys),d.extendOwn=d.assign=C(d.keys),d.findKey=function(t,e,n){e=v(e,n);for(var r,i=d.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r};function z(t,e,n){return e in n}var N,F;d.pick=m(function(t,e){var n={},r=e[0];if(null==t)return n;d.isFunction(r)?(1<e.length&&(r=h(r,e[1])),e=d.allKeys(t)):(r=z,e=O(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n}),d.omit=m(function(t,n){var e,r=n[0];return d.isFunction(r)?(r=d.negate(r),1<n.length&&(e=n[1])):(n=d.map(O(n,!1,!1),String),r=function(t,e){return!d.contains(n,e)}),d.pick(t,r,e)}),d.defaults=C(d.allKeys,!0),d.create=function(t,e){var n=g(t);return e&&d.extendOwn(n,e),n},d.clone=function(t){return d.isObject(t)?d.isArray(t)?t.slice():d.extend({},t):t},d.tap=function(t,e){return e(t),t},d.isMatch=function(t,e){var n=d.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0},N=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"==i||"object"==i||"object"==typeof e)&&F(t,e,n,r)},F=function(t,e,n,r){t instanceof d&&(t=t._wrapped),e instanceof d&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return p.valueOf.call(t)===p.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(d.isFunction(a)&&a instanceof a&&d.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!N(t[l],e[l],n,r))return!1}else{var c,u=d.keys(t);if(l=u.length,d.keys(e).length!==l)return!1;for(;l--;)if(c=u[l],!x(e,c)||!N(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},d.isEqual=function(t,e){return N(t,e)},d.isEmpty=function(t){return null==t||(k(t)&&(d.isArray(t)||d.isString(t)||d.isArguments(t))?0===t.length:0===d.keys(t).length)},d.isElement=function(t){return!(!t||1!==t.nodeType)},d.isArray=s||function(t){return"[object Array]"===f.call(t)},d.isObject=function(t){var e=typeof t;return"function"==e||"object"==e&&!!t},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){d["is"+e]=function(t){return f.call(t)==="[object "+e+"]"}}),d.isArguments(arguments)||(d.isArguments=function(t){return x(t,"callee")});var U=t.document&&t.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof U&&(d.isFunction=function(t){return"function"==typeof t||!1}),d.isFinite=function(t){return!d.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},d.isNaN=function(t){return d.isNumber(t)&&isNaN(t)},d.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},d.isNull=function(t){return null===t},d.isUndefined=function(t){return void 0===t},d.has=function(t,e){if(!d.isArray(e))return x(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!o.call(t,i))return!1;t=t[i]}return!!n},d.noConflict=function(){return t._=e,this},d.identity=function(t){return t},d.constant=function(t){return function(){return t}},d.noop=function(){},d.property=function(e){return d.isArray(e)?function(t){return _(t,e)}:b(e)},d.propertyOf=function(e){return null==e?function(){}:function(t){return d.isArray(t)?_(e,t):e[t]}},d.matcher=d.matches=function(e){return e=d.extendOwn({},e),function(t){return d.isMatch(t,e)}},d.times=function(t,e,n){var r=Array(Math.max(0,t));e=h(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},d.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},d.now=Date.now||function(){return(new Date).getTime()};function H(e){function n(t){return e[t]}var t="(?:"+d.keys(e).join("|")+")",r=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,n):t}}var L={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},B=d.invert(L);d.escape=H(L),d.unescape=H(B),d.result=function(t,e,n){d.isArray(e)||(e=[e]);var r=e.length;if(!r)return d.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=d.isFunction(o)?o.call(t):o}return t};var R=0;d.uniqueId=function(t){var e=++R+"";return t?t+e:e},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function W(t){return"\\"+Y[t]}var q=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g;d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var n,r=RegExp([(t.escape||q).source,(t.interpolate||q).source,(t.evaluate||q).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(r,function(t,e,n,r,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":r&&(s+="';\n"+r+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}function i(t){return n.call(this,t,d)}var l=t.variable||"obj";return i.source="function("+l+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};function K(t,e){return t._chain?d(e).chain():e}d.mixin=function(n){return d.each(d.functions(n),function(t){var e=d[t]=n[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),K(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var n=r[e];d.prototype[e]=function(){var t=this._wrapped;return n.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],K(this,t)}}),d.each(["concat","join","slice"],function(t){var e=r[t];d.prototype[t]=function(){return K(this,e.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},void 0===(J=function(){return d}.apply(Q,[]))||(Z.exports=J)}()}).call(this,e(32),e(33)(t))},function(t){"use strict";function l(t,e){var n=parseInt(t.substring(6,10)),r=parseInt(t.substring(0,3)),i=parseInt(t.substring(3,5)),o=parseInt(e.substring(0,2)),a=parseInt(e.substring(3,5)),s=parseInt(e.substring(6,8));return new Date(n,r,i,o,a,s)}function c(){$("#Plot").prop("disabled",!0)}function a(t,e,n,r){if("--"==(i=$("#interval option:selected")).text());else{var i,o=l(t,n),a=(l(e,r)-o)/1e3,s=(i=$("#interval option:selected")).data("seconds");a=Math.floor(a/s);0<=a&&a<60?($("#prompt_user").html("a "+i.text()+" interval would plot about "+a.toString()+" data points; that's too few - please try again"),$("#default").attr("selected","selected"),c()):a<0?($("#prompt_user").html("The end date is before the start date. Please choose a later end date."),$("#default").attr("selected","selected")):1e3<a?($("#prompt_user").html("a "+i.text()+" interval would plot about "+a.toString()+" data points; that's too many - please try again"),$("#default").attr("selected","selected"),c()):($("#prompt_user").html("a "+i.text()+" interval would plot about "+a.toString()+" data points."),$("#Plot").prop("disabled",!1))}}t.exports.loading=function(){},t.exports.disable=function(){$("#Start-date-picker").prop("disabled",!0),$("#Start-time-picker").prop("disabled",!0),$("#End-date-picker").prop("disabled",!0),$("#End-time-picker").prop("disabled",!0),$("#interval").prop("disabled",!0),$("#Plot").prop("disabled",!0)},t.exports.enable=function(){$("#Start-date-picker").prop("disabled",!1),$("#Start-time-picker").prop("disabled",!1),$("#End-date-picker").prop("disabled",!1),$("#End-time-picker").prop("disabled",!1),$("#interval").prop("disabled",!1)},t.exports.checkInterval=function(){var t=$("#Start-date-picker").val(),e=$("#End-date-picker").val(),n=$("#Start-time-picker").val(),r=$("#End-time-picker").val(),i=$("#interval"),o=$("#interval option:selected");t&&e&&n&&r||"--"==o.text()||($("#prompt_user").html("Please fill out all other fields before filling out the interval field"),$("#default").attr("selected","selected")),a(t,e,n,r,i)}},function(t,e,n){"use strict";var r=n(19)();t.exports=function(t){return t!==r&&null!==t}},function(t){t.exports=Plotly},function(t,e,n){"use strict";var i=n(0);function p(t){return 1.8*t+32}function r(t){return t}String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,e){return void 0!==n[e]?n[e]:t})});var o={null:r,undefined:r,getF:p,getPresInHg:function(t){return.02952998751*t},getSpeedMPH:function(t){return 3600*t/1608},getAccumMillimeter:function(t){return 25.4*t},cardinalWDir:function(t){return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor((t+11.25)%360/22.5)]},getSpeedKTS:function(t){return 1.94384*t}};function c(t,e,n){var r;return null===t?r=t="":(r="yaxis2"in e&&"convert_value"in e.yaxis2?(r=o[e.yaxis2.convert_value](t)).toFixed?r.toFixed(e.yaxis2.precision):r:void 0,t=(t=o[e.yaxis.convert_value](t)).toFixed?t.toFixed(e.yaxis.precision):t),"yaxis2"in e&&void 0!==r?"{0}: {1}{2} ({3}{4})".format(n.name,t,e.yaxis.units,r,e.yaxis2.units):"{0}: {1}{2}".format(n.name,t,e.yaxis.units)}function a(t,e,n,r){for(var i=[],o=0;o<t.length;o++)i.push(c(t[o],e,n));return i}var s={undefined:a,null:a,dewpoint:function(t,e,n,r){var i,o=[],a=void 0;"anc_variables"in n&&1==n.anc_variables.length&&(a=r[n.anc_variables[0]]);var s=n.anc_info[n.anc_variables[0]];s||(s={name:n.anc_variables[0],units:"",precision:2});for(var l=0;l<t.length;l++)i=c(t[l],e,n),void 0!==a&&(i+="<br>{0}: {1}{2}".format(s.name,a[l]?a[l].toFixed(s.precision):"",s.units)),o.push(i);return o},water_temp:function(t,e,n){for(var r,i,o,a,s,l=[],c=0;c<t.length;c++){i=t[c],a=[],s=n.y[c];for(var u=0;u<i.length;u++)o=i[u],r="Depth: {0}m<br>{1}: {2} °C ({3} °F)".format(s.toFixed(1),n.name,null!==o?o.toFixed(3):"N/A",null!==o?p(o).toFixed(3):"N/A"),a.push(r);l.push(a)}return l}};t.exports.getTickVals=function(t,e){var n=.02*(e-t),r=((e+=n)-(t-=n))/4;return i.range(t,e+r,r)},t.exports.getProbeText=function(t,e,n,r){return"probe_text"in n?s[n.probe_text](t,e,n,r):a(t,e,n)},t.exports.getTickText=function(t,e){for(var n=[],r=0;r<t.length;r++){var i=o[e.convert_value](t[r]);i=i.toFixed?i.toFixed(e.precision):i,n.push(i)}return n}},function(t){"use strict";t.exports.buildRequestUrl=function(t,e,n,r,i,o,a){var s=METOBS_API_URL+"/api/data."+t+"?";return s+="interval="+e,s+="&epoch="+n,s+="&sep="+r||!1,s+="&order="+i,s+=o,s+="&symbols="+a}},function(t,e,n){"use strict";function _(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var k=n(3),w=n(4),T=n(0);function M(t,e,n,r){var i,o,a,s,l,c,u,p=0==r?"yaxis":"yaxis2",f={};!function(t,e,n){var r=new Date(t[0].x[t[0].x.length-1]),i=Number(r.toLocaleString("en-US",{hour:"numeric",hour12:!1}));document.getElementById("overlay").style.opacity=0<i&&i<5?1:0;var o=r.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).replace(/,([^,]*)$/,"$1"),a=Number(r.getUTCMonth());a=a<9?"0"+(a+1):a+1;var s=Number(r.getUTCDate())<9?"0"+r.getUTCDate():r.getUTCDate(),l=Number(r.getUTCMinutes())<9?"0"+r.getUTCMinutes():r.getUTCMinutes(),c=Number(r.getUTCSeconds())<9?"0"+r.getUTCSeconds():r.getUTCSeconds(),u=r.getUTCFullYear()+"-"+a+"-"+s+" "+r.getUTCHours()+":"+l+":"+c,p=0==e?"327.5 meters":"1074.5 feet";n["annotations.1.text"]="Data last recorded at: "+u+"Z ["+o+" Local] RIG Elevation = "+p}(t,r,f);for(var d=0;d<t.length;d++)if(l=0==d?"":d+1,s=t[d].x,f["xaxis"+l+".tickvals"]=[s[0],s[Math.round(s.length/2)],s[s.length-1]],i=t[d].plot_name,o=n.plots[i],a=w.getTickText([t[d].y[t[d].y.length-1]],o[p])[0],f["annotations["+(3+2*d)+"].text"]=a+""+o[p].units,null!=(u=e.layout["yaxis"+l].tickvals)){if("wind_direction"==i||"rel_hum"==i)c=o[p].ticktext;else{c=[];for(var h=0;h<u.length;h++)c.push(w.getTickText([u[h]],o[p]))}f["yaxis"+l+".ticktext"]=c}k.relayout(e,f),function(){var t={north:"east",east:"south",south:"west",west:"north"}[document.getElementById("roofCam").src.split("/")[7]];document.getElementById("roofCam").alt=document.getElementById("dirText").innerHTML=t,document.getElementById("roofCam").src=METOBS_API_URL+"/pub/cache/aoss/cameras/"+t+"/latest_orig.jpg?t="+(new Date).getTime()}()}function j(t,e,n,r,i,o){if("aoss.tower.rel_hum"!=n&&"aoss.tower.wind_direction"!=n){0==t.y.length?(t.yMin=Math.min.apply(Math,_(e)),t.yMax=Math.max.apply(Math,_(e))):(t.yMin=Math.min.apply(Math,_(e).concat([t.yMin])),t.yMax=Math.max.apply(Math,_(e).concat([t.yMax])));var a=t.yMax-t.yMin,s=t.yMin-a,l="aoss.tower.solar_flux"==n?t.yMax:t.yMax+a;0==a&&(0<l?(l*=1.1,s*=.9):l<0?(l*=.9,s*=1.1):s=-(l=.1));var c=s;"aoss.tower.air_temp"!=n&&"aoss.tower.dewpoint"!=n&&s<=0&&(c=s=0),s-=.075*a+.001,r[i+".tickvals"]=[c,c+(l-c)/4,c+2*(l-c)/4,c+3*(l-c)/4,l],r[i+".range"]=[s,l]}else r[i+".tickvals"]=o}t.exports.updatePlot=function(t,e,n,r,i,o){!function(o,t,a,s,e,n){var r,l,c,u,p,f,d=s.dates,i=[],h=!1,v=[],y={x:[],y:[],text:[]},m=[],g={x:[],z:[],text:[]},b=0,x={};for(c=0;c<o.length;c++)r=o[c].plot_name,i[i.length-1]!=r&&(l=a.plots[r],T.each(l.traces,function(e,t){if("contour"==o[b+t].type){var n;g.x.push(d),m.push(b+t),p=T.map(e.var_names,function(t){return s[t]}),(n=o[c].text).push.apply(n,_(w.getProbeText(p,l,e,s)));for(var r=0;r<e.var_names.length;r++){for(var i;r>=o[c].z.length;)o[c].z.push([]);(i=o[c].z[r]).push.apply(i,_(s[e.var_names[r]]))}g.z.push(o[c].z),g.text.push(o[c].text)}else y.x.push(d),v.push(b+t),T.each(e.var_names,function(t){a.isLobbyDisplay&&(f=0==c?"":c+1,j(o[c],s[t],t,x,"yaxis"+f,l.yaxis2.tickvals)),y.y.push(s[t]),u="probe_text"in e&&null===e.probe_text?[void 0]:w.getProbeText(s[t],l,e,s),y.text.push(u)})}),b+=l.traces.length,i.push(r));if(0<v.length&&k.extendTraces(t,y,v),0<m.length)for(k.extendTraces(t,g,m),c=0;c<m.length;c++)o[m[c]].z.splice(0,o[m[c]].y.length),o[m[c]].text.splice(0,o[m[c]].y.length);0!=n||e||(n=s.dates.length,h=!0),0<n&&o[0].x.length>n&&function(t,e){for(var n=0;n<t.length;n++){if(t[n].x.splice(0,e),t[n].hasOwnProperty("z"))for(var r=0;r<t[n].z.length;r++)t[n].z[r].splice(0,e);else t[n].hasOwnProperty("y")&&t[n].y.splice(0,e);t[n].hasOwnProperty("text")&&t[n].text.splice(0,e)}}(o,o[0].x.length-n),0!=Object.keys(x).length&&(k.relayout(t,x),e||M(o,t,a,0)),h&&k.redraw(t)}(t,e,n,r,i,o)},t.exports.changeUnits=M},function(t,e,n){"use strict";var i=n(8),o=n(10);n(0);window.MeteorogramController=function(t,e,n){var r=o.getDispatcher();return{plotDiv:t,controlDiv:e,dataCache:[],initMeteorogram:function(t,e){this.hasGraph=!0,this.plotDiv=t||this.plotDiv,r.dispatch({status:"initPlot",emit:"plotEmitter",location:this.plotDiv,dataCache:this.dataCache,plotsInfo:n,plotOrder:e})},initMeteorogramTable:function(t,e){this.hasTable=!0,this.tableDiv=t||this.plotDiv,r.dispatch({status:"initTable",emit:"plotEmitter",location:this.tableDiv,plotsInfo:n,plotOrder:e})},initMeteorogramControls:function(){i(this.controlDiv,this.plotDiv,r)},displayRealTime:function(){this.hasTable&&r.dispatch({status:"update_table",emit:"plotEmitter",time:"-3:00:00",location:this.tableDiv}),this.hasGraph&&r.dispatch({status:"get_since_now",emit:"plotEmitter",time:"-3:00:00",location:this.plotDiv})},showPlot:function(t){r.dispatch({status:"show"+t,emit:"checkboxEmitter",location:this.div})},hidePlot:function(t){r.dispatch({status:"hide"+t,emit:"checkboxEmitter",location:this.div})},displayRecent:function(t){r.dispatch({status:"get_since_now",emit:"plotEmitter",time:t})},displayTimeRange:function(t,e,n){r.dispatch({status:"get_between_dates",emit:"plotEmitter",start:t,end:e,interval:n||"auto"})}}}},function(t,e,n){"use strict";n(1);var r=n(9);function i(t,e){$(t+" #plot-btn").click(function(){!function(t){t.dispatch({status:"get_between_dates",emit:"plotEmitter",start:$("#Start-date-picker").val().split(" ").join("T")+":00",end:$("#End-date-picker").val().split(" ").join("T")+":00",interval:"auto"})}(e)}),$(t+" #dropDownId").change(function(){!function(t,e){if("realtime"==t)e.dispatch({status:"get_since_now",emit:"plotEmitter",time:"-3:00:00"});else{e.dispatch({status:"get_since_now",emit:"plotEmitter",time:t})}}($(this).val(),e)})}function o(t,e){$(e+" #dropDownId").prop("disabled","recent"!=t),$(e+" #interval").prop("disabled","range"!=t),$(e+" #Start-date-picker").prop("disabled","range"!=t),$(e+" #End-date-picker").prop("disabled","range"!=t),$(e+" #Start-time-picker").prop("disabled","range"!=t),$(e+" #End-time-picker").prop("disabled","range"!=t),$(e+" #plot-btn").prop("disabled","range"!=t)}function a(t,e,n){var r="#"+t;!function(t){$(t+" #Start-date-picker").datetimepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",timeFormat:"HH:mm",showSecond:!1,showMillisec:!1,showMicrosec:!1}),$(t+" #End-date-picker").datetimepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",timeFormat:"HH:mm",showSecond:!1,showMillisec:!1,showMicrosec:!1}),$(t+" [type=text]").prop("disabled",!0),$(t+" select").prop("disabled",!0),$(t+" #last_x_days").click(function(){o("recent",t)}),$(t+" #date_range").click(function(){o("range",t)}),$(t+" #last_x_days").trigger("click")}(r),i(r,n)}$(document).ready(function(){}),t.exports=function(t,e,n){$("#"+t).append(r.controlPanelTemplate),a(t,0,n)}},function(t){"use strict";t.exports={controlPanelTemplate:'<div class="row" id="control-panel-row"><div id="show-hide-boxes" class="col-md-12"></div><div class = "col-md-9"><div class="row" style="padding: 0 1em;"><div class="form-group"><table style="width:100%"><tr><td><div class="radio"><label><input type="radio" id="last_x_days" name="time_select">Recent Data:</label></div></td><td><select class="form-control" id="dropDownId"><option selected value="realtime">Realtime Update</option><option value="-1:00:00">Past 1 Hour</option><option value="-2:00:00">Past 2 Hours</option><option value="-3:00:00">Past 3 Hours</option><option value="-6:00:00">Past 6 Hours</option><option value="-12:00:00">Past 12 Hours</option><option value="-18:00:00">Past 18 Hours</option><option value="-24:00:00">Past 24 Hours</option><option value="-96:00:00">Past 4 Days</option></select></td><td style="padding-left:.5em"><div class="radio"><label><input type="radio" id="date_range" name="time_select">Date Range:</label></div></td><td><input class="form-control" style="padding 0.5em 0;" id="Start-date-picker" type="text" placeholder="YYYY-MM-DD"/></td><td>to </td><td><input class="form-control" style="padding 0.5em 0;" id="End-date-picker" type="text" placeholder="YYYY-MM-DD"/></td><td><button class="btn btn-primary btn-block" id="plot-btn">Plot</button></td></tr></table></div></div></div></div>',checkboxTemplates:{"aoss.tower":'<div class="form-group"><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="temp">Temperature + Dewpoint</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="pres">Pressure</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wS">Wind Speed</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wD">Wind Direction</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="aP">Precipitation</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="sF">Solar Flux</label></div>',"mendota.buoy":'<div class="form-group"><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="temp">Temperature + Dewpoint</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="rh">Relative Humidity</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wS">Wind Speed</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wD">Wind Direction</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="chlor">Chlorophyll</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="phyco">Phycocyanin</label></div>'}}},function(t,e,n){"use strict";var u,r=n(11),p=n(27),f=n(30),d=n(31),h=n(34),v=n(1),y=n(6);t.exports.getDispatcher=function(){var i=new p.Dispatcher;function o(){360<(u+=.2*(2*Math.min(120-u%120,u%120)/60+1))&&(u=0),document.getElementById("row1").style.backgroundColor="hsl("+u+",100%,15%)",document.getElementById("row2").style.backgroundColor="hsl("+u+",75%,30%)",document.getElementById("row3").style.backgroundColor="hsl("+u+",50%,45%)"}i.GRAPH_HEIGHT=170;var a=r({visible:{},setPlots:function(t){for(var e in t)this.visible[e]=!0},setShowing:function(t,e){this.showing[t]=void 0===e?!this.showing[t]:e},getShowing:function(t){return this.showing[t]},handleActions:function(t){"checkboxEmitter"==t.emit&&this.emit(t.status,t.location)}});a.dispatchToken=i.register(a.handleActions.bind(a));var t=r({handleActions:function(t){"plotEmitter"==t.emit&&(i.waitFor([a.dispatchToken]),void 0!==t.location&&(this.div=t.location),void 0!==t.plotsInfo&&(this.plotsInfo=t.plotsInfo,this.plotOrder=this.plotsInfo.defaultPlots),void 0!==t.plotOrder&&(this.plotOrder=t.plotOrder),void 0!==t.dataCache&&(this.dataCache=t.dataCache),"get_since_now"==t.status?(this.plotsInfo.isLobbyDisplay&&(t.time="-6:00:00"),this.emit(t.status,t.time,this.plotsInfo,this.dataCache,this.div)):"update_table"==t.status?this.emit(t.status,t.time,this.plotsInfo,this.div):"get_between_dates"==t.status?this.emit(t.status,t.start,t.end,t.interval,this.plotsInfo,this.dataCache,this.div):"initPlot"==t.status?this.emit(t.status,t.location,t.plotOrder?t.plotOrder:this.plotOrder,this.plotsInfo,this.dataCache):"initTable"==t.status?this.emit(t.status,t.location,t.plotOrder?t.plotOrder:this.plotOrder,this.plotsInfo):"update"==t.status?this.emit(t.status,this.div,this.plotsInfo,this.dataCache,t.startTime):"changeUnits"==t.status?this.emit(t.status,this.div,this.plotsInfo,this.dataCache,t.unitCount):this.emit(t.status,t.userInfo))}});function s(t){if(t.progress||(t.progress={}),t.progress.validID){var e=t.progress.id[0];clearInterval(e),t.isLobbyDisplay&&(clearInterval(t.progress.colorID),clearInterval(t.progress.lobbyID)),t.progress.validID=!1}}var l={"1m":3e4,"5m":15e4,"1h":18e5};function c(t,e,n){n.progress||(n.progress={}),s(n),void 0===t&&(t=n.progress.id[1]),void 0===e&&(e=n.progress.id[2]);var r=setInterval(function(t){return function(){i.dispatch({status:"update",emit:"plotEmitter",startTime:t})}}(t),l[e]);n.isLobbyDisplay&&(u=Number(getComputedStyle(document.getElementById("color")).getPropertyValue("--starting-hue")),n.progress.colorID=setInterval(o,1e3),n.progress.lobbyID=setInterval(function(t){return function(){t=(t+1)%2,i.dispatch({status:"changeUnits",emit:"plotEmitter",unitCount:t})}}(0),5e3)),n.progress.id=[r,t,e],n.progress.validID=!0}return t.on("initTable",function(t,e,n){a.setPlots(n),d.initTable(t,e,n)}),t.on("update_table",function(t,e,n){d.requestTableUpdate(n,e),setInterval(function(){d.requestTableUpdate(n,e)},l["1m"])}),t.on("initPlot",function(t,e,n,r){a.setPlots(n),f.initPlot(r,t,e,n)}),t.on("get_since_now",function(t,e,n,r){c(t,h.requestPlotUpdate(n,r,e,t,void 0,void 0,void 0,s),e)}),t.on("get_between_dates",function(t,e,n,r,i,o){s(r),h.requestPlotUpdate(i,o,r,t,e,n)}),t.on("update",function(t,e,n,r){h.requestPlotUpdate(n,t,e,r,void 0,void 0,!0)}),t.on("changeUnits",function(t,e,n,r){y.changeUnits(n,document.getElementById(t),e,r)}),t.on("checking_custom",function(){v.checkInterval()}),t.dispatchToken=i.register(t.handleActions.bind(t)),i}},function(t,e,n){"use strict";var i,r,o,a,s,l,c,u=n(12),p=n(26),f=Function.prototype.apply,d=Function.prototype.call,h=Object.create,v=Object.defineProperty,y=Object.defineProperties,m=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n,r;return p(e),i.call(r=this,t,n=function(){o.call(r,t,n),f.call(e,this,arguments)}),n.__eeOnceListener__=e,this},s={on:i=function(t,e){var n;return p(e),m.call(this,"__ee__")?n=this.__ee__:(n=g.value=h(null),v(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r,off:o=function(t,e){var n,r,i,o;if(p(e),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:a=function(t,e,n){var r,i,o,a,s;if(m.call(this,"__ee__")&&(a=this.__ee__[t]))if("object"==typeof a){for(i=arguments.length,s=new Array(i-1),r=1;r<i;++r)s[r-1]=arguments[r];for(a=a.slice(),r=0;o=a[r];++r)f.call(o,this,s)}else switch(arguments.length){case 1:d.call(a,this);break;case 2:d.call(a,this,e);break;case 3:d.call(a,this,e,n);break;default:for(i=arguments.length,s=new Array(i-1),r=1;r<i;++r)s[r-1]=arguments[r];f.call(a,this,s)}}},l={on:u(i),once:u(r),off:u(o),emit:u(a)},c=y({},l),t.exports=e=function(t){return null==t?h(c):y(Object(t),l)},e.methods=s},function(t,e,n){"use strict";var l=n(13),c=n(21),u=n(22),p=n(23);(t.exports=function(t,e,n){var r,i,o,a,s;return arguments.length<2||"string"!=typeof t?(a=e,e=t,t=null):a=n,null==t?(r=o=!0,i=!1):(r=p.call(t,"c"),i=p.call(t,"e"),o=p.call(t,"w")),s={value:e,configurable:r,enumerable:i,writable:o},a?l(c(a),s):s}).gs=function(t,e,n,r){var i,o,a,s;return"string"!=typeof t?(a=n,n=e,e=t,t=null):a=r,null==e?e=void 0:u(e)?null==n?n=void 0:u(n)||(a=n,n=void 0):(a=e,e=n=void 0),o=null==t?!(i=!0):(i=p.call(t,"c"),p.call(t,"e")),s={get:e,set:n,configurable:i,enumerable:o},a?l(c(a),s):s}},function(t,e,n){"use strict";t.exports=n(14)()?Object.assign:n(15)},function(t){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var a=n(16),s=n(20),l=Math.max;t.exports=function(e,n){var r,t,i,o=l(arguments.length,2);for(e=Object(s(e)),i=function(t){try{e[t]=n[t]}catch(t){r||(r=t)}},t=1;t<o;++t)a(n=arguments[t]).forEach(i);if(void 0!==r)throw r;return e}},function(t,e,n){"use strict";t.exports=n(17)()?Object.keys:n(18)},function(t){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(2),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";var r=n(2),i=Array.prototype.forEach,o=Object.create;t.exports=function(){var e=o(null);return i.call(arguments,function(t){r(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)}),e}},function(t){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=n(24)()?String.prototype.contains:n(25)},function(t){"use strict";var e="razdwatrzy";t.exports=function(){return"function"==typeof e.contains&&(!0===e.contains("dwa")&&!1===e.contains("foo"))}},function(t){"use strict";var n=String.prototype.indexOf;t.exports=function(t,e){return-1<n.call(this,t,e)}},function(t){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){t.exports.Dispatcher=n(28)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(29),i=(o.prototype.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},o.prototype.unregister=function(t){this._callbacks[t]||r(!1),delete this._callbacks[t]},o.prototype.waitFor=function(t){this._isDispatching||r(!1);for(var e=0;e<t.length;e++){var n=t[e];this._isPending[n]?this._isHandled[n]||r(!1):(this._callbacks[n]||r(!1),this._invokeCallback(n))}},o.prototype.dispatch=function(t){this._isDispatching&&r(!1),this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},o.prototype.isDispatching=function(){return this._isDispatching},o.prototype._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},o.prototype._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},o.prototype._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},o);function o(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}t.exports=i},function(t){"use strict";t.exports=function(t,e,n,r,i,o,a,s){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],u=0;(l=new Error(e.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $=n(3),A=n(1);function C(t,e,n,r){for(var i,o={gridcolor:"#777777",titlefont:{size:12},title:n.title,zeroline:!1,overlaying:"y"+(t-1).toString(),side:"right",anchor:"x"},a=0;a<r.length;a++)(i=r[a])in n&&(o[i]=n[i]);return o}t.exports.initPlot=function(t,e,n,r){var i=n.length,o={title:r.title,showlegend:!1,height:170*i+180};Object.assign(o,r.layout),o.xaxis={domain:[0,1],showline:!1,zeroline:!1,showticklabels:0<i,gridcolor:"#777777",showgrid:!1,tickformat:"%Y-%m-%d %H:%MZ"};for(var a,s,l,c,u,p,f,d,h,v,y,m,g,b,x,_,k,w=0,T=1/i,M=w,j=["marker","color","mode","zmin","zmax","y","contours","line","colorscale","showscale","colorbar","tick0","dtick","hovermode"],S=["nticks","range","autorange","zeroline","showgrid","tickmode","ticktext","tickvals"],O=0;O<n.length;O++){p=n[O],M=w+=1,a=(s=r.plots[p]).yaxis,d=[(n.length-1-O)*T*1.03,1-O*T*1.05],r.isLobbyDisplay&&(d=[.82-8/75-(.2+8/75)*Math.floor(O/3),.82-(.2+8/75)*Math.floor(O/3)]);for(var D=0;D<s.traces.length;D++){c={name:(l=s.traces[D]).name,x:[],y:[],text:[],type:l.type?l.type:"scatter",xaxis:r.isLobbyDisplay?"x"+w:"x1",yaxis:"y"+w,hoverinfo:"x+text",hovermode:"closest",var_names:l.var_names,anc_variables:l.anc_variables,anc_data:[],plot_name:p,trace_index:D},l.isSecondAxis&&(c.yaxis="y"+(w+D));for(var P=0;P<j.length;P++)(f=j[P])in l&&(c[f]=l[f]);"colorbar"in c&&(c.colorbar.len=d[1]-d[0],c.colorbar.y=(d[1]-d[0])/2+d[0],c.z=[]),t.push(c)}for(u={gridcolor:"#777777",titlefont:{size:12},title:a.title,zeroline:!1,domain:d},r.isLobbyDisplay&&(h=o,v=u,y=w,m=O,g=d[1],b=l.name,x=r.rowTextSize,k=_=void 0,h["xaxis"+y]={ticktext:["-6h","-3h","Now"],tickfont:{size:x/5},showline:!0,linecolor:"white",anchor:"y"+y,domain:[.1+1/3*(m%3)*(1+Math.floor(m/6)),14/60+1/3*(m%3)*(1+Math.floor(m/6))],zeroline:!1,showgrid:!1},h.annotations.push((E(_={font:{size:x/2},showarrow:!1,align:"center",x:1/6+1/3*(m%3)*(1+Math.floor(m/6)),y:g+.04,xref:"paper",yref:"paper"},"showarrow",!0),E(_,"arrowhead",0),E(_,"ax",0),E(_,"ay",0),_)),h.annotations.push((E(k={text:b,font:{size:x/4},showarrow:!1,align:"center",x:1/6+1/3*(m%3)*(1+Math.floor(m/6)),y:g+.085,xref:"paper",yref:"paper"},"showarrow",!0),E(k,"arrowhead",0),E(k,"ax",0),E(k,"ay",0),k)),delete v.title,v.tickfont={size:x/5},v.showgrid=!1,v.showticklabels=!0,v.anchor="x"+y,v.showline=!0,v.linecolor="white"),P=0;P<S.length;P++)(f=S[P])in a&&(u[f]=a[f]);o["yaxis"+w]=u,!r.isLobbyDisplay&&"yaxis2"in s&&!s.yaxis2.skip&&(u=C(w+=1,0,a=s.yaxis2,S),o["yaxis"+w]=u)}o.xaxis.anchor="y"+M;var I={showLink:!1,displaylogo:!1,displayModeBar:!0,responsive:!0};r.isLobbyDisplay&&(delete o.xaxis,I={responsive:!0}),$.plot(e,t,o,I),A.loading()}},function(t,e,n){"use strict";var x=n(4),c=n(5);function h(t,e,n,r){for(var i=0;i<r.anc_variables.length;i++){var o=r.anc_info[r.anc_variables[i]],a=$("<td>N/A</td>");a.addClass("met_data"),a.data("info",{key:e,idx:n,anc_idx:i});var s=$("<tr></tr>"),l=o.short_name||o.name;s.append("<td>"+l+"</td>"),s.append(a),s.append('<td class="convert"></td>'),t.append(s)}}function v(t,e,n,r,i){var o='<tr><td colspan="2">'+(c=r.short_name||r.name)+"</td><td></td>";t.append(o);for(var a=0;a<r.y_highlight.length;a++){var s=r.y_highlight[a],l=$("<tr></tr>"),c=r.y[s]+i.yaxis.units;l.append('<td class="subtitle text-center">'+c+"</td>");var u=$("<td>N/A</td>");u.addClass("met_data"),u.data("info",{key:e,idx:n,hl_idx:s}),l.append(u),l.append('<td class="convert"></td>'),t.append(l)}}function _(t,e,n,r,i){for(var o=0;o<r.y_highlight.length;o++){var a=r.y_highlight[o],s=t[r.var_names[a]][0],l=r.zprobe.units,c=x.getTickText([s],r.zprobe),u="";if(r.zprobe2&&r.zprobe2.convert_value){var p=r.zprobe2.units;u=x.getTickText([s],r.zprobe2)+p}e[i].innerHTML=c+l,n[i].innerHTML=u,i+=1}return i}function k(t,e,n,r){for(var i=0;i<n.anc_variables.length;i++){var o=n.anc_variables[i],a=n.anc_info[o],s=t[o][0],l=x.getTickText([s],a);e[r].innerHTML=s||0==s?l+a.units:"N/A",r+=1}return r}t.exports.initTable=function(t,e,n){for(var r,i,o=$("#"+t),a=$('<table class="met_table"><tbody></tbody></table>'),s=a.children("tbody"),l=0;l<e.length;l++){i=e[l],r=n.plots[i];for(var c=0;c<r.traces.length;c++){var u=r.traces[c];if("contour"==u.type)v(s,i,c,u,r);else{var p=$("<td>N/A</td>");p.addClass("met_data"),p.data("info",{key:i,idx:c});var f=$("<tr></tr>"),d=u.short_name||u.name;if("Wind Direction Card"==d)continue;f.append("<td>"+d+"</td>"),f.append(p),f.append('<td class="convert"></td>'),s.append(f),u.anc_variables&&h(s,i,c,u)}}}o.append("<h3>"+n.title+"</h3>"),o.append(a),o.append('<span id="timestamp"></span>')},t.exports.requestTableUpdate=function(e,o){$("#"+e);var a,s=[],l=[],n=$("#"+e+" .met_data"),r=$("#"+e+" .convert");n.each(function(){var t=$(this).data("info").key,e=$(this).data("info").idx,n=$(this).data("info").anc_idx,r=$(this).data("info").hl_idx,i=o.plots[t].traces[e];-1==l.indexOf(t)&&l.push(t),a=void 0!==n?i.anc_variables[0]:void 0!==r?i.var_names[r]:i.var_names[0],s.includes(a)||s.push(a)});var t=s.join(":"),i=c.buildRequestUrl("json","1m","","","column","&begin=-00:04:00",t);$.ajax({type:"GET",url:i,jsonp:"callback",dataType:"jsonp",success:function(t){t.div_id=e,t.plotOrder=l,t.data_cells=n,t.convert_cells=r,function(t,e){var n,r,i=t.results.data,o=0,a=t.div_id,s=t.plotOrder,l=t.data_cells,c=t.convert_cells;if(0==t.num_results)return $("#"+a+" #timestamp").html("No recent data");$("#"+a+" #timestamp").html("Last updated: "+t.results.timestamps[0]);for(var u=0;u<s.length;u++){r=s[u],n=e.plots[r];for(var p=0;p<n.traces.length;p++){var f=n.traces[p];if("Wind Direction Card"!=f.name)if("contour"==f.type)o=_(i,l,c,f,o);else{var d=i[f.var_names[0]][0];if(d||0==d){var h=n.yaxis.units,v="",y=n.yaxis.precision;n.yaxis.precision=Math.min(y,1);var m=x.getTickText([d],n.yaxis);if(n.yaxis.precision=y,n.yaxis2&&n.yaxis2.convert_value!=n.yaxis.convert_value){var g=n.yaxis2.units;y=n.yaxis2.precision;n.yaxis2.precision=Math.min(y,1);var b=x.getTickText([d],n.yaxis2);n.yaxis2.precision=y,v=b+g}l[o].innerHTML=m+h,c[o].innerHTML=v}else l[o].innerHTML="N/A",c[o].innerHTML="";o+=1,f.anc_variables&&(o=k(i,l,f,o))}}}}(t,o)}})}},function(t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var h=n(6),v=n(5),y=n(0);function m(s,t,l,c,u,p,f,d){$.ajax({type:"GET",url:t,jsonp:"callback",dataType:"jsonp",success:function(t){if(200!=t.code)return console.error("Invalid data API query. Code: {0} | Message: {1}".format(t.code,t.message)),void(void 0!==d&&d(c));var e=document.getElementById(u),n=function(t){var e={dates:y.map(t.timestamps,function(t){return t})};return y.extend(e,t.data),e}(t.results),r=s[0].x||[],i=n.dates;if(0!=(t={dates:i}).dates.length){if(p){for(var o=0;o<i.length&&i[o]<=r[r.length-1];)o++;if(o>=i.length)return void console.info("No new data downloaded");for(var a=0;a<l.length;a++)t[l[a]]=n[l[a]].slice(o);i=i.slice(o),t.dates=i}else for(a=0;a<l.length;a++)t[l[a]]=n[l[a]];h.updatePlot(s,e,c,t,p,f)}else console.warn("No data available from API")}})}var g=[[864e5,"5m","-00:10:00"],[2592e6,"1h","-02:00:00"]],b={"1m":60,"5m":300,"1h":3600};t.exports.requestPlotUpdate=function(t,e,n,r,i,o,a,s){var l,c,u,p,f=function(t){var e=[];return y.each(t,function(t){Array.prototype.push.apply(e,t.var_names),"anc_variables"in t&&Array.prototype.push.apply(e,t.anc_variables)}),y.uniq(e)}(t),d="";for(var h in f)d+=f[h],h<f.length-1&&(d+=":");if(i){if(p="&begin="+r+"&end="+i,"auto"==o)for(var h in o="1m",l=new Date(i)-new Date(r),g)l>=g[h][0]&&(o=g[h][1])}else{for(var h in o="1m",l=-36e5*(c=y.map(r.split(":"),Number))[0]+6e4*c[1]+1e3*c[2],g)l>=g[h][0]&&(o=g[h][1],a&&(r=g[h][2]));p="&begin="+r}return u=a?b.hasOwnProperty(o)?l/1e3/b[o]:250:0,m(t,v.buildRequestUrl("json",o,"","","column",p,d),f,n,e,a,u,s),o}}]); \ No newline at end of file +!function(n){var r={};function i(t){if(r[t])return r[t].exports;var e=r[t]={i:t,l:!1,exports:{}};return n[t].call(e.exports,e,e.exports,i),e.l=!0,e.exports}i.m=n,i.c=r,i.d=function(t,e,n){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},i.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(e,t){if(1&t&&(e=i(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(i.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)i.d(n,r,function(t){return e[t]}.bind(null,r));return n},i.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s=7)}([function(t,Q,e){(function(V,Z){var J;!function(){function n(){}var t="object"==typeof self&&self.self===self&&self||"object"==typeof V&&V.global===V&&V||this||{},e=t._,r=Array.prototype,a=Object.prototype,p="undefined"!=typeof Symbol?Symbol.prototype:null,i=r.push,l=r.slice,f=a.toString,o=a.hasOwnProperty,s=Array.isArray,c=Object.keys,u=Object.create,d=function(t){return t instanceof d?t:this instanceof d?void(this._wrapped=t):new d(t)};Q.nodeType?t._=d:(!Z.nodeType&&Z.exports&&(Q=Z.exports=d),Q._=d),d.VERSION="1.9.1";function h(i,o,t){if(void 0===o)return i;switch(null==t?3:t){case 1:return function(t){return i.call(o,t)};case 3:return function(t,e,n){return i.call(o,t,e,n)};case 4:return function(t,e,n,r){return i.call(o,t,e,n,r)}}return function(){return i.apply(o,arguments)}}function v(t,e,n){return d.iteratee!==y?d.iteratee(t,e):null==t?d.identity:d.isFunction(t)?h(t,e,n):d.isObject(t)&&!d.isArray(t)?d.matcher(t):d.property(t)}var y;d.iteratee=y=function(t,e){return v(t,e,1/0)};function m(a,s){return s=null==s?a.length-1:+s,function(t,e){for(var n=Math.max(arguments.length-s,0),r=Array(n),i=0;i<n;i++)r[i]=arguments[i+s];switch(s){case 0:return a.call(this,r);case 1:return a.call(this,t,r);case 2:return a.call(this,t,e,r)}var o=Array(s+1);for(i=0;i<s;i++)o[i]=arguments[i];return o[s]=r,a.apply(this,o)}}function g(t){if(!d.isObject(t))return{};if(u)return u(t);n.prototype=t;var e=new n;return n.prototype=null,e}function b(e){return function(t){return null==t?void 0:t[e]}}function x(t,e){return null!=t&&o.call(t,e)}function _(t,e){for(var n=e.length,r=0;r<n;r++){if(null==t)return;t=t[e[r]]}return n?t:void 0}function k(t){var e=T(t);return"number"==typeof e&&0<=e&&e<=w}var w=Math.pow(2,53)-1,T=b("length");d.each=d.forEach=function(t,e,n){var r,i;if(e=h(e,n),k(t))for(r=0,i=t.length;r<i;r++)e(t[r],r,t);else{var o=d.keys(t);for(r=0,i=o.length;r<i;r++)e(t[o[r]],o[r],t)}return t},d.map=d.collect=function(t,e,n){e=v(e,n);for(var r=!k(t)&&d.keys(t),i=(r||t).length,o=Array(i),a=0;a<i;a++){var s=r?r[a]:a;o[a]=e(t[s],s,t)}return o};function M(l){return function(t,e,n,r){var i=3<=arguments.length;return function(t,e,n,r){var i=!k(t)&&d.keys(t),o=(i||t).length,a=0<l?0:o-1;for(r||(n=t[i?i[a]:a],a+=l);0<=a&&a<o;a+=l){var s=i?i[a]:a;n=e(n,t[s],s,t)}return n}(t,h(e,r,4),n,i)}}d.reduce=d.foldl=d.inject=M(1),d.reduceRight=d.foldr=M(-1),d.find=d.detect=function(t,e,n){var r=(k(t)?d.findIndex:d.findKey)(t,e,n);if(void 0!==r&&-1!==r)return t[r]},d.filter=d.select=function(t,r,e){var i=[];return r=v(r,e),d.each(t,function(t,e,n){r(t,e,n)&&i.push(t)}),i},d.reject=function(t,e,n){return d.filter(t,d.negate(v(e)),n)},d.every=d.all=function(t,e,n){e=v(e,n);for(var r=!k(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(!e(t[a],a,t))return!1}return!0},d.some=d.any=function(t,e,n){e=v(e,n);for(var r=!k(t)&&d.keys(t),i=(r||t).length,o=0;o<i;o++){var a=r?r[o]:o;if(e(t[a],a,t))return!0}return!1},d.contains=d.includes=d.include=function(t,e,n,r){return k(t)||(t=d.values(t)),"number"==typeof n&&!r||(n=0),0<=d.indexOf(t,e,n)},d.invoke=m(function(t,n,r){var i,o;return d.isFunction(n)?o=n:d.isArray(n)&&(i=n.slice(0,-1),n=n[n.length-1]),d.map(t,function(t){var e=o;if(!e){if(i&&i.length&&(t=_(t,i)),null==t)return;e=t[n]}return null==e?e:e.apply(t,r)})}),d.pluck=function(t,e){return d.map(t,d.property(e))},d.where=function(t,e){return d.filter(t,d.matcher(e))},d.findWhere=function(t,e){return d.find(t,d.matcher(e))},d.max=function(t,r,e){var n,i,o=-1/0,a=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=k(t)?t:d.values(t)).length;s<l;s++)null!=(n=t[s])&&o<n&&(o=n);else r=v(r,e),d.each(t,function(t,e,n){i=r(t,e,n),(a<i||i===-1/0&&o===-1/0)&&(o=t,a=i)});return o},d.min=function(t,r,e){var n,i,o=1/0,a=1/0;if(null==r||"number"==typeof r&&"object"!=typeof t[0]&&null!=t)for(var s=0,l=(t=k(t)?t:d.values(t)).length;s<l;s++)null!=(n=t[s])&&n<o&&(o=n);else r=v(r,e),d.each(t,function(t,e,n){((i=r(t,e,n))<a||i===1/0&&o===1/0)&&(o=t,a=i)});return o},d.shuffle=function(t){return d.sample(t,1/0)},d.sample=function(t,e,n){if(null==e||n)return k(t)||(t=d.values(t)),t[d.random(t.length-1)];var r=k(t)?d.clone(t):d.values(t),i=T(r);e=Math.max(Math.min(e,i),0);for(var o=i-1,a=0;a<e;a++){var s=d.random(a,o),l=r[a];r[a]=r[s],r[s]=l}return r.slice(0,e)},d.sortBy=function(t,r,e){var i=0;return r=v(r,e),d.pluck(d.map(t,function(t,e,n){return{value:t,index:i++,criteria:r(t,e,n)}}).sort(function(t,e){var n=t.criteria,r=e.criteria;if(n!==r){if(r<n||void 0===n)return 1;if(n<r||void 0===r)return-1}return t.index-e.index}),"value")};function j(a,e){return function(r,i,t){var o=e?[[],[]]:{};return i=v(i,t),d.each(r,function(t,e){var n=i(t,e,r);a(o,t,n)}),o}}d.groupBy=j(function(t,e,n){x(t,n)?t[n].push(e):t[n]=[e]}),d.indexBy=j(function(t,e,n){t[n]=e}),d.countBy=j(function(t,e,n){x(t,n)?t[n]++:t[n]=1});var S=/[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;d.toArray=function(t){return t?d.isArray(t)?l.call(t):d.isString(t)?t.match(S):k(t)?d.map(t,d.identity):d.values(t):[]},d.size=function(t){return null==t?0:k(t)?t.length:d.keys(t).length},d.partition=j(function(t,e,n){t[n?0:1].push(e)},!0),d.first=d.head=d.take=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[0]:d.initial(t,t.length-e)},d.initial=function(t,e,n){return l.call(t,0,Math.max(0,t.length-(null==e||n?1:e)))},d.last=function(t,e,n){return null==t||t.length<1?null==e?void 0:[]:null==e||n?t[t.length-1]:d.rest(t,Math.max(0,t.length-e))},d.rest=d.tail=d.drop=function(t,e,n){return l.call(t,null==e||n?1:e)},d.compact=function(t){return d.filter(t,Boolean)};var O=function(t,e,n,r){for(var i=(r=r||[]).length,o=0,a=T(t);o<a;o++){var s=t[o];if(k(s)&&(d.isArray(s)||d.isArguments(s)))if(e)for(var l=0,c=s.length;l<c;)r[i++]=s[l++];else O(s,e,n,r),i=r.length;else n||(r[i++]=s)}return r};d.flatten=function(t,e){return O(t,e,!1)},d.without=m(function(t,e){return d.difference(t,e)}),d.uniq=d.unique=function(t,e,n,r){d.isBoolean(e)||(r=n,n=e,e=!1),null!=n&&(n=v(n,r));for(var i=[],o=[],a=0,s=T(t);a<s;a++){var l=t[a],c=n?n(l,a,t):l;e&&!n?(a&&o===c||i.push(l),o=c):n?d.contains(o,c)||(o.push(c),i.push(l)):d.contains(i,l)||i.push(l)}return i},d.union=m(function(t){return d.uniq(O(t,!0,!0))}),d.intersection=function(t){for(var e=[],n=arguments.length,r=0,i=T(t);r<i;r++){var o=t[r];if(!d.contains(e,o)){var a;for(a=1;a<n&&d.contains(arguments[a],o);a++);a===n&&e.push(o)}}return e},d.difference=m(function(t,e){return e=O(e,!0,!0),d.filter(t,function(t){return!d.contains(e,t)})}),d.unzip=function(t){for(var e=t&&d.max(t,T).length||0,n=Array(e),r=0;r<e;r++)n[r]=d.pluck(t,r);return n},d.zip=m(d.unzip),d.object=function(t,e){for(var n={},r=0,i=T(t);r<i;r++)e?n[t[r]]=e[r]:n[t[r][0]]=t[r][1];return n};function D(o){return function(t,e,n){e=v(e,n);for(var r=T(t),i=0<o?0:r-1;0<=i&&i<r;i+=o)if(e(t[i],i,t))return i;return-1}}d.findIndex=D(1),d.findLastIndex=D(-1),d.sortedIndex=function(t,e,n,r){for(var i=(n=v(n,r,1))(e),o=0,a=T(t);o<a;){var s=Math.floor((o+a)/2);n(t[s])<i?o=s+1:a=s}return o};function P(o,a,s){return function(t,e,n){var r=0,i=T(t);if("number"==typeof n)0<o?r=0<=n?n:Math.max(n+i,r):i=0<=n?Math.min(n+1,i):n+i+1;else if(s&&n&&i)return t[n=s(t,e)]===e?n:-1;if(e!=e)return 0<=(n=a(l.call(t,r,i),d.isNaN))?n+r:-1;for(n=0<o?r:i-1;0<=n&&n<i;n+=o)if(t[n]===e)return n;return-1}}d.indexOf=P(1,d.findIndex,d.sortedIndex),d.lastIndexOf=P(-1,d.findLastIndex),d.range=function(t,e,n){null==e&&(e=t||0,t=0),n||(n=e<t?-1:1);for(var r=Math.max(Math.ceil((e-t)/n),0),i=Array(r),o=0;o<r;o++,t+=n)i[o]=t;return i},d.chunk=function(t,e){if(null==e||e<1)return[];for(var n=[],r=0,i=t.length;r<i;)n.push(l.call(t,r,r+=e));return n};function I(t,e,n,r,i){if(!(r instanceof e))return t.apply(n,i);var o=g(t.prototype),a=t.apply(o,i);return d.isObject(a)?a:o}d.bind=m(function(e,n,r){if(!d.isFunction(e))throw new TypeError("Bind must be called on a function");var i=m(function(t){return I(e,i,n,this,r.concat(t))});return i}),d.partial=m(function(i,o){var a=d.partial.placeholder,s=function(){for(var t=0,e=o.length,n=Array(e),r=0;r<e;r++)n[r]=o[r]===a?arguments[t++]:o[r];for(;t<arguments.length;)n.push(arguments[t++]);return I(i,s,this,this,n)};return s}),(d.partial.placeholder=d).bindAll=m(function(t,e){var n=(e=O(e,!1,!1)).length;if(n<1)throw new Error("bindAll must be passed function names");for(;n--;){var r=e[n];t[r]=d.bind(t[r],t)}}),d.memoize=function(r,i){var o=function(t){var e=o.cache,n=""+(i?i.apply(this,arguments):t);return x(e,n)||(e[n]=r.apply(this,arguments)),e[n]};return o.cache={},o},d.delay=m(function(t,e,n){return setTimeout(function(){return t.apply(null,n)},e)}),d.defer=d.partial(d.delay,d,1),d.throttle=function(n,r,i){var o,a,s,l,c=0;i||(i={});function u(){c=!1===i.leading?0:d.now(),o=null,l=n.apply(a,s),o||(a=s=null)}function t(){var t=d.now();c||!1!==i.leading||(c=t);var e=r-(t-c);return a=this,s=arguments,e<=0||r<e?(o&&(clearTimeout(o),o=null),c=t,l=n.apply(a,s),o||(a=s=null)):o||!1===i.trailing||(o=setTimeout(u,e)),l}return t.cancel=function(){clearTimeout(o),c=0,o=a=s=null},t},d.debounce=function(n,r,i){function o(t,e){a=null,e&&(s=n.apply(t,e))}var a,s,t=m(function(t){if(a&&clearTimeout(a),i){var e=!a;a=setTimeout(o,r),e&&(s=n.apply(this,t))}else a=d.delay(o,r,this,t);return s});return t.cancel=function(){clearTimeout(a),a=null},t},d.wrap=function(t,e){return d.partial(e,t)},d.negate=function(t){return function(){return!t.apply(this,arguments)}},d.compose=function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},d.after=function(t,e){return function(){if(--t<1)return e.apply(this,arguments)}},d.before=function(t,e){var n;return function(){return 0<--t&&(n=e.apply(this,arguments)),t<=1&&(e=null),n}},d.once=d.partial(d.before,2),d.restArguments=m;function E(t,e){var n=A.length,r=t.constructor,i=d.isFunction(r)&&r.prototype||a,o="constructor";for(x(t,o)&&!d.contains(e,o)&&e.push(o);n--;)(o=A[n])in t&&t[o]!==i[o]&&!d.contains(e,o)&&e.push(o)}var $=!{toString:null}.propertyIsEnumerable("toString"),A=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"];d.keys=function(t){if(!d.isObject(t))return[];if(c)return c(t);var e=[];for(var n in t)x(t,n)&&e.push(n);return $&&E(t,e),e},d.allKeys=function(t){if(!d.isObject(t))return[];var e=[];for(var n in t)e.push(n);return $&&E(t,e),e},d.values=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=t[e[i]];return r},d.mapObject=function(t,e,n){e=v(e,n);for(var r=d.keys(t),i=r.length,o={},a=0;a<i;a++){var s=r[a];o[s]=e(t[s],s,t)}return o},d.pairs=function(t){for(var e=d.keys(t),n=e.length,r=Array(n),i=0;i<n;i++)r[i]=[e[i],t[e[i]]];return r},d.invert=function(t){for(var e={},n=d.keys(t),r=0,i=n.length;r<i;r++)e[t[n[r]]]=n[r];return e},d.functions=d.methods=function(t){var e=[];for(var n in t)d.isFunction(t[n])&&e.push(n);return e.sort()};function C(l,c){return function(t){var e=arguments.length;if(c&&(t=Object(t)),e<2||null==t)return t;for(var n=1;n<e;n++)for(var r=arguments[n],i=l(r),o=i.length,a=0;a<o;a++){var s=i[a];c&&void 0!==t[s]||(t[s]=r[s])}return t}}d.extend=C(d.allKeys),d.extendOwn=d.assign=C(d.keys),d.findKey=function(t,e,n){e=v(e,n);for(var r,i=d.keys(t),o=0,a=i.length;o<a;o++)if(e(t[r=i[o]],r,t))return r};function z(t,e,n){return e in n}var N,F;d.pick=m(function(t,e){var n={},r=e[0];if(null==t)return n;d.isFunction(r)?(1<e.length&&(r=h(r,e[1])),e=d.allKeys(t)):(r=z,e=O(e,!1,!1),t=Object(t));for(var i=0,o=e.length;i<o;i++){var a=e[i],s=t[a];r(s,a,t)&&(n[a]=s)}return n}),d.omit=m(function(t,n){var e,r=n[0];return d.isFunction(r)?(r=d.negate(r),1<n.length&&(e=n[1])):(n=d.map(O(n,!1,!1),String),r=function(t,e){return!d.contains(n,e)}),d.pick(t,r,e)}),d.defaults=C(d.allKeys,!0),d.create=function(t,e){var n=g(t);return e&&d.extendOwn(n,e),n},d.clone=function(t){return d.isObject(t)?d.isArray(t)?t.slice():d.extend({},t):t},d.tap=function(t,e){return e(t),t},d.isMatch=function(t,e){var n=d.keys(e),r=n.length;if(null==t)return!r;for(var i=Object(t),o=0;o<r;o++){var a=n[o];if(e[a]!==i[a]||!(a in i))return!1}return!0},N=function(t,e,n,r){if(t===e)return 0!==t||1/t==1/e;if(null==t||null==e)return!1;if(t!=t)return e!=e;var i=typeof t;return("function"==i||"object"==i||"object"==typeof e)&&F(t,e,n,r)},F=function(t,e,n,r){t instanceof d&&(t=t._wrapped),e instanceof d&&(e=e._wrapped);var i=f.call(t);if(i!==f.call(e))return!1;switch(i){case"[object RegExp]":case"[object String]":return""+t==""+e;case"[object Number]":return+t!=+t?+e!=+e:0==+t?1/+t==1/e:+t==+e;case"[object Date]":case"[object Boolean]":return+t==+e;case"[object Symbol]":return p.valueOf.call(t)===p.valueOf.call(e)}var o="[object Array]"===i;if(!o){if("object"!=typeof t||"object"!=typeof e)return!1;var a=t.constructor,s=e.constructor;if(a!==s&&!(d.isFunction(a)&&a instanceof a&&d.isFunction(s)&&s instanceof s)&&"constructor"in t&&"constructor"in e)return!1}r=r||[];for(var l=(n=n||[]).length;l--;)if(n[l]===t)return r[l]===e;if(n.push(t),r.push(e),o){if((l=t.length)!==e.length)return!1;for(;l--;)if(!N(t[l],e[l],n,r))return!1}else{var c,u=d.keys(t);if(l=u.length,d.keys(e).length!==l)return!1;for(;l--;)if(c=u[l],!x(e,c)||!N(t[c],e[c],n,r))return!1}return n.pop(),r.pop(),!0},d.isEqual=function(t,e){return N(t,e)},d.isEmpty=function(t){return null==t||(k(t)&&(d.isArray(t)||d.isString(t)||d.isArguments(t))?0===t.length:0===d.keys(t).length)},d.isElement=function(t){return!(!t||1!==t.nodeType)},d.isArray=s||function(t){return"[object Array]"===f.call(t)},d.isObject=function(t){var e=typeof t;return"function"==e||"object"==e&&!!t},d.each(["Arguments","Function","String","Number","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(e){d["is"+e]=function(t){return f.call(t)==="[object "+e+"]"}}),d.isArguments(arguments)||(d.isArguments=function(t){return x(t,"callee")});var U=t.document&&t.document.childNodes;"object"!=typeof Int8Array&&"function"!=typeof U&&(d.isFunction=function(t){return"function"==typeof t||!1}),d.isFinite=function(t){return!d.isSymbol(t)&&isFinite(t)&&!isNaN(parseFloat(t))},d.isNaN=function(t){return d.isNumber(t)&&isNaN(t)},d.isBoolean=function(t){return!0===t||!1===t||"[object Boolean]"===f.call(t)},d.isNull=function(t){return null===t},d.isUndefined=function(t){return void 0===t},d.has=function(t,e){if(!d.isArray(e))return x(t,e);for(var n=e.length,r=0;r<n;r++){var i=e[r];if(null==t||!o.call(t,i))return!1;t=t[i]}return!!n},d.noConflict=function(){return t._=e,this},d.identity=function(t){return t},d.constant=function(t){return function(){return t}},d.noop=function(){},d.property=function(e){return d.isArray(e)?function(t){return _(t,e)}:b(e)},d.propertyOf=function(e){return null==e?function(){}:function(t){return d.isArray(t)?_(e,t):e[t]}},d.matcher=d.matches=function(e){return e=d.extendOwn({},e),function(t){return d.isMatch(t,e)}},d.times=function(t,e,n){var r=Array(Math.max(0,t));e=h(e,n,1);for(var i=0;i<t;i++)r[i]=e(i);return r},d.random=function(t,e){return null==e&&(e=t,t=0),t+Math.floor(Math.random()*(e-t+1))},d.now=Date.now||function(){return(new Date).getTime()};function H(e){function n(t){return e[t]}var t="(?:"+d.keys(e).join("|")+")",r=RegExp(t),i=RegExp(t,"g");return function(t){return t=null==t?"":""+t,r.test(t)?t.replace(i,n):t}}var L={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},B=d.invert(L);d.escape=H(L),d.unescape=H(B),d.result=function(t,e,n){d.isArray(e)||(e=[e]);var r=e.length;if(!r)return d.isFunction(n)?n.call(t):n;for(var i=0;i<r;i++){var o=null==t?void 0:t[e[i]];void 0===o&&(o=n,i=r),t=d.isFunction(o)?o.call(t):o}return t};var R=0;d.uniqueId=function(t){var e=++R+"";return t?t+e:e},d.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};function W(t){return"\\"+Y[t]}var q=/(.)^/,Y={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},G=/\\|'|\r|\n|\u2028|\u2029/g;d.template=function(o,t,e){!t&&e&&(t=e),t=d.defaults({},t,d.templateSettings);var n,r=RegExp([(t.escape||q).source,(t.interpolate||q).source,(t.evaluate||q).source].join("|")+"|$","g"),a=0,s="__p+='";o.replace(r,function(t,e,n,r,i){return s+=o.slice(a,i).replace(G,W),a=i+t.length,e?s+="'+\n((__t=("+e+"))==null?'':_.escape(__t))+\n'":n?s+="'+\n((__t=("+n+"))==null?'':__t)+\n'":r&&(s+="';\n"+r+"\n__p+='"),t}),s+="';\n",t.variable||(s="with(obj||{}){\n"+s+"}\n"),s="var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n"+s+"return __p;\n";try{n=new Function(t.variable||"obj","_",s)}catch(t){throw t.source=s,t}function i(t){return n.call(this,t,d)}var l=t.variable||"obj";return i.source="function("+l+"){\n"+s+"}",i},d.chain=function(t){var e=d(t);return e._chain=!0,e};function K(t,e){return t._chain?d(e).chain():e}d.mixin=function(n){return d.each(d.functions(n),function(t){var e=d[t]=n[t];d.prototype[t]=function(){var t=[this._wrapped];return i.apply(t,arguments),K(this,e.apply(d,t))}}),d},d.mixin(d),d.each(["pop","push","reverse","shift","sort","splice","unshift"],function(e){var n=r[e];d.prototype[e]=function(){var t=this._wrapped;return n.apply(t,arguments),"shift"!==e&&"splice"!==e||0!==t.length||delete t[0],K(this,t)}}),d.each(["concat","join","slice"],function(t){var e=r[t];d.prototype[t]=function(){return K(this,e.apply(this._wrapped,arguments))}}),d.prototype.value=function(){return this._wrapped},d.prototype.valueOf=d.prototype.toJSON=d.prototype.value,d.prototype.toString=function(){return String(this._wrapped)},void 0===(J=function(){return d}.apply(Q,[]))||(Z.exports=J)}()}).call(this,e(32),e(33)(t))},function(t){"use strict";function l(t,e){var n=parseInt(t.substring(6,10)),r=parseInt(t.substring(0,3)),i=parseInt(t.substring(3,5)),o=parseInt(e.substring(0,2)),a=parseInt(e.substring(3,5)),s=parseInt(e.substring(6,8));return new Date(n,r,i,o,a,s)}function c(){$("#Plot").prop("disabled",!0)}function a(t,e,n,r){if("--"==(i=$("#interval option:selected")).text());else{var i,o=l(t,n),a=(l(e,r)-o)/1e3,s=(i=$("#interval option:selected")).data("seconds");a=Math.floor(a/s);0<=a&&a<60?($("#prompt_user").html("a "+i.text()+" interval would plot about "+a.toString()+" data points; that's too few - please try again"),$("#default").attr("selected","selected"),c()):a<0?($("#prompt_user").html("The end date is before the start date. Please choose a later end date."),$("#default").attr("selected","selected")):1e3<a?($("#prompt_user").html("a "+i.text()+" interval would plot about "+a.toString()+" data points; that's too many - please try again"),$("#default").attr("selected","selected"),c()):($("#prompt_user").html("a "+i.text()+" interval would plot about "+a.toString()+" data points."),$("#Plot").prop("disabled",!1))}}t.exports.loading=function(){},t.exports.disable=function(){$("#Start-date-picker").prop("disabled",!0),$("#Start-time-picker").prop("disabled",!0),$("#End-date-picker").prop("disabled",!0),$("#End-time-picker").prop("disabled",!0),$("#interval").prop("disabled",!0),$("#Plot").prop("disabled",!0)},t.exports.enable=function(){$("#Start-date-picker").prop("disabled",!1),$("#Start-time-picker").prop("disabled",!1),$("#End-date-picker").prop("disabled",!1),$("#End-time-picker").prop("disabled",!1),$("#interval").prop("disabled",!1)},t.exports.checkInterval=function(){var t=$("#Start-date-picker").val(),e=$("#End-date-picker").val(),n=$("#Start-time-picker").val(),r=$("#End-time-picker").val(),i=$("#interval"),o=$("#interval option:selected");t&&e&&n&&r||"--"==o.text()||($("#prompt_user").html("Please fill out all other fields before filling out the interval field"),$("#default").attr("selected","selected")),a(t,e,n,r,i)}},function(t,e,n){"use strict";var r=n(19)();t.exports=function(t){return t!==r&&null!==t}},function(t){t.exports=Plotly},function(t,e,n){"use strict";var i=n(0);function p(t){return 1.8*t+32}function r(t){return t}String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,e){return void 0!==n[e]?n[e]:t})});var o={null:r,undefined:r,getF:p,getPresInHg:function(t){return.02952998751*t},getSpeedMPH:function(t){return 3600*t/1608},getAccumMillimeter:function(t){return 25.4*t},cardinalWDir:function(t){return["N","NNE","NE","ENE","E","ESE","SE","SSE","S","SSW","SW","WSW","W","WNW","NW","NNW"][Math.floor((t+11.25)%360/22.5)]},getSpeedKTS:function(t){return 1.94384*t}};function c(t,e,n){var r;return null===t?r=t="":(r="yaxis2"in e&&"convert_value"in e.yaxis2?(r=o[e.yaxis2.convert_value](t)).toFixed?r.toFixed(e.yaxis2.precision):r:void 0,t=(t=o[e.yaxis.convert_value](t)).toFixed?t.toFixed(e.yaxis.precision):t),"yaxis2"in e&&void 0!==r?"{0}: {1}{2} ({3}{4})".format(n.name,t,e.yaxis.units,r,e.yaxis2.units):"{0}: {1}{2}".format(n.name,t,e.yaxis.units)}function a(t,e,n,r){for(var i=[],o=0;o<t.length;o++)i.push(c(t[o],e,n));return i}var s={undefined:a,null:a,dewpoint:function(t,e,n,r){var i,o=[],a=void 0;"anc_variables"in n&&1==n.anc_variables.length&&(a=r[n.anc_variables[0]]);var s=n.anc_info[n.anc_variables[0]];s||(s={name:n.anc_variables[0],units:"",precision:2});for(var l=0;l<t.length;l++)i=c(t[l],e,n),void 0!==a&&(i+="<br>{0}: {1}{2}".format(s.name,a[l]?a[l].toFixed(s.precision):"",s.units)),o.push(i);return o},water_temp:function(t,e,n){for(var r,i,o,a,s,l=[],c=0;c<t.length;c++){i=t[c],a=[],s=n.y[c];for(var u=0;u<i.length;u++)o=i[u],r="Depth: {0}m<br>{1}: {2} °C ({3} °F)".format(s.toFixed(1),n.name,null!==o?o.toFixed(3):"N/A",null!==o?p(o).toFixed(3):"N/A"),a.push(r);l.push(a)}return l}};t.exports.getTickVals=function(t,e){var n=.02*(e-t),r=((e+=n)-(t-=n))/4;return i.range(t,e+r,r)},t.exports.getProbeText=function(t,e,n,r){return"probe_text"in n?s[n.probe_text](t,e,n,r):a(t,e,n)},t.exports.getTickText=function(t,e){for(var n=[],r=0;r<t.length;r++){var i=o[e.convert_value](t[r]);i=i.toFixed?i.toFixed(e.precision):i,n.push(i)}return n}},function(t){"use strict";t.exports.buildRequestUrl=function(t,e,n,r,i,o,a){var s=METOBS_API_URL+"/api/data."+t+"?";return s+="interval="+e,s+="&epoch="+n,s+="&sep="+r||!1,s+="&order="+i,s+=o,s+="&symbols="+a}},function(t,e,n){"use strict";function _(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}var k=n(3),w=n(4),T=n(0);function M(t,e,n,r){var i,o,a,s,l,c,u,p=0==r?"yaxis":"yaxis2",f={};!function(t,e,n){var r=new Date(t[0].x[t[0].x.length-1]),i=Number(r.toLocaleString("en-US",{hour:"numeric",hour12:!1}));document.getElementById("overlay").style.opacity=0<i&&i<5?1:0;var o=r.toLocaleString("en-US",{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"numeric",second:"numeric"}).replace(/,([^,]*)$/,"$1"),a=Number(r.getUTCMonth());a=a<9?"0"+(a+1):a+1;var s=Number(r.getUTCDate())<9?"0"+r.getUTCDate():r.getUTCDate(),l=Number(r.getUTCMinutes())<9?"0"+r.getUTCMinutes():r.getUTCMinutes(),c=Number(r.getUTCSeconds())<9?"0"+r.getUTCSeconds():r.getUTCSeconds(),u=r.getUTCFullYear()+"-"+a+"-"+s+" "+r.getUTCHours()+":"+l+":"+c,p=0==e?"327.5 meters":"1074.5 feet";n["annotations.1.text"]="Data last recorded at: "+u+"Z ["+o+" Local] RIG Elevation = "+p}(t,r,f);for(var d=0;d<t.length;d++)if(l=0==d?"":d+1,s=t[d].x,f["xaxis"+l+".tickvals"]=[s[0],s[Math.round(s.length/2)],s[s.length-1]],i=t[d].plot_name,o=n.plots[i],a=w.getTickText([t[d].y[t[d].y.length-1]],o[p])[0],f["annotations["+(3+2*d)+"].text"]=a+""+o[p].units,null!=(u=e.layout["yaxis"+l].tickvals)){if("wind_direction"==i||"rel_hum"==i)c=o[p].ticktext;else{c=[];for(var h=0;h<u.length;h++)c.push(w.getTickText([u[h]],o[p]))}f["yaxis"+l+".ticktext"]=c}k.relayout(e,f),function(){var t={north:"east",east:"south",south:"west",west:"north"}[document.getElementById("roofCam").src.split("/")[7]];t=t||"north",document.getElementById("roofCam").alt=document.getElementById("dirText").innerHTML=t;var e=new Date,n=300*Math.floor(e.getTime()/1e3/300);document.getElementById("roofCam").src=METOBS_API_URL+"/pub/cache/aoss/cameras/"+t+"/latest_medium.jpg?t="+n}()}function j(t,e,n,r,i,o){if("aoss.tower.rel_hum"!=n&&"aoss.tower.wind_direction"!=n){0==t.y.length?(t.yMin=Math.min.apply(Math,_(e)),t.yMax=Math.max.apply(Math,_(e))):(t.yMin=Math.min.apply(Math,_(e).concat([t.yMin])),t.yMax=Math.max.apply(Math,_(e).concat([t.yMax])));var a=t.yMax-t.yMin,s=t.yMin-a,l="aoss.tower.solar_flux"==n?t.yMax:t.yMax+a;0==a&&(0<l?(l*=1.1,s*=.9):l<0?(l*=.9,s*=1.1):s=-(l=.1));var c=s;"aoss.tower.air_temp"!=n&&"aoss.tower.dewpoint"!=n&&s<=0&&(c=s=0),s-=.075*a+.001,r[i+".tickvals"]=[c,c+(l-c)/4,c+2*(l-c)/4,c+3*(l-c)/4,l],r[i+".range"]=[s,l]}else r[i+".tickvals"]=o}t.exports.updatePlot=function(t,e,n,r,i,o){!function(o,t,a,s,e,n){var r,l,c,u,p,f,d=s.dates,i=[],h=!1,v=[],y={x:[],y:[],text:[]},m=[],g={x:[],z:[],text:[]},b=0,x={};for(c=0;c<o.length;c++)r=o[c].plot_name,i[i.length-1]!=r&&(l=a.plots[r],T.each(l.traces,function(e,t){if("contour"==o[b+t].type){var n;g.x.push(d),m.push(b+t),p=T.map(e.var_names,function(t){return s[t]}),(n=o[c].text).push.apply(n,_(w.getProbeText(p,l,e,s)));for(var r=0;r<e.var_names.length;r++){for(var i;r>=o[c].z.length;)o[c].z.push([]);(i=o[c].z[r]).push.apply(i,_(s[e.var_names[r]]))}g.z.push(o[c].z),g.text.push(o[c].text)}else y.x.push(d),v.push(b+t),T.each(e.var_names,function(t){a.isLobbyDisplay&&(f=0==c?"":c+1,j(o[c],s[t],t,x,"yaxis"+f,l.yaxis2.tickvals)),y.y.push(s[t]),u="probe_text"in e&&null===e.probe_text?[void 0]:w.getProbeText(s[t],l,e,s),y.text.push(u)})}),b+=l.traces.length,i.push(r));if(0<v.length&&k.extendTraces(t,y,v),0<m.length)for(k.extendTraces(t,g,m),c=0;c<m.length;c++)o[m[c]].z.splice(0,o[m[c]].y.length),o[m[c]].text.splice(0,o[m[c]].y.length);0!=n||e||(n=s.dates.length,h=!0),0<n&&o[0].x.length>n&&function(t,e){for(var n=0;n<t.length;n++){if(t[n].x.splice(0,e),t[n].hasOwnProperty("z"))for(var r=0;r<t[n].z.length;r++)t[n].z[r].splice(0,e);else t[n].hasOwnProperty("y")&&t[n].y.splice(0,e);t[n].hasOwnProperty("text")&&t[n].text.splice(0,e)}}(o,o[0].x.length-n),0!=Object.keys(x).length&&(k.relayout(t,x),e||M(o,t,a,0)),h&&k.redraw(t)}(t,e,n,r,i,o)},t.exports.changeUnits=M},function(t,e,n){"use strict";var i=n(8),o=n(10);n(0);window.MeteorogramController=function(t,e,n){var r=o.getDispatcher();return{plotDiv:t,controlDiv:e,dataCache:[],initMeteorogram:function(t,e){this.hasGraph=!0,this.plotDiv=t||this.plotDiv,r.dispatch({status:"initPlot",emit:"plotEmitter",location:this.plotDiv,dataCache:this.dataCache,plotsInfo:n,plotOrder:e})},initMeteorogramTable:function(t,e){this.hasTable=!0,this.tableDiv=t||this.plotDiv,r.dispatch({status:"initTable",emit:"plotEmitter",location:this.tableDiv,plotsInfo:n,plotOrder:e})},initMeteorogramControls:function(){i(this.controlDiv,this.plotDiv,r)},displayRealTime:function(){this.hasTable&&r.dispatch({status:"update_table",emit:"plotEmitter",time:"-3:00:00",location:this.tableDiv}),this.hasGraph&&r.dispatch({status:"get_since_now",emit:"plotEmitter",time:"-3:00:00",location:this.plotDiv})},showPlot:function(t){r.dispatch({status:"show"+t,emit:"checkboxEmitter",location:this.div})},hidePlot:function(t){r.dispatch({status:"hide"+t,emit:"checkboxEmitter",location:this.div})},displayRecent:function(t){r.dispatch({status:"get_since_now",emit:"plotEmitter",time:t})},displayTimeRange:function(t,e,n){r.dispatch({status:"get_between_dates",emit:"plotEmitter",start:t,end:e,interval:n||"auto"})}}}},function(t,e,n){"use strict";n(1);var r=n(9);function i(t,e){$(t+" #plot-btn").click(function(){!function(t){t.dispatch({status:"get_between_dates",emit:"plotEmitter",start:$("#Start-date-picker").val().split(" ").join("T")+":00",end:$("#End-date-picker").val().split(" ").join("T")+":00",interval:"auto"})}(e)}),$(t+" #dropDownId").change(function(){!function(t,e){if("realtime"==t)e.dispatch({status:"get_since_now",emit:"plotEmitter",time:"-3:00:00"});else{e.dispatch({status:"get_since_now",emit:"plotEmitter",time:t})}}($(this).val(),e)})}function o(t,e){$(e+" #dropDownId").prop("disabled","recent"!=t),$(e+" #interval").prop("disabled","range"!=t),$(e+" #Start-date-picker").prop("disabled","range"!=t),$(e+" #End-date-picker").prop("disabled","range"!=t),$(e+" #Start-time-picker").prop("disabled","range"!=t),$(e+" #End-time-picker").prop("disabled","range"!=t),$(e+" #plot-btn").prop("disabled","range"!=t)}function a(t,e,n){var r="#"+t;!function(t){$(t+" #Start-date-picker").datetimepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",timeFormat:"HH:mm",showSecond:!1,showMillisec:!1,showMicrosec:!1}),$(t+" #End-date-picker").datetimepicker({changeMonth:!0,changeYear:!0,dateFormat:"yy-mm-dd",timeFormat:"HH:mm",showSecond:!1,showMillisec:!1,showMicrosec:!1}),$(t+" [type=text]").prop("disabled",!0),$(t+" select").prop("disabled",!0),$(t+" #last_x_days").click(function(){o("recent",t)}),$(t+" #date_range").click(function(){o("range",t)}),$(t+" #last_x_days").trigger("click")}(r),i(r,n)}$(document).ready(function(){}),t.exports=function(t,e,n){$("#"+t).append(r.controlPanelTemplate),a(t,0,n)}},function(t){"use strict";t.exports={controlPanelTemplate:'<div class="row" id="control-panel-row"><div id="show-hide-boxes" class="col-md-12"></div><div class = "col-md-9"><div class="row" style="padding: 0 1em;"><div class="form-group"><table style="width:100%"><tr><td><div class="radio"><label><input type="radio" id="last_x_days" name="time_select">Recent Data:</label></div></td><td><select class="form-control" id="dropDownId"><option selected value="realtime">Realtime Update</option><option value="-1:00:00">Past 1 Hour</option><option value="-2:00:00">Past 2 Hours</option><option value="-3:00:00">Past 3 Hours</option><option value="-6:00:00">Past 6 Hours</option><option value="-12:00:00">Past 12 Hours</option><option value="-18:00:00">Past 18 Hours</option><option value="-24:00:00">Past 24 Hours</option><option value="-96:00:00">Past 4 Days</option></select></td><td style="padding-left:.5em"><div class="radio"><label><input type="radio" id="date_range" name="time_select">Date Range:</label></div></td><td><input class="form-control" style="padding 0.5em 0;" id="Start-date-picker" type="text" placeholder="YYYY-MM-DD"/></td><td>to </td><td><input class="form-control" style="padding 0.5em 0;" id="End-date-picker" type="text" placeholder="YYYY-MM-DD"/></td><td><button class="btn btn-primary btn-block" id="plot-btn">Plot</button></td></tr></table></div></div></div></div>',checkboxTemplates:{"aoss.tower":'<div class="form-group"><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="temp">Temperature + Dewpoint</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="pres">Pressure</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wS">Wind Speed</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wD">Wind Direction</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="aP">Precipitation</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="sF">Solar Flux</label></div>',"mendota.buoy":'<div class="form-group"><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="temp">Temperature + Dewpoint</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="rh">Relative Humidity</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wS">Wind Speed</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="wD">Wind Direction</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="chlor">Chlorophyll</label><label class="form-check-label"><input type="checkbox" class="form-check-input" checked id="phyco">Phycocyanin</label></div>'}}},function(t,e,n){"use strict";var u,r=n(11),p=n(27),f=n(30),d=n(31),h=n(34),v=n(1),y=n(6);t.exports.getDispatcher=function(){var i=new p.Dispatcher;function o(){360<(u+=.2*(2*Math.min(120-u%120,u%120)/60+1))&&(u=0),document.getElementById("row1").style.backgroundColor="hsl("+u+",100%,15%)",document.getElementById("row2").style.backgroundColor="hsl("+u+",75%,30%)",document.getElementById("row3").style.backgroundColor="hsl("+u+",50%,45%)"}i.GRAPH_HEIGHT=170;var a=r({visible:{},setPlots:function(t){for(var e in t)this.visible[e]=!0},setShowing:function(t,e){this.showing[t]=void 0===e?!this.showing[t]:e},getShowing:function(t){return this.showing[t]},handleActions:function(t){"checkboxEmitter"==t.emit&&this.emit(t.status,t.location)}});a.dispatchToken=i.register(a.handleActions.bind(a));var t=r({handleActions:function(t){"plotEmitter"==t.emit&&(i.waitFor([a.dispatchToken]),void 0!==t.location&&(this.div=t.location),void 0!==t.plotsInfo&&(this.plotsInfo=t.plotsInfo,this.plotOrder=this.plotsInfo.defaultPlots),void 0!==t.plotOrder&&(this.plotOrder=t.plotOrder),void 0!==t.dataCache&&(this.dataCache=t.dataCache),"get_since_now"==t.status?(this.plotsInfo.isLobbyDisplay&&(t.time="-6:00:00"),this.emit(t.status,t.time,this.plotsInfo,this.dataCache,this.div)):"update_table"==t.status?this.emit(t.status,t.time,this.plotsInfo,this.div):"get_between_dates"==t.status?this.emit(t.status,t.start,t.end,t.interval,this.plotsInfo,this.dataCache,this.div):"initPlot"==t.status?this.emit(t.status,t.location,t.plotOrder?t.plotOrder:this.plotOrder,this.plotsInfo,this.dataCache):"initTable"==t.status?this.emit(t.status,t.location,t.plotOrder?t.plotOrder:this.plotOrder,this.plotsInfo):"update"==t.status?this.emit(t.status,this.div,this.plotsInfo,this.dataCache,t.startTime):"changeUnits"==t.status?this.emit(t.status,this.div,this.plotsInfo,this.dataCache,t.unitCount):this.emit(t.status,t.userInfo))}});function s(t){if(t.progress||(t.progress={}),t.progress.validID){var e=t.progress.id[0];clearInterval(e),t.isLobbyDisplay&&(clearInterval(t.progress.colorID),clearInterval(t.progress.lobbyID)),t.progress.validID=!1}}var l={"1m":3e4,"5m":15e4,"1h":18e5};function c(t,e,n){n.progress||(n.progress={}),s(n),void 0===t&&(t=n.progress.id[1]),void 0===e&&(e=n.progress.id[2]);var r=setInterval(function(t){return function(){i.dispatch({status:"update",emit:"plotEmitter",startTime:t})}}(t),l[e]);n.isLobbyDisplay&&(u=Number(getComputedStyle(document.getElementById("color")).getPropertyValue("--starting-hue")),n.progress.colorID=setInterval(o,1e3),n.progress.lobbyID=setInterval(function(t){return function(){t=(t+1)%2,i.dispatch({status:"changeUnits",emit:"plotEmitter",unitCount:t})}}(0),5e3)),n.progress.id=[r,t,e],n.progress.validID=!0}return t.on("initTable",function(t,e,n){a.setPlots(n),d.initTable(t,e,n)}),t.on("update_table",function(t,e,n){d.requestTableUpdate(n,e),setInterval(function(){d.requestTableUpdate(n,e)},l["1m"])}),t.on("initPlot",function(t,e,n,r){a.setPlots(n),f.initPlot(r,t,e,n)}),t.on("get_since_now",function(t,e,n,r){c(t,h.requestPlotUpdate(n,r,e,t,void 0,void 0,void 0,s),e)}),t.on("get_between_dates",function(t,e,n,r,i,o){s(r),h.requestPlotUpdate(i,o,r,t,e,n)}),t.on("update",function(t,e,n,r){h.requestPlotUpdate(n,t,e,r,void 0,void 0,!0)}),t.on("changeUnits",function(t,e,n,r){y.changeUnits(n,document.getElementById(t),e,r)}),t.on("checking_custom",function(){v.checkInterval()}),t.dispatchToken=i.register(t.handleActions.bind(t)),i}},function(t,e,n){"use strict";var i,r,o,a,s,l,c,u=n(12),p=n(26),f=Function.prototype.apply,d=Function.prototype.call,h=Object.create,v=Object.defineProperty,y=Object.defineProperties,m=Object.prototype.hasOwnProperty,g={configurable:!0,enumerable:!1,writable:!0};r=function(t,e){var n,r;return p(e),i.call(r=this,t,n=function(){o.call(r,t,n),f.call(e,this,arguments)}),n.__eeOnceListener__=e,this},s={on:i=function(t,e){var n;return p(e),m.call(this,"__ee__")?n=this.__ee__:(n=g.value=h(null),v(this,"__ee__",g),g.value=null),n[t]?"object"==typeof n[t]?n[t].push(e):n[t]=[n[t],e]:n[t]=e,this},once:r,off:o=function(t,e){var n,r,i,o;if(p(e),!m.call(this,"__ee__"))return this;if(!(n=this.__ee__)[t])return this;if("object"==typeof(r=n[t]))for(o=0;i=r[o];++o)i!==e&&i.__eeOnceListener__!==e||(2===r.length?n[t]=r[o?0:1]:r.splice(o,1));else r!==e&&r.__eeOnceListener__!==e||delete n[t];return this},emit:a=function(t,e,n){var r,i,o,a,s;if(m.call(this,"__ee__")&&(a=this.__ee__[t]))if("object"==typeof a){for(i=arguments.length,s=new Array(i-1),r=1;r<i;++r)s[r-1]=arguments[r];for(a=a.slice(),r=0;o=a[r];++r)f.call(o,this,s)}else switch(arguments.length){case 1:d.call(a,this);break;case 2:d.call(a,this,e);break;case 3:d.call(a,this,e,n);break;default:for(i=arguments.length,s=new Array(i-1),r=1;r<i;++r)s[r-1]=arguments[r];f.call(a,this,s)}}},l={on:u(i),once:u(r),off:u(o),emit:u(a)},c=y({},l),t.exports=e=function(t){return null==t?h(c):y(Object(t),l)},e.methods=s},function(t,e,n){"use strict";var l=n(13),c=n(21),u=n(22),p=n(23);(t.exports=function(t,e,n){var r,i,o,a,s;return arguments.length<2||"string"!=typeof t?(a=e,e=t,t=null):a=n,null==t?(r=o=!0,i=!1):(r=p.call(t,"c"),i=p.call(t,"e"),o=p.call(t,"w")),s={value:e,configurable:r,enumerable:i,writable:o},a?l(c(a),s):s}).gs=function(t,e,n,r){var i,o,a,s;return"string"!=typeof t?(a=n,n=e,e=t,t=null):a=r,null==e?e=void 0:u(e)?null==n?n=void 0:u(n)||(a=n,n=void 0):(a=e,e=n=void 0),o=null==t?!(i=!0):(i=p.call(t,"c"),p.call(t,"e")),s={get:e,set:n,configurable:i,enumerable:o},a?l(c(a),s):s}},function(t,e,n){"use strict";t.exports=n(14)()?Object.assign:n(15)},function(t){"use strict";t.exports=function(){var t,e=Object.assign;return"function"==typeof e&&(e(t={foo:"raz"},{bar:"dwa"},{trzy:"trzy"}),t.foo+t.bar+t.trzy==="razdwatrzy")}},function(t,e,n){"use strict";var a=n(16),s=n(20),l=Math.max;t.exports=function(e,n){var r,t,i,o=l(arguments.length,2);for(e=Object(s(e)),i=function(t){try{e[t]=n[t]}catch(t){r||(r=t)}},t=1;t<o;++t)a(n=arguments[t]).forEach(i);if(void 0!==r)throw r;return e}},function(t,e,n){"use strict";t.exports=n(17)()?Object.keys:n(18)},function(t){"use strict";t.exports=function(){try{return Object.keys("primitive"),!0}catch(t){return!1}}},function(t,e,n){"use strict";var r=n(2),i=Object.keys;t.exports=function(t){return i(r(t)?Object(t):t)}},function(t){"use strict";t.exports=function(){}},function(t,e,n){"use strict";var r=n(2);t.exports=function(t){if(!r(t))throw new TypeError("Cannot use null or undefined");return t}},function(t,e,n){"use strict";var r=n(2),i=Array.prototype.forEach,o=Object.create;t.exports=function(){var e=o(null);return i.call(arguments,function(t){r(t)&&function(t,e){var n;for(n in t)e[n]=t[n]}(Object(t),e)}),e}},function(t){"use strict";t.exports=function(t){return"function"==typeof t}},function(t,e,n){"use strict";t.exports=n(24)()?String.prototype.contains:n(25)},function(t){"use strict";var e="razdwatrzy";t.exports=function(){return"function"==typeof e.contains&&(!0===e.contains("dwa")&&!1===e.contains("foo"))}},function(t){"use strict";var n=String.prototype.indexOf;t.exports=function(t,e){return-1<n.call(this,t,e)}},function(t){"use strict";t.exports=function(t){if("function"!=typeof t)throw new TypeError(t+" is not a function");return t}},function(t,e,n){t.exports.Dispatcher=n(28)},function(t,e,n){"use strict";e.__esModule=!0;var r=n(29),i=(o.prototype.register=function(t){var e="ID_"+this._lastID++;return this._callbacks[e]=t,e},o.prototype.unregister=function(t){this._callbacks[t]||r(!1),delete this._callbacks[t]},o.prototype.waitFor=function(t){this._isDispatching||r(!1);for(var e=0;e<t.length;e++){var n=t[e];this._isPending[n]?this._isHandled[n]||r(!1):(this._callbacks[n]||r(!1),this._invokeCallback(n))}},o.prototype.dispatch=function(t){this._isDispatching&&r(!1),this._startDispatching(t);try{for(var e in this._callbacks)this._isPending[e]||this._invokeCallback(e)}finally{this._stopDispatching()}},o.prototype.isDispatching=function(){return this._isDispatching},o.prototype._invokeCallback=function(t){this._isPending[t]=!0,this._callbacks[t](this._pendingPayload),this._isHandled[t]=!0},o.prototype._startDispatching=function(t){for(var e in this._callbacks)this._isPending[e]=!1,this._isHandled[e]=!1;this._pendingPayload=t,this._isDispatching=!0},o.prototype._stopDispatching=function(){delete this._pendingPayload,this._isDispatching=!1},o);function o(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,o),this._callbacks={},this._isDispatching=!1,this._isHandled={},this._isPending={},this._lastID=1}t.exports=i},function(t){"use strict";t.exports=function(t,e,n,r,i,o,a,s){if(!t){var l;if(void 0===e)l=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var c=[n,r,i,o,a,s],u=0;(l=new Error(e.replace(/%s/g,function(){return c[u++]}))).name="Invariant Violation"}throw l.framesToPop=1,l}}},function(t,e,n){"use strict";function E(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $=n(3),A=n(1);function C(t,e,n,r){for(var i,o={gridcolor:"#777777",titlefont:{size:12},title:n.title,zeroline:!1,overlaying:"y"+(t-1).toString(),side:"right",anchor:"x"},a=0;a<r.length;a++)(i=r[a])in n&&(o[i]=n[i]);return o}t.exports.initPlot=function(t,e,n,r){var i=n.length,o={title:r.title,showlegend:!1,height:170*i+180};Object.assign(o,r.layout),o.xaxis={domain:[0,1],showline:!1,zeroline:!1,showticklabels:0<i,gridcolor:"#777777",showgrid:!1,tickformat:"%Y-%m-%d %H:%MZ"};for(var a,s,l,c,u,p,f,d,h,v,y,m,g,b,x,_,k,w=0,T=1/i,M=w,j=["marker","color","mode","zmin","zmax","y","contours","line","colorscale","showscale","colorbar","tick0","dtick","hovermode"],S=["nticks","range","autorange","zeroline","showgrid","tickmode","ticktext","tickvals"],O=0;O<n.length;O++){p=n[O],M=w+=1,a=(s=r.plots[p]).yaxis,d=[(n.length-1-O)*T*1.03,1-O*T*1.05],r.isLobbyDisplay&&(d=[.82-8/75-(.2+8/75)*Math.floor(O/3),.82-(.2+8/75)*Math.floor(O/3)]);for(var D=0;D<s.traces.length;D++){c={name:(l=s.traces[D]).name,x:[],y:[],text:[],type:l.type?l.type:"scatter",xaxis:r.isLobbyDisplay?"x"+w:"x1",yaxis:"y"+w,hoverinfo:"x+text",hovermode:"closest",var_names:l.var_names,anc_variables:l.anc_variables,anc_data:[],plot_name:p,trace_index:D},l.isSecondAxis&&(c.yaxis="y"+(w+D));for(var P=0;P<j.length;P++)(f=j[P])in l&&(c[f]=l[f]);"colorbar"in c&&(c.colorbar.len=d[1]-d[0],c.colorbar.y=(d[1]-d[0])/2+d[0],c.z=[]),t.push(c)}for(u={gridcolor:"#777777",titlefont:{size:12},title:a.title,zeroline:!1,domain:d},r.isLobbyDisplay&&(h=o,v=u,y=w,m=O,g=d[1],b=l.name,x=r.rowTextSize,k=_=void 0,h["xaxis"+y]={ticktext:["-6h","-3h","Now"],tickfont:{size:x/5},showline:!0,linecolor:"white",anchor:"y"+y,domain:[.1+1/3*(m%3)*(1+Math.floor(m/6)),14/60+1/3*(m%3)*(1+Math.floor(m/6))],zeroline:!1,showgrid:!1},h.annotations.push((E(_={font:{size:x/2},showarrow:!1,align:"center",x:1/6+1/3*(m%3)*(1+Math.floor(m/6)),y:g+.04,xref:"paper",yref:"paper"},"showarrow",!0),E(_,"arrowhead",0),E(_,"ax",0),E(_,"ay",0),_)),h.annotations.push((E(k={text:b,font:{size:x/4},showarrow:!1,align:"center",x:1/6+1/3*(m%3)*(1+Math.floor(m/6)),y:g+.085,xref:"paper",yref:"paper"},"showarrow",!0),E(k,"arrowhead",0),E(k,"ax",0),E(k,"ay",0),k)),delete v.title,v.tickfont={size:x/5},v.showgrid=!1,v.showticklabels=!0,v.anchor="x"+y,v.showline=!0,v.linecolor="white"),P=0;P<S.length;P++)(f=S[P])in a&&(u[f]=a[f]);o["yaxis"+w]=u,!r.isLobbyDisplay&&"yaxis2"in s&&!s.yaxis2.skip&&(u=C(w+=1,0,a=s.yaxis2,S),o["yaxis"+w]=u)}o.xaxis.anchor="y"+M;var I={showLink:!1,displaylogo:!1,displayModeBar:!0,responsive:!0};r.isLobbyDisplay&&(delete o.xaxis,I={responsive:!0}),$.plot(e,t,o,I),A.loading()}},function(t,e,n){"use strict";var x=n(4),c=n(5);function h(t,e,n,r){for(var i=0;i<r.anc_variables.length;i++){var o=r.anc_info[r.anc_variables[i]],a=$("<td>N/A</td>");a.addClass("met_data"),a.data("info",{key:e,idx:n,anc_idx:i});var s=$("<tr></tr>"),l=o.short_name||o.name;s.append("<td>"+l+"</td>"),s.append(a),s.append('<td class="convert"></td>'),t.append(s)}}function v(t,e,n,r,i){var o='<tr><td colspan="2">'+(c=r.short_name||r.name)+"</td><td></td>";t.append(o);for(var a=0;a<r.y_highlight.length;a++){var s=r.y_highlight[a],l=$("<tr></tr>"),c=r.y[s]+i.yaxis.units;l.append('<td class="subtitle text-center">'+c+"</td>");var u=$("<td>N/A</td>");u.addClass("met_data"),u.data("info",{key:e,idx:n,hl_idx:s}),l.append(u),l.append('<td class="convert"></td>'),t.append(l)}}function _(t,e,n,r,i){for(var o=0;o<r.y_highlight.length;o++){var a=r.y_highlight[o],s=t[r.var_names[a]][0],l=r.zprobe.units,c=x.getTickText([s],r.zprobe),u="";if(r.zprobe2&&r.zprobe2.convert_value){var p=r.zprobe2.units;u=x.getTickText([s],r.zprobe2)+p}e[i].innerHTML=c+l,n[i].innerHTML=u,i+=1}return i}function k(t,e,n,r){for(var i=0;i<n.anc_variables.length;i++){var o=n.anc_variables[i],a=n.anc_info[o],s=t[o][0],l=x.getTickText([s],a);e[r].innerHTML=s||0==s?l+a.units:"N/A",r+=1}return r}t.exports.initTable=function(t,e,n){for(var r,i,o=$("#"+t),a=$('<table class="met_table"><tbody></tbody></table>'),s=a.children("tbody"),l=0;l<e.length;l++){i=e[l],r=n.plots[i];for(var c=0;c<r.traces.length;c++){var u=r.traces[c];if("contour"==u.type)v(s,i,c,u,r);else{var p=$("<td>N/A</td>");p.addClass("met_data"),p.data("info",{key:i,idx:c});var f=$("<tr></tr>"),d=u.short_name||u.name;if("Wind Direction Card"==d)continue;f.append("<td>"+d+"</td>"),f.append(p),f.append('<td class="convert"></td>'),s.append(f),u.anc_variables&&h(s,i,c,u)}}}o.append("<h3>"+n.title+"</h3>"),o.append(a),o.append('<span id="timestamp"></span>')},t.exports.requestTableUpdate=function(e,o){$("#"+e);var a,s=[],l=[],n=$("#"+e+" .met_data"),r=$("#"+e+" .convert");n.each(function(){var t=$(this).data("info").key,e=$(this).data("info").idx,n=$(this).data("info").anc_idx,r=$(this).data("info").hl_idx,i=o.plots[t].traces[e];-1==l.indexOf(t)&&l.push(t),a=void 0!==n?i.anc_variables[0]:void 0!==r?i.var_names[r]:i.var_names[0],s.includes(a)||s.push(a)});var t=s.join(":"),i=c.buildRequestUrl("json","1m","","","column","&begin=-00:04:00",t);$.ajax({type:"GET",url:i,jsonp:"callback",dataType:"jsonp",success:function(t){t.div_id=e,t.plotOrder=l,t.data_cells=n,t.convert_cells=r,function(t,e){var n,r,i=t.results.data,o=0,a=t.div_id,s=t.plotOrder,l=t.data_cells,c=t.convert_cells;if(0==t.num_results)return $("#"+a+" #timestamp").html("No recent data");$("#"+a+" #timestamp").html("Last updated: "+t.results.timestamps[0]);for(var u=0;u<s.length;u++){r=s[u],n=e.plots[r];for(var p=0;p<n.traces.length;p++){var f=n.traces[p];if("Wind Direction Card"!=f.name)if("contour"==f.type)o=_(i,l,c,f,o);else{var d=i[f.var_names[0]][0];if(d||0==d){var h=n.yaxis.units,v="",y=n.yaxis.precision;n.yaxis.precision=Math.min(y,1);var m=x.getTickText([d],n.yaxis);if(n.yaxis.precision=y,n.yaxis2&&n.yaxis2.convert_value!=n.yaxis.convert_value){var g=n.yaxis2.units;y=n.yaxis2.precision;n.yaxis2.precision=Math.min(y,1);var b=x.getTickText([d],n.yaxis2);n.yaxis2.precision=y,v=b+g}l[o].innerHTML=m+h,c[o].innerHTML=v}else l[o].innerHTML="N/A",c[o].innerHTML="";o+=1,f.anc_variables&&(o=k(i,l,f,o))}}}}(t,o)}})}},function(t){var e;e=function(){return this}();try{e=e||new Function("return this")()}catch(t){"object"==typeof window&&(e=window)}t.exports=e},function(t){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";var h=n(6),v=n(5),y=n(0);function m(s,t,l,c,u,p,f,d){$.ajax({type:"GET",url:t,jsonp:"callback",dataType:"jsonp",success:function(t){if(200!=t.code)return console.error("Invalid data API query. Code: {0} | Message: {1}".format(t.code,t.message)),void(void 0!==d&&d(c));var e=document.getElementById(u),n=function(t){var e={dates:y.map(t.timestamps,function(t){return t})};return y.extend(e,t.data),e}(t.results),r=s[0].x||[],i=n.dates;if(0!=(t={dates:i}).dates.length){if(p){for(var o=0;o<i.length&&i[o]<=r[r.length-1];)o++;if(o>=i.length)return void console.info("No new data downloaded");for(var a=0;a<l.length;a++)t[l[a]]=n[l[a]].slice(o);i=i.slice(o),t.dates=i}else for(a=0;a<l.length;a++)t[l[a]]=n[l[a]];h.updatePlot(s,e,c,t,p,f)}else console.warn("No data available from API")}})}var g=[[864e5,"5m","-00:10:00"],[2592e6,"1h","-02:00:00"]],b={"1m":60,"5m":300,"1h":3600};t.exports.requestPlotUpdate=function(t,e,n,r,i,o,a,s){var l,c,u,p,f=function(t){var e=[];return y.each(t,function(t){Array.prototype.push.apply(e,t.var_names),"anc_variables"in t&&Array.prototype.push.apply(e,t.anc_variables)}),y.uniq(e)}(t),d="";for(var h in f)d+=f[h],h<f.length-1&&(d+=":");if(i){if(p="&begin="+r+"&end="+i,"auto"==o)for(var h in o="1m",l=new Date(i)-new Date(r),g)l>=g[h][0]&&(o=g[h][1])}else{for(var h in o="1m",l=-36e5*(c=y.map(r.split(":"),Number))[0]+6e4*c[1]+1e3*c[2],g)l>=g[h][0]&&(o=g[h][1],a&&(r=g[h][2]));p="&begin="+r}return u=a?b.hasOwnProperty(o)?l/1e3/b[o]:250:0,m(t,v.buildRequestUrl("json",o,"","","column",p,d),f,n,e,a,u,s),o}}]); \ No newline at end of file diff --git a/content/js/meteorogram/meteorogram.js.map b/content/js/meteorogram/meteorogram.js.map index 2e52ed72683f9aa0221be615bc062865fe1b82fd..14eb50fa7e4f2f6981df668a86693663c153e0c4 100644 --- a/content/js/meteorogram/meteorogram.js.map +++ b/content/js/meteorogram/meteorogram.js.map @@ -1 +1 @@ -{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./controller.js","webpack:///./dispatcher.js","webpack:///./node_modules/d/index.js","webpack:///./node_modules/es5-ext/function/noop.js","webpack:///./node_modules/es5-ext/object/assign/index.js","webpack:///./node_modules/es5-ext/object/assign/is-implemented.js","webpack:///./node_modules/es5-ext/object/assign/shim.js","webpack:///./node_modules/es5-ext/object/is-callable.js","webpack:///./node_modules/es5-ext/object/is-value.js","webpack:///./node_modules/es5-ext/object/keys/index.js","webpack:///./node_modules/es5-ext/object/keys/is-implemented.js","webpack:///./node_modules/es5-ext/object/keys/shim.js","webpack:///./node_modules/es5-ext/object/normalize-options.js","webpack:///./node_modules/es5-ext/object/valid-callable.js","webpack:///./node_modules/es5-ext/object/valid-value.js","webpack:///./node_modules/es5-ext/string/#/contains/index.js","webpack:///./node_modules/es5-ext/string/#/contains/is-implemented.js","webpack:///./node_modules/es5-ext/string/#/contains/shim.js","webpack:///./node_modules/event-emitter/index.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/flux/index.js","webpack:///./node_modules/flux/lib/Dispatcher.js","webpack:///./node_modules/underscore/underscore.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/module.js","webpack:///./plot/data.js","webpack:///./plot/init.js","webpack:///./plot/table.js","webpack:///./plot/ticks.js","webpack:///./plot/update.js","webpack:///./plot/utils.js","webpack:///./ui/button_template.js","webpack:///./ui/buttons.js","webpack:///./ui/loading.js","webpack:///external \"Plotly\""],"names":["buildFormInDiv","require","Dispatcher","_","API","div","controlDiv","plotsInfo","myDispatcher","getDispatcher","plotDiv","dataCache","initMeteorogram","plot_div","plotOrder","hasGraph","dispatch","initMeteorogramTable","table_div","hasTable","tableDiv","initMeteorogramControls","displayRealTime","showPlot","varName","status","hidePlot","displayRecent","start_time","displayTimeRange","stop_time","interval","window","MeteorogramController","ee","Flux","Plot","Table","dataAccess","loading","updatePlot","hue","GRAPH_HEIGHT","dispatchUpdate","startTime","dispatchChangeUnits","unitCount","changeBackgroundColor","skip_jump","acceleration","rate","Math","min","document","getElementById","style","backgroundColor","checkboxEmitter","visible","setPlots","plot_key","setShowing","plotName","undefined","showing","getShowing","handleActions","action","emit","location","dispatchToken","register","bind","plotEmitter","waitFor","defaultPlots","time","start","end","userInfo","stopUpdate","progress","validID","id","clearInterval","colorID","lobbyID","updateInterval","startUpdate","intervalID","setInterval","Number","getComputedStyle","getPropertyValue","on","initTable","requestTableUpdate","initPlot","requestPlotUpdate","changeUnits","checkInterval","module","exports","utils","processData","dataObj","dates","map","timestamps","date","replace","substring","length","allData","extend","data","plotting","url","var_names","update","maxPoints","err_callback","$","ajax","type","jsonp","dataType","success","code","console","error","format","message","graphDiv","existingDates","warn","startIndex","info","i","slice","intervalLookUp","intervalToSeconds","varNamesForDiv","varNames","each","trace_data","Array","prototype","push","apply","anc_variables","uniq","endTime","stream_string","dt_in_ms","time_parts","split","Date","hasOwnProperty","buildRequestUrl","Plotly","getSecondAxisConfig","axis_number","plot_info","axis_info","axis_kwargs","key","axis_config","gridcolor","titlefont","title","zeroline","overlaying","toString","side","anchor","idx","coreLobbyLayout","layout","plot_idx","topOfGraph","graphName","textSize","ticktext","tickfont","size","showline","linecolor","domain","floor","showgrid","font","showarrow","align","x","y","xref","yref","text","div_id","DEFAULT_PLOT_HEIGHT","nshowing","showlegend","height","Object","assign","showticklabels","tickformat","trace_info","trace_config","step","x_anchor","trace_kwargs","plots","yaxis","trace_info_idx","traces","name","xaxis","hoverinfo","hovermode","anc_data","plot_name","trace_index","isSecondAxis","colorbar","len","z","yaxis2","skip","toolbar","responsive","plot","table","tbody","children","add_contour_rows","info_td","addClass","row","short_name","append","add_anc_rows","anc_info_idx","anc_info","anc_idx","title_row","hightlight_idx","y_highlight","hightlight_idx_idx","units","hl_idx","data_cells","convert_cells","trace_idx","trace","indexOf","includes","join","updateTable","results","td_idx","num_results","html","update_contour_cells","update_val","convert","old_precision","precision","orig_val","getTickText","convert_value","convert_units","convert_val","innerHTML","update_anc_cells","zprobe","zprobe2","anc_key","String","args","arguments","match","number","getWaterTempProbe","plotInfo","traceInfo","allProbeText","probeText","col","rowText","depth","j","toFixed","getF","getSpeedMPH","val","getSpeedKTS","getPresInHg","getAccumMillimeter","cardinalWDir","degrees","getVal","CONVERSION_FUNCTIONS","null","formatValue","val2","getDewpointProbe","relHum","rh_info","defaultProbeText","PROBE_TEXT_FUNCTIONS","dewpoint","water_temp","getProbeText","probe_text","values","tickText","getTickVals","max","bump","extra","range","removeOldPoints","removeCount","splice","formatDate","formatString","hour12","toLocaleString","hour","minute","second","month","getMonth","dateInfo","day_name","month_name","day","year","$0","$1","updateHeader","layoutUpdates","curr_date","opacity","date_local","date_utc","elevation","changeCamera","directions","newDirection","src","alt","getTime","currData","tick_dates","converted_tickvals","tickvals","round","relayout","fitGraphs","var_name","defaultTickVals","yMin","yMax","spread","bottom","top","tick0","replaceData","plotHandled","forceRedraw","tracesToExtend","extendData","newContourData","contourTracesToExtend","contourExtendData","traceIndex","index","extendTraces","keys","redraw","epoch","sep","order","streams","request_url","METOBS_API_URL","checkboxTemplates","controlPanelTemplate","dispatchCustom","dispatcher","getUserInfo","startDate","endDate","intervalVal","setTimeout","dropDown","selectedText","timeDelta","bind_daterange_actions","jQ_div","click","change","set_active_form","which_block","prop","set_form_datepickers","datetimepicker","changeMonth","changeYear","dateFormat","timeFormat","showSecond","showMillisec","showMicrosec","trigger","setup_all_forms","ready","disable","enable","getDate","dateString","timeString","parseInt","seconds","enablePlot","disablePlot","checkFields","selected","diff","points","attr"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AAC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;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;;AAE1B;AACA;AACA;AACA;;;;;;;;;;;;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,IAAI,IAAqC;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;AACrD,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,0BAA0B;AAC1B;AACA;AACA;;AAEA,2B;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,mBAAO,CAAC,+DAAkB;;;;;;;;;;;;;ACTtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,gBAAgB,mBAAO,CAAC,gEAAoB;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2BAA2B,KAAqC,qGAAqG,SAAgB;AACrL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,KAAqC,qFAAqF,SAAgB;AACrK,oBAAoB,iBAAiB;AACrC;AACA;AACA,+BAA+B,KAAqC,gHAAgH,SAAgB;AACpM;AACA;AACA,6BAA6B,KAAqC,kGAAkG,SAAgB;AACpL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4BAA4B,KAAqC,8FAA8F,SAAgB;AAC/K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED,4B;;;;;;;;;;;ACtOA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM,KAA6B;AACnC,QAAQ,KAA4B;AACpC;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA;AACA,KAAK;AACL;AACA,uCAAuC,YAAY;AACnD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAkD;AAClD,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,wCAAwC;AACxC,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6CAA6C,YAAY;AACzD;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,0BAA0B;AACpE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAqB,cAAc;AACnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAe;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,eAAe;AACpC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM,KAAwB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf,cAAc;AACd,cAAc;AACd,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,qBAAqB;AACrB;;AAEA;AACA;AACA,KAAK;AACL,iBAAiB;;AAEjB;AACA,kDAAkD,EAAE,iBAAiB;;AAErE;AACA,wBAAwB,8BAA8B;AACtD,2BAA2B;;AAE3B;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kDAAkD,iBAAiB;;AAEnE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAyC;AAC/C,IAAI,iCAAqB,EAAE,mCAAE;AAC7B;AACA,KAAK;AAAA,oGAAC;AACN;AACA,CAAC;;;;;;;;;;;;;AC3pDD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH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ACF,eADrB;;AAGN8P;AACM;AAEP;AACD;;AAED;;;;;;;AAOA,SAASvU,aAAT,GACA;AACC,KAAIsS,YAAYhR,EAAE,oBAAF,EAAwB8K,GAAxB,EAAhB;AACA,KAAImG,UAAUjR,EAAE,kBAAF,EAAsB8K,GAAtB,EAAd;AACA,KAAI5P,YAAY8E,EAAE,oBAAF,EAAwB8K,GAAxB,EAAhB;AACA,KAAIhJ,UAAU9B,EAAE,kBAAF,EAAsB8K,GAAtB,EAAd;AACA,KAAIzQ,WAAW2F,EAAE,WAAF,CAAf;;AAEA;AACA,KAAIoT,WAAWpT,EAAE,2BAAF,CAAf;;AAEG;AACH,KAAG,CAAC,CAACgR,SAAD,IAAc,CAACC,OAAf,IAA0B,CAAC/V,SAA3B,IAAwC,CAAC4G,OAA1C,KAAsDsR,SAASxO,IAAT,MAAmB,IAA5E,EACA;AACC5E,IAAE,cAAF,EAAkB6I,IAAlB,CAAuB,wEAAvB;AACA7I,IAAE,UAAF,EAAcuT,IAAd,CAAmB,UAAnB,EAA+B,UAA/B;AACA;;AAEE;AACHJ,aAAYnC,SAAZ,EAAuBC,OAAvB,EAAgC/V,SAAhC,EAA2C4G,OAA3C,EAAoDzH,QAApD;AACA;;AAEDsE,OAAOC,OAAP,CAAe/D,OAAf,GAAyBA,OAAzB;AACA8D,OAAOC,OAAP,CAAe8T,OAAf,GAAyBA,OAAzB;AACA/T,OAAOC,OAAP,CAAe+T,MAAf,GAAwBA,MAAxB;AACAhU,OAAOC,OAAP,CAAeF,aAAf,GAA+BA,aAA/B,C;;;;;;;;;;;AC5MA,wB","file":"meteorogram.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./controller.js\");\n","var buildFormInDiv = require('./ui/buttons.js');\nvar Dispatcher = require('./dispatcher.js');\nvar _ = require('underscore');\n\nfunction API(div, controlDiv, plotsInfo) {\n var myDispatcher = Dispatcher.getDispatcher();\n return {\n plotDiv: div,\n controlDiv: controlDiv,\n // Our storage of the plotly data/traces being plotted right now\n dataCache: [],\n\n initMeteorogram: function(plot_div, plotOrder) {\n this.hasGraph = true;\n this.plotDiv = plot_div || this.plotDiv;\n //start with only the selected plots showing, reveal others only if their data is requested\n myDispatcher.dispatch({\n 'status': 'initPlot',\n 'emit': 'plotEmitter',\n 'location': this.plotDiv,\n 'dataCache': this.dataCache,\n 'plotsInfo': plotsInfo,\n 'plotOrder': plotOrder\n });\n },\n initMeteorogramTable: function(table_div,plotOrder) {\n this.hasTable = true;\n this.tableDiv = table_div || this.plotDiv;\n //start with only the selected plots showing, reveal others only if their data is requested\n myDispatcher.dispatch({\n 'status': 'initTable',\n 'emit': 'plotEmitter',\n 'location': this.tableDiv,\n 'plotsInfo': plotsInfo,\n 'plotOrder': plotOrder,\n });\n },\n\n initMeteorogramControls:function(plotOrder){\n buildFormInDiv(this.controlDiv, this.plotDiv,myDispatcher);\n },\n\n displayRealTime: function() {\n if (this.hasTable) {\n myDispatcher.dispatch({\n 'status':'update_table',\n 'emit':'plotEmitter',\n 'time':'-3:00:00',\n 'location':this.tableDiv\n });\n }\n if (this.hasGraph) {\n myDispatcher.dispatch({\n 'status':'get_since_now',\n 'emit':'plotEmitter',\n 'time':'-3:00:00',\n 'location':this.plotDiv\n });\n }\n },\n\n showPlot:function(varName){\n myDispatcher.dispatch({status: ('show' + varName), 'emit': 'checkboxEmitter','location':this.div});\n },\n\n hidePlot:function(varName){\n myDispatcher.dispatch({status: ('hide' + varName), 'emit': 'checkboxEmitter','location':this.div});\n },\n\n displayRecent: function(start_time) {\n // interval, if not provided, will be determined based on start time\n myDispatcher.dispatch({\n 'status': 'get_since_now',\n 'emit': 'plotEmitter',\n 'time': start_time,\n });\n },\n\n displayTimeRange: function(start_time, stop_time, interval) {\n myDispatcher.dispatch({\n 'status':'get_between_dates',\n 'emit':'plotEmitter',\n 'start':start_time,\n 'end':stop_time,\n 'interval':interval||'auto',\n });\n\n },\n }\n}\n\n//expose the API to other scripts\nwindow.MeteorogramController = API;\n","\"use strict\";\n\n//var $ = require('jquery');\nvar ee = require('event-emitter');\nvar Flux = require('flux');\nvar Plot = require('./plot/init.js');\nvar Table = require('./plot/table.js');\nvar dataAccess = require('./plot/data.js');\nvar loading = require('./ui/loading.js');\nvar updatePlot = require('./plot/update.js');\nvar hue;\n\nfunction getDispatcher() {\n var myDispatcher = new Flux.Dispatcher();\n //not sure where else to stick globals\n myDispatcher.GRAPH_HEIGHT = 170;\n /**\n * The purpose of this method is to dispatch an update message to plotStore\n *\n * no parameters\n * no returns\n */\n\n function dispatchUpdate(startTime) {\n return function() {\n //dispatch update message to plotStore\n myDispatcher.dispatch({'status': 'update', 'emit': 'plotEmitter', 'startTime': startTime});\n }\n }\n\n function dispatchChangeUnits(unitCount) {\n return function() {\n unitCount = (unitCount + 1) % 2\n //dispatch update message to plotStore\n myDispatcher.dispatch({'status': 'changeUnits', 'emit': 'plotEmitter', 'unitCount': unitCount});\n }\n }\n\n function changeBackgroundColor() {\n // Moves faster between Red, Green, and Blue. This is purely aesthetic to avoid \"ugly\" colors (I'm looking at\n // you brown-green).\n var skip_jump = 120;\n var acceleration = 2;\n var rate = .2;\n // Exactly rate times faster at skip_jump / 2, and normal speed at skip_jump.\n hue += (acceleration * Math.min(skip_jump - hue % skip_jump, hue % skip_jump) / (skip_jump / 2) + 1) * rate\n // Loops around the color circle.\n if (hue > 360) {\n hue = 0\n }\n // Make the brighter colors more grey to match the darker colors above them.\n document.getElementById('row1').style.backgroundColor = 'hsl(' + hue + ',' + 100 + '%,' + 15 + '%)';\n document.getElementById('row2').style.backgroundColor = 'hsl(' + hue + ',' + 75 + '%,' + 30 + '%)';\n document.getElementById('row3').style.backgroundColor = 'hsl(' + hue + ',' + 50 + '%,' + 45 + '%)';\n }\n\n //creates checkbox store\n var checkboxEmitter = ee({\n visible: {},\n setPlots: function (plotsInfo) {\n for (var plot_key in plotsInfo) {\n this.visible[plot_key] = true;\n }\n },\n setShowing: function(plotName, visible) {\n if (visible === undefined) {\n this.showing[plotName] = !this.showing[plotName];\n } else {\n this.showing[plotName] = visible;\n }\n },\n getShowing: function(plotName) {\n return this.showing[plotName];\n },\n handleActions: function(action) {\n //only handels if action is for checkbox emitter\n if(action.emit == 'checkboxEmitter')\n {\n this.emit(action.status, action.location);\n }\n }\n });\n\n //register store with dispatcher\n checkboxEmitter.dispatchToken = myDispatcher.register(checkboxEmitter.handleActions.bind(checkboxEmitter));\n\n //create plotStore\n // FIXME: Event emitter should be added to a class prototype, not the other way around\n // See https://github.com/medikoo/event-emitter#usage\n // The below works...but only because event-emitter allows it. Should probably stick with advertised features\n var plotEmitter = ee({\n handleActions: function(action) {\n if (action.emit == 'plotEmitter') {\n myDispatcher.waitFor([checkboxEmitter.dispatchToken]);\n\n if (action.location !== undefined) {\n this.div = action.location;\n }\n\n if (action.plotsInfo !== undefined) {\n this.plotsInfo = action.plotsInfo;\n this.plotOrder = this.plotsInfo.defaultPlots;\n }\n if (action.plotOrder !== undefined) {\n this.plotOrder = action.plotOrder;\n }\n\n if (action.dataCache !== undefined) {\n this.dataCache = action.dataCache;\n }\n\n if (action.status == 'get_since_now') {\n if (this.plotsInfo['isLobbyDisplay']) {\n action.time = '-6:00:00'\n }\n this.emit(\n action.status,\n action.time,\n this.plotsInfo,\n this.dataCache,\n this.div);\n }else if (action.status == 'update_table') {\n this.emit(\n action.status,\n action.time,\n this.plotsInfo,\n this.div);\n } else if (action.status == 'get_between_dates') {\n this.emit(\n action.status,\n action.start,\n action.end,\n action.interval,\n this.plotsInfo,\n this.dataCache,\n this.div);\n } else if (action.status == 'initPlot') {\n this.emit(\n action.status,\n action.location,\n action.plotOrder ? action.plotOrder : this.plotOrder,\n this.plotsInfo,\n this.dataCache);\n } else if (action.status == 'initTable') {\n this.emit(\n action.status,\n action.location,\n action.plotOrder ? action.plotOrder : this.plotOrder,\n this.plotsInfo);\n } else if (action.status == 'update') {\n this.emit(action.status, this.div, this.plotsInfo, this.dataCache, action.startTime);\n } else if (action.status == 'changeUnits') {\n this.emit(action.status, this.div, this.plotsInfo, this.dataCache, action.unitCount);\n } else {\n //adds parameter for user information in custom plot\n // console.debug(\"Emitting user information message: {action.status} : {action.userInfo}\");\n this.emit(action.status, action.userInfo);\n }\n }\n }\n });\n\n\n function stopUpdate(plotsInfo) {\n if(!plotsInfo.progress)\n plotsInfo.progress = {};\n if(plotsInfo.progress.validID){\n var id = plotsInfo.progress.id[0];\n clearInterval(id);\n if (plotsInfo['isLobbyDisplay']) {\n clearInterval(plotsInfo.progress.colorID);\n clearInterval(plotsInfo.progress.lobbyID);\n }\n plotsInfo.progress.validID = false;\n }\n }\n\n // update every N/2 milliseconds\n const updateInterval = {\n '1m': 30 * 1000,\n '5m': 2.5 * 60 * 1000,\n '1h': 30 * 60 * 1000,\n };\n\n\n function startUpdate(startTime, interval, plotsInfo) {\n // stop any previous updates\n if(!plotsInfo.progress)\n plotsInfo.progress = {};\n stopUpdate(plotsInfo);\n\n // resume update operations\n if (startTime === undefined) {\n startTime = plotsInfo.progress.id[1];\n }\n if (interval === undefined) {\n interval = plotsInfo.progress.id[2];\n }\n\n // every 30 seconds, rings update alarm\n var intervalID = setInterval(dispatchUpdate(startTime), updateInterval[interval]);\n if (plotsInfo['isLobbyDisplay']) {\n hue = Number(getComputedStyle(document.getElementById(\"color\")).getPropertyValue('--starting-hue'))\n plotsInfo.progress.colorID = setInterval(changeBackgroundColor, 1000)\n plotsInfo.progress.lobbyID = setInterval(dispatchChangeUnits(0), 5000);\n }\n // save alarm id\n plotsInfo.progress.id = [intervalID, startTime, interval];\n plotsInfo.progress.validID = true;\n }\n\n plotEmitter.on('initTable', function(div, plotOrder, plotsInfo) {\n //initialize checkbox store\n checkboxEmitter.setPlots(plotsInfo);\n Table.initTable(div, plotOrder, plotsInfo);\n });\n\n plotEmitter.on('update_table',function(time, plotsInfo, div){\n Table.requestTableUpdate(div, plotsInfo);\n setInterval(function(){Table.requestTableUpdate(div,plotsInfo)},updateInterval['1m']);\n });\n\n plotEmitter.on('initPlot', function(div, plotOrder, plotsInfo, dataCache) {\n //initialize checkbox store\n checkboxEmitter.setPlots(plotsInfo);\n Plot.initPlot(dataCache, div, plotOrder, plotsInfo);\n });\n\n plotEmitter.on(\"get_since_now\", function(time, plotsInfo, dataCache, div) {\n var interval = dataAccess.requestPlotUpdate(dataCache, div, plotsInfo, time,\n undefined, undefined, undefined, stopUpdate);\n startUpdate(time, interval, plotsInfo);\n });\n\n plotEmitter.on(\"get_between_dates\",function(start, end, interval, plotsInfo, dataCache, div) {\n stopUpdate(plotsInfo);\n dataAccess.requestPlotUpdate(dataCache, div, plotsInfo, start, end, interval);\n });\n\n //when store recieves signal, update component\n plotEmitter.on('update', function(div, plotsInfo, dataCache, startTime) {\n dataAccess.requestPlotUpdate(dataCache, div, plotsInfo, startTime, undefined, undefined, true);\n });\n\n plotEmitter.on('changeUnits', function(div, plotsInfo, dataCache, unitCount) {\n updatePlot.changeUnits(dataCache, document.getElementById(div), plotsInfo, unitCount)\n });\n\n plotEmitter.on(\"checking_custom\", function()\n {\n //before components were plots. Here, it's the user prompt paragraph\n loading.checkInterval();\n });\n\n //register plotStore with dispatcher\n plotEmitter.dispatchToken = myDispatcher.register(plotEmitter.handleActions.bind(plotEmitter));\n\n return myDispatcher;\n}\n\n//exports dispatchers and stores\nmodule.exports.getDispatcher = getDispatcher;\n","'use strict';\n\nvar assign = require('es5-ext/object/assign')\n , normalizeOpts = require('es5-ext/object/normalize-options')\n , isCallable = require('es5-ext/object/is-callable')\n , contains = require('es5-ext/string/#/contains')\n\n , d;\n\nd = module.exports = function (dscr, value/*, options*/) {\n\tvar c, e, w, options, desc;\n\tif ((arguments.length < 2) || (typeof dscr !== 'string')) {\n\t\toptions = value;\n\t\tvalue = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[2];\n\t}\n\tif (dscr == null) {\n\t\tc = w = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t\tw = contains.call(dscr, 'w');\n\t}\n\n\tdesc = { value: value, configurable: c, enumerable: e, writable: w };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\nd.gs = function (dscr, get, set/*, options*/) {\n\tvar c, e, options, desc;\n\tif (typeof dscr !== 'string') {\n\t\toptions = set;\n\t\tset = get;\n\t\tget = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[3];\n\t}\n\tif (get == null) {\n\t\tget = undefined;\n\t} else if (!isCallable(get)) {\n\t\toptions = get;\n\t\tget = set = undefined;\n\t} else if (set == null) {\n\t\tset = undefined;\n\t} else if (!isCallable(set)) {\n\t\toptions = set;\n\t\tset = undefined;\n\t}\n\tif (dscr == null) {\n\t\tc = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t}\n\n\tdesc = { get: get, set: set, configurable: c, enumerable: e };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n","\"use strict\";\n\n// eslint-disable-next-line no-empty-function\nmodule.exports = function () {};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? Object.assign\n\t: require(\"./shim\");\n","\"use strict\";\n\nmodule.exports = function () {\n\tvar assign = Object.assign, obj;\n\tif (typeof assign !== \"function\") return false;\n\tobj = { foo: \"raz\" };\n\tassign(obj, { bar: \"dwa\" }, { trzy: \"trzy\" });\n\treturn (obj.foo + obj.bar + obj.trzy) === \"razdwatrzy\";\n};\n","\"use strict\";\n\nvar keys = require(\"../keys\")\n , value = require(\"../valid-value\")\n , max = Math.max;\n\nmodule.exports = function (dest, src /*, …srcn*/) {\n\tvar error, i, length = max(arguments.length, 2), assign;\n\tdest = Object(value(dest));\n\tassign = function (key) {\n\t\ttry {\n\t\t\tdest[key] = src[key];\n\t\t} catch (e) {\n\t\t\tif (!error) error = e;\n\t\t}\n\t};\n\tfor (i = 1; i < length; ++i) {\n\t\tsrc = arguments[i];\n\t\tkeys(src).forEach(assign);\n\t}\n\tif (error !== undefined) throw error;\n\treturn dest;\n};\n","// Deprecated\n\n\"use strict\";\n\nmodule.exports = function (obj) {\n return typeof obj === \"function\";\n};\n","\"use strict\";\n\nvar _undefined = require(\"../function/noop\")(); // Support ES3 engines\n\nmodule.exports = function (val) {\n return (val !== _undefined) && (val !== null);\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? Object.keys\n\t: require(\"./shim\");\n","\"use strict\";\n\nmodule.exports = function () {\n\ttry {\n\t\tObject.keys(\"primitive\");\n\t\treturn true;\n\t} catch (e) {\n return false;\n}\n};\n","\"use strict\";\n\nvar isValue = require(\"../is-value\");\n\nvar keys = Object.keys;\n\nmodule.exports = function (object) {\n\treturn keys(isValue(object) ? Object(object) : object);\n};\n","\"use strict\";\n\nvar isValue = require(\"./is-value\");\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\nvar process = function (src, obj) {\n\tvar key;\n\tfor (key in src) obj[key] = src[key];\n};\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function (opts1 /*, …options*/) {\n\tvar result = create(null);\n\tforEach.call(arguments, function (options) {\n\t\tif (!isValue(options)) return;\n\t\tprocess(Object(options), result);\n\t});\n\treturn result;\n};\n","\"use strict\";\n\nmodule.exports = function (fn) {\n\tif (typeof fn !== \"function\") throw new TypeError(fn + \" is not a function\");\n\treturn fn;\n};\n","\"use strict\";\n\nvar isValue = require(\"./is-value\");\n\nmodule.exports = function (value) {\n\tif (!isValue(value)) throw new TypeError(\"Cannot use null or undefined\");\n\treturn value;\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? String.prototype.contains\n\t: require(\"./shim\");\n","\"use strict\";\n\nvar str = \"razdwatrzy\";\n\nmodule.exports = function () {\n\tif (typeof str.contains !== \"function\") return false;\n\treturn (str.contains(\"dwa\") === true) && (str.contains(\"foo\") === false);\n};\n","\"use strict\";\n\nvar indexOf = String.prototype.indexOf;\n\nmodule.exports = function (searchString/*, position*/) {\n\treturn indexOf.call(this, searchString, arguments[1]) > -1;\n};\n","'use strict';\n\nvar d = require('d')\n , callable = require('es5-ext/object/valid-callable')\n\n , apply = Function.prototype.apply, call = Function.prototype.call\n , create = Object.create, defineProperty = Object.defineProperty\n , defineProperties = Object.defineProperties\n , hasOwnProperty = Object.prototype.hasOwnProperty\n , descriptor = { configurable: true, enumerable: false, writable: true }\n\n , on, once, off, emit, methods, descriptors, base;\n\non = function (type, listener) {\n\tvar data;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) {\n\t\tdata = descriptor.value = create(null);\n\t\tdefineProperty(this, '__ee__', descriptor);\n\t\tdescriptor.value = null;\n\t} else {\n\t\tdata = this.__ee__;\n\t}\n\tif (!data[type]) data[type] = listener;\n\telse if (typeof data[type] === 'object') data[type].push(listener);\n\telse data[type] = [data[type], listener];\n\n\treturn this;\n};\n\nonce = function (type, listener) {\n\tvar once, self;\n\n\tcallable(listener);\n\tself = this;\n\ton.call(this, type, once = function () {\n\t\toff.call(self, type, once);\n\t\tapply.call(listener, this, arguments);\n\t});\n\n\tonce.__eeOnceListener__ = listener;\n\treturn this;\n};\n\noff = function (type, listener) {\n\tvar data, listeners, candidate, i;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return this;\n\tdata = this.__ee__;\n\tif (!data[type]) return this;\n\tlisteners = data[type];\n\n\tif (typeof listeners === 'object') {\n\t\tfor (i = 0; (candidate = listeners[i]); ++i) {\n\t\t\tif ((candidate === listener) ||\n\t\t\t\t\t(candidate.__eeOnceListener__ === listener)) {\n\t\t\t\tif (listeners.length === 2) data[type] = listeners[i ? 0 : 1];\n\t\t\t\telse listeners.splice(i, 1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ((listeners === listener) ||\n\t\t\t\t(listeners.__eeOnceListener__ === listener)) {\n\t\t\tdelete data[type];\n\t\t}\n\t}\n\n\treturn this;\n};\n\nemit = function (type) {\n\tvar i, l, listener, listeners, args;\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return;\n\tlisteners = this.__ee__[type];\n\tif (!listeners) return;\n\n\tif (typeof listeners === 'object') {\n\t\tl = arguments.length;\n\t\targs = new Array(l - 1);\n\t\tfor (i = 1; i < l; ++i) args[i - 1] = arguments[i];\n\n\t\tlisteners = listeners.slice();\n\t\tfor (i = 0; (listener = listeners[i]); ++i) {\n\t\t\tapply.call(listener, this, args);\n\t\t}\n\t} else {\n\t\tswitch (arguments.length) {\n\t\tcase 1:\n\t\t\tcall.call(listeners, this);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcall.call(listeners, this, arguments[1]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcall.call(listeners, this, arguments[1], arguments[2]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tl = arguments.length;\n\t\t\targs = new Array(l - 1);\n\t\t\tfor (i = 1; i < l; ++i) {\n\t\t\t\targs[i - 1] = arguments[i];\n\t\t\t}\n\t\t\tapply.call(listeners, this, args);\n\t\t}\n\t}\n};\n\nmethods = {\n\ton: on,\n\tonce: once,\n\toff: off,\n\temit: emit\n};\n\ndescriptors = {\n\ton: d(on),\n\tonce: d(once),\n\toff: d(off),\n\temit: d(emit)\n};\n\nbase = defineProperties({}, descriptors);\n\nmodule.exports = exports = function (o) {\n\treturn (o == null) ? create(base) : defineProperties(Object(o), descriptors);\n};\nexports.methods = methods;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nmodule.exports.Dispatcher = require('./lib/Dispatcher');\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Dispatcher\n * \n * @preventMunge\n */\n\n'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar _prefix = 'ID_';\n\n/**\n * Dispatcher is used to broadcast payloads to registered callbacks. This is\n * different from generic pub-sub systems in two ways:\n *\n * 1) Callbacks are not subscribed to particular events. Every payload is\n * dispatched to every registered callback.\n * 2) Callbacks can be deferred in whole or part until other callbacks have\n * been executed.\n *\n * For example, consider this hypothetical flight destination form, which\n * selects a default city when a country is selected:\n *\n * var flightDispatcher = new Dispatcher();\n *\n * // Keeps track of which country is selected\n * var CountryStore = {country: null};\n *\n * // Keeps track of which city is selected\n * var CityStore = {city: null};\n *\n * // Keeps track of the base flight price of the selected city\n * var FlightPriceStore = {price: null}\n *\n * When a user changes the selected city, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'city-update',\n * selectedCity: 'paris'\n * });\n *\n * This payload is digested by `CityStore`:\n *\n * flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'city-update') {\n * CityStore.city = payload.selectedCity;\n * }\n * });\n *\n * When the user selects a country, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'country-update',\n * selectedCountry: 'australia'\n * });\n *\n * This payload is digested by both stores:\n *\n * CountryStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * CountryStore.country = payload.selectedCountry;\n * }\n * });\n *\n * When the callback to update `CountryStore` is registered, we save a reference\n * to the returned token. Using this token with `waitFor()`, we can guarantee\n * that `CountryStore` is updated before the callback that updates `CityStore`\n * needs to query its data.\n *\n * CityStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * // `CountryStore.country` may not be updated.\n * flightDispatcher.waitFor([CountryStore.dispatchToken]);\n * // `CountryStore.country` is now guaranteed to be updated.\n *\n * // Select the default city for the new country\n * CityStore.city = getDefaultCityForCountry(CountryStore.country);\n * }\n * });\n *\n * The usage of `waitFor()` can be chained, for example:\n *\n * FlightPriceStore.dispatchToken =\n * flightDispatcher.register(function(payload) {\n * switch (payload.actionType) {\n * case 'country-update':\n * case 'city-update':\n * flightDispatcher.waitFor([CityStore.dispatchToken]);\n * FlightPriceStore.price =\n * getFlightPriceStore(CountryStore.country, CityStore.city);\n * break;\n * }\n * });\n *\n * The `country-update` payload will be guaranteed to invoke the stores'\n * registered callbacks in order: `CountryStore`, `CityStore`, then\n * `FlightPriceStore`.\n */\n\nvar Dispatcher = (function () {\n function Dispatcher() {\n _classCallCheck(this, Dispatcher);\n\n this._callbacks = {};\n this._isDispatching = false;\n this._isHandled = {};\n this._isPending = {};\n this._lastID = 1;\n }\n\n /**\n * Registers a callback to be invoked with every dispatched payload. Returns\n * a token that can be used with `waitFor()`.\n */\n\n Dispatcher.prototype.register = function register(callback) {\n var id = _prefix + this._lastID++;\n this._callbacks[id] = callback;\n return id;\n };\n\n /**\n * Removes a callback based on its token.\n */\n\n Dispatcher.prototype.unregister = function unregister(id) {\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.unregister(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n delete this._callbacks[id];\n };\n\n /**\n * Waits for the callbacks specified to be invoked before continuing execution\n * of the current callback. This method should only be used by a callback in\n * response to a dispatched payload.\n */\n\n Dispatcher.prototype.waitFor = function waitFor(ids) {\n !this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Must be invoked while dispatching.') : invariant(false) : undefined;\n for (var ii = 0; ii < ids.length; ii++) {\n var id = ids[ii];\n if (this._isPending[id]) {\n !this._isHandled[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Circular dependency detected while ' + 'waiting for `%s`.', id) : invariant(false) : undefined;\n continue;\n }\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n this._invokeCallback(id);\n }\n };\n\n /**\n * Dispatches a payload to all registered callbacks.\n */\n\n Dispatcher.prototype.dispatch = function dispatch(payload) {\n !!this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.') : invariant(false) : undefined;\n this._startDispatching(payload);\n try {\n for (var id in this._callbacks) {\n if (this._isPending[id]) {\n continue;\n }\n this._invokeCallback(id);\n }\n } finally {\n this._stopDispatching();\n }\n };\n\n /**\n * Is this Dispatcher currently dispatching.\n */\n\n Dispatcher.prototype.isDispatching = function isDispatching() {\n return this._isDispatching;\n };\n\n /**\n * Call the callback stored with the given id. Also do some internal\n * bookkeeping.\n *\n * @internal\n */\n\n Dispatcher.prototype._invokeCallback = function _invokeCallback(id) {\n this._isPending[id] = true;\n this._callbacks[id](this._pendingPayload);\n this._isHandled[id] = true;\n };\n\n /**\n * Set up bookkeeping needed when dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._startDispatching = function _startDispatching(payload) {\n for (var id in this._callbacks) {\n this._isPending[id] = false;\n this._isHandled[id] = false;\n }\n this._pendingPayload = payload;\n this._isDispatching = true;\n };\n\n /**\n * Clear bookkeeping used for dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._stopDispatching = function _stopDispatching() {\n delete this._pendingPayload;\n this._isDispatching = false;\n };\n\n return Dispatcher;\n})();\n\nmodule.exports = Dispatcher;","// Underscore.js 1.9.1\n// http://underscorejs.org\n// (c) 2009-2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` (`self`) in the browser, `global`\n // on the server, or `this` in some virtual machines. We use `self`\n // instead of `window` for `WebWorker` support.\n var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global ||\n this ||\n {};\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype;\n var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create;\n\n // Naked function reference for surrogate-prototype-swapping.\n var Ctor = function(){};\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for their old module API. If we're in\n // the browser, add `_` as a global object.\n // (`nodeType` is checked to ensure that `module`\n // and `exports` are not HTML elements.)\n if (typeof exports != 'undefined' && !exports.nodeType) {\n if (typeof module != 'undefined' && !module.nodeType && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root._ = _;\n }\n\n // Current version.\n _.VERSION = '1.9.1';\n\n // Internal function that returns an efficient (for current engines) version\n // of the passed-in callback, to be repeatedly applied in other Underscore\n // functions.\n var optimizeCb = function(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n };\n\n var builtinIteratee;\n\n // An internal function to generate callbacks that can be applied to each\n // element in a collection, returning the desired result — either `identity`,\n // an arbitrary callback, a property matcher, or a property accessor.\n var cb = function(value, context, argCount) {\n if (_.iteratee !== builtinIteratee) return _.iteratee(value, context);\n if (value == null) return _.identity;\n if (_.isFunction(value)) return optimizeCb(value, context, argCount);\n if (_.isObject(value) && !_.isArray(value)) return _.matcher(value);\n return _.property(value);\n };\n\n // External wrapper for our callback generator. Users may customize\n // `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n // This abstraction hides the internal-only argCount argument.\n _.iteratee = builtinIteratee = function(value, context) {\n return cb(value, context, Infinity);\n };\n\n // Some functions take a variable number of arguments, or a few expected\n // arguments at the beginning and then a variable number of values to operate\n // on. This helper accumulates all remaining arguments past the function’s\n // argument length (or an explicit `startIndex`), into an array that becomes\n // the last argument. Similar to ES6’s \"rest parameter\".\n var restArguments = function(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0),\n rest = Array(length),\n index = 0;\n for (; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n case 2: return func.call(this, arguments[0], arguments[1], rest);\n }\n var args = Array(startIndex + 1);\n for (index = 0; index < startIndex; index++) {\n args[index] = arguments[index];\n }\n args[startIndex] = rest;\n return func.apply(this, args);\n };\n };\n\n // An internal function for creating a new object that inherits from another.\n var baseCreate = function(prototype) {\n if (!_.isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n };\n\n var shallowProperty = function(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n };\n\n var has = function(obj, path) {\n return obj != null && hasOwnProperty.call(obj, path);\n }\n\n var deepGet = function(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n };\n\n // Helper for collection methods to determine whether a collection\n // should be iterated as an array or as an object.\n // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n var getLength = shallowProperty('length');\n var isArrayLike = function(collection) {\n var length = getLength(collection);\n return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n };\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles raw objects in addition to array-likes. Treats all\n // sparse array-likes as if they were dense.\n _.each = _.forEach = function(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var keys = _.keys(obj);\n for (i = 0, length = keys.length; i < length; i++) {\n iteratee(obj[keys[i]], keys[i], obj);\n }\n }\n return obj;\n };\n\n // Return the results of applying the iteratee to each element.\n _.map = _.collect = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n };\n\n // Create a reducing function iterating left or right.\n var createReduce = function(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n };\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`.\n _.reduce = _.foldl = _.inject = createReduce(1);\n\n // The right-associative version of reduce, also known as `foldr`.\n _.reduceRight = _.foldr = createReduce(-1);\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? _.findIndex : _.findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n };\n\n // Return all the elements that pass a truth test.\n // Aliased as `select`.\n _.filter = _.select = function(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n _.each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, predicate, context) {\n return _.filter(obj, _.negate(cb(predicate)), context);\n };\n\n // Determine whether all of the elements match a truth test.\n // Aliased as `all`.\n _.every = _.all = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Aliased as `any`.\n _.some = _.any = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n };\n\n // Determine if the array or object contains a given item (using `===`).\n // Aliased as `includes` and `include`.\n _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = _.values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return _.indexOf(obj, item, fromIndex) >= 0;\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = restArguments(function(obj, path, args) {\n var contextPath, func;\n if (_.isFunction(path)) {\n func = path;\n } else if (_.isArray(path)) {\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return _.map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n });\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, _.property(key));\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // containing specific `key:value` pairs.\n _.where = function(obj, attrs) {\n return _.filter(obj, _.matcher(attrs));\n };\n\n // Convenience version of a common use case of `find`: getting the first object\n // containing specific `key:value` pairs.\n _.findWhere = function(obj, attrs) {\n return _.find(obj, _.matcher(attrs));\n };\n\n // Return the maximum element (or element-based computation).\n _.max = function(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : _.values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n _.each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : _.values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n _.each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || computed === Infinity && result === Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n };\n\n // Shuffle a collection.\n _.shuffle = function(obj) {\n return _.sample(obj, Infinity);\n };\n\n // Sample **n** random values from a collection using the modern version of the\n // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n // If **n** is not specified, returns a single random element.\n // The internal `guard` argument allows it to work with `map`.\n _.sample = function(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = _.values(obj);\n return obj[_.random(obj.length - 1)];\n }\n var sample = isArrayLike(obj) ? _.clone(obj) : _.values(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = _.random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n };\n\n // Sort the object's values by a criterion produced by an iteratee.\n _.sortBy = function(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return _.pluck(_.map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n _.each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n });\n\n // Indexes the object's values by a criterion, similar to `groupBy`, but for\n // when you know that your index values will be unique.\n _.indexBy = group(function(result, value, key) {\n result[key] = value;\n });\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n });\n\n var reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\n // Safely create a real, live array from anything iterable.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (_.isArray(obj)) return slice.call(obj);\n if (_.isString(obj)) {\n // Keep surrogate pair characters together\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return _.map(obj, _.identity);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : _.keys(obj).length;\n };\n\n // Split a collection into two arrays: one whose elements all satisfy the given\n // predicate, and one whose elements all do not satisfy the predicate.\n _.partition = group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n }, true);\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null || guard) return array[0];\n return _.initial(array, array.length - n);\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array.\n _.last = function(array, n, guard) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return _.rest(array, Math.max(0, array.length - n));\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, Boolean);\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, strict, output) {\n output = output || [];\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (shallow) {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n } else {\n flatten(value, shallow, strict, output);\n idx = output.length;\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n };\n\n // Flatten out an array, either recursively (by default), or just one level.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, false);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = restArguments(function(array, otherArrays) {\n return _.difference(array, otherArrays);\n });\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // The faster algorithm will not work with an iteratee if the iteratee\n // is not a one-to-one function, so providing an iteratee will disable\n // the faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iteratee, context) {\n if (!_.isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!_.contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!_.contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = restArguments(function(arrays) {\n return _.uniq(flatten(arrays, true, true));\n });\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (_.contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!_.contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return _.filter(array, function(value){\n return !_.contains(rest, value);\n });\n });\n\n // Complement of _.zip. Unzip accepts an array of arrays and groups\n // each array's elements on shared indices.\n _.unzip = function(array) {\n var length = array && _.max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = _.pluck(array, index);\n }\n return result;\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = restArguments(_.unzip);\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values. Passing by pairs is the reverse of _.pairs.\n _.object = function(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // Generator function to create the findIndex and findLastIndex functions.\n var createPredicateIndexFinder = function(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n };\n\n // Returns the first index on an array-like that passes a predicate test.\n _.findIndex = createPredicateIndexFinder(1);\n _.findLastIndex = createPredicateIndexFinder(-1);\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n };\n\n // Generator function to create the indexOf and lastIndexOf functions.\n var createIndexFinder = function(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n };\n\n // Return the position of the first occurrence of an item in an array,\n // or -1 if the item is not included in the array.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n };\n\n // Chunk a single array into multiple arrays, each containing `count` or fewer\n // items.\n _.chunk = function(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Determines whether to execute a function as a constructor\n // or a normal function with the provided arguments.\n var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (_.isObject(result)) return result;\n return self;\n };\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n // available.\n _.bind = restArguments(function(func, context, args) {\n if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n });\n\n // Partially apply a function by creating a version that has had some of its\n // arguments pre-filled, without changing its dynamic `this` context. _ acts\n // as a placeholder by default, allowing any combination of arguments to be\n // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\n _.partial = restArguments(function(func, boundArgs) {\n var placeholder = _.partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n });\n\n _.partial.placeholder = _;\n\n // Bind a number of an object's methods to that object. Remaining arguments\n // are the method names to be bound. Useful for ensuring that all callbacks\n // defined on an object belong to it.\n _.bindAll = restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = keys[index];\n obj[key] = _.bind(obj[key], obj);\n }\n });\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n });\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = _.partial(_.delay, _, 1);\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time. Normally, the throttled function will run\n // as much as it can, without ever going more than once per `wait` duration;\n // but if you'd like to disable the execution on the leading edge, pass\n // `{leading: false}`. To disable execution on the trailing edge, ditto.\n _.throttle = function(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : _.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var now = _.now();\n if (!previous && options.leading === false) previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, result;\n\n var later = function(context, args) {\n timeout = null;\n if (args) result = func.apply(context, args);\n };\n\n var debounced = restArguments(function(args) {\n if (timeout) clearTimeout(timeout);\n if (immediate) {\n var callNow = !timeout;\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(this, args);\n } else {\n timeout = _.delay(later, wait, this, args);\n }\n\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = null;\n };\n\n return debounced;\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return _.partial(wrapper, func);\n };\n\n // Returns a negated version of the passed-in predicate.\n _.negate = function(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n };\n\n // Returns a function that will only be executed on and after the Nth call.\n _.after = function(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Returns a function that will only be executed up to (but not including) the Nth call.\n _.before = function(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = _.partial(_.before, 2);\n\n _.restArguments = restArguments;\n\n // Object Functions\n // ----------------\n\n // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\n var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n var collectNonEnumProps = function(obj, keys) {\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = _.isFunction(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n keys.push(prop);\n }\n }\n };\n\n // Retrieve the names of an object's own properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`.\n _.keys = function(obj) {\n if (!_.isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n };\n\n // Retrieve all the property names of an object.\n _.allKeys = function(obj) {\n if (!_.isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var keys = _.keys(obj);\n var length = keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[keys[i]];\n }\n return values;\n };\n\n // Returns the results of applying the iteratee to each element of the object.\n // In contrast to _.map it returns an object.\n _.mapObject = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var keys = _.keys(obj),\n length = keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n // The opposite of _.object.\n _.pairs = function(obj) {\n var keys = _.keys(obj);\n var length = keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [keys[i], obj[keys[i]]];\n }\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n var keys = _.keys(obj);\n for (var i = 0, length = keys.length; i < length; i++) {\n result[obj[keys[i]]] = keys[i];\n }\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`.\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // An internal function for creating assigner functions.\n var createAssigner = function(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = createAssigner(_.allKeys);\n\n // Assigns a given object with all the own properties in the passed-in object(s).\n // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n _.extendOwn = _.assign = createAssigner(_.keys);\n\n // Returns the first key on an object that passes a predicate test.\n _.findKey = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = _.keys(obj), key;\n for (var i = 0, length = keys.length; i < length; i++) {\n key = keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n };\n\n // Internal pick helper function to determine if `obj` has key `key`.\n var keyInObj = function(value, key, obj) {\n return key in obj;\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (_.isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = _.allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n });\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (_.isFunction(iteratee)) {\n iteratee = _.negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = _.map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !_.contains(keys, key);\n };\n }\n return _.pick(obj, iteratee, context);\n });\n\n // Fill in a given object with default properties.\n _.defaults = createAssigner(_.allKeys, true);\n\n // Creates an object that inherits from the given prototype object.\n // If additional properties are provided then they will be added to the\n // created object.\n _.create = function(prototype, props) {\n var result = baseCreate(prototype);\n if (props) _.extendOwn(result, props);\n return result;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Returns whether an object has a given set of `key:value` pairs.\n _.isMatch = function(object, attrs) {\n var keys = _.keys(attrs), length = keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n };\n\n\n // Internal recursive comparison function for `isEqual`.\n var eq, deepEq;\n eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n };\n\n // Internal recursive comparison function for `isEqual`.\n deepEq = function(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&\n _.isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var keys = _.keys(a), key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (_.keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n return _.keys(obj).length === 0;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) === '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isMap, isWeakMap, isSet, isWeakSet.\n _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol', 'Map', 'WeakMap', 'Set', 'WeakSet'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) === '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE < 9), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return has(obj, 'callee');\n };\n }\n\n // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n // IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\n var nodelist = root.document && root.document.childNodes;\n if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {\n _.isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return !_.isSymbol(obj) && isFinite(obj) && !isNaN(parseFloat(obj));\n };\n\n // Is the given value `NaN`?\n _.isNaN = function(obj) {\n return _.isNumber(obj) && isNaN(obj);\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, path) {\n if (!_.isArray(path)) {\n return has(obj, path);\n }\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (obj == null || !hasOwnProperty.call(obj, key)) {\n return false;\n }\n obj = obj[key];\n }\n return !!length;\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iteratees.\n _.identity = function(value) {\n return value;\n };\n\n // Predicate-generating functions. Often useful outside of Underscore.\n _.constant = function(value) {\n return function() {\n return value;\n };\n };\n\n _.noop = function(){};\n\n // Creates a function that, when passed an object, will traverse that object’s\n // properties down the given `path`, specified as an array of keys or indexes.\n _.property = function(path) {\n if (!_.isArray(path)) {\n return shallowProperty(path);\n }\n return function(obj) {\n return deepGet(obj, path);\n };\n };\n\n // Generates a function for a given object that returns a given property.\n _.propertyOf = function(obj) {\n if (obj == null) {\n return function(){};\n }\n return function(path) {\n return !_.isArray(path) ? obj[path] : deepGet(obj, path);\n };\n };\n\n // Returns a predicate for checking whether an object has a given set of\n // `key:value` pairs.\n _.matcher = _.matches = function(attrs) {\n attrs = _.extendOwn({}, attrs);\n return function(obj) {\n return _.isMatch(obj, attrs);\n };\n };\n\n // Run a function **n** times.\n _.times = function(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n };\n\n // A (possibly faster) way to get the current timestamp as an integer.\n _.now = Date.now || function() {\n return new Date().getTime();\n };\n\n // List of HTML entities for escaping.\n var escapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n var unescapeMap = _.invert(escapeMap);\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n var createEscaper = function(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + _.keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n };\n _.escape = createEscaper(escapeMap);\n _.unescape = createEscaper(unescapeMap);\n\n // Traverses the children of `obj` along `path`. If a child is a function, it\n // is invoked with its parent as context. Returns the value of the final\n // child, or `fallback` if any child is undefined.\n _.result = function(obj, path, fallback) {\n if (!_.isArray(path)) path = [path];\n var length = path.length;\n if (!length) {\n return _.isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = _.isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n var escapeChar = function(match) {\n return '\\\\' + escapes[match];\n };\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n // NB: `oldSettings` only exists for backwards compatibility.\n _.template = function(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n var argument = settings.variable || 'obj';\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function. Start chaining a wrapped Underscore object.\n _.chain = function(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var chainResult = function(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n _.each(_.functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n return chainResult(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n _.each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return chainResult(this, method.apply(this._wrapped, arguments));\n };\n });\n\n // Extracts the result from a wrapped and chained object.\n _.prototype.value = function() {\n return this._wrapped;\n };\n\n // Provide unwrapping proxy for some methods used in engine operations\n // such as arithmetic and JSON stringification.\n _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n _.prototype.toString = function() {\n return String(this._wrapped);\n };\n\n // AMD registration happens at the end for compatibility with AMD loaders\n // that may not enforce next-turn semantics on modules. Even though general\n // practice for AMD registration is to be anonymous, underscore registers\n // as a named module because, like jQuery, it is a base library that is\n // popular enough to be bundled in a third party lib, but not be part of\n // an AMD load request. Those cases could generate an error when an\n // anonymous define() is called outside of a loader request.\n if (typeof define == 'function' && define.amd) {\n define('underscore', [], function() {\n return _;\n });\n }\n}());\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","\"use strict\";\nvar updatePlot = require('./update.js');\nvar utils = require('./utils.js');\nvar _ = require('underscore');\n\n\nfunction processData(dataObj) {\n // plotly doesn't support the 'T' date/time separator or the 'Z' at the end\n // https://help.plot.ly/date-format-and-time-series/#step-2-entering-dates-and-times-in-plotly-s-grid\n var dates = _.map(dataObj.timestamps, function(date){return date.replace(\"T\",' ').substring(0, date.length-1)});\n var allData = {\n dates: dates,\n };\n _.extend(allData, dataObj.data);\n return allData;\n}\n\n\nfunction plotting(dataCache, url, var_names, plotsInfo, div, update, maxPoints, err_callback) {\n //gets information and updates component\n $.ajax({\n type: 'GET',\n url: url,\n jsonp: \"callback\",\n dataType: \"jsonp\",\n\n success: function(dataObj) {\n if (dataObj.code != 200) {\n console.error(\"Invalid data API query. Code: {0} | Message: {1}\".format(\n dataObj.code, dataObj.message));\n if (err_callback !== undefined) {\n // stop the update timer if specified\n err_callback(plotsInfo);\n }\n return;\n }\n\n var graphDiv = document.getElementById(div);\n var allData = processData(dataObj['results']);\n // var existingDates = graphDiv.data[0]['x'];\n var existingDates = dataCache[0]['x'] || [];\n var dates = allData['dates'];\n dataObj = {\n dates: dates\n };\n\n if (dataObj.dates.length == 0) {\n console.warn(\"No data available from API\");\n return;\n }\n\n if (update) {\n // first index in the new data that is actually new\n var startIndex = 0;\n // update only dates that aren't already included\n // assume that we don't have any missing dates in the middle\n while (startIndex < dates.length && dates[startIndex] <= existingDates[existingDates.length - 1]) {\n startIndex++;\n }\n\n // subset the data if needed\n if (startIndex >= dates.length) {\n console.info(\"No new data downloaded\");\n return;\n } else {\n for (var i = 0; i < var_names.length; i++) {\n dataObj[var_names[i]] = allData[var_names[i]].slice(startIndex);\n }\n dates = dates.slice(startIndex);\n dataObj.dates = dates;\n }\n } else {\n // replace the entire data array\n for (var i = 0; i < var_names.length; i++) {\n dataObj[var_names[i]] = allData[var_names[i]];\n }\n }\n\n // Update data with\n updatePlot.updatePlot(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints);\n }\n });\n}\n\n\n// 1. the minimum time period (in milliseconds) that a request must cover in order to use\n// 2. MetObs Data API interval specifier\n// 3. reasonable update interval for API given this data interval\nconst intervalLookUp = [\n // 1 day for 5 minutes\n [1000*60*60*24, '5m', '-00:10:00'],\n // 1 month for 1 hour\n [1000*60*60*24*30*1, '1h', '-02:00:00'],\n // anything else is 1 minute\n];\n\nconst intervalToSeconds = {\n '1m': 60,\n '5m': 60 * 5,\n '1h': 60 * 60,\n};\n\n\nfunction varNamesForDiv(dataCache) {\n var varNames = [];\n _.each(dataCache, function(trace_data) {\n Array.prototype.push.apply(varNames, trace_data.var_names);\n if ('anc_variables' in trace_data) {\n Array.prototype.push.apply(varNames, trace_data.anc_variables);\n }\n });\n return _.uniq(varNames);\n}\n\n\n//poorly ordered function parameters\nfunction requestPlotUpdate(dataCache, div, plotsInfo, startTime, endTime, interval, update, err_callback) {\n var varNames = varNamesForDiv(dataCache);\n var stream_string = '';\n var dt_in_ms;\n var time_parts;\n var maxPoints;\n var time;\n for (var i in varNames) {\n stream_string += varNames[i];\n if (i < varNames.length - 1) stream_string += ':';\n }\n\n if (!endTime) {\n interval = '1m';\n // hours, minutes, seconds\n time_parts = _.map(startTime.split(':'), Number);\n dt_in_ms = -1000 * 60 * 60 * time_parts[0] + 1000 * 60 * time_parts[1] + 1000 * time_parts[2];\n for (var i in intervalLookUp) {\n if (dt_in_ms >= intervalLookUp[i][0]) {\n interval = intervalLookUp[i][1];\n\n if (update) {\n // we only want new data, the passed startTime was only\n // used to determine the interval\n startTime = intervalLookUp[i][2];\n }\n }\n }\n time = '&begin=' + startTime;\n } else {\n time = '&begin=' + startTime + '&end=' + endTime;\n if (interval == 'auto') {\n interval = '1m';\n dt_in_ms = (new Date(endTime)) - (new Date(startTime));\n for (var i in intervalLookUp) {\n if (dt_in_ms >= intervalLookUp[i][0])\n interval = intervalLookUp[i][1];\n }\n }\n }\n\n\n // Maximum number of points (fallback to arbitrary 250)\n if (update) {\n maxPoints = intervalToSeconds.hasOwnProperty(interval) ? dt_in_ms / 1000 / intervalToSeconds[interval] : 250;\n } else {\n maxPoints = 0; // delete all previous data\n }\n var url = utils.buildRequestUrl('json', interval, '', '', 'column', time, stream_string);\n plotting(dataCache, url, varNames, plotsInfo, div, update, maxPoints, err_callback);\n return interval;\n}\n\n\n//export functions\nmodule.exports.requestPlotUpdate = requestPlotUpdate;\n","\"use strict\";\nvar Plotly = require('Plotly');\nvar loading = require('../ui/loading.js');\n\n\nfunction getSecondAxisConfig(axis_number, plot_info, axis_info, axis_kwargs) {\n var key;\n var axis_config = {\n gridcolor: '#777777',\n titlefont: {'size' : 12},\n title: axis_info['title'],\n zeroline: false,\n overlaying: 'y' + (axis_number - 1).toString(),\n side: 'right',\n anchor: 'x',\n };\n\n for (var idx=0; idx < axis_kwargs.length; idx++) {\n key = axis_kwargs[idx];\n if (key in axis_info) {\n axis_config[key] = axis_info[key];\n }\n }\n return axis_config;\n}\n\n\nfunction coreLobbyLayout(layout, axis_config, axis_number, plot_idx, topOfGraph, graphName, textSize) {\n layout['xaxis' + axis_number] = {\n ticktext: ['-6h', '-3h', 'Now'],\n tickfont: {\n size: textSize / 5\n },\n showline: true,\n linecolor: 'white',\n anchor: 'y' + axis_number,\n // 1 is the far right of the plot, 0 is the far left.\n // Space the x-axis with the 10% of window width on each side. The bottom row has no middle graph,\n // which is why we multiply by (1 + Math.floor(plot_idx / 6)).\n domain: [.1 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6)), 14 / 60 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6))],\n // xaxis doesn't show its lines.\n zeroline: false,\n // hide grid.\n showgrid: false\n };\n // This is the text for the current value above each graph.\n layout['annotations'].push({\n font: {\n size: textSize / 2\n },\n showarrow: false,\n align: 'center',\n // Middle of each x-axis domain.\n x: 1/6 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6)), //position in x domain\n y: topOfGraph + .04, //position in y domain\n xref: 'paper',\n yref: 'paper',\n //Makes text centered\n showarrow: true,\n arrowhead: 0,\n ax: 0,\n ay: 0,\n });\n // This is the text for the name of each graph.\n layout['annotations'].push({\n text: graphName,\n font: {\n size: textSize / 4\n },\n showarrow: false,\n align: 'center',\n x: 1/6 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6)), //position in x domain\n y: topOfGraph + .085, //position in y domain\n xref: 'paper',\n yref: 'paper',\n //Makes text centered\n showarrow: true,\n arrowhead: 0,\n ax: 0,\n ay: 0,\n });\n // Removes title from yaxis.\n delete axis_config['title']\n axis_config['tickfont'] = { size: textSize / 5 }\n axis_config['showgrid'] = false;\n axis_config['showticklabels'] = true;\n // Give each subgraph its own y-axis.\n axis_config['anchor'] = 'x' + axis_number;\n axis_config['showline'] = true;\n axis_config['linecolor'] = 'white';\n // axis_config are both modified without having to be returned.\n}\n\n\nfunction initPlot(dataCache, div_id, plotOrder, plotsInfo) {\n var DEFAULT_PLOT_HEIGHT = 170;\n var nshowing = plotOrder.length;\n var layout = {\n title: plotsInfo.title,\n showlegend: false,\n height: DEFAULT_PLOT_HEIGHT * nshowing + 180,\n }\n // Updates layout with plotsInfo.layout, which is defined for lobby display.\n Object.assign(layout, plotsInfo.layout)\n layout['xaxis'] = {\n //domain affects size of x axis\n //this made room for the legend\n //1 is the far right of the plot, 0 is the far left\n domain: [0, 1],\n\n //xaxis doesn't show its lines\n showline: false,\n zeroline: false,\n\n //values of the tick labels show up\n //show right away if we have any starting streams\n showticklabels: nshowing > 0,\n\n //its grid is a little darker than default\n gridcolor: \"#777777\",\n\n //hide grid\n showgrid: false,\n tickformat: '%Y-%m-%d %H:%MZ'\n };\n var axis_number = 0;\n var axis_info;\n var plot_info;\n var trace_info;\n var trace_config;\n var axis_config;\n var plot_key;\n var key;\n var step = 1 / nshowing;\n var domain;\n var x_anchor = axis_number;\n var trace_kwargs = ['marker', 'color', 'mode', 'zmin', 'zmax', 'y',\n 'contours', 'line', 'colorscale', 'showscale', 'colorbar', 'tick0', 'dtick', 'hovermode'];\n var axis_kwargs = ['nticks', 'range', 'autorange', 'zeroline', 'showgrid',\n 'tickmode', 'ticktext', 'tickvals'];\n for (var plot_idx = 0; plot_idx < plotOrder.length; plot_idx++) {\n plot_key = plotOrder[plot_idx];\n plot_info = plotsInfo.plots[plot_key];\n axis_number += 1;\n x_anchor = axis_number;\n axis_info = plot_info.yaxis;\n domain = [(plotOrder.length - 1 - plot_idx) * step * 1.03, 1 - plot_idx * step * 1.05];\n if (plotsInfo['isLobbyDisplay']) {\n // Leaves 8% for the header, then divides the rest into thirds with 10% height above and below each graph.\n domain = [.82 - 8 / 75 - (.2 + 8 / 75) * Math.floor(plot_idx / 3), .82 - (.2 + 8 / 75) * Math.floor(plot_idx / 3)];\n }\n\n // Create the necessary traces (lines)\n for (var trace_info_idx = 0; trace_info_idx < plot_info.traces.length; trace_info_idx++) {\n trace_info = plot_info.traces[trace_info_idx];\n trace_config = {\n name: trace_info['name'],\n x: [],\n y: [],\n text: [],\n type: trace_info.type ? trace_info.type : 'scatter',\n // Gives each graph its own x-axis if plotsInfo['isLobbyDisplay'].\n xaxis: plotsInfo['isLobbyDisplay'] ? 'x' + axis_number : 'x1',\n yaxis: 'y' + axis_number,\n hoverinfo: 'x+text',\n hovermode: 'closest',\n // meteorogram custom data flags\n var_names: trace_info['var_names'],\n anc_variables: trace_info['anc_variables'],\n anc_data: [],\n plot_name: plot_key,\n trace_index: trace_info_idx\n };\n // when we have a second trace that is purely there to make the\n // second y-axis appear, we do this to point the trace to the\n // correct axis\n if (trace_info.isSecondAxis) {\n trace_config.yaxis = 'y' + (axis_number + trace_info_idx);\n }\n\n for (var idx = 0; idx < trace_kwargs.length; idx++) {\n key = trace_kwargs[idx];\n if (key in trace_info) {\n trace_config[key] = trace_info[key];\n }\n }\n if ('colorbar' in trace_config) {\n trace_config.colorbar.len = domain[1] - domain[0];\n trace_config.colorbar.y = (domain[1] - domain[0]) / 2 + domain[0];\n trace_config.z = [];\n }\n dataCache.push(trace_config);\n }\n\n // Create Y-axis configuration object\n axis_config = {\n gridcolor: '#777777',\n titlefont: { 'size': 12 },\n title: axis_info['title'],\n zeroline: false,\n // where on the canvas does this axis belong\n domain: domain\n };\n if (plotsInfo['isLobbyDisplay']) {\n coreLobbyLayout(layout, axis_config, axis_number, plot_idx, domain[1], trace_info['name'], plotsInfo['rowTextSize'])\n }\n\n for (idx = 0; idx < axis_kwargs.length; idx++) {\n key = axis_kwargs[idx];\n if (key in axis_info) {\n axis_config[key] = axis_info[key];\n }\n }\n\n layout['yaxis' + axis_number] = axis_config;\n\n // Process second y-axis config\n // Skip if specified meaning this configuration is only parsed\n // for additional hover/probe information (custom MetObs thing, not Plotly)\n if (!plotsInfo['isLobbyDisplay'] && 'yaxis2' in plot_info && !plot_info.yaxis2.skip) {\n axis_number += 1;\n axis_info = plot_info.yaxis2;\n axis_config = getSecondAxisConfig(axis_number, plot_info, axis_info, axis_kwargs);\n layout['yaxis' + axis_number] = axis_config;\n }\n // MetObs custom way of saying \"I want more probe information\n // if ('probe2' in plot_info) {\n // axis_number += 1;\n // axis_info = plot_info.probe2;\n // axis_config = getSecondAxisConfig(axis_number, plot_info, axis_info, axis_kwargs);\n // layout['probe' + axis_number] = axis_config;\n // }\n }\n // xaxis only shows on the bottom most plot\n layout['xaxis']['anchor'] = 'y' + x_anchor;\n\n // Toolbar configuration\n var toolbar = {\n // Disable link to plotly\n 'showLink': false,\n // Don't show plotly logo\n 'displaylogo': false,\n 'displayModeBar': true,\n 'responsive': true\n };\n if (plotsInfo['isLobbyDisplay']) {\n // Prevents first graph from taking up entire width, and other layout problems.\n delete layout['xaxis'];\n // Adjusts graph sizes every time window size is changed.\n toolbar = {responsive: true};\n }\n //creates new graph\n Plotly.plot(div_id, dataCache, layout, toolbar);\n loading.loading();\n}\n\nmodule.exports.initPlot = initPlot;\n","\"use strict\";\nvar ticktext = require('./ticks.js');\nvar utils = require('./utils.js');\n\n/* \n * Build a table in the specified div with a row for each trace in plotsInfo\n * Stores metadata for each trace using $.data, which is retrieved\n * and used by requestTableUpdate\n */\nfunction initTable(div_id, plotOrder, plotsInfo) {\n var div = $('#'+div_id);\n var table = $('<table class=\"met_table\"><tbody></tbody></table>');\n var tbody = table.children('tbody');\n\n var plot_info;\n var plot_key;\n for (var plot_idx=0; plot_idx < plotOrder.length; plot_idx++) {\n plot_key = plotOrder[plot_idx];\n plot_info = plotsInfo.plots[plot_key];\n //extract the necessary variables\n for (var trace_info_idx=0; trace_info_idx < plot_info.traces.length; trace_info_idx++) {\n var trace_info = plot_info.traces[trace_info_idx];\n if(trace_info.type=='contour'){\n add_contour_rows(tbody,plot_key,trace_info_idx,trace_info,plot_info);\n }else{\n var info_td = $('<td>N/A</td>');\n info_td.addClass('met_data');\n info_td.data('info', {key:plot_key,idx:trace_info_idx});\n var row = $('<tr></tr>');\n var name = trace_info.short_name || trace_info.name;\n if (name == 'Wind Direction Card') {\n continue\n }\n row.append('<td>'+name+'</td>');\n row.append(info_td);\n row.append('<td class=\"convert\"></td>');\n tbody.append(row);\n //add rows for our ancillary variables that normally only show up in tags\n if(trace_info.anc_variables)\n add_anc_rows(tbody,plot_key,trace_info_idx,trace_info);\n }\n };\n }\n div.append('<h3>'+plotsInfo.title+'</h3>');\n div.append(table);\n div.append('<span id=\"timestamp\"></span>');\n};\n\nfunction add_anc_rows(tbody,plot_key,idx,trace_info){\n for(var anc_info_idx = 0; anc_info_idx < trace_info.anc_variables.length; anc_info_idx++){\n var anc_info = trace_info.anc_info[trace_info.anc_variables[anc_info_idx]];\n var info_td = $('<td>N/A</td>');\n info_td.addClass('met_data');\n info_td.data('info', {key:plot_key,idx:idx,anc_idx:anc_info_idx});\n var row = $('<tr></tr>');\n var name = anc_info.short_name || anc_info.name;\n row.append('<td>'+name+'</td>');\n row.append(info_td);\n row.append('<td class=\"convert\"></td>');\n tbody.append(row);\n }\n\n}\n\nfunction add_contour_rows(tbody,plot_key,idx,trace_info,plot_info){\n var name = trace_info.short_name||trace_info.name;\n var title_row=('<tr><td colspan=\"2\">'+name+'</td><td></td>');\n tbody.append(title_row);\n for(var hightlight_idx = 0;hightlight_idx< trace_info.y_highlight.length;hightlight_idx++){\n var hightlight_idx_idx = trace_info.y_highlight[hightlight_idx];\n var row = $('<tr></tr>');\n var name = trace_info.y[hightlight_idx_idx] + plot_info.yaxis.units;\n row.append('<td class=\"subtitle text-center\">'+name+'</td>');\n var info_td = $('<td>N/A</td>');\n info_td.addClass('met_data');\n info_td.data('info', {key:plot_key,idx:idx,hl_idx:hightlight_idx_idx});\n row.append(info_td);\n row.append('<td class=\"convert\"></td>');\n tbody.append(row);\n }\n\n}\n\n/*\n * Build a datastream request from the data tags in div_id's existing meteorogram table,\n * then add labels and alternate units based on the axes objects in plotsInfo\n */\nfunction requestTableUpdate(div_id,plotsInfo) {\n var div = $('#'+div_id);\n var varNames = [];\n var plotOrder = [];\n var data_cells = $('#'+div_id+' .met_data');\n var convert_cells = $('#'+div_id+' .convert');\n var varName;\n data_cells.each(function(){\n var key = $(this).data('info').key;\n var trace_idx = $(this).data('info').idx;\n var anc_idx = $(this).data('info').anc_idx;\n var hl_idx = $(this).data('info').hl_idx;\n var trace = plotsInfo.plots[key].traces[trace_idx];\n if(plotOrder.indexOf(key)==-1)\n plotOrder.push(key);\n if(anc_idx !== undefined)\n varName = trace.anc_variables[0];\n else if(hl_idx !== undefined)\n varName = trace.var_names[hl_idx];\n else\n varName = trace.var_names[0];\n if (!varNames.includes(varName))\n varNames.push(varName);\n });\n var stream_string = varNames.join(':'); \n //Use a set time that has both buoy and tower records for testing\n var url = utils.buildRequestUrl('json', '1m', '', '', 'column', '&begin=-00:04:00', stream_string);\n $.ajax({\n type: 'GET',\n url: url,\n jsonp: \"callback\",\n dataType: \"jsonp\",\n success: function(dataObj){\n dataObj.div_id = div_id;\n dataObj.plotOrder = plotOrder;\n dataObj.data_cells = data_cells;\n dataObj.convert_cells = convert_cells;\n updateTable(dataObj,plotsInfo);\n }\n });\n}\n\nfunction updateTable(dataObj,plotsInfo) {\n var data = dataObj.results.data;\n var plot_info;\n var plot_key;\n var td_idx = 0;\n var div_id = dataObj.div_id;\n var plotOrder = dataObj.plotOrder;\n var data_cells = dataObj.data_cells;\n var convert_cells = dataObj.convert_cells;\n if(dataObj.num_results==0){\n $('#'+div_id+' #timestamp').html('No recent data');\n return;\n }\n $('#'+div_id+' #timestamp').html('Last updated: '+ dataObj.results.timestamps[0]);\n for (var plot_idx=0; plot_idx < plotOrder.length; plot_idx++) {\n plot_key = plotOrder[plot_idx];\n plot_info = plotsInfo.plots[plot_key];\n //Fill in a row for each trace in the plot\n for (var trace_info_idx=0; trace_info_idx < plot_info.traces.length; trace_info_idx++) {\n var trace_info = plot_info.traces[trace_info_idx];\n if (trace_info.name == 'Wind Direction Card') {\n continue\n }\n if (trace_info.type=='contour') {\n td_idx=update_contour_cells(data,data_cells,convert_cells,trace_info,td_idx);\n } else {\n var update_val = data[trace_info['var_names'][0]][0];\n if(update_val || update_val==0){\n var units = plot_info.yaxis.units;\n var convert = '';\n var old_precision = plot_info.yaxis.precision;\n plot_info.yaxis.precision=Math.min(old_precision,1);\n var orig_val = ticktext.getTickText([update_val],plot_info.yaxis);\n plot_info.yaxis.precision = old_precision;\n if(plot_info.yaxis2 && plot_info.yaxis2.convert_value != plot_info.yaxis.convert_value){\n var convert_units = plot_info.yaxis2.units;\n var old_precision = plot_info.yaxis2.precision;\n plot_info.yaxis2.precision= Math.min(old_precision,1);\n var convert_val = ticktext.getTickText([update_val],plot_info.yaxis2);\n plot_info.yaxis2.precision = old_precision;\n convert = convert_val+convert_units;\n }\n data_cells[td_idx].innerHTML=orig_val+units;\n convert_cells[td_idx].innerHTML=convert;\n } else {\n data_cells[td_idx].innerHTML='N/A';\n convert_cells[td_idx].innerHTML='';\n }\n td_idx+=1;\n //Fill in a row for each anc_var in the plot\n if (trace_info.anc_variables) {\n td_idx=update_anc_cells(data,data_cells,trace_info,td_idx);\n }\n }\n }\n }\n}\n\n\nfunction update_contour_cells(data,data_cells,convert_cells,trace_info,td_idx){\n for(var hightlight_idx = 0;hightlight_idx< trace_info.y_highlight.length;hightlight_idx++){\n var hightlight_idx_idx = trace_info.y_highlight[hightlight_idx];\n var update_val = data[trace_info['var_names'][hightlight_idx_idx]][0];\n var units = trace_info.zprobe.units;\n var orig_val = ticktext.getTickText([update_val],trace_info.zprobe);\n var convert = '';\n if(trace_info.zprobe2 && trace_info.zprobe2.convert_value){\n var convert_units = trace_info.zprobe2.units;\n var convert_val = ticktext.getTickText([update_val],trace_info.zprobe2);\n convert = convert_val+convert_units;\n }\n data_cells[td_idx].innerHTML=orig_val+units;\n convert_cells[td_idx].innerHTML=convert;\n td_idx+=1;\n }\n return td_idx;\n}\n\nfunction update_anc_cells(data,data_cells,trace_info,td_idx){\n for(var anc_info_idx = 0; anc_info_idx < trace_info.anc_variables.length; anc_info_idx++){\n var anc_key = trace_info.anc_variables[anc_info_idx];\n var anc_info = trace_info.anc_info[anc_key];\n var update_val = data[anc_key][0];\n var orig_val = ticktext.getTickText([update_val],anc_info);\n if(update_val || update_val==0)\n data_cells[td_idx].innerHTML=orig_val+anc_info.units;\n else\n data_cells[td_idx].innerHTML='N/A';\n td_idx+=1;\n }\n return td_idx;\n}\nmodule.exports.initTable = initTable; \nmodule.exports.requestTableUpdate = requestTableUpdate; \n","var _ = require('underscore');\n\n// Add string formatting if it doesn't exist\nif (!String.prototype.format) {\n String.prototype.format = function() {\n var args = arguments;\n return this.replace(/{(\\d+)}/g, function(match, number) {\n return typeof args[number] != 'undefined'\n ? args[number]\n : match\n ;\n });\n };\n}\n\nfunction getWaterTempProbe(data, plotInfo, traceInfo, allData) {\n var allProbeText = [];\n var probeText;\n var row, col;\n var rowText;\n var depth;\n for (var j=0; j < data.length; j++) {\n row = data[j];\n rowText = [];\n depth = traceInfo.y[j];\n for (var i=0; i < row.length; i++) {\n col = row[i];\n\n probeText = \"Depth: {0}m<br>{1}: {2} °C ({3} °F)\".format(\n depth.toFixed(1),\n traceInfo.name,\n col !== null ? col.toFixed(3) : \"N/A\",\n col !== null ? getF(col).toFixed(3) : \"N/A\");\n rowText.push(probeText);\n }\n allProbeText.push(rowText);\n }\n return allProbeText;\n}\n\nfunction getSpeedMPH(val) {\n // convert m/s to mph\n return val * 3600 / 1608;\n}\nfunction getSpeedKTS(val) {\n //m/s to knots\n return val * 1.94384;\n}\n\n\nfunction getPresInHg(val) {\n // hPa to InHg\n return val * 0.02952998751;\n}\n\n\nfunction getAccumMillimeter(val) {\n // convert inches to millimeters\n return val * 25.4;\n}\n\n\nfunction cardinalWDir(degrees){\n \n return ['N','NNE','NE','ENE',\n 'E','ESE','SE','SSE',\n 'S','SSW','SW','WSW',\n 'W','WNW','NW','NNW'][Math.floor(((degrees+11.25)%360)/22.5)];\n}\n// Convert C to F degrees\nfunction getF(val) {\n return val * 1.8 + 32;\n}\n\nfunction getVal(val) {\n return val;\n}\n\n\nvar CONVERSION_FUNCTIONS = {\n null: getVal,\n undefined: getVal,\n getF: getF,\n getPresInHg: getPresInHg,\n getSpeedMPH: getSpeedMPH,\n getAccumMillimeter: getAccumMillimeter,\n cardinalWDir: cardinalWDir,\n getSpeedKTS:getSpeedKTS\n};\n\n\n\nfunction formatValue(val, plotInfo, traceInfo) {\n var val2;\n if (val === null) {\n val = \"\";\n val2 = \"\";\n } else {\n if ('yaxis2' in plotInfo && 'convert_value' in plotInfo.yaxis2) {\n val2 = CONVERSION_FUNCTIONS[plotInfo.yaxis2.convert_value](val);\n val2 = (val2.toFixed)?val2.toFixed(plotInfo.yaxis2.precision):val2;\n } else {\n val2 = undefined;\n }\n val = CONVERSION_FUNCTIONS[plotInfo.yaxis.convert_value](val);\n val=(val.toFixed)?val.toFixed(plotInfo.yaxis.precision):val;\n }\n\n if ('yaxis2' in plotInfo && val2 !== undefined) {\n return \"{0}: {1}{2} ({3}{4})\".format(\n traceInfo.name,\n val, plotInfo.yaxis.units,\n val2, plotInfo.yaxis2.units);\n } else {\n return \"{0}: {1}{2}\".format(\n traceInfo.name,\n val, plotInfo.yaxis.units);\n }\n}\n\nfunction getDewpointProbe(data, plotInfo, traceInfo, allData) {\n var allProbeText = [];\n var probeText;\n var relHum = undefined;\n if ('anc_variables' in traceInfo && traceInfo.anc_variables.length == 1) {\n relHum = allData[traceInfo.anc_variables[0]];\n }\n var rh_info = traceInfo.anc_info[traceInfo.anc_variables[0]];\n if(!rh_info)\n rh_info={ name: traceInfo.anc_variables[0], units: '', precision: 2};\n\n for (var i=0; i < data.length; i++) {\n probeText = formatValue(data[i], plotInfo, traceInfo);\n if (relHum !== undefined) {\n probeText += \"<br>{0}: {1}{2}\".format(rh_info.name,\n relHum[i] ? relHum[i].toFixed(rh_info.precision) : \"\",\n rh_info.units);\n }\n allProbeText.push(probeText);\n }\n return allProbeText;\n}\n\n\nfunction defaultProbeText(data, plotInfo, traceInfo, allData) {\n // assume traces share the same 'x'\n var allProbeText = [];\n for (var i=0; i < data.length; i++) {\n allProbeText.push(formatValue(data[i], plotInfo, traceInfo));\n }\n return allProbeText;\n}\n\n\nvar PROBE_TEXT_FUNCTIONS = {\n undefined: defaultProbeText,\n null: defaultProbeText,\n dewpoint: getDewpointProbe,\n water_temp: getWaterTempProbe,\n};\n\n\nfunction getProbeText(data, plotInfo, traceInfo, allData) {\n if ('probe_text' in traceInfo) {\n return PROBE_TEXT_FUNCTIONS[traceInfo.probe_text](data, plotInfo, traceInfo, allData);\n }\n return defaultProbeText(data, plotInfo, traceInfo, allData);\n}\n\n\nfunction getTickText(values, axis_info) {\n var tickText = [];\n for (var i=0; i < values.length; i++) {\n var val = CONVERSION_FUNCTIONS[axis_info.convert_value](values[i]);\n val = (val.toFixed)?val.toFixed(axis_info.precision):val;\n tickText.push(val);\n }\n return tickText;\n}\n\n\n/**\n* the purpose of this method is to get the spacing for the y axis\n* For deg F and deg C\n* @param min - minimum of the temp or dew point array\n* @param max - maximum of the temp or dew point array\n* @return array of 4 tick values for the y axis\n*/\n\nfunction getTickVals(min, max, bump) {\n var extra = (max - min) * 0.02;\n min = min - extra;\n max = max + extra;\n var step = (max - min) / 4.;\n //create 4 tick values for the y axis\n return _.range(min, max + step, step);\n}\n\n\nmodule.exports.getTickVals = getTickVals;\nmodule.exports.getProbeText = getProbeText;\nmodule.exports.getTickText = getTickText;\n\n\n\n\n","var Plotly = require('Plotly');\nvar ticktext = require('./ticks.js');\nvar _ = require('underscore');\n\n\nfunction removeOldPoints(dataCache, removeCount) {\n for (var i = 0; i < dataCache.length; i++) {\n dataCache[i].x.splice(0, removeCount);\n\n if (dataCache[i].hasOwnProperty('z')) {\n for (var j = 0; j < dataCache[i].z.length; j++) {\n dataCache[i].z[j].splice(0, removeCount);\n }\n } else if (dataCache[i].hasOwnProperty('y')) {\n // delete things from y *only* if we don't have a Z\n dataCache[i].y.splice(0, removeCount);\n }\n if (dataCache[i].hasOwnProperty('text')) {\n dataCache[i].text.splice(0, removeCount);\n }\n }\n}\n\n\nfunction formatDate(date, formatString, hour12) {\n var date = new Date(date);\n var time = date.toLocaleString(undefined, { hour: 'numeric', minute: 'numeric', second: 'numeric', hour12: hour12 });\n var month = date.getMonth() + 1;\n month = month < 10 ? '0' + month : month;\n date = date.toString().split(' ');\n var dateInfo = {\n day_name: date[0],\n month_name: date[1],\n month: month,\n day: date[2],\n year: date[3],\n time: time,\n }\n // https://stackoverflow.com/questions/36529417/javascript-insert-variables-at-a-specific-place-in-a-string\n return formatString.replace(/\\{([^}]*)\\}/g, function($0, $1) {\n return dateInfo[$1] || $0;\n });\n}\n\n\nfunction updateHeader(dataCache, unitCount, layoutUpdates) {\n // Note: curr_date is 2 minutes behind the current time.\n var curr_date = dataCache[0]['x'][dataCache[0]['x'].length - 1];\n // Date() takes + ' UTC' as a way to know the given date is UTC and converts it to local time.\n var hour = Number(formatDate(curr_date + ' UTC', '{time}', false).split(':')[0]);\n // Make the screen go black between 1 and 5 am.\n if (0 < hour && hour < 5) {\n document.getElementById(\"overlay\").style.opacity = 1;\n } else {\n document.getElementById(\"overlay\").style.opacity = 0;\n }\n var date_local = formatDate(curr_date + ' UTC', '{day_name}, {month_name} {day}, {year} {time}', true);\n var date_utc = formatDate(curr_date, '{year}-{month}-{day} {time}Z', false);\n var elevation = unitCount == 0 ? '327.5 meters' : '1074.5 feet';\n layoutUpdates['annotations.1.text'] = 'Data last recorded at: ' + date_utc + ' [' + date_local + ' Local] RIG Elevation = ' + elevation;\n}\n\n\nfunction changeCamera() {\n var directions = {'north': 'east', 'east': 'south', 'south': 'west', 'west': 'north',};\n // Gets witch direction the current camera is showing.\n var newDirection = directions[document.getElementById('roofCam').src.split('/')[7]];\n // Makes image update. Image updates every (about) 2 minutes and 15 seconds.\n document.getElementById('roofCam').alt = document.getElementById('dirText').innerHTML = newDirection;\n document.getElementById('roofCam').src = 'http://metobs.ssec.wisc.edu/pub/cache/aoss/cameras/' + newDirection +\n '/latest_orig.jpg?t=' + new Date().getTime();\n}\n\n\nfunction changeUnits(dataCache, graphDiv, plotsInfo, unitCount) {\n // Note: unitCount alternates between 0 and 1.\n var plotName;\n var plotInfo;\n var currData;\n var tick_dates;\n // This changes the graphDiv y-axis we are getting.\n var axis_number;\n // This changes the plotInfo y-axis we are getting, which switches between units every time changeUnits is called.\n var yaxis = unitCount == 0 ? 'yaxis' : 'yaxis2';\n var converted_tickvals;\n var tickvals;\n var layoutUpdates = {};\n updateHeader(dataCache, unitCount, layoutUpdates);\n // Update each subgraph's displayed y-axis and current data values.\n for (var i = 0; i < dataCache.length; i++) {\n axis_number = i == 0 ? '' : i + 1;\n tick_dates = dataCache[i]['x'];\n // Prevents '-6h' from falling off x-axis.\n layoutUpdates['xaxis' + axis_number + '.tickvals'] = [ tick_dates[0], tick_dates[Math.round(tick_dates.length / 2)], tick_dates[tick_dates.length - 1]]\n plotName = dataCache[i].plot_name;\n plotInfo = plotsInfo.plots[plotName];\n // Convert data to the correct units.\n currData = ticktext.getTickText([dataCache[i]['y'][dataCache[i]['y'].length - 1]], plotInfo[yaxis])[0];\n layoutUpdates['annotations[' + (3 + 2 * i) + '].text'] = currData + '' + plotInfo[yaxis]['units']\n tickvals = graphDiv.layout['yaxis' + axis_number]['tickvals']\n if (tickvals != undefined) {\n // Relative Humidity and Wind Direction ticktext and tickvals are static from site_configs_lobby.js.\n if (plotName == 'wind_direction' || plotName == 'rel_hum') {\n converted_tickvals = plotInfo[yaxis]['ticktext'];\n } else {\n converted_tickvals = [];\n for (var j = 0; j < tickvals.length; j++) {\n converted_tickvals.push(ticktext.getTickText([tickvals[j]], plotInfo[yaxis]))\n }\n }\n layoutUpdates['yaxis' + axis_number + '.ticktext'] = converted_tickvals;\n }\n }\n // Updates everything at once to save time.\n Plotly.relayout(graphDiv, layoutUpdates);\n changeCamera();\n}\n\n\nfunction fitGraphs(dataCache, data, var_name, layoutUpdates, yaxis, defaultTickVals) {\n // Set the range of each graph if applicable.\n if (var_name != 'aoss.tower.rel_hum' && var_name != 'aoss.tower.wind_direction') {\n // data only contains new data. Thus we must keep track of old mins/maxs.\n if (dataCache['y'].length == 0) {\n // dataCache['y'] gets overridden somewhere.\n dataCache.yMin = Math.min(...data)\n dataCache.yMax = Math.max(...data)\n } else {\n dataCache.yMin = Math.min(...data, dataCache.yMin)\n dataCache.yMax = Math.max(...data, dataCache.yMax)\n }\n\n var spread = dataCache.yMax - dataCache.yMin;\n var bottom = dataCache.yMin - spread;\n var top = var_name == 'aoss.tower.solar_flux' ? dataCache.yMax : dataCache.yMax + spread;\n // Make graph visible if flat line: Add a margin equal to 10% of the value if non-zero, else scale from 0 to 1.\n if (spread == 0) {\n // Note: top == bottom since spread == 0.\n if (top > 0) {\n top = top * 1.1\n bottom = bottom * .9\n } else if (top < 0) { // Only applies to air_temp and dewpoint.\n top = top * .9\n bottom = bottom * 1.1\n } else { // Mainly for precipitation.\n top = .1\n bottom = -.1\n }\n }\n // Used to lower bottom so that the graph can be seen if it is 0.\n var tick0 = bottom\n // If bottom < 0: Make the bottom 0 since values cannot be negative,\n // and lower the bottom to see 0.\n if (var_name != 'aoss.tower.air_temp' && var_name != 'aoss.tower.dewpoint' && bottom <= 0) {\n bottom = 0;\n tick0 = 0;\n }\n // Shifts the bottom down so that tick0 doesn't overlap xaxis ticks, and graphs near zero can be seen.\n bottom -= .075 * spread + .001;\n layoutUpdates[yaxis + '.tickvals'] = [tick0, tick0 + (top - tick0) / 4, tick0 + 2 * (top - tick0) / 4,\n tick0 + 3 * (top - tick0) / 4, top]\n layoutUpdates[yaxis + '.range'] = [bottom, top]\n } else {\n layoutUpdates[yaxis + '.tickvals'] = defaultTickVals\n }\n // layoutUpdates is changed without having to return it.\n}\n\n\nfunction replaceData(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints) {\n var dates = dataObj.dates;\n var plotName;\n var plotInfo;\n var i;\n var probeText;\n var plotHandled = [];\n var forceRedraw = false;\n\n // scatter updates\n var tracesToExtend = [];\n var extendData = {\n x: [],\n y: [],\n text: [],\n };\n\n // contour updates\n var newContourData;\n var contourTracesToExtend = [];\n var contourExtendData = {\n x: [],\n z: [],\n text: [],\n };\n\n var traceIndex = 0;\n\n // Variables used for lobby display.\n var layoutUpdates = {};\n var axis_number;\n /**\n *\n * If we are updating the plots instead of replacing them, then try\n * to use plotly's extendTraces to update the x and y coordinates as well\n * the hovering probe text. This should only add new trace points instead\n * of updating all points.\n *\n * Since we passed 'dataCache' to plotly's 'plot' function during\n * initialization any changes to 'dataCache' should be mirrored in Plotly's\n * plot and vice versa. See the below stackoverflow question for details.\n * https://stackoverflow.com/questions/45759582/plotly-how-to-discard-older-points\n * This is important since we use `.shift()` on the data arrays to remove\n * \"old\" elements.\n *\n * We have to operate per-plot because some of our plots hover/probe labels\n * use the trace values to come up with one probe box\n * (air temp + dewpoint -> relative humidity).\n *\n */\n for (i = 0; i < dataCache.length; i++) {\n plotName = dataCache[i].plot_name;\n if (plotHandled[plotHandled.length - 1] == plotName) {\n // this happens when there are more than one trace in a plot\n continue;\n }\n plotInfo = plotsInfo.plots[plotName];\n _.each(plotInfo.traces, function (traceInfo, index) {\n\n if (dataCache[traceIndex + index].type == 'contour') {\n // push new dates for each trace to be extended\n contourExtendData.x.push(dates);\n contourTracesToExtend.push(traceIndex + index);\n // update the Z data instead of the traditional 'y' data\n // assumes Y doesn't update between calls\n newContourData = _.map(traceInfo.var_names, function(var_name) {return dataObj[var_name];});\n dataCache[i].text.push(...ticktext.getProbeText(newContourData, plotInfo, traceInfo, dataObj));\n for (var j = 0; j < traceInfo.var_names.length; j++) {\n while (j >= dataCache[i].z.length) {\n dataCache[i].z.push([]);\n }\n dataCache[i].z[j].push(...dataObj[traceInfo.var_names[j]]); // ES6-style push\n }\n contourExtendData.z.push(dataCache[i].z);\n contourExtendData.text.push(dataCache[i].text);\n // If plotly could handle extendTraces in the x-dimension we'd\n // probably do something like this:\n // newContourData = _.map(traceInfo.var_names, function(var_name) {return dataObj[var_name];});\n // contourExtendData.z.push(newContourData);\n // contourExtendData.text.push(\n // [ticktext.getProbeText(newContourData, plotInfo, traceInfo, dataObj)]\n // );\n } else {\n // push new dates for each trace to be extended\n extendData['x'].push(dates);\n tracesToExtend.push(traceIndex + index);\n // scatter plots, assume the y data is the data being updated\n _.each(traceInfo.var_names, function (var_name) {\n if (plotsInfo['isLobbyDisplay']) {\n axis_number = i == 0 ? '': i + 1;\n fitGraphs(dataCache[i], dataObj[var_name], var_name, layoutUpdates, 'yaxis' + axis_number, plotInfo['yaxis2']['tickvals'])\n }\n // push the entire new data array as one element to update\n extendData.y.push(dataObj[var_name]);\n\n // Get new probe text shown when hovering over the traces\n if ('probe_text' in traceInfo && traceInfo['probe_text'] === null) {\n // we don't want probe text for this trace\n probeText = [undefined];\n } else {\n probeText = ticktext.getProbeText(dataObj[var_name], plotInfo, traceInfo, dataObj);\n }\n extendData.text.push(probeText);\n });\n }\n });\n traceIndex += plotInfo.traces.length;\n plotHandled.push(plotName);\n }\n\n // Have plotly update the graph with the new points in extendData\n // This will add data to 'dataCache' because of how we originally\n // created the plots.\n if (tracesToExtend.length > 0) {\n Plotly.extendTraces(graphDiv, extendData, tracesToExtend);\n }\n if (contourTracesToExtend.length > 0) {\n Plotly.extendTraces(graphDiv, contourExtendData, contourTracesToExtend);\n // we are currently cheating and re-adding every \"row\" of data because\n // plotly doesn't support extendTrace'ing in the x-dimension\n // we want to remove the previous \"depth\" amount of rows\n for (i = 0; i < contourTracesToExtend.length; i++) {\n dataCache[contourTracesToExtend[i]].z.splice(0, dataCache[contourTracesToExtend[i]].y.length);\n dataCache[contourTracesToExtend[i]].text.splice(0, dataCache[contourTracesToExtend[i]].y.length);\n }\n }\n\n if (maxPoints == 0 && !update) {\n // we aren't doing realtime updates and the caller wants us to remove\n // all previous points and keep all new points\n maxPoints = dataObj.dates.length;\n // we have to force a redraw of the plot because the removed plots\n // will still exist on the the graph otherwise (until the next update)\n forceRedraw = true;\n }\n // If adding these new points gave us more points than we need\n // remove the points at the beginning of our data\n if (maxPoints > 0 && dataCache[0]['x'].length > maxPoints) {\n removeOldPoints(dataCache, dataCache[0].x.length - maxPoints);\n }\n\n // If lobby display and data to update.\n if (Object.keys(layoutUpdates).length != 0) {\n // Updates everything at once to save time. Should be done after all dataCache manipulations.\n Plotly.relayout(graphDiv, layoutUpdates);\n // The first time through, call changeUnits to display current data.\n if (!update) {\n changeUnits(dataCache, graphDiv, plotsInfo, 0);\n }\n }\n if (forceRedraw) {\n Plotly.redraw(graphDiv);\n }\n}\n\n\nfunction updatePlot(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints) {\n replaceData(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints);\n}\n\nmodule.exports.updatePlot = updatePlot;\nmodule.exports.changeUnits = changeUnits;\n","\"use strict\";\n\nfunction buildRequestUrl(format, interval, epoch, sep, order, time, streams) {\n var request_url = METOBS_API_URL+'/api/data.'+format+'?';\n request_url += 'interval='+interval;\n request_url += '&epoch='+epoch;\n request_url +='&sep='+sep || ',';\n request_url += '&order='+order;\n request_url+=time;\n request_url+='&symbols='+streams;\n return request_url;\n}\n\nmodule.exports.buildRequestUrl = buildRequestUrl;\n","const checkboxTemplates = {\n 'aoss.tower': '<div class=\"form-group\">'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"temp\">Temperature + Dewpoint'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"pres\">Pressure'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wS\">Wind Speed'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wD\">Wind Direction'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"aP\">Precipitation'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"sF\">Solar Flux'+\n '</label>'+\n '</div>',\n 'mendota.buoy': '<div class=\"form-group\">'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"temp\">Temperature + Dewpoint'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"rh\">Relative Humidity'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wS\">Wind Speed'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wD\">Wind Direction'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"chlor\">Chlorophyll'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"phyco\">Phycocyanin'+\n '</label>'+\n '</div>'\n};\n\nconst controlPanelTemplate = '<div class=\"row\" id=\"control-panel-row\">'+\n'<div id=\"show-hide-boxes\" class=\"col-md-12\">'+\n'</div>'+\n'<div class = \"col-md-9\">'+\n'<div class=\"row\" style=\"padding: 0 1em;\">'+\n'<div class=\"form-group\">'+\n'<table style=\"width:100%\">'+\n'<tr>'+\n'<td>'+\n'<div class=\"radio\">'+\n'<label><input type=\"radio\" id=\"last_x_days\" name=\"time_select\">'+\n'Recent Data:'+\n'</label>'+\n'</div>'+\n'</td>'+\n'<td>'+\n'<select class=\"form-control\" id=\"dropDownId\">'+\n'<option selected value=\"realtime\">Realtime Update</option>'+\n'<option value=\"-1:00:00\">Past 1 Hour</option>'+\n'<option value=\"-2:00:00\">Past 2 Hours</option>'+\n'<option value=\"-3:00:00\">Past 3 Hours</option>'+\n'<option value=\"-6:00:00\">Past 6 Hours</option>'+\n'<option value=\"-12:00:00\">Past 12 Hours</option>'+\n'<option value=\"-18:00:00\">Past 18 Hours</option>'+\n'<option value=\"-24:00:00\">Past 24 Hours</option>'+\n'<option value=\"-96:00:00\">Past 4 Days</option>'+\n'</select>'+\n'</td>'+\n'<td style=\"padding-left:.5em\">'+\n'<div class=\"radio\">'+\n'<label><input type=\"radio\" id=\"date_range\" name=\"time_select\">'+\n'Date Range:'+\n'</label>'+\n'</div>'+\n'</td>'+\n'<td>'+\n'<input class=\"form-control\" style=\"padding 0.5em 0;\" id=\"Start-date-picker\" type=\"text\" placeholder=\"YYYY-MM-DD\"/>'+\n'</td>'+\n'<td>to </td>'+\n'<td>'+\n'<input class=\"form-control\" style=\"padding 0.5em 0;\" id=\"End-date-picker\" type=\"text\" placeholder=\"YYYY-MM-DD\"/>'+\n'</td>'+\n'<td>'+\n'<button class=\"btn btn-primary btn-block\" id=\"plot-btn\">Plot</button>'+\n'</td>'+\n'</tr>'+\n'</table>'+\n'</div>'+\n'</div>'+\n'</div>'+\n'</div>'\n;\nmodule.exports = {\n controlPanelTemplate:controlPanelTemplate,\n checkboxTemplates:checkboxTemplates\n}\n","\"use strict\";\n\n//var $ = require('jquery');\n//var jQuery = require('jquery');\n\nvar loading = require('./loading.js');\nconst controlPanelTemplate = require('./button_template.js');\n\n/**\n* The purpose of this method is to tell dispatcher\n* Oh, please check if user's entering stuff correctly\n*\n* no params\n* no returns\n*/\n\nfunction dispatchCustom(dispatcher)\n{\n dispatcher.dispatch({\n status:'get_between_dates',\n 'emit':'plotEmitter',\n 'start':$('#Start-date-picker').val().split(' ').join('T')+':00',\n 'end':$('#End-date-picker').val().split(' ').join('T')+':00',\n 'interval':'auto',\n });\n}\n\n\n/**\n* The purpose of this method is to send dispatcher user information\n*\n* no params\n* no returns\n*/\n\nfunction getUserInfo(dispatcher)\n{\n //show gif\n loading.loading();\n\n //get the information from the text boxes\n var startDate = $('#Start-date-picker').val();\n var endDate = $('#End-date-picker').val();\n var startTime = $('#Start-time-picker').val();\n var endTime = $('#End-time-picker').val();\n var interval = $('#interval option:selected');\n var intervalVal = interval.data(\"name\");\n\n //store in user info\n var userInfo = {'startDate' : startDate,\n 'startTime' : startTime,\n 'endDate': endDate,\n 'endTime': endTime,\n 'interval': intervalVal};\n\n //send to dispatcher\n setTimeout(function() {dispatch.dispatch({status: 'plot_custom', 'emit': 'plotEmitter', 'userInfo': userInfo});}, 200); \n}\n\n\n/**\n* The purpose of this method is to tell dispatcher, time to check if we need to update\n*\n* no params\n* no returns\n*/\n\nfunction dispatchUpdate(dispatcher)\n{\n dispatcher.dispatch({'status': 'update', 'emit': 'plotEmitter'});\n}\n\n/**\n* The purpose of this method is to figure out what the user wants to do based upon\n* what the user selects on the task dropdown\n*\n* no params\n* no returns\n*/\n\nfunction dropDown(selectedText, dispatcher) {\n if (selectedText == 'realtime') {\n dispatcher.dispatch({\n status:'get_since_now',\n 'emit':'plotEmitter',\n 'time':'-3:00:00'\n });\n\n } else {\n var timeDelta = selectedText;\n dispatcher.dispatch({\n status:'get_since_now',\n 'emit':'plotEmitter',\n 'time':selectedText\n });\n }\n}\n\nvar bind_daterange_actions = function(jQ_div,dispatcher){\n //bind to custom buttons and dropdowns\n $(jQ_div+' #plot-btn').click(function(){dispatchCustom(dispatcher)});\n $(jQ_div+' #dropDownId').change(function(){dropDown($(this).val(),dispatcher)});\n}\nvar set_active_form = function(which_block,jQ_div){\n $(jQ_div+\" #dropDownId\").prop(\"disabled\",which_block!=\"recent\");\n\n $(jQ_div+\" #interval\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #Start-date-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #End-date-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #Start-time-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #End-time-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #plot-btn\").prop(\"disabled\",which_block!=\"range\");\n}\n\nvar set_form_datepickers = function(jQ_div){\n $(jQ_div+' #Start-date-picker').datetimepicker({\n changeMonth: true, \n changeYear: true,\n dateFormat:'yy-mm-dd',\n timeFormat:'HH:mm',\n showSecond:false,\n showMillisec:false,\n showMicrosec:false\n });\n\n $(jQ_div+' #End-date-picker').datetimepicker({\n changeMonth: true, \n changeYear: true,\n dateFormat:'yy-mm-dd',\n timeFormat:'HH:mm',\n showSecond:false,\n showMillisec:false,\n showMicrosec:false\n });\n\n //bind the enabling/disabling of forms to radio buttons\n $(jQ_div+' [type=text]').prop(\"disabled\",true);\n $(jQ_div+' select').prop(\"disabled\",true);\n $(jQ_div+\" #last_x_days\").click(function(){\n set_active_form(\"recent\",jQ_div);\n });\n $(jQ_div+\" #date_range\").click(function(){\n set_active_form(\"range\",jQ_div);\n });\n //$('#Start-time-picker').editableSelect();\n //$('#End-time-picker').editableSelect();\n //add placeholder values for the order forms \n //$('#Start-date-picker').attr('placeholder',moment.utc().subtract(5,'days').format('YYYY-MM-DD'));\n //$('#End-date-picker').attr('placeholder',moment.utc().format('YYYY-MM-DD'));\n //Firefox (+others maybe) keep buttons selected on page reload\n //enable the currrently selected one's field\n $(jQ_div+\" #last_x_days\").trigger('click');\n\n};\n\nvar setup_all_forms = function(div,plot_div,dispatcher){\n var jQ_div = '#'+div;\n set_form_datepickers(jQ_div,plot_div);\n bind_daterange_actions(jQ_div,dispatcher);\n}\n\nfunction buildFormInDiv(div, plot_div,dispatcher) {\n $('#'+div).append(controlPanelTemplate.controlPanelTemplate);\n //$('#'+div+ \" #show-hide-boxes\").append(controlPanelTemplate.checkboxTemplates[site]);\n setup_all_forms(div,plot_div,dispatcher);\n}\n$(document).ready(function(){\n //Hide all form errors initially\n //Set up the date range inputs as datepicker objects\n});\n\nmodule.exports = buildFormInDiv;\n","\"use strict\";\n//var $ = require('jquery');\n\n/**\n* The purpose of this function is to either hide the graph and show the loading\n* spinner or to hide the loading spinner and show the graph\n* no parameters or returns\n*/\n\nfunction loading()\n{\n return;\n //$(\"#progress\").toggle();\n //$(\"#graph\").toggle();\n}\n\n/**\n* The point of this method is to disable the custom area of the meteorogram\n* header\n*\n* no params\n* no returns\n*/\n\nfunction disable()\n{\n\t//disable custom rows\n\t$('#Start-date-picker').prop(\"disabled\", true);\n\t$('#Start-time-picker').prop(\"disabled\", true);\n\t$('#End-date-picker').prop(\"disabled\", true);\n\t$('#End-time-picker').prop(\"disabled\", true);\n\t$('#interval').prop(\"disabled\", true);\n\t$('#Plot').prop(\"disabled\", true);\n}\n\n/**\n* The purpose of this method is to enable the custom area of the meteorogram\n* header\n*\n* no params\n* no returns\n*/\n\nfunction enable()\n{\n\t//enable custom rows\n\t$('#Start-date-picker').prop(\"disabled\", false);\n\t$('#Start-time-picker').prop(\"disabled\", false);\n\t$('#End-date-picker').prop(\"disabled\", false);\n\t$('#End-time-picker').prop(\"disabled\", false);\n\t$('#interval').prop(\"disabled\", false);\n}\n\n/**\n* The purpose of this function is to take a date string and a time string and turn that\n* into a date JS object\n*\n* @param dateString - \"MM/DD/YYYY\"\n* @param timeString - \"HH-MM-SS\"\n* @return date object\n*/\n\nfunction getDate(dateString, timeString)\n{\n\t//get date string\n\tvar year = parseInt(dateString.substring(6,10));\n\tvar month = parseInt(dateString.substring(0,3));\n\tvar day = parseInt(dateString.substring(3,5));\n\tvar hour = parseInt(timeString.substring(0,2));\n\tvar minute = parseInt(timeString.substring(3,5));\n\tvar seconds = parseInt(timeString.substring(6,8));\n\n //return date variable\n var date = new Date(year, month, day, hour, minute, seconds);\n\n return date;\n}\n\n/**\n* The purpose of this method is to make sure each field is valid and does\n* not result in too much or too less data points being plotted\n* @param start date - the date the user wants to start at\n* @param time user wants to start at\n* @param end Date - the date user wants to stop at\n* @param end Time - the time the user wants to stop at\n* @param interval - how many seconds averaged does the user want\n* no returns\n*/\n\n/**\n* The purpsoe of this method is to enable the plot button\n*\n* no params\n* no returns\n*/\n\nfunction enablePlot()\n{\n\t//enable plot button\n\t$('#Plot').prop(\"disabled\", false);\n}\n\n/**\n* The purpose of this method is to disable the plot button\n*\n* no params\n* no returns\n*/\n\nfunction disablePlot()\n{\n\t//disable plot button\n\t$('#Plot').prop(\"disabled\", true);\n}\n\nfunction checkFields(startDate, endDate, startTime, endTime, interval)\n{\n\t//get user information from selected drop down\n\tvar selected = $('#interval option:selected');\n\n //give user time to fill out other fields\n\tif(selected.text() == '--');\n\n\telse\n\t{\n\t\t//get information to create a message to the user saying approx how many pts\n\t\t//they are plotting\n var start = getDate(startDate, startTime);\n var end = getDate(endDate, endTime);\n var selected = $('#interval option:selected');\n var diff = (end - start)/1000;\n var intervalVal = selected.data(\"seconds\");\n diff = Math.floor(diff/intervalVal);\n var points = diff/interval;\n\n //if too few points, tell user\n if(diff >= 0 && diff < 60)\n {\n \t$('#prompt_user').html('a ' + selected.text() + ' interval would plot about ' + diff.toString() \n \t\t + ' data points; that\\'s too few - please try again');\n\t\t\t$('#default').attr('selected', 'selected');\n\t\t\tdisablePlot();\n }\n\n //if the user accidentally mixed up start and end dates, politely tell them\n else if(diff < 0)\n {\n \t$('#prompt_user').html('The end date is before the start date. Please choose a later end date.');\n\t\t\t$('#default').attr('selected', 'selected');\n }\n\n //if too many points, tell user\n else if(diff > 1000)\n {\n \t$('#prompt_user').html('a ' + selected.text() + ' interval would plot about '\n \t\t+ diff.toString() + ' data points; that\\'s too many - please try again');\n\t\t\t$('#default').attr('selected', 'selected');\n\t\t\tdisablePlot();\n }\n\n //else we enable the plot button and tell user how many points they're plotting\n else\n {\n \t$('#prompt_user').html('a ' + selected.text() + ' interval would plot about '\n \t\t+ diff.toString() + ' data points.');\n\n\t\t\tenablePlot();\n }\n\n\t}\n}\n\n/**\n* The purpose of this method is to make sure all the fields and intervals selected are valid\n*\n* No parameters\n* No returns\n*/\n\nfunction checkInterval()\n{\n\tvar startDate = $('#Start-date-picker').val();\n\tvar endDate = $('#End-date-picker').val();\n\tvar startTime = $('#Start-time-picker').val();\n\tvar endTime = $('#End-time-picker').val();\n\tvar interval = $('#interval');\n\n\t//get user information from selected drop down\n\tvar selected = $('#interval option:selected');\n\n //check if any fields are not filled out\n\tif((!startDate || !endDate || !startTime || !endTime) && selected.text() != '--')\n\t{\n\t\t$('#prompt_user').html('Please fill out all other fields before filling out the interval field');\n\t\t$('#default').attr('selected', 'selected');\n\t}\n\n //check to see if fields are ok\n\tcheckFields(startDate, endDate, startTime, endTime, interval);\n}\n\nmodule.exports.loading = loading;\nmodule.exports.disable = disable;\nmodule.exports.enable = enable;\nmodule.exports.checkInterval = checkInterval;\n","module.exports = Plotly;"],"sourceRoot":""} \ No newline at end of file +{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./controller.js","webpack:///./dispatcher.js","webpack:///./node_modules/d/index.js","webpack:///./node_modules/es5-ext/function/noop.js","webpack:///./node_modules/es5-ext/object/assign/index.js","webpack:///./node_modules/es5-ext/object/assign/is-implemented.js","webpack:///./node_modules/es5-ext/object/assign/shim.js","webpack:///./node_modules/es5-ext/object/is-callable.js","webpack:///./node_modules/es5-ext/object/is-value.js","webpack:///./node_modules/es5-ext/object/keys/index.js","webpack:///./node_modules/es5-ext/object/keys/is-implemented.js","webpack:///./node_modules/es5-ext/object/keys/shim.js","webpack:///./node_modules/es5-ext/object/normalize-options.js","webpack:///./node_modules/es5-ext/object/valid-callable.js","webpack:///./node_modules/es5-ext/object/valid-value.js","webpack:///./node_modules/es5-ext/string/#/contains/index.js","webpack:///./node_modules/es5-ext/string/#/contains/is-implemented.js","webpack:///./node_modules/es5-ext/string/#/contains/shim.js","webpack:///./node_modules/event-emitter/index.js","webpack:///./node_modules/fbjs/lib/invariant.js","webpack:///./node_modules/flux/index.js","webpack:///./node_modules/flux/lib/Dispatcher.js","webpack:///./node_modules/underscore/underscore.js","webpack:///(webpack)/buildin/global.js","webpack:///(webpack)/buildin/module.js","webpack:///./plot/data.js","webpack:///./plot/init.js","webpack:///./plot/table.js","webpack:///./plot/ticks.js","webpack:///./plot/update.js","webpack:///./plot/utils.js","webpack:///./ui/button_template.js","webpack:///./ui/buttons.js","webpack:///./ui/loading.js","webpack:///external \"Plotly\""],"names":["buildFormInDiv","require","Dispatcher","_","API","div","controlDiv","plotsInfo","myDispatcher","getDispatcher","plotDiv","dataCache","initMeteorogram","plot_div","plotOrder","hasGraph","dispatch","initMeteorogramTable","table_div","hasTable","tableDiv","initMeteorogramControls","displayRealTime","showPlot","varName","status","hidePlot","displayRecent","start_time","displayTimeRange","stop_time","interval","window","MeteorogramController","ee","Flux","Plot","Table","dataAccess","loading","updatePlot","hue","GRAPH_HEIGHT","dispatchUpdate","startTime","dispatchChangeUnits","unitCount","changeBackgroundColor","skip_jump","acceleration","rate","Math","min","document","getElementById","style","backgroundColor","checkboxEmitter","visible","setPlots","plot_key","setShowing","plotName","undefined","showing","getShowing","handleActions","action","emit","location","dispatchToken","register","bind","plotEmitter","waitFor","defaultPlots","time","start","end","userInfo","stopUpdate","progress","validID","id","clearInterval","colorID","lobbyID","updateInterval","startUpdate","intervalID","setInterval","Number","getComputedStyle","getPropertyValue","on","initTable","requestTableUpdate","initPlot","requestPlotUpdate","changeUnits","checkInterval","module","exports","utils","processData","dataObj","dates","map","timestamps","date","allData","extend","data","plotting","url","var_names","update","maxPoints","err_callback","$","ajax","type","jsonp","dataType","success","code","console","error","format","message","graphDiv","existingDates","length","warn","startIndex","info","i","slice","intervalLookUp","intervalToSeconds","varNamesForDiv","varNames","each","trace_data","Array","prototype","push","apply","anc_variables","uniq","endTime","stream_string","dt_in_ms","time_parts","split","Date","hasOwnProperty","buildRequestUrl","Plotly","getSecondAxisConfig","axis_number","plot_info","axis_info","axis_kwargs","key","axis_config","gridcolor","titlefont","title","zeroline","overlaying","toString","side","anchor","idx","coreLobbyLayout","layout","plot_idx","topOfGraph","graphName","textSize","ticktext","tickfont","size","showline","linecolor","domain","floor","showgrid","font","showarrow","align","x","y","xref","yref","text","div_id","DEFAULT_PLOT_HEIGHT","nshowing","showlegend","height","Object","assign","showticklabels","tickformat","trace_info","trace_config","step","x_anchor","trace_kwargs","plots","yaxis","trace_info_idx","traces","name","xaxis","hoverinfo","hovermode","anc_data","plot_name","trace_index","isSecondAxis","colorbar","len","z","yaxis2","skip","toolbar","responsive","plot","table","tbody","children","add_contour_rows","info_td","addClass","row","short_name","append","add_anc_rows","anc_info_idx","anc_info","anc_idx","title_row","hightlight_idx","y_highlight","hightlight_idx_idx","units","hl_idx","data_cells","convert_cells","trace_idx","trace","indexOf","includes","join","updateTable","results","td_idx","num_results","html","update_contour_cells","update_val","convert","old_precision","precision","orig_val","getTickText","convert_value","convert_units","convert_val","innerHTML","update_anc_cells","zprobe","zprobe2","anc_key","String","args","arguments","replace","match","number","getWaterTempProbe","plotInfo","traceInfo","allProbeText","probeText","col","rowText","depth","j","toFixed","getF","getSpeedMPH","val","getSpeedKTS","getPresInHg","getAccumMillimeter","cardinalWDir","degrees","getVal","CONVERSION_FUNCTIONS","null","formatValue","val2","getDewpointProbe","relHum","rh_info","defaultProbeText","PROBE_TEXT_FUNCTIONS","dewpoint","water_temp","getProbeText","probe_text","values","tickText","getTickVals","max","bump","extra","range","removeOldPoints","removeCount","splice","updateHeader","layoutUpdates","curr_date","hour","toLocaleString","opacity","date_local","year","month","day","minute","second","utcMonth","getUTCMonth","utcDay","getUTCDate","utcMinutes","getUTCMinutes","utcSeconds","getUTCSeconds","date_utc","getUTCFullYear","getUTCHours","elevation","changeCamera","directions","newDirection","src","alt","METOBS_API_URL","currData","tick_dates","converted_tickvals","tickvals","round","relayout","fitGraphs","var_name","defaultTickVals","yMin","yMax","spread","bottom","top","tick0","replaceData","plotHandled","forceRedraw","tracesToExtend","extendData","newContourData","contourTracesToExtend","contourExtendData","traceIndex","index","extendTraces","keys","redraw","epoch","sep","order","streams","request_url","checkboxTemplates","controlPanelTemplate","dispatchCustom","dispatcher","getUserInfo","startDate","endDate","intervalVal","setTimeout","dropDown","selectedText","timeDelta","bind_daterange_actions","jQ_div","click","change","set_active_form","which_block","prop","set_form_datepickers","datetimepicker","changeMonth","changeYear","dateFormat","timeFormat","showSecond","showMillisec","showMicrosec","trigger","setup_all_forms","ready","disable","enable","getDate","dateString","timeString","parseInt","substring","seconds","enablePlot","disablePlot","checkFields","selected","diff","points","attr"],"mappings":";AAAA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;;AAGA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,kDAA0C,gCAAgC;AAC1E;AACA;;AAEA;AACA;AACA;AACA,gEAAwD,kBAAkB;AAC1E;AACA,yDAAiD,cAAc;AAC/D;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,iDAAyC,iCA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A;AACA;AACA;;;;;;;;;;;;;ACRa;;AAEb,cAAc,mBAAO,CAAC,6DAAY;;AAElC;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;;;;;;;;;;;;;ACnBa;;AAEb;AACA;AACA;AACA;;;;;;;;;;;;;ACLa;;AAEb,cAAc,mBAAO,CAAC,6DAAY;;AAElC;AACA;AACA;AACA;;;;;;;;;;;;;ACPa;;AAEb,iBAAiB,mBAAO,CAAC,oFAAkB;AAC3C;AACA,GAAG,mBAAO,CAAC,gEAAQ;;;;;;;;;;;;;ACJN;;AAEb;;AAEA;AACA;AACA;AACA;;;;;;;;;;;;;ACPa;;AAEb;;AAEA;AACA;AACA;;;;;;;;;;;;;ACNa;;AAEb,eAAe,mBAAO,CAAC,oCAAG;AAC1B,eAAe,mBAAO,CAAC,sFAA+B;;AAEtD;AACA;AACA;AACA;AACA,kBAAkB;;AAElB;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,EAAE;;AAEF;AACA;AACA;;AAEA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,aAAa,4BAA4B;AACzC;AACA;AACA;AACA;AACA;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA,aAAa,OAAO;;AAEpB;AACA,aAAa,2BAA2B;AACxC;AACA;AACA,EAAE;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,cAAc,OAAO;AACrB;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA,0BAA0B;;AAE1B;AACA;AACA;AACA;;;;;;;;;;;;;ACnIA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA,IAAI,IAAqC;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;AACrD,KAAK;AACL;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA,0BAA0B;AAC1B;AACA;AACA;;AAEA,2B;;;;;;;;;;;ACpDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,4BAA4B,mBAAO,CAAC,+DAAkB;;;;;;;;;;;;;ACTtD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEa;;AAEb;;AAEA,iDAAiD,0CAA0C,0DAA0D,EAAE;;AAEvJ,gBAAgB,mBAAO,CAAC,gEAAoB;;AAE5C;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB;AACzB;AACA;AACA,sBAAsB;AACtB;AACA;AACA,6BAA6B;AAC7B;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM;AACN;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,2BAA2B,KAAqC,qGAAqG,SAAgB;AACrL;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA,2BAA2B,KAAqC,qFAAqF,SAAgB;AACrK,oBAAoB,iBAAiB;AACrC;AACA;AACA,+BAA+B,KAAqC,gHAAgH,SAAgB;AACpM;AACA;AACA,6BAA6B,KAAqC,kGAAkG,SAAgB;AACpL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA,4BAA4B,KAAqC,8FAA8F,SAAgB;AAC/K;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA,CAAC;;AAED,4B;;;;;;;;;;;ACtOA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,MAAM,KAA6B;AACnC,QAAQ,KAA4B;AACpC;AACA;AACA;AACA,GAAG;AACH;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,gBAAgB;AAC5B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,oBAAoB;AACzC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sCAAsC,YAAY;AAClD;AACA;AACA,KAAK;AACL;AACA,uCAAuC,YAAY;AACnD;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,YAAY;AACtD;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,WAAW;AAClC;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;;AAEA;AACA;AACA;AACA,kDAAkD;AAClD,GAAG;;AAEH;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA,wCAAwC;AACxC,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA,8CAA8C,YAAY;AAC1D;AACA;AACA;AACA,iBAAiB,gBAAgB;AACjC;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;AACA;AACA;;AAEA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,6CAA6C,YAAY;AACzD;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,YAAY,8BAA8B;AAC1C;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,sDAAsD;AACtD;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;AACT;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;AACA;AACA;AACA;AACA,0CAA0C,0BAA0B;AACpE;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA,qBAAqB,cAAc;AACnC;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,qBAAqB,YAAY;AACjC;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL,GAAG;;AAEH;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,OAAO,eAAe;AACtB;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO;AACP;AACA;;AAEA;AACA,KAAK;;AAEL;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;;AAEA;AACA;;AAEA;AACA,qBAAqB,eAAe;AACpC;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,uBAAuB,gBAAgB;AACvC;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,yBAAyB,gBAAgB;AACzC;AACA;AACA;AACA,uBAAuB,OAAO;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA,yCAAyC,YAAY;AACrD;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,qDAAqD;AACrD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;;;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,6EAA6E;AAC7E;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,MAAM,KAAwB;AAC9B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,0BAA0B;AAC1B;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA,mBAAmB,OAAO;AAC1B;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA,eAAe;AACf,cAAc;AACd,cAAc;AACd,gBAAgB;AAChB,gBAAgB;AAChB,gBAAgB;AAChB;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,mBAAmB,YAAY;AAC/B;AACA;AACA;AACA,mBAAmB;AACnB;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,4BAA4B;;AAE5B;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA,OAAO;AACP;AACA,OAAO;AACP,qBAAqB;AACrB;;AAEA;AACA;AACA,KAAK;AACL,iBAAiB;;AAEjB;AACA,kDAAkD,EAAE,iBAAiB;;AAErE;AACA,wBAAwB,8BAA8B;AACtD,2BAA2B;;AAE3B;AACA;AACA;AACA,KAAK;AACL;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA,kDAAkD,iBAAiB;;AAEnE;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,KAAK;AACL;AACA;;AAEA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;;AAEH;AACA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAM,IAAyC;AAC/C,IAAI,iCAAqB,EAAE,mCAAE;AAC7B;AACA,KAAK;AAAA,oGAAC;AACN;AACA,CAAC;;;;;;;;;;;;;AC3pDD;;AAEA;AACA;AACA;AACA,CAAC;;AAED;AACA;AACA;AACA,CAAC;AACD;AACA;AACA;;AAEA;AACA;AACA,4CAA4C;;AAE5C;;;;;;;;;;;;ACnBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;AACA;AACA,GAAG;AACH;AACA;AACA;AACA;;;;;;;;;;;;;ACrBa;;AACb,IAAI+B,aAAavC,mBAAOA,CAAC,qCAAR,CAAjB;AACA,IAAIsG,QAAQtG,mBAAOA,CAAC,mCAAR,CAAZ;AACA,IA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L,GAAtB,EAAd;AACA,KAAIxQ,WAAWwF,EAAE,WAAF,CAAf;;AAEA;AACA,KAAIuT,WAAWvT,EAAE,2BAAF,CAAf;;AAEG;AACH,KAAG,CAAC,CAACkR,SAAD,IAAc,CAACC,OAAf,IAA0B,CAAC9V,SAA3B,IAAwC,CAAC0G,OAA1C,KAAsDwR,SAAS1O,IAAT,MAAmB,IAA5E,EACA;AACC7E,IAAE,cAAF,EAAkB8I,IAAlB,CAAuB,wEAAvB;AACA9I,IAAE,UAAF,EAAc0T,IAAd,CAAmB,UAAnB,EAA+B,UAA/B;AACA;;AAEE;AACHJ,aAAYpC,SAAZ,EAAuBC,OAAvB,EAAgC9V,SAAhC,EAA2C0G,OAA3C,EAAoDvH,QAApD;AACA;;AAEDsE,OAAOC,OAAP,CAAe/D,OAAf,GAAyBA,OAAzB;AACA8D,OAAOC,OAAP,CAAe6T,OAAf,GAAyBA,OAAzB;AACA9T,OAAOC,OAAP,CAAe8T,MAAf,GAAwBA,MAAxB;AACA/T,OAAOC,OAAP,CAAeF,aAAf,GAA+BA,aAA/B,C;;;;;;;;;;;AC5MA,wB","file":"meteorogram.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = \"./controller.js\");\n","var buildFormInDiv = require('./ui/buttons.js');\nvar Dispatcher = require('./dispatcher.js');\nvar _ = require('underscore');\n\nfunction API(div, controlDiv, plotsInfo) {\n var myDispatcher = Dispatcher.getDispatcher();\n return {\n plotDiv: div,\n controlDiv: controlDiv,\n // Our storage of the plotly data/traces being plotted right now\n dataCache: [],\n\n initMeteorogram: function(plot_div, plotOrder) {\n this.hasGraph = true;\n this.plotDiv = plot_div || this.plotDiv;\n //start with only the selected plots showing, reveal others only if their data is requested\n myDispatcher.dispatch({\n 'status': 'initPlot',\n 'emit': 'plotEmitter',\n 'location': this.plotDiv,\n 'dataCache': this.dataCache,\n 'plotsInfo': plotsInfo,\n 'plotOrder': plotOrder\n });\n },\n initMeteorogramTable: function(table_div,plotOrder) {\n this.hasTable = true;\n this.tableDiv = table_div || this.plotDiv;\n //start with only the selected plots showing, reveal others only if their data is requested\n myDispatcher.dispatch({\n 'status': 'initTable',\n 'emit': 'plotEmitter',\n 'location': this.tableDiv,\n 'plotsInfo': plotsInfo,\n 'plotOrder': plotOrder,\n });\n },\n\n initMeteorogramControls:function(plotOrder){\n buildFormInDiv(this.controlDiv, this.plotDiv,myDispatcher);\n },\n\n displayRealTime: function() {\n if (this.hasTable) {\n myDispatcher.dispatch({\n 'status':'update_table',\n 'emit':'plotEmitter',\n 'time':'-3:00:00',\n 'location':this.tableDiv\n });\n }\n if (this.hasGraph) {\n myDispatcher.dispatch({\n 'status':'get_since_now',\n 'emit':'plotEmitter',\n 'time':'-3:00:00',\n 'location':this.plotDiv\n });\n }\n },\n\n showPlot:function(varName){\n myDispatcher.dispatch({status: ('show' + varName), 'emit': 'checkboxEmitter','location':this.div});\n },\n\n hidePlot:function(varName){\n myDispatcher.dispatch({status: ('hide' + varName), 'emit': 'checkboxEmitter','location':this.div});\n },\n\n displayRecent: function(start_time) {\n // interval, if not provided, will be determined based on start time\n myDispatcher.dispatch({\n 'status': 'get_since_now',\n 'emit': 'plotEmitter',\n 'time': start_time,\n });\n },\n\n displayTimeRange: function(start_time, stop_time, interval) {\n myDispatcher.dispatch({\n 'status':'get_between_dates',\n 'emit':'plotEmitter',\n 'start':start_time,\n 'end':stop_time,\n 'interval':interval||'auto',\n });\n\n },\n }\n}\n\n//expose the API to other scripts\nwindow.MeteorogramController = API;\n","\"use strict\";\n\n//var $ = require('jquery');\nvar ee = require('event-emitter');\nvar Flux = require('flux');\nvar Plot = require('./plot/init.js');\nvar Table = require('./plot/table.js');\nvar dataAccess = require('./plot/data.js');\nvar loading = require('./ui/loading.js');\nvar updatePlot = require('./plot/update.js');\nvar hue;\n\nfunction getDispatcher() {\n var myDispatcher = new Flux.Dispatcher();\n //not sure where else to stick globals\n myDispatcher.GRAPH_HEIGHT = 170;\n /**\n * The purpose of this method is to dispatch an update message to plotStore\n *\n * no parameters\n * no returns\n */\n\n function dispatchUpdate(startTime) {\n return function() {\n //dispatch update message to plotStore\n myDispatcher.dispatch({'status': 'update', 'emit': 'plotEmitter', 'startTime': startTime});\n }\n }\n\n function dispatchChangeUnits(unitCount) {\n return function() {\n unitCount = (unitCount + 1) % 2\n //dispatch update message to plotStore\n myDispatcher.dispatch({'status': 'changeUnits', 'emit': 'plotEmitter', 'unitCount': unitCount});\n }\n }\n\n function changeBackgroundColor() {\n // Moves faster between Red, Green, and Blue. This is purely aesthetic to avoid \"ugly\" colors (I'm looking at\n // you brown-green).\n var skip_jump = 120;\n var acceleration = 2;\n var rate = .2;\n // Exactly rate times faster at skip_jump / 2, and normal speed at skip_jump.\n hue += (acceleration * Math.min(skip_jump - hue % skip_jump, hue % skip_jump) / (skip_jump / 2) + 1) * rate\n // Loops around the color circle.\n if (hue > 360) {\n hue = 0\n }\n // Make the brighter colors more grey to match the darker colors above them.\n document.getElementById('row1').style.backgroundColor = 'hsl(' + hue + ',' + 100 + '%,' + 15 + '%)';\n document.getElementById('row2').style.backgroundColor = 'hsl(' + hue + ',' + 75 + '%,' + 30 + '%)';\n document.getElementById('row3').style.backgroundColor = 'hsl(' + hue + ',' + 50 + '%,' + 45 + '%)';\n }\n\n //creates checkbox store\n var checkboxEmitter = ee({\n visible: {},\n setPlots: function (plotsInfo) {\n for (var plot_key in plotsInfo) {\n this.visible[plot_key] = true;\n }\n },\n setShowing: function(plotName, visible) {\n if (visible === undefined) {\n this.showing[plotName] = !this.showing[plotName];\n } else {\n this.showing[plotName] = visible;\n }\n },\n getShowing: function(plotName) {\n return this.showing[plotName];\n },\n handleActions: function(action) {\n //only handels if action is for checkbox emitter\n if(action.emit == 'checkboxEmitter')\n {\n this.emit(action.status, action.location);\n }\n }\n });\n\n //register store with dispatcher\n checkboxEmitter.dispatchToken = myDispatcher.register(checkboxEmitter.handleActions.bind(checkboxEmitter));\n\n //create plotStore\n // FIXME: Event emitter should be added to a class prototype, not the other way around\n // See https://github.com/medikoo/event-emitter#usage\n // The below works...but only because event-emitter allows it. Should probably stick with advertised features\n var plotEmitter = ee({\n handleActions: function(action) {\n if (action.emit == 'plotEmitter') {\n myDispatcher.waitFor([checkboxEmitter.dispatchToken]);\n\n if (action.location !== undefined) {\n this.div = action.location;\n }\n\n if (action.plotsInfo !== undefined) {\n this.plotsInfo = action.plotsInfo;\n this.plotOrder = this.plotsInfo.defaultPlots;\n }\n if (action.plotOrder !== undefined) {\n this.plotOrder = action.plotOrder;\n }\n\n if (action.dataCache !== undefined) {\n this.dataCache = action.dataCache;\n }\n\n if (action.status == 'get_since_now') {\n if (this.plotsInfo['isLobbyDisplay']) {\n action.time = '-6:00:00'\n }\n this.emit(\n action.status,\n action.time,\n this.plotsInfo,\n this.dataCache,\n this.div);\n }else if (action.status == 'update_table') {\n this.emit(\n action.status,\n action.time,\n this.plotsInfo,\n this.div);\n } else if (action.status == 'get_between_dates') {\n this.emit(\n action.status,\n action.start,\n action.end,\n action.interval,\n this.plotsInfo,\n this.dataCache,\n this.div);\n } else if (action.status == 'initPlot') {\n this.emit(\n action.status,\n action.location,\n action.plotOrder ? action.plotOrder : this.plotOrder,\n this.plotsInfo,\n this.dataCache);\n } else if (action.status == 'initTable') {\n this.emit(\n action.status,\n action.location,\n action.plotOrder ? action.plotOrder : this.plotOrder,\n this.plotsInfo);\n } else if (action.status == 'update') {\n this.emit(action.status, this.div, this.plotsInfo, this.dataCache, action.startTime);\n } else if (action.status == 'changeUnits') {\n this.emit(action.status, this.div, this.plotsInfo, this.dataCache, action.unitCount);\n } else {\n //adds parameter for user information in custom plot\n // console.debug(\"Emitting user information message: {action.status} : {action.userInfo}\");\n this.emit(action.status, action.userInfo);\n }\n }\n }\n });\n\n\n function stopUpdate(plotsInfo) {\n if(!plotsInfo.progress)\n plotsInfo.progress = {};\n if(plotsInfo.progress.validID){\n var id = plotsInfo.progress.id[0];\n clearInterval(id);\n if (plotsInfo['isLobbyDisplay']) {\n clearInterval(plotsInfo.progress.colorID);\n clearInterval(plotsInfo.progress.lobbyID);\n }\n plotsInfo.progress.validID = false;\n }\n }\n\n // update every N/2 milliseconds\n const updateInterval = {\n '1m': 30 * 1000,\n '5m': 2.5 * 60 * 1000,\n '1h': 30 * 60 * 1000,\n };\n\n\n function startUpdate(startTime, interval, plotsInfo) {\n // stop any previous updates\n if(!plotsInfo.progress)\n plotsInfo.progress = {};\n stopUpdate(plotsInfo);\n\n // resume update operations\n if (startTime === undefined) {\n startTime = plotsInfo.progress.id[1];\n }\n if (interval === undefined) {\n interval = plotsInfo.progress.id[2];\n }\n\n // every 30 seconds, rings update alarm\n var intervalID = setInterval(dispatchUpdate(startTime), updateInterval[interval]);\n if (plotsInfo['isLobbyDisplay']) {\n hue = Number(getComputedStyle(document.getElementById(\"color\")).getPropertyValue('--starting-hue'))\n plotsInfo.progress.colorID = setInterval(changeBackgroundColor, 1000)\n plotsInfo.progress.lobbyID = setInterval(dispatchChangeUnits(0), 5000);\n }\n // save alarm id\n plotsInfo.progress.id = [intervalID, startTime, interval];\n plotsInfo.progress.validID = true;\n }\n\n plotEmitter.on('initTable', function(div, plotOrder, plotsInfo) {\n //initialize checkbox store\n checkboxEmitter.setPlots(plotsInfo);\n Table.initTable(div, plotOrder, plotsInfo);\n });\n\n plotEmitter.on('update_table',function(time, plotsInfo, div){\n Table.requestTableUpdate(div, plotsInfo);\n setInterval(function(){Table.requestTableUpdate(div,plotsInfo)},updateInterval['1m']);\n });\n\n plotEmitter.on('initPlot', function(div, plotOrder, plotsInfo, dataCache) {\n //initialize checkbox store\n checkboxEmitter.setPlots(plotsInfo);\n Plot.initPlot(dataCache, div, plotOrder, plotsInfo);\n });\n\n plotEmitter.on(\"get_since_now\", function(time, plotsInfo, dataCache, div) {\n var interval = dataAccess.requestPlotUpdate(dataCache, div, plotsInfo, time,\n undefined, undefined, undefined, stopUpdate);\n startUpdate(time, interval, plotsInfo);\n });\n\n plotEmitter.on(\"get_between_dates\",function(start, end, interval, plotsInfo, dataCache, div) {\n stopUpdate(plotsInfo);\n dataAccess.requestPlotUpdate(dataCache, div, plotsInfo, start, end, interval);\n });\n\n //when store recieves signal, update component\n plotEmitter.on('update', function(div, plotsInfo, dataCache, startTime) {\n dataAccess.requestPlotUpdate(dataCache, div, plotsInfo, startTime, undefined, undefined, true);\n });\n\n plotEmitter.on('changeUnits', function(div, plotsInfo, dataCache, unitCount) {\n updatePlot.changeUnits(dataCache, document.getElementById(div), plotsInfo, unitCount)\n });\n\n plotEmitter.on(\"checking_custom\", function()\n {\n //before components were plots. Here, it's the user prompt paragraph\n loading.checkInterval();\n });\n\n //register plotStore with dispatcher\n plotEmitter.dispatchToken = myDispatcher.register(plotEmitter.handleActions.bind(plotEmitter));\n\n return myDispatcher;\n}\n\n//exports dispatchers and stores\nmodule.exports.getDispatcher = getDispatcher;\n","'use strict';\n\nvar assign = require('es5-ext/object/assign')\n , normalizeOpts = require('es5-ext/object/normalize-options')\n , isCallable = require('es5-ext/object/is-callable')\n , contains = require('es5-ext/string/#/contains')\n\n , d;\n\nd = module.exports = function (dscr, value/*, options*/) {\n\tvar c, e, w, options, desc;\n\tif ((arguments.length < 2) || (typeof dscr !== 'string')) {\n\t\toptions = value;\n\t\tvalue = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[2];\n\t}\n\tif (dscr == null) {\n\t\tc = w = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t\tw = contains.call(dscr, 'w');\n\t}\n\n\tdesc = { value: value, configurable: c, enumerable: e, writable: w };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n\nd.gs = function (dscr, get, set/*, options*/) {\n\tvar c, e, options, desc;\n\tif (typeof dscr !== 'string') {\n\t\toptions = set;\n\t\tset = get;\n\t\tget = dscr;\n\t\tdscr = null;\n\t} else {\n\t\toptions = arguments[3];\n\t}\n\tif (get == null) {\n\t\tget = undefined;\n\t} else if (!isCallable(get)) {\n\t\toptions = get;\n\t\tget = set = undefined;\n\t} else if (set == null) {\n\t\tset = undefined;\n\t} else if (!isCallable(set)) {\n\t\toptions = set;\n\t\tset = undefined;\n\t}\n\tif (dscr == null) {\n\t\tc = true;\n\t\te = false;\n\t} else {\n\t\tc = contains.call(dscr, 'c');\n\t\te = contains.call(dscr, 'e');\n\t}\n\n\tdesc = { get: get, set: set, configurable: c, enumerable: e };\n\treturn !options ? desc : assign(normalizeOpts(options), desc);\n};\n","\"use strict\";\n\n// eslint-disable-next-line no-empty-function\nmodule.exports = function () {};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? Object.assign\n\t: require(\"./shim\");\n","\"use strict\";\n\nmodule.exports = function () {\n\tvar assign = Object.assign, obj;\n\tif (typeof assign !== \"function\") return false;\n\tobj = { foo: \"raz\" };\n\tassign(obj, { bar: \"dwa\" }, { trzy: \"trzy\" });\n\treturn (obj.foo + obj.bar + obj.trzy) === \"razdwatrzy\";\n};\n","\"use strict\";\n\nvar keys = require(\"../keys\")\n , value = require(\"../valid-value\")\n , max = Math.max;\n\nmodule.exports = function (dest, src /*, …srcn*/) {\n\tvar error, i, length = max(arguments.length, 2), assign;\n\tdest = Object(value(dest));\n\tassign = function (key) {\n\t\ttry {\n\t\t\tdest[key] = src[key];\n\t\t} catch (e) {\n\t\t\tif (!error) error = e;\n\t\t}\n\t};\n\tfor (i = 1; i < length; ++i) {\n\t\tsrc = arguments[i];\n\t\tkeys(src).forEach(assign);\n\t}\n\tif (error !== undefined) throw error;\n\treturn dest;\n};\n","// Deprecated\n\n\"use strict\";\n\nmodule.exports = function (obj) {\n return typeof obj === \"function\";\n};\n","\"use strict\";\n\nvar _undefined = require(\"../function/noop\")(); // Support ES3 engines\n\nmodule.exports = function (val) {\n return (val !== _undefined) && (val !== null);\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? Object.keys\n\t: require(\"./shim\");\n","\"use strict\";\n\nmodule.exports = function () {\n\ttry {\n\t\tObject.keys(\"primitive\");\n\t\treturn true;\n\t} catch (e) {\n return false;\n}\n};\n","\"use strict\";\n\nvar isValue = require(\"../is-value\");\n\nvar keys = Object.keys;\n\nmodule.exports = function (object) {\n\treturn keys(isValue(object) ? Object(object) : object);\n};\n","\"use strict\";\n\nvar isValue = require(\"./is-value\");\n\nvar forEach = Array.prototype.forEach, create = Object.create;\n\nvar process = function (src, obj) {\n\tvar key;\n\tfor (key in src) obj[key] = src[key];\n};\n\n// eslint-disable-next-line no-unused-vars\nmodule.exports = function (opts1 /*, …options*/) {\n\tvar result = create(null);\n\tforEach.call(arguments, function (options) {\n\t\tif (!isValue(options)) return;\n\t\tprocess(Object(options), result);\n\t});\n\treturn result;\n};\n","\"use strict\";\n\nmodule.exports = function (fn) {\n\tif (typeof fn !== \"function\") throw new TypeError(fn + \" is not a function\");\n\treturn fn;\n};\n","\"use strict\";\n\nvar isValue = require(\"./is-value\");\n\nmodule.exports = function (value) {\n\tif (!isValue(value)) throw new TypeError(\"Cannot use null or undefined\");\n\treturn value;\n};\n","\"use strict\";\n\nmodule.exports = require(\"./is-implemented\")()\n\t? String.prototype.contains\n\t: require(\"./shim\");\n","\"use strict\";\n\nvar str = \"razdwatrzy\";\n\nmodule.exports = function () {\n\tif (typeof str.contains !== \"function\") return false;\n\treturn (str.contains(\"dwa\") === true) && (str.contains(\"foo\") === false);\n};\n","\"use strict\";\n\nvar indexOf = String.prototype.indexOf;\n\nmodule.exports = function (searchString/*, position*/) {\n\treturn indexOf.call(this, searchString, arguments[1]) > -1;\n};\n","'use strict';\n\nvar d = require('d')\n , callable = require('es5-ext/object/valid-callable')\n\n , apply = Function.prototype.apply, call = Function.prototype.call\n , create = Object.create, defineProperty = Object.defineProperty\n , defineProperties = Object.defineProperties\n , hasOwnProperty = Object.prototype.hasOwnProperty\n , descriptor = { configurable: true, enumerable: false, writable: true }\n\n , on, once, off, emit, methods, descriptors, base;\n\non = function (type, listener) {\n\tvar data;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) {\n\t\tdata = descriptor.value = create(null);\n\t\tdefineProperty(this, '__ee__', descriptor);\n\t\tdescriptor.value = null;\n\t} else {\n\t\tdata = this.__ee__;\n\t}\n\tif (!data[type]) data[type] = listener;\n\telse if (typeof data[type] === 'object') data[type].push(listener);\n\telse data[type] = [data[type], listener];\n\n\treturn this;\n};\n\nonce = function (type, listener) {\n\tvar once, self;\n\n\tcallable(listener);\n\tself = this;\n\ton.call(this, type, once = function () {\n\t\toff.call(self, type, once);\n\t\tapply.call(listener, this, arguments);\n\t});\n\n\tonce.__eeOnceListener__ = listener;\n\treturn this;\n};\n\noff = function (type, listener) {\n\tvar data, listeners, candidate, i;\n\n\tcallable(listener);\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return this;\n\tdata = this.__ee__;\n\tif (!data[type]) return this;\n\tlisteners = data[type];\n\n\tif (typeof listeners === 'object') {\n\t\tfor (i = 0; (candidate = listeners[i]); ++i) {\n\t\t\tif ((candidate === listener) ||\n\t\t\t\t\t(candidate.__eeOnceListener__ === listener)) {\n\t\t\t\tif (listeners.length === 2) data[type] = listeners[i ? 0 : 1];\n\t\t\t\telse listeners.splice(i, 1);\n\t\t\t}\n\t\t}\n\t} else {\n\t\tif ((listeners === listener) ||\n\t\t\t\t(listeners.__eeOnceListener__ === listener)) {\n\t\t\tdelete data[type];\n\t\t}\n\t}\n\n\treturn this;\n};\n\nemit = function (type) {\n\tvar i, l, listener, listeners, args;\n\n\tif (!hasOwnProperty.call(this, '__ee__')) return;\n\tlisteners = this.__ee__[type];\n\tif (!listeners) return;\n\n\tif (typeof listeners === 'object') {\n\t\tl = arguments.length;\n\t\targs = new Array(l - 1);\n\t\tfor (i = 1; i < l; ++i) args[i - 1] = arguments[i];\n\n\t\tlisteners = listeners.slice();\n\t\tfor (i = 0; (listener = listeners[i]); ++i) {\n\t\t\tapply.call(listener, this, args);\n\t\t}\n\t} else {\n\t\tswitch (arguments.length) {\n\t\tcase 1:\n\t\t\tcall.call(listeners, this);\n\t\t\tbreak;\n\t\tcase 2:\n\t\t\tcall.call(listeners, this, arguments[1]);\n\t\t\tbreak;\n\t\tcase 3:\n\t\t\tcall.call(listeners, this, arguments[1], arguments[2]);\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tl = arguments.length;\n\t\t\targs = new Array(l - 1);\n\t\t\tfor (i = 1; i < l; ++i) {\n\t\t\t\targs[i - 1] = arguments[i];\n\t\t\t}\n\t\t\tapply.call(listeners, this, args);\n\t\t}\n\t}\n};\n\nmethods = {\n\ton: on,\n\tonce: once,\n\toff: off,\n\temit: emit\n};\n\ndescriptors = {\n\ton: d(on),\n\tonce: d(once),\n\toff: d(off),\n\temit: d(emit)\n};\n\nbase = defineProperties({}, descriptors);\n\nmodule.exports = exports = function (o) {\n\treturn (o == null) ? create(base) : defineProperties(Object(o), descriptors);\n};\nexports.methods = methods;\n","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n */\n\n'use strict';\n\n/**\n * Use invariant() to assert state which your program assumes to be true.\n *\n * Provide sprintf-style format (only %s is supported) and arguments\n * to provide information about what broke and what you were\n * expecting.\n *\n * The invariant message will be stripped in production, but the invariant\n * will remain to ensure logic does not differ in production.\n */\n\nvar validateFormat = function validateFormat(format) {};\n\nif (process.env.NODE_ENV !== 'production') {\n validateFormat = function validateFormat(format) {\n if (format === undefined) {\n throw new Error('invariant requires an error message argument');\n }\n };\n}\n\nfunction invariant(condition, format, a, b, c, d, e, f) {\n validateFormat(format);\n\n if (!condition) {\n var error;\n if (format === undefined) {\n error = new Error('Minified exception occurred; use the non-minified dev environment ' + 'for the full error message and additional helpful warnings.');\n } else {\n var args = [a, b, c, d, e, f];\n var argIndex = 0;\n error = new Error(format.replace(/%s/g, function () {\n return args[argIndex++];\n }));\n error.name = 'Invariant Violation';\n }\n\n error.framesToPop = 1; // we don't care about invariant's own frame\n throw error;\n }\n}\n\nmodule.exports = invariant;","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n */\n\nmodule.exports.Dispatcher = require('./lib/Dispatcher');\n","/**\n * Copyright (c) 2014-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Dispatcher\n * \n * @preventMunge\n */\n\n'use strict';\n\nexports.__esModule = true;\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError('Cannot call a class as a function'); } }\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar _prefix = 'ID_';\n\n/**\n * Dispatcher is used to broadcast payloads to registered callbacks. This is\n * different from generic pub-sub systems in two ways:\n *\n * 1) Callbacks are not subscribed to particular events. Every payload is\n * dispatched to every registered callback.\n * 2) Callbacks can be deferred in whole or part until other callbacks have\n * been executed.\n *\n * For example, consider this hypothetical flight destination form, which\n * selects a default city when a country is selected:\n *\n * var flightDispatcher = new Dispatcher();\n *\n * // Keeps track of which country is selected\n * var CountryStore = {country: null};\n *\n * // Keeps track of which city is selected\n * var CityStore = {city: null};\n *\n * // Keeps track of the base flight price of the selected city\n * var FlightPriceStore = {price: null}\n *\n * When a user changes the selected city, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'city-update',\n * selectedCity: 'paris'\n * });\n *\n * This payload is digested by `CityStore`:\n *\n * flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'city-update') {\n * CityStore.city = payload.selectedCity;\n * }\n * });\n *\n * When the user selects a country, we dispatch the payload:\n *\n * flightDispatcher.dispatch({\n * actionType: 'country-update',\n * selectedCountry: 'australia'\n * });\n *\n * This payload is digested by both stores:\n *\n * CountryStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * CountryStore.country = payload.selectedCountry;\n * }\n * });\n *\n * When the callback to update `CountryStore` is registered, we save a reference\n * to the returned token. Using this token with `waitFor()`, we can guarantee\n * that `CountryStore` is updated before the callback that updates `CityStore`\n * needs to query its data.\n *\n * CityStore.dispatchToken = flightDispatcher.register(function(payload) {\n * if (payload.actionType === 'country-update') {\n * // `CountryStore.country` may not be updated.\n * flightDispatcher.waitFor([CountryStore.dispatchToken]);\n * // `CountryStore.country` is now guaranteed to be updated.\n *\n * // Select the default city for the new country\n * CityStore.city = getDefaultCityForCountry(CountryStore.country);\n * }\n * });\n *\n * The usage of `waitFor()` can be chained, for example:\n *\n * FlightPriceStore.dispatchToken =\n * flightDispatcher.register(function(payload) {\n * switch (payload.actionType) {\n * case 'country-update':\n * case 'city-update':\n * flightDispatcher.waitFor([CityStore.dispatchToken]);\n * FlightPriceStore.price =\n * getFlightPriceStore(CountryStore.country, CityStore.city);\n * break;\n * }\n * });\n *\n * The `country-update` payload will be guaranteed to invoke the stores'\n * registered callbacks in order: `CountryStore`, `CityStore`, then\n * `FlightPriceStore`.\n */\n\nvar Dispatcher = (function () {\n function Dispatcher() {\n _classCallCheck(this, Dispatcher);\n\n this._callbacks = {};\n this._isDispatching = false;\n this._isHandled = {};\n this._isPending = {};\n this._lastID = 1;\n }\n\n /**\n * Registers a callback to be invoked with every dispatched payload. Returns\n * a token that can be used with `waitFor()`.\n */\n\n Dispatcher.prototype.register = function register(callback) {\n var id = _prefix + this._lastID++;\n this._callbacks[id] = callback;\n return id;\n };\n\n /**\n * Removes a callback based on its token.\n */\n\n Dispatcher.prototype.unregister = function unregister(id) {\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.unregister(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n delete this._callbacks[id];\n };\n\n /**\n * Waits for the callbacks specified to be invoked before continuing execution\n * of the current callback. This method should only be used by a callback in\n * response to a dispatched payload.\n */\n\n Dispatcher.prototype.waitFor = function waitFor(ids) {\n !this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Must be invoked while dispatching.') : invariant(false) : undefined;\n for (var ii = 0; ii < ids.length; ii++) {\n var id = ids[ii];\n if (this._isPending[id]) {\n !this._isHandled[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): Circular dependency detected while ' + 'waiting for `%s`.', id) : invariant(false) : undefined;\n continue;\n }\n !this._callbacks[id] ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatcher.waitFor(...): `%s` does not map to a registered callback.', id) : invariant(false) : undefined;\n this._invokeCallback(id);\n }\n };\n\n /**\n * Dispatches a payload to all registered callbacks.\n */\n\n Dispatcher.prototype.dispatch = function dispatch(payload) {\n !!this._isDispatching ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Dispatch.dispatch(...): Cannot dispatch in the middle of a dispatch.') : invariant(false) : undefined;\n this._startDispatching(payload);\n try {\n for (var id in this._callbacks) {\n if (this._isPending[id]) {\n continue;\n }\n this._invokeCallback(id);\n }\n } finally {\n this._stopDispatching();\n }\n };\n\n /**\n * Is this Dispatcher currently dispatching.\n */\n\n Dispatcher.prototype.isDispatching = function isDispatching() {\n return this._isDispatching;\n };\n\n /**\n * Call the callback stored with the given id. Also do some internal\n * bookkeeping.\n *\n * @internal\n */\n\n Dispatcher.prototype._invokeCallback = function _invokeCallback(id) {\n this._isPending[id] = true;\n this._callbacks[id](this._pendingPayload);\n this._isHandled[id] = true;\n };\n\n /**\n * Set up bookkeeping needed when dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._startDispatching = function _startDispatching(payload) {\n for (var id in this._callbacks) {\n this._isPending[id] = false;\n this._isHandled[id] = false;\n }\n this._pendingPayload = payload;\n this._isDispatching = true;\n };\n\n /**\n * Clear bookkeeping used for dispatching.\n *\n * @internal\n */\n\n Dispatcher.prototype._stopDispatching = function _stopDispatching() {\n delete this._pendingPayload;\n this._isDispatching = false;\n };\n\n return Dispatcher;\n})();\n\nmodule.exports = Dispatcher;","// Underscore.js 1.9.1\n// http://underscorejs.org\n// (c) 2009-2018 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n// Underscore may be freely distributed under the MIT license.\n\n(function() {\n\n // Baseline setup\n // --------------\n\n // Establish the root object, `window` (`self`) in the browser, `global`\n // on the server, or `this` in some virtual machines. We use `self`\n // instead of `window` for `WebWorker` support.\n var root = typeof self == 'object' && self.self === self && self ||\n typeof global == 'object' && global.global === global && global ||\n this ||\n {};\n\n // Save the previous value of the `_` variable.\n var previousUnderscore = root._;\n\n // Save bytes in the minified (but not gzipped) version:\n var ArrayProto = Array.prototype, ObjProto = Object.prototype;\n var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;\n\n // Create quick reference variables for speed access to core prototypes.\n var push = ArrayProto.push,\n slice = ArrayProto.slice,\n toString = ObjProto.toString,\n hasOwnProperty = ObjProto.hasOwnProperty;\n\n // All **ECMAScript 5** native function implementations that we hope to use\n // are declared here.\n var nativeIsArray = Array.isArray,\n nativeKeys = Object.keys,\n nativeCreate = Object.create;\n\n // Naked function reference for surrogate-prototype-swapping.\n var Ctor = function(){};\n\n // Create a safe reference to the Underscore object for use below.\n var _ = function(obj) {\n if (obj instanceof _) return obj;\n if (!(this instanceof _)) return new _(obj);\n this._wrapped = obj;\n };\n\n // Export the Underscore object for **Node.js**, with\n // backwards-compatibility for their old module API. If we're in\n // the browser, add `_` as a global object.\n // (`nodeType` is checked to ensure that `module`\n // and `exports` are not HTML elements.)\n if (typeof exports != 'undefined' && !exports.nodeType) {\n if (typeof module != 'undefined' && !module.nodeType && module.exports) {\n exports = module.exports = _;\n }\n exports._ = _;\n } else {\n root._ = _;\n }\n\n // Current version.\n _.VERSION = '1.9.1';\n\n // Internal function that returns an efficient (for current engines) version\n // of the passed-in callback, to be repeatedly applied in other Underscore\n // functions.\n var optimizeCb = function(func, context, argCount) {\n if (context === void 0) return func;\n switch (argCount == null ? 3 : argCount) {\n case 1: return function(value) {\n return func.call(context, value);\n };\n // The 2-argument case is omitted because we’re not using it.\n case 3: return function(value, index, collection) {\n return func.call(context, value, index, collection);\n };\n case 4: return function(accumulator, value, index, collection) {\n return func.call(context, accumulator, value, index, collection);\n };\n }\n return function() {\n return func.apply(context, arguments);\n };\n };\n\n var builtinIteratee;\n\n // An internal function to generate callbacks that can be applied to each\n // element in a collection, returning the desired result — either `identity`,\n // an arbitrary callback, a property matcher, or a property accessor.\n var cb = function(value, context, argCount) {\n if (_.iteratee !== builtinIteratee) return _.iteratee(value, context);\n if (value == null) return _.identity;\n if (_.isFunction(value)) return optimizeCb(value, context, argCount);\n if (_.isObject(value) && !_.isArray(value)) return _.matcher(value);\n return _.property(value);\n };\n\n // External wrapper for our callback generator. Users may customize\n // `_.iteratee` if they want additional predicate/iteratee shorthand styles.\n // This abstraction hides the internal-only argCount argument.\n _.iteratee = builtinIteratee = function(value, context) {\n return cb(value, context, Infinity);\n };\n\n // Some functions take a variable number of arguments, or a few expected\n // arguments at the beginning and then a variable number of values to operate\n // on. This helper accumulates all remaining arguments past the function’s\n // argument length (or an explicit `startIndex`), into an array that becomes\n // the last argument. Similar to ES6’s \"rest parameter\".\n var restArguments = function(func, startIndex) {\n startIndex = startIndex == null ? func.length - 1 : +startIndex;\n return function() {\n var length = Math.max(arguments.length - startIndex, 0),\n rest = Array(length),\n index = 0;\n for (; index < length; index++) {\n rest[index] = arguments[index + startIndex];\n }\n switch (startIndex) {\n case 0: return func.call(this, rest);\n case 1: return func.call(this, arguments[0], rest);\n case 2: return func.call(this, arguments[0], arguments[1], rest);\n }\n var args = Array(startIndex + 1);\n for (index = 0; index < startIndex; index++) {\n args[index] = arguments[index];\n }\n args[startIndex] = rest;\n return func.apply(this, args);\n };\n };\n\n // An internal function for creating a new object that inherits from another.\n var baseCreate = function(prototype) {\n if (!_.isObject(prototype)) return {};\n if (nativeCreate) return nativeCreate(prototype);\n Ctor.prototype = prototype;\n var result = new Ctor;\n Ctor.prototype = null;\n return result;\n };\n\n var shallowProperty = function(key) {\n return function(obj) {\n return obj == null ? void 0 : obj[key];\n };\n };\n\n var has = function(obj, path) {\n return obj != null && hasOwnProperty.call(obj, path);\n }\n\n var deepGet = function(obj, path) {\n var length = path.length;\n for (var i = 0; i < length; i++) {\n if (obj == null) return void 0;\n obj = obj[path[i]];\n }\n return length ? obj : void 0;\n };\n\n // Helper for collection methods to determine whether a collection\n // should be iterated as an array or as an object.\n // Related: http://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength\n // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094\n var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;\n var getLength = shallowProperty('length');\n var isArrayLike = function(collection) {\n var length = getLength(collection);\n return typeof length == 'number' && length >= 0 && length <= MAX_ARRAY_INDEX;\n };\n\n // Collection Functions\n // --------------------\n\n // The cornerstone, an `each` implementation, aka `forEach`.\n // Handles raw objects in addition to array-likes. Treats all\n // sparse array-likes as if they were dense.\n _.each = _.forEach = function(obj, iteratee, context) {\n iteratee = optimizeCb(iteratee, context);\n var i, length;\n if (isArrayLike(obj)) {\n for (i = 0, length = obj.length; i < length; i++) {\n iteratee(obj[i], i, obj);\n }\n } else {\n var keys = _.keys(obj);\n for (i = 0, length = keys.length; i < length; i++) {\n iteratee(obj[keys[i]], keys[i], obj);\n }\n }\n return obj;\n };\n\n // Return the results of applying the iteratee to each element.\n _.map = _.collect = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n results = Array(length);\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n results[index] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n };\n\n // Create a reducing function iterating left or right.\n var createReduce = function(dir) {\n // Wrap code that reassigns argument variables in a separate function than\n // the one that accesses `arguments.length` to avoid a perf hit. (#1991)\n var reducer = function(obj, iteratee, memo, initial) {\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length,\n index = dir > 0 ? 0 : length - 1;\n if (!initial) {\n memo = obj[keys ? keys[index] : index];\n index += dir;\n }\n for (; index >= 0 && index < length; index += dir) {\n var currentKey = keys ? keys[index] : index;\n memo = iteratee(memo, obj[currentKey], currentKey, obj);\n }\n return memo;\n };\n\n return function(obj, iteratee, memo, context) {\n var initial = arguments.length >= 3;\n return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);\n };\n };\n\n // **Reduce** builds up a single result from a list of values, aka `inject`,\n // or `foldl`.\n _.reduce = _.foldl = _.inject = createReduce(1);\n\n // The right-associative version of reduce, also known as `foldr`.\n _.reduceRight = _.foldr = createReduce(-1);\n\n // Return the first value which passes a truth test. Aliased as `detect`.\n _.find = _.detect = function(obj, predicate, context) {\n var keyFinder = isArrayLike(obj) ? _.findIndex : _.findKey;\n var key = keyFinder(obj, predicate, context);\n if (key !== void 0 && key !== -1) return obj[key];\n };\n\n // Return all the elements that pass a truth test.\n // Aliased as `select`.\n _.filter = _.select = function(obj, predicate, context) {\n var results = [];\n predicate = cb(predicate, context);\n _.each(obj, function(value, index, list) {\n if (predicate(value, index, list)) results.push(value);\n });\n return results;\n };\n\n // Return all the elements for which a truth test fails.\n _.reject = function(obj, predicate, context) {\n return _.filter(obj, _.negate(cb(predicate)), context);\n };\n\n // Determine whether all of the elements match a truth test.\n // Aliased as `all`.\n _.every = _.all = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n if (!predicate(obj[currentKey], currentKey, obj)) return false;\n }\n return true;\n };\n\n // Determine if at least one element in the object matches a truth test.\n // Aliased as `any`.\n _.some = _.any = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = !isArrayLike(obj) && _.keys(obj),\n length = (keys || obj).length;\n for (var index = 0; index < length; index++) {\n var currentKey = keys ? keys[index] : index;\n if (predicate(obj[currentKey], currentKey, obj)) return true;\n }\n return false;\n };\n\n // Determine if the array or object contains a given item (using `===`).\n // Aliased as `includes` and `include`.\n _.contains = _.includes = _.include = function(obj, item, fromIndex, guard) {\n if (!isArrayLike(obj)) obj = _.values(obj);\n if (typeof fromIndex != 'number' || guard) fromIndex = 0;\n return _.indexOf(obj, item, fromIndex) >= 0;\n };\n\n // Invoke a method (with arguments) on every item in a collection.\n _.invoke = restArguments(function(obj, path, args) {\n var contextPath, func;\n if (_.isFunction(path)) {\n func = path;\n } else if (_.isArray(path)) {\n contextPath = path.slice(0, -1);\n path = path[path.length - 1];\n }\n return _.map(obj, function(context) {\n var method = func;\n if (!method) {\n if (contextPath && contextPath.length) {\n context = deepGet(context, contextPath);\n }\n if (context == null) return void 0;\n method = context[path];\n }\n return method == null ? method : method.apply(context, args);\n });\n });\n\n // Convenience version of a common use case of `map`: fetching a property.\n _.pluck = function(obj, key) {\n return _.map(obj, _.property(key));\n };\n\n // Convenience version of a common use case of `filter`: selecting only objects\n // containing specific `key:value` pairs.\n _.where = function(obj, attrs) {\n return _.filter(obj, _.matcher(attrs));\n };\n\n // Convenience version of a common use case of `find`: getting the first object\n // containing specific `key:value` pairs.\n _.findWhere = function(obj, attrs) {\n return _.find(obj, _.matcher(attrs));\n };\n\n // Return the maximum element (or element-based computation).\n _.max = function(obj, iteratee, context) {\n var result = -Infinity, lastComputed = -Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : _.values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value > result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n _.each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed > lastComputed || computed === -Infinity && result === -Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n };\n\n // Return the minimum element (or element-based computation).\n _.min = function(obj, iteratee, context) {\n var result = Infinity, lastComputed = Infinity,\n value, computed;\n if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {\n obj = isArrayLike(obj) ? obj : _.values(obj);\n for (var i = 0, length = obj.length; i < length; i++) {\n value = obj[i];\n if (value != null && value < result) {\n result = value;\n }\n }\n } else {\n iteratee = cb(iteratee, context);\n _.each(obj, function(v, index, list) {\n computed = iteratee(v, index, list);\n if (computed < lastComputed || computed === Infinity && result === Infinity) {\n result = v;\n lastComputed = computed;\n }\n });\n }\n return result;\n };\n\n // Shuffle a collection.\n _.shuffle = function(obj) {\n return _.sample(obj, Infinity);\n };\n\n // Sample **n** random values from a collection using the modern version of the\n // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle).\n // If **n** is not specified, returns a single random element.\n // The internal `guard` argument allows it to work with `map`.\n _.sample = function(obj, n, guard) {\n if (n == null || guard) {\n if (!isArrayLike(obj)) obj = _.values(obj);\n return obj[_.random(obj.length - 1)];\n }\n var sample = isArrayLike(obj) ? _.clone(obj) : _.values(obj);\n var length = getLength(sample);\n n = Math.max(Math.min(n, length), 0);\n var last = length - 1;\n for (var index = 0; index < n; index++) {\n var rand = _.random(index, last);\n var temp = sample[index];\n sample[index] = sample[rand];\n sample[rand] = temp;\n }\n return sample.slice(0, n);\n };\n\n // Sort the object's values by a criterion produced by an iteratee.\n _.sortBy = function(obj, iteratee, context) {\n var index = 0;\n iteratee = cb(iteratee, context);\n return _.pluck(_.map(obj, function(value, key, list) {\n return {\n value: value,\n index: index++,\n criteria: iteratee(value, key, list)\n };\n }).sort(function(left, right) {\n var a = left.criteria;\n var b = right.criteria;\n if (a !== b) {\n if (a > b || a === void 0) return 1;\n if (a < b || b === void 0) return -1;\n }\n return left.index - right.index;\n }), 'value');\n };\n\n // An internal function used for aggregate \"group by\" operations.\n var group = function(behavior, partition) {\n return function(obj, iteratee, context) {\n var result = partition ? [[], []] : {};\n iteratee = cb(iteratee, context);\n _.each(obj, function(value, index) {\n var key = iteratee(value, index, obj);\n behavior(result, value, key);\n });\n return result;\n };\n };\n\n // Groups the object's values by a criterion. Pass either a string attribute\n // to group by, or a function that returns the criterion.\n _.groupBy = group(function(result, value, key) {\n if (has(result, key)) result[key].push(value); else result[key] = [value];\n });\n\n // Indexes the object's values by a criterion, similar to `groupBy`, but for\n // when you know that your index values will be unique.\n _.indexBy = group(function(result, value, key) {\n result[key] = value;\n });\n\n // Counts instances of an object that group by a certain criterion. Pass\n // either a string attribute to count by, or a function that returns the\n // criterion.\n _.countBy = group(function(result, value, key) {\n if (has(result, key)) result[key]++; else result[key] = 1;\n });\n\n var reStrSymbol = /[^\\ud800-\\udfff]|[\\ud800-\\udbff][\\udc00-\\udfff]|[\\ud800-\\udfff]/g;\n // Safely create a real, live array from anything iterable.\n _.toArray = function(obj) {\n if (!obj) return [];\n if (_.isArray(obj)) return slice.call(obj);\n if (_.isString(obj)) {\n // Keep surrogate pair characters together\n return obj.match(reStrSymbol);\n }\n if (isArrayLike(obj)) return _.map(obj, _.identity);\n return _.values(obj);\n };\n\n // Return the number of elements in an object.\n _.size = function(obj) {\n if (obj == null) return 0;\n return isArrayLike(obj) ? obj.length : _.keys(obj).length;\n };\n\n // Split a collection into two arrays: one whose elements all satisfy the given\n // predicate, and one whose elements all do not satisfy the predicate.\n _.partition = group(function(result, value, pass) {\n result[pass ? 0 : 1].push(value);\n }, true);\n\n // Array Functions\n // ---------------\n\n // Get the first element of an array. Passing **n** will return the first N\n // values in the array. Aliased as `head` and `take`. The **guard** check\n // allows it to work with `_.map`.\n _.first = _.head = _.take = function(array, n, guard) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null || guard) return array[0];\n return _.initial(array, array.length - n);\n };\n\n // Returns everything but the last entry of the array. Especially useful on\n // the arguments object. Passing **n** will return all the values in\n // the array, excluding the last N.\n _.initial = function(array, n, guard) {\n return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));\n };\n\n // Get the last element of an array. Passing **n** will return the last N\n // values in the array.\n _.last = function(array, n, guard) {\n if (array == null || array.length < 1) return n == null ? void 0 : [];\n if (n == null || guard) return array[array.length - 1];\n return _.rest(array, Math.max(0, array.length - n));\n };\n\n // Returns everything but the first entry of the array. Aliased as `tail` and `drop`.\n // Especially useful on the arguments object. Passing an **n** will return\n // the rest N values in the array.\n _.rest = _.tail = _.drop = function(array, n, guard) {\n return slice.call(array, n == null || guard ? 1 : n);\n };\n\n // Trim out all falsy values from an array.\n _.compact = function(array) {\n return _.filter(array, Boolean);\n };\n\n // Internal implementation of a recursive `flatten` function.\n var flatten = function(input, shallow, strict, output) {\n output = output || [];\n var idx = output.length;\n for (var i = 0, length = getLength(input); i < length; i++) {\n var value = input[i];\n if (isArrayLike(value) && (_.isArray(value) || _.isArguments(value))) {\n // Flatten current level of array or arguments object.\n if (shallow) {\n var j = 0, len = value.length;\n while (j < len) output[idx++] = value[j++];\n } else {\n flatten(value, shallow, strict, output);\n idx = output.length;\n }\n } else if (!strict) {\n output[idx++] = value;\n }\n }\n return output;\n };\n\n // Flatten out an array, either recursively (by default), or just one level.\n _.flatten = function(array, shallow) {\n return flatten(array, shallow, false);\n };\n\n // Return a version of the array that does not contain the specified value(s).\n _.without = restArguments(function(array, otherArrays) {\n return _.difference(array, otherArrays);\n });\n\n // Produce a duplicate-free version of the array. If the array has already\n // been sorted, you have the option of using a faster algorithm.\n // The faster algorithm will not work with an iteratee if the iteratee\n // is not a one-to-one function, so providing an iteratee will disable\n // the faster algorithm.\n // Aliased as `unique`.\n _.uniq = _.unique = function(array, isSorted, iteratee, context) {\n if (!_.isBoolean(isSorted)) {\n context = iteratee;\n iteratee = isSorted;\n isSorted = false;\n }\n if (iteratee != null) iteratee = cb(iteratee, context);\n var result = [];\n var seen = [];\n for (var i = 0, length = getLength(array); i < length; i++) {\n var value = array[i],\n computed = iteratee ? iteratee(value, i, array) : value;\n if (isSorted && !iteratee) {\n if (!i || seen !== computed) result.push(value);\n seen = computed;\n } else if (iteratee) {\n if (!_.contains(seen, computed)) {\n seen.push(computed);\n result.push(value);\n }\n } else if (!_.contains(result, value)) {\n result.push(value);\n }\n }\n return result;\n };\n\n // Produce an array that contains the union: each distinct element from all of\n // the passed-in arrays.\n _.union = restArguments(function(arrays) {\n return _.uniq(flatten(arrays, true, true));\n });\n\n // Produce an array that contains every item shared between all the\n // passed-in arrays.\n _.intersection = function(array) {\n var result = [];\n var argsLength = arguments.length;\n for (var i = 0, length = getLength(array); i < length; i++) {\n var item = array[i];\n if (_.contains(result, item)) continue;\n var j;\n for (j = 1; j < argsLength; j++) {\n if (!_.contains(arguments[j], item)) break;\n }\n if (j === argsLength) result.push(item);\n }\n return result;\n };\n\n // Take the difference between one array and a number of other arrays.\n // Only the elements present in just the first array will remain.\n _.difference = restArguments(function(array, rest) {\n rest = flatten(rest, true, true);\n return _.filter(array, function(value){\n return !_.contains(rest, value);\n });\n });\n\n // Complement of _.zip. Unzip accepts an array of arrays and groups\n // each array's elements on shared indices.\n _.unzip = function(array) {\n var length = array && _.max(array, getLength).length || 0;\n var result = Array(length);\n\n for (var index = 0; index < length; index++) {\n result[index] = _.pluck(array, index);\n }\n return result;\n };\n\n // Zip together multiple lists into a single array -- elements that share\n // an index go together.\n _.zip = restArguments(_.unzip);\n\n // Converts lists into objects. Pass either a single array of `[key, value]`\n // pairs, or two parallel arrays of the same length -- one of keys, and one of\n // the corresponding values. Passing by pairs is the reverse of _.pairs.\n _.object = function(list, values) {\n var result = {};\n for (var i = 0, length = getLength(list); i < length; i++) {\n if (values) {\n result[list[i]] = values[i];\n } else {\n result[list[i][0]] = list[i][1];\n }\n }\n return result;\n };\n\n // Generator function to create the findIndex and findLastIndex functions.\n var createPredicateIndexFinder = function(dir) {\n return function(array, predicate, context) {\n predicate = cb(predicate, context);\n var length = getLength(array);\n var index = dir > 0 ? 0 : length - 1;\n for (; index >= 0 && index < length; index += dir) {\n if (predicate(array[index], index, array)) return index;\n }\n return -1;\n };\n };\n\n // Returns the first index on an array-like that passes a predicate test.\n _.findIndex = createPredicateIndexFinder(1);\n _.findLastIndex = createPredicateIndexFinder(-1);\n\n // Use a comparator function to figure out the smallest index at which\n // an object should be inserted so as to maintain order. Uses binary search.\n _.sortedIndex = function(array, obj, iteratee, context) {\n iteratee = cb(iteratee, context, 1);\n var value = iteratee(obj);\n var low = 0, high = getLength(array);\n while (low < high) {\n var mid = Math.floor((low + high) / 2);\n if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;\n }\n return low;\n };\n\n // Generator function to create the indexOf and lastIndexOf functions.\n var createIndexFinder = function(dir, predicateFind, sortedIndex) {\n return function(array, item, idx) {\n var i = 0, length = getLength(array);\n if (typeof idx == 'number') {\n if (dir > 0) {\n i = idx >= 0 ? idx : Math.max(idx + length, i);\n } else {\n length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;\n }\n } else if (sortedIndex && idx && length) {\n idx = sortedIndex(array, item);\n return array[idx] === item ? idx : -1;\n }\n if (item !== item) {\n idx = predicateFind(slice.call(array, i, length), _.isNaN);\n return idx >= 0 ? idx + i : -1;\n }\n for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {\n if (array[idx] === item) return idx;\n }\n return -1;\n };\n };\n\n // Return the position of the first occurrence of an item in an array,\n // or -1 if the item is not included in the array.\n // If the array is large and already in sort order, pass `true`\n // for **isSorted** to use binary search.\n _.indexOf = createIndexFinder(1, _.findIndex, _.sortedIndex);\n _.lastIndexOf = createIndexFinder(-1, _.findLastIndex);\n\n // Generate an integer Array containing an arithmetic progression. A port of\n // the native Python `range()` function. See\n // [the Python documentation](http://docs.python.org/library/functions.html#range).\n _.range = function(start, stop, step) {\n if (stop == null) {\n stop = start || 0;\n start = 0;\n }\n if (!step) {\n step = stop < start ? -1 : 1;\n }\n\n var length = Math.max(Math.ceil((stop - start) / step), 0);\n var range = Array(length);\n\n for (var idx = 0; idx < length; idx++, start += step) {\n range[idx] = start;\n }\n\n return range;\n };\n\n // Chunk a single array into multiple arrays, each containing `count` or fewer\n // items.\n _.chunk = function(array, count) {\n if (count == null || count < 1) return [];\n var result = [];\n var i = 0, length = array.length;\n while (i < length) {\n result.push(slice.call(array, i, i += count));\n }\n return result;\n };\n\n // Function (ahem) Functions\n // ------------------\n\n // Determines whether to execute a function as a constructor\n // or a normal function with the provided arguments.\n var executeBound = function(sourceFunc, boundFunc, context, callingContext, args) {\n if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);\n var self = baseCreate(sourceFunc.prototype);\n var result = sourceFunc.apply(self, args);\n if (_.isObject(result)) return result;\n return self;\n };\n\n // Create a function bound to a given object (assigning `this`, and arguments,\n // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if\n // available.\n _.bind = restArguments(function(func, context, args) {\n if (!_.isFunction(func)) throw new TypeError('Bind must be called on a function');\n var bound = restArguments(function(callArgs) {\n return executeBound(func, bound, context, this, args.concat(callArgs));\n });\n return bound;\n });\n\n // Partially apply a function by creating a version that has had some of its\n // arguments pre-filled, without changing its dynamic `this` context. _ acts\n // as a placeholder by default, allowing any combination of arguments to be\n // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.\n _.partial = restArguments(function(func, boundArgs) {\n var placeholder = _.partial.placeholder;\n var bound = function() {\n var position = 0, length = boundArgs.length;\n var args = Array(length);\n for (var i = 0; i < length; i++) {\n args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];\n }\n while (position < arguments.length) args.push(arguments[position++]);\n return executeBound(func, bound, this, this, args);\n };\n return bound;\n });\n\n _.partial.placeholder = _;\n\n // Bind a number of an object's methods to that object. Remaining arguments\n // are the method names to be bound. Useful for ensuring that all callbacks\n // defined on an object belong to it.\n _.bindAll = restArguments(function(obj, keys) {\n keys = flatten(keys, false, false);\n var index = keys.length;\n if (index < 1) throw new Error('bindAll must be passed function names');\n while (index--) {\n var key = keys[index];\n obj[key] = _.bind(obj[key], obj);\n }\n });\n\n // Memoize an expensive function by storing its results.\n _.memoize = function(func, hasher) {\n var memoize = function(key) {\n var cache = memoize.cache;\n var address = '' + (hasher ? hasher.apply(this, arguments) : key);\n if (!has(cache, address)) cache[address] = func.apply(this, arguments);\n return cache[address];\n };\n memoize.cache = {};\n return memoize;\n };\n\n // Delays a function for the given number of milliseconds, and then calls\n // it with the arguments supplied.\n _.delay = restArguments(function(func, wait, args) {\n return setTimeout(function() {\n return func.apply(null, args);\n }, wait);\n });\n\n // Defers a function, scheduling it to run after the current call stack has\n // cleared.\n _.defer = _.partial(_.delay, _, 1);\n\n // Returns a function, that, when invoked, will only be triggered at most once\n // during a given window of time. Normally, the throttled function will run\n // as much as it can, without ever going more than once per `wait` duration;\n // but if you'd like to disable the execution on the leading edge, pass\n // `{leading: false}`. To disable execution on the trailing edge, ditto.\n _.throttle = function(func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function() {\n previous = options.leading === false ? 0 : _.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function() {\n var now = _.now();\n if (!previous && options.leading === false) previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n\n throttled.cancel = function() {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n };\n\n // Returns a function, that, as long as it continues to be invoked, will not\n // be triggered. The function will be called after it stops being called for\n // N milliseconds. If `immediate` is passed, trigger the function on the\n // leading edge, instead of the trailing.\n _.debounce = function(func, wait, immediate) {\n var timeout, result;\n\n var later = function(context, args) {\n timeout = null;\n if (args) result = func.apply(context, args);\n };\n\n var debounced = restArguments(function(args) {\n if (timeout) clearTimeout(timeout);\n if (immediate) {\n var callNow = !timeout;\n timeout = setTimeout(later, wait);\n if (callNow) result = func.apply(this, args);\n } else {\n timeout = _.delay(later, wait, this, args);\n }\n\n return result;\n });\n\n debounced.cancel = function() {\n clearTimeout(timeout);\n timeout = null;\n };\n\n return debounced;\n };\n\n // Returns the first function passed as an argument to the second,\n // allowing you to adjust arguments, run code before and after, and\n // conditionally execute the original function.\n _.wrap = function(func, wrapper) {\n return _.partial(wrapper, func);\n };\n\n // Returns a negated version of the passed-in predicate.\n _.negate = function(predicate) {\n return function() {\n return !predicate.apply(this, arguments);\n };\n };\n\n // Returns a function that is the composition of a list of functions, each\n // consuming the return value of the function that follows.\n _.compose = function() {\n var args = arguments;\n var start = args.length - 1;\n return function() {\n var i = start;\n var result = args[start].apply(this, arguments);\n while (i--) result = args[i].call(this, result);\n return result;\n };\n };\n\n // Returns a function that will only be executed on and after the Nth call.\n _.after = function(times, func) {\n return function() {\n if (--times < 1) {\n return func.apply(this, arguments);\n }\n };\n };\n\n // Returns a function that will only be executed up to (but not including) the Nth call.\n _.before = function(times, func) {\n var memo;\n return function() {\n if (--times > 0) {\n memo = func.apply(this, arguments);\n }\n if (times <= 1) func = null;\n return memo;\n };\n };\n\n // Returns a function that will be executed at most one time, no matter how\n // often you call it. Useful for lazy initialization.\n _.once = _.partial(_.before, 2);\n\n _.restArguments = restArguments;\n\n // Object Functions\n // ----------------\n\n // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.\n var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');\n var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',\n 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];\n\n var collectNonEnumProps = function(obj, keys) {\n var nonEnumIdx = nonEnumerableProps.length;\n var constructor = obj.constructor;\n var proto = _.isFunction(constructor) && constructor.prototype || ObjProto;\n\n // Constructor is a special case.\n var prop = 'constructor';\n if (has(obj, prop) && !_.contains(keys, prop)) keys.push(prop);\n\n while (nonEnumIdx--) {\n prop = nonEnumerableProps[nonEnumIdx];\n if (prop in obj && obj[prop] !== proto[prop] && !_.contains(keys, prop)) {\n keys.push(prop);\n }\n }\n };\n\n // Retrieve the names of an object's own properties.\n // Delegates to **ECMAScript 5**'s native `Object.keys`.\n _.keys = function(obj) {\n if (!_.isObject(obj)) return [];\n if (nativeKeys) return nativeKeys(obj);\n var keys = [];\n for (var key in obj) if (has(obj, key)) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n };\n\n // Retrieve all the property names of an object.\n _.allKeys = function(obj) {\n if (!_.isObject(obj)) return [];\n var keys = [];\n for (var key in obj) keys.push(key);\n // Ahem, IE < 9.\n if (hasEnumBug) collectNonEnumProps(obj, keys);\n return keys;\n };\n\n // Retrieve the values of an object's properties.\n _.values = function(obj) {\n var keys = _.keys(obj);\n var length = keys.length;\n var values = Array(length);\n for (var i = 0; i < length; i++) {\n values[i] = obj[keys[i]];\n }\n return values;\n };\n\n // Returns the results of applying the iteratee to each element of the object.\n // In contrast to _.map it returns an object.\n _.mapObject = function(obj, iteratee, context) {\n iteratee = cb(iteratee, context);\n var keys = _.keys(obj),\n length = keys.length,\n results = {};\n for (var index = 0; index < length; index++) {\n var currentKey = keys[index];\n results[currentKey] = iteratee(obj[currentKey], currentKey, obj);\n }\n return results;\n };\n\n // Convert an object into a list of `[key, value]` pairs.\n // The opposite of _.object.\n _.pairs = function(obj) {\n var keys = _.keys(obj);\n var length = keys.length;\n var pairs = Array(length);\n for (var i = 0; i < length; i++) {\n pairs[i] = [keys[i], obj[keys[i]]];\n }\n return pairs;\n };\n\n // Invert the keys and values of an object. The values must be serializable.\n _.invert = function(obj) {\n var result = {};\n var keys = _.keys(obj);\n for (var i = 0, length = keys.length; i < length; i++) {\n result[obj[keys[i]]] = keys[i];\n }\n return result;\n };\n\n // Return a sorted list of the function names available on the object.\n // Aliased as `methods`.\n _.functions = _.methods = function(obj) {\n var names = [];\n for (var key in obj) {\n if (_.isFunction(obj[key])) names.push(key);\n }\n return names.sort();\n };\n\n // An internal function for creating assigner functions.\n var createAssigner = function(keysFunc, defaults) {\n return function(obj) {\n var length = arguments.length;\n if (defaults) obj = Object(obj);\n if (length < 2 || obj == null) return obj;\n for (var index = 1; index < length; index++) {\n var source = arguments[index],\n keys = keysFunc(source),\n l = keys.length;\n for (var i = 0; i < l; i++) {\n var key = keys[i];\n if (!defaults || obj[key] === void 0) obj[key] = source[key];\n }\n }\n return obj;\n };\n };\n\n // Extend a given object with all the properties in passed-in object(s).\n _.extend = createAssigner(_.allKeys);\n\n // Assigns a given object with all the own properties in the passed-in object(s).\n // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)\n _.extendOwn = _.assign = createAssigner(_.keys);\n\n // Returns the first key on an object that passes a predicate test.\n _.findKey = function(obj, predicate, context) {\n predicate = cb(predicate, context);\n var keys = _.keys(obj), key;\n for (var i = 0, length = keys.length; i < length; i++) {\n key = keys[i];\n if (predicate(obj[key], key, obj)) return key;\n }\n };\n\n // Internal pick helper function to determine if `obj` has key `key`.\n var keyInObj = function(value, key, obj) {\n return key in obj;\n };\n\n // Return a copy of the object only containing the whitelisted properties.\n _.pick = restArguments(function(obj, keys) {\n var result = {}, iteratee = keys[0];\n if (obj == null) return result;\n if (_.isFunction(iteratee)) {\n if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);\n keys = _.allKeys(obj);\n } else {\n iteratee = keyInObj;\n keys = flatten(keys, false, false);\n obj = Object(obj);\n }\n for (var i = 0, length = keys.length; i < length; i++) {\n var key = keys[i];\n var value = obj[key];\n if (iteratee(value, key, obj)) result[key] = value;\n }\n return result;\n });\n\n // Return a copy of the object without the blacklisted properties.\n _.omit = restArguments(function(obj, keys) {\n var iteratee = keys[0], context;\n if (_.isFunction(iteratee)) {\n iteratee = _.negate(iteratee);\n if (keys.length > 1) context = keys[1];\n } else {\n keys = _.map(flatten(keys, false, false), String);\n iteratee = function(value, key) {\n return !_.contains(keys, key);\n };\n }\n return _.pick(obj, iteratee, context);\n });\n\n // Fill in a given object with default properties.\n _.defaults = createAssigner(_.allKeys, true);\n\n // Creates an object that inherits from the given prototype object.\n // If additional properties are provided then they will be added to the\n // created object.\n _.create = function(prototype, props) {\n var result = baseCreate(prototype);\n if (props) _.extendOwn(result, props);\n return result;\n };\n\n // Create a (shallow-cloned) duplicate of an object.\n _.clone = function(obj) {\n if (!_.isObject(obj)) return obj;\n return _.isArray(obj) ? obj.slice() : _.extend({}, obj);\n };\n\n // Invokes interceptor with the obj, and then returns obj.\n // The primary purpose of this method is to \"tap into\" a method chain, in\n // order to perform operations on intermediate results within the chain.\n _.tap = function(obj, interceptor) {\n interceptor(obj);\n return obj;\n };\n\n // Returns whether an object has a given set of `key:value` pairs.\n _.isMatch = function(object, attrs) {\n var keys = _.keys(attrs), length = keys.length;\n if (object == null) return !length;\n var obj = Object(object);\n for (var i = 0; i < length; i++) {\n var key = keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) return false;\n }\n return true;\n };\n\n\n // Internal recursive comparison function for `isEqual`.\n var eq, deepEq;\n eq = function(a, b, aStack, bStack) {\n // Identical objects are equal. `0 === -0`, but they aren't identical.\n // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal).\n if (a === b) return a !== 0 || 1 / a === 1 / b;\n // `null` or `undefined` only equal to itself (strict comparison).\n if (a == null || b == null) return false;\n // `NaN`s are equivalent, but non-reflexive.\n if (a !== a) return b !== b;\n // Exhaust primitive checks\n var type = typeof a;\n if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;\n return deepEq(a, b, aStack, bStack);\n };\n\n // Internal recursive comparison function for `isEqual`.\n deepEq = function(a, b, aStack, bStack) {\n // Unwrap any wrapped objects.\n if (a instanceof _) a = a._wrapped;\n if (b instanceof _) b = b._wrapped;\n // Compare `[[Class]]` names.\n var className = toString.call(a);\n if (className !== toString.call(b)) return false;\n switch (className) {\n // Strings, numbers, regular expressions, dates, and booleans are compared by value.\n case '[object RegExp]':\n // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')\n case '[object String]':\n // Primitives and their corresponding object wrappers are equivalent; thus, `\"5\"` is\n // equivalent to `new String(\"5\")`.\n return '' + a === '' + b;\n case '[object Number]':\n // `NaN`s are equivalent, but non-reflexive.\n // Object(NaN) is equivalent to NaN.\n if (+a !== +a) return +b !== +b;\n // An `egal` comparison is performed for other numeric values.\n return +a === 0 ? 1 / +a === 1 / b : +a === +b;\n case '[object Date]':\n case '[object Boolean]':\n // Coerce dates and booleans to numeric primitive values. Dates are compared by their\n // millisecond representations. Note that invalid dates with millisecond representations\n // of `NaN` are not equivalent.\n return +a === +b;\n case '[object Symbol]':\n return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);\n }\n\n var areArrays = className === '[object Array]';\n if (!areArrays) {\n if (typeof a != 'object' || typeof b != 'object') return false;\n\n // Objects with different constructors are not equivalent, but `Object`s or `Array`s\n // from different frames are.\n var aCtor = a.constructor, bCtor = b.constructor;\n if (aCtor !== bCtor && !(_.isFunction(aCtor) && aCtor instanceof aCtor &&\n _.isFunction(bCtor) && bCtor instanceof bCtor)\n && ('constructor' in a && 'constructor' in b)) {\n return false;\n }\n }\n // Assume equality for cyclic structures. The algorithm for detecting cyclic\n // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.\n\n // Initializing stack of traversed objects.\n // It's done here since we only need them for objects and arrays comparison.\n aStack = aStack || [];\n bStack = bStack || [];\n var length = aStack.length;\n while (length--) {\n // Linear search. Performance is inversely proportional to the number of\n // unique nested structures.\n if (aStack[length] === a) return bStack[length] === b;\n }\n\n // Add the first object to the stack of traversed objects.\n aStack.push(a);\n bStack.push(b);\n\n // Recursively compare objects and arrays.\n if (areArrays) {\n // Compare array lengths to determine if a deep comparison is necessary.\n length = a.length;\n if (length !== b.length) return false;\n // Deep compare the contents, ignoring non-numeric properties.\n while (length--) {\n if (!eq(a[length], b[length], aStack, bStack)) return false;\n }\n } else {\n // Deep compare objects.\n var keys = _.keys(a), key;\n length = keys.length;\n // Ensure that both objects contain the same number of properties before comparing deep equality.\n if (_.keys(b).length !== length) return false;\n while (length--) {\n // Deep compare each member\n key = keys[length];\n if (!(has(b, key) && eq(a[key], b[key], aStack, bStack))) return false;\n }\n }\n // Remove the first object from the stack of traversed objects.\n aStack.pop();\n bStack.pop();\n return true;\n };\n\n // Perform a deep comparison to check if two objects are equal.\n _.isEqual = function(a, b) {\n return eq(a, b);\n };\n\n // Is a given array, string, or object empty?\n // An \"empty\" object has no enumerable own-properties.\n _.isEmpty = function(obj) {\n if (obj == null) return true;\n if (isArrayLike(obj) && (_.isArray(obj) || _.isString(obj) || _.isArguments(obj))) return obj.length === 0;\n return _.keys(obj).length === 0;\n };\n\n // Is a given value a DOM element?\n _.isElement = function(obj) {\n return !!(obj && obj.nodeType === 1);\n };\n\n // Is a given value an array?\n // Delegates to ECMA5's native Array.isArray\n _.isArray = nativeIsArray || function(obj) {\n return toString.call(obj) === '[object Array]';\n };\n\n // Is a given variable an object?\n _.isObject = function(obj) {\n var type = typeof obj;\n return type === 'function' || type === 'object' && !!obj;\n };\n\n // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp, isError, isMap, isWeakMap, isSet, isWeakSet.\n _.each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp', 'Error', 'Symbol', 'Map', 'WeakMap', 'Set', 'WeakSet'], function(name) {\n _['is' + name] = function(obj) {\n return toString.call(obj) === '[object ' + name + ']';\n };\n });\n\n // Define a fallback version of the method in browsers (ahem, IE < 9), where\n // there isn't any inspectable \"Arguments\" type.\n if (!_.isArguments(arguments)) {\n _.isArguments = function(obj) {\n return has(obj, 'callee');\n };\n }\n\n // Optimize `isFunction` if appropriate. Work around some typeof bugs in old v8,\n // IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).\n var nodelist = root.document && root.document.childNodes;\n if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {\n _.isFunction = function(obj) {\n return typeof obj == 'function' || false;\n };\n }\n\n // Is a given object a finite number?\n _.isFinite = function(obj) {\n return !_.isSymbol(obj) && isFinite(obj) && !isNaN(parseFloat(obj));\n };\n\n // Is the given value `NaN`?\n _.isNaN = function(obj) {\n return _.isNumber(obj) && isNaN(obj);\n };\n\n // Is a given value a boolean?\n _.isBoolean = function(obj) {\n return obj === true || obj === false || toString.call(obj) === '[object Boolean]';\n };\n\n // Is a given value equal to null?\n _.isNull = function(obj) {\n return obj === null;\n };\n\n // Is a given variable undefined?\n _.isUndefined = function(obj) {\n return obj === void 0;\n };\n\n // Shortcut function for checking if an object has a given property directly\n // on itself (in other words, not on a prototype).\n _.has = function(obj, path) {\n if (!_.isArray(path)) {\n return has(obj, path);\n }\n var length = path.length;\n for (var i = 0; i < length; i++) {\n var key = path[i];\n if (obj == null || !hasOwnProperty.call(obj, key)) {\n return false;\n }\n obj = obj[key];\n }\n return !!length;\n };\n\n // Utility Functions\n // -----------------\n\n // Run Underscore.js in *noConflict* mode, returning the `_` variable to its\n // previous owner. Returns a reference to the Underscore object.\n _.noConflict = function() {\n root._ = previousUnderscore;\n return this;\n };\n\n // Keep the identity function around for default iteratees.\n _.identity = function(value) {\n return value;\n };\n\n // Predicate-generating functions. Often useful outside of Underscore.\n _.constant = function(value) {\n return function() {\n return value;\n };\n };\n\n _.noop = function(){};\n\n // Creates a function that, when passed an object, will traverse that object’s\n // properties down the given `path`, specified as an array of keys or indexes.\n _.property = function(path) {\n if (!_.isArray(path)) {\n return shallowProperty(path);\n }\n return function(obj) {\n return deepGet(obj, path);\n };\n };\n\n // Generates a function for a given object that returns a given property.\n _.propertyOf = function(obj) {\n if (obj == null) {\n return function(){};\n }\n return function(path) {\n return !_.isArray(path) ? obj[path] : deepGet(obj, path);\n };\n };\n\n // Returns a predicate for checking whether an object has a given set of\n // `key:value` pairs.\n _.matcher = _.matches = function(attrs) {\n attrs = _.extendOwn({}, attrs);\n return function(obj) {\n return _.isMatch(obj, attrs);\n };\n };\n\n // Run a function **n** times.\n _.times = function(n, iteratee, context) {\n var accum = Array(Math.max(0, n));\n iteratee = optimizeCb(iteratee, context, 1);\n for (var i = 0; i < n; i++) accum[i] = iteratee(i);\n return accum;\n };\n\n // Return a random integer between min and max (inclusive).\n _.random = function(min, max) {\n if (max == null) {\n max = min;\n min = 0;\n }\n return min + Math.floor(Math.random() * (max - min + 1));\n };\n\n // A (possibly faster) way to get the current timestamp as an integer.\n _.now = Date.now || function() {\n return new Date().getTime();\n };\n\n // List of HTML entities for escaping.\n var escapeMap = {\n '&': '&',\n '<': '<',\n '>': '>',\n '\"': '"',\n \"'\": ''',\n '`': '`'\n };\n var unescapeMap = _.invert(escapeMap);\n\n // Functions for escaping and unescaping strings to/from HTML interpolation.\n var createEscaper = function(map) {\n var escaper = function(match) {\n return map[match];\n };\n // Regexes for identifying a key that needs to be escaped.\n var source = '(?:' + _.keys(map).join('|') + ')';\n var testRegexp = RegExp(source);\n var replaceRegexp = RegExp(source, 'g');\n return function(string) {\n string = string == null ? '' : '' + string;\n return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;\n };\n };\n _.escape = createEscaper(escapeMap);\n _.unescape = createEscaper(unescapeMap);\n\n // Traverses the children of `obj` along `path`. If a child is a function, it\n // is invoked with its parent as context. Returns the value of the final\n // child, or `fallback` if any child is undefined.\n _.result = function(obj, path, fallback) {\n if (!_.isArray(path)) path = [path];\n var length = path.length;\n if (!length) {\n return _.isFunction(fallback) ? fallback.call(obj) : fallback;\n }\n for (var i = 0; i < length; i++) {\n var prop = obj == null ? void 0 : obj[path[i]];\n if (prop === void 0) {\n prop = fallback;\n i = length; // Ensure we don't continue iterating.\n }\n obj = _.isFunction(prop) ? prop.call(obj) : prop;\n }\n return obj;\n };\n\n // Generate a unique integer id (unique within the entire client session).\n // Useful for temporary DOM ids.\n var idCounter = 0;\n _.uniqueId = function(prefix) {\n var id = ++idCounter + '';\n return prefix ? prefix + id : id;\n };\n\n // By default, Underscore uses ERB-style template delimiters, change the\n // following template settings to use alternative delimiters.\n _.templateSettings = {\n evaluate: /<%([\\s\\S]+?)%>/g,\n interpolate: /<%=([\\s\\S]+?)%>/g,\n escape: /<%-([\\s\\S]+?)%>/g\n };\n\n // When customizing `templateSettings`, if you don't want to define an\n // interpolation, evaluation or escaping regex, we need one that is\n // guaranteed not to match.\n var noMatch = /(.)^/;\n\n // Certain characters need to be escaped so that they can be put into a\n // string literal.\n var escapes = {\n \"'\": \"'\",\n '\\\\': '\\\\',\n '\\r': 'r',\n '\\n': 'n',\n '\\u2028': 'u2028',\n '\\u2029': 'u2029'\n };\n\n var escapeRegExp = /\\\\|'|\\r|\\n|\\u2028|\\u2029/g;\n\n var escapeChar = function(match) {\n return '\\\\' + escapes[match];\n };\n\n // JavaScript micro-templating, similar to John Resig's implementation.\n // Underscore templating handles arbitrary delimiters, preserves whitespace,\n // and correctly escapes quotes within interpolated code.\n // NB: `oldSettings` only exists for backwards compatibility.\n _.template = function(text, settings, oldSettings) {\n if (!settings && oldSettings) settings = oldSettings;\n settings = _.defaults({}, settings, _.templateSettings);\n\n // Combine delimiters into one regular expression via alternation.\n var matcher = RegExp([\n (settings.escape || noMatch).source,\n (settings.interpolate || noMatch).source,\n (settings.evaluate || noMatch).source\n ].join('|') + '|$', 'g');\n\n // Compile the template source, escaping string literals appropriately.\n var index = 0;\n var source = \"__p+='\";\n text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {\n source += text.slice(index, offset).replace(escapeRegExp, escapeChar);\n index = offset + match.length;\n\n if (escape) {\n source += \"'+\\n((__t=(\" + escape + \"))==null?'':_.escape(__t))+\\n'\";\n } else if (interpolate) {\n source += \"'+\\n((__t=(\" + interpolate + \"))==null?'':__t)+\\n'\";\n } else if (evaluate) {\n source += \"';\\n\" + evaluate + \"\\n__p+='\";\n }\n\n // Adobe VMs need the match returned to produce the correct offset.\n return match;\n });\n source += \"';\\n\";\n\n // If a variable is not specified, place data values in local scope.\n if (!settings.variable) source = 'with(obj||{}){\\n' + source + '}\\n';\n\n source = \"var __t,__p='',__j=Array.prototype.join,\" +\n \"print=function(){__p+=__j.call(arguments,'');};\\n\" +\n source + 'return __p;\\n';\n\n var render;\n try {\n render = new Function(settings.variable || 'obj', '_', source);\n } catch (e) {\n e.source = source;\n throw e;\n }\n\n var template = function(data) {\n return render.call(this, data, _);\n };\n\n // Provide the compiled source as a convenience for precompilation.\n var argument = settings.variable || 'obj';\n template.source = 'function(' + argument + '){\\n' + source + '}';\n\n return template;\n };\n\n // Add a \"chain\" function. Start chaining a wrapped Underscore object.\n _.chain = function(obj) {\n var instance = _(obj);\n instance._chain = true;\n return instance;\n };\n\n // OOP\n // ---------------\n // If Underscore is called as a function, it returns a wrapped object that\n // can be used OO-style. This wrapper holds altered versions of all the\n // underscore functions. Wrapped objects may be chained.\n\n // Helper function to continue chaining intermediate results.\n var chainResult = function(instance, obj) {\n return instance._chain ? _(obj).chain() : obj;\n };\n\n // Add your own custom functions to the Underscore object.\n _.mixin = function(obj) {\n _.each(_.functions(obj), function(name) {\n var func = _[name] = obj[name];\n _.prototype[name] = function() {\n var args = [this._wrapped];\n push.apply(args, arguments);\n return chainResult(this, func.apply(_, args));\n };\n });\n return _;\n };\n\n // Add all of the Underscore functions to the wrapper object.\n _.mixin(_);\n\n // Add all mutator Array functions to the wrapper.\n _.each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n var obj = this._wrapped;\n method.apply(obj, arguments);\n if ((name === 'shift' || name === 'splice') && obj.length === 0) delete obj[0];\n return chainResult(this, obj);\n };\n });\n\n // Add all accessor Array functions to the wrapper.\n _.each(['concat', 'join', 'slice'], function(name) {\n var method = ArrayProto[name];\n _.prototype[name] = function() {\n return chainResult(this, method.apply(this._wrapped, arguments));\n };\n });\n\n // Extracts the result from a wrapped and chained object.\n _.prototype.value = function() {\n return this._wrapped;\n };\n\n // Provide unwrapping proxy for some methods used in engine operations\n // such as arithmetic and JSON stringification.\n _.prototype.valueOf = _.prototype.toJSON = _.prototype.value;\n\n _.prototype.toString = function() {\n return String(this._wrapped);\n };\n\n // AMD registration happens at the end for compatibility with AMD loaders\n // that may not enforce next-turn semantics on modules. Even though general\n // practice for AMD registration is to be anonymous, underscore registers\n // as a named module because, like jQuery, it is a base library that is\n // popular enough to be bundled in a third party lib, but not be part of\n // an AMD load request. Those cases could generate an error when an\n // anonymous define() is called outside of a loader request.\n if (typeof define == 'function' && define.amd) {\n define('underscore', [], function() {\n return _;\n });\n }\n}());\n","var g;\n\n// This works in non-strict mode\ng = (function() {\n\treturn this;\n})();\n\ntry {\n\t// This works if eval is allowed (see CSP)\n\tg = g || new Function(\"return this\")();\n} catch (e) {\n\t// This works if the window reference is available\n\tif (typeof window === \"object\") g = window;\n}\n\n// g can still be undefined, but nothing to do about it...\n// We return undefined, instead of nothing here, so it's\n// easier to handle this case. if(!global) { ...}\n\nmodule.exports = g;\n","module.exports = function(module) {\n\tif (!module.webpackPolyfill) {\n\t\tmodule.deprecate = function() {};\n\t\tmodule.paths = [];\n\t\t// module.parent = undefined by default\n\t\tif (!module.children) module.children = [];\n\t\tObject.defineProperty(module, \"loaded\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.l;\n\t\t\t}\n\t\t});\n\t\tObject.defineProperty(module, \"id\", {\n\t\t\tenumerable: true,\n\t\t\tget: function() {\n\t\t\t\treturn module.i;\n\t\t\t}\n\t\t});\n\t\tmodule.webpackPolyfill = 1;\n\t}\n\treturn module;\n};\n","\"use strict\";\nvar updatePlot = require('./update.js');\nvar utils = require('./utils.js');\nvar _ = require('underscore');\n\n\nfunction processData(dataObj) {\n var dates = _.map(dataObj.timestamps, function(date){return date});\n var allData = {\n dates: dates,\n };\n _.extend(allData, dataObj.data);\n return allData;\n}\n\n\nfunction plotting(dataCache, url, var_names, plotsInfo, div, update, maxPoints, err_callback) {\n //gets information and updates component\n $.ajax({\n type: 'GET',\n url: url,\n jsonp: \"callback\",\n dataType: \"jsonp\",\n\n success: function(dataObj) {\n if (dataObj.code != 200) {\n console.error(\"Invalid data API query. Code: {0} | Message: {1}\".format(\n dataObj.code, dataObj.message));\n if (err_callback !== undefined) {\n // stop the update timer if specified\n err_callback(plotsInfo);\n }\n return;\n }\n\n var graphDiv = document.getElementById(div);\n var allData = processData(dataObj['results']);\n // var existingDates = graphDiv.data[0]['x'];\n var existingDates = dataCache[0]['x'] || [];\n var dates = allData['dates'];\n dataObj = {\n dates: dates\n };\n\n if (dataObj.dates.length == 0) {\n console.warn(\"No data available from API\");\n return;\n }\n\n if (update) {\n // first index in the new data that is actually new\n var startIndex = 0;\n // update only dates that aren't already included\n // assume that we don't have any missing dates in the middle\n while (startIndex < dates.length && dates[startIndex] <= existingDates[existingDates.length - 1]) {\n startIndex++;\n }\n\n // subset the data if needed\n if (startIndex >= dates.length) {\n console.info(\"No new data downloaded\");\n return;\n } else {\n for (var i = 0; i < var_names.length; i++) {\n dataObj[var_names[i]] = allData[var_names[i]].slice(startIndex);\n }\n dates = dates.slice(startIndex);\n dataObj.dates = dates;\n }\n } else {\n // replace the entire data array\n for (var i = 0; i < var_names.length; i++) {\n dataObj[var_names[i]] = allData[var_names[i]];\n }\n }\n\n // Update data with\n updatePlot.updatePlot(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints);\n }\n });\n}\n\n\n// 1. the minimum time period (in milliseconds) that a request must cover in order to use\n// 2. MetObs Data API interval specifier\n// 3. reasonable update interval for API given this data interval\nconst intervalLookUp = [\n // 1 day for 5 minutes\n [1000*60*60*24, '5m', '-00:10:00'],\n // 1 month for 1 hour\n [1000*60*60*24*30*1, '1h', '-02:00:00'],\n // anything else is 1 minute\n];\n\nconst intervalToSeconds = {\n '1m': 60,\n '5m': 60 * 5,\n '1h': 60 * 60,\n};\n\n\nfunction varNamesForDiv(dataCache) {\n var varNames = [];\n _.each(dataCache, function(trace_data) {\n Array.prototype.push.apply(varNames, trace_data.var_names);\n if ('anc_variables' in trace_data) {\n Array.prototype.push.apply(varNames, trace_data.anc_variables);\n }\n });\n return _.uniq(varNames);\n}\n\n\n//poorly ordered function parameters\nfunction requestPlotUpdate(dataCache, div, plotsInfo, startTime, endTime, interval, update, err_callback) {\n var varNames = varNamesForDiv(dataCache);\n var stream_string = '';\n var dt_in_ms;\n var time_parts;\n var maxPoints;\n var time;\n for (var i in varNames) {\n stream_string += varNames[i];\n if (i < varNames.length - 1) stream_string += ':';\n }\n\n if (!endTime) {\n interval = '1m';\n // hours, minutes, seconds\n time_parts = _.map(startTime.split(':'), Number);\n dt_in_ms = -1000 * 60 * 60 * time_parts[0] + 1000 * 60 * time_parts[1] + 1000 * time_parts[2];\n for (var i in intervalLookUp) {\n if (dt_in_ms >= intervalLookUp[i][0]) {\n interval = intervalLookUp[i][1];\n\n if (update) {\n // we only want new data, the passed startTime was only\n // used to determine the interval\n startTime = intervalLookUp[i][2];\n }\n }\n }\n time = '&begin=' + startTime;\n } else {\n time = '&begin=' + startTime + '&end=' + endTime;\n if (interval == 'auto') {\n interval = '1m';\n dt_in_ms = (new Date(endTime)) - (new Date(startTime));\n for (var i in intervalLookUp) {\n if (dt_in_ms >= intervalLookUp[i][0])\n interval = intervalLookUp[i][1];\n }\n }\n }\n\n\n // Maximum number of points (fallback to arbitrary 250)\n if (update) {\n maxPoints = intervalToSeconds.hasOwnProperty(interval) ? dt_in_ms / 1000 / intervalToSeconds[interval] : 250;\n } else {\n maxPoints = 0; // delete all previous data\n }\n var url = utils.buildRequestUrl('json', interval, '', '', 'column', time, stream_string);\n plotting(dataCache, url, varNames, plotsInfo, div, update, maxPoints, err_callback);\n return interval;\n}\n\n\n//export functions\nmodule.exports.requestPlotUpdate = requestPlotUpdate;\n","\"use strict\";\nvar Plotly = require('Plotly');\nvar loading = require('../ui/loading.js');\n\n\nfunction getSecondAxisConfig(axis_number, plot_info, axis_info, axis_kwargs) {\n var key;\n var axis_config = {\n gridcolor: '#777777',\n titlefont: {'size' : 12},\n title: axis_info['title'],\n zeroline: false,\n overlaying: 'y' + (axis_number - 1).toString(),\n side: 'right',\n anchor: 'x',\n };\n\n for (var idx=0; idx < axis_kwargs.length; idx++) {\n key = axis_kwargs[idx];\n if (key in axis_info) {\n axis_config[key] = axis_info[key];\n }\n }\n return axis_config;\n}\n\n\nfunction coreLobbyLayout(layout, axis_config, axis_number, plot_idx, topOfGraph, graphName, textSize) {\n layout['xaxis' + axis_number] = {\n ticktext: ['-6h', '-3h', 'Now'],\n tickfont: {\n size: textSize / 5\n },\n showline: true,\n linecolor: 'white',\n anchor: 'y' + axis_number,\n // 1 is the far right of the plot, 0 is the far left.\n // Space the x-axis with the 10% of window width on each side. The bottom row has no middle graph,\n // which is why we multiply by (1 + Math.floor(plot_idx / 6)).\n domain: [.1 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6)), 14 / 60 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6))],\n // xaxis doesn't show its lines.\n zeroline: false,\n // hide grid.\n showgrid: false\n };\n // This is the text for the current value above each graph.\n layout['annotations'].push({\n font: {\n size: textSize / 2\n },\n showarrow: false,\n align: 'center',\n // Middle of each x-axis domain.\n x: 1/6 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6)), //position in x domain\n y: topOfGraph + .04, //position in y domain\n xref: 'paper',\n yref: 'paper',\n //Makes text centered\n showarrow: true,\n arrowhead: 0,\n ax: 0,\n ay: 0,\n });\n // This is the text for the name of each graph.\n layout['annotations'].push({\n text: graphName,\n font: {\n size: textSize / 4\n },\n showarrow: false,\n align: 'center',\n x: 1/6 + 1 / 3 * (plot_idx % 3) * (1 + Math.floor(plot_idx / 6)), //position in x domain\n y: topOfGraph + .085, //position in y domain\n xref: 'paper',\n yref: 'paper',\n //Makes text centered\n showarrow: true,\n arrowhead: 0,\n ax: 0,\n ay: 0,\n });\n // Removes title from yaxis.\n delete axis_config['title']\n axis_config['tickfont'] = { size: textSize / 5 }\n axis_config['showgrid'] = false;\n axis_config['showticklabels'] = true;\n // Give each subgraph its own y-axis.\n axis_config['anchor'] = 'x' + axis_number;\n axis_config['showline'] = true;\n axis_config['linecolor'] = 'white';\n // axis_config are both modified without having to be returned.\n}\n\n\nfunction initPlot(dataCache, div_id, plotOrder, plotsInfo) {\n var DEFAULT_PLOT_HEIGHT = 170;\n var nshowing = plotOrder.length;\n var layout = {\n title: plotsInfo.title,\n showlegend: false,\n height: DEFAULT_PLOT_HEIGHT * nshowing + 180,\n }\n // Updates layout with plotsInfo.layout, which is defined for lobby display.\n Object.assign(layout, plotsInfo.layout)\n layout['xaxis'] = {\n //domain affects size of x axis\n //this made room for the legend\n //1 is the far right of the plot, 0 is the far left\n domain: [0, 1],\n\n //xaxis doesn't show its lines\n showline: false,\n zeroline: false,\n\n //values of the tick labels show up\n //show right away if we have any starting streams\n showticklabels: nshowing > 0,\n\n //its grid is a little darker than default\n gridcolor: \"#777777\",\n\n //hide grid\n showgrid: false,\n tickformat: '%Y-%m-%d %H:%MZ'\n };\n var axis_number = 0;\n var axis_info;\n var plot_info;\n var trace_info;\n var trace_config;\n var axis_config;\n var plot_key;\n var key;\n var step = 1 / nshowing;\n var domain;\n var x_anchor = axis_number;\n var trace_kwargs = ['marker', 'color', 'mode', 'zmin', 'zmax', 'y',\n 'contours', 'line', 'colorscale', 'showscale', 'colorbar', 'tick0', 'dtick', 'hovermode'];\n var axis_kwargs = ['nticks', 'range', 'autorange', 'zeroline', 'showgrid',\n 'tickmode', 'ticktext', 'tickvals'];\n for (var plot_idx = 0; plot_idx < plotOrder.length; plot_idx++) {\n plot_key = plotOrder[plot_idx];\n plot_info = plotsInfo.plots[plot_key];\n axis_number += 1;\n x_anchor = axis_number;\n axis_info = plot_info.yaxis;\n domain = [(plotOrder.length - 1 - plot_idx) * step * 1.03, 1 - plot_idx * step * 1.05];\n if (plotsInfo['isLobbyDisplay']) {\n // Leaves 8% for the header, then divides the rest into thirds with 10% height above and below each graph.\n domain = [.82 - 8 / 75 - (.2 + 8 / 75) * Math.floor(plot_idx / 3), .82 - (.2 + 8 / 75) * Math.floor(plot_idx / 3)];\n }\n\n // Create the necessary traces (lines)\n for (var trace_info_idx = 0; trace_info_idx < plot_info.traces.length; trace_info_idx++) {\n trace_info = plot_info.traces[trace_info_idx];\n trace_config = {\n name: trace_info['name'],\n x: [],\n y: [],\n text: [],\n type: trace_info.type ? trace_info.type : 'scatter',\n // Gives each graph its own x-axis if plotsInfo['isLobbyDisplay'].\n xaxis: plotsInfo['isLobbyDisplay'] ? 'x' + axis_number : 'x1',\n yaxis: 'y' + axis_number,\n hoverinfo: 'x+text',\n hovermode: 'closest',\n // meteorogram custom data flags\n var_names: trace_info['var_names'],\n anc_variables: trace_info['anc_variables'],\n anc_data: [],\n plot_name: plot_key,\n trace_index: trace_info_idx\n };\n // when we have a second trace that is purely there to make the\n // second y-axis appear, we do this to point the trace to the\n // correct axis\n if (trace_info.isSecondAxis) {\n trace_config.yaxis = 'y' + (axis_number + trace_info_idx);\n }\n\n for (var idx = 0; idx < trace_kwargs.length; idx++) {\n key = trace_kwargs[idx];\n if (key in trace_info) {\n trace_config[key] = trace_info[key];\n }\n }\n if ('colorbar' in trace_config) {\n trace_config.colorbar.len = domain[1] - domain[0];\n trace_config.colorbar.y = (domain[1] - domain[0]) / 2 + domain[0];\n trace_config.z = [];\n }\n dataCache.push(trace_config);\n }\n\n // Create Y-axis configuration object\n axis_config = {\n gridcolor: '#777777',\n titlefont: { 'size': 12 },\n title: axis_info['title'],\n zeroline: false,\n // where on the canvas does this axis belong\n domain: domain\n };\n if (plotsInfo['isLobbyDisplay']) {\n coreLobbyLayout(layout, axis_config, axis_number, plot_idx, domain[1], trace_info['name'], plotsInfo['rowTextSize'])\n }\n\n for (idx = 0; idx < axis_kwargs.length; idx++) {\n key = axis_kwargs[idx];\n if (key in axis_info) {\n axis_config[key] = axis_info[key];\n }\n }\n\n layout['yaxis' + axis_number] = axis_config;\n\n // Process second y-axis config\n // Skip if specified meaning this configuration is only parsed\n // for additional hover/probe information (custom MetObs thing, not Plotly)\n if (!plotsInfo['isLobbyDisplay'] && 'yaxis2' in plot_info && !plot_info.yaxis2.skip) {\n axis_number += 1;\n axis_info = plot_info.yaxis2;\n axis_config = getSecondAxisConfig(axis_number, plot_info, axis_info, axis_kwargs);\n layout['yaxis' + axis_number] = axis_config;\n }\n // MetObs custom way of saying \"I want more probe information\n // if ('probe2' in plot_info) {\n // axis_number += 1;\n // axis_info = plot_info.probe2;\n // axis_config = getSecondAxisConfig(axis_number, plot_info, axis_info, axis_kwargs);\n // layout['probe' + axis_number] = axis_config;\n // }\n }\n // xaxis only shows on the bottom most plot\n layout['xaxis']['anchor'] = 'y' + x_anchor;\n\n // Toolbar configuration\n var toolbar = {\n // Disable link to plotly\n 'showLink': false,\n // Don't show plotly logo\n 'displaylogo': false,\n 'displayModeBar': true,\n 'responsive': true\n };\n if (plotsInfo['isLobbyDisplay']) {\n // Prevents first graph from taking up entire width, and other layout problems.\n delete layout['xaxis'];\n // Adjusts graph sizes every time window size is changed.\n toolbar = {responsive: true};\n }\n //creates new graph\n Plotly.plot(div_id, dataCache, layout, toolbar);\n loading.loading();\n}\n\nmodule.exports.initPlot = initPlot;\n","\"use strict\";\nvar ticktext = require('./ticks.js');\nvar utils = require('./utils.js');\n\n/* \n * Build a table in the specified div with a row for each trace in plotsInfo\n * Stores metadata for each trace using $.data, which is retrieved\n * and used by requestTableUpdate\n */\nfunction initTable(div_id, plotOrder, plotsInfo) {\n var div = $('#'+div_id);\n var table = $('<table class=\"met_table\"><tbody></tbody></table>');\n var tbody = table.children('tbody');\n\n var plot_info;\n var plot_key;\n for (var plot_idx=0; plot_idx < plotOrder.length; plot_idx++) {\n plot_key = plotOrder[plot_idx];\n plot_info = plotsInfo.plots[plot_key];\n //extract the necessary variables\n for (var trace_info_idx=0; trace_info_idx < plot_info.traces.length; trace_info_idx++) {\n var trace_info = plot_info.traces[trace_info_idx];\n if(trace_info.type=='contour'){\n add_contour_rows(tbody,plot_key,trace_info_idx,trace_info,plot_info);\n }else{\n var info_td = $('<td>N/A</td>');\n info_td.addClass('met_data');\n info_td.data('info', {key:plot_key,idx:trace_info_idx});\n var row = $('<tr></tr>');\n var name = trace_info.short_name || trace_info.name;\n if (name == 'Wind Direction Card') {\n continue\n }\n row.append('<td>'+name+'</td>');\n row.append(info_td);\n row.append('<td class=\"convert\"></td>');\n tbody.append(row);\n //add rows for our ancillary variables that normally only show up in tags\n if(trace_info.anc_variables)\n add_anc_rows(tbody,plot_key,trace_info_idx,trace_info);\n }\n };\n }\n div.append('<h3>'+plotsInfo.title+'</h3>');\n div.append(table);\n div.append('<span id=\"timestamp\"></span>');\n};\n\nfunction add_anc_rows(tbody,plot_key,idx,trace_info){\n for(var anc_info_idx = 0; anc_info_idx < trace_info.anc_variables.length; anc_info_idx++){\n var anc_info = trace_info.anc_info[trace_info.anc_variables[anc_info_idx]];\n var info_td = $('<td>N/A</td>');\n info_td.addClass('met_data');\n info_td.data('info', {key:plot_key,idx:idx,anc_idx:anc_info_idx});\n var row = $('<tr></tr>');\n var name = anc_info.short_name || anc_info.name;\n row.append('<td>'+name+'</td>');\n row.append(info_td);\n row.append('<td class=\"convert\"></td>');\n tbody.append(row);\n }\n\n}\n\nfunction add_contour_rows(tbody,plot_key,idx,trace_info,plot_info){\n var name = trace_info.short_name||trace_info.name;\n var title_row=('<tr><td colspan=\"2\">'+name+'</td><td></td>');\n tbody.append(title_row);\n for(var hightlight_idx = 0;hightlight_idx< trace_info.y_highlight.length;hightlight_idx++){\n var hightlight_idx_idx = trace_info.y_highlight[hightlight_idx];\n var row = $('<tr></tr>');\n var name = trace_info.y[hightlight_idx_idx] + plot_info.yaxis.units;\n row.append('<td class=\"subtitle text-center\">'+name+'</td>');\n var info_td = $('<td>N/A</td>');\n info_td.addClass('met_data');\n info_td.data('info', {key:plot_key,idx:idx,hl_idx:hightlight_idx_idx});\n row.append(info_td);\n row.append('<td class=\"convert\"></td>');\n tbody.append(row);\n }\n\n}\n\n/*\n * Build a datastream request from the data tags in div_id's existing meteorogram table,\n * then add labels and alternate units based on the axes objects in plotsInfo\n */\nfunction requestTableUpdate(div_id,plotsInfo) {\n var div = $('#'+div_id);\n var varNames = [];\n var plotOrder = [];\n var data_cells = $('#'+div_id+' .met_data');\n var convert_cells = $('#'+div_id+' .convert');\n var varName;\n data_cells.each(function(){\n var key = $(this).data('info').key;\n var trace_idx = $(this).data('info').idx;\n var anc_idx = $(this).data('info').anc_idx;\n var hl_idx = $(this).data('info').hl_idx;\n var trace = plotsInfo.plots[key].traces[trace_idx];\n if(plotOrder.indexOf(key)==-1)\n plotOrder.push(key);\n if(anc_idx !== undefined)\n varName = trace.anc_variables[0];\n else if(hl_idx !== undefined)\n varName = trace.var_names[hl_idx];\n else\n varName = trace.var_names[0];\n if (!varNames.includes(varName))\n varNames.push(varName);\n });\n var stream_string = varNames.join(':'); \n //Use a set time that has both buoy and tower records for testing\n var url = utils.buildRequestUrl('json', '1m', '', '', 'column', '&begin=-00:04:00', stream_string);\n $.ajax({\n type: 'GET',\n url: url,\n jsonp: \"callback\",\n dataType: \"jsonp\",\n success: function(dataObj){\n dataObj.div_id = div_id;\n dataObj.plotOrder = plotOrder;\n dataObj.data_cells = data_cells;\n dataObj.convert_cells = convert_cells;\n updateTable(dataObj,plotsInfo);\n }\n });\n}\n\nfunction updateTable(dataObj,plotsInfo) {\n var data = dataObj.results.data;\n var plot_info;\n var plot_key;\n var td_idx = 0;\n var div_id = dataObj.div_id;\n var plotOrder = dataObj.plotOrder;\n var data_cells = dataObj.data_cells;\n var convert_cells = dataObj.convert_cells;\n if(dataObj.num_results==0){\n $('#'+div_id+' #timestamp').html('No recent data');\n return;\n }\n $('#'+div_id+' #timestamp').html('Last updated: '+ dataObj.results.timestamps[0]);\n for (var plot_idx=0; plot_idx < plotOrder.length; plot_idx++) {\n plot_key = plotOrder[plot_idx];\n plot_info = plotsInfo.plots[plot_key];\n //Fill in a row for each trace in the plot\n for (var trace_info_idx=0; trace_info_idx < plot_info.traces.length; trace_info_idx++) {\n var trace_info = plot_info.traces[trace_info_idx];\n if (trace_info.name == 'Wind Direction Card') {\n continue\n }\n if (trace_info.type=='contour') {\n td_idx=update_contour_cells(data,data_cells,convert_cells,trace_info,td_idx);\n } else {\n var update_val = data[trace_info['var_names'][0]][0];\n if(update_val || update_val==0){\n var units = plot_info.yaxis.units;\n var convert = '';\n var old_precision = plot_info.yaxis.precision;\n plot_info.yaxis.precision=Math.min(old_precision,1);\n var orig_val = ticktext.getTickText([update_val],plot_info.yaxis);\n plot_info.yaxis.precision = old_precision;\n if(plot_info.yaxis2 && plot_info.yaxis2.convert_value != plot_info.yaxis.convert_value){\n var convert_units = plot_info.yaxis2.units;\n var old_precision = plot_info.yaxis2.precision;\n plot_info.yaxis2.precision= Math.min(old_precision,1);\n var convert_val = ticktext.getTickText([update_val],plot_info.yaxis2);\n plot_info.yaxis2.precision = old_precision;\n convert = convert_val+convert_units;\n }\n data_cells[td_idx].innerHTML=orig_val+units;\n convert_cells[td_idx].innerHTML=convert;\n } else {\n data_cells[td_idx].innerHTML='N/A';\n convert_cells[td_idx].innerHTML='';\n }\n td_idx+=1;\n //Fill in a row for each anc_var in the plot\n if (trace_info.anc_variables) {\n td_idx=update_anc_cells(data,data_cells,trace_info,td_idx);\n }\n }\n }\n }\n}\n\n\nfunction update_contour_cells(data,data_cells,convert_cells,trace_info,td_idx){\n for(var hightlight_idx = 0;hightlight_idx< trace_info.y_highlight.length;hightlight_idx++){\n var hightlight_idx_idx = trace_info.y_highlight[hightlight_idx];\n var update_val = data[trace_info['var_names'][hightlight_idx_idx]][0];\n var units = trace_info.zprobe.units;\n var orig_val = ticktext.getTickText([update_val],trace_info.zprobe);\n var convert = '';\n if(trace_info.zprobe2 && trace_info.zprobe2.convert_value){\n var convert_units = trace_info.zprobe2.units;\n var convert_val = ticktext.getTickText([update_val],trace_info.zprobe2);\n convert = convert_val+convert_units;\n }\n data_cells[td_idx].innerHTML=orig_val+units;\n convert_cells[td_idx].innerHTML=convert;\n td_idx+=1;\n }\n return td_idx;\n}\n\nfunction update_anc_cells(data,data_cells,trace_info,td_idx){\n for(var anc_info_idx = 0; anc_info_idx < trace_info.anc_variables.length; anc_info_idx++){\n var anc_key = trace_info.anc_variables[anc_info_idx];\n var anc_info = trace_info.anc_info[anc_key];\n var update_val = data[anc_key][0];\n var orig_val = ticktext.getTickText([update_val],anc_info);\n if(update_val || update_val==0)\n data_cells[td_idx].innerHTML=orig_val+anc_info.units;\n else\n data_cells[td_idx].innerHTML='N/A';\n td_idx+=1;\n }\n return td_idx;\n}\nmodule.exports.initTable = initTable; \nmodule.exports.requestTableUpdate = requestTableUpdate; \n","var _ = require('underscore');\n\n// Add string formatting if it doesn't exist\nif (!String.prototype.format) {\n String.prototype.format = function() {\n var args = arguments;\n return this.replace(/{(\\d+)}/g, function(match, number) {\n return typeof args[number] != 'undefined'\n ? args[number]\n : match\n ;\n });\n };\n}\n\nfunction getWaterTempProbe(data, plotInfo, traceInfo, allData) {\n var allProbeText = [];\n var probeText;\n var row, col;\n var rowText;\n var depth;\n for (var j=0; j < data.length; j++) {\n row = data[j];\n rowText = [];\n depth = traceInfo.y[j];\n for (var i=0; i < row.length; i++) {\n col = row[i];\n\n probeText = \"Depth: {0}m<br>{1}: {2} °C ({3} °F)\".format(\n depth.toFixed(1),\n traceInfo.name,\n col !== null ? col.toFixed(3) : \"N/A\",\n col !== null ? getF(col).toFixed(3) : \"N/A\");\n rowText.push(probeText);\n }\n allProbeText.push(rowText);\n }\n return allProbeText;\n}\n\nfunction getSpeedMPH(val) {\n // convert m/s to mph\n return val * 3600 / 1608;\n}\nfunction getSpeedKTS(val) {\n //m/s to knots\n return val * 1.94384;\n}\n\n\nfunction getPresInHg(val) {\n // hPa to InHg\n return val * 0.02952998751;\n}\n\n\nfunction getAccumMillimeter(val) {\n // convert inches to millimeters\n return val * 25.4;\n}\n\n\nfunction cardinalWDir(degrees){\n \n return ['N','NNE','NE','ENE',\n 'E','ESE','SE','SSE',\n 'S','SSW','SW','WSW',\n 'W','WNW','NW','NNW'][Math.floor(((degrees+11.25)%360)/22.5)];\n}\n// Convert C to F degrees\nfunction getF(val) {\n return val * 1.8 + 32;\n}\n\nfunction getVal(val) {\n return val;\n}\n\n\nvar CONVERSION_FUNCTIONS = {\n null: getVal,\n undefined: getVal,\n getF: getF,\n getPresInHg: getPresInHg,\n getSpeedMPH: getSpeedMPH,\n getAccumMillimeter: getAccumMillimeter,\n cardinalWDir: cardinalWDir,\n getSpeedKTS:getSpeedKTS\n};\n\n\n\nfunction formatValue(val, plotInfo, traceInfo) {\n var val2;\n if (val === null) {\n val = \"\";\n val2 = \"\";\n } else {\n if ('yaxis2' in plotInfo && 'convert_value' in plotInfo.yaxis2) {\n val2 = CONVERSION_FUNCTIONS[plotInfo.yaxis2.convert_value](val);\n val2 = (val2.toFixed)?val2.toFixed(plotInfo.yaxis2.precision):val2;\n } else {\n val2 = undefined;\n }\n val = CONVERSION_FUNCTIONS[plotInfo.yaxis.convert_value](val);\n val=(val.toFixed)?val.toFixed(plotInfo.yaxis.precision):val;\n }\n\n if ('yaxis2' in plotInfo && val2 !== undefined) {\n return \"{0}: {1}{2} ({3}{4})\".format(\n traceInfo.name,\n val, plotInfo.yaxis.units,\n val2, plotInfo.yaxis2.units);\n } else {\n return \"{0}: {1}{2}\".format(\n traceInfo.name,\n val, plotInfo.yaxis.units);\n }\n}\n\nfunction getDewpointProbe(data, plotInfo, traceInfo, allData) {\n var allProbeText = [];\n var probeText;\n var relHum = undefined;\n if ('anc_variables' in traceInfo && traceInfo.anc_variables.length == 1) {\n relHum = allData[traceInfo.anc_variables[0]];\n }\n var rh_info = traceInfo.anc_info[traceInfo.anc_variables[0]];\n if(!rh_info)\n rh_info={ name: traceInfo.anc_variables[0], units: '', precision: 2};\n\n for (var i=0; i < data.length; i++) {\n probeText = formatValue(data[i], plotInfo, traceInfo);\n if (relHum !== undefined) {\n probeText += \"<br>{0}: {1}{2}\".format(rh_info.name,\n relHum[i] ? relHum[i].toFixed(rh_info.precision) : \"\",\n rh_info.units);\n }\n allProbeText.push(probeText);\n }\n return allProbeText;\n}\n\n\nfunction defaultProbeText(data, plotInfo, traceInfo, allData) {\n // assume traces share the same 'x'\n var allProbeText = [];\n for (var i=0; i < data.length; i++) {\n allProbeText.push(formatValue(data[i], plotInfo, traceInfo));\n }\n return allProbeText;\n}\n\n\nvar PROBE_TEXT_FUNCTIONS = {\n undefined: defaultProbeText,\n null: defaultProbeText,\n dewpoint: getDewpointProbe,\n water_temp: getWaterTempProbe,\n};\n\n\nfunction getProbeText(data, plotInfo, traceInfo, allData) {\n if ('probe_text' in traceInfo) {\n return PROBE_TEXT_FUNCTIONS[traceInfo.probe_text](data, plotInfo, traceInfo, allData);\n }\n return defaultProbeText(data, plotInfo, traceInfo, allData);\n}\n\n\nfunction getTickText(values, axis_info) {\n var tickText = [];\n for (var i=0; i < values.length; i++) {\n var val = CONVERSION_FUNCTIONS[axis_info.convert_value](values[i]);\n val = (val.toFixed)?val.toFixed(axis_info.precision):val;\n tickText.push(val);\n }\n return tickText;\n}\n\n\n/**\n* the purpose of this method is to get the spacing for the y axis\n* For deg F and deg C\n* @param min - minimum of the temp or dew point array\n* @param max - maximum of the temp or dew point array\n* @return array of 4 tick values for the y axis\n*/\n\nfunction getTickVals(min, max, bump) {\n var extra = (max - min) * 0.02;\n min = min - extra;\n max = max + extra;\n var step = (max - min) / 4.;\n //create 4 tick values for the y axis\n return _.range(min, max + step, step);\n}\n\n\nmodule.exports.getTickVals = getTickVals;\nmodule.exports.getProbeText = getProbeText;\nmodule.exports.getTickText = getTickText;\n\n\n\n\n","var Plotly = require('Plotly');\nvar ticktext = require('./ticks.js');\nvar _ = require('underscore');\n\n\nfunction removeOldPoints(dataCache, removeCount) {\n for (var i = 0; i < dataCache.length; i++) {\n dataCache[i].x.splice(0, removeCount);\n\n if (dataCache[i].hasOwnProperty('z')) {\n for (var j = 0; j < dataCache[i].z.length; j++) {\n dataCache[i].z[j].splice(0, removeCount);\n }\n } else if (dataCache[i].hasOwnProperty('y')) {\n // delete things from y *only* if we don't have a Z\n dataCache[i].y.splice(0, removeCount);\n }\n if (dataCache[i].hasOwnProperty('text')) {\n dataCache[i].text.splice(0, removeCount);\n }\n }\n}\n\n\nfunction updateHeader(dataCache, unitCount, layoutUpdates) {\n // Note: curr_date is 2 minutes behind the current time.\n var curr_date = new Date(dataCache[0]['x'][dataCache[0]['x'].length - 1]);\n var hour = Number(curr_date.toLocaleString(\"en-US\", {hour: 'numeric', 'hour12': false}));\n // Make the screen go black between 1 and 5 am.\n if (0 < hour && hour < 5) {\n document.getElementById(\"overlay\").style.opacity = 1;\n } else {\n document.getElementById(\"overlay\").style.opacity = 0;\n }\n var date_local = curr_date.toLocaleString(\"en-US\",\n { year: 'numeric', month: 'short', day: 'numeric',\n hour: 'numeric', minute: 'numeric', second: 'numeric' }).replace(/,([^,]*)$/, '$1');\n var utcMonth = Number(curr_date.getUTCMonth());\n utcMonth = utcMonth < 9 ? '0' + (utcMonth + 1) : utcMonth + 1;\n var utcDay = Number(curr_date.getUTCDate()) < 9 ? '0' + curr_date.getUTCDate() : curr_date.getUTCDate();\n var utcMinutes = Number(curr_date.getUTCMinutes()) < 9 ? '0' + curr_date.getUTCMinutes() : curr_date.getUTCMinutes();\n var utcSeconds = Number(curr_date.getUTCSeconds()) < 9 ? '0' + curr_date.getUTCSeconds() : curr_date.getUTCSeconds();\n var date_utc = curr_date.getUTCFullYear() + '-' + utcMonth + '-' + utcDay + ' ' +\n curr_date.getUTCHours() + ':' + utcMinutes + ':' + utcSeconds;\n var elevation = unitCount == 0 ? '327.5 meters' : '1074.5 feet';\n layoutUpdates['annotations.1.text'] = 'Data last recorded at: ' + date_utc + 'Z [' + date_local + ' Local] RIG Elevation = ' + elevation;\n}\n\n\n\nfunction changeCamera() {\n var directions = {'north': 'east', 'east': 'south', 'south': 'west', 'west': 'north',};\n // Gets witch direction the current camera is showing.\n var newDirection = directions[document.getElementById('roofCam').src.split('/')[7]];\n // Default to North on first load.\n newDirection = newDirection ? newDirection : 'north';\n // Makes image update. Image updates every (about) 2 minutes and 15 seconds.\n document.getElementById('roofCam').alt = document.getElementById('dirText').innerHTML = newDirection;\n document.getElementById('roofCam').src = METOBS_API_URL + '/pub/cache/aoss/cameras/' + newDirection +\n '/latest_medium.jpg';\n}\n\n\nfunction changeUnits(dataCache, graphDiv, plotsInfo, unitCount) {\n // Note: unitCount alternates between 0 and 1.\n var plotName;\n var plotInfo;\n var currData;\n var tick_dates;\n // This changes the graphDiv y-axis we are getting.\n var axis_number;\n // This changes the plotInfo y-axis we are getting, which switches between units every time changeUnits is called.\n var yaxis = unitCount == 0 ? 'yaxis' : 'yaxis2';\n var converted_tickvals;\n var tickvals;\n var layoutUpdates = {};\n updateHeader(dataCache, unitCount, layoutUpdates);\n // Update each subgraph's displayed y-axis and current data values.\n for (var i = 0; i < dataCache.length; i++) {\n axis_number = i == 0 ? '' : i + 1;\n tick_dates = dataCache[i]['x'];\n // Prevents '-6h' from falling off x-axis.\n layoutUpdates['xaxis' + axis_number + '.tickvals'] = [ tick_dates[0], tick_dates[Math.round(tick_dates.length / 2)], tick_dates[tick_dates.length - 1]]\n plotName = dataCache[i].plot_name;\n plotInfo = plotsInfo.plots[plotName];\n // Convert data to the correct units.\n currData = ticktext.getTickText([dataCache[i]['y'][dataCache[i]['y'].length - 1]], plotInfo[yaxis])[0];\n layoutUpdates['annotations[' + (3 + 2 * i) + '].text'] = currData + '' + plotInfo[yaxis]['units']\n tickvals = graphDiv.layout['yaxis' + axis_number]['tickvals']\n if (tickvals != undefined) {\n // Relative Humidity and Wind Direction ticktext and tickvals are static from site_configs_lobby.js.\n if (plotName == 'wind_direction' || plotName == 'rel_hum') {\n converted_tickvals = plotInfo[yaxis]['ticktext'];\n } else {\n converted_tickvals = [];\n for (var j = 0; j < tickvals.length; j++) {\n converted_tickvals.push(ticktext.getTickText([tickvals[j]], plotInfo[yaxis]))\n }\n }\n layoutUpdates['yaxis' + axis_number + '.ticktext'] = converted_tickvals;\n }\n }\n // Updates everything at once to save time.\n Plotly.relayout(graphDiv, layoutUpdates);\n changeCamera();\n}\n\n\nfunction fitGraphs(dataCache, data, var_name, layoutUpdates, yaxis, defaultTickVals) {\n // Set the range of each graph if applicable.\n if (var_name != 'aoss.tower.rel_hum' && var_name != 'aoss.tower.wind_direction') {\n // data only contains new data. Thus we must keep track of old mins/maxs.\n if (dataCache['y'].length == 0) {\n // dataCache['y'] gets overridden somewhere.\n dataCache.yMin = Math.min(...data)\n dataCache.yMax = Math.max(...data)\n } else {\n dataCache.yMin = Math.min(...data, dataCache.yMin)\n dataCache.yMax = Math.max(...data, dataCache.yMax)\n }\n\n var spread = dataCache.yMax - dataCache.yMin;\n var bottom = dataCache.yMin - spread;\n var top = var_name == 'aoss.tower.solar_flux' ? dataCache.yMax : dataCache.yMax + spread;\n // Make graph visible if flat line: Add a margin equal to 10% of the value if non-zero, else scale from 0 to 1.\n if (spread == 0) {\n // Note: top == bottom since spread == 0.\n if (top > 0) {\n top = top * 1.1\n bottom = bottom * .9\n } else if (top < 0) { // Only applies to air_temp and dewpoint.\n top = top * .9\n bottom = bottom * 1.1\n } else { // Mainly for precipitation.\n top = .1\n bottom = -.1\n }\n }\n // Used to lower bottom so that the graph can be seen if it is 0.\n var tick0 = bottom\n // If bottom < 0: Make the bottom 0 since values cannot be negative,\n // and lower the bottom to see 0.\n if (var_name != 'aoss.tower.air_temp' && var_name != 'aoss.tower.dewpoint' && bottom <= 0) {\n bottom = 0;\n tick0 = 0;\n }\n // Shifts the bottom down so that tick0 doesn't overlap xaxis ticks, and graphs near zero can be seen.\n bottom -= .075 * spread + .001;\n layoutUpdates[yaxis + '.tickvals'] = [tick0, tick0 + (top - tick0) / 4, tick0 + 2 * (top - tick0) / 4,\n tick0 + 3 * (top - tick0) / 4, top]\n layoutUpdates[yaxis + '.range'] = [bottom, top]\n } else {\n layoutUpdates[yaxis + '.tickvals'] = defaultTickVals\n }\n // layoutUpdates is changed without having to return it.\n}\n\n\nfunction replaceData(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints) {\n var dates = dataObj.dates;\n var plotName;\n var plotInfo;\n var i;\n var probeText;\n var plotHandled = [];\n var forceRedraw = false;\n\n // scatter updates\n var tracesToExtend = [];\n var extendData = {\n x: [],\n y: [],\n text: [],\n };\n\n // contour updates\n var newContourData;\n var contourTracesToExtend = [];\n var contourExtendData = {\n x: [],\n z: [],\n text: [],\n };\n\n var traceIndex = 0;\n\n // Variables used for lobby display.\n var layoutUpdates = {};\n var axis_number;\n /**\n *\n * If we are updating the plots instead of replacing them, then try\n * to use plotly's extendTraces to update the x and y coordinates as well\n * the hovering probe text. This should only add new trace points instead\n * of updating all points.\n *\n * Since we passed 'dataCache' to plotly's 'plot' function during\n * initialization any changes to 'dataCache' should be mirrored in Plotly's\n * plot and vice versa. See the below stackoverflow question for details.\n * https://stackoverflow.com/questions/45759582/plotly-how-to-discard-older-points\n * This is important since we use `.shift()` on the data arrays to remove\n * \"old\" elements.\n *\n * We have to operate per-plot because some of our plots hover/probe labels\n * use the trace values to come up with one probe box\n * (air temp + dewpoint -> relative humidity).\n *\n */\n for (i = 0; i < dataCache.length; i++) {\n plotName = dataCache[i].plot_name;\n if (plotHandled[plotHandled.length - 1] == plotName) {\n // this happens when there are more than one trace in a plot\n continue;\n }\n plotInfo = plotsInfo.plots[plotName];\n _.each(plotInfo.traces, function (traceInfo, index) {\n\n if (dataCache[traceIndex + index].type == 'contour') {\n // push new dates for each trace to be extended\n contourExtendData.x.push(dates);\n contourTracesToExtend.push(traceIndex + index);\n // update the Z data instead of the traditional 'y' data\n // assumes Y doesn't update between calls\n newContourData = _.map(traceInfo.var_names, function(var_name) {return dataObj[var_name];});\n dataCache[i].text.push(...ticktext.getProbeText(newContourData, plotInfo, traceInfo, dataObj));\n for (var j = 0; j < traceInfo.var_names.length; j++) {\n while (j >= dataCache[i].z.length) {\n dataCache[i].z.push([]);\n }\n dataCache[i].z[j].push(...dataObj[traceInfo.var_names[j]]); // ES6-style push\n }\n contourExtendData.z.push(dataCache[i].z);\n contourExtendData.text.push(dataCache[i].text);\n // If plotly could handle extendTraces in the x-dimension we'd\n // probably do something like this:\n // newContourData = _.map(traceInfo.var_names, function(var_name) {return dataObj[var_name];});\n // contourExtendData.z.push(newContourData);\n // contourExtendData.text.push(\n // [ticktext.getProbeText(newContourData, plotInfo, traceInfo, dataObj)]\n // );\n } else {\n // push new dates for each trace to be extended\n extendData['x'].push(dates);\n tracesToExtend.push(traceIndex + index);\n // scatter plots, assume the y data is the data being updated\n _.each(traceInfo.var_names, function (var_name) {\n if (plotsInfo['isLobbyDisplay']) {\n axis_number = i == 0 ? '': i + 1;\n fitGraphs(dataCache[i], dataObj[var_name], var_name, layoutUpdates, 'yaxis' + axis_number, plotInfo['yaxis2']['tickvals'])\n }\n // push the entire new data array as one element to update\n extendData.y.push(dataObj[var_name]);\n\n // Get new probe text shown when hovering over the traces\n if ('probe_text' in traceInfo && traceInfo['probe_text'] === null) {\n // we don't want probe text for this trace\n probeText = [undefined];\n } else {\n probeText = ticktext.getProbeText(dataObj[var_name], plotInfo, traceInfo, dataObj);\n }\n extendData.text.push(probeText);\n });\n }\n });\n traceIndex += plotInfo.traces.length;\n plotHandled.push(plotName);\n }\n\n // Have plotly update the graph with the new points in extendData\n // This will add data to 'dataCache' because of how we originally\n // created the plots.\n if (tracesToExtend.length > 0) {\n Plotly.extendTraces(graphDiv, extendData, tracesToExtend);\n }\n if (contourTracesToExtend.length > 0) {\n Plotly.extendTraces(graphDiv, contourExtendData, contourTracesToExtend);\n // we are currently cheating and re-adding every \"row\" of data because\n // plotly doesn't support extendTrace'ing in the x-dimension\n // we want to remove the previous \"depth\" amount of rows\n for (i = 0; i < contourTracesToExtend.length; i++) {\n dataCache[contourTracesToExtend[i]].z.splice(0, dataCache[contourTracesToExtend[i]].y.length);\n dataCache[contourTracesToExtend[i]].text.splice(0, dataCache[contourTracesToExtend[i]].y.length);\n }\n }\n\n if (maxPoints == 0 && !update) {\n // we aren't doing realtime updates and the caller wants us to remove\n // all previous points and keep all new points\n maxPoints = dataObj.dates.length;\n // we have to force a redraw of the plot because the removed plots\n // will still exist on the the graph otherwise (until the next update)\n forceRedraw = true;\n }\n // If adding these new points gave us more points than we need\n // remove the points at the beginning of our data\n if (maxPoints > 0 && dataCache[0]['x'].length > maxPoints) {\n removeOldPoints(dataCache, dataCache[0].x.length - maxPoints);\n }\n\n // If lobby display and data to update.\n if (Object.keys(layoutUpdates).length != 0) {\n // Updates everything at once to save time. Should be done after all dataCache manipulations.\n Plotly.relayout(graphDiv, layoutUpdates);\n // The first time through, call changeUnits to display current data.\n if (!update) {\n changeUnits(dataCache, graphDiv, plotsInfo, 0);\n }\n }\n if (forceRedraw) {\n Plotly.redraw(graphDiv);\n }\n}\n\n\nfunction updatePlot(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints) {\n replaceData(dataCache, graphDiv, plotsInfo, dataObj, update, maxPoints);\n}\n\nmodule.exports.updatePlot = updatePlot;\nmodule.exports.changeUnits = changeUnits;\n","\"use strict\";\n\nfunction buildRequestUrl(format, interval, epoch, sep, order, time, streams) {\n var request_url = METOBS_API_URL+'/api/data.'+format+'?';\n request_url += 'interval='+interval;\n request_url += '&epoch='+epoch;\n request_url +='&sep='+sep || ',';\n request_url += '&order='+order;\n request_url+=time;\n request_url+='&symbols='+streams;\n return request_url;\n}\n\nmodule.exports.buildRequestUrl = buildRequestUrl;\n","const checkboxTemplates = {\n 'aoss.tower': '<div class=\"form-group\">'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"temp\">Temperature + Dewpoint'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"pres\">Pressure'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wS\">Wind Speed'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wD\">Wind Direction'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"aP\">Precipitation'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"sF\">Solar Flux'+\n '</label>'+\n '</div>',\n 'mendota.buoy': '<div class=\"form-group\">'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"temp\">Temperature + Dewpoint'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"rh\">Relative Humidity'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wS\">Wind Speed'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"wD\">Wind Direction'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"chlor\">Chlorophyll'+\n '</label>'+\n '<label class=\"form-check-label\">'+\n '<input type=\"checkbox\" class=\"form-check-input\" checked id=\"phyco\">Phycocyanin'+\n '</label>'+\n '</div>'\n};\n\nconst controlPanelTemplate = '<div class=\"row\" id=\"control-panel-row\">'+\n'<div id=\"show-hide-boxes\" class=\"col-md-12\">'+\n'</div>'+\n'<div class = \"col-md-9\">'+\n'<div class=\"row\" style=\"padding: 0 1em;\">'+\n'<div class=\"form-group\">'+\n'<table style=\"width:100%\">'+\n'<tr>'+\n'<td>'+\n'<div class=\"radio\">'+\n'<label><input type=\"radio\" id=\"last_x_days\" name=\"time_select\">'+\n'Recent Data:'+\n'</label>'+\n'</div>'+\n'</td>'+\n'<td>'+\n'<select class=\"form-control\" id=\"dropDownId\">'+\n'<option selected value=\"realtime\">Realtime Update</option>'+\n'<option value=\"-1:00:00\">Past 1 Hour</option>'+\n'<option value=\"-2:00:00\">Past 2 Hours</option>'+\n'<option value=\"-3:00:00\">Past 3 Hours</option>'+\n'<option value=\"-6:00:00\">Past 6 Hours</option>'+\n'<option value=\"-12:00:00\">Past 12 Hours</option>'+\n'<option value=\"-18:00:00\">Past 18 Hours</option>'+\n'<option value=\"-24:00:00\">Past 24 Hours</option>'+\n'<option value=\"-96:00:00\">Past 4 Days</option>'+\n'</select>'+\n'</td>'+\n'<td style=\"padding-left:.5em\">'+\n'<div class=\"radio\">'+\n'<label><input type=\"radio\" id=\"date_range\" name=\"time_select\">'+\n'Date Range:'+\n'</label>'+\n'</div>'+\n'</td>'+\n'<td>'+\n'<input class=\"form-control\" style=\"padding 0.5em 0;\" id=\"Start-date-picker\" type=\"text\" placeholder=\"YYYY-MM-DD\"/>'+\n'</td>'+\n'<td>to </td>'+\n'<td>'+\n'<input class=\"form-control\" style=\"padding 0.5em 0;\" id=\"End-date-picker\" type=\"text\" placeholder=\"YYYY-MM-DD\"/>'+\n'</td>'+\n'<td>'+\n'<button class=\"btn btn-primary btn-block\" id=\"plot-btn\">Plot</button>'+\n'</td>'+\n'</tr>'+\n'</table>'+\n'</div>'+\n'</div>'+\n'</div>'+\n'</div>'\n;\nmodule.exports = {\n controlPanelTemplate:controlPanelTemplate,\n checkboxTemplates:checkboxTemplates\n}\n","\"use strict\";\n\n//var $ = require('jquery');\n//var jQuery = require('jquery');\n\nvar loading = require('./loading.js');\nconst controlPanelTemplate = require('./button_template.js');\n\n/**\n* The purpose of this method is to tell dispatcher\n* Oh, please check if user's entering stuff correctly\n*\n* no params\n* no returns\n*/\n\nfunction dispatchCustom(dispatcher)\n{\n dispatcher.dispatch({\n status:'get_between_dates',\n 'emit':'plotEmitter',\n 'start':$('#Start-date-picker').val().split(' ').join('T')+':00',\n 'end':$('#End-date-picker').val().split(' ').join('T')+':00',\n 'interval':'auto',\n });\n}\n\n\n/**\n* The purpose of this method is to send dispatcher user information\n*\n* no params\n* no returns\n*/\n\nfunction getUserInfo(dispatcher)\n{\n //show gif\n loading.loading();\n\n //get the information from the text boxes\n var startDate = $('#Start-date-picker').val();\n var endDate = $('#End-date-picker').val();\n var startTime = $('#Start-time-picker').val();\n var endTime = $('#End-time-picker').val();\n var interval = $('#interval option:selected');\n var intervalVal = interval.data(\"name\");\n\n //store in user info\n var userInfo = {'startDate' : startDate,\n 'startTime' : startTime,\n 'endDate': endDate,\n 'endTime': endTime,\n 'interval': intervalVal};\n\n //send to dispatcher\n setTimeout(function() {dispatch.dispatch({status: 'plot_custom', 'emit': 'plotEmitter', 'userInfo': userInfo});}, 200); \n}\n\n\n/**\n* The purpose of this method is to tell dispatcher, time to check if we need to update\n*\n* no params\n* no returns\n*/\n\nfunction dispatchUpdate(dispatcher)\n{\n dispatcher.dispatch({'status': 'update', 'emit': 'plotEmitter'});\n}\n\n/**\n* The purpose of this method is to figure out what the user wants to do based upon\n* what the user selects on the task dropdown\n*\n* no params\n* no returns\n*/\n\nfunction dropDown(selectedText, dispatcher) {\n if (selectedText == 'realtime') {\n dispatcher.dispatch({\n status:'get_since_now',\n 'emit':'plotEmitter',\n 'time':'-3:00:00'\n });\n\n } else {\n var timeDelta = selectedText;\n dispatcher.dispatch({\n status:'get_since_now',\n 'emit':'plotEmitter',\n 'time':selectedText\n });\n }\n}\n\nvar bind_daterange_actions = function(jQ_div,dispatcher){\n //bind to custom buttons and dropdowns\n $(jQ_div+' #plot-btn').click(function(){dispatchCustom(dispatcher)});\n $(jQ_div+' #dropDownId').change(function(){dropDown($(this).val(),dispatcher)});\n}\nvar set_active_form = function(which_block,jQ_div){\n $(jQ_div+\" #dropDownId\").prop(\"disabled\",which_block!=\"recent\");\n\n $(jQ_div+\" #interval\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #Start-date-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #End-date-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #Start-time-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #End-time-picker\").prop(\"disabled\",which_block!=\"range\");\n $(jQ_div+\" #plot-btn\").prop(\"disabled\",which_block!=\"range\");\n}\n\nvar set_form_datepickers = function(jQ_div){\n $(jQ_div+' #Start-date-picker').datetimepicker({\n changeMonth: true, \n changeYear: true,\n dateFormat:'yy-mm-dd',\n timeFormat:'HH:mm',\n showSecond:false,\n showMillisec:false,\n showMicrosec:false\n });\n\n $(jQ_div+' #End-date-picker').datetimepicker({\n changeMonth: true, \n changeYear: true,\n dateFormat:'yy-mm-dd',\n timeFormat:'HH:mm',\n showSecond:false,\n showMillisec:false,\n showMicrosec:false\n });\n\n //bind the enabling/disabling of forms to radio buttons\n $(jQ_div+' [type=text]').prop(\"disabled\",true);\n $(jQ_div+' select').prop(\"disabled\",true);\n $(jQ_div+\" #last_x_days\").click(function(){\n set_active_form(\"recent\",jQ_div);\n });\n $(jQ_div+\" #date_range\").click(function(){\n set_active_form(\"range\",jQ_div);\n });\n //$('#Start-time-picker').editableSelect();\n //$('#End-time-picker').editableSelect();\n //add placeholder values for the order forms \n //$('#Start-date-picker').attr('placeholder',moment.utc().subtract(5,'days').format('YYYY-MM-DD'));\n //$('#End-date-picker').attr('placeholder',moment.utc().format('YYYY-MM-DD'));\n //Firefox (+others maybe) keep buttons selected on page reload\n //enable the currrently selected one's field\n $(jQ_div+\" #last_x_days\").trigger('click');\n\n};\n\nvar setup_all_forms = function(div,plot_div,dispatcher){\n var jQ_div = '#'+div;\n set_form_datepickers(jQ_div,plot_div);\n bind_daterange_actions(jQ_div,dispatcher);\n}\n\nfunction buildFormInDiv(div, plot_div,dispatcher) {\n $('#'+div).append(controlPanelTemplate.controlPanelTemplate);\n //$('#'+div+ \" #show-hide-boxes\").append(controlPanelTemplate.checkboxTemplates[site]);\n setup_all_forms(div,plot_div,dispatcher);\n}\n$(document).ready(function(){\n //Hide all form errors initially\n //Set up the date range inputs as datepicker objects\n});\n\nmodule.exports = buildFormInDiv;\n","\"use strict\";\n//var $ = require('jquery');\n\n/**\n* The purpose of this function is to either hide the graph and show the loading\n* spinner or to hide the loading spinner and show the graph\n* no parameters or returns\n*/\n\nfunction loading()\n{\n return;\n //$(\"#progress\").toggle();\n //$(\"#graph\").toggle();\n}\n\n/**\n* The point of this method is to disable the custom area of the meteorogram\n* header\n*\n* no params\n* no returns\n*/\n\nfunction disable()\n{\n\t//disable custom rows\n\t$('#Start-date-picker').prop(\"disabled\", true);\n\t$('#Start-time-picker').prop(\"disabled\", true);\n\t$('#End-date-picker').prop(\"disabled\", true);\n\t$('#End-time-picker').prop(\"disabled\", true);\n\t$('#interval').prop(\"disabled\", true);\n\t$('#Plot').prop(\"disabled\", true);\n}\n\n/**\n* The purpose of this method is to enable the custom area of the meteorogram\n* header\n*\n* no params\n* no returns\n*/\n\nfunction enable()\n{\n\t//enable custom rows\n\t$('#Start-date-picker').prop(\"disabled\", false);\n\t$('#Start-time-picker').prop(\"disabled\", false);\n\t$('#End-date-picker').prop(\"disabled\", false);\n\t$('#End-time-picker').prop(\"disabled\", false);\n\t$('#interval').prop(\"disabled\", false);\n}\n\n/**\n* The purpose of this function is to take a date string and a time string and turn that\n* into a date JS object\n*\n* @param dateString - \"MM/DD/YYYY\"\n* @param timeString - \"HH-MM-SS\"\n* @return date object\n*/\n\nfunction getDate(dateString, timeString)\n{\n\t//get date string\n\tvar year = parseInt(dateString.substring(6,10));\n\tvar month = parseInt(dateString.substring(0,3));\n\tvar day = parseInt(dateString.substring(3,5));\n\tvar hour = parseInt(timeString.substring(0,2));\n\tvar minute = parseInt(timeString.substring(3,5));\n\tvar seconds = parseInt(timeString.substring(6,8));\n\n //return date variable\n var date = new Date(year, month, day, hour, minute, seconds);\n\n return date;\n}\n\n/**\n* The purpose of this method is to make sure each field is valid and does\n* not result in too much or too less data points being plotted\n* @param start date - the date the user wants to start at\n* @param time user wants to start at\n* @param end Date - the date user wants to stop at\n* @param end Time - the time the user wants to stop at\n* @param interval - how many seconds averaged does the user want\n* no returns\n*/\n\n/**\n* The purpsoe of this method is to enable the plot button\n*\n* no params\n* no returns\n*/\n\nfunction enablePlot()\n{\n\t//enable plot button\n\t$('#Plot').prop(\"disabled\", false);\n}\n\n/**\n* The purpose of this method is to disable the plot button\n*\n* no params\n* no returns\n*/\n\nfunction disablePlot()\n{\n\t//disable plot button\n\t$('#Plot').prop(\"disabled\", true);\n}\n\nfunction checkFields(startDate, endDate, startTime, endTime, interval)\n{\n\t//get user information from selected drop down\n\tvar selected = $('#interval option:selected');\n\n //give user time to fill out other fields\n\tif(selected.text() == '--');\n\n\telse\n\t{\n\t\t//get information to create a message to the user saying approx how many pts\n\t\t//they are plotting\n var start = getDate(startDate, startTime);\n var end = getDate(endDate, endTime);\n var selected = $('#interval option:selected');\n var diff = (end - start)/1000;\n var intervalVal = selected.data(\"seconds\");\n diff = Math.floor(diff/intervalVal);\n var points = diff/interval;\n\n //if too few points, tell user\n if(diff >= 0 && diff < 60)\n {\n \t$('#prompt_user').html('a ' + selected.text() + ' interval would plot about ' + diff.toString() \n \t\t + ' data points; that\\'s too few - please try again');\n\t\t\t$('#default').attr('selected', 'selected');\n\t\t\tdisablePlot();\n }\n\n //if the user accidentally mixed up start and end dates, politely tell them\n else if(diff < 0)\n {\n \t$('#prompt_user').html('The end date is before the start date. Please choose a later end date.');\n\t\t\t$('#default').attr('selected', 'selected');\n }\n\n //if too many points, tell user\n else if(diff > 1000)\n {\n \t$('#prompt_user').html('a ' + selected.text() + ' interval would plot about '\n \t\t+ diff.toString() + ' data points; that\\'s too many - please try again');\n\t\t\t$('#default').attr('selected', 'selected');\n\t\t\tdisablePlot();\n }\n\n //else we enable the plot button and tell user how many points they're plotting\n else\n {\n \t$('#prompt_user').html('a ' + selected.text() + ' interval would plot about '\n \t\t+ diff.toString() + ' data points.');\n\n\t\t\tenablePlot();\n }\n\n\t}\n}\n\n/**\n* The purpose of this method is to make sure all the fields and intervals selected are valid\n*\n* No parameters\n* No returns\n*/\n\nfunction checkInterval()\n{\n\tvar startDate = $('#Start-date-picker').val();\n\tvar endDate = $('#End-date-picker').val();\n\tvar startTime = $('#Start-time-picker').val();\n\tvar endTime = $('#End-time-picker').val();\n\tvar interval = $('#interval');\n\n\t//get user information from selected drop down\n\tvar selected = $('#interval option:selected');\n\n //check if any fields are not filled out\n\tif((!startDate || !endDate || !startTime || !endTime) && selected.text() != '--')\n\t{\n\t\t$('#prompt_user').html('Please fill out all other fields before filling out the interval field');\n\t\t$('#default').attr('selected', 'selected');\n\t}\n\n //check to see if fields are ok\n\tcheckFields(startDate, endDate, startTime, endTime, interval);\n}\n\nmodule.exports.loading = loading;\nmodule.exports.disable = disable;\nmodule.exports.enable = enable;\nmodule.exports.checkInterval = checkInterval;\n","module.exports = Plotly;"],"sourceRoot":""} \ No newline at end of file diff --git a/content/js/meteorogram/plot/update.js b/content/js/meteorogram/plot/update.js index 990112325b70eb09c27749445cbb8d43968e539f..3cb54609d002d3b18ea867af366271c159c0bd23 100644 --- a/content/js/meteorogram/plot/update.js +++ b/content/js/meteorogram/plot/update.js @@ -47,15 +47,19 @@ function updateHeader(dataCache, unitCount, layoutUpdates) { } - function changeCamera() { var directions = {'north': 'east', 'east': 'south', 'south': 'west', 'west': 'north',}; // Gets witch direction the current camera is showing. var newDirection = directions[document.getElementById('roofCam').src.split('/')[7]]; + // Default to North on first load. + newDirection = newDirection ? newDirection : 'north'; // Makes image update. Image updates every (about) 2 minutes and 15 seconds. document.getElementById('roofCam').alt = document.getElementById('dirText').innerHTML = newDirection; + var date = new Date(); + // Update image every 5 minutes and let the final value be in seconds since epoch. + var formatted_date = Math.floor(date.getTime() / 1000 / 300) * 300; document.getElementById('roofCam').src = METOBS_API_URL + '/pub/cache/aoss/cameras/' + newDirection + - '/latest_orig.jpg?t=' + new Date().getTime(); + '/latest_medium.jpg?t=' + formatted_date; } diff --git a/content/pages/lobby_meteorogram.html b/content/pages/lobby_meteorogram.html index 0811571a8672fbc378285724df0795d9a696cd0b..178a6f72dc44decfcb1fb1ab0f5bc5c441b6a8b9 100644 --- a/content/pages/lobby_meteorogram.html +++ b/content/pages/lobby_meteorogram.html @@ -19,9 +19,8 @@ <div id="row3" style="height: calc(93%/3); width: 100%"> <div id="col1" style="float: left; height: 100%; width: calc(100%/3)"></div> <div id="col2" style="float: left; height: 100%; width: calc(100%/3); position: relative"> - <img id="roofCam" src="/pub/cache/aoss/cameras/west/latest_orig.jpg" - alt="west" style="Cache-Control: no-store; height: 100%; width: 100%;"> - <div id="dirText" style="position: absolute; bottom: 0%; right: 0%; font-size: .5vh; background-color: black; color: white">west</div> + <img id="roofCam" alt="west" style="Cache-Control: no-store; height: 100%; width: 100%;"> + <div id="dirText" style="position: absolute; bottom: 0%; right: 50%; font-size: .6vh; background-color: black; color: white">west</div> </div> <div id="col3" style="float: left; height: 100%; width: calc(100%/3)"></div> </div>