var Epic;(function(n){var t;(function(t){var u=function(){function t(){}return t.AddToPageLoad=function(t){n.AppOrchard.PageLoad.onLoadEvents.push(t)},t.OnLoadEventHandler=function(t){for(var i=0;i<n.AppOrchard.PageLoad.onLoadEvents.length;i++)try{n.AppOrchard.PageLoad.onLoadEvents[i].call(window.document,t)}catch(r){alert(r)}},t.BindKnockoutModelToUI=function(n,t){var i=document.getElementById(n);if(!i)throw"Unable to result DOM element with ID: "+n;ko.applyBindings(t,i)},t.ShowHeaderContextMenu=function(){return $("#menuBarContextMenu").toggleClass("loginContextMenuShow"),$("#menuBarContextMenu").hasClass("loginContextMenuShow")&&$("#NavMenuButton:visible").length>0&&($("#loggedInUserContext").length<1?$("#loginContextMenu").removeClass("hidden"):$("#loginContextMenu").addClass("hidden")),!1},t.ShowLoginContextMenu=function(){return $("#loginContextMenu:visible").length>0?n.AppOrchard.PageLoad.HideLoginContextMenu():($("#loginOverlay").width("100%"),$("#loginContextMenu").removeClass("hidden"),$("#loginListItem").addClass("menuselected"),!1)},t.HideLoginContextMenu=function(){return $("#loginOverlay").width("0%"),$("#loginContextMenu").addClass("hidden"),$("#loginListItem").removeClass("menuselected"),!1},t.InjectNewUrlToHistory=function(n,t){t===void 0&&(t=!1);var i=window.location.pathname+"?"+n;if(t?window.history.replaceState({},null,i):window.history.pushState({},null,i),window.onhashchange)window.onhashchange(null)},t.onLoadEvents=[],t}(),i,r;t.PageLoad=u,i=function(){function i(){}return i.OpenLoginMenu=function(){return $("#NavMenuButton").is(":visible")?$("#NavMenuButton").click():n.AppOrchard.PageLoad.ShowLoginContextMenu(),setTimeout(function(){$("#LogInHeader").focus()},50),!0},i.VendorLoginClicked=function(i){var u=new Date,r;return u.setTime(u.getTime()+31536e6),r=new Date,r.setTime(r.getTime()+-31536e6),t.Util.CreateCookie("AOVendorLogin","true",u.toUTCString(),".epic.com"),t.Util.CreateCookie("FHIRLogin","false",r.toUTCString(),".epic.com"),setTimeout(function(){window.open(n.AppOrchard.Util.GetFullUrl("/Account/SignIn?returnUrl="+i),"_self")},50),!1},i.CustomerLoginClicked=function(i){var r=new Date;return r.setTime(r.getTime()+-31536e6),t.Util.CreateCookie("AOVendorLogin","false",r.toUTCString(),".epic.com"),t.Util.CreateCookie("FHIRLogin","false",r.toUTCString(),".epic.com"),setTimeout(function(){window.open(n.AppOrchard.Util.GetFullUrl("/Account/SignIn?returnUrl="+i),"_self")},50),!1},i}(),t.Login=i,r=function(){function n(){}return n.TranslateProgramName=function(t){return t.toLowerCase()=="bronze"?"Greenhouse":t.toLowerCase()=="silver"?"Garden":t.toLowerCase()=="gold"?"Terrace":t.toLowerCase()=="uscdimember"?"Epic on FHIR Member":n.PrettifyPascalCase(t)},n.PrettifyPascalCase=function(n){return n.replace(/([A-Z])/g," $1").trim()},n.RemoveUnderscores=function(n){return n.replace(/_/g,"").trim()},n.ChangeHeightToFitContent=function(n,t){t=t||0,n.style.height="0",n.style.height=n.scrollHeight+t+"px"},n.IsMSEdge=function(){return navigator.userAgent.indexOf("Edge")>-1},n.EncodeAndNewlineToBreak=function(n){return n=this.EncodeText(n),n.replace(/\n/g,"<br/>")},n.EncodeText=function(n){return $("<div/>").text(n).html()},n}(),t.Helpers=r,window.onload=n.AppOrchard.PageLoad.OnLoadEventHandler,window.onpopstate=function(){window.onhashchange(null)}})(t=n.AppOrchard||(n.AppOrchard={}))})(Epic||(Epic={}))