function extend(n,t){var i=t.split("."),u=n,r,f;for(i[0]==="Core"&&(i=i.slice(1)),f=i.length,r=0;r<f;r++)typeof u[i[r]]=="undefined"&&(u[i[r]]={}),u=u[i[r]];return u}var Core=Core||{},Globals,ReCaptcha,Url,Utility,Notifications,Form,DateTime,Auth,ParlWork;Core.CreateNamespace=function(n){return extend(Core,n)};Core.Navigate=function(n){window.location.href=n};Core.CreateGuid=function(){function n(){return Math.floor((1+Math.random())*65536).toString(16).substring(1)}return n()+n()+n()+n()+n()+n()+n()+n()};Core.Hash=function(n){var t=0;if(n.length==0)return t;for(i=0;i<n.length;i++)char=n.charCodeAt(i),t=(t<<5)-t+char,t=t&t;return t};Globals=Core.CreateNamespace("Core.Globals");Globals.RouteDictionary={};Globals.Sitting={Status:null,IsLoaded:!1,IsAdjourned:function(){return Globals.Sitting.Status?Globals.Sitting.Status.toLowerCase().indexOf("adjourned")>-1:!1}};ReCaptcha=ReCaptcha||{};ReCaptcha.Components=[];ReCaptcha.ResetAll=function(){grecaptcha&&jQuery.each(ReCaptcha.Components,function(n,t){grecaptcha.reset(t)})};Url=Core.CreateNamespace("Core.Url");Url.GetUrlParamByName=function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))};Utility=Core.CreateNamespace("Core.Utility");Utility.UpdateQueryString=function(n,t,i){var u,r,f;return i||(i=window.location.href),u=new RegExp("([?&])"+n+"=.*?(&|#|$)(.*)","gi"),u.test(i)?typeof t!="undefined"&&t!==null?i.replace(u,"$1"+n+"="+t+"$2$3"):(r=i.split("#"),i=r[0].replace(u,"$1$3").replace(/(&|\?)$/,""),typeof r[1]!="undefined"&&r[1]!==null&&(i+="#"+r[1]),i):typeof t!="undefined"&&t!==null?(f=i.indexOf("?")!==-1?"&":"?",r=i.split("#"),i=r[0]+f+n+"="+t,typeof r[1]!="undefined"&&r[1]!==null&&(i+="#"+r[1]),i):i};Utility.RemoveQueryStringParameter=function(n,t){var r,f,i,u;if(t||(t=window.location.href),r=t.split("?"),r.length>=2){for(f=encodeURIComponent(n)+"=",i=r[1].split(/[&;]/g),u=i.length;u-->0;)i[u].lastIndexOf(f,0)!==-1&&i.splice(u,1);return r[0]+"?"+i.join("&")}return t};Utility.GetQueryStringParameter=function(n){n=n.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]");var i=new RegExp("[\\?&]"+n+"=([^&#]*)"),t=i.exec(location.search);return t===null?"":decodeURIComponent(t[1].replace(/\+/g," "))};Utility.DeserializeQueryString=function(n){n||(n=window.location.search.substr(1));var i=n.split("&"),t={};return i.forEach(function(n){n=n.split("=");var i=n[0],r=n[1];i.length&&(t[i]!==undefined?(t[i].push||(t[i]=[t[i]]),t[i].push(r||"")):t[i]=r||"")}),t};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})});Notifications=Core.CreateNamespace("Core.Notifications");Notifications.Show=function(n,t,i){var r={text:t,type:n,dismissQueue:!0,layout:"bottomRight",timeout:3e3,theme:"parlaccount",closeWith:["click","backdrop"],maxVisible:1,modal:!1,force:!1,killer:!0,animation:{open:"animated fadeInRight",close:"animated fadeOutRight"}},u;i&&(r.timeout=i);u=noty(r)};Notifications.Clear=function(){$.noty.closeAll()};Notifications.HideAlert=function(n){$(n).fadeOut("fast")};Notifications.ShowAlert=function(n,t,i,r){$(n).hide();$(n).removeClass("success").removeClass("warning").removeClass("info").removeClass("alert").removeClass("secondary").addClass(t).html(i).fadeIn("fast");r?setTimeout(function(){$(n).fadeOut("slow")},r):setTimeout(function(){$(n).fadeOut("slow")},3e4)};Notifications.Confirm=function(n,t,i){var p,s,u,l,a,h,c,f,e,v,o,y,r;n.title=typeof n.title!="undefined"?n.title:"Are you sure?";n.message=typeof n.message!="undefined"?n.message:"";n.uniqueIdentifier=typeof n.uniqueIdentifier!="undefined"?n.uniqueIdentifier:Core.CreateGuid();n.yesText=typeof n.yesText!="undefined"?n.yesText:"Yes";n.noText=typeof n.noText!="undefined"?n.noText:"No";p=n.uniqueIdentifier;s=document.createElement("div");s.classList.add("row","border-bottom");u=document.createElement("div");u.classList.add("large-12","columns");l=document.createElement("h4");l.innerHTML=n.title;u.appendChild(l);a=document.createElement("p");a.innerHTML=n.message;u.appendChild(a);s.appendChild(u);h=document.createElement("div");h.classList.add("row");c=document.createElement("div");c.classList.add("large-12","columns");f=document.createElement("ul");f.classList.add("right","button-group","radius","margin-top");e=document.createElement("a");e.classList.add("button","secondary","medium");e.innerHTML=n.noText;v=document.createElement("li");v.appendChild(e);f.appendChild(v);o=document.createElement("a");o.classList.add("button","alert","medium");o.innerHTML=n.yesText;y=document.createElement("li");y.appendChild(o);f.appendChild(y);c.appendChild(f);h.appendChild(c);r=document.createElement("div");r.id=p;r.classList.add("reveal-modal","confirm-modal","small","no-padding");r.dataset.reveal="";r.appendChild(s);r.appendChild(h);document.body.appendChild(r);$(r).foundation("reveal","open");o.onclick=function(){t&&t();$(r).foundation("reveal","close")};e.onclick=function(){i&&i();$(r).foundation("reveal","close")}};Form=Core.CreateNamespace("Core.Form");Form.InitSubmit=function(n,t,i){var r=function(){var t=$(n).find(".alert-box").attr("id");Core.Notifications.ShowAlert("#"+t,"alert","There was a server error processing your request. Please try again later...");Form.Enable(n);ReCaptcha.ResetAll()},u={dataType:"json",beforeSubmit:t,success:i,error:r};$(n).submit(function(){return $(this).ajaxSubmit(u),!1})};Form.ClearPasswordFields=function(){$("input[type='password']").val("")};Form.ResetAll=function(){ReCaptcha.ResetAll();$("form").each(function(){this.reset()})};Form.InitPasswordStrength=function(n,t){var f=document.getElementById(n);if(f){var i=document.getElementById(t),r=i.parentNode.querySelector(".password-meter-bar"),u=i.parentNode.querySelector(".field-tip"),e=["Weak","Average","Good","Strong","Strong"],o=["#d23923","#892517","#06660f","#088714","#088714"],s=70;i.addEventListener("keyup",function(){var t,n,f;this.value!==""?(t=zxcvbn(i.value),n=t.score/4*s,n=n>20?n:20,f=o[t.score],u.innerHTML=e[t.score],u.style.color=f,r.style.backgroundColor=f,r.style.height=n+"%",this.style.borderColor="#088714"):(u.innerHTML="",r.style.height="0",this.style.borderColor="")})}};Form.Enable=function(n){$(n+" :input").attr("disabled",!1);$(n+" a.formsubmit").removeClass("disabled")};Form.Disable=function(n){$(n+" :input").attr("disabled",!0);$(n+" a.formsubmit").addClass("disabled")};Form.Init=function(){$(".formsubmit").on("click",function(n){n.preventDefault();var t=$(this).closest("form");t.submit()});$("form :input").attr("disabled",!1);$("a.formsubmit").removeClass("disabled")};DateTime=Core.CreateNamespace("Core.DateTime");DateTime.ToDate=function(n){var t=new Date(n),i=t.getDate(),r=t.getMonth()+1,u=t.getFullYear();return i+"/"+r+"/"+u};DateTime.ToMediumDate=function(n){var t=new Date(parseInt(n)),i=t.getDate(),r=t.getMonth(),u=t.getFullYear();return["January","February","March","April","May","June","July","August","September","October","November","December"][r]+" "+i+", "+u};DateTime.Today=function(){return new Date};DateTime.Yesterday=function(){var n=DateTime.Today(),t=new Date(n);return t.setDate(n.getDate()-1),t};DateTime.LastYear=function(){var n=DateTime.Today(),t=new Date(n);return t.setDate(n.getYear()-1),t};DateTime.RoundToNearestMinute=function(n){var t=moment(n);return t.second()<30?moment(t).startOf("minute").format("hh:mm a"):moment(t).add(1,"minutes").startOf("minute").format("hh:mm a")};Auth=Core.CreateNamespace("Core.Auth");Auth.AuthorizeXhr=function(n){n.status===401&&setTimeout(function(){window.location.href="/FederatedAuth/SignIn?returnUrl="+window.location.href},100)};ParlWork=ParlWork||{};ParlWork.Init=function(){"use strict";$(window).on("beforeunload",function(){$.connection.hub.stop()});$.ajaxSetup({cache:!1,error:function(n){Core.Auth.AuthorizeXhr(n)}});$(document).foundation({accordion:{multi_expand:!0},tab:{callback:function(){$(document).foundation("equalizer","reflow")}}});$("#back-to-top").on("click",function(n){n.preventDefault();$("body,html").velocity("scroll",400)});if(document.referrer){$("#turn-back").fadeIn("slow");$("#turn-back").on("click",function(n){n.preventDefault();window.history.go(-1)})}else $("#turn-back").fadeOut();$(document).on("click",".animated-accordion-navigation > a",function(n){var t;n.preventDefault();t=$(n.target);t.hasClass("category-title")||(t=t.parent(".category-title"));var u=t.parent().siblings(),i=u.find("> a.active"),f=i.next(".content"),r=$(t.attr("href"));t.hasClass("active")?r.velocity("slideUp",{complete:function(){t.removeClass("active")}}):(i.length&&f.velocity("slideUp",{complete:function(){i.removeClass("active")}}),t.addClass("active"),r.velocity("slideDown",{complete:function(){$(document).foundation("equalizer","reflow");t.velocity("scroll",500)}}))});$(".fedauth-link").on("click",function(n){var i,t,r;n.preventDefault();i=$(this).attr("href");t="/";window.location.pathname.split("/").pop()!=="Bookmarks"&&(t=window.location.pathname);r=i+"?returnUrl="+t;window.location.href=r});if($("#feedbackModal").length){$.get("/api/feedback/rating",function(n){n.IsSuccess&&$("div.rating").raty({half:!1,starType:"i",score:function(){return n.Rating},click:function(n){$.ajax({method:"POST",url:"/api/feedback/rate",data:JSON.stringify({Rating:n}),contentType:"application/json",dataType:"json",success:function(){}})}})});$(".feedbackbutton").on("click",function(n){n.preventDefault();var t=$(this).attr("href");$("#feedbackMenu").fadeOut("fast",function(){$(t).fadeIn("fast")})});$(".feedbackback").on("click",function(n){n.preventDefault();$(this).closest(".feedbackform").fadeOut("fast",function(){$("#feedbackMenu").fadeIn("fast")});Notifications.HideAlert("#feedbackAlert")});var n=function(){Core.Form.Disable(".feedbackForm");Core.Notifications.ShowAlert("#feedbackAlert","info",'<i class="fa fa-circle-o-notch fa-spin"><\/i>&nbsp;&nbsp;Submitting your feedback. Please wait...')},t=function(n){Notifications.HideAlert("#feedbackAlert");n.IsSuccess?(Notifications.ShowAlert("#feedbackAlert","success",'<i class="fa fa-thumbs-up"><\/i>&nbsp;&nbsp;Thank you for your feedback.'),$(".feedbackForm").find("textarea").val(""),Core.Form.Enable(".feedbackForm")):Notifications.ShowAlert("#feedbackAlert","danger","Aw snap! Something went wrong while submitting your feedback. Please try again later or contact support...")};Core.Form.InitSubmit(".feedbackForm",n,t)}}