/*
 
 jQuery Tools @VERSION Overlay - Overlay base. Extend it.

 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.

 http://flowplayer.org/tools/overlay/

 Since: March 2008
 Date: @DATE 
 
 jQuery Tools @VERSION / Expose - Dim the lights

 NO COPYRIGHTS OR LICENSES. DO WHAT YOU LIKE.

 http://flowplayer.org/tools/toolbox/expose.html

 Since: Mar 2010
 Date: @DATE 
 Handlebars hbs 0.4.0 - Alex Sexton, but Handlebars has it's own licensing junk

 Available via the MIT or new BSD license.
 see: http://github.com/jrburke/require-cs for details on the plugin this was based off of
*/
(function(){var define=window.define||function(f){return f()};define("fitbit-widget-dropdown",["require","jquery"],function(require){var isAMD=typeof require==="function";var $=isAMD?require("jquery"):window.jQuery;if(!isAMD){var fitbit=window.fitbit||{};fitbit.modules=fitbit.modules||{};if($.isFunction(fitbit.modules.dropdown))return fitbit}var Dropdown=function(catalyst,config){if(!catalyst||!catalyst.length)return this._throwError("no catalyst specified");this.catalyst=$(catalyst).first();this.catalystActiveClass=
null;this.anchorPoint="left below";this.elements={root:null,content:null};this.fadeEffectDuration=200;this.hideDelay=500;this.isManualShowEnabled=false;this.isMouseBoundaryDetectionEnabled=true;this.isMouseCursorInsideDropdown=false;this.namespace={css:"module-dd",event:"module-dropdown-"};this.positionOffset={x:0,y:0};this._initialize(config)};Dropdown.prototype={cancelHide:function(){if(this.hideTimer){clearTimeout(this.hideTimer);this.hideTimer=null}},clear:function(){$(this.elements.content).empty()},
destroy:function(){this._fireCustomEvent("destroy");this.catalyst.off("."+this.namespace.event);for(var el in this.elements)$(el).remove();this.catalyst.removeData("module-dropdown-id");var self=this;delete self},getCatalystPosition:function(){return this._getCatalystPosition()},getRootElement:function(){return this.elements.root&&this.elements.root.length?this.elements.root.get(0):null},hide:function(){var rootEl=$(this.elements.root);if(!rootEl.is(":animated")){this._fireCustomEvent("beforeHide");
this.catalyst.removeClass(this.catalystActiveClass);rootEl.fadeOut(this.fadeEffectDuration,$.proxy(function(){this._fireCustomEvent("hide")},this))}},isVisible:function(){try{return this.elements.root.is(":visible")}catch(e){return false}},render:function(content,isAppend){if(content){if(!isAppend)this.clear();$(this.elements.content).append(content);this._fireCustomEvent("render");return true}return false},setPosition:function(){this._setPosition()},setPositionOffset:function(x,y){if($.isNumeric(x))this.positionOffset.x=
x;if($.isNumeric(y))this.positionOffset.y=y},show:function(){this.setPosition();this._fireCustomEvent("beforeShow");this.catalyst.addClass(this.catalystActiveClass);$(this.elements.root).fadeIn(this.fadeEffectDuration,$.proxy(function(){this._fireCustomEvent("show")},this))},subscribe:function(eventName,callback,once){if(typeof eventName==="string"&&$.isFunction(callback)){this.catalyst[once===true?"one":"on"](this._getEventName(eventName),callback);return true}return false},toggle:function(){return this._toggle()},
unsubscribe:function(eventName,callback){if(typeof eventName==="string"){this.catalyst.off(this._getEventName(eventName),callback);return true}return false},_applyConfiguration:function(config){if($.isPlainObject(config)){var isString=function(str){return typeof str==="string"&&!/^\s*$/.test(str)};if(isString(config.anchorPoint))this.anchorPoint=config.anchorPoint;if(isString(config.className))this.customClassName=config.className;if(isString(config.catalystActiveClass))this.catalystActiveClass=config.catalystActiveClass;
if($.isNumeric(config.hideDelay))this.hideDelay=config.hideDelay>0?config.hideDelay:0;if($.isNumeric(config.fadeEffectDuration)||config.fadeEffectDuration===false)this.fadeEffectDuration=config.fadeEffectDuration;this.isMouseBoundaryDetectionEnabled=!(config.mouseBoundaryDetectionEnabled===false);this.isManualShowEnabled=config.manualShowEnabled===true}},_buildStructure:function(){var cn=$.proxy(function(className){var str=this.namespace.css;if(typeof className==="string")str+="-"+className.replace(/\s+/,
"-");return str},this);var rootEl=$("\x3cdiv/\x3e").addClass(cn()).hide();if(this.customClassName)rootEl.addClass(this.customClassName);var contentEl=$("\x3cdiv/\x3e").addClass(cn("content")).appendTo(rootEl);rootEl.appendTo(document.body);$.extend(this.elements,{root:rootEl,content:contentEl})},_defineAnchorPointStrategies:function(){if(!this.anchorPointStrategies)this.anchorPointStrategies={"below":$.proxy(function(){var catalystPosition=this._getCatalystPosition();return{"top":parseInt(this.positionOffset.y+
catalystPosition.y+catalystPosition.h,10)+"px","bottom":"auto"}},this),"left":$.proxy(function(){var catalystPosition=this._getCatalystPosition();return{"left":parseInt(this.positionOffset.x+catalystPosition.x,10)+"px","right":"auto"}},this),"right":$.proxy(function(){var catalystPosition=this._getCatalystPosition();return{"right":parseInt($(window).width()-(0-this.positionOffset.x+catalystPosition.x+catalystPosition.w),10)+"px","left":"auto"}},this)}},_fireCustomEvent:function(eventName){this.catalyst.trigger(this._getEventName(eventName),
this)},_getCatalystPosition:function(){var catalyst=this.catalyst;var pos=catalyst.offset();return{x:Math.round(pos.left),y:Math.round(pos.top),w:Math.round(catalyst.outerWidth(false)),h:Math.round(catalyst.outerHeight(false))}},_getEventName:function(eventName){return typeof eventName==="string"||$.isArray(eventName)?eventName+"."+this.namespace.event:null},_getEventNames:function(eventNames){if(eventNames){if(typeof eventNames==="string")eventNames=[eventNames];$.each(eventNames,$.proxy(function(index,
eventName){eventNames[index]=this._getEventName(eventName)},this))}return eventNames&&eventNames.length?eventNames:null},_getPositionByAnchorPoint:function(){var strategies=this.anchorPoint.split(" ");if(strategies.length!==2)this._throwError("anchor point is invalid");var css={};$.each(strategies,$.proxy(function(index,strategy){$.extend(css,this.anchorPointStrategies[strategy]())},this));if($.isEmptyObject(css))this._throwError("could not determine dropdown position from anchor point");return css},
_getUniqueId:function(){if(!$.isNumeric(this.uniqueId))this.uniqueId=parseInt(Math.random().toString().replace(".",""),10);return this.uniqueId},_initialize:function(config){var uniqueId=this._getUniqueId();this.namespace.event+=uniqueId;this._applyConfiguration(config);this._buildStructure();$(this.catalyst).add(this.elements.root).data("module-dropdown-id",uniqueId);this._initializeCatalyst();this._initializeMouseBoundaryDetection();this._defineAnchorPointStrategies();$(window).on(this._getEventName("resize"),
$.proxy(function(){if(this.isVisible()){this._fireCustomEvent("hideAfterResize");this.hide()}},this));$(document.body).on(this._getEventName("click"),$.proxy(function(ev){var $evTarget=$(ev.target);if(this.isVisible()&&!($evTarget.closest(this.catalyst).length||$evTarget.closest("."+this.namespace.css).length))this.hide()},this));this._fireCustomEvent("initialize")},_initializeCatalyst:function(){if(!this.isManualShowEnabled&&!this.isMouseDelayedShowEnabled)this.catalyst.on(this._getEventName("click"),
$.proxy(function(ev){if(ev)ev.preventDefault();this._toggle()},this))},_initializeMouseBoundaryDetection:function(){if(this.isMouseBoundaryDetectionEnabled)this.elements.root.on(this._getEventName("mouseenter"),$.proxy(function(){this._setMouseCursorInsideDropdown(true)},this)).on(this._getEventName("mouseleave"),$.proxy(function(){this._setMouseCursorInsideDropdown(false);if(!this.hideTimer&&this.isVisible())this.hideTimer=setTimeout($.proxy(function(){if(!this.isMouseCursorInsideDropdown)this.hide();
this.cancelHide()},this),this.hideDelay)},this))},_setMouseCursorInsideDropdown:function(isInside){if(isInside){this.isMouseCursorInsideDropdown=true;this._fireCustomEvent("mouseEnterDropdown")}else{this.isMouseCursorInsideDropdown=false;this._fireCustomEvent("mouseLeaveDropdown")}},_setPosition:function(){this.elements.root.css(this._getPositionByAnchorPoint());this._fireCustomEvent("position")},_throwError:function(message){console.log("Fitbit Dropdown Widget : "+(message||"unknown error"))},_toggle:function(){if(this.isVisible()){this.hide();
return false}else{this.show();return true}}};if(isAMD)return Dropdown;else{fitbit.modules.dropdown=Dropdown;return fitbit}})})();
(function($){function Overlay(trigger,conf){var self=this;var fire=trigger.add(self);var w=$(window);var closers;var overlay;var opened;var maskConf=$.tools.expose&&(conf.mask||conf.expose);var uid=Math.random().toString().slice(10);if(maskConf){if(typeof maskConf=="string")maskConf={color:maskConf};maskConf.closeOnClick=maskConf.closeOnEsc=false}var jq=conf.target||trigger.attr("rel");overlay=jq?$(jq):null||trigger;if(!overlay.length)throw"Could not find Overlay: "+jq;if(trigger&&trigger.index(overlay)==
-1)trigger.click(function(e){self.load(e);return e.preventDefault()});$.extend(self,{load:function(e$$0){if(self.isOpened())return self;var eff=effects[conf.effect];if(!eff)throw'Overlay: cannot find effect : "'+conf.effect+'"';if(conf.oneInstance)$.each(instances,function(){this.close(e$$0)});e$$0=e$$0||$.Event();e$$0.type="onBeforeLoad";fire.trigger(e$$0);if(e$$0.isDefaultPrevented())return self;opened=true;if(maskConf)$(overlay).expose(maskConf);var top=conf.top;var left=conf.left;var oWidth=overlay.outerWidth(true);
var oHeight=overlay.outerHeight(true);if(typeof top=="string")top=top=="center"?Math.max((w.height()-oHeight)/2,0):parseInt(top,10)/100*w.height();if(left=="center")left=Math.max((w.width()-oWidth)/2,0);eff[0].call(self,{top:top,left:left},function(){if(opened){e$$0.type="onLoad";fire.trigger(e$$0)}});if(maskConf&&conf.closeOnClick)$.mask.getMask().one("click",self.close);if(conf.closeOnClick)$(document).bind("click."+uid,function(e){if(!$(e.target).parents(overlay).length)self.close(e)});if(conf.closeOnEsc)$(document).bind("keydown."+
uid,function(e){if(e.keyCode==27)self.close(e)});return self},close:function(e){if(!self.isOpened())return self;e=e||$.Event();e.type="onBeforeClose";fire.trigger(e);if(e.isDefaultPrevented())return;opened=false;effects[conf.effect][1].call(self,function(){e.type="onClose";fire.trigger(e)});$(document).unbind("click."+uid).unbind("keydown."+uid);if(maskConf)$.mask.close();return self},getOverlay:function(){return overlay},getTrigger:function(){return trigger},getClosers:function(){return closers},
isOpened:function(){return opened},getConf:function(){return conf}});$.each("onBeforeLoad,onStart,onLoad,onBeforeClose,onClose".split(","),function(i,name){if($.isFunction(conf[name]))$(self).bind(name,conf[name]);self[name]=function(fn){if(fn)$(self).bind(name,fn);return self}});closers=overlay.find(conf.close||".close");if(!closers.length&&!conf.close){closers=$('\x3ca class\x3d"close"\x3e\x3c/a\x3e');overlay.prepend(closers)}closers.click(function(e){self.close(e)});if(conf.load)self.load()}$.tools=
$.tools||{version:"@VERSION"};$.tools.overlay={addEffect:function(name,loadFn,closeFn){effects[name]=[loadFn,closeFn]},conf:{close:null,closeOnClick:true,closeOnEsc:true,closeSpeed:"fast",effect:"default",fixed:true,left:"center",load:false,mask:null,oneInstance:true,speed:"normal",target:null,top:"10%"}};var instances=[];var effects={};$.tools.overlay.addEffect("default",function(pos,onLoad){var conf=this.getConf();var w=$(window);if(!conf.fixed){pos.top+=w.scrollTop();pos.left+=w.scrollLeft()}pos.position=
conf.fixed?"fixed":"absolute";this.getOverlay().css(pos).fadeIn(conf.speed,onLoad)},function(onClose){this.getOverlay().fadeOut(this.getConf().closeSpeed,onClose)});$.fn.overlay=function(conf){var el=this.data("overlay");if(el)return el;if($.isFunction(conf))conf={onBeforeLoad:conf};conf=$.extend(true,{},$.tools.overlay.conf,conf);this.each(function(){el=new Overlay($(this),conf);instances.push(el);$(this).data("overlay",el)});return conf.api?el:this}})(jQuery);define("jqtools-overlay",function(){});
(function($){function viewport(){if($.browser.msie){var d=$(document).height();var w=$(window).height();return[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,d-w<20?w:d]}return[$(document).width(),$(document).height()]}function call(fn){if(fn)return fn.call($.mask)}$.tools=$.tools||{version:"@VERSION"};var tool;tool=$.tools.expose={conf:{maskId:"exposeMask",loadSpeed:"slow",closeSpeed:"fast",closeOnClick:true,closeOnEsc:true,zIndex:9998,opacity:.8,startOpacity:0,
color:"#fff",onLoad:null,onClose:null}};var mask;var exposed;var loaded;var config;var overlayIndex;$.mask={load:function(conf,els){if(loaded)return this;if(typeof conf=="string")conf={color:conf};conf=conf||config;config=conf=$.extend($.extend({},tool.conf),conf);mask=$("#"+conf.maskId);if(!mask.length){mask=$("\x3cdiv/\x3e").attr("id",conf.maskId);$("body").append(mask)}var size=viewport();mask.css({position:"absolute",top:0,left:0,width:size[0],height:size[1],display:"none",opacity:conf.startOpacity,
zIndex:conf.zIndex});if(conf.color)mask.css("backgroundColor",conf.color);if(call(conf.onBeforeLoad)===false)return this;if(conf.closeOnEsc)$(document).bind("keydown.mask",function(e){if(e.keyCode==27)$.mask.close(e)});if(conf.closeOnClick)mask.bind("click.mask",function(e){$.mask.close(e)});$(window).bind("resize.mask",function(){$.mask.fit()});if(els&&els.length){overlayIndex=els.eq(0).css("zIndex");$.each(els,function(){var el=$(this);if(!/relative|absolute|fixed/i.test(el.css("position")))el.css("position",
"relative")});exposed=els.css({zIndex:Math.max(conf.zIndex+1,overlayIndex=="auto"?0:overlayIndex)})}mask.css({display:"block"}).fadeTo(conf.loadSpeed,conf.opacity,function(){$.mask.fit();call(conf.onLoad);loaded="full"});loaded=true;return this},close:function(){if(loaded){if(call(config.onBeforeClose)===false)return this;mask.fadeOut(config.closeSpeed,function(){call(config.onClose);if(exposed)exposed.css({zIndex:overlayIndex});loaded=false});$(document).unbind("keydown.mask");mask.unbind("click.mask");
$(window).unbind("resize.mask")}return this},fit:function(){if(loaded){var size=viewport();mask.css({width:size[0],height:size[1]})}},getMask:function(){return mask},isLoaded:function(fully){return fully?loaded=="full":loaded},getConf:function(){return config},getExposed:function(){return exposed}};$.fn.mask=function(conf){$.mask.load(conf);return this};$.fn.expose=function(conf){$.mask.load(conf,this);return this}})(jQuery);define("jqtools-toolbox-expose",function(){});
define("galileo/i18n/messageformat/locales",["require"],function(require){MessageFormat=window["MessageFormat"]||{};MessageFormat.locale=MessageFormat.locale||{};MessageFormat.locale.en=function(n){if(n===1)return"one";return"other"};MessageFormat.locale.fr=function(n){if(n>=0&&n<2)return"one";return"other"};MessageFormat.locale.de=function(n){if(n===1)return"one";return"other"};MessageFormat.locale.es=function(n){if(n===1)return"one";return"other"};MessageFormat.locale.ja=function(n){if(n===1)return"one";
return"other"};MessageFormat.locale.ko=function(n){return"other"};MessageFormat.locale.zh=function(n){return"other"};MessageFormat.locale.it=function(n){if(n===1)return"one";return"other"};MessageFormat.locale.tr=function(n){return"other"};MessageFormat.locale.pt=function(n){if(n===1)return"one";return"other"};MessageFormat.locale.ru=function(n){if(n%10==1&&n%100!=11)return"one";if(n%10>=2&&n%10<=4&&(n%100<12||n%100>14)&&n==Math.floor(n))return"few";if(n%10===0||n%10>=5&&n%10<=9||n%100>=11&&n%100<=
14&&n==Math.floor(n))return"many";return"other"}});define("substitute",["require"],function(require){return function(str){if(typeof str!=="string")return"";if(arguments.length>1){var i=0;for(var len=arguments.length;i<len;i++)str=str.replace("{"+i+"}",arguments[i+1]+"")}return str}});
(function(){var define=window.define||function(f){return f()};define("fitbit-jquery-charsRemaining",["require","jquery","galileo/i18n/messageformat/locales","substitute"],function(require){function _getConfig(catalyst){return $(catalyst).data(namespace.plugin).config}function _getMessage(numRemaining){var messageType=numRemaining===1?"singular":"plural";return getResource(messages[messageType],numRemaining)}function _getMessageElement(catalyst){return $(catalyst).data(namespace.plugin).messageEl}
function _refresh(catalyst){catalyst=$(catalyst);var config=_getConfig(catalyst);var length=catalyst.val().length;var maxlength=config.maxlength;var messageEl=_getMessageElement(catalyst);messageEl.text(_getMessage(maxlength-length));if(length>=maxlength){if(!messageEl.hasClass(config.errorClass)){messageEl.removeClass(config.warningClass).addClass(config.errorClass);_triggerCustomEvent(catalyst,"lengthError")}}else if(length>=maxlength-config.warningThreshold){if(!messageEl.hasClass(config.warningClass)){messageEl.removeClass(config.errorClass).addClass(config.warningClass);
_triggerCustomEvent(catalyst,"lengthWarning")}}else{if(messageEl.hasClass(config.errorClass)){messageEl.removeClass(config.errorClass);_triggerCustomEvent(catalyst,"lengthOkay")}if(messageEl.hasClass(config.warningClass))messageEl.removeClass(config.warningClass)}}function _throwError(msg){console.log(namespace.plugin+" : "+msg)}function _triggerCustomEvent(catalyst,eventName){$(catalyst).trigger(eventName)}var isAMD=typeof require==="function";var isLayoutBaseLean=document.getElementById("requirejs");
var $=isAMD?require("jquery"):window.jQuery;if(isAMD&&!isLayoutBaseLean){var i18n=require("galileo/i18n/messageformat/locales");var getResource=require("substitute")}else{i18n=function(key){return key};getResource=fitbit.i18n.getResource}var messages={singular:"{0} character remaining",plural:"{0} characters remaining"};var namespace={css:"module-chars-remaining",plugin:"chars_remaining"};var defaultConfig={maxlength:140,warningThreshold:20,warningClass:"warning",errorClass:"exceeded",tagName:"span"};
var methods={init:function(options){var config=$.extend(defaultConfig,options);var displayText=_getMessage(config.maxlength);if(!displayText||/^\s*$/.test(displayText))_throwError("error initializing, message keys not found");return this.each(function(){var catalyst=$(this);if(catalyst.is("input[type\x3d'text'], input[type\x3d'password'], textarea")){var data=catalyst.data(namespace.plugin);if(!data){var messageEl=$("\x3c"+config.tagName+"/\x3e").addClass(namespace.css).html(displayText).insertAfter(catalyst);
catalyst.data(namespace.plugin,{target:catalyst,messageEl:messageEl,config:config});catalyst.on("paste."+namespace.plugin+" keyup."+namespace.plugin,function(){setTimeout(function(){_refresh(catalyst)},0)})}}})},reset:function(){return this.each(function(){var catalyst=$(this);catalyst.val("");_refresh(catalyst)})},destroy:function(){return this.each(function(){var catalyst=$(this);_getMessageElement(catalyst).remove();catalyst.off("."+namespace.plugin).removeData(namespace.plugin)})}};$.fn.charsRemaining=
function(method){if($.isFunction(methods[method]))return methods[method].apply(this,Array.prototype.slice.call(arguments,1));else if($.isPlainObject(method)||!method)return methods.init.apply(this,arguments);else{_throwError('"'+method+'" does not exist');return this}}})})();
(function(){var define=window.define||function(f){return f()};define("fitbit-jquery-peerMessageModal",["require","jquery","jqtools-overlay","jqtools-toolbox-expose","fitbit-jquery-charsRemaining"],function(require){if(typeof require==="function"){var $=require("jquery");require("jqtools-overlay");require("jqtools-toolbox-expose");require("fitbit-jquery-charsRemaining")}else{$=window.jQuery;window.curvyCornersNoAutoScan=true}if($.isFunction($.fn.peerMessageModal))return;var isInitialized=false;var theForm;
var textarea;var successMessage;$.fn.peerMessageModal=function(options){function _initModalContent(){if(isInitialized)return;isInitialized=true;var formDisabledClass="failure";theForm=$self.find(".wrapper-form");textarea=theForm.find("textarea").first();successMessage=$self.find(".message-success");textarea.charsRemaining({maxlength:messageMaxLength}).on("paste keyup",function(){setTimeout(function(){theForm.toggleClass(formDisabledClass,!_validateForm())},0)})}function _validateForm(){var messageValue=
textarea.val();return messageValue.length<=messageMaxLength&&!/^\s*$/.test(messageValue)}function _mixpanel_tracking(eventProperties){var mpq=window.mpq;if(mpq&&$.isPlainObject(eventProperties))mpq.push(["track","Social: Friend Message - Sent",$.extend({"token":mpqMasterPrj},eventProperties)])}var $self=$(this);var messageMaxLength=180;var opts=$.extend({},$.fn.peerMessageModal.defaults,options);var init=function(){mm.launchModal()};var pluginConfig={overlay:{top:"center",left:"center",mask:{color:"#000",
opacity:.6},close:".closeModal, .cancel",zIndex:9999,onLoad:function(){_initModalContent();textarea.get(0).focus()},onClose:function(){theForm.each(function(index,el){el.reset()});$self.find("form").unbind("submit");textarea.charsRemaining("reset");successMessage.hide()}}};var mm={launchModal:function(){mm.addData();$self.overlay(pluginConfig.overlay);mm.overlay=$self.data("overlay");mm.overlay.load()}};mm.addData=function(){var thumbUrl;if(opts.userThumb)thumbUrl=opts.userThumb.replace(/\\"/g,'"');
else thumbUrl="/images/profile/defaultProfile_32_male.gif";var modalHeader=$self.find(".modal-header");modalHeader.find(".name").text(opts.userName).end().find(".photo").empty().append($("\x3cimg/\x3e").attr({src:thumbUrl,width:40,height:40,alt:""}))};init();$self.find("form").submit(function(ev){ev.preventDefault();if(_validateForm())$.ajax({type:"GET",url:"/leaderboard/message",data:{apiFormat:"JSON",sendMessage:"on",recipientEncodedUserId:opts.userId,msgToSend:textarea.val(),statType:opts.statType,
periodType:opts.periodType,networkType:opts.networkType,networkId:opts.networkId,dataType:opts.dataType},dataType:"json",success:function(json){successMessage.fadeIn(200);setTimeout(function(){mm.overlay.close()},2E3);var trackingSource=opts.mixPanelData&&typeof opts.mixPanelData.trackingSource==="string"?opts.mixPanelData.trackingSource:location.href;var mixpanelEventData={"!PAGEGROUP":opts.mixPanelData.pageGroup,"!TYPE":opts.mixPanelData.type,source:trackingSource};_mixpanel_tracking(mixpanelEventData)}})})}})})();
(function(){var define=window.define||function(f){return f()};define("fitbit-header-notificationDropdown",["require","jquery","fitbit-widget-dropdown","fitbit-jquery-peerMessageModal","galileo/i18n/messageformat/locales"],function(require){var isAMD=typeof require==="function";var isLayoutBaseLean=document.getElementById("requirejs");if(isAMD){var $=require("jquery");var DD=require("fitbit-widget-dropdown");require("fitbit-jquery-peerMessageModal")}else{$=window.jQuery;DD=$.isFunction(fitbit.modules.dropdown)&&
fitbit.modules.dropdown}if(isAMD&&!isLayoutBaseLean){var i18n=require("galileo/i18n/messageformat/locales");null;var _localMessageBundle={badges:"Badges",friend_rankings:"Friend Rankings",reply:"Reply",send_message:"Send Message",view_request:"View Request",loading_notifications:"Loading...",empty_state_notifications:"You have no notifications."};var _getMessage=function(key){return _localMessageBundle[key]?_localMessageBundle[key]:""}}else _getMessage=function(key){return fitbit.i18n.getResource("com.fitbit.app.user.friends.label."+
key)};var FLAG_INIT="isNotificationDropdownInitialized";var $CATALYST=$("#catalyst-notify");if($CATALYST.data(FLAG_INIT))return;var notificationDropdown=function(){function fillTemplate(data){var ret=$("\x3cul\x3e").addClass("listCont");$.isArray(data.result)&&$.each(data.result,function(){var that=this;var linkAction={};var linkText="";$.each(notifActionMap,function(key,value){if(key==that.notifType){linkText=value[0];linkAction.link=value[1];linkAction.actionType=that.notifType}});if($.isPlainObject(this.msgMetaData)){linkAction.dataType=
this.msgMetaData.dataType;linkAction.statType=this.msgMetaData.statType;linkAction.periodType=this.msgMetaData.periodType;linkAction.networkType=this.msgMetaData.networkType;linkAction.networkId=this.msgMetaData.networkId}linkAction.userId=this.thumbUsrEncId;linkAction.userName=this.thumbUsrDisplayName;linkAction.userThumb=this.thumbImage;if(linkAction.actionType=="messageCorporate")linkAction=null;if(this.thumbMetaData)var thumbDiv=$("\x3cdiv\x3e").addClass("thumb thumb-badge").append($("\x3cimg\x3e").addClass("photo").attr("src",
this.thumbImage).attr("alt",""),$("\x3cspan\x3e").addClass("num").text(this.thumbMetaData.badgeValue),$("\x3cspan\x3e").addClass("unit").text(this.thumbMetaData.badgeUnit));else if(this.notifType==="messageCorporate")thumbDiv=$("\x3cdiv\x3e").addClass("thumb").append($("\x3cimg\x3e").addClass("photo programLogo").attr("src",this.thumbImage).attr("alt",this.thumbUsrDisplayName||""));else thumbDiv=$("\x3cdiv\x3e").addClass("thumb").append($("\x3cimg\x3e").addClass("photo").attr("src",this.thumbImage).attr("alt",
this.thumbUsrDisplayName||""));$("\x3cli\x3e").addClass("clearfix").addClass(this.hasBeenRead).data("action",linkAction).append($("\x3cdiv\x3e").addClass("timeAction").append($("\x3cspan\x3e").text(this.notifTimeLabel),$("\x3cspan\x3e").addClass("link").text(linkText)),thumbDiv,$("\x3cdiv\x3e").addClass("icon").addClass(this.notifType).addClass(this.hasBeenRead),$("\x3cdiv\x3e").addClass("meat").append($("\x3ch6\x3e").text(this.notifSysGenMsg),this.notifSysGenHeader?$("\x3ch3\x3e").text(this.notifSysGenHeader):
"",this.notifType==="messageCorporate"?$("\x3cspan\x3e").html(this.notifUsrGenMsg):$("\x3cspan\x3e").text(this.notifUsrGenMsg))).appendTo(ret)});ret=ret.add($("\x3cdiv\x3e").addClass("paginate").addClass(!isNaN(data.result.length)&&data.result.length<15?"hide":"").append($("\x3cspan\x3e").text($("#notificationDropdownTemplate").html())));return ret}function clearNotificationMenuIconState(){$CATALYST.find(".icon-notify").removeClass("unread")}function recordMostRecentlySeen(doQuickRequest){var fetchedId=
minMaxNotifId(true);if(fetchedId)$.ajax({type:"GET",url:"/notifications/view",data:{apiFormat:"JSON",updateLastViewed:"on",highEventId:fetchedId},dataType:"json",success:function(json){}})}function minMaxNotifId(max){var initialResult=nDropdown.notifications.result?nDropdown.notifications.result:null;var subsequentResult=nDropdown.subsequentNotifications.result?nDropdown.subsequentNotifications.result:null;var notifArr=[];var notifIdArr=[];if($.isArray(initialResult)&&$.isArray(subsequentResult))notifArr=
$.merge(initialResult,subsequentResult);else if($.isArray(initialResult))notifArr=initialResult;else return false;$.each(notifArr,function(index,value){notifIdArr.push(parseInt(value.notifId))});return Math[max?"max":"min"].apply(null,notifIdArr)}function mixpanel_tracking(eventProperties){var mpq=window.mpq;if(mpq&&$.isPlainObject(eventProperties)){eventProperties=$.extend({token:mpqMasterPrj,user_action:"list item click",uid:getUserIdForMixpanel()},eventProperties);mpq.push(["track","Social: View Notifications",
eventProperties])}}function getUserIdForMixpanel(){var mpq=window.mpq;try{var isProductionEnv=mpqSocialFeaturesPrj!==mpqQAPrj;return isProductionEnv?"":mpq.metrics.super_properties.all.distinct_id}catch(e){}return""}$.firstNotifRequest=true;var nDropdown={notifications:{},subsequentNotifications:{}};var firstTimeDropdown=true;var listElem="notifyList";var $triggerElem=$CATALYST;var notifActionMap={friendReq:[_getMessage("view_request"),"/user/"],messageSingle:[_getMessage("reply"),"#umm"],cheer:[_getMessage("reply"),
"#umm"],taunt:[_getMessage("reply"),"#umm"],passSingle:[_getMessage("send_message"),"#umm"],passedBySingle:[_getMessage("send_message"),"#umm"],passMultiple:[_getMessage("friend_rankings"),"/friends/leaders"],badge:[_getMessage("badges"),"/badges/all"],messageCorporate:["",""]};nDropdown.generateTemplateHTML=function(loadMore){var source=$("#notificationDropdownTemplate").html();var initialList=!$.isEmptyObject(nDropdown.notifications)?nDropdown.notifications:false;var subsequentList=!$.isEmptyObject(nDropdown.subsequentNotifications)?
nDropdown.subsequentNotifications:false;var listHtml={};if(subsequentList&&loadMore)listHtml=fillTemplate(nDropdown.subsequentNotifications);else if(initialList)listHtml=fillTemplate(nDropdown.notifications);else return false;return listHtml};nDropdown.showLoader=function(){NotifDD.render('\x3cdiv class\x3d"initialLoading"\x3e'+_getMessage("loading_notifications")+"\x3c/div\x3e");if(firstTimeDropdown){if(!NotifDD.isVisible())NotifDD.show()}else NotifDD.toggle()};nDropdown.displayNotifList=function(listHtml,
isAppend){var initialListLength=!$.isEmptyObject(nDropdown.notifications)?nDropdown.notifications.result.length:0;NotifDD.render(listHtml,isAppend);if(!firstTimeDropdown&&!isAppend)nDropdown.markAsRead();if(firstTimeDropdown||isAppend){if(!NotifDD.isVisible())NotifDD.show()}else NotifDD.toggle();if(!isAppend){recordMostRecentlySeen();clearNotificationMenuIconState()}};nDropdown.init=function(loadingMode){if(firstTimeDropdown)nDropdown.bindEvents();nDropdown.displayNotifList(nDropdown.generateTemplateHTML());
firstTimeDropdown=false};nDropdown.bindEvents=function(){$("."+listElem).on("click",".paginate",function(){var that=this;$(that).addClass("spinner");$.ajax({type:"GET",url:"/notifications/view",data:{apiFormat:"JSON",lowEventId:minMaxNotifId(false)},dataType:"json",success:function(json){if(json.result.length>0){notificationDropdown.saveJSON(json);nDropdown.displayNotifList(nDropdown.generateTemplateHTML(true),true);$(that).html("").removeClass("spinner, paginate").addClass("divider");mixpanel_tracking({user_action:"load more"})}}})});
$("."+listElem).on("click","li",function(){var actionObj=$(this).data("action");if(/^#umm/.test(actionObj.link)){nDropdown.notificationMessageModal(actionObj);return}if(/^\/user\/$/.test(actionObj.link))actionObj.link+=actionObj.userId;nDropdown.notificationLink(actionObj)});NotifDD.subscribe("show",function(){mixpanel_tracking({user_action:"show"})});NotifDD.subscribe("hide",function(){mixpanel_tracking({user_action:"hide"})})};nDropdown.notificationLink=function(actionObj){mixpanel_tracking({"!NOTIFICATION_TYPE":actionObj.actionType,
"!PAGEGROUP":"notifications"});window.location=actionObj.link};nDropdown.notificationMessageModal=function(actionObj){if(NotifDD.isVisible())NotifDD.hide();var mixPanelData={trackingSource:"reply to "+actionObj.actionType,pageGroup:"notifications list",type:"sendCustom"};$("#peerMessageModal").peerMessageModal($.extend(actionObj,{mixPanelData:mixPanelData}));mixpanel_tracking({"!NOTIFICATION_TYPE":actionObj.actionType,"!PAGEGROUP":"notifications"})};nDropdown.saveJSON=function(json){if(json&&firstTimeDropdown&&
json.result.length>0)$.extend(nDropdown.notifications,json);else if(json&&json.result.length>0)$.extend(nDropdown.subsequentNotifications,json)};nDropdown.markAsRead=function(){$("."+listElem).find("li").addClass("read").end().find(".icon").addClass("read").end().find(".paginate").removeClass("spinner")};nDropdown.newDropdown=function(){if($triggerElem.length){NotifDD=new DD($triggerElem,{className:listElem+" subnav subnav-app",anchorPoint:"below right",manualShowEnabled:true,catalystActiveClass:"active",
mouseBoundaryDetectionEnabled:false});NotifDD.setPositionOffset(-51,0)}};return nDropdown}();$(function(){notificationDropdown.newDropdown();$CATALYST.addClass("hasdropdown");$CATALYST.data(FLAG_INIT,true);$CATALYST.on("mousedown",function(){var noData=_getMessage("empty_state_notifications");if($.firstNotifRequest){notificationDropdown.showLoader();$.firstNotifRequest=false;$.ajax({type:"GET",url:"/notifications/view",data:{apiFormat:"JSON"},dataType:"json",success:function(json){if(json.result.length>
0){notificationDropdown.saveJSON(json);notificationDropdown.init()}else $(".initialLoading").addClass("empty").html(noData)}})}else notificationDropdown.init()})})})})();
(function(){this.MooTools={version:"1.4.5",build:"ab8ea8824dc3b24b6666867a2c4ed58ebb762cf0"};var typeOf=this.typeOf=function(item){if(item==null)return"null";if(item.$family!=null)return item.$family();if(item.nodeName){if(item.nodeType==1)return"element";if(item.nodeType==3)return/\S/.test(item.nodeValue)?"textnode":"whitespace"}else if(typeof item.length=="number"){if(item.callee)return"arguments";if("item"in item)return"collection"}return typeof item};var instanceOf=this.instanceOf=function(item,
object){if(item==null)return false;for(var constructor=item.$constructor||item.constructor;constructor;){if(constructor===object)return true;constructor=constructor.parent}if(!item.hasOwnProperty)return false;return item instanceof object};var Function=this.Function;var enumerables=true;for(var i$$1 in{toString:1})enumerables=null;if(enumerables)enumerables=["hasOwnProperty","valueOf","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","constructor"];Function.prototype.overloadSetter=
function(usePlural){var self=this;return function(a,b){if(a==null)return this;if(usePlural||typeof a!="string"){for(var k in a)self.call(this,k,a[k]);if(enumerables)for(var i=enumerables.length;i--;){k=enumerables[i];if(a.hasOwnProperty(k))self.call(this,k,a[k])}}else self.call(this,a,b);return this}};Function.prototype.overloadGetter=function(usePlural){var self=this;return function(a){var args;var result;if(typeof a!="string")args=a;else if(arguments.length>1)args=arguments;else if(usePlural)args=
[a];if(args){result={};for(var i=0;i<args.length;i++)result[args[i]]=self.call(this,args[i])}else result=self.call(this,a);return result}};Function.prototype.extend=function(key,value){this[key]=value}.overloadSetter();Function.prototype.implement=function(key,value){this.prototype[key]=value}.overloadSetter();var slice=Array.prototype.slice;Function.from=function(item){return typeOf(item)=="function"?item:function(){return item}};Array.from=function(item){if(item==null)return[];return Type.isEnumerable(item)&&
typeof item!="string"?typeOf(item)=="array"?item:slice.call(item):[item]};Number.from=function(item){var number=parseFloat(item);return isFinite(number)?number:null};String.from=function(item){return item+""};Function.implement({hide:function(){this.$hidden=true;return this},protect:function(){this.$protected=true;return this}});var Type=this.Type=function(name,object){if(name){var lower=name.toLowerCase();var typeCheck=function(item){return typeOf(item)==lower};Type["is"+name]=typeCheck;if(object!=
null)object.prototype.$family=function(){return lower}.hide()}if(object==null)return null;object.extend(this);object.$constructor=Type;object.prototype.$constructor=object;return object};var toString=Object.prototype.toString;Type.isEnumerable=function(item){return item!=null&&typeof item.length=="number"&&toString.call(item)!="[object Function]"};var hooks={};var hooksOf=function(object){var type=typeOf(object.prototype);return hooks[type]||(hooks[type]=[])};var implement=function(name,method){if(method&&
method.$hidden)return;var hooks=hooksOf(this);for(var i=0;i<hooks.length;i++){var hook=hooks[i];if(typeOf(hook)=="type")implement.call(hook,name,method);else hook.call(this,name,method)}var previous=this.prototype[name];if(previous==null||!previous.$protected)this.prototype[name]=method;if(this[name]==null&&typeOf(method)=="function")extend.call(this,name,function(item){return method.apply(item,slice.call(arguments,1))})};var extend=function(name,method){if(method&&method.$hidden)return;var previous=
this[name];if(previous==null||!previous.$protected)this[name]=method};Type.implement({implement:implement.overloadSetter(),extend:extend.overloadSetter(),alias:function(name,existing){implement.call(this,name,this.prototype[existing])}.overloadSetter(),mirror:function(hook){hooksOf(this).push(hook);return this}});new Type("Type",Type);var force=function(name,object,methods){var isType=object!=Object;var prototype=object.prototype;if(isType)object=new Type(name,object);var i$$0=0;for(var l=methods.length;i$$0<
l;i$$0++){var key$$0=methods[i$$0];var generic=object[key$$0];var proto=prototype[key$$0];if(generic)generic.protect();if(isType&&proto)object.implement(key$$0,proto.protect())}if(isType){var methodsEnumerable=prototype.propertyIsEnumerable(methods[0]);object.forEachMethod=function(fn){if(!methodsEnumerable){var i=0;for(var l=methods.length;i<l;i++)fn.call(prototype,prototype[methods[i]],methods[i])}for(var key in prototype)fn.call(prototype,prototype[key],key)}}return force};force("String",String,
["charAt","charCodeAt","concat","indexOf","lastIndexOf","match","quote","replace","search","slice","split","substr","substring","trim","toLowerCase","toUpperCase"])("Array",Array,["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice","indexOf","lastIndexOf","filter","forEach","every","map","some","reduce","reduceRight"])("Number",Number,["toExponential","toFixed","toLocaleString","toPrecision"])("Function",Function,["apply","call","bind"])("RegExp",RegExp,["exec","test"])("Object",
Object,["create","defineProperty","defineProperties","keys","getPrototypeOf","getOwnPropertyDescriptor","getOwnPropertyNames","preventExtensions","isExtensible","seal","isSealed","freeze","isFrozen"])("Date",Date,["now"]);Object.extend=extend.overloadSetter();Date.extend("now",function(){return+new Date});new Type("Boolean",Boolean);Number.prototype.$family=function(){return isFinite(this)?"number":"null"}.hide();Number.extend("random",function(min,max){return Math.floor(Math.random()*(max-min+1)+
min)});var hasOwnProperty=Object.prototype.hasOwnProperty;Object.extend("forEach",function(object,fn,bind){for(var key in object)if(hasOwnProperty.call(object,key))fn.call(bind,object[key],key,object)});Object.each=Object.forEach;Array.implement({forEach:function(fn,bind){var i=0;for(var l=this.length;i<l;i++)if(i in this)fn.call(bind,this[i],i,this)},each:function(fn,bind){Array.forEach(this,fn,bind);return this}});var cloneOf=function(item){switch(typeOf(item)){case "array":return item.clone();
case "object":return Object.clone(item);default:return item}};Array.implement("clone",function(){var i=this.length;for(var clone=new Array(i);i--;)clone[i]=cloneOf(this[i]);return clone});var mergeOne=function(source,key,current){switch(typeOf(current)){case "object":if(typeOf(source[key])=="object")Object.merge(source[key],current);else source[key]=Object.clone(current);break;case "array":source[key]=current.clone();break;default:source[key]=current}return source};Object.extend({merge:function(source,
k,v){if(typeOf(k)=="string")return mergeOne(source,k,v);var i=1;for(var l=arguments.length;i<l;i++){var object=arguments[i];for(var key in object)mergeOne(source,key,object[key])}return source},clone:function(object){var clone={};for(var key in object)clone[key]=cloneOf(object[key]);return clone},append:function(original){var i=1;for(var l=arguments.length;i<l;i++){var extended=arguments[i]||{};for(var key in extended)original[key]=extended[key]}return original}});["Object","WhiteSpace","TextNode",
"Collection","Arguments"].each(function(name){new Type(name)});var UID=Date.now();String.extend("uniqueID",function(){return(UID++).toString(36)})})();
Array.implement({every:function(fn,bind){var i=0;for(var l=this.length>>>0;i<l;i++)if(i in this&&!fn.call(bind,this[i],i,this))return false;return true},filter:function(fn,bind){var results=[];var value;var i=0;for(var l=this.length>>>0;i<l;i++)if(i in this){value=this[i];if(fn.call(bind,value,i,this))results.push(value)}return results},indexOf:function(item,from){var length=this.length>>>0;for(var i=from<0?Math.max(0,length+from):from||0;i<length;i++)if(this[i]===item)return i;return-1},map:function(fn,
bind){var length=this.length>>>0;var results=Array(length);for(var i=0;i<length;i++)if(i in this)results[i]=fn.call(bind,this[i],i,this);return results},some:function(fn,bind){var i=0;for(var l=this.length>>>0;i<l;i++)if(i in this&&fn.call(bind,this[i],i,this))return true;return false},clean:function(){return this.filter(function(item){return item!=null})},invoke:function(methodName){var args=Array.slice(arguments,1);return this.map(function(item){return item[methodName].apply(item,args)})},associate:function(keys){var obj=
{};var length=Math.min(this.length,keys.length);for(var i=0;i<length;i++)obj[keys[i]]=this[i];return obj},link:function(object){var result={};var i=0;for(var l=this.length;i<l;i++)for(var key in object)if(object[key](this[i])){result[key]=this[i];delete object[key];break}return result},contains:function(item,from){return this.indexOf(item,from)!=-1},append:function(array){this.push.apply(this,array);return this},getLast:function(){return this.length?this[this.length-1]:null},getRandom:function(){return this.length?
this[Number.random(0,this.length-1)]:null},include:function(item){if(!this.contains(item))this.push(item);return this},combine:function(array){var i=0;for(var l=array.length;i<l;i++)this.include(array[i]);return this},erase:function(item){for(var i=this.length;i--;)if(this[i]===item)this.splice(i,1);return this},empty:function(){this.length=0;return this},flatten:function(){var array=[];var i=0;for(var l=this.length;i<l;i++){var type=typeOf(this[i]);if(type=="null")continue;array=array.concat(type==
"array"||type=="collection"||type=="arguments"||instanceOf(this[i],Array)?Array.flatten(this[i]):this[i])}return array},pick:function(){var i=0;for(var l=this.length;i<l;i++)if(this[i]!=null)return this[i];return null},hexToRgb:function(array){if(this.length!=3)return null;var rgb=this.map(function(value){if(value.length==1)value+=value;return value.toInt(16)});return array?rgb:"rgb("+rgb+")"},rgbToHex:function(array){if(this.length<3)return null;if(this.length==4&&this[3]==0&&!array)return"transparent";
var hex=[];for(var i=0;i<3;i++){var bit=(this[i]-0).toString(16);hex.push(bit.length==1?"0"+bit:bit)}return array?hex:"#"+hex.join("")}});
String.implement({test:function(regex,params){return(typeOf(regex)=="regexp"?regex:new RegExp(""+regex,params)).test(this)},contains:function(string,separator){return separator?(separator+this+separator).indexOf(separator+string+separator)>-1:String(this).indexOf(string)>-1},trim:function(){return String(this).replace(/^\s+|\s+$/g,"")},clean:function(){return String(this).replace(/\s+/g," ").trim()},camelCase:function(){return String(this).replace(/-\D/g,function(match){return match.charAt(1).toUpperCase()})},
hyphenate:function(){return String(this).replace(/[A-Z]/g,function(match){return"-"+match.charAt(0).toLowerCase()})},capitalize:function(){return String(this).replace(/\b[a-z]/g,function(match){return match.toUpperCase()})},escapeRegExp:function(){return String(this).replace(/([-.*+?^{$}()|[\]\/\\])/g,"\\$1")},toInt:function(base){return parseInt(this,base||10)},toFloat:function(){return parseFloat(this)},hexToRgb:function(array){var hex=String(this).match(/^#?(\w{1,2})(\w{1,2})(\w{1,2})$/);return hex?
hex.slice(1).hexToRgb(array):null},rgbToHex:function(array){var rgb=String(this).match(/\d{1,3}/g);return rgb?rgb.rgbToHex(array):null},substitute:function(object,regexp){return String(this).replace(regexp||/\\?\{([^{}]+)\}/g,function(match,name){if(match.charAt(0)=="\\")return match.slice(1);return object[name]!=null?object[name]:""})}});
Number.implement({limit:function(min,max){return Math.min(max,Math.max(min,this))},round:function(precision){precision=Math.pow(10,precision||0).toFixed(precision<0?-precision:0);return Math.round(this*precision)/precision},times:function(fn,bind){for(var i=0;i<this;i++)fn.call(bind,i,this)},toFloat:function(){return parseFloat(this)},toInt:function(base){return parseInt(this,base||10)}});Number.alias("each","times");
(function(math){var methods={};math.each(function(name){if(!Number[name])methods[name]=function(){return Math[name].apply(null,[this].concat(Array.from(arguments)))}});Number.implement(methods)})(["abs","acos","asin","atan","atan2","ceil","cos","exp","floor","log","max","min","pow","sin","sqrt","tan"]);Function.extend({attempt:function(){var i=0;for(var l=arguments.length;i<l;i++)try{return arguments[i]()}catch(e){}return null}});
Function.implement({attempt:function(args,bind){try{return this.apply(bind,Array.from(args))}catch(e){}return null},bind:function(that){var self=this;var args=arguments.length>1?Array.slice(arguments,1):null;var F=function(){};var bound=function(){var context=that;var length=arguments.length;if(this instanceof bound){F.prototype=self.prototype;context=new F}var result=!args&&!length?self.call(context):self.apply(context,args&&length?args.concat(Array.slice(arguments)):args||arguments);return context==
that?result:context};return bound},pass:function(args,bind){var self=this;if(args!=null)args=Array.from(args);return function(){return self.apply(bind,args||arguments)}},delay:function(delay,bind,args){return setTimeout(this.pass(args==null?[]:args,bind),delay)},periodical:function(periodical,bind,args){return setInterval(this.pass(args==null?[]:args,bind),periodical)}});
(function(){var document=this.document;var window=document.window=this;var ua=navigator.userAgent.toLowerCase();var platform=navigator.platform.toLowerCase();var UA=ua.match(/(opera|ie|firefox|chrome|version)[\s\/:]([\w\d\.]+)?.*?(safari|version[\s\/:]([\w\d\.]+)|$)/)||[null,"unknown",0];var mode=UA[1]=="ie"&&document.documentMode;var Browser=this.Browser={extend:Function.prototype.extend,name:UA[1]=="version"?UA[3]:UA[1],version:mode||parseFloat(UA[1]=="opera"&&UA[4]?UA[4]:UA[2]),Platform:{name:ua.match(/ip(?:ad|od|hone)/)?
"ios":(ua.match(/(?:webos|android)/)||platform.match(/mac|win|linux/)||["other"])[0]},Features:{xpath:!!document.evaluate,air:!!window.runtime,query:!!document.querySelector,json:!!window.JSON},Plugins:{}};Browser[Browser.name]=true;Browser[Browser.name+parseInt(Browser.version,10)]=true;Browser.Platform[Browser.Platform.name]=true;Browser.Request=function(){var XMLHTTP=function(){return new XMLHttpRequest};var MSXML2=function(){return new ActiveXObject("MSXML2.XMLHTTP")};var MSXML=function(){return new ActiveXObject("Microsoft.XMLHTTP")};
return Function.attempt(function(){XMLHTTP();return XMLHTTP},function(){MSXML2();return MSXML2},function(){MSXML();return MSXML})}();Browser.Features.xhr=!!Browser.Request;var version=(Function.attempt(function(){return navigator.plugins["Shockwave Flash"].description},function(){return(new ActiveXObject("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")})||"0 r0").match(/\d+/g);Browser.Plugins.Flash={version:Number(version[0]||"0."+version[1])||0,build:Number(version[2])||0};Browser.exec=
function(text){if(!text)return text;if(window.execScript)window.execScript(text);else{var script=document.createElement("script");script.setAttribute("type","text/javascript");script.text=text;document.head.appendChild(script);document.head.removeChild(script)}return text};String.implement("stripScripts",function(exec){var scripts="";var text=this.replace(/<script[^>]*>([\s\S]*?)<\/script>/gi,function(all,code){scripts+=code+"\n";return""});if(exec===true)Browser.exec(scripts);else if(typeOf(exec)==
"function")exec(scripts,text);return text});Browser.extend({Document:this.Document,Window:this.Window,Element:this.Element,Event:this.Event});this.Window=this.$constructor=new Type("Window",function(){});this.$family=Function.from("window").hide();Window.mirror(function(name,method){window[name]=method});this.Document=document.$constructor=new Type("Document",function(){});document.$family=Function.from("document").hide();Document.mirror(function(name,method){document[name]=method});document.html=
document.documentElement;if(!document.head)document.head=document.getElementsByTagName("head")[0];if(document.execCommand)try{document.execCommand("BackgroundImageCache",false,true)}catch(e){}if(this.attachEvent&&!this.addEventListener){var unloadEvent=function(){this.detachEvent("onunload",unloadEvent);document.head=document.html=document.window=null};this.attachEvent("onunload",unloadEvent)}var arrayFrom=Array.from;try{arrayFrom(document.html.childNodes)}catch(e$$0){Array.from=function(item){if(typeof item!=
"string"&&Type.isEnumerable(item)&&typeOf(item)!="array"){var i=item.length;for(var array=new Array(i);i--;)array[i]=item[i];return array}return arrayFrom(item)};var prototype=Array.prototype;var slice=prototype.slice;["pop","push","reverse","shift","sort","splice","unshift","concat","join","slice"].each(function(name){var method=prototype[name];Array[name]=function(item){return method.apply(Array.from(item),slice.call(arguments,1))}})}})();
(function(){var hasOwnProperty=Object.prototype.hasOwnProperty;Object.extend({subset:function(object,keys){var results={};var i=0;for(var l=keys.length;i<l;i++){var k=keys[i];if(k in object)results[k]=object[k]}return results},map:function(object,fn,bind){var results={};for(var key in object)if(hasOwnProperty.call(object,key))results[key]=fn.call(bind,object[key],key,object);return results},filter:function(object,fn,bind){var results={};for(var key in object){var value=object[key];if(hasOwnProperty.call(object,
key)&&fn.call(bind,value,key,object))results[key]=value}return results},every:function(object,fn,bind){for(var key in object)if(hasOwnProperty.call(object,key)&&!fn.call(bind,object[key],key))return false;return true},some:function(object,fn,bind){for(var key in object)if(hasOwnProperty.call(object,key)&&fn.call(bind,object[key],key))return true;return false},keys:function(object){var keys=[];for(var key in object)if(hasOwnProperty.call(object,key))keys.push(key);return keys},values:function(object){var values=
[];for(var key in object)if(hasOwnProperty.call(object,key))values.push(object[key]);return values},getLength:function(object){return Object.keys(object).length},keyOf:function(object,value){for(var key in object)if(hasOwnProperty.call(object,key)&&object[key]===value)return key;return null},contains:function(object,value){return Object.keyOf(object,value)!=null},toQueryString:function(object,base){var queryString=[];Object.each(object,function(value,key){if(base)key=base+"["+key+"]";var result;switch(typeOf(value)){case "object":result=
Object.toQueryString(value,key);break;case "array":var qs={};value.each(function(val,i){qs[i]=val});result=Object.toQueryString(qs,key);break;default:result=key+"\x3d"+encodeURIComponent(value)}if(value!=null)queryString.push(result)});return queryString.join("\x26")}})})();
(function(){var _keys={};var DOMEvent=this.DOMEvent=new Type("DOMEvent",function(event,win){if(!win)win=window;event=event||win.event;if(event.$extended)return event;this.event=event;this.$extended=true;this.shift=event.shiftKey;this.control=event.ctrlKey;this.alt=event.altKey;this.meta=event.metaKey;var type=this.type=event.type;for(var target=event.target||event.srcElement;target&&target.nodeType==3;)target=target.parentNode;this.target=document.id(target);if(type.indexOf("key")==0){var code=this.code=
event.which||event.keyCode;this.key=_keys[code];if(type=="keydown")if(code>111&&code<124)this.key="f"+(code-111);else if(code>95&&code<106)this.key=code-96;if(this.key==null)this.key=String.fromCharCode(code).toLowerCase()}else if(type=="click"||type=="dblclick"||type=="contextmenu"||type=="DOMMouseScroll"||type.indexOf("mouse")==0){var doc=win.document;doc=!doc.compatMode||doc.compatMode=="CSS1Compat"?doc.html:doc.body;this.page={x:event.pageX!=null?event.pageX:event.clientX+doc.scrollLeft,y:event.pageY!=
null?event.pageY:event.clientY+doc.scrollTop};this.client={x:event.pageX!=null?event.pageX-win.pageXOffset:event.clientX,y:event.pageY!=null?event.pageY-win.pageYOffset:event.clientY};if(type=="DOMMouseScroll"||type=="mousewheel")this.wheel=event.wheelDelta?event.wheelDelta/120:-(event.detail||0)/3;this.rightClick=event.which==3||event.button==2;if(type=="mouseover"||type=="mouseout"){for(var related=event.relatedTarget||event[(type=="mouseover"?"from":"to")+"Element"];related&&related.nodeType==
3;)related=related.parentNode;this.relatedTarget=document.id(related)}}else if(type.indexOf("touch")==0||type.indexOf("gesture")==0){this.rotation=event.rotation;this.scale=event.scale;this.targetTouches=event.targetTouches;this.changedTouches=event.changedTouches;var touches=this.touches=event.touches;if(touches&&touches[0]){var touch=touches[0];this.page={x:touch.pageX,y:touch.pageY};this.client={x:touch.clientX,y:touch.clientY}}}if(!this.client)this.client={};if(!this.page)this.page={}});DOMEvent.implement({stop:function(){return this.preventDefault().stopPropagation()},
stopPropagation:function(){if(this.event.stopPropagation)this.event.stopPropagation();else this.event.cancelBubble=true;return this},preventDefault:function(){if(this.event.preventDefault)this.event.preventDefault();else this.event.returnValue=false;return this}});DOMEvent.defineKey=function(code,key){_keys[code]=key;return this};DOMEvent.defineKeys=DOMEvent.defineKey.overloadSetter(true);DOMEvent.defineKeys({38:"up",40:"down",37:"left",39:"right",27:"esc",32:"space",8:"backspace",9:"tab",46:"delete",
13:"enter"})})();
(function(){var Class=this.Class=new Type("Class",function(params){if(instanceOf(params,Function))params={initialize:params};var newClass=function(){reset(this);if(newClass.$prototyping)return this;this.$caller=null;var value=this.initialize?this.initialize.apply(this,arguments):this;this.$caller=this.caller=null;return value}.extend(this).implement(params);newClass.$constructor=Class;newClass.prototype.$constructor=newClass;newClass.prototype.parent=parent;return newClass});var parent=function(){if(!this.$caller)throw new Error('The method "parent" cannot be called.');
var name=this.$caller.$name;var parent=this.$caller.$owner.parent;var previous=parent?parent.prototype[name]:null;if(!previous)throw new Error('The method "'+name+'" has no parent.');return previous.apply(this,arguments)};var reset=function(object){for(var key in object){var value=object[key];switch(typeOf(value)){case "object":var F=function(){};F.prototype=value;object[key]=reset(new F);break;case "array":object[key]=value.clone();break}}return object};var wrap=function(self,key,method){if(method.$origin)method=
method.$origin;var wrapper=function(){if(method.$protected&&this.$caller==null)throw new Error('The method "'+key+'" cannot be called.');var caller=this.caller;var current=this.$caller;this.caller=current;this.$caller=wrapper;var result=method.apply(this,arguments);this.$caller=current;this.caller=caller;return result}.extend({$owner:self,$origin:method,$name:key});return wrapper};var implement=function(key,value,retain){if(Class.Mutators.hasOwnProperty(key)){value=Class.Mutators[key].call(this,value);
if(value==null)return this}if(typeOf(value)=="function"){if(value.$hidden)return this;this.prototype[key]=retain?value:wrap(this,key,value)}else Object.merge(this.prototype,key,value);return this};var getInstance=function(klass){klass.$prototyping=true;var proto=new klass;delete klass.$prototyping;return proto};Class.implement("implement",implement.overloadSetter());Class.Mutators={Extends:function(parent){this.parent=parent;this.prototype=getInstance(parent)},Implements:function(items){Array.from(items).each(function(item){var instance=
new item;for(var key in instance)implement.call(this,key,instance[key],true)},this)}}})();
(function(){this.Chain=new Class({$chain:[],chain:function(){this.$chain.append(Array.flatten(arguments));return this},callChain:function(){return this.$chain.length?this.$chain.shift().apply(this,arguments):false},clearChain:function(){this.$chain.empty();return this}});var removeOn=function(string){return string.replace(/^on([A-Z])/,function(full,first){return first.toLowerCase()})};this.Events=new Class({$events:{},addEvent:function(type,fn,internal){type=removeOn(type);this.$events[type]=(this.$events[type]||
[]).include(fn);if(internal)fn.internal=true;return this},addEvents:function(events){for(var type in events)this.addEvent(type,events[type]);return this},fireEvent:function(type,args,delay){type=removeOn(type);var events=this.$events[type];if(!events)return this;args=Array.from(args);events.each(function(fn){if(delay)fn.delay(delay,this,args);else fn.apply(this,args)},this);return this},removeEvent:function(type,fn){type=removeOn(type);var events=this.$events[type];if(events&&!fn.internal){var index=
events.indexOf(fn);if(index!=-1)delete events[index]}return this},removeEvents:function(events){var type;if(typeOf(events)=="object"){for(type in events)this.removeEvent(type,events[type]);return this}if(events)events=removeOn(events);for(type in this.$events){if(events&&events!=type)continue;var fns=this.$events[type];for(var i=fns.length;i--;)if(i in fns)this.removeEvent(type,fns[i])}return this}});this.Options=new Class({setOptions:function(){var options=this.options=Object.merge.apply(null,[{},
this.options].append(arguments));if(this.addEvent)for(var option in options){if(typeOf(options[option])!="function"||!/^on[A-Z]/.test(option))continue;this.addEvent(option,options[option]);delete options[option]}return this}})})();if(typeof JSON=="undefined")this.JSON={};
(function(){var special={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};var escape=function(chr){return special[chr]||"\\u"+("0000"+chr.charCodeAt(0).toString(16)).slice(-4)};JSON.validate=function(string){string=string.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"");return/^[\],:{}\s]*$/.test(string)};JSON.encode=JSON.stringify?function(obj){return JSON.stringify(obj)}:
function(obj){if(obj&&obj.toJSON)obj=obj.toJSON();switch(typeOf(obj)){case "string":return'"'+obj.replace(/[\x00-\x1f\\"]/g,escape)+'"';case "array":return"["+obj.map(JSON.encode).clean()+"]";case "object":case "hash":var string=[];Object.each(obj,function(value,key){var json=JSON.encode(value);if(json)string.push(JSON.encode(key)+":"+json)});return"{"+string+"}";case "number":case "boolean":return""+obj;case "null":return"null"}return null};JSON.decode=function(string,secure){if(!string||typeOf(string)!=
"string")return null;if(secure||JSON.secure){if(JSON.parse)return JSON.parse(string);if(!JSON.validate(string))throw new Error("JSON could not decode the input; security is enabled and the value is not secure.");}return eval("("+string+")")}})();define("mootools",function(){});
define("galileo/prototype/array",["require","mootools"],function(require){require("mootools");Array.implement({reindex:function(indices){var ret=[];for(var ii=0;ii<indices.length;ii++)ret[ii]=this[indices[ii]];return ret},sortBy:function(picker){this.sort(function(x,y){var px=picker(x);var py=picker(y);return px<py?-1:px>py?1:0});return this},group:function(n){if(this.length<n)return[];var ret=this.slice(1).group(n);ret.unshift(this.slice(0,n));return ret},zipWith:function(that,fn){var len=Math.min(this.length,
that.length);var ret=[];for(var ii=0;ii<len;ii++)ret.push(fn(this[ii],that[ii],ii));return ret},shuffle:function(){for(var i=this.length-1;i>0;i--){var j=Math.floor(Math.random()*(i+1));var tmp=this[i];this[i]=this[j];this[j]=tmp}return this},find:function(testFunction){for(var i=0;i<this.length;i++)if(testFunction(this[i])===true)return this[i];return null}})});
define("galileo/prototype/function",["require","mootools"],function(require){require("mootools");Function.extend({id:function(x){return x},takeKey:function(){var args=Array.from(arguments);return function(o){for(var myArgs=args.slice(0);myArgs.length;)o=o[myArgs.shift()];return o}},join:function(){var fns=Array.from(arguments);var k=fns.pop();var results=[];var ctxt=this;var taken=0;fns.map(function(fn,ii){fn(function(result){if(!(ii in results))taken++;results[ii]=result;if(taken==fns.length)k.apply(ctxt,
results)})})}})});
define("galileo/util/dateUtil",["require","galileo/i18n/messageformat/locales","substitute","jquery","galileo/prototype/array","galileo/prototype/function"],function(require){function _localeFormat(date,fmt,formatMapping){var yy=date.getFullYear()%100;var substitutions={yyyy:date.getFullYear(),yy:yy>9?""+yy:"0"+yy,MMMM:months[date.getMonth()],MMM:shortMonths[date.getMonth()],MM:date.getMonth()>=9?""+(date.getMonth()+1):"0"+(date.getMonth()+1),M:""+(date.getMonth()+1),dd:date.getDate()>9?""+date.getDate():
"0"+date.getDate(),d:""+date.getDate(),EEEE:weekdays[date.getDay()],EEE:shortWeekdays[date.getDay()],E:extramin_weekdays[date.getDay()],HH:date.getHours()>9?""+date.getHours():"0"+date.getHours(),hh:""+(date.getHours()%12||12),mm:date.getMinutes()>9?""+date.getMinutes():"0"+date.getMinutes(),ss:date.getSeconds()>9?""+date.getSeconds():"0"+date.getSeconds(),H:""+date.getHours(),h:""+(date.getHours()%12||12),m:""+date.getMinutes(),s:""+date.getSeconds(),a:date.getHours()>=12?amPm[1]:amPm[0]};formatMapping=
formatMapping?formatMapping:localeFormats;if(!formatMapping[fmt]&&!substitutions[fmt])throw"Unsupported localized date format: "+fmt;if(substitutions[fmt])return substitutions[fmt];subRE=subRE||new RegExp("("+Object.keys(substitutions).sortBy(Function.takeKey("length")).reverse().join("|")+")","g");return formatMapping[fmt].replace(subRE,function(match){return substitutions[match]})}function _getStrings(str,defaultList){var ret=str.split(",").map(function(x){return x.trim()});return ret.length<=1?
defaultList:ret}function _getRelativeDate(dateTime,isDateFormatISO,formatMapping){var delta;var relativeDate="";var minute=60;var hour=minute*60;var day=hour*24;var week=day*7;var month=week*4;var year=month*12;var getMessage=function(key,num){return formatMapping[key]?substituteUtil(formatMapping[key],num):""};formatMapping=formatMapping?formatMapping:relativeDateMessageBundle;if(isDateFormatISO)try{dateTime=_getDateFromISO8601(dateTime,dateTime.charAt(dateTime.length-1)==="Z")}catch(e){if(console)console.log("_getRelativeDate: improperly formatted ISO8601 date string");
return""}delta=Math.floor(((new Date).getTime()-(new Date(dateTime)).getTime())/1E3);if($.isNumeric(delta))if(delta<30)relativeDate=getMessage("just_now",delta);else if(delta<minute)relativeDate=getMessage("seconds",delta);else if(delta<minute*2)relativeDate=getMessage("minute","1");else if(delta<hour)relativeDate=getMessage("minutes",Math.floor(delta/minute));else if(delta<hour*2)relativeDate=getMessage("hour","1");else if(delta<day)relativeDate=getMessage("hours",Math.floor(delta/hour));else if(delta<
day*2)relativeDate=getMessage("day","1");else if(delta<week)relativeDate=getMessage("days",Math.floor(delta/day));else if(delta<week*2)relativeDate=getMessage("week","1");else if(delta<month*3)relativeDate=getMessage("weeks",Math.floor(delta/week));else if(delta<year*2)relativeDate=getMessage("months",Math.floor(delta/month));else relativeDate=getMessage("years",Math.floor(delta/year));return relativeDate}function _getDateFromISO8601(dateString,doConversionToUTC){var dateParts=dateString.match(/([0-9]{4})(-([0-9]{2})(-([0-9]{2})(T([0-9]{2}):([0-9]{2})(:([0-9]{2})(\.([0-9]+))?)?(Z|(([-+])([0-9]{2}):([0-9]{2})))?)?)?)?/);
var offset=0;var date=new Date(dateParts[1],0,1);var convertedDate;if(dateParts[3])date.setMonth(dateParts[3]-1);if(dateParts[5])date.setDate(dateParts[5]);if(dateParts[7])date.setHours(dateParts[7]);if(dateParts[8])date.setMinutes(dateParts[8]);if(dateParts[10])date.setSeconds(dateParts[10]);if(dateParts[12])date.setMilliseconds(Number("0."+dateParts[12])*1E3);if(dateParts[14]){offset=Number(dateParts[16])*60+Number(dateParts[17]);offset*=dateParts[15]==="-"?1:-1}if(!doConversionToUTC)offset-=date.getTimezoneOffset();
convertedDate=new Date;convertedDate.setTime(Number(Number(date)+offset*60*1E3));return convertedDate}function _ajaxEncode(date){var pad=function(n){if((""+n).length===1)return"0"+n;return""+n};return date.getFullYear()+"-"+pad(date.getMonth()+1)+"-"+pad(date.getDate())}function _ajaxDecode(dateString){var parts=dateString.split(" ");var dateParts=parts[0].split("-");if(parts.length>1){var timeParts=parts[1].split(":");return new Date(dateParts[0],dateParts[1]-1,dateParts[2],timeParts[0],timeParts[1],
timeParts[2])}return new Date(dateParts[0],dateParts[1]-1,dateParts[2])}function _forTime(time){var parts=time.split(":");var ret=new Date;ret.setHours(parts[0]);ret.setMinutes(parts[1]);ret.setSeconds(0);ret.setMilliseconds(0);return ret}function _compute(type,fn){return function(date,n){var copy=new Date(date.getTime());copy["set"+type](copy["get"+type]()+fn(n));return copy}}var i18n=require("galileo/i18n/messageformat/locales");var substituteUtil=require("substitute");var $=require("jquery");require("galileo/prototype/array");
require("galileo/prototype/function");null;null;var relativeDateMessageBundle={just_now:"just now",seconds:"{0} secs ago",minute:"{0} min ago",minutes:"{0} mins ago",hour:"{0} hr ago",hours:"{0} hrs ago",day:"{0} day ago",days:"{0} days ago",week:"{0} wk ago",weeks:"{0} wks ago",months:"{0} months ago",years:"{0} years ago"};var localeFormats={"EEE, MMM d":"EEE, MMM d","EEE, M/d":"EEE, M/d","M/dd/yyyy":"yyyy-MM-dd","MMMM dd, yyyy":"MMMM dd, yyyy","MMM dd, yyyy":"MMM dd, yyyy",MMM:"MMM","MMM dd":"MMM dd",
"MMMM dd":"MMMM dd","MMM yyyy":"MMM yyyy","MMMM yyyy":"MMMM yyyy",EEE:"EEE","EEEE, MMMM dd":"EEEE, MMMM dd","EEE, MMM d, yyyy":"EEE, MMM d, yyyy","MMM d, hh:mm a":"MMM d, hh:mm a","MMM d, HH:mm":"MMM d, HH:mm","hh:mm a":"hh:mm a","hh:mm:ss":"hh:mm:ss","HH:mm":"HH:mm","HH:mm:ss":"HH:mm:ss","hh:mm":"hh:mm",hha:"hha"};var amPm=_getStrings("AM, PM",["AM","PM"]);var weekdays=_getStrings("Sunday, Monday, Tuesday, Wednesday, Thursday, Friday, Saturday",["Sunday","Monday","Tuesday","Wednesday","Thursday",
"Friday","Saturday"]);var shortWeekdays=_getStrings("Sun, Mon, Tue, Wed, Thu, Fri, Sat",["Sun","Mon","Tue","Wed","Thu","Fri","Sat"]);var extramin_weekdays=_getStrings("S,M,T,W,T,F,S",["S","M","T","W","T","F","S"]);var months=_getStrings("January, February, March, April, May, June, July, August, September, October, November, December",["January","February","March","April","May","June","July","August","September","October","November","December"]);var shortMonths=_getStrings("Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec",
["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]);var subRE;return{getRelativeDate:_getRelativeDate,getDateFromISO8601:_getDateFromISO8601,ajaxEncode:_ajaxEncode,ajaxDecode:_ajaxDecode,forTime:_forTime,plusMinutes:_compute("Time",function(n){return n*60*1E3}),minusMinutes:_compute("Time",function(n){return-(n*60*1E3)}),plusDays:_compute("Date",function(n){return n}),minusDays:_compute("Date",function(n){return-n}),plusWeeks:_compute("Date",function(n){return n*7}),minusWeeks:_compute("Date",
function(n){return-n*7}),plusMonths:_compute("Month",function(n){return n}),minusMonths:_compute("Month",function(n){return-n}),plusYears:_compute("FullYear",function(n){return n}),minusYears:_compute("FullYear",function(n){return-n}),localeFormat:_localeFormat,diff:function(date1,date2){return date1.getTime()-date2.getTime()},diffInSeconds:function(date1,date2,doNotFloor){var diff=this.diff(date1,date2)/1E3;return doNotFloor?diff:Math.abs(diff)!==diff?Math.ceil(diff):Math.floor(diff)},diffInMinutes:function(date1,
date2,doNotFloor){var diff=this.diffInSeconds(date1,date2,true)/60;return doNotFloor?diff:Math.abs(diff)!==diff?Math.ceil(diff):Math.floor(diff)},diffInHours:function(date1,date2,doNotFloor){var diff=this.diffInMinutes(date1,date2,true)/60;return doNotFloor?diff:Math.abs(diff)!==diff?Math.ceil(diff):Math.floor(diff)},diffInDays:function(date1,date2){return this.diffInHours(new Date(date1.toDateString()),new Date(date2.toDateString()))/24},getMonthNames:function(){return months},getShortMonthNames:function(){return shortMonths},
getWeekdayNames:function(){return weekdays},getShortWeekdayNames:function(){return shortWeekdays},isToday:function(date){if(!date)return false;return this.diffInDays(new Date,date)===0},isYesterday:function(date){if(!date)return false;return this.diffInDays(new Date,date)===1}}});
define("messages-deviceNames",["require","galileo/i18n/messageformat/locales"],function(require){var i18n=require("galileo/i18n/messageformat/locales");null;return{FLOJO:{name:"Aria",displayName:"Aria Scale"},KEPLER:{name:"Classic",displayName:"Classic Tracker"},VIRTUAL_KEPLER:{name:"Classic",displayName:"Classic Tracker"},TYCHO:{name:"Ultra",displayName:"Ultra Tracker"},GALILEO:{name:"Zip",displayName:"Zip Tracker"},HADRON:{name:"One",displayName:"One Tracker"},QUARK:{name:"Flex",displayName:"Flex Tracker"},
NEUTRINO:{name:"Force",displayName:"Force Tracker"},GRAVITON:{name:"Charge HR",displayName:"Charge HR Tracker"},TAU:{name:"Charge",displayName:"Charge Tracker"},PROTON:{name:"Surge",displayName:"Surge Tracker"}}});define("messages-batteryLevels",["require","galileo/i18n/messageformat/locales"],function(require){var i18n=require("galileo/i18n/messageformat/locales");null;return{empty:"Empty",low:"Low",medium:"Medium",high:"High",full:"Full",unknown:"???"}});
define("galileo/builder/text",["require","jquery"],function(require){require("jquery");return function(str,text){var keywords={italic:{"font-style":"italic"},bold:{"font-weight":"bold"},uppercase:{"text-transform":"uppercase"},underline:{"text-decoration":"underline"},nounderline:{"text-decoration":"none"}};var parts=str.split(/(?:\s|\/)+/);for(var style={};parts.length&&parts[0]in keywords;)Object.merge(style,keywords[parts.shift()]);var fontRE=/\d+(\.\d*)?(px|em|%|pt|en)/;if(parts.length&&parts[0].match(fontRE))Object.merge(style,
{"font-size":parts.shift()});if(parts.length&&parts[0].match(fontRE))Object.merge(style,{"line-height":parts.shift()});if(parts.getLast()&&parts.getLast().indexOf("#")==0)Object.merge(style,{color:parts.pop()});var fontFamily=parts.join(" ").trim();if(fontFamily!="")Object.merge(style,{fontFamily:fontFamily});return $("\x3cspan\x3e").css(style).text(text)}});
define("galileo/builder/util",["require","./text"],function(require){function legend(color,text){return $("\x3cspan\x3e").append($("\x3cspan\x3e").css("display","inline-block").width(10).height(10).css("backgroundColor",color),hspace(10),Text("uppercase 12px #666",text))}function hspace(n){return $("\x3cspan\x3e").css("display","inline-block").width(n)}function vspace(n){return $("\x3cp\x3e").html("\x26nbsp").height(n)}function vline(width,height,color){return hspace(width).css("height",height).css("background-color",
color)}var Text=require("./text");return{hspace:hspace,vspace:vspace,vline:vline,legend:legend}});define("galileo/prototype/number",["require","mootools"],function(require){require("mootools");Number.withDigits=function(x,n){return Math.round(x*Math.pow(10,n))/Math.pow(10,n)};Number.implement({mod:function(n){return(this%n+n)%n}})});define("galileo/prototype/all",["require","./function","./array","./number"],function(require){require("./function");require("./array");require("./number")});
define("galileo/widget/tabs",["require","galileo/prototype/all"],function(require){require("galileo/prototype/all");return function(tabs,defaultStyle,selectedStyle,initialSelection){function selectTab(tabName){if(selected===tabName)return;selected=tabName;tabs.each(function(tab){if(tab[0]==tabName)tab[1]()});Object.each(tabElems,function(elem,name){if(name==tabName)elem.css(selectedStyle);else elem.css(unselect)})}var list=$("\x3cul\x3e").css("listStyle","none");var tabElems={};var selected=null;
var unselect=null;tabs.each(function(tabRecord){var tabName=tabRecord[0];tabElems[tabName]=$("\x3cli\x3e").css("display","inline-block").text(tabName).click(function(){selectTab(tabName)}).css(defaultStyle).appendTo(list);if(!unselect){unselect={};Object.keys(selectedStyle).each(function(styleName){unselect[styleName]=tabElems[tabName].css(styleName)})}});selectTab(initialSelection||tabs[0][0]);return list}});
define("shared/scripts/modal",["require","jquery"],function(require){var $=require("jquery");var win;var doc;return function(fn){function position(){var width=win.width();var height=win.height();var diagWidth=dialog.width();var diagHeight=dialog.height();var styles={};styles.left=width>=diagWidth?computeCenter(width,diagWidth)+doc.scrollLeft():doc.scrollLeft();styles.top=height>=diagHeight?computeCenter(height,diagHeight)+doc.scrollTop():doc.scrollTop();dialog.css(styles)}function computeCenter(a,
b){return(a+b)/2-b}function close(){overlay.animate({"opacity":0},{duration:250,complete:function(){overlay.detach()}});win.off("resize",position);doc.off("keydown",docClose);onCloseCallback()}function docClose(e){e.keyCode==27&&close()}win=win||$(window);doc=doc||$(document);var overlay=$("\x3cdiv\x3e").addClass("backdrop").css({position:"absolute",left:0,top:0,right:0,bottom:0,zIndex:1E3});$("\x3cdiv\x3e").addClass("overlay").css({position:"absolute",left:0,top:0,right:0,bottom:0,opacity:.5,backgroundColor:"#000"}).appendTo(overlay).on("click",
function(ev){if(this==ev.target)close()});overlay.appendTo($("body").css({position:"relative"})).fadeIn(250);var onCloseCallback=function(){};var dialog=fn(close);dialog.appendTo(overlay);dialog.find(".close").on("click",close);doc.on("keydown",docClose);position();win.on("resize",position);return{dialog:dialog,close:close,onClose:function(cb){onCloseCallback=cb},position:position,overlay:overlay}}});
define("galileo/modal/flex101",["require","galileo/builder/util","galileo/builder/text","galileo/i18n/messageformat/locales","galileo/widget/tabs","shared/scripts/modal"],function(require){function txt(header,content){var ret=$("\x3cdiv\x3e").append(Text("bold 16px/22px #333",header),$("\x3cbr\x3e"),Text("14px/17px #333","").html(content));ret.find("a").css({color:"#ff4588"});return ret}function link(text,href){return"\x3ca href\x3d'"+href+"'\x3e"+text+"\x3c/a\x3e"}function goals(){return $("\x3cdiv\x3e").append(Text("bold 16px/22px #333",
"Goals"),$("\x3cbr\x3e"),Text("14px/17px #333","On the dashboard, see your progress towards goals for:"),$("\x3cbr\x3e"),$("\x3cbr\x3e"),$("\x3cdiv\x3e").css({width:200,display:"inline-block"}).append(Text("14px/17px #333","\u2022 "+"Steps"),$("\x3cbr\x3e"),Text("14px/17px #333","\u2022 "+"Calories Burned")),$("\x3cdiv\x3e").css({width:200,display:"inline-block"}).append(Text("14px/17px #333","\u2022 "+"Distance"),$("\x3cbr\x3e"),Text("14px/17px #333","\u2022 "+"Very Active Minutes")))}function img(x){return $("\x3cimg\x3e").attr("src",
"/images/dashboard/galileo/flex101/"+x+".png")}function flex101(ims,texts){return $("\x3cdiv\x3e").append(line(ims[0],texts[0]),hline(),line(ims[1],texts[1]),hline(),line(ims[2],texts[2]))}function hline(){return $("\x3cdiv\x3e").html("\x26nbsp").css({height:1,backgroundColor:"#ccc"})}function line(im,text){return $("\x3cdiv\x3e").append(B.vspace(23),B.hspace(15),im,B.hspace(27),$("\x3cdiv\x3e").css({width:407,display:"inline-block"}).append(text),B.vspace(23))}var B=require("galileo/builder/util");
var Text=require("galileo/builder/text");var i18n=require("galileo/i18n/messageformat/locales");var Tabs=require("galileo/widget/tabs");null;var allTexts=[txt("Charging","Your tracker battery lasts for about 5 days. To charge it, remove the tracker from the band and place it in the charger until all 5 lights are blinking."),txt("Syncing","When your Flex is within 20 feet of the Wireless Sync Dongle, your Flex will sync automatically with your Fitbit account. You can also sync via your smartphone if it supports Bluetooth Low Energy (4.0). Learn more about {0} or about {1}.".substitute([link("Supported Devices",
"/devices"),link("Syncing","https://help.fitbit.com/customer/portal/articles/896922")])),txt("Wearing","Your Flex tracker should be placed inside the included wristband and worn on your non-dominant hand for best results. Flex is water resistant and can be worn in the shower and out in the rain."),goals(),txt("Goal Progress","Each light on your Flex tracker represents 20% of your goal. When you reach your goal, Flex will buzz and flash in celebration of your achievement."),txt("Changing Goals","To choose which goal is shown on your Flex display, go to {0} in your account. You can change a goal amount on the corresponding Dashboard tile.".substitute([link("Device Settings",
"/settings/device")])),txt("Tracking Sleep","Sleep tracking can be turned on by tapping the top of the Flex display area until you feel the motor vibrate and the 2 outer lights turn on. Once in sleep tracking mode, the Tracker will show two lights moving side-to-side. When you're awake and want to stop sleep tracking, repeat the taps until you feel the motor vibrate and see all lights flash. The iPhone and Android apps also allow you to start and stop a sleep recording."),txt("Forgot to turn on sleep tracking?",
"You can add a sleep log on the website or mobile app. Go to the Sleep section and add a sleep log. Need help? {0}.".substitute([link("Learn More","https://help.fitbit.com/customer/portal/articles/176101-can-i-log-my-sleep-if-i-didn%E2%80%99t-put-my-fitbit-one-or-ultra-tracker-into-sleep-mode")])),txt("Silent Alarms","Set a Silent Alarm from the {0} of your account.".substitute([link("Devices area","/settings/alarms")]))];return function(){return require("shared/scripts/modal")(function(close){var container=
$("\x3cdiv\x3e");return $("\x3cdiv\x3e").css({padding:31,backgroundColor:"white",width:500,position:"fixed"}).append(Tabs([["Basics",function(){container.empty().append(flex101([img("11"),img("12"),img("13")],allTexts.slice(0,3)))}],["Goals",function(){container.empty().append(flex101([img("21"),img("22"),img("23")],allTexts.slice(3,6)))}],["Sleep",function(){container.empty().append(flex101([img("31"),img("32"),img("33")],allTexts.slice(6,9)))}]],{fontSize:"12px",fontWeight:"bold",color:"#999",cursor:"pointer",
lineHeight:"23px",textTransform:"uppercase",padding:"0px 12px",borderBottom:"2px solid #999"},{color:"#333",borderBottom:"2px solid #55c2c2",cursor:"default"},"Basics").css("float","right"),Text("bold 25px #55c2c2","Flex 101"),$("\x3cbr\x3e"),B.vspace(61),container,B.vspace(20),Text("bold 18px/30px #fff","x").css({position:"absolute",right:-30,top:0,width:30,backgroundColor:"black",textAlign:"center",cursor:"pointer"}).click(close))})}});
(function(){var Handlebars$$0={};(function(Handlebars,undefined){Handlebars.VERSION="1.0.0-rc.3";Handlebars.COMPILER_REVISION=2;Handlebars.REVISION_CHANGES={1:"\x3c\x3d 1.0.rc.2",2:"\x3e\x3d 1.0.0-rc.3"};Handlebars.helpers={};Handlebars.partials={};Handlebars.registerHelper=function(name,fn,inverse){if(inverse)fn.not=inverse;this.helpers[name]=fn};Handlebars.registerPartial=function(name,str){this.partials[name]=str};Handlebars.registerHelper("helperMissing",function(arg){if(arguments.length===2)return undefined;
else throw new Error("Could not find property '"+arg+"'");});var toString=Object.prototype.toString;var functionType="[object Function]";Handlebars.registerHelper("blockHelperMissing",function(context,options){var inverse=options.inverse||function(){};var fn=options.fn;var type=toString.call(context);if(type===functionType)context=context.call(this);if(context===true)return fn(this);else if(context===false||context==null)return inverse(this);else if(type==="[object Array]")if(context.length>0)return Handlebars.helpers.each(context,
options);else return inverse(this);else return fn(context)});Handlebars.K=function(){};Handlebars.createFrame=Object.create||function(object){Handlebars.K.prototype=object;var obj=new Handlebars.K;Handlebars.K.prototype=null;return obj};Handlebars.logger={DEBUG:0,INFO:1,WARN:2,ERROR:3,level:3,methodMap:{0:"debug",1:"info",2:"warn",3:"error"},log:function(level,obj){if(Handlebars.logger.level<=level){var method=Handlebars.logger.methodMap[level];if(typeof console!=="undefined"&&console[method])console[method].call(console,
obj)}}};Handlebars.log=function(level,obj){Handlebars.logger.log(level,obj)};Handlebars.registerHelper("each",function(context,options){var fn=options.fn;var inverse=options.inverse;var i=0;var ret="";var data;if(options.data)data=Handlebars.createFrame(options.data);if(context&&typeof context==="object")if(context instanceof Array)for(var j=context.length;i<j;i++){if(data)data.index=i;ret=ret+fn(context[i],{data:data})}else for(var key in context)if(context.hasOwnProperty(key)){if(data)data.key=
key;ret=ret+fn(context[key],{data:data});i++}if(i===0)ret=inverse(this);return ret});Handlebars.registerHelper("if",function(context,options){var type=toString.call(context);if(type===functionType)context=context.call(this);if(!context||Handlebars.Utils.isEmpty(context))return options.inverse(this);else return options.fn(this)});Handlebars.registerHelper("unless",function(context,options){return Handlebars.helpers["if"].call(this,context,{fn:options.inverse,inverse:options.fn})});Handlebars.registerHelper("with",
function(context,options){return options.fn(context)});Handlebars.registerHelper("log",function(context,options){var level=options.data&&options.data.level!=null?parseInt(options.data.level,10):1;Handlebars.log(level,context)})})(Handlebars$$0);var errorProps=["description","fileName","lineNumber","message","name","number","stack"];Handlebars$$0.Exception=function(message){var tmp=Error.prototype.constructor.apply(this,arguments);for(var idx=0;idx<errorProps.length;idx++)this[errorProps[idx]]=tmp[errorProps[idx]]};
Handlebars$$0.Exception.prototype=new Error;Handlebars$$0.SafeString=function(string){this.string=string};Handlebars$$0.SafeString.prototype.toString=function(){return this.string.toString()};(function(){var escape={"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;","`":"\x26#x60;"};var badChars=/[&<>"'`]/g;var possible=/[&<>"'`]/;var escapeChar=function(chr){return escape[chr]||"\x26amp;"};Handlebars$$0.Utils={escapeExpression:function(string){if(string instanceof
Handlebars$$0.SafeString)return string.toString();else if(string==null||string===false)return"";if(!possible.test(string))return string;return string.replace(badChars,escapeChar)},isEmpty:function(value){if(!value&&value!==0)return true;else if(Object.prototype.toString.call(value)==="[object Array]"&&value.length===0)return true;else return false}}})();Handlebars$$0.Compiler=function(){};Handlebars$$0.JavaScriptCompiler=function(){};(function(Compiler,JavaScriptCompiler){Compiler.prototype={compiler:Compiler,
disassemble:function(){var opcodes=this.opcodes;var opcode;var out=[];var params;var param;var i=0;for(var l=opcodes.length;i<l;i++){opcode=opcodes[i];if(opcode.opcode==="DECLARE")out.push("DECLARE "+opcode.name+"\x3d"+opcode.value);else{params=[];for(var j=0;j<opcode.args.length;j++){param=opcode.args[j];if(typeof param==="string")param='"'+param.replace("\n","\\n")+'"';params.push(param)}out.push(opcode.opcode+" "+params.join(" "))}}return out.join("\n")},equals:function(other){var len=this.opcodes.length;
if(other.opcodes.length!==len)return false;for(var i=0;i<len;i++){var opcode=this.opcodes[i];var otherOpcode=other.opcodes[i];if(opcode.opcode!==otherOpcode.opcode||opcode.args.length!==otherOpcode.args.length)return false;for(var j=0;j<opcode.args.length;j++)if(opcode.args[j]!==otherOpcode.args[j])return false}len=this.children.length;if(other.children.length!==len)return false;for(i=0;i<len;i++)if(!this.children[i].equals(other.children[i]))return false;return true},guid:0,compile:function(program,
options){this.children=[];this.depths={list:[]};this.options=options;var knownHelpers=this.options.knownHelpers;this.options.knownHelpers={"helperMissing":true,"blockHelperMissing":true,"each":true,"if":true,"unless":true,"with":true,"log":true};if(knownHelpers)for(var name in knownHelpers)this.options.knownHelpers[name]=knownHelpers[name];return this.program(program)},accept:function(node){return this[node.type](node)},program:function(program){var statements=program.statements;var statement;this.opcodes=
[];var i=0;for(var l=statements.length;i<l;i++){statement=statements[i];this[statement.type](statement)}this.isSimple=l===1;this.depths.list=this.depths.list.sort(function(a,b){return a-b});return this},compileProgram:function(program){var result=(new this.compiler).compile(program,this.options);var guid=this.guid++;var depth;this.usePartial=this.usePartial||result.usePartial;this.children[guid]=result;var i=0;for(var l=result.depths.list.length;i<l;i++){depth=result.depths.list[i];if(depth<2)continue;
else this.addDepth(depth-1)}return guid},block:function(block){var mustache=block.mustache;var program=block.program;var inverse=block.inverse;if(program)program=this.compileProgram(program);if(inverse)inverse=this.compileProgram(inverse);var type=this.classifyMustache(mustache);if(type==="helper")this.helperMustache(mustache,program,inverse);else if(type==="simple"){this.simpleMustache(mustache);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("emptyHash");this.opcode("blockValue")}else{this.ambiguousMustache(mustache,
program,inverse);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("emptyHash");this.opcode("ambiguousBlockValue")}this.opcode("append")},hash:function(hash){var pairs=hash.pairs;var pair;var val;this.opcode("pushHash");var i=0;for(var l=pairs.length;i<l;i++){pair=pairs[i];val=pair[1];if(this.options.stringParams)this.opcode("pushStringParam",val.stringModeValue,val.type);else this.accept(val);this.opcode("assignToHash",pair[0])}this.opcode("popHash")},partial:function(partial){var partialName=
partial.partialName;this.usePartial=true;if(partial.context)this.ID(partial.context);else this.opcode("push","depth0");this.opcode("invokePartial",partialName.name);this.opcode("append")},content:function(content){this.opcode("appendContent",content.string)},mustache:function(mustache){var options=this.options;var type=this.classifyMustache(mustache);if(type==="simple")this.simpleMustache(mustache);else if(type==="helper")this.helperMustache(mustache);else this.ambiguousMustache(mustache);if(mustache.escaped&&
!options.noEscape)this.opcode("appendEscaped");else this.opcode("append")},ambiguousMustache:function(mustache,program,inverse){var id=mustache.id;var name=id.parts[0];var isBlock=program!=null||inverse!=null;this.opcode("getContext",id.depth);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);this.opcode("invokeAmbiguous",name,isBlock)},simpleMustache:function(mustache){var id=mustache.id;if(id.type==="DATA")this.DATA(id);else if(id.parts.length)this.ID(id);else{this.addDepth(id.depth);
this.opcode("getContext",id.depth);this.opcode("pushContext")}this.opcode("resolvePossibleLambda")},helperMustache:function(mustache,program,inverse){var params=this.setupFullMustacheParams(mustache,program,inverse);var name=mustache.id.parts[0];if(this.options.knownHelpers[name])this.opcode("invokeKnownHelper",params.length,name);else if(this.knownHelpersOnly)throw new Error("You specified knownHelpersOnly, but used the unknown helper "+name);else this.opcode("invokeHelper",params.length,name)},
ID:function(id){this.addDepth(id.depth);this.opcode("getContext",id.depth);var name=id.parts[0];if(!name)this.opcode("pushContext");else this.opcode("lookupOnContext",id.parts[0]);var i=1;for(var l=id.parts.length;i<l;i++)this.opcode("lookup",id.parts[i])},DATA:function(data){this.options.data=true;this.opcode("lookupData",data.id)},STRING:function(string){this.opcode("pushString",string.string)},INTEGER:function(integer){this.opcode("pushLiteral",integer.integer)},BOOLEAN:function(bool){this.opcode("pushLiteral",
bool.bool)},comment:function(){},opcode:function(name){this.opcodes.push({opcode:name,args:[].slice.call(arguments,1)})},declare:function(name,value){this.opcodes.push({opcode:"DECLARE",name:name,value:value})},addDepth:function(depth){if(isNaN(depth))throw new Error("EWOT");if(depth===0)return;if(!this.depths[depth]){this.depths[depth]=true;this.depths.list.push(depth)}},classifyMustache:function(mustache){var isHelper=mustache.isHelper;var isEligible=mustache.eligibleHelper;var options=this.options;
if(isEligible&&!isHelper){var name=mustache.id.parts[0];if(options.knownHelpers[name])isHelper=true;else if(options.knownHelpersOnly)isEligible=false}if(isHelper)return"helper";else if(isEligible)return"ambiguous";else return"simple"},pushParams:function(params){var i=params.length;for(var param;i--;){param=params[i];if(this.options.stringParams){if(param.depth)this.addDepth(param.depth);this.opcode("getContext",param.depth||0);this.opcode("pushStringParam",param.stringModeValue,param.type)}else this[param.type](param)}},
setupMustacheParams:function(mustache){var params=mustache.params;this.pushParams(params);if(mustache.hash)this.hash(mustache.hash);else this.opcode("emptyHash");return params},setupFullMustacheParams:function(mustache,program,inverse){var params=mustache.params;this.pushParams(params);this.opcode("pushProgram",program);this.opcode("pushProgram",inverse);if(mustache.hash)this.hash(mustache.hash);else this.opcode("emptyHash");return params}};var Literal=function(value){this.value=value};JavaScriptCompiler.prototype=
{nameLookup:function(parent,name){if(/^[0-9]+$/.test(name))return parent+"["+name+"]";else if(JavaScriptCompiler.isValidJavaScriptVariableName(name))return parent+"."+name;else return parent+"['"+name+"']"},appendToBuffer:function(string){if(this.environment.isSimple)return"return "+string+";";else return{appendToBuffer:true,content:string,toString:function(){return"buffer +\x3d "+string+";"}}},initializeBuffer:function(){return this.quotedString("")},namespace:"Handlebars",compile:function(environment,
options,context,asObject){this.environment=environment;this.options=options||{};Handlebars$$0.log(Handlebars$$0.logger.DEBUG,this.environment.disassemble()+"\n\n");this.name=this.environment.name;this.isChild=!!context;this.context=context||{programs:[],environments:[],aliases:{}};this.preamble();this.stackSlot=0;this.stackVars=[];this.registers={list:[]};this.compileStack=[];this.inlineStack=[];this.compileChildren(environment,options);var opcodes=environment.opcodes;var opcode;this.i=0;for(l$$0=
opcodes.length;this.i<l$$0;this.i++){opcode=opcodes[this.i];if(opcode.opcode==="DECLARE")this[opcode.name]=opcode.value;else this[opcode.opcode].apply(this,opcode.args)}return this.createFunctionContext(asObject)},nextOpcode:function(){var opcodes=this.environment.opcodes;return opcodes[this.i+1]},eat:function(){this.i=this.i+1},preamble:function(){var out=[];if(!this.isChild){var namespace=this.namespace;var copies="helpers \x3d helpers || "+namespace+".helpers;";if(this.environment.usePartial)copies=
copies+" partials \x3d partials || "+namespace+".partials;";if(this.options.data)copies=copies+" data \x3d data || {};";out.push(copies)}else out.push("");if(!this.environment.isSimple)out.push(", buffer \x3d "+this.initializeBuffer());else out.push("");this.lastContext=0;this.source=out},createFunctionContext:function(asObject){var locals=this.stackVars.concat(this.registers.list);if(locals.length>0)this.source[1]=this.source[1]+", "+locals.join(", ");if(!this.isChild)for(var alias in this.context.aliases)this.source[1]=
this.source[1]+", "+alias+"\x3d"+this.context.aliases[alias];if(this.source[1])this.source[1]="var "+this.source[1].substring(2)+";";if(!this.isChild)this.source[1]+="\n"+this.context.programs.join("\n")+"\n";if(!this.environment.isSimple)this.source.push("return buffer;");var params=this.isChild?["depth0","data"]:["Handlebars","depth0","helpers","partials","data"];var i=0;for(var l=this.environment.depths.list.length;i<l;i++)params.push("depth"+this.environment.depths.list[i]);var source=this.mergeSource();
if(!this.isChild){var revision=Handlebars$$0.COMPILER_REVISION;var versions=Handlebars$$0.REVISION_CHANGES[revision];source="this.compilerInfo \x3d ["+revision+",'"+versions+"'];\n"+source}if(asObject){params.push(source);return Function.apply(this,params)}else{var functionSource="function "+(this.name||"")+"("+params.join(",")+") {\n  "+source+"}";Handlebars$$0.log(Handlebars$$0.logger.DEBUG,functionSource+"\n\n");return functionSource}},mergeSource:function(){var source="";var buffer;var i=0;for(var len=
this.source.length;i<len;i++){var line=this.source[i];if(line.appendToBuffer)if(buffer)buffer=buffer+"\n    + "+line.content;else buffer=line.content;else{if(buffer){source+="buffer +\x3d "+buffer+";\n  ";buffer=undefined}source+=line+"\n  "}}return source},blockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var params=["depth0"];this.setupParams(0,params);this.replaceStack(function(current){params.splice(1,0,current);return"blockHelperMissing.call("+params.join(", ")+
")"})},ambiguousBlockValue:function(){this.context.aliases.blockHelperMissing="helpers.blockHelperMissing";var params=["depth0"];this.setupParams(0,params);var current=this.topStack();params.splice(1,0,current);params[params.length-1]="options";this.source.push("if (!"+this.lastHelper+") { "+current+" \x3d blockHelperMissing.call("+params.join(", ")+"); }")},appendContent:function(content){this.source.push(this.appendToBuffer(this.quotedString(content)))},append:function(){this.flushInline();var local=
this.popStack();this.source.push("if("+local+" || "+local+" \x3d\x3d\x3d 0) { "+this.appendToBuffer(local)+" }");if(this.environment.isSimple)this.source.push("else { "+this.appendToBuffer("''")+" }")},appendEscaped:function(){this.context.aliases.escapeExpression="this.escapeExpression";this.source.push(this.appendToBuffer("escapeExpression("+this.popStack()+")"))},getContext:function(depth){if(this.lastContext!==depth)this.lastContext=depth},lookupOnContext:function(name){this.push(this.nameLookup("depth"+
this.lastContext,name,"context"))},pushContext:function(){this.pushStackLiteral("depth"+this.lastContext)},resolvePossibleLambda:function(){this.context.aliases.functionType='"function"';this.replaceStack(function(current){return"typeof "+current+" \x3d\x3d\x3d functionType ? "+current+".apply(depth0) : "+current})},lookup:function(name){this.replaceStack(function(current){return current+" \x3d\x3d null || "+current+" \x3d\x3d\x3d false ? "+current+" : "+this.nameLookup(current,name,"context")})},
lookupData:function(id){this.push(this.nameLookup("data",id,"data"))},pushStringParam:function(string,type){this.pushStackLiteral("depth"+this.lastContext);this.pushString(type);if(typeof string==="string")this.pushString(string);else this.pushStackLiteral(string)},emptyHash:function(){this.pushStackLiteral("{}");if(this.options.stringParams)this.register("hashTypes","{}")},pushHash:function(){this.hash={values:[],types:[]}},popHash:function(){var hash=this.hash;this.hash=undefined;if(this.options.stringParams)this.register("hashTypes",
"{"+hash.types.join(",")+"}");this.push("{\n    "+hash.values.join(",\n    ")+"\n  }")},pushString:function(string){this.pushStackLiteral(this.quotedString(string))},push:function(expr){this.inlineStack.push(expr);return expr},pushLiteral:function(value){this.pushStackLiteral(value)},pushProgram:function(guid){if(guid!=null)this.pushStackLiteral(this.programExpression(guid));else this.pushStackLiteral(null)},invokeHelper:function(paramSize,name$$0){this.context.aliases.helperMissing="helpers.helperMissing";
var helper=this.lastHelper=this.setupHelper(paramSize,name$$0,true);this.push(helper.name);this.replaceStack(function(name){return name+" ? "+name+".call("+helper.callParams+") "+": helperMissing.call("+helper.helperMissingParams+")"})},invokeKnownHelper:function(paramSize,name){var helper=this.setupHelper(paramSize,name);this.push(helper.name+".call("+helper.callParams+")")},invokeAmbiguous:function(name,helperCall){this.context.aliases.functionType='"function"';this.pushStackLiteral("{}");var helper=
this.setupHelper(0,name,helperCall);var helperName=this.lastHelper=this.nameLookup("helpers",name,"helper");var nonHelper=this.nameLookup("depth"+this.lastContext,name,"context");var nextStack=this.nextStack();this.source.push("if ("+nextStack+" \x3d "+helperName+") { "+nextStack+" \x3d "+nextStack+".call("+helper.callParams+"); }");this.source.push("else { "+nextStack+" \x3d "+nonHelper+"; "+nextStack+" \x3d typeof "+nextStack+" \x3d\x3d\x3d functionType ? "+nextStack+".apply(depth0) : "+nextStack+
"; }")},invokePartial:function(name){var params=[this.nameLookup("partials",name,"partial"),"'"+name+"'",this.popStack(),"helpers","partials"];if(this.options.data)params.push("data");this.context.aliases.self="this";this.push("self.invokePartial("+params.join(", ")+")")},assignToHash:function(key){var value=this.popStack();var type;if(this.options.stringParams){type=this.popStack();this.popStack()}var hash=this.hash;if(type)hash.types.push("'"+key+"': "+type);hash.values.push("'"+key+"': ("+value+
")")},compiler:JavaScriptCompiler,compileChildren:function(environment,options){var children=environment.children;var child;var compiler;var i=0;for(var l=children.length;i<l;i++){child=children[i];compiler=new this.compiler;var index=this.matchExistingProgram(child);if(index==null){this.context.programs.push("");index=this.context.programs.length;child.index=index;child.name="program"+index;this.context.programs[index]=compiler.compile(child,options,this.context);this.context.environments[index]=
child}else{child.index=index;child.name="program"+index}}},matchExistingProgram:function(child){var i=0;for(var len=this.context.environments.length;i<len;i++){var environment=this.context.environments[i];if(environment&&environment.equals(child))return i}},programExpression:function(guid){this.context.aliases.self="this";if(guid==null)return"self.noop";var child=this.environment.children[guid];var depths=child.depths.list;var depth;var programParams=[child.index,child.name,"data"];var i=0;for(var l=
depths.length;i<l;i++){depth=depths[i];if(depth===1)programParams.push("depth0");else programParams.push("depth"+(depth-1))}if(depths.length===0)return"self.program("+programParams.join(", ")+")";else{programParams.shift();return"self.programWithDepth("+programParams.join(", ")+")"}},register:function(name,val){this.useRegister(name);this.source.push(name+" \x3d "+val+";")},useRegister:function(name){if(!this.registers[name]){this.registers[name]=true;this.registers.list.push(name)}},pushStackLiteral:function(item){return this.push(new Literal(item))},
pushStack:function(item){this.flushInline();var stack=this.incrStack();if(item)this.source.push(stack+" \x3d "+item+";");this.compileStack.push(stack);return stack},replaceStack:function(callback){var prefix="";var inline=this.isInline();var stack;if(inline){var top=this.popStack(true);if(top instanceof Literal)stack=top.value;else{var name=this.stackSlot?this.topStackName():this.incrStack();prefix="("+this.push(name)+" \x3d "+top+"),";stack=this.topStack()}}else stack=this.topStack();var item=callback.call(this,
stack);if(inline){if(this.inlineStack.length||this.compileStack.length)this.popStack();this.push("("+prefix+item+")")}else{if(!/^stack/.test(stack))stack=this.nextStack();this.source.push(stack+" \x3d ("+prefix+item+");")}return stack},nextStack:function(){return this.pushStack()},incrStack:function(){this.stackSlot++;if(this.stackSlot>this.stackVars.length)this.stackVars.push("stack"+this.stackSlot);return this.topStackName()},topStackName:function(){return"stack"+this.stackSlot},flushInline:function(){var inlineStack=
this.inlineStack;if(inlineStack.length){this.inlineStack=[];var i=0;for(var len=inlineStack.length;i<len;i++){var entry=inlineStack[i];if(entry instanceof Literal)this.compileStack.push(entry);else this.pushStack(entry)}}},isInline:function(){return this.inlineStack.length},popStack:function(wrapped){var inline=this.isInline();var item=(inline?this.inlineStack:this.compileStack).pop();if(!wrapped&&item instanceof Literal)return item.value;else{if(!inline)this.stackSlot--;return item}},topStack:function(wrapped){var stack=
this.isInline()?this.inlineStack:this.compileStack;var item=stack[stack.length-1];if(!wrapped&&item instanceof Literal)return item.value;else return item},quotedString:function(str){return'"'+str.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r")+'"'},setupHelper:function(paramSize,name,missingParams){var params=[];this.setupParams(paramSize,params,missingParams);var foundHelper=this.nameLookup("helpers",name,"helper");return{params:params,name:foundHelper,callParams:["depth0"].concat(params).join(", "),
helperMissingParams:missingParams&&["depth0",this.quotedString(name)].concat(params).join(", ")}},setupParams:function(paramSize,params,useRegister){var options=[];var contexts=[];var types=[];var param;var inverse;var program;options.push("hash:"+this.popStack());inverse=this.popStack();program=this.popStack();if(program||inverse){if(!program){this.context.aliases.self="this";program="self.noop"}if(!inverse){this.context.aliases.self="this";inverse="self.noop"}options.push("inverse:"+inverse);options.push("fn:"+
program)}for(var i=0;i<paramSize;i++){param=this.popStack();params.push(param);if(this.options.stringParams){types.push(this.popStack());contexts.push(this.popStack())}}if(this.options.stringParams){options.push("contexts:["+contexts.join(",")+"]");options.push("types:["+types.join(",")+"]");options.push("hashTypes:hashTypes")}if(this.options.data)options.push("data:data");options="{"+options.join(",")+"}";if(useRegister){this.register("options",options);params.push("options")}else params.push(options);
return params.join(", ")}};var reservedWords=("break else new var"+" case finally return void"+" catch for switch while"+" continue function this with"+" default if throw"+" delete in try"+" do instanceof typeof"+" abstract enum int short"+" boolean export interface static"+" byte extends long super"+" char final native synchronized"+" class float package throws"+" const goto private transient"+" debugger implements protected volatile"+" double import public let yield").split(" ");var compilerWords=
JavaScriptCompiler.RESERVED_WORDS={};var i$$0=0;for(var l$$0=reservedWords.length;i$$0<l$$0;i$$0++)compilerWords[reservedWords[i$$0]]=true;JavaScriptCompiler.isValidJavaScriptVariableName=function(name){if(!JavaScriptCompiler.RESERVED_WORDS[name]&&/^[a-zA-Z_$][0-9a-zA-Z_$]+$/.test(name))return true;return false};Handlebars$$0.VM={template:function(templateSpec){var container={escapeExpression:Handlebars$$0.Utils.escapeExpression,invokePartial:Handlebars$$0.VM.invokePartial,programs:[],program:function(i,
fn,data){var programWrapper=this.programs[i];if(data)return Handlebars$$0.VM.program(fn,data);else if(programWrapper)return programWrapper;else{programWrapper=this.programs[i]=Handlebars$$0.VM.program(fn);return programWrapper}},programWithDepth:Handlebars$$0.VM.programWithDepth,noop:Handlebars$$0.VM.noop,compilerInfo:null};return function(context,options){options=options||{};var result=templateSpec.call(container,Handlebars$$0,context,options.helpers,options.partials,options.data);var compilerInfo=
container.compilerInfo||[];var compilerRevision=compilerInfo[0]||1;var currentRevision=Handlebars$$0.COMPILER_REVISION;if(compilerRevision!==currentRevision)if(compilerRevision<currentRevision){var runtimeVersions=Handlebars$$0.REVISION_CHANGES[currentRevision];var compilerVersions=Handlebars$$0.REVISION_CHANGES[compilerRevision];throw"Template was precompiled with an older version of Handlebars than the current runtime. "+"Please update your precompiler to a newer version ("+runtimeVersions+") or downgrade your runtime to an older version ("+
compilerVersions+").";}else throw"Template was precompiled with a newer version of Handlebars than the current runtime. "+"Please update your runtime to a newer version ("+compilerInfo[1]+").";return result}},programWithDepth:function(fn,data,$depth){var args=Array.prototype.slice.call(arguments,2);return function(context,options){options=options||{};return fn.apply(this,[context,options.data||data].concat(args))}},program:function(fn,data){return function(context,options){options=options||{};return fn(context,
options.data||data)}},noop:function(){return""},invokePartial:function(partial,name,context,helpers,partials,data){var options={helpers:helpers,partials:partials,data:data};if(partial===undefined)throw new Handlebars$$0.Exception("The partial "+name+" could not be found");else if(partial instanceof Function)return partial(context,options);else if(!Handlebars$$0.compile)throw new Handlebars$$0.Exception("The partial "+name+" could not be compiled when running in runtime-only mode");else{partials[name]=
Handlebars$$0.compile(partial,{data:data!==undefined});return partials[name](context,options)}}};Handlebars$$0.template=Handlebars$$0.VM.template})(Handlebars$$0.Compiler,Handlebars$$0.JavaScriptCompiler);define("handlebars",[],function(){return Handlebars$$0})})();
(function(){var root=this;var previousUnderscore=root._;var ArrayProto=Array.prototype;var ObjProto=Object.prototype;var FuncProto=Function.prototype;var push=ArrayProto.push;var slice=ArrayProto.slice;var concat=ArrayProto.concat;var toString=ObjProto.toString;var hasOwnProperty=ObjProto.hasOwnProperty;var nativeIsArray=Array.isArray;var nativeKeys=Object.keys;var nativeBind=FuncProto.bind;var _=function(obj){if(obj instanceof _)return obj;if(!(this instanceof _))return new _(obj);this._wrapped=
obj};if(typeof exports!=="undefined"){if(typeof module!=="undefined"&&module.exports)exports=module.exports=_;exports._=_}else root._=_;_.VERSION="1.7.0";var createCallback=function(func,context,argCount){if(context===void 0)return func;switch(argCount==null?3:argCount){case 1:return function(value){return func.call(context,value)};case 2:return function(value,other){return func.call(context,value,other)};case 3:return function(value,index,collection){return func.call(context,value,index,collection)};
case 4:return function(accumulator,value,index,collection){return func.call(context,accumulator,value,index,collection)}}return function(){return func.apply(context,arguments)}};_.iteratee=function(value,context,argCount){if(value==null)return _.identity;if(_.isFunction(value))return createCallback(value,context,argCount);if(_.isObject(value))return _.matches(value);return _.property(value)};_.each=_.forEach=function(obj,iteratee,context){if(obj==null)return obj;iteratee=createCallback(iteratee,context);
var i;var length=obj.length;if(length===+length)for(i=0;i<length;i++)iteratee(obj[i],i,obj);else{var keys=_.keys(obj);for(i=0,length=keys.length;i<length;i++)iteratee(obj[keys[i]],keys[i],obj)}return obj};_.map=_.collect=function(obj,iteratee,context){if(obj==null)return[];iteratee=_.iteratee(iteratee,context);var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var results=Array(length);var currentKey;for(var index=0;index<length;index++){currentKey=keys?keys[index]:index;
results[index]=iteratee(obj[currentKey],currentKey,obj)}return results};var reduceError="Reduce of empty array with no initial value";_.reduce=_.foldl=_.inject=function(obj,iteratee,memo,context){if(obj==null)obj=[];iteratee=createCallback(iteratee,context,4);var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var index=0;var currentKey;if(arguments.length<3){if(!length)throw new TypeError(reduceError);memo=obj[keys?keys[index++]:index++]}for(;index<length;index++){currentKey=
keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo};_.reduceRight=_.foldr=function(obj,iteratee,memo,context){if(obj==null)obj=[];iteratee=createCallback(iteratee,context,4);var keys=obj.length!==+obj.length&&_.keys(obj);var index=(keys||obj).length;var currentKey;if(arguments.length<3){if(!index)throw new TypeError(reduceError);memo=obj[keys?keys[--index]:--index]}for(;index--;){currentKey=keys?keys[index]:index;memo=iteratee(memo,obj[currentKey],currentKey,obj)}return memo};
_.find=_.detect=function(obj,predicate,context){var result;predicate=_.iteratee(predicate,context);_.some(obj,function(value,index,list){if(predicate(value,index,list)){result=value;return true}});return result};_.filter=_.select=function(obj,predicate,context){var results=[];if(obj==null)return results;predicate=_.iteratee(predicate,context);_.each(obj,function(value,index,list){if(predicate(value,index,list))results.push(value)});return results};_.reject=function(obj,predicate,context){return _.filter(obj,
_.negate(_.iteratee(predicate)),context)};_.every=_.all=function(obj,predicate,context){if(obj==null)return true;predicate=_.iteratee(predicate,context);var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var index;var currentKey;for(index=0;index<length;index++){currentKey=keys?keys[index]:index;if(!predicate(obj[currentKey],currentKey,obj))return false}return true};_.some=_.any=function(obj,predicate,context){if(obj==null)return false;predicate=_.iteratee(predicate,context);
var keys=obj.length!==+obj.length&&_.keys(obj);var length=(keys||obj).length;var index;var currentKey;for(index=0;index<length;index++){currentKey=keys?keys[index]:index;if(predicate(obj[currentKey],currentKey,obj))return true}return false};_.contains=_.include=function(obj,target){if(obj==null)return false;if(obj.length!==+obj.length)obj=_.values(obj);return _.indexOf(obj,target)>=0};_.invoke=function(obj,method){var args=slice.call(arguments,2);var isFunc=_.isFunction(method);return _.map(obj,function(value){return(isFunc?
method:value[method]).apply(value,args)})};_.pluck=function(obj,key){return _.map(obj,_.property(key))};_.where=function(obj,attrs){return _.filter(obj,_.matches(attrs))};_.findWhere=function(obj,attrs){return _.find(obj,_.matches(attrs))};_.max=function(obj,iteratee,context){var result=-Infinity;var lastComputed=-Infinity;var value$$0;var computed;if(iteratee==null&&obj!=null){obj=obj.length===+obj.length?obj:_.values(obj);var i=0;for(var length=obj.length;i<length;i++){value$$0=obj[i];if(value$$0>
result)result=value$$0}}else{iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed>lastComputed||computed===-Infinity&&result===-Infinity){result=value;lastComputed=computed}})}return result};_.min=function(obj,iteratee,context){var result=Infinity;var lastComputed=Infinity;var value$$0;var computed;if(iteratee==null&&obj!=null){obj=obj.length===+obj.length?obj:_.values(obj);var i=0;for(var length=obj.length;i<length;i++){value$$0=
obj[i];if(value$$0<result)result=value$$0}}else{iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index,list){computed=iteratee(value,index,list);if(computed<lastComputed||computed===Infinity&&result===Infinity){result=value;lastComputed=computed}})}return result};_.shuffle=function(obj){var set=obj&&obj.length===+obj.length?obj:_.values(obj);var length=set.length;var shuffled=Array(length);var index=0;for(var rand;index<length;index++){rand=_.random(0,index);if(rand!==index)shuffled[index]=
shuffled[rand];shuffled[rand]=set[index]}return shuffled};_.sample=function(obj,n,guard){if(n==null||guard){if(obj.length!==+obj.length)obj=_.values(obj);return obj[_.random(obj.length-1)]}return _.shuffle(obj).slice(0,Math.max(0,n))};_.sortBy=function(obj,iteratee,context){iteratee=_.iteratee(iteratee,context);return _.pluck(_.map(obj,function(value,index,list){return{value:value,index:index,criteria:iteratee(value,index,list)}}).sort(function(left,right){var a=left.criteria;var b=right.criteria;
if(a!==b){if(a>b||a===void 0)return 1;if(a<b||b===void 0)return-1}return left.index-right.index}),"value")};var group=function(behavior){return function(obj,iteratee,context){var result={};iteratee=_.iteratee(iteratee,context);_.each(obj,function(value,index){var key=iteratee(value,index,obj);behavior(result,value,key)});return result}};_.groupBy=group(function(result,value,key){if(_.has(result,key))result[key].push(value);else result[key]=[value]});_.indexBy=group(function(result,value,key){result[key]=
value});_.countBy=group(function(result,value,key){if(_.has(result,key))result[key]++;else result[key]=1});_.sortedIndex=function(array,obj,iteratee,context){iteratee=_.iteratee(iteratee,context,1);var value=iteratee(obj);var low=0;for(var high=array.length;low<high;){var mid=low+high>>>1;if(iteratee(array[mid])<value)low=mid+1;else high=mid}return low};_.toArray=function(obj){if(!obj)return[];if(_.isArray(obj))return slice.call(obj);if(obj.length===+obj.length)return _.map(obj,_.identity);return _.values(obj)};
_.size=function(obj){if(obj==null)return 0;return obj.length===+obj.length?obj.length:_.keys(obj).length};_.partition=function(obj$$0,predicate,context){predicate=_.iteratee(predicate,context);var pass=[];var fail=[];_.each(obj$$0,function(value,key,obj){(predicate(value,key,obj)?pass:fail).push(value)});return[pass,fail]};_.first=_.head=_.take=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[0];if(n<0)return[];return slice.call(array,0,n)};_.initial=function(array,
n,guard){return slice.call(array,0,Math.max(0,array.length-(n==null||guard?1:n)))};_.last=function(array,n,guard){if(array==null)return void 0;if(n==null||guard)return array[array.length-1];return slice.call(array,Math.max(array.length-n,0))};_.rest=_.tail=_.drop=function(array,n,guard){return slice.call(array,n==null||guard?1:n)};_.compact=function(array){return _.filter(array,_.identity)};var flatten=function(input,shallow,strict,output){if(shallow&&_.every(input,_.isArray))return concat.apply(output,
input);var i=0;for(var length=input.length;i<length;i++){var value=input[i];if(!_.isArray(value)&&!_.isArguments(value)){if(!strict)output.push(value)}else if(shallow)push.apply(output,value);else flatten(value,shallow,strict,output)}return output};_.flatten=function(array,shallow){return flatten(array,shallow,false,[])};_.without=function(array){return _.difference(array,slice.call(arguments,1))};_.uniq=_.unique=function(array,isSorted,iteratee,context){if(array==null)return[];if(!_.isBoolean(isSorted)){context=
iteratee;iteratee=isSorted;isSorted=false}if(iteratee!=null)iteratee=_.iteratee(iteratee,context);var result=[];var seen=[];var i=0;for(var length=array.length;i<length;i++){var value=array[i];if(isSorted){if(!i||seen!==value)result.push(value);seen=value}else if(iteratee){var computed=iteratee(value,i,array);if(_.indexOf(seen,computed)<0){seen.push(computed);result.push(value)}}else if(_.indexOf(result,value)<0)result.push(value)}return result};_.union=function(){return _.uniq(flatten(arguments,
true,true,[]))};_.intersection=function(array){if(array==null)return[];var result=[];var argsLength=arguments.length;var i=0;for(var length=array.length;i<length;i++){var item=array[i];if(_.contains(result,item))continue;for(var j=1;j<argsLength;j++)if(!_.contains(arguments[j],item))break;if(j===argsLength)result.push(item)}return result};_.difference=function(array){var rest=flatten(slice.call(arguments,1),true,true,[]);return _.filter(array,function(value){return!_.contains(rest,value)})};_.zip=
function(array){if(array==null)return[];var length=_.max(arguments,"length").length;var results=Array(length);for(var i=0;i<length;i++)results[i]=_.pluck(arguments,i);return results};_.object=function(list,values){if(list==null)return{};var result={};var i=0;for(var length=list.length;i<length;i++)if(values)result[list[i]]=values[i];else result[list[i][0]]=list[i][1];return result};_.indexOf=function(array,item,isSorted){if(array==null)return-1;var i=0;var length=array.length;if(isSorted)if(typeof isSorted==
"number")i=isSorted<0?Math.max(0,length+isSorted):isSorted;else{i=_.sortedIndex(array,item);return array[i]===item?i:-1}for(;i<length;i++)if(array[i]===item)return i;return-1};_.lastIndexOf=function(array,item,from){if(array==null)return-1;var idx=array.length;if(typeof from=="number")idx=from<0?idx+from+1:Math.min(idx,from+1);for(;--idx>=0;)if(array[idx]===item)return idx;return-1};_.range=function(start,stop,step){if(arguments.length<=1){stop=start||0;start=0}step=step||1;var length=Math.max(Math.ceil((stop-
start)/step),0);var range=Array(length);for(var idx=0;idx<length;idx++,start+=step)range[idx]=start;return range};var Ctor=function(){};_.bind=function(func,context){var args;var bound;if(nativeBind&&func.bind===nativeBind)return nativeBind.apply(func,slice.call(arguments,1));if(!_.isFunction(func))throw new TypeError("Bind must be called on a function");args=slice.call(arguments,2);bound=function(){if(!(this instanceof bound))return func.apply(context,args.concat(slice.call(arguments)));Ctor.prototype=
func.prototype;var self=new Ctor;Ctor.prototype=null;var result=func.apply(self,args.concat(slice.call(arguments)));if(_.isObject(result))return result;return self};return bound};_.partial=function(func){var boundArgs=slice.call(arguments,1);return function(){var position=0;var args=boundArgs.slice();var i=0;for(var length=args.length;i<length;i++)if(args[i]===_)args[i]=arguments[position++];for(;position<arguments.length;)args.push(arguments[position++]);return func.apply(this,args)}};_.bindAll=
function(obj){var i;var length=arguments.length;var key;if(length<=1)throw new Error("bindAll must be passed function names");for(i=1;i<length;i++){key=arguments[i];obj[key]=_.bind(obj[key],obj)}return obj};_.memoize=function(func,hasher){var memoize=function(key){var cache=memoize.cache;var address=hasher?hasher.apply(this,arguments):key;if(!_.has(cache,address))cache[address]=func.apply(this,arguments);return cache[address]};memoize.cache={};return memoize};_.delay=function(func,wait){var args=
slice.call(arguments,2);return setTimeout(function(){return func.apply(null,args)},wait)};_.defer=function(func){return _.delay.apply(_,[func,1].concat(slice.call(arguments,1)))};_.throttle=function(func,wait,options){var context;var args;var result;var timeout=null;var previous=0;if(!options)options={};var later=function(){previous=options.leading===false?0:_.now();timeout=null;result=func.apply(context,args);if(!timeout)context=args=null};return function(){var now=_.now();if(!previous&&options.leading===
false)previous=now;var remaining=wait-(now-previous);context=this;args=arguments;if(remaining<=0||remaining>wait){clearTimeout(timeout);timeout=null;previous=now;result=func.apply(context,args);if(!timeout)context=args=null}else if(!timeout&&options.trailing!==false)timeout=setTimeout(later,remaining);return result}};_.debounce=function(func,wait,immediate){var timeout;var args;var context;var timestamp;var result;var later=function(){var last=_.now()-timestamp;if(last<wait&&last>0)timeout=setTimeout(later,
wait-last);else{timeout=null;if(!immediate){result=func.apply(context,args);if(!timeout)context=args=null}}};return function(){context=this;args=arguments;timestamp=_.now();var callNow=immediate&&!timeout;if(!timeout)timeout=setTimeout(later,wait);if(callNow){result=func.apply(context,args);context=args=null}return result}};_.wrap=function(func,wrapper){return _.partial(wrapper,func)};_.negate=function(predicate){return function(){return!predicate.apply(this,arguments)}};_.compose=function(){var args=
arguments;var start=args.length-1;return function(){var i=start;for(var result=args[start].apply(this,arguments);i--;)result=args[i].call(this,result);return result}};_.after=function(times,func){return function(){if(--times<1)return func.apply(this,arguments)}};_.before=function(times,func){var memo;return function(){if(--times>0)memo=func.apply(this,arguments);else func=null;return memo}};_.once=_.partial(_.before,2);_.keys=function(obj){if(!_.isObject(obj))return[];if(nativeKeys)return nativeKeys(obj);
var keys=[];for(var key in obj)if(_.has(obj,key))keys.push(key);return keys};_.values=function(obj){var keys=_.keys(obj);var length=keys.length;var values=Array(length);for(var i=0;i<length;i++)values[i]=obj[keys[i]];return values};_.pairs=function(obj){var keys=_.keys(obj);var length=keys.length;var pairs=Array(length);for(var i=0;i<length;i++)pairs[i]=[keys[i],obj[keys[i]]];return pairs};_.invert=function(obj){var result={};var keys=_.keys(obj);var i=0;for(var length=keys.length;i<length;i++)result[obj[keys[i]]]=
keys[i];return result};_.functions=_.methods=function(obj){var names=[];for(var key in obj)if(_.isFunction(obj[key]))names.push(key);return names.sort()};_.extend=function(obj){if(!_.isObject(obj))return obj;var source;var prop;var i=1;for(var length=arguments.length;i<length;i++){source=arguments[i];for(prop in source)if(hasOwnProperty.call(source,prop))obj[prop]=source[prop]}return obj};_.pick=function(obj,iteratee,context){var result={};var key;if(obj==null)return result;if(_.isFunction(iteratee)){iteratee=
createCallback(iteratee,context);for(key in obj){var value=obj[key];if(iteratee(value,key,obj))result[key]=value}}else{var keys=concat.apply([],slice.call(arguments,1));obj=new Object(obj);var i=0;for(var length=keys.length;i<length;i++){key=keys[i];if(key in obj)result[key]=obj[key]}}return result};_.omit=function(obj,iteratee,context){if(_.isFunction(iteratee))iteratee=_.negate(iteratee);else{var keys=_.map(concat.apply([],slice.call(arguments,1)),String);iteratee=function(value,key){return!_.contains(keys,
key)}}return _.pick(obj,iteratee,context)};_.defaults=function(obj){if(!_.isObject(obj))return obj;var i=1;for(var length=arguments.length;i<length;i++){var source=arguments[i];for(var prop in source)if(obj[prop]===void 0)obj[prop]=source[prop]}return obj};_.clone=function(obj){if(!_.isObject(obj))return obj;return _.isArray(obj)?obj.slice():_.extend({},obj)};_.tap=function(obj,interceptor){interceptor(obj);return obj};var eq=function(a,b,aStack,bStack){if(a===b)return a!==0||1/a===1/b;if(a==null||
b==null)return a===b;if(a instanceof _)a=a._wrapped;if(b instanceof _)b=b._wrapped;var className=toString.call(a);if(className!==toString.call(b))return false;switch(className){case "[object RegExp]":case "[object String]":return""+a===""+b;case "[object Number]":if(+a!==+a)return+b!==+b;return+a===0?1/+a===1/b:+a===+b;case "[object Date]":case "[object Boolean]":return+a===+b}if(typeof a!="object"||typeof b!="object")return false;for(var length=aStack.length;length--;)if(aStack[length]===a)return bStack[length]===
b;var aCtor=a.constructor;var bCtor=b.constructor;if(aCtor!==bCtor&&"constructor"in a&&"constructor"in b&&!(_.isFunction(aCtor)&&aCtor instanceof aCtor&&_.isFunction(bCtor)&&bCtor instanceof bCtor))return false;aStack.push(a);bStack.push(b);var size;var result;if(className==="[object Array]"){size=a.length;result=size===b.length;if(result)for(;size--;)if(!(result=eq(a[size],b[size],aStack,bStack)))break}else{var keys=_.keys(a);var key;size=keys.length;result=_.keys(b).length===size;if(result)for(;size--;){key=
keys[size];if(!(result=_.has(b,key)&&eq(a[key],b[key],aStack,bStack)))break}}aStack.pop();bStack.pop();return result};_.isEqual=function(a,b){return eq(a,b,[],[])};_.isEmpty=function(obj){if(obj==null)return true;if(_.isArray(obj)||_.isString(obj)||_.isArguments(obj))return obj.length===0;for(var key in obj)if(_.has(obj,key))return false;return true};_.isElement=function(obj){return!!(obj&&obj.nodeType===1)};_.isArray=nativeIsArray||function(obj){return toString.call(obj)==="[object Array]"};_.isObject=
function(obj){var type=typeof obj;return type==="function"||type==="object"&&!!obj};_.each(["Arguments","Function","String","Number","Date","RegExp"],function(name){_["is"+name]=function(obj){return toString.call(obj)==="[object "+name+"]"}});if(!_.isArguments(arguments))_.isArguments=function(obj){return _.has(obj,"callee")};if(typeof/./!=="function")_.isFunction=function(obj){return typeof obj=="function"||false};_.isFinite=function(obj){return isFinite(obj)&&!isNaN(parseFloat(obj))};_.isNaN=function(obj){return _.isNumber(obj)&&
obj!==+obj};_.isBoolean=function(obj){return obj===true||obj===false||toString.call(obj)==="[object Boolean]"};_.isNull=function(obj){return obj===null};_.isUndefined=function(obj){return obj===void 0};_.has=function(obj,key){return obj!=null&&hasOwnProperty.call(obj,key)};_.noConflict=function(){root._=previousUnderscore;return this};_.identity=function(value){return value};_.constant=function(value){return function(){return value}};_.noop=function(){};_.property=function(key){return function(obj){return obj[key]}};
_.matches=function(attrs){var pairs=_.pairs(attrs);var length=pairs.length;return function(obj){if(obj==null)return!length;obj=new Object(obj);for(var i=0;i<length;i++){var pair=pairs[i];var key=pair[0];if(pair[1]!==obj[key]||!(key in obj))return false}return true}};_.times=function(n,iteratee,context){var accum=Array(Math.max(0,n));iteratee=createCallback(iteratee,context,1);for(var i=0;i<n;i++)accum[i]=iteratee(i);return accum};_.random=function(min,max){if(max==null){max=min;min=0}return min+Math.floor(Math.random()*
(max-min+1))};_.now=Date.now||function(){return(new Date).getTime()};var escapeMap={"\x26":"\x26amp;","\x3c":"\x26lt;","\x3e":"\x26gt;",'"':"\x26quot;","'":"\x26#x27;","`":"\x26#x60;"};var unescapeMap=_.invert(escapeMap);var createEscaper=function(map){var escaper=function(match){return map[match]};var source="(?:"+_.keys(map).join("|")+")";var testRegexp=RegExp(source);var replaceRegexp=RegExp(source,"g");return function(string){string=string==null?"":""+string;return testRegexp.test(string)?string.replace(replaceRegexp,
escaper):string}};_.escape=createEscaper(escapeMap);_.unescape=createEscaper(unescapeMap);_.result=function(object,property){if(object==null)return void 0;var value=object[property];return _.isFunction(value)?object[property]():value};var idCounter=0;_.uniqueId=function(prefix){var id=++idCounter+"";return prefix?prefix+id:id};_.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var noMatch=/(.)^/;var escapes={"'":"'","\\":"\\","\r":"r","\n":"n",
"\u2028":"u2028","\u2029":"u2029"};var escaper=/\\|'|\r|\n|\u2028|\u2029/g;var escapeChar=function(match){return"\\"+escapes[match]};_.template=function(text,settings,oldSettings){if(!settings&&oldSettings)settings=oldSettings;settings=_.defaults({},settings,_.templateSettings);var matcher=RegExp([(settings.escape||noMatch).source,(settings.interpolate||noMatch).source,(settings.evaluate||noMatch).source].join("|")+"|$","g");var index=0;var source="__p+\x3d'";text.replace(matcher,function(match,escape,
interpolate,evaluate,offset){source+=text.slice(index,offset).replace(escaper,escapeChar);index=offset+match.length;if(escape)source+="'+\n((__t\x3d("+escape+"))\x3d\x3dnull?'':_.escape(__t))+\n'";else if(interpolate)source+="'+\n((__t\x3d("+interpolate+"))\x3d\x3dnull?'':__t)+\n'";else if(evaluate)source+="';\n"+evaluate+"\n__p+\x3d'";return match});source+="';\n";if(!settings.variable)source="with(obj||{}){\n"+source+"}\n";source="var __t,__p\x3d'',__j\x3dArray.prototype.join,"+"print\x3dfunction(){__p+\x3d__j.call(arguments,'');};\n"+
source+"return __p;\n";try{var render=new Function(settings.variable||"obj","_",source)}catch(e){e.source=source;throw e;}var template=function(data){return render.call(this,data,_)};var argument=settings.variable||"obj";template.source="function("+argument+"){\n"+source+"}";return template};_.chain=function(obj){var instance=_(obj);instance._chain=true;return instance};var result$$0=function(obj){return this._chain?_(obj).chain():obj};_.mixin=function(obj){_.each(_.functions(obj),function(name){var func=
_[name]=obj[name];_.prototype[name]=function(){var args=[this._wrapped];push.apply(args,arguments);return result$$0.call(this,func.apply(_,args))}})};_.mixin(_);_.each(["pop","push","reverse","shift","sort","splice","unshift"],function(name){var method=ArrayProto[name];_.prototype[name]=function(){var obj=this._wrapped;method.apply(obj,arguments);if((name==="shift"||name==="splice")&&obj.length===0)delete obj[0];return result$$0.call(this,obj)}});_.each(["concat","join","slice"],function(name){var method=
ArrayProto[name];_.prototype[name]=function(){return result$$0.call(this,method.apply(this._wrapped,arguments))}});_.prototype.value=function(){return this._wrapped};if(typeof define==="function"&&define.amd)define("underscore",[],function(){return _})}).call(this);
define("hbs",[],function(){return{get:function(){return Handlebars},write:function(pluginName,name,write){if(name+customNameExtension in buildMap){var text=buildMap[name+customNameExtension];write.asModule(pluginName+"!"+name,text)}},version:"0.4.0",load:function(name,parentRequire,load,config){}}});
define("hbs!galileo/modal/template/force101/content-wearing-force",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eWearing Force\x3c/h3\x3e\n\x3cp\x3eIf you wear your Force on your dominant hand (the one you use to write and eat), you\'ll want to update \x3ca href\x3d"/settings/device/tracker"\x3eDevice Settings\x3c/a\x3e for optimal accuracy.\x3c/p\x3e'});
Handlebars$$0.registerPartial("galileo_modal_template_force101_content-wearing-force",t);return t});
define("hbs!galileo/modal/template/force101/content-display-options",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eDisplay Options\x3c/h3\x3e\n\x3cp\x3eYou can customize what you see on your Force display in \x3ca href\x3d"/settings/device/tracker"\x3eDevice Settings\x3c/a\x3e.\x3c/p\x3e\n\x3cul\x3e\n    \x3cli\x3eChange the order in which your stats appear.\x3c/li\x3e\n    \x3cli\x3eHide stats that don\'t interest you.\x3c/li\x3e\n    \x3cli\x3eChange the clock face style.\x3c/li\x3e\n\x3c/ul\x3e\n\n\x3cul class\x3d"display-options-list"\x3e\n    \x3cli\x3eSteps\x3c/li\x3e\n    \x3cli\x3eActive Minutes\x3c/li\x3e\n    \x3cli\x3eCalories\x3c/li\x3e\n    \x3cli\x3eDistance\x3c/li\x3e\t\t\n\x3c/ul\x3e\t'});Handlebars$$0.registerPartial("galileo_modal_template_force101_content-display-options",
t);return t});
define("hbs!galileo/modal/template/force101/content-goals",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eGoals\x3c/h3\x3e\n\x3cp\x3eTrack progress against one Main Goal on Force. Additional goals can be set and tracked on your dashboard.\x3c/p\x3e\n\n\x3ch4\x3eMain Goal\x3c/h4\x3e\n\x3cul\x3e\n    \x3cli\x3eYou will feel a vibration when you meet this goal.\x3c/li\x3e\n    \x3cli\x3eChange which stat is selected as your Main Goal in \x3ca href\x3d"/settings/device/tracker"\x3eDevice Settings\x3c/a\x3e.\x3c/li\x3e\n\x3c/ul\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_force101_content-goals",
t);return t});
define("hbs!galileo/modal/template/force101/content-tracking-sleep",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return"\n\x3ch3\x3eTracking Sleep\x3c/h3\x3e\n\x3cp\x3eForce tracks time asleep, awake, and restless.\x3c/p\x3e\n\n\x3cul\x3e\n    \x3cli\x3ePress and hold the button until the stopwatch appears to start recording sleep.\x3c/li\x3e\n    \x3cli\x3eRepeat the same action when you wake up to stop recording.\x3c/li\x3e\n    \x3cli\x3eIf you forget to log sleep, you can log it after the fact on the website or mobile app.\x3c/li\x3e\n\x3c/ul\x3e"});Handlebars$$0.registerPartial("galileo_modal_template_force101_content-tracking-sleep",
t);return t});
define("hbs!galileo/modal/template/force101/content-silent-alarms",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eSilent Alarms\x3c/h3\x3e\n\x3cp\x3eYou can set up an alarm in \x3ca href\x3d"/settings/alarms"\x3eSettings\x3c/a\x3e or using the Fitbit mobile app.\x3c/p\x3e\n\x3cp\x3eMake sure to sync after setting an alarm.\x3c/p\x3e\n\x3cp\x3eWhen an alarm is set, your Force will show your next alarm time.\x3c/p\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_force101_content-silent-alarms",
t);return t});
define("hbs!galileo/modal/template/force101",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0$$0,helpers,partials,data$$0){function program1(depth0,data){var buffer="";var stack1;buffer+='\n                \x3cli class\x3d"screen ';if(stack1=helpers.name)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.name;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}buffer+=escapeExpression(stack1)+'" data-screen-name\x3d"';if(stack1=
helpers.name)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.name;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}buffer+=escapeExpression(stack1)+'"\x3e\n                    \x3cdiv class\x3d"section"\x3e\n                        ';if(stack1=helpers.contents)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.contents;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}if(stack1||stack1===0)buffer+=stack1;buffer+="\n                    \x3c/div\x3e\n                \x3c/li\x3e\n                ";
return buffer}this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;var buffer$$0="";var stack1;var functionType="function";var escapeExpression=this.escapeExpression;var self=this;buffer$$0+='\n\n\x3cdiv class\x3d"force101-modal wearing-force"\x3e\n    \x3ca class\x3d"close closeBtn"\x3ex\x3c/a\x3e\n\n    \x3cdiv class\x3d"paddingContainer"\x3e\n        \x3cdiv class\x3d"header"\x3e\n            \x3ch2\x3e\n                Force 101\n            \x3c/h2\x3e\n            \x3cul class\x3d"nav"\x3e\n                \x3cli class\x3d"basics"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eBasics\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n                \x3cli class\x3d"goals"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eGoals\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n                \x3cli class\x3d"sleep"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eSleep\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n            \x3c/ul\x3e\n        \x3c/div\x3e\n\n        \x3cdiv class\x3d"body"\x3e\n\n            \x3cul class\x3d"screens"\x3e\n                ';
stack1=helpers.each.call(depth0$$0,depth0$$0.screens,{hash:{},inverse:self.noop,fn:self.program(1,program1,data$$0)});if(stack1||stack1===0)buffer$$0+=stack1;buffer$$0+='\n            \x3c/ul\x3e\n\n        \x3c/div\x3e\n    \x3c/div\x3e\n\n    \x3cdiv class\x3d"navActions"\x3e\n        \x3cul class\x3d"actions"\x3e\n            \x3cli\x3e\n                \x3ca rel\x3d"prev"\x3e\x26lt; Back\x3c/a\x3e\n            \x3c/li\x3e\n            \x3cli\x3e\n                \x3ca rel\x3d"next"\x3eNext \x26gt;\x3c/a\x3e\n            \x3c/li\x3e\n            \x3cli\x3e\n                \x3ca class\x3d"close" rel\x3d"done"\x3eDone\x3c/a\x3e\n            \x3c/li\x3e\n        \x3c/ul\x3e\n    \x3c/div\x3e\n\x3c/div\x3e';
return buffer$$0});Handlebars$$0.registerPartial("galileo_modal_template_force101",t);return t});
define("galileo/modal/force101",["require","galileo/builder/util","galileo/builder/text","galileo/i18n/messageformat/locales","galileo/widget/tabs","hbs!./template/force101/content-wearing-force","hbs!./template/force101/content-display-options","hbs!./template/force101/content-goals","hbs!./template/force101/content-tracking-sleep","hbs!./template/force101/content-silent-alarms","hbs!./template/force101","shared/scripts/modal"],function(require){var B=require("galileo/builder/util");var Text=require("galileo/builder/text");
var i18n=require("galileo/i18n/messageformat/locales");var Tabs=require("galileo/widget/tabs");var screensContents=[{name:"wearing-force",contents:require("hbs!./template/force101/content-wearing-force")()},{name:"display-options",contents:require("hbs!./template/force101/content-display-options")()},{name:"goals",contents:require("hbs!./template/force101/content-goals")()},{name:"tracking-sleep",contents:require("hbs!./template/force101/content-tracking-sleep")()},{name:"silent-alarms",contents:require("hbs!./template/force101/content-silent-alarms")()}];
var modalContents=require("hbs!./template/force101");var openModal;return function(){if(!openModal){openModal=require("shared/scripts/modal")(function(close){var modal=$(modalContents({screens:screensContents}));var screens=modal.find(".screen");var totalScreens=screens.length;var current=0;modal.on("click",".navActions a:not([rel\x3ddone])",function(){var element=$(this);var direction=element.attr("rel");var num=0;switch(direction){case "next":num+=1;break;case "prev":num-=1;break}if(num!=0){var newCurrent=
current+num;var currentScreen=screens.eq(current);var newScreen=screens.eq(newCurrent);current=newCurrent;modal.removeClass(currentScreen.data("screen-name"));modal.addClass(newScreen.data("screen-name"))}});return modal});openModal.onClose(function(){openModal=undefined})}return openModal}});
define("hbs!galileo/modal/template/charge101/content-wearing-charge",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eWearing Charge\x3c/h3\x3e\n\x3cp\x3eIf you wear your Charge on your dominant hand (the one you use to write and eat), you\'ll want to update \x3ca href\x3d"/settings/device/tracker"\x3eDevice Settings\x3c/a\x3e for optimal accuracy.\x3c/p\x3e'});
Handlebars$$0.registerPartial("galileo_modal_template_charge101_content-wearing-charge",t);return t});
define("hbs!galileo/modal/template/charge101/content-display-options",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eDisplay Options\x3c/h3\x3e\n\x3cp\x3eYou can customize what you see on your Charge display in \x3ca href\x3d"/settings/device/tracker"\x3eDevice Settings\x3c/a\x3e.\x3c/p\x3e\n\x3cul\x3e\n    \x3cli\x3eChange the order in which your stats appear.\x3c/li\x3e\n    \x3cli\x3eHide stats that don\'t interest you.\x3c/li\x3e\n    \x3cli\x3eChange the clock face style.\x3c/li\x3e\n\x3c/ul\x3e\n\n\x3cul class\x3d"display-options-list"\x3e\n    \x3cli\x3eSteps\x3c/li\x3e\n    \x3cli\x3eFloors\x3c/li\x3e\n    \x3cli\x3eCalories\x3c/li\x3e\n    \x3cli\x3eDistance\x3c/li\x3e\n\x3c/ul\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_charge101_content-display-options",
t);return t});
define("hbs!galileo/modal/template/charge101/content-goals",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eGoals\x3c/h3\x3e\n\x3cp\x3eTrack progress against one Main Goal on Charge. Additional goals can be set and tracked on your dashboard.\x3c/p\x3e\n\n\x3ch4\x3eMain Goal\x3c/h4\x3e\n\x3cul\x3e\n    \x3cli\x3eYou will feel a vibration when you meet this goal.\x3c/li\x3e\n    \x3cli\x3eChange which stat is selected as your Main Goal in \x3ca href\x3d"/settings/device/tracker"\x3eDevice Settings\x3c/a\x3e.\x3c/li\x3e\n\x3c/ul\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_charge101_content-goals",
t);return t});
define("hbs!galileo/modal/template/charge101/content-call-notifications",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return"\n\x3ch3\x3eCall Notifications\x3c/h3\x3e\n\x3cp\x3eCharge can receive notifications for phone calls. Turn on call notifications from \x3ca\x3eAccount Settings\x3c/a\x3e in Fitbit mobile app.\x3c/p\x3e\n\x3cp\x3eCharge will vibrate and show the name or number of the caller.\x3c/p\x3e\n"});Handlebars$$0.registerPartial("galileo_modal_template_charge101_content-call-notifications",
t);return t});
define("hbs!galileo/modal/template/charge101/content-silent-alarms",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\n\x3ch3\x3eSilent Alarms\x3c/h3\x3e\n\x3cp\x3eYou can set up an alarm in \x3ca href\x3d"/settings/alarms"\x3eSettings\x3c/a\x3e or using the Fitbit mobile app.\x3c/p\x3e\n\x3cp\x3eMake sure to sync after setting an alarm.\x3c/p\x3e\n\x3cp\x3eWhen an alarm is set, your Charge will show your next alarm time.\x3c/p\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_charge101_content-silent-alarms",
t);return t});
define("hbs!galileo/modal/template/charge101",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0$$0,helpers,partials,data$$0){function program1(depth0,data){var buffer="";var stack1;buffer+='\n                \x3cli class\x3d"screen ';if(stack1=helpers.name)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.name;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}buffer+=escapeExpression(stack1)+'" data-screen-name\x3d"';if(stack1=
helpers.name)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.name;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}buffer+=escapeExpression(stack1)+'"\x3e\n                    \x3cdiv class\x3d"section"\x3e\n                        ';if(stack1=helpers.contents)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.contents;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}if(stack1||stack1===0)buffer+=stack1;buffer+="\n                    \x3c/div\x3e\n                \x3c/li\x3e\n                ";
return buffer}this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;var buffer$$0="";var stack1$$0;var functionType="function";var escapeExpression=this.escapeExpression;var self=this;buffer$$0+='\n\n\x3cdiv class\x3d"charge101-modal wearing-charge"\x3e\n    \x3ca class\x3d"close closeBtn"\x3ex\x3c/a\x3e\n\n    \x3cdiv class\x3d"paddingContainer"\x3e\n        \x3cdiv class\x3d"header"\x3e\n            \x3ch2\x3e\n                Charge 101\n            \x3c/h2\x3e\n            \x3cul class\x3d"nav"\x3e\n                \x3cli class\x3d"basics"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eBasics\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n                \x3cli class\x3d"goals"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eGoals\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n                \x3cli class\x3d"calls"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eCalls\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n                \x3cli class\x3d"sleep"\x3e\n                    \x3ca\x3e\n                        \x3cstrong\x3eSleep\x3c/strong\x3e\n                    \x3c/a\x3e\n                \x3c/li\x3e\n            \x3c/ul\x3e\n        \x3c/div\x3e\n\n        \x3cdiv class\x3d"body"\x3e\n\n            \x3cul class\x3d"screens"\x3e\n                ';
stack1$$0=helpers.each.call(depth0$$0,depth0$$0.screens,{hash:{},inverse:self.noop,fn:self.program(1,program1,data$$0)});if(stack1$$0||stack1$$0===0)buffer$$0+=stack1$$0;buffer$$0+='\n            \x3c/ul\x3e\n\n        \x3c/div\x3e\n    \x3c/div\x3e\n\n    \x3cdiv class\x3d"navActions"\x3e\n        \x3cul class\x3d"actions"\x3e\n            \x3cli\x3e\n                \x3ca rel\x3d"prev"\x3e\x26lt; Back\x3c/a\x3e\n            \x3c/li\x3e\n            \x3cli\x3e\n                \x3ca rel\x3d"next"\x3eNext \x26gt;\x3c/a\x3e\n            \x3c/li\x3e\n            \x3cli\x3e\n                \x3ca class\x3d"close" rel\x3d"done"\x3eDone\x3c/a\x3e\n            \x3c/li\x3e\n        \x3c/ul\x3e\n    \x3c/div\x3e\n\x3c/div\x3e';
return buffer$$0});Handlebars$$0.registerPartial("galileo_modal_template_charge101",t);return t});
define("galileo/modal/charge101",["require","galileo/builder/util","galileo/builder/text","galileo/i18n/messageformat/locales","galileo/widget/tabs","hbs!./template/charge101/content-wearing-charge","hbs!./template/charge101/content-display-options","hbs!./template/charge101/content-goals","hbs!./template/charge101/content-call-notifications","hbs!./template/charge101/content-silent-alarms","hbs!./template/charge101","shared/scripts/modal"],function(require){var B=require("galileo/builder/util");
var Text=require("galileo/builder/text");var i18n=require("galileo/i18n/messageformat/locales");var Tabs=require("galileo/widget/tabs");var screensContents=[{name:"wearing-charge",contents:require("hbs!./template/charge101/content-wearing-charge")()},{name:"display-options",contents:require("hbs!./template/charge101/content-display-options")()},{name:"goals",contents:require("hbs!./template/charge101/content-goals")()},{name:"call-notifications",contents:require("hbs!./template/charge101/content-call-notifications")()},
{name:"silent-alarms",contents:require("hbs!./template/charge101/content-silent-alarms")()}];var modalContents=require("hbs!./template/charge101");var openModal;return function(){if(!openModal){openModal=require("shared/scripts/modal")(function(close){var modal=$(modalContents({screens:screensContents}));var screens=modal.find(".screen");var totalScreens=screens.length;var current=0;modal.on("click",".navActions a:not([rel\x3ddone])",function(){var element=$(this);var direction=element.attr("rel");
var num=0;switch(direction){case "next":num+=1;break;case "prev":num-=1;break}if(num!=0){var newCurrent=current+num;var currentScreen=screens.eq(current);var newScreen=screens.eq(newCurrent);current=newCurrent;modal.removeClass(currentScreen.data("screen-name"));modal.addClass(newScreen.data("screen-name"))}});return modal});openModal.onClose(function(){openModal=undefined})}return openModal}});
define("galileo/modal/device101",["require"],function(require){function initDevice101(){function reDrawButtons(el){if(el.hasClass("first-item-101"))$(".navigation-button-101.prev-screen").hide();else $(".navigation-button-101.prev-screen").show();if(el.hasClass("last-item-101")){$(".navigation-button-101.next-screen").hide();$(".navigation-button-101.close-screen").show()}else{$(".navigation-button-101.next-screen").show();$(".navigation-button-101.close-screen").hide()}}function doChangeScreen(el){var _t=
null;if(el.hasClass("prev-screen"))_t=$("a.pagination-marker-101.active").parent().prev().find("a.pagination-marker-101");else if(el.hasClass("next-screen"))_t=$("a.pagination-marker-101.active").parent().next().find("a.pagination-marker-101");if(_t&&_t.length){var _target=_t.attr("href");$("a.pagination-marker-101.active").removeClass("active");_t.addClass("active");$("div.active-area-101").fadeOut().removeClass("active-area-101");$("div"+_target).fadeIn().addClass("active-area-101");reDrawButtons($("div"+
_target))}}$(".device-101-1-menu-item").after("\x3cbr/\x3e");$("#fitbit-mobile-device-101").append('\x3cdiv class\x3d"close-button"\x3e\x3c/div\x3e');$(".navigation-button-101").click(function(){doChangeScreen($(this))});$(".navigation-button-101.prev-screen").hide();$("#fitbit-mobile-device-101 \x3e div.content-area-101:not(.fitbit-mobile-device-101-content)").append("\x3cdiv class\x3d'device-101-left-side'\x3e\x3c/div\x3e\x3cdiv class\x3d'device-101-right-side'\x3e\x3c/div\x3e");$("#fitbit-mobile-device-101 \x3e div:not(.fitbit-mobile-device-101-content)").each(function(){var _l=
$(this).find(".device-101-left-side");$(this).find("img:not('.ic'), p.left-area").appendTo(_l);var _r=$(this).find(".device-101-right-side");$(this).find("p:not(.left-area),h1").appendTo(_r);$(this).find("p.device-101-split").each(function(){var _h=$(this).html();_h=_h.replace("\x3cbr/\x3e","\x3c/p\x3e\x3cp\x3e").replace("\x3cbr\x3e","\x3c/p\x3e\x3cp\x3e");$(this).html(_h)})});$("img.lazy").each(function(){var r_src=$(this).attr("data-src");$(this).attr("src",r_src)});$("#fitbit-mobile-device-101 .close-button, .fitbit-mobile-device-101-overlay, .navigation-button-101.close-screen").click(function(){$(".fitbit-mobile-device-101-overlay").remove();
$("#fitbit-mobile-device-101").remove()});$("#fitbit-mobile-device-101 #nav-101").show();var cnt=$("#fitbit-mobile-device-101 \x3e div.content-area-101");var cntl=cnt.length;cnt.each(function(i){if(i!==0){if(i==cntl-1)$(this).addClass("last-item-101");$(this).hide()}else $(this).addClass("active-area-101").addClass("first-item-101");var cl=$(this).hasClass("fitbit-mobile-device-101-content")?"class\x3d'content-table'":"";var active=i==0?"active":"";var href=$(this).attr("id");var el="\x3cli "+cl+
"\x3e\x3ca href\x3d'#"+href+"' class\x3d'pagination-marker-101 "+active+"'\x3e\x3c/a\x3e\x3c/li\x3e";$("#nav-101 ul").append(el)});$("a.pagination-marker-101, a.device-101-1-menu-item").click(function(ev){ev.preventDefault();if(!$(this).hasClass("active")){var _t=$(this).attr("href");$("a.pagination-marker-101").removeClass("active");$("a.pagination-marker-101[href\x3d'"+_t+"']").addClass("active");$("div.active-area-101").fadeOut().removeClass("active-area-101");$("div"+_t).fadeIn().addClass("active-area-101");
reDrawButtons($("div"+_t))}return false});$(".fitbit-mobile-device-101-overlay").show();$("#fitbit-mobile-device-101").show()}return function(device){var LANG_WHITELIST={"de":"de","en":"us","es":"es","fr":"fr","it":"it","ja":"jp","ko":"kr","zh":"cn"};var locale=$("body").attr("class").match(/locale-\S+/);var lang=locale&&locale[0].split("-")[1].split("_")[0].toLowerCase();var region=LANG_WHITELIST[lang]?"/"+LANG_WHITELIST[lang]:"";var url=false;if(device==="surge")url=region+"/surge/surge-101";else if(device===
"chargehr")url=region+"/unit?unit\x3dchargehr/chargehr-101";if(url)$.get(url,function(data){if(data){$("body").append(data);initDevice101()}})}});
define("galileo/util/channel",["require"],function(require){return function(sendLast){var fns=[];var args;return{fns:fns,give:function(){args=arguments;for(var i=0;i<fns.length;i++)fns[i].apply(this,args)},take:function(fn,ctxt){fn=ctxt?function(fnBind){return function(){return fnBind.apply(ctxt,args)}}(fn):fn;fns.push(fn);if(sendLast&&args)fn.apply(this,args);return function(){for(var i=fns.length-1;i>=0;i--)if(fns[i]===fn)fns.splice(i,1)}}}}});
define("galileo/ajax/ajax",["require","mootools","jquery","galileo/prototype/all","galileo/util/channel","underscore"],function(require){function getKey(wrap,method,url,args){var argsArray=Object.keys(args).map(function(k){return[k,args[k]]});argsArray.sortBy(Function.takeKey(0));return JSON.encode([wrap,method,url,argsArray])}function ajax(post,wrap,owner,method,url,args,callback){var key=getKey(wrap,method,url,args);var fullRequest=!owner||typeof global_page_owner==="undefined"?"/ajaxapi":"/ajaxapi/user/"+
global_page_owner.encodedId;var argsWithCsrf=args;if(_.isString(method)&&method.toLowerCase()==="post"&&_.isObject(args)&&!_.isArray(args))argsWithCsrf=_.extend({},args,{csrfToken:window.fitbitCsrfToken});var makeRequest=function(){if(wrap)$.ajax({type:"POST",url:fullRequest,data:$.param({request:JSON.stringify({template:"/mgmt/ajaxTemplate.jsp",serviceCalls:[{name:url,args:args,method:method}]}),csrfToken:window.fitbitCsrfToken}),success:function(res){load(wrap,method,url,args,JSON.parse(res))}});
else $.ajax({type:method,url:url,data:argsWithCsrf,success:load.bind(this,wrap,method,url,args)})};if(post===true){if(wrap)$.ajax({type:"POST",url:fullRequest,data:$.param({request:JSON.stringify({template:"/mgmt/ajaxTemplate.jsp",serviceCalls:[{name:url,args:args,method:method}]}),csrfToken:window.fitbitCsrfToken}),success:callback});else $.ajax({type:method,url:url,data:argsWithCsrf,success:callback});return}if(callback==undefined)return{update:function(){delete values[key];makeRequest()}};if(!channels[key]){channels[key]=
channel();if(preloading)queue.push(function(){if(!values[key])makeRequest()});else makeRequest()}if(!channels[key].fns.contains(callback))channels[key].take(callback);if(values.hasOwnProperty(key)){callback(values[key]);return}}function load(wrap,method,url,args,value){var key=getKey(wrap,method,url,args);values[key]=value;channels[key]=channels[key]||channel();channels[key].give(value)}function preloadFinished(){preloading=false;queue.map(function(fn){fn()});delete queue}require("mootools");require("jquery");
require("galileo/prototype/all");var channel=require("galileo/util/channel");var _=require("underscore");var preloading=true;var queue=[];var values={};var channels={};window.channelThings=channels;return{getRaw:ajax.bind(this,false,false,false,"get"),get:ajax.bind(this,false,true,false),getOwner:ajax.bind(this,false,true,true),post:ajax.bind(this,true,true,false),postOwner:ajax.bind(this,true,true,true),postRaw:ajax.bind(this,true,false,false,"post"),preload:load.bind(this,true),preloadRaw:load.bind(this,
false),preloadFinished:preloadFinished}});
define("galileo/util/dialog101Loader",["require","./channel","galileo/ajax/ajax"],function(require){function waitFor(cond,k){if(cond())k();else setTimeout(waitFor.bind(this,cond,k),40)}var channel=require("./channel");var Ajax=require("galileo/ajax/ajax");var started=false;var done=false;var chan=channel();return function(k){if(!started){started=true;$.get("/lab/galileo/dialog101",function(html){var parts=html.split("\x3c!--ENDSCRIPT--\x3e");$("\x3cdiv\x3e").css({position:"absolute",left:-1E4}).html(parts[1]).appendTo($("body"));
waitFor(function(){return $("#aria101_labels").length},function(){$("\x3cdiv\x3e").css({position:"absolute",left:-1E4}).html(parts[0]).appendTo($("body"));waitFor(function(){return $.fn.fitbit101&&$.aria101&&$.zip101&&$.one101},function(){var $template=$("#fb101-template");$template.replaceWith($template.text());chan.give();done=true})})}.bind(this),"text")}if(done)k();else chan.take(k)}});
define("galileo/util/foodGoalLoader",["require","./channel","galileo/ajax/ajax","galileo/util/dateUtil"],function(require){var channel=require("./channel");var Ajax=require("galileo/ajax/ajax");var dateUtil=require("galileo/util/dateUtil");var started=false;var done=false;var chan=channel();$("body").on("fgmClose",function(){Ajax.get("getWeightTileDataAt","activityTileData",{date:dateUtil.ajaxEncode(new Date)}).update()});return function(k){if(!started){started=true;$.get("/lab/galileo/weightDialogs",
function(html){function waitForFitbit(){if(window["fitbit"]&&window["fitbit"]["i18n"]){$("\x3cdiv\x3e").css({position:"absolute",left:-1E4}).html(parts[1]).appendTo($("body"));chan.give();done=true}else setTimeout(waitForFitbit,100)}var parts=html.split("\x3c!--ENDSCRIPT--\x3e");$("\x3cdiv\x3e").css({position:"absolute",left:-1E4}).html(parts[0]).appendTo($("body"));waitForFitbit()}.bind(this),"text")}if(done)k();else chan.take(k)}});
define("hbs!galileo/modal/template/basicModal",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;var buffer="";var stack1;var functionType="function";buffer+='\x3cdiv class\x3d"basic-modal"\x3e\n    \x3ca class\x3d"close" href\x3d"#"\x3e\n        \x3cspan class\x3d"close-icon"\x3eX\x3c/span\x3e\n    \x3c/a\x3e\n    \x3cdiv class\x3d"content"\x3e';
if(stack1=helpers.content)stack1=stack1.call(depth0,{hash:{}});else{stack1=depth0.content;stack1=typeof stack1===functionType?stack1.apply(depth0):stack1}if(stack1||stack1===0)buffer+=stack1;buffer+="\x3c/div\x3e\n\x3c/div\x3e";return buffer});Handlebars$$0.registerPartial("galileo_modal_template_basicModal",t);return t});
define("basicModal",["underscore","hbs!galileo/modal/template/basicModal"],function(_,template){function _appendToBody($element){$("body").append($element)}function _loadCss(url){if(document.createStyleSheet)document.createStyleSheet(url);else $('\x3clink rel\x3d"stylesheet" type\x3d"text/css" href\x3d"'+url+'" /\x3e').appendTo("head")}var BasicModal=function(modalContent,modalWidth){_loadCss("/styles/modal/basicModal.css");this.$el=$(template({content:modalContent}));this.$el.hide();this.elementId=
_.uniqueId();this.$el.attr("id",this.elementId);this.modalWidth=modalWidth;_appendToBody(this.$el)};BasicModal.prototype.trigger=function(){var self=this;var $modalEl=$("#"+self.elementId);if(self.modalWidth)$modalEl.css({width:self.modalWidth});$modalEl.overlay({top:"20%",target:"#"+self.elementId,load:true,closeOnClick:true,closeOnEsc:true,close:".close",mask:{color:"#000",opacity:.6},onClose:function(){self.$el.remove();$("#exposeMask").fadeOut().remove()}})};return BasicModal});
define("hbs!galileo/modal/template/holidayShipping",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\x3cdiv class\x3d"holidayShipping"\x3e\n    \x3ch1 class\x3d"shippingGuidelines"\x3eShipping guidelines\x3c/h1\x3e\n    \x3cp class\x3d"heading"\x3eTo order and receive products for shipping during the 2013 holiday season, please refer to the following guidelines:\x3c/p\x3e\n    \x3cul\x3e\n        \x3cli\x3eAdd any item to your cart to view whether it\u2019s in-stock. In-stock items ship within 24 hours (1 business day) of your order.\x3c/li\x3e\n        \x3cli\x3eIf an item is back-ordered, please review the cart messaging to determine whether we\u2019ll be able to ship the item in time for your needs.\x3c/li\x3e\n        \x3cli\x3ePlease select the most appropriate shipping method for your delivery. Please note that orders received after noon PST are not likely to ship on the same day as ordered (they will ship the next business day).\x3c/li\x3e\n        \x3cli\x3eOrders to Canadian shipping addresses will take longer to deliver \u2013 please review the cart messaging during check-out.\x3c/li\x3e\n    \x3c/ul\x3e\n\x3c/div\x3e'});
Handlebars$$0.registerPartial("galileo_modal_template_holidayShipping",t);return t});
define("hbs!galileo/modal/template/holidayShippingTwoDay",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\x3cdiv class\x3d"holidayShipping"\x3e\n    \x3ch1 class\x3d"shippingGuidelines"\x3eShipping guidelines\x3c/h1\x3e\n    \x3cp class\x3d"heading"\x3eFREE 2-3 day shipping on all \x3cspan class\x3d"emphasis"\x3ein-stock orders over $50\x3c/span\x3e placed between Friday December 13 at 8:00am PST and Tuesday December 17 at 11:59pm PST\x3c/p\x3e\n    \x3cul\x3e\n        \x3cli\x3eYou must select 2-3 day shipping in order to guarantee the 2-3 day ship method.\x3c/li\x3e\n        \x3cli\x3ePlease review each item\u2019s in-stock or back-order delivery messaging in the cart to ensure the item will ship in time for your needs.\x3c/li\x3e\n        \x3cli\x3ePlease note that in-stock orders received after noon PST are not likely to ship on the same day as ordered (they will ship the next business day).\x3c/li\x3e\n        \x3cli\x3eOrders to Canadian shipping addresses will take longer to deliver \u2013 please review the cart messaging during check-out.\x3c/li\x3e\n    \x3c/ul\x3e\n\x3c/div\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_holidayShippingTwoDay",
t);return t});
define("hbs!galileo/modal/template/holidayShippingOneDay",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\x3cdiv class\x3d"holidayShipping"\x3e\n    \x3ch1 class\x3d"shippingGuidelines"\x3eShipping guidelines\x3c/h1\x3e\n    \x3cp class\x3d"heading"\x3eFREE 1-day shipping on all \x3cspan class\x3d"emphasis"\x3ein-stock orders over $50\x3c/span\x3e placed between Tuesday December 17 at 11:59pm PST and Friday December 20 at 5:00pm PST\x3c/p\x3e\n    \x3cul\x3e\n        \x3cli\x3eYou must select 1-day shipping in order to guarantee the 1-day ship method.\x3c/li\x3e\n        \x3cli\x3ePlease review each item\u2019s in-stock or back-order delivery messaging in the cart to ensure the item will ship in time for your needs.\x3c/li\x3e\n        \x3cli\x3ePlease note that in-stock orders received after noon PST are not likely to ship on the same day as ordered (they will ship the next business day).\x3c/li\x3e\n        \x3cli\x3eOrders to Canadian shipping addresses will take longer to deliver \u2013 please review the cart messaging during check-out.\x3c/li\x3e\n    \x3c/ul\x3e\n\x3c/div\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_holidayShippingOneDay",
t);return t});
define("hbs!galileo/modal/template/holidayShippingTooLate",["hbs","handlebars"],function(hbs,Handlebars$$0){var t=Handlebars$$0.template(function(Handlebars,depth0,helpers,partials,data){this.compilerInfo=[2,"\x3e\x3d 1.0.0-rc.3"];helpers=helpers||Handlebars.helpers;return'\x3cdiv class\x3d"holidayShipping"\x3e\n    \x3ch1 class\x3d"shippingGuidelines"\x3eShipping guidelines\x3c/h1\x3e\n    \x3cp class\x3d"heading"\x3eHoliday shipping on all orders will NOT deliver before December 24\x3c/p\x3e\n    \x3cul\x3e\n        \x3cli\x3eAll in-stock items ship within 24 hours (1 business day) of your order.\x3c/li\x3e\n        \x3cli\x3eIf an item is back-ordered, please review the cart messaging to determine when the item will be available to ship.\x3c/li\x3e\n        \x3cli\x3eHappy Holidays and New Year!\x3c/li\x3e\n    \x3c/ul\x3e\n    \x3cp class\x3d"signature"\x3e-Fitbit Team\x3c/p\x3e\n\x3c/div\x3e'});Handlebars$$0.registerPartial("galileo_modal_template_holidayShippingTooLate",
t);return t});
(function(){var define=window.define||function(f){return f()};define("fitbit-header",["require","jquery","fitbit-widget-dropdown","fitbit-header-notificationDropdown","galileo/util/dateUtil","messages-deviceNames","messages-batteryLevels","galileo/modal/flex101","galileo/modal/force101","galileo/modal/charge101","galileo/modal/device101","galileo/util/dialog101Loader","galileo/util/foodGoalLoader","basicModal","hbs!galileo/modal/template/holidayShipping","hbs!galileo/modal/template/holidayShippingTwoDay","hbs!galileo/modal/template/holidayShippingOneDay",
"hbs!galileo/modal/template/holidayShippingTooLate"],function(require){function initializeAccountSettingsDropdown(){var settingsCatalyst=headerWrapper.find(".account \x3e .nav-item-settings");if(settingsCatalyst.length&&DD){var evNamespace=".accountSettingsDropdown";var settingsSubNav;settingsCatalyst.one("mouseover"+evNamespace+" mousedown"+evNamespace,function(ev){settingsCatalyst.off(evNamespace).addClass("hasdropdown");$.post("/ajaxapi",{request:JSON.stringify({serviceCalls:[{name:"trackerSettings",
method:"getAlarms"},{name:"device",method:"getOwnerDevices"}],template:"common/defaultResponse.json.jsp"})},function(result){var alarmResponse=result[0];var deviceResponse=result[1];var deviceElems=[];if(deviceResponse.length)$.each(deviceResponse,function(index$$0,device){if(!device.softTracker){if(device.type=="FLOJO"&&launchAria101){$("#header-settings-subnav .aria101").removeClass("invisible");$("#header-settings-subnav .aria101 a").off("click").click(function(){launchAria101();settingsSubNav.hide()})}else if(device.type==
"PROTON"&&launchNewDevice101){$("#header-settings-subnav .surge101").removeClass("invisible");$("#header-settings-subnav .surge101 a").off("click").click(function(){launchNewDevice101("surge");settingsSubNav.hide()})}else if(device.type=="GRAVITON"&&launchNewDevice101){$("#header-settings-subnav .chargeHR101").removeClass("invisible");$("#header-settings-subnav .chargeHR101 a").off("click").click(function(){launchNewDevice101("chargehr");settingsSubNav.hide()})}else if(device.type=="TAU"&&launchCharge101){$("#header-settings-subnav .charge101").removeClass("invisible");
$("#header-settings-subnav .charge101 a").off("click").click(function(){launchCharge101();settingsSubNav.hide()})}else if(device.type=="QUARK"&&launchFlex101){$("#header-settings-subnav .flex101").removeClass("invisible");$("#header-settings-subnav .flex101 a").off("click").click(function(){launchFlex101();settingsSubNav.hide()})}else if(device.type=="NEUTRINO"&&launchForce101){$("#header-settings-subnav .force101").removeClass("invisible");$("#header-settings-subnav .force101 a").off("click").click(function(){launchForce101();
settingsSubNav.hide()})}else if(device.type=="HADRON"&&launchOne101){$("#header-settings-subnav .one101").removeClass("invisible");$("#header-settings-subnav .one101 a").off("click").click(function(){launchOne101();settingsSubNav.hide()})}else if(device.type=="TYCHO"&&launchUltra101){$("#header-settings-subnav .ultra101").removeClass("invisible");$("#header-settings-subnav .ultra101 a").off("click").click(function(){launchUltra101();settingsSubNav.hide()})}else if(device.type=="GALILEO"&&launchZip101){$("#header-settings-subnav .zip101").removeClass("invisible");
$("#header-settings-subnav .zip101 a").off("click").click(function(){launchZip101();settingsSubNav.hide()})}deviceElems.push($("\x3cli\x3e").addClass("device-divider").append($("\x3cdiv\x3e").addClass("hr")));var elem=$("\x3cli\x3e").addClass("device").addClass("device-"+device.productName.toLowerCase().replace(" ",""));var settingsLink=$("\x3ca\x3e").addClass("gotoSettings").appendTo(elem);device.settingsUrl&&settingsLink.attr("href",device.settingsUrl);settingsLink.append($("\x3cdiv\x3e").addClass("icon"));
var infoDiv=$("\x3cdiv\x3e").addClass("info").append($("\x3cspan\x3e").addClass("type").text(_getDeviceMessage(device.type,"displayName")),$("\x3cbr\x3e"),$("\x3cspan\x3e").addClass("sync deviceDetail").data("time",device.lastSyncTime).text(device.lastSyncTime>0?_getRelativeDateMessage(device.lastSyncTime):"")).appendTo(settingsLink);var nextAlarm;$.each(alarmResponse,function(index,alarm){if(alarm.trackerId===device.id&&alarm.enabled&&alarm.nextAlarmTimeUTC)if(!nextAlarm)nextAlarm=alarm;else if(alarm.nextAlarmTimeUTC<
nextAlarm.nextAlarmTimeUTC)nextAlarm=alarm});if(nextAlarm)infoDiv.append($("\x3cbr\x3e"),$("\x3cspan\x3e").addClass("alarm deviceDetail").text(nextAlarm.nextAlarmLocalDay+" "+nextAlarm.localTime));infoDiv.append($("\x3cdiv\x3e").addClass("battery").addClass(device.battery?device.battery.toLowerCase():"").attr("title",device.battery?_getBatteryMessage(device.battery.toLowerCase()):""));deviceElems.push(elem)}});deviceElems.push($("\x3cli\x3e").addClass("divider"));$.each(deviceElems.reverse(),function(){$("#header-settings-subnav").prepend(this)})},
"json")}).one("click",function(ev$$0){ev$$0.preventDefault();settingsSubNav=new DD(settingsCatalyst,{anchorPoint:"below right",className:subNavClass+" subnav-settings",catalystActiveClass:activeClass,mouseBoundaryDetectionEnabled:false});var settingsSubNavContent=$("#header-settings-subnav");settingsSubNav.render(settingsSubNavContent);settingsSubNav.subscribe("beforeShow",function(){settingsSubNavContent.find(".device .sync").each(function(index,el){var absoluteTime=parseInt($(el).attr("data-time"));
if(absoluteTime>0)$(el).text(_getRelativeDateMessage(absoluteTime))})});settingsSubNav.subscribe("beforeShow",function(){var rootEl=settingsSubNav.getRootElement();$(rootEl).find(".link-dashboard").on("click",function(ev){ev.preventDefault();var element=$(this);var setting=element.data("setting");$.get("/userSettings/dh/save?apiFormat\x3djson\x26settings['show%20galileo%20dashboard']\x3d"+setting,function(){window.location="/"})})},true);settingsSubNav.show()})}}function getCookie(name){var cookies=
document.cookie.split("; ");for(var i=0;i<cookies.length;i++){nameAndValue=cookies[i].split("\x3d");if(nameAndValue[0]==name)return unescape(nameAndValue[1])}return null}function displayCartCount(){var count=0;var merchandise=getCookie("cart_merchandise");if(merchandise){items=merchandise.split("|");for(var i=1;i<items.length-1;i++)if(items[i][0]=="p"){lineItem=items[i].split(":");if(lineItem)count+=parseInt(lineItem[lineItem.length-1])}}$(".cart-indicator \x3e span").html(count)}var isAMD=typeof require===
"function";var isLayoutBaseLean=document.getElementById("requirejs");var launchFlex101=null;var launchForce101=null;var launchCharge101=null;var launchAria101=null;var launchOne101=null;var launchUltra101=null;var launchZip101=null;var launchNewDevice101=null;var load101=null;var foodGoalLoader=null;if(isAMD){var $=require("jquery");var DD=require("fitbit-widget-dropdown");require("fitbit-header-notificationDropdown")}else{$=window.jQuery;DD=$.isFunction(fitbit.modules.dropdown)&&fitbit.modules.dropdown}if(isAMD&&
!isLayoutBaseLean){var _getRelativeDateMessage=require("galileo/util/dateUtil").getRelativeDate;var deviceMessageBundle=require("messages-deviceNames");var batteryMessageBundle=require("messages-batteryLevels");var undefinedMessage="???";var _getDeviceMessage=function(deviceType,messageType){return deviceMessageBundle[deviceType]&&deviceMessageBundle[deviceType][messageType]?deviceMessageBundle[deviceType][messageType]:undefinedMessage};var _getBatteryMessage=function(level){return batteryMessageBundle[level]?
batteryMessageBundle[level]:undefinedMessage};launchFlex101=require("galileo/modal/flex101");launchForce101=require("galileo/modal/force101");launchCharge101=require("galileo/modal/charge101");launchNewDevice101=require("galileo/modal/device101");load101=require("galileo/util/dialog101Loader");foodGoalLoader=require("galileo/util/foodGoalLoader");var launchDevice101=function(deviceFn){return function(){load101(function(){$[deviceFn]()})}};launchAria101=function(){foodGoalLoader(launchDevice101("aria101"))};
launchOne101=launchDevice101("one101");launchUltra101=function(){load101(function(){$("#fb101").fitbit101()})};launchZip101=launchDevice101("zip101")}else{_getRelativeDateMessage=fitbit.util.getRelativeDate;var ns="com.fitbit.app.device.message.";_getDeviceMessage=function(deviceType,messageType){return fitbit.i18n.getResource(ns+"device_"+messageType+"_"+deviceType)};_getBatteryMessage=function(level){return fitbit.i18n.getResource(ns+"battery_"+level)}}var _getMixpanel=function(){var mixpanel=window.mixpanel;
var master=mixpanel.master;return master?master:mixpanel};var headerWrapper=$(".wrapper-header").first();if(headerWrapper.data("fitbitHeaderInitialized"))return;headerWrapper.data("fitbitHeaderInitialized",true);var primaryNav=headerWrapper.find(".wrapper-nav");var isDashboardNav=headerWrapper.hasClass("nav-app");var activeClass="active";var subNavClass="subnav";if(isDashboardNav)subNavClass+=" subnav-app";primaryNav.on("click",".nav \x3e li",function(ev){if($(ev.currentTarget).hasClass("nav-products"))ev.preventDefault();
else{var url=$(this).find("a").first().attr("href");if(url){ev.preventDefault();location.href=url}}});initializeAccountSettingsDropdown();$(function(){if(launchFlex101&&(/launchFlex101/.test(window.location.hash)||/launchFlex101/.test(window.location.search)))launchFlex101();else if(launchForce101&&(/launchForce101/.test(window.location.hash)||/launchForce101/.test(window.location.search)))launchForce101();else if(launchCharge101&&(/launchCharge101/.test(window.location.hash)||/launchCharge101/.test(window.location.search)))launchCharge101();
else if(launchNewDevice101&&(/launchSurge101/.test(window.location.hash)||/launchSurge101/.test(window.location.search)))launchNewDevice101("surge");else if(launchNewDevice101&&(/launchChargeHR101/.test(window.location.hash)||/launchChargeHR101/.test(window.location.search)))launchNewDevice101("chargehr");var systemAlertsWrapper=$(".wrapper-system-alerts");if(systemAlertsWrapper.length){var alertSelector=".system-alert";var systemAlerts=systemAlertsWrapper.find(alertSelector);systemAlerts.find(".exit").one("click",
function(){var currentAlert=$(this).closest(alertSelector);var alertObject={alertType:currentAlert.data("type"),deviceType:currentAlert.data("device")};var cwProgramId=currentAlert.data("cw-program");if(cwProgramId!=null)alertObject.attributes={CORPORATE_PROGRAM_ID:cwProgramId};var jsonAlert=JSON.stringify(alertObject);var reqParams={request:JSON.stringify({template:"user/dash/alertResponse.json.jsp",serviceCalls:[{name:"alert",method:"processAlert",args:{action:"CLOSE",alert:jsonAlert}}]})};$.ajax({type:"post",
url:"/ajaxapi",data:reqParams,dataType:"json"});currentAlert.trigger("destroy.systemAlert");var hideEffect=systemAlerts.length>1?"fadeOut":"slideUp";currentAlert[hideEffect](function(){var nextAlert=currentAlert.next(alertSelector);if(nextAlert.length)nextAlert.fadeIn(function(){currentAlert.remove();parseAndSaveCookieData(nextAlert);nextAlert.trigger("impression.systemAlert")});else systemAlertsWrapper.slideUp(function(){systemAlertsWrapper.remove();setTimeout(function(){$("body").trigger("resetGlobalTimeSelector")},
0)})})});var parseAndSaveCookieData=function(systemAlertWrapperElement){if(!systemAlertWrapperElement)return;var cookieData=systemAlertWrapperElement.first().data("cookie");if(cookieData&&!/^\s*$/.test(cookieData)){var cookieExpireDate=new Date;cookieExpireDate.setTime(cookieExpireDate.getTime()+2629743830);document.cookie="system_alert"+"\x3d"+cookieData+"; expires\x3d"+cookieExpireDate.toGMTString()+"; path\x3d/;"}};var firstAlert=systemAlerts.first();parseAndSaveCookieData(firstAlert);var fireTrackingEvent=
function(device){if(typeof device!=="string")return;var trackingData=["_trackEvent","GlobalAlertProductReview-"+device];if(arguments.length>1)trackingData=trackingData.concat(Array.prototype.slice.call(arguments,1));try{fitbit.util.deferredTrack(trackingData)}catch(e){if(console)console.log("header.js: 'fitbit.util.deferredTrack' is not available")}};var mixpanelTrackAmazon=function(event,device,action){if(!event)return;var obj={};device&&(obj["!PRODUCT_SHOWN"]=device);typeof action!=void 0&&(obj["!ACTION"]=
action);_getMixpanel().track(event,obj)};var mixpanelTrackAmazonClick=function(device,action){mixpanelTrackAmazon("Dash: Amazon Review Alert Clicked",device,action)};systemAlerts.filter(".amazon-review").one("impression.systemAlert",function(){var device=$(this).data("device");fireTrackingEvent(device,"Display","Show");mixpanelTrackAmazon("Dash: Amazon Review Alert",device)}).one("click contextmenu",".message a",function(ev){var device=$(ev.delegateTarget).data("device");fireTrackingEvent(device,
"Click","LinkToAmazon");mixpanelTrackAmazonClick(device,"review")}).one("destroy.systemAlert",function(ev){var device=$(ev.target).data("device");fireTrackingEvent(device,"Click","CloseForever");mixpanelTrackAmazonClick(device,"close")});systemAlerts.filter(".newDashInvite").one("impression.systemAlert",function(){_getMixpanel().track("Dash: Preview Promo")});firstAlert.trigger("impression.systemAlert")}if(DD){var subNavParents=primaryNav.find(".hasdropdown");subNavParents.each(function(index,el){function clearTimers(){if(showTimer){clearTimeout(showTimer);
showTimer=null}if(hideTimer){clearTimeout(hideTimer);hideTimer=null}}function hideSubNav(){isMouseCursorInsideCatalyst=false;clearTimers();if(subnav&&subnav.isVisible())hideTimer=setTimeout(function(){if(!subnav.isMouseCursorInsideDropdown&&!isMouseCursorInsideCatalyst){subnav.hide();catalyst.removeClass(activeClass)}clearTimers()},200)}function showSubNav(){isMouseCursorInsideCatalyst=true;clearTimers();if(subnav){subnav.cancelHide();if(!subnav.isVisible())showTimer=setTimeout(function(){subnav.show();
clearTimers()},350)}}var catalyst=$(el);var subnav=null;var hideTimer=null;var showTimer=null;var isMouseCursorInsideCatalyst=false;catalyst.one("mouseover",function(){subnav=new DD(catalyst,{className:subNavClass,catalystActiveClass:activeClass,hideDelay:200,manualShowEnabled:true});subnav.render(catalyst.find(".subnav-content").first());showSubNav()}).on("mouseenter",showSubNav).on("mouseleave",hideSubNav)})}var $cartIcon=headerWrapper.find(".nav-item-cart");if($cartIcon.length)$(document.body).on("hideCartIcon.siteHeader",
function(){$cartIcon.hide()}).on("showCartIcon.siteHeader",function(){$cartIcon.show()})});!function initializeHolidayRibbons(){var BasicModal=require("basicModal");var holidayShoppingContents=require("hbs!galileo/modal/template/holidayShipping")();var holidayShoppingTwoDayContents=require("hbs!galileo/modal/template/holidayShippingTwoDay")();var holidayShoppingOneDayContents=require("hbs!galileo/modal/template/holidayShippingOneDay")();var holidayShoppingTooLateContents=require("hbs!galileo/modal/template/holidayShippingTooLate")();
var $holidayShipping=$(".wrapper-header .holiday-banner.shop-holidays");var $holidayShippingTwoDay=$(".wrapper-header .holiday-banner.two-day-shipping");var $holidayShippingOneDay=$(".wrapper-header .holiday-banner.one-day-shipping");var $holidayShippingTooLate=$(".wrapper-header .holiday-banner.too-late-shipping");$holidayShipping.click(function(){(new BasicModal(holidayShoppingContents,500)).trigger()});$holidayShippingTwoDay.click(function(){(new BasicModal(holidayShoppingTwoDayContents,500)).trigger()});
$holidayShippingOneDay.click(function(){(new BasicModal(holidayShoppingOneDayContents,500)).trigger()});$holidayShippingTooLate.click(function(){(new BasicModal(holidayShoppingTooLateContents,500)).trigger()})}();$(document).ready(function(){displayCartCount()})})})();