function getKeyPressed(n){var t=undefined;return document.all?t=String.fromCharCode(event.keyCode):document.getElementById?t=String.fromCharCode(n.which):document.layers&&(t=String.fromCharCode(n.which)),t}function convertWeight(n,t){if(n=="")return n;var i=n;return t==="UsStandard"?Math.round(parseFloat(n.replace(",","."))*2.2046):Math.round(10*n*.4536)/10}function convertHeight(n,t){return t==="UsStandard"?heightToUsStandard(n[0]*.393700787402):heightToMetric(n[0],n[1])}function heightToMetric(n,t){(t==undefined||t=="")&&(t=0);var i=n*12+parseInt(t);return i!=0?Math.round(i*2.54):""}function heightToUsStandard(n){var t=Math.floor(n/12),i=Math.round(n-t*12,10);return i==12&&(i=0,t+=1),t==0&&i==0?["",""]:[t,i]}function isTextSelected(n){return typeof n.selectionStart=="number"?n.selectionEnd-n.selectionStart>=0:typeof document.selection!="undefined"?(n.focus(),document.selection.createRange().text==n.value):void 0}function checkLowerThan(n,t,i,r){var f=parseFloat(getKeyPressed(n)),u,e,o;if(!isNaN(f)){if(u=t.val(),isTextSelected(t)||isTextSelected(t[0]))var s=u.substring(0,t.getSelectionStart()),h=u.substring(t.getSelectionEnd()),o=(s+f+h).replace(",",".");else e=t.getSelectionStart(),o=(u.substring(0,e)+f+u.substring(e)).replace(",",".");o<=r&&t.val(o.toString());n.preventDefault()}}function allowsNumbers(n){$.inArray(n.keyCode,[46,8,9,27,13])!==-1||n.keyCode==65&&n.ctrlKey===!0||n.keyCode>=35&&n.keyCode<=39||(n.shiftKey||n.keyCode<48||n.keyCode>57)&&(n.keyCode<96||n.keyCode>105)&&n.preventDefault()}function allowsDecimalNumbers(n,t){if($.inArray(n.keyCode,[46,8,9,27,13,110,188,190])!==-1||n.keyCode==65&&n.ctrlKey===!0||n.keyCode>=35&&n.keyCode<=39){var i=t.val();$.inArray(n.keyCode,[110,188,190])>=0&&(i.indexOf(",")!=-1||i.indexOf(".")!=-1||i.length==0)&&n.preventDefault();return}(n.shiftKey||n.keyCode<48||n.keyCode>57)&&(n.keyCode<96||n.keyCode>105)&&n.preventDefault()}function isMobileUserAgent(){return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}function getUserProfilextendedData(n,t,i,r){var u,f;if(EU.isLoggedUser()){if(u=t?EU.clientStorage.sessionStorage.getItem(t):null,u)return $.isEmptyObject(u)&&(u=null),i&&i(u),u;f={appFilter:n};EU.api.services.corsPostCall(EU.api.services.actions.getExtendedProfile(),f,function(n){var r=null;return n.data&&n.data.profile?(r=n.data.profile,t&&EU.clientStorage.sessionStorage.setItem(t,r)):t&&EU.clientStorage.sessionStorage.setItem(t,{}),i&&i(r),r},r)}else return i&&i(null),null}function showLoading(n){$("#onloading").fadeIn("fast");n&&showBusyPanel()}function hideLoading(){$("#onloading").hide("fast");clearFeedbackTimeout();$(".feedbackMessageBusyPanel").hide()}function isBootstrapBreakpoint(n){return $(".device-"+n).is(":visible")}function distanceFromRPMperSeconds(n,t){var i=n*900/1e4;return i*t}function round(n,t){return Number(Math.round(n+"e"+t)+"e-"+t)}function getAge(n){var i=new Date,t,r;return n instanceof Date||(n=new Date(n)),t=i.getFullYear()-n.getFullYear(),r=i.getMonth()-n.getMonth(),(r<0||r===0&&i.getDate()<n.getDate())&&(t=t-1),t}function getParameterByName(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i="[\\?&]"+n+"=([^&#]*)",r=new RegExp(i),t=r.exec(window.location.search);return t==null?"":decodeURIComponent(t[1].replace(/\+/g," "))}function isBrowserCookiesEnabled(){return IS_IE()?"cookie"in document&&(document.cookie.length>0||(document.cookie="test").indexOf.call(document.cookie,"test")>-1):navigator.cookieEnabled}function checkIfCookiesIsEnabled(n,t){$(document).ready(function(){if(isBrowserCookiesEnabled){$.cookie.json=!0;var i=$.cookie(EU.consts.privacySettingsCookieName);i&&i.technicalCookiesEnabled=="false"&&$("#"+t).length&&$("#"+t).modal()}else $("#"+n).length&&$("#"+n).modal()})}function randomIntFromInterval(n,t){return Math.floor(Math.random()*(t-n+1)+n)}function getDateTimeNowAsInt(){var n=(new Date).getDate();return parseInt(n.getFullYear().toString()+n.getMonth().pad(2)+n.getDay().pad(2))}function getMobileOperatingSystem(){var n=navigator.userAgent||navigator.vendor||window.opera;return/windows phone/i.test(n)?"windowsphone":/android/i.test(n)?"android":/iPad|iPhone|iPod/.test(n)&&!window.MSStream?"ios":undefined}function getTimeDecreased(n,t,i){var r={days:parseInt(n),hours:parseInt(t),minutes:parseInt(i)};return r.minutes--,r.minutes<0&&(r.minutes=59,r.hours--,r.hours<0&&(r.hours=23,r.days--,r.days<0&&(r.days=0,r.hours=0,r.minutes=0))),r}function hexToRgba(n,t){var i=null;return n!==null&&t!==null&&(i=n.trim(),/^#([A-Fa-f0-9]{3}){1,2}$/.test(i)&&(i=i.substring(1).split(""),i.length==3&&(i=[i[0],i[0],i[1],i[1],i[2],i[2]]),i="0x"+i.join(""),i="rgba("+[i>>16&255,i>>8&255,i&255].join(",")+","+t+")")),i}function createCORSRequest(n,t,i,r){var u=new XMLHttpRequest;return"withCredentials"in u?u.open(n,t,!0):typeof XDomainRequest!="undefined"?(u=new XDomainRequest,u.open(n,t)):u=null,u!=null&&(u.timeout=3e5,i!==undefined&&u.setRequestHeader("Content-type",i),r&&u.setRequestHeader("x-amz-server-side-encryption","AES256")),u}function xhrRequest(n,t,i,r,u,f,e){var o=createCORSRequest(n,i,f,e);o?(o.send(t),o.onload=function(){o.status>=400?u():r()},o.onerror=function(){typeof resetVideoAndPictureToUpload!="undefined"?(resetVideoAndPictureToUpload(),ShowNegativeFeedback(errorLabel)):u()}):(resetVideoAndPictureToUpload(),ShowNegativeFeedback(errorLabel))}function showBusyPanel(){_busyFeedbackMessageTimeout=setTimeout(function(){IS_IE&&IE_VERSION<9?$(".feedbackMessageBusyPanel").css("display","block"):$(".feedbackMessageBusyPanel").fadeIn(300);_feedbackMessageTimeout=null},500)}function showSuccessFeedback(n){showFeedback("alert-success",n)}function showDangerFeedback(n){showFeedback("alert-danger",n)}function showInfoFeedback(n){showFeedback("alert-info",n)}function showBusyFeedback(n){showFeedback("alert-warning",n)}function showFeedback(n,t){clearFeedbackTimeout();$(".feedbackMessageBusyPanel").hide();$(".feedbackMessagePanel").hide();$(".feedbackMessagePanel .feedbackMessage").removeClass("alert-success alert-danger alert-info alert-warning").addClass(n);$(".feedbackMessagePanel .feedbackMessage span.text").html(t);n=="alert-warning"?(showBusyPanel(),$(".feedbackMessagePanel").fadeIn(150)):($(".feedbackMessagePanel").fadeIn(300),_feedbackMessageTimeout=setTimeout(hideFeedback,8e3))}function hideFeedback(){clearFeedbackTimeout();$(".feedbackMessageBusyPanel").fadeOut(300);$(".feedbackMessagePanel").fadeOut(300)}function clearFeedbackTimeout(){_feedbackMessageTimeout&&clearTimeout(_feedbackMessageTimeout);_busyFeedbackMessageTimeout&&(clearTimeout(_busyFeedbackMessageTimeout),_busyFeedbackMessageTimeout=null)}function setEULocale(){var n=$("html").data("lang")||EU.config.defaultLocale,t=$("html").data("club")||EU.config.defaultClub;EU.config.locale=n;EU.config.club=t;window.I18n&&(I18n.locale=n.replace("-","_"))}var EU={},IE_VERSION,IS_IE,localization,_feedbackMessageTimeout,_busyFeedbackMessageTimeout;EU.config={API_HOST:"services.mywellness.com",API_APP_ID:"ec1d38d7-d359-48d0-a60c-d8c0b8fb9df9",LEADERBOARD_HOST:"leaderboards.mywellness.com",MESSENGER_HOST:"messenger.mywellness.com",defaultLocale:"en-GB",defaultClub:"cloud",locale:null,club:null,httpsPort:443,httpsServicesPort:443,version:"2.2.6.1",social:{facebook:{APP_ID:"106614989436655",scopes:"user_birthday, email"},googleplus:{APP_ID:"670278552992.apps.googleusercontent.com",scopes:""},twitter:{APP_ID:"SrVdFU2EaAlZQNDGXiiEsw",scopes:""}}};typeof String.prototype.startsWith!="function"&&(String.prototype.startsWith=function(n){return this.slice(0,n.length)==n});typeof String.prototype.endsWith!="function"&&(String.prototype.endsWith=function(n){return this.slice(-n.length)==n});String.prototype.format||(String.prototype.format=function(){var n=arguments;return this.replace(/{(\d+)}/g,function(t,i){return typeof n[i]!="undefined"?n[i]:t})});String.prototype.firstChar||(String.prototype.firstChar=function(){return this!=null&&this!=""?this.trim().charAt(0).toUpperCase():""});String.prototype.hashCode=function(){var n=0,t,i,r;if(this.length==0)return n;for(t=0,r=this.length;t<r;t++)i=this.charCodeAt(t),n=(n<<5)-n+i|0;return n};String.prototype.pad||(String.prototype.pad=function(n){if(this!=null&&this!=""){for(var t=this;t.length<n;)t="0"+t;return t.toString()}return""});Number.prototype.pad||(Number.prototype.pad=function(n){if(this!=null&&this!=undefined){for(var t=this+"";t.length<n;)t="0"+t;return t.toString()}return""});Number.prototype.isNull||(Number.prototype.isNull=function(){return typeof this=="undefined"||this===null||isNaN(this)});Number.prototype.toHHMMSS||(Number.prototype.toHHMMSS=function(){sec_numb=parseInt(this);var n=Math.floor(sec_numb/3600),t=Math.floor((sec_numb-n*3600)/60),i=sec_numb-n*3600-t*60;return n<10&&(n="0"+n),t<10&&(t="0"+t),i<10&&(i="0"+i),n=="00"?t+":"+i:n+":"+t+":"+i});Number.prototype.isInteger||(Number.prototype.isInteger=function(){return this%1==0});navigator.browserInfo=function(){var i=navigator.userAgent,t,n=i.match(/(opera|chrome|safari|firefox|msie|trident(?=\/))\/?\s*(\d+)/i)||[];return/trident/i.test(n[1])?(t=/\brv[ :]+(\d+)/g.exec(i)||[],"IE "+(t[1]||"")):n[1]==="Chrome"&&(t=i.match(/\bOPR\/(\d+)/),t!=null)?"Opera "+t[1]:(n=n[2]?[n[1],n[2]]:[navigator.appName,navigator.appVersion,"-?"],(t=i.match(/version\/(\d+)/i))!=null&&n.splice(1,1,t[1]),{browser:n[0],version:n[1]})}();Array.prototype.removeIf=function(n){for(var t=this.length;t--;)n(this[t],t)&&this.splice(t,1)};jQuery.fn.getCursorPosition=function(){return this.lengh==0?-1:$(this).getSelectionStart()};jQuery.fn.setCursorPosition=function(n){return this.lengh==0?this:$(this).setSelection(n,n)};jQuery.fn.getSelection=function(){if(this.lengh==0)return-1;var n=$(this).getSelectionStart(),t=$(this).getSelectionEnd();return this[0].value.substring(n,t)};jQuery.fn.getSelectionStart=function(){var n,t;return this.lengh==0?-1:(input=this[0],n=input.value.length,input.createTextRange?(t=document.selection.createRange().duplicate(),t.moveEnd("character",input.value.length),t.text==""&&(n=input.value.length),n=input.value.lastIndexOf(t.text)):typeof input.selectionStart!="undefined"&&(n=input.selectionStart),n)};jQuery.fn.getSelectionEnd=function(){var n,t;return this.lengh==0?-1:(input=this[0],n=input.value.length,input.createTextRange?(t=document.selection.createRange().duplicate(),t.moveStart("character",-input.value.length),t.text==""&&(n=input.value.length),n=input.value.lastIndexOf(t.text)):typeof input.selectionEnd!="undefined"&&(n=input.selectionEnd),n)};jQuery.fn.setSelection=function(n,t){if(this.lengh==0)return this;if(input=this[0],input.createTextRange){var i=input.createTextRange();i.collapse(!0);i.moveEnd("character",t);i.moveStart("character",n);i.select()}else input.setSelectionRange&&(input.focus(),input.setSelectionRange(n,t));return this};jQuery.fn.preventMultipleSubmit=function(){var n=$("button[type=submit]",this);$(this).on("submit",function(t){var i=$(this);i.valid()?n.attr("disabled","disabled"):t.preventDefault()});return this};jQuery.fn.hasAttr=function(n){var t=this.attr(n);return t!==undefined&&t!==!1};jQuery.fn.disableButton=function(n){return n&&n.preventDefault(),$(this).attr("disabled","disabled"),this};jQuery.fn.enableButton=function(n){return n&&n.preventDefault(),$(this).removeAttr("disabled"),this};$.ajaxSetup({beforeSend:function(n){n.setRequestHeader("X-MWAPPS-CLIENT","enduserweb");n.setRequestHeader("X-MWAPPS-APPID",EU.config.API_APP_ID)}});EU.currentUser={id:null,token:null,culture:"en-GB",language:"en",measurementSystem:"Metric",windowTimeZoneId:"",aspirationMap:null,isMywellnessKeyInserted:!1};EU.consts={cdnHttpsBaseUrl:"https://cdnmedia.mywellness.com/",defaultThirdPartiesLogoUrl:"{0}thirdparties/web/{1}-logo.png",hrZoneNames:[{color:"#F0C2C1",id:"hr_veryhard"},{color:"#FCD7B2",id:"hr_hard"},{color:"#FFEFA3",id:"hr_moderate"},{color:"#DCEBB2",id:"hr_light"},{color:"#C8ECF1",id:"hr_verylight"}],powerZoneNames:[{color:"#F0C2C1",id:"hr_veryhard"},{color:"#FCD7B2",id:"hr_hard"},{color:"#FFEFA3",id:"hr_moderate"},{color:"#DCEBB2",id:"hr_light"},{color:"#C8ECF1",id:"hr_verylight"}],privacySettingsCookieName:"privacysettingseu"};EU.isLoggedUser=function(){return this.currentUser&&this.currentUser.id};EU.clientStorage={consistencyCookieName:"_mwconsistencystorage",aspirationMapKey:function(){return"am_"+EU.currentUser.id},fbUserAuthKey:function(){return"fb_"+EU.currentUser.id},gpUserAuthKey:function(){return"gp_"+EU.currentUser.id},localizationdDictionaryKey:function(n){return n?"loc_"+n:"loc"},isMwkInsertedKey:function(){return"mwk_inserted"},getCookie:function(){$.cookie.json=!0;var n=$.cookie(EU.clientStorage.consistencyCookieName);return n?n:{}},setCookie:function(n,t,i){var r=i?i:this.getCookie();r[n]=t.hashCode();$.cookie(EU.clientStorage.consistencyCookieName,r,{path:"/",domain:".mywellness.com"})},localStorage:{getItem:function(n){var r=null,t,i;return localStorage[n]&&(t=localStorage[n],i=EU.clientStorage.getCookie(),i[n]?t.hashCode()==i[n]?r=JSON.parse(t):localStorage.removeItem(n):(EU.clientStorage.setCookie(n,t,i),r=JSON.parse(t))),r},setItem:function(n,t){var i=$.type(t)==="string"?t:JSON.stringify(t);localStorage.setItem(n,i);EU.clientStorage.setCookie(n,i)},removeItem:function(n){localStorage.removeItem(n);EU.clientStorage.setCookie(n,"deleted")}},sessionStorage:{getItem:function(n){var r=null,t,i;return sessionStorage[n]&&(t=sessionStorage[n],i=EU.clientStorage.getCookie(),i[n]?t.hashCode()==i[n]?r=JSON.parse(t):sessionStorage.removeItem(n):(EU.clientStorage.setCookie(n,t,i),r=JSON.parse(t))),r},setItem:function(n,t){var i=$.type(t)==="string"?t:JSON.stringify(t);sessionStorage.setItem(n,i);EU.clientStorage.setCookie(n,i)},removeItem:function(n){sessionStorage.removeItem(n);EU.clientStorage.setCookie(n,"deleted")}}};EU.api={services:{timeoutCall:25e3,getParams:function(n,t){return n||(n={}),n._c=t?t:$("html").data("lang"),n.AppId=EU.config.API_APP_ID,!n.token&&EU.isLoggedUser()&&(n.token=EU.currentUser.token),n},getUrl:function(n,t,i){var u="https:",f=EU.config.httpsServicesPort!=443&&u=="https:"?":"+EU.config.httpsServicesPort:"",r=[u,"//",EU.config.API_HOST];return f!=""&&r.push(f),r.push(n),(i===undefined||i===null)&&(EU.isLoggedUser()&&(i=EU.currentUser.id),(i===undefined||i===null)&&(i=EU.config.API_APP_ID)),r.push(i),r.push(t),r.join("")},getExerciseLeaderBoardUrl:function(n,t){var i=["https:","//",EU.config.LEADERBOARD_HOST];return i.push(n),i.push(t),i.join("")},getMessengerUrl:function(n,t){var i=["https:","//",EU.config.MESSENGER_HOST];return i.push(n),i.push(t),i.join("")},corsPostCall:function(n,t,i,r,u,f,e){if(!n||n==="")return r?r({Errors:[{type:"url",errorMessage:'field "url" is mandatory!'}]}):void 0;var t=EU.api.services.getParams(t,f);return n+="?_c="+t._c,$.ajax({traditional:u?u:!1,crossDomain:!0,type:"POST",url:n,data:JSON.stringify(t),dataType:"json",contentType:"application/json",xhrFields:{withCredentials:!1},cache:!1,statusCode:{404:function(){r&&r({Errors:[{type:"404",errorMessage:"Service not found!"}]})},500:function(){r&&r({Errors:[{type:"500",errorMessage:"Internal error!"}]})}},beforeSend:function(n){"beforeSend"in $.ajaxSettings&&$.ajaxSettings.beforeSend(n);e&&t.token&&n.setRequestHeader("Authorization","Bearer "+t.token)},success:function(n){i&&i(n)},error:function(n,t){r&&r({Errors:[{type:"corsPostCall",errorMessage:t}]})},abort:function(){r&&r({Errors:[{type:"abort",errorMessage:"Internal error!"}]})},timeout:this.timeoutCall})},corsPutCall:function(n,t,i,r,u,f,e){if(!n||n==="")return r?r({Errors:[{type:"url",errorMessage:'field "url" is mandatory!'}]}):void 0;var t=EU.api.services.getParams(t,f);return n+="?_c="+t._c,$.ajax({traditional:u?u:!1,crossDomain:!0,type:"PUT",url:n,data:JSON.stringify(t),dataType:"json",contentType:"application/json",xhrFields:{withCredentials:!1},cache:!1,statusCode:{404:function(){r&&r({Errors:[{type:"404",errorMessage:"Service not found!"}]})},500:function(){r&&r({Errors:[{type:"500",errorMessage:"Internal error!"}]})}},beforeSend:function(n){"beforeSend"in $.ajaxSettings&&$.ajaxSettings.beforeSend(n);e&&t.token&&n.setRequestHeader("Authorization","Bearer "+t.token)},success:function(n){i&&i(n)},error:function(n,t){r&&r({Errors:[{type:"corsPutCall",errorMessage:t}]})},abort:function(){r&&r({Errors:[{type:"abort",errorMessage:"Internal error!"}]})},timeout:this.timeoutCall})},corsGetCall:function(n,t,i,r,u,f){return!n||n===""?r?r({Errors:[{type:"url",errorMessage:'field "url" is mandatory!'}]}):void 0:$.ajax({traditional:u?u:!1,crossDomain:!0,type:"GET",url:n,data:EU.api.services.getParams(t,f),xhrFields:{withCredentials:!1},cache:!1,statusCode:{404:function(){r&&r({Errors:[{type:"404",errorMessage:"Service not found!"}]})},500:function(){r&&r({Errors:[{type:"500",errorMessage:"Internal error!"}]})}},success:function(n){i&&i(n)},error:function(n,t){r&&r({Errors:[{type:"corsGetCall",errorMessage:t}]})},abort:function(){r&&r({Errors:[{type:"abort",errorMessage:"Internal error!"}]})},timeout:this.timeoutCall})},actions:{getAspirationMap:function(){return EU.api.services.getUrl("/Aspirations/User/","/GetAspirationMap")},saveUserAspirationMap:function(){return EU.api.services.getUrl("/Aspirations/User/","/SaveAspirationMap")},saveSurvey:function(){return EU.api.services.getUrl("/Surveys/User/","/SaveSurveyResults")},cloudMoves:function(){return EU.api.services.getUrl("/Challenges/Application/","/CloudMoves",EU.config.API_APP_ID)},saveExtendedData:function(){return EU.api.services.getUrl("/Core/User/","/SaveExtendedData")},getExtendedProfile:function(){return EU.api.services.getUrl("/Core/User/","/GetExtendedProfile")},assignFacebookProfile:function(){return EU.api.services.getUrl("/Core/User/","/AssignFacebookProfile")},assignGooglePlusProfile:function(){return EU.api.services.getUrl("/Core/User/","/AssignGooglePlusProfile")},removeSocialNetworkProfile:function(){return EU.api.services.getUrl("/Core/User/","/RemoveSocialNetworkProfile")},printUserTrainingProgram:function(){return EU.api.services.getUrl("/Reports/User/","/PrintUserTrainingProgram")},mergeUserByUser:function(){return EU.api.services.getUrl("/Core/User/","/MergeUserByUser")},assignUserTrainingProgram:function(){return EU.api.services.getUrl("/Training/User/","/AssignTrainingProgram")},reAssignUserTrainingProgram:function(){return EU.api.services.getUrl("/Training/User/","/ReAssignUserTrainingProgram")},startWorkoutSession:function(){return EU.api.services.getUrl("/Training/User/","/StartWorkoutSession/")},startWorkoutSessionFromLibrary:function(){return EU.api.services.getUrl("/Training/User/","/StartWorkoutSessionFromLibrary/")},saveUserNotificationSettings:function(){return EU.api.services.getUrl("/Core/User/","/SaveUserNotificationSettings")},saveUserNotificationSettingsWithUserId:function(n){return EU.api.services.getUrl("/Core/User/","/SaveUserNotificationSettings",n)},createCoachLogBookItem:function(){return EU.api.services.getUrl("/Core/User/","/CreateCoachLogBookItem")},replyToCoachLogBookItem:function(){return EU.api.services.getUrl("/Core/User/","/ReplyToCoachLogBookItem")},logBook:function(){return EU.api.services.getUrl("/Core/User/","/LogBook")},revokeApplicationGrant:function(){return EU.api.services.getUrl("/Core/User/","/RevokeApplicationGrant")},markPhysicalActivityAsDone:function(){return EU.api.services.getUrl("/Training/User/","/MarkPhysicalActivityAsDone")},challengeDetails:function(n){return EU.api.services.getUrl("/Challenges/Challenge/","/Details",n)},challengesJoin:function(){return EU.api.services.getUrl("/Challenges/User/","/JoinChallenge")},getCampaignFacilityStandings:function(n){return EU.api.services.getUrl("/Challenges/Facility/","/GetCampaignFacilityStandings",n)},getCampaignDataInACountry:function(){return EU.api.services.getUrl("/Challenges/Application/","/GetCampaignDataInACountry",EU.config.API_APP_ID)},getCampaignSummary:function(){return EU.api.services.getUrl("/Challenges/Application/","/GetCampaignSummary",EU.config.API_APP_ID)},cardioLogDetails:function(n){return EU.api.services.getUrl("/Training/CardioLog/","/Details",n)},sendDeleteAccountRequest:function(n){return EU.api.services.getUrl("/Core/Account/","/SendDeleteRequest",n)},unjoinFacilityRequest:function(){return EU.api.services.getUrl("/Core/User/","/UnJoinFacility")},sendDeleteAccount:function(n){return EU.api.services.getUrl("/Public/Account","/DeleteEndUser/?"+n,"")},sendChangeAccountEmailRequest:function(n){return EU.api.services.getUrl("/Core/Account/","/SendChangeAccountEmailRequest",n)},checkUserEmail:function(){return EU.api.services.getUrl("/Application/","/CheckEmail",EU.config.API_APP_ID)},searchCalendarEvents:function(n){return EU.api.services.getUrl("/Core/Facility/","/SearchCalendarEvents",n)},getCalendarEventDetails:function(n){return EU.api.services.getUrl("/Core/CalendarEvent/","/Details",n)},getCalendarEventParticipants:function(n){return EU.api.services.getUrl("/Core/CalendarEvent/","/Participants",n)},getPhysicalActivityDetails:function(n,t){return EU.api.services.getUrl("/"+n+"/Training/PhysicalActivity/","/GetPhysicalActivityDetails",t)},getOnlineEquipments:function(n){return EU.api.services.getUrl("/Training/Facility/",n+"/GetOnlineEquipments","")},getUserPublicProfile:function(n){return EU.api.services.getUrl("/Core/User/","/PublicProfile",n)},deletePerformedPhysicalActivity:function(){return EU.api.services.getUrl("/Training/User/","/DeletePerformedPhysicalActivity")},challengeBoard:function(n){return EU.api.services.getUrl("/Challenges/Facility/","/ChallengeDetails",n)},leaderboard:function(n){return EU.api.services.getUrl("/Challenges/Facility/","/LeaderBoards",n)},facilityPublicProfileFromUrl:function(){return EU.api.services.getUrl("/Application/","/FacilityPublicProfile",EU.config.API_APP_ID)},facilityPublicProfile:function(n){return EU.api.services.getUrl("/Core/Facility/",n+"/PublicProfile","")},chainFacilities:function(n){return EU.api.services.getUrl("/Core/Chain/",n+"/SearchFacilities","")},counters:function(n){return EU.api.services.getUrl("/Challenges/Facility/","/FacilityCounters",n)},customEventCounters:function(){return EU.api.services.getUrl("/Challenges/Application/","/CustomEventCounters",EU.config.API_APP_ID)},eventBoardSettings:function(n){return EU.api.services.getUrl("/Challenges/Facility/","/GetEventBoardSettings",n)},exerciseLeaderBoardUrl:function(n,t,i){return EU.api.services.getExerciseLeaderBoardUrl("/leaderboard/",n+"/activity/"+t+"/"+i)},weeklyLeaderBoardUrl:function(n,t,i){return EU.api.services.getExerciseLeaderBoardUrl("/leaderboard/",n+"/distancetype/"+t+"/week/"+i)},weeklyLeaderBoardByEquipmentUrl:function(n,t,i){return EU.api.services.getExerciseLeaderBoardUrl("/leaderboard/",n+"/equipmenttype/"+t+"/week/"+i)},chainLeaderBoardUrl:function(n,t,i){return EU.api.services.getExerciseLeaderBoardUrl("/facilities/",t+"/"+n+"/"+i)},facilityLeaderBoardUrl:function(n,t,i,r){return EU.api.services.getExerciseLeaderBoardUrl("/leaderboard/",n+"/"+i+"/"+t+"/"+r)},getPhysicalActivityDetailUrl:function(n){return EU.api.services.getUrl("/Training/PhysicalActivity/",n+"/GetPhysicalActivityPublicInfo","")},getHrSession:function(){return EU.api.services.getUrl("/Training/User/","/GetHrSession")},getFacilityUserData:function(n){return EU.api.services.getUrl("/Core/User/",n+"/GetFacilityUserData","")},getFacilityPrivacyPolicy:function(n){return EU.api.services.getUrl("/Core/Facility/",n+"/GetPrivacyPolicy","")},saveFacilityUserPrivacySettings:function(n){return EU.api.services.getUrl("/Core/User/",n+"/SaveFacilityUserPrivacySettings","")},login:function(){return EU.api.services.getUrl("/Application/","/Login",EU.config.API_APP_ID)},getConversationsByUserId:function(){return EU.api.services.getMessengerUrl("/v2/conversations","/GetByUserId")},getConversationById:function(){return EU.api.services.getMessengerUrl("/v2/conversations","/GetById")},getConversationMessages:function(){return EU.api.services.getMessengerUrl("/v2/messages","/GetMessages")},getUnreadMessageCount:function(){return EU.api.services.getMessengerUrl("/v2/messages","/GetUnreadMessageCount")},createGroupConversation:function(){return EU.api.services.getMessengerUrl("/v2/conversations","/CreateGroupConversation")},createConversationMessage:function(){return EU.api.services.getMessengerUrl("/v2/messages","/CreateMessage")},markConversationMessagesAsRead:function(){return EU.api.services.getMessengerUrl("/v2/messages","/MarkAsRead")},getMessageUploadResourcesUrl:function(){return EU.api.services.getMessengerUrl("/v2/messages","/GetUploadResourcesUrl")}}},local:{getUrl:function(n,t,i,r){var e=EU.config.defaultLocale,f=EU.config.defaultClub,o=window.location.hostname,s=window.location.port!=""&&window.location.protocol!="https:"?":"+window.location.port:"",h=EU.config.httpsPort!=443?":"+EU.config.httpsPort:s,u=[];return $("html").data("lang")&&(e=$("html").data("lang")),$("html").data("club")&&(f=$("html").data("club")),u.push("https://"),u.push(o),u.push(h),r||(u.push("/"),u.push(f)),u.push(n),i&&u.push(EU.api.local.getQuerystring(i)),u.join("")},getQuerystring:function(n){var t="";return n&&(Object.keys(n).length==1&&(n.id||n.Id)?t=n.id||n.Id:(t+="?",$.map(n,function(n,i){n&&(t+=i+"="+n+"&")}),t=t.substring(0,t.length-1))),t},postCall:function(n,t,i,r,u,f){return!n||n===""?r?r({Errors:[{type:"url",errorMessage:'field "url" is mandatory!'}]}):void 0:$.ajax({traditional:u?u:!1,type:"POST",url:n,data:JSON.stringify(EU.api.services.getParams(t,f)),dataType:"json",contentType:"application/json",cache:!1,statusCode:{404:function(){r&&r({Errors:[{type:"404",errorMessage:"Service not found!"}]})},500:function(){r&&r({Errors:[{type:"500",errorMessage:"Internal error!"}]})}},success:function(n){i&&i(n)},error:function(n,t){r&&r({Errors:[{type:"corsPostCall",errorMessage:t}]})},abort:function(){r&&r({Errors:[{type:"abort",errorMessage:"Internal error!"}]})},timeout:this.timeoutCall})},postForm:function(n,t,i){var r,f,u;i=i||"post";r=document.createElement("form");r.setAttribute("method",i);r.setAttribute("action",n);for(f in t)t.hasOwnProperty(f)&&(u=document.createElement("input"),u.setAttribute("type","hidden"),u.setAttribute("name",f),u.setAttribute("value",t[f]),r.appendChild(u));document.body.appendChild(r);r.submit()},pages:{homeLogged:function(n){return EU.api.local.getUrl("/Home/Logged",!0,n)},multipleUserMerge:function(n){return EU.api.local.getUrl("/User/MultipleUserMerge",!1,n)},trainingProgram:function(){return EU.api.local.getUrl("/Training/TrainingProgram")},currentWorkoutSession:function(){return EU.api.local.getUrl("/Training/CurrentWorkoutSession/")},currentExerciseDetail:function(n){return EU.api.local.getUrl("/Training/CurrentExerciseDetail/",!1,n)},challengeDetail:function(n){return EU.api.local.getUrl("/Challenge/Detail/",!1,n)},userSettingsAccountIntegration:function(){return EU.api.local.getUrl("/UserSettings/AccountIntegration/")},userSettingsAccountIntegrationMobile:function(){return EU.api.local.getUrl("/UserSettings/AccountIntegrationMobile/")},getLocaleByCulture:function(){return EU.api.local.getUrl("/Utils/GetLocaleByCulture/")},personalRecords:function(){return EU.api.local.getUrl("/Results/PersonalRecords/")},logout:function(){return EU.api.local.getUrl("/User/Logout/")},loginByGoogle:function(){return EU.api.local.getUrl("/User/LoginByGoogle/",!0)},exportHistory:function(n,t){return EU.api.local.getUrl("/UserSettings/ExportHistory/?from="+n+"&to="+t,!0)},generateExport:function(){return EU.api.local.getUrl("/UserSettings/GenerateExport/",!0)},downloadExport:function(){return EU.api.local.getUrl("/UserSettings/DownloadExport/",!0)},saveJoinFacility:function(n){return EU.api.local.getUrl("/UserSettings/SaveJoinFacility/"+n,!0)},registerUser:function(){return EU.api.local.getUrl("/User/RegisterUser",!0)},myCoach:function(n){return EU.api.local.getUrl("/MyCoach/",!0,n)}}}};$(document).ready(function(){document.addEventListener("submit",function(){var n=$("form");!n.hasClass("noshowloadingonsubmit")&&n.valid()&&showLoading()});$("form button[type='submit']").click(function(n){$(n.target).data("action")&&$("form").attr("action",$(n.target).data("action"))});$(".closeTab").on("click",function(n){n.preventDefault();window.close()});var n=EU.clientStorage.sessionStorage.getItem(EU.clientStorage.isMwkInsertedKey());n==null||n==undefined?IsMywellnessKeyIn(function(n){n&&EU.clientStorage.sessionStorage.setItem(EU.clientStorage.isMwkInsertedKey(),n);EU.isMywellnessKeyInserted=n}):EU.isMywellnessKeyInserted=n});typeof jQuery.validator!="undefined"&&($.validator.addMethod("requiredif",function(n,t,i){var o="#"+i.dependentproperty,r=i.targetvalue,f,u;for(r=(r==null?"":r).toString(),f=r.split("|"),u=0;u<f.length;u++){var e=$(o),s=e.prop("type"),h=s==="checkbox"?e.prop("checked")?"true":"false":e.val();if(f[u]===h)return $.validator.methods.required.call(this,n,t,i)}return!0}),$.validator.unobtrusive.adapters.add("requiredif",["dependentproperty","targetvalue"],function(n){n.rules.requiredif={dependentproperty:n.params.dependentproperty,targetvalue:n.params.targetvalue};n.messages.requiredif=n.message}),jQuery.validator.addMethod("notequal",function(n,t,i){return this.optional(t)||n!=$(i).val()},""),jQuery.validator.unobtrusive.adapters.add("notequal",["other"],function(n){n.rules.notequal="#"+n.params.other;n.message&&(n.messages.notequal=n.message)}),jQuery.validator.unobtrusive.adapters.addBool("mustbetrue","required"),$.fn.getDateFromTripleDdls=function(n){var i=this.find("select:nth(0)").val(),r=this.find("select:nth(1)").val(),u=this.find("select:nth(2)").val(),s;if(i==""||r==""||u=="")return null;var f=parseInt(u,10),e=parseInt(r,10),o=parseInt(i,10),t=new Date(f,e-1,o),h=t.getFullYear()==f&&t.getMonth()+1==e&&t.getDate()==o;return h?n?(s=new Date,t<=s?t:null):t:null},$.validator.methods.email=function(n,t){return this.optional(t)||!0},$.validator.methods.range=function(n,t,i){var r=n.replace(",",".");return this.optional(t)||r>=i[0]&&r<=i[1]},$.validator.methods.number=function(n,t){return this.optional(t)||/^-?(?:\d+|\d{1,3}(?:[\s\.,]\d{3})+)(?:[\.,]\d+)?$/.test(n)});jQuery.fn.scrollToFirstError=function(){$(this).on("submit",function(){if($(this).valid())return!0;var n=$(".has-error:nth(0)")&&$(".has-error:visible");return $("html").animate({scrollTop:n.offset().top-130},200),!1});return this},function(n){var t={fieldValidationSpanAll:"span.field-validation-valid, span.field-validation-error",fieldValidationSpanMsg:"span.field-validation-error span, span.field-validation-error",inputValidationError:".input-validation-error",inputField:".form-group .form-control, .form-group .form-check",controlGroupDiv:"div.form-group",fieldValidationError:".field-validation-error",form:"form"},i={inlineHelp:"help-inline",error:"has-error",errorDisplay:"error-display",hideError:"destroy",inputValidationError:"input-validation-error"},r={inline:"inline",tooltip:"tooltip",popover:"popover"},f=function(){n(this).addClass(i.inlineHelp)},e=function(r){var u,f;n(r).tooltip(i.hideError);u=n(r).parent().find(t.fieldValidationSpanMsg).html();u&&(f={html:!0,placement:"auto",title:'<div class="tooltip-alert alert-danger">'+u+"<\/div>"},n(r).addClass(i.inputValidationError).tooltip(f))},o=function(r){var f=n(r).data("error-ref-id")?"#"+n(r).data("error-ref-id"):r,u,e;n(f).popover(i.hideError);u=n(r).parent().find(t.fieldValidationSpanMsg).html();u&&(e={placement:n(r).data("popover-placement")?n(r).data("popover-placement"):"auto",html:!0,trigger:"focus",content:'<i class="fa fa-exclamation"><\/i>'+u},n(f).addClass(i.inputValidationError).popover(e).popover("show"))},u=function(u){n(u).closest(t.controlGroupDiv).addClass(i.error);var f=n(u).closest(t.inputField).data(i.errorDisplay);f&&(f=f.toLowerCase(),f==r.tooltip?setTimeout(function(){e(u)},500):f==r.popover&&setTimeout(function(){o(u)},500),n(u).parent().find(t.fieldValidationSpanAll).hide())},s=function(u){var e=n(u).closest(t.controlGroupDiv),f;setTimeout(function(){n(e).find("."+i.inputValidationError).length==0&&n(e).removeClass(i.error)},500);n(u).removeClass(i.inputValidationError);f=n(u).closest(t.inputField).data(i.errorDisplay);f&&(f=f.toLowerCase(),f==r.tooltip?n(u).tooltip(i.hideError):f==r.popover&&n(u).popover(i.hideError))},h=function(){n(this).find(t.controlGroupDiv).each(function(){n(this).find(t.inputValidationError).length==0&&n(this).removeClass(i.error)});n(this).valid()||n(this).find(t.controlGroupDiv).each(function(){n(this).find(t.inputValidationError).length>0&&n(this).addClass(i.error)})},c=function(){n(this).find(t.controlGroupDiv).each(function(){if(n(this).find(t.inputValidationError).length>0){var i=n(this).find(t.inputValidationError);u(i)}})},l=function(){typeof n.validator!="undefined"&&n.validator.setDefaults({ignore:"",highlight:function(n,t,i){u(n,t,i)},unhighlight:function(n,t,i){s(n,t,i)}});n(function(){n(t.fieldValidationSpanAll).each(f);n(t.form).submit(h);n(t.form).each(c)})};return{init:l}}(jQuery).init(),function(){var n={url:function(n){return(window.location.protocol.indexOf("https")>=0?"https://localhost:47610":"http://localhost:47510")+n},Update:function(){return this.url("/update?type=json")},Status:function(){return this.url("/status?type=json")}};IsMywellnessKeyIn=function(t){$.ajax({crossDomain:!0,type:"GET",url:n.Status(),dataType:"jsonp",jsonp:"callback",success:function(n){t&&t(n&&n.keyStatus==1)},error:function(){t&&t(!1)},timeout:5e3})};CheckStatusMWL=function(t){$.ajax({crossDomain:!0,type:"GET",url:n.Status(),dataType:"jsonp",jsonp:"callback",error:function(){t&&t()},timeout:5e3})};UpdateMWL=function(t){var u=function(n,u,f){var e=!1;n.status==500||n.status==404||n.statusText=="timeout"?(t&&t.error&&r.toString.call(t.error)=="[object Function]"&&(e=!0,t.error(n,u,f)),i()):i()},i=function(){},r={};t&&t.success&&r.toString.call(t.success)=="[object Function]"&&(i=t.success);$.ajax({crossDomain:!0,type:"GET",url:n.Update(),dataType:"jsonp",jsonp:"_callback",cache:!1,timeout:2e3,success:i,error:u})}}();IE_VERSION=function(){for(var i,n=3,t=document.createElement("div"),r=t.getElementsByTagName("i");t.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->",r[0];);return n>4?n:i}();IS_IE=function(){for(var i,n=3,t=document.createElement("div");t.innerHTML="<!--[if gt IE "+ ++n+"]><i><\/i><![endif]-->",t.getElementsByTagName("i")[0];);return n>4?n:i}();localization={localizationDictionary:{},getLocalizedString:function(n,t){function f(t,i){var r=n;if(typeof t=="string"&&t!==null&&t!=="")r=t;else{if(i.length>=5)return i=i.substring(0,2),localization.getLocalizedString(n,i);if(i.length==2)return localization.getLocalizedString(n,"")}return r}var r,i,u;return n=n.toLowerCase(),r=null,i=EU.config.locale.toLowerCase(),typeof t!="undefined"&&(i=t),localization.localizationDictionary[i]?r=localization.localizationDictionary[i][n]:(u=EU.clientStorage.sessionStorage.getItem(EU.clientStorage.localizationdDictionaryKey(i)),u?(localization.localizationDictionary[i]=u,r=localization.localizationDictionary[i][n]):localization.loadDictionary(i,function(t){if(t){var u=JSON.parse(t.content);localization.localizationDictionary[i]=u;EU.clientStorage.sessionStorage.setItem(EU.clientStorage.localizationdDictionaryKey(i),u);r=localization.localizationDictionary[i][n]}})),f(r,i)},loadDictionary:function(n,t){$.ajax({type:"POST",url:EU.api.local.pages.getLocaleByCulture(),async:!1,data:"cultureName="+n,success:function(n){n?t(n):showDangerFeedback(window.genericErrorMessage)},error:function(){showDangerFeedback(window.genericErrorMessage)}})}};$(function(){var n=$(".feedbackMessagePanel .feedbackMessage .closeButton");n&&n.click(hideFeedback)}),function(n){n.urlParam=function(t,i){var e={href:window.location.href,isCaseSensitive:!1},r=n.extend({},e,i),u="[\\?&]"+t+"=([^&#]*)",o=r.isCaseSensitive?new RegExp(u):new RegExp(u,"i"),f=o.exec(r.href);return f?f[1]||0:0}}(jQuery);setEULocale(),function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?n(require("jquery")):n(jQuery)}(function(n){function i(n){return t.raw?n:encodeURIComponent(n)}function f(n){return t.raw?n:decodeURIComponent(n)}function e(n){return i(t.json?JSON.stringify(n):String(n))}function o(n){n.indexOf('"')===0&&(n=n.slice(1,-1).replace(/\\"/g,'"').replace(/\\\\/g,"\\"));try{return n=decodeURIComponent(n.replace(u," ")),t.json?JSON.parse(n):n}catch(i){}}function r(i,r){var u=t.raw?i:o(i);return n.isFunction(r)?r(u):u}var u=/\+/g,t=n.cookie=function(u,o,s){var y,a,h,v,c,p;if(o!==undefined&&!n.isFunction(o))return s=n.extend({},t.defaults,s),typeof s.expires=="number"&&(y=s.expires,a=s.expires=new Date,a.setTime(+a+y*864e5)),document.cookie=[i(u),"=",e(o),s.expires?"; expires="+s.expires.toUTCString():"",s.path?"; path="+s.path:"",s.domain?"; domain="+s.domain:"",s.secure?"; secure":""].join("");for(h=u?undefined:{},v=document.cookie?document.cookie.split("; "):[],c=0,p=v.length;c<p;c++){var w=v[c].split("="),b=f(w.shift()),l=w.join("=");if(u&&u===b){h=r(l,o);break}u||(l=r(l))===undefined||(h[b]=l)}return h};t.defaults={};n.removeCookie=function(t,i){return n.cookie(t)===undefined?!1:(n.cookie(t,"",n.extend({},i,{expires:-1})),!n.cookie(t))}}),function(n,t){function v(n,t,r){var e=n.children(),o=!1,u,s,f;for(n.empty(),u=0,s=e.length;u<s;u++)if(f=e.eq(u),n.append(f),r&&n.append(r),i(n,t)){f.remove();o=!0;break}else r&&r.detach();return o}function e(t,r,u,f,o){var s=!1,h="table, thead, tbody, tfoot, tr, col, colgroup, object, embed, param, ol, ul, dl, blockquote, select, optgroup, option, textarea, script, style",c="script, .dotdotdot-keep";return t.contents().detach().each(function(){var a=this,l=n(a);if(typeof a=="undefined"||a.nodeType==3&&n.trim(a.data).length==0)return!0;if(l.is(c))t.append(l);else{if(s)return!0;t.append(l);o&&t[t.is(h)?"after":"append"](o);i(u,f)&&(s=a.nodeType==3?y(l,r,u,f,o):e(l,r,u,f,o),s||(l.detach(),s=!0));s||o&&o.detach()}}),s}function y(t,f,e,s,c){var l=t[0],nt,k,d;if(!l)return!1;var y=h(l),tt=y.indexOf(" ")!==-1?" ":"　",p=s.wrap=="letter"?"":tt,a=y.split(p),g=-1,w=-1,b=0,v=a.length-1;for(s.fallbackToLetter&&b==0&&v==0&&(p="",a=y.split(p),v=a.length-1);b<=v&&!(b==0&&v==0);){if(nt=Math.floor((b+v)/2),nt==w)break;w=nt;u(l,a.slice(0,w+1).join(p)+s.ellipsis);i(e,s)?(v=w,s.fallbackToLetter&&b==0&&v==0&&(p="",a=a[0].split(p),g=-1,w=-1,b=0,v=a.length-1)):(g=w,b=w)}return g==-1||a.length==1&&a[0].length==0?(k=t.parent(),t.detach(),d=c&&c.closest(k).length?c.length:0,k.contents().length>d?l=r(k.contents().eq(-1-d),f):(l=r(k,f,!0),d||k.detach()),l&&(y=o(h(l),s),u(l,y),d&&c&&n(l).parent().append(c))):(y=o(a.slice(0,g+1).join(p),s),u(l,y)),!0}function i(n,t){return n.innerHeight()>t.maxHeight}function o(t,i){while(n.inArray(t.slice(-1),i.lastCharacter.remove)>-1)t=t.slice(0,-1);return n.inArray(t.slice(-1),i.lastCharacter.noEllipsis)<0&&(t+=i.ellipsis),t}function s(n){return{width:n.innerWidth(),height:n.innerHeight()}}function u(n,t){n.innerText?n.innerText=t:n.nodeValue?n.nodeValue=t:n.textContent&&(n.textContent=t)}function h(n){return n.innerText?n.innerText:n.nodeValue?n.nodeValue:n.textContent?n.textContent:""}function c(n){do n=n.previousSibling;while(n&&n.nodeType!==1&&n.nodeType!==3);return n}function r(t,i,u){var e=t&&t[0],f;if(e){if(!u){if(e.nodeType===3)return e;if(n.trim(t.text()))return r(t.contents().last(),i)}for(f=c(e);!f;){if(t=t.parent(),t.is(i)||!t.length)return!1;f=c(t[0])}if(f)return r(n(f),i)}return!1}function p(t,i){return t?typeof t=="string"?(t=n(t,i),t.length?t:!1):t.jquery?t:!1:!1}function w(n){for(var t,r=n.innerHeight(),u=["paddingTop","paddingBottom"],i=0,f=u.length;i<f;i++)t=parseInt(n.css(u[i]),10),isNaN(t)&&(t=0),r-=t;return r}var f,l,a;n.fn.dotdotdot||(n.fn.dotdotdot=function(t){var r;if(this.length==0)return n.fn.dotdotdot.debug('No element found for "'+this.selector+'".'),this;if(this.length>1)return this.each(function(){n(this).dotdotdot(t)});r=this;r.data("dotdotdot")&&r.trigger("destroy.dot");r.data("dotdotdot-style",r.attr("style")||"");r.css("word-wrap","break-word");r.css("white-space")==="nowrap"&&r.css("white-space","normal");r.bind_events=function(){return r.bind("update.dot",function(t,f){t.preventDefault();t.stopPropagation();u.maxHeight=typeof u.height=="number"?u.height:w(r);u.maxHeight+=u.tolerance;typeof f!="undefined"&&((typeof f=="string"||f instanceof HTMLElement)&&(f=n("<div />").append(f).contents()),f instanceof n&&(c=f));h=r.wrapInner('<div class="dotdotdot" />').children();h.contents().detach().end().append(c.clone(!0)).find("br").replaceWith("  <br />  ").end().css({height:"auto",width:"auto",border:"none",padding:0,margin:0});var s=!1,l=!1;return o.afterElement&&(s=o.afterElement.clone(!0),s.show(),o.afterElement.detach()),i(h,u)&&(l=u.wrap=="children"?v(h,u,s):e(h,r,h,u,s)),h.replaceWith(h.contents()),h=null,n.isFunction(u.callback)&&u.callback.call(r[0],l,c),o.isTruncated=l,l}).bind("isTruncated.dot",function(n,t){return n.preventDefault(),n.stopPropagation(),typeof t=="function"&&t.call(r[0],o.isTruncated),o.isTruncated}).bind("originalContent.dot",function(n,t){return n.preventDefault(),n.stopPropagation(),typeof t=="function"&&t.call(r[0],c),c}).bind("destroy.dot",function(n){n.preventDefault();n.stopPropagation();r.unwatch().unbind_events().contents().detach().end().append(c).attr("style",r.data("dotdotdot-style")||"").data("dotdotdot",!1)}),r};r.unbind_events=function(){return r.unbind(".dot"),r};r.watch=function(){if(r.unwatch(),u.watch=="window"){var t=n(window),i=t.width(),f=t.height();t.bind("resize.dot"+o.dotId,function(){i==t.width()&&f==t.height()&&u.windowResizeFix||(i=t.width(),f=t.height(),l&&clearInterval(l),l=setTimeout(function(){r.trigger("update.dot")},100))})}else a=s(r),l=setInterval(function(){if(r.is(":visible")){var n=s(r);(a.width!=n.width||a.height!=n.height)&&(r.trigger("update.dot"),a=n)}},500);return r};r.unwatch=function(){return n(window).unbind("resize.dot"+o.dotId),l&&clearInterval(l),r};var c=r.contents(),u=n.extend(!0,{},n.fn.dotdotdot.defaults,t),o={},a={},l=null,h=null;return u.lastCharacter.remove instanceof Array||(u.lastCharacter.remove=n.fn.dotdotdot.defaultArrays.lastCharacter.remove),u.lastCharacter.noEllipsis instanceof Array||(u.lastCharacter.noEllipsis=n.fn.dotdotdot.defaultArrays.lastCharacter.noEllipsis),o.afterElement=p(u.after,r),o.isTruncated=!1,o.dotId=f++,r.data("dotdotdot",!0).bind_events().trigger("update.dot"),u.watch&&r.watch(),r},n.fn.dotdotdot.defaults={ellipsis:"... ",wrap:"word",fallbackToLetter:!0,lastCharacter:{},tolerance:0,callback:null,after:null,height:null,watch:!1,windowResizeFix:!0},n.fn.dotdotdot.defaultArrays={lastCharacter:{remove:[" ","　",",",";",".","!","?"],noEllipsis:[]}},n.fn.dotdotdot.debug=function(){},f=1,l=n.fn.html,n.fn.html=function(i){return i!=t&&!n.isFunction(i)&&this.data("dotdotdot")?this.trigger("update",[i]):l.apply(this,arguments)},a=n.fn.text,n.fn.text=function(i){return i!=t&&!n.isFunction(i)&&this.data("dotdotdot")?(i=n("<div />").text(i).html(),this.trigger("update",[i])):a.apply(this,arguments)})}(jQuery);jQuery.fn.mousehold=function(n,t){if(n&&typeof n=="function"&&(t=n,n=200),t&&typeof t=="function"){var r=0,i=0;return this.each(function(){jQuery(this).mousedown(function(u){if(u.which===1){i=1;var f=0,e=this;r=setInterval(function(){f++;t.call(e,f);i=2},n)}});clearMousehold=function(){clearInterval(r);i==1&&t.call(this,1);i=0};jQuery(this).mouseout(clearMousehold);jQuery(this).mouseup(clearMousehold)})}},function(n){typeof define=="function"&&define.amd?define(["jquery"],n):typeof exports=="object"?module.exports=n:n(jQuery)}(function(n){function e(i){var r=i||window.event,y=h.call(arguments,1),o=0,e=0,f=0,l=0,a,v;if(i=n.event.fix(r),i.type="mousewheel","detail"in r&&(f=r.detail*-1),"wheelDelta"in r&&(f=r.wheelDelta),"wheelDeltaY"in r&&(f=r.wheelDeltaY),"wheelDeltaX"in r&&(e=r.wheelDeltaX*-1),"axis"in r&&r.axis===r.HORIZONTAL_AXIS&&(e=f*-1,f=0),o=f===0?e:f,"deltaY"in r&&(f=r.deltaY*-1,o=f),"deltaX"in r&&(e=r.deltaX,f===0&&(o=e*-1)),f!==0||e!==0)return r.deltaMode===1?(a=n.data(this,"mousewheel-line-height"),o*=a,f*=a,e*=a):r.deltaMode===2&&(v=n.data(this,"mousewheel-page-height"),o*=v,f*=v,e*=v),l=Math.max(Math.abs(f),Math.abs(e)),(!t||l<t)&&(t=l,s(r,l)&&(t/=40)),s(r,l)&&(o/=40,e/=40,f/=40),o=Math[o>=1?"floor":"ceil"](o/t),e=Math[e>=1?"floor":"ceil"](e/t),f=Math[f>=1?"floor":"ceil"](f/t),i.deltaX=e,i.deltaY=f,i.deltaFactor=t,i.deltaMode=0,y.unshift(i,o,e,f),u&&clearTimeout(u),u=setTimeout(c,200),(n.event.dispatch||n.event.handle).apply(this,y)}function c(){t=null}function s(n,t){return r.settings.adjustOldDeltas&&n.type==="mousewheel"&&t%120==0}var o=["wheel","mousewheel","DOMMouseScroll","MozMousePixelScroll"],i="onwheel"in document||document.documentMode>=9?["wheel"]:["mousewheel","DomMouseScroll","MozMousePixelScroll"],h=Array.prototype.slice,u,t,f,r;if(n.event.fixHooks)for(f=o.length;f;)n.event.fixHooks[o[--f]]=n.event.mouseHooks;r=n.event.special.mousewheel={version:"3.1.9",setup:function(){if(this.addEventListener)for(var t=i.length;t;)this.addEventListener(i[--t],e,!1);else this.onmousewheel=e;n.data(this,"mousewheel-line-height",r.getLineHeight(this));n.data(this,"mousewheel-page-height",r.getPageHeight(this))},teardown:function(){if(this.removeEventListener)for(var n=i.length;n;)this.removeEventListener(i[--n],e,!1);else this.onmousewheel=null},getLineHeight:function(t){return parseInt(n(t)["offsetParent"in n.fn?"offsetParent":"parent"]().css("fontSize"),10)},getPageHeight:function(t){return n(t).height()},settings:{adjustOldDeltas:!0}};n.fn.extend({mousewheel:function(n){return n?this.bind("mousewheel",n):this.trigger("mousewheel")},unmousewheel:function(n){return this.unbind("mousewheel",n)}})}),function(n){n.fn.touchwipe=function(t){var i={min_move_x:20,min_move_y:20,wipeLeft:function(){},wipeRight:function(){},wipeUp:function(){},wipeDown:function(){},preventDefaultEvents:!0};return t&&n.extend(i,t),this.each(function(){function u(){this.removeEventListener("touchmove",f);n=null;t=!1}function f(f){if(i.preventDefaultEvents&&f.preventDefault(),t){var s=f.touches[0].pageX,h=f.touches[0].pageY,e=n-s,o=r-h;Math.abs(e)>=i.min_move_x?(u(),e>0?i.wipeLeft():i.wipeRight()):Math.abs(o)>=i.min_move_y&&(u(),o>0?i.wipeDown():i.wipeUp())}}function e(i){i.touches.length==1&&(n=i.touches[0].pageX,r=i.touches[0].pageY,t=!0,this.addEventListener("touchmove",f,!1))}var n,r,t=!1;"ontouchstart"in document.documentElement&&this.addEventListener("touchstart",e,!1)}),this}}(jQuery)