$$WPComp.VB6Component=function WPComp$VB6Component(t){t=t||{},this._componentClick=t._componentClick||function(){},this.Url=makeLink("inside.asp?mode="+(t.Mode||this.Mode)+"&co=true"),this.DontSetH2AsTitle=t.DontSetH2AsTitle||!1,this.Components$ViewComponent(t)},$$WPComp.VB6Component.prototype={Mode:"",Class:"VB6Component",DontSetH2AsTitle:!1,html:function WPComp$VB6Component$html(t){var e=new Array;e=this.getInfoButtonData(t),t=this.cleanResponse(t);var n=dangerou$.parseHtml("<div>"+t+"</div>"),o=n.find("h2");this.DontSetH2AsTitle||1===o.length&&(this.setTitle(o.text(),this._Title.Buttons,this._Title.Image,this.IsClosable),o.remove()),this.Components$ViewComponent$html(n.html()),this.setInfoButtonData(e)},dispose:function WPComp$VB6Component$dispose(t){this._isDisposed||(this.$container.find("form").each((function(){WP.Validators&&delete WP.Validators.Forms[this.id]})),this.Components$ViewComponent$dispose(t))},cleanResponse:function WPComp$VB6Component$cleanResponse(t){return dangerou$.parseHtml(t).find("#main").html()},getInfoButtonData:function WPComp$VB6Component$getInfoButtonData(t){var e,n,o,i,s=8,a=0,l=0,p=new Array;do{s=t.indexOf('type="text/javascript">var info = WP.Controls.InfoButton',a),a=t.indexOf("<\/script>",s),-1!==s&&(e=t.indexOf("HTMLUnencode",s),n=t.substring(s+82,e-4),o=t.indexOf('"), "popupparentdiv',s),i=t.substring(e+14,o),p[l]={},p[l].id=n,p[l].info=i,l+=1)}while(-1!==s);return p},setInfoButtonData:function WPComp$VB6Component$setInfoButtonData(t){var e=0;if(null!==t&&null!==t.length){for(e=0;e<t.length;e++)$afe.select("#"+t[e].id).safeAttr("data-info",t[e].info).safeAttr("data-id","infobutton");this.setInfoButtonBubbles()}},setInfoButtonBubbles:function WPComp$VB6Component$setInfoButtonBubbles(){var t,e,n=$afe.select("div[data-id='infobutton']");if(n.length>0)for(e=0;e<n.length;e++)0===$afe.select("#"+n[e].id+" .popupiconcontainer").length&&(t=$afe.select("#"+n[e].id),WP.Controls.InfoButton(document.getElementById(n[e].id),HTMLUnencode(t.safeAttr("data-info")),"popupparentdiv_"+n[e].id,null,"",null,null,null,null,null))}},$$WPComp.VB6Component.extend("Components.ViewComponent"),$$WPUtil.guaranteeExistence($$WPUtil,"ComponentFactory.HomePage"),$$WPUtil.ComponentFactory.vb6Mode=function CF$byMode(t,e,n){return(n=n||{}).Mode=t+"&"+e,n._mode=t,n._otherParameters=e,n.copy=n.copy||function(t){return t.Html=t.Html||this.$content.get(0).innerHTML,$$WPUtil.ComponentFactory.vb6Mode(this._mode,this._otherParameters)},new $$WPComp.VB6Component(n)},$$WPUtil.ComponentFactory.HomePage.quickLinks=function CF$quickLinks(t){return(t=t||{}).Class=t.Class||"",t.Class+=" quickLinks list hoverable",t.copy=t.copy||function(t){return t.Html=t.Html||this.$content.get(0).innerHTML,$$WPUtil.ComponentFactory.HomePage.quickLinks(t)},t.html=function(t){$$WP.Components.VB6Component.prototype.html.apply(this,[t]),this.$content.find("#links").children("a").length?this.$container.hasClass("vertical")||$$WP.Behaviors.matchRowHeights(this.$content,"#links a"):this.hide()},$$WPUtil.ComponentFactory.vb6Mode("","widgetName=quickLinks",t)},$$WPUtil.ComponentFactory.HomePage.news=function CF$news(t){return(t=t||{}).Class=t.Class||"",t.Class+=" news",t.copy=t.copy||function(t){return t.Html=t.Html||this.$content.get(0).innerHTML,$$WPUtil.ComponentFactory.HomePage.news(t)},t.Components$VB6Component$cleanResponse=$$WPComp.VB6Component.prototype.cleanResponse,t.cleanResponse=function(t){var e=(t=this.Components$VB6Component$cleanResponse(t).replace(/ id="[^"]+"/gim,"")).indexOf("\x3c!-- Start Section Block --\x3e")+28;return e>27&&(t=t.substring(e,t.indexOf("\x3c!-- End Section Block --\x3e",e))),t},$$WPUtil.ComponentFactory.vb6Mode("","widgetName=staticNews",t)},$$WPUtil.ComponentFactory.HomePage.alerts=function CF$alerts(t){return(t=t||{}).Class=t.Class||"",t.Class+=" Alerts",t.SupportAnimations=!1!==t.SupportAnimations,t.copy=t.copy||function CF$alerts$copy(t){return t.Html=t.Html||this.$content.get(0).innerHTML,$$WPUtil.ComponentFactory.HomePage.alerts(t)},t.Components$VB6Component$html=$$WPComp.VB6Component.prototype.html,t.html=t.html||function CF$alerts$html(t){this.Components$VB6Component$html(t),this.$content.find("#alertspanel-autowaitlist").length>0||this.$content.find("#alertspanel-expiredautowaitlist").length>0?$$WPUtil.ComponentFactory.HomePage.AutoWaitList(0,null):0===this.$content.find("a").length&&this.$container.addClass("noinfo");var e=this.$content.find("[data-alertid='alertspanel-notificationreview']");if(e.length>0){var n=JSON.parse($(e[0]).html());$$WPUtil.guaranteeExistence($$WP,"Preferences.NotificationsReviewAlertComponent");var o=new $$WP.Preferences.NotificationsReviewAlertComponent(n);$$WPUtil.ComponentFactory.HomePage.ShowNotificationAlertAsPopup(o),1===this.$content.find("#alerts div").length&&this.hide()}},$$WPUtil.ComponentFactory.vb6Mode("","widgetName=alerts",t)},$$WPUtil.ComponentFactory.HomePage.ShowNotificationAlertAsPopup=function CF$ShowNotificationAlertAsPopup(t){var e=new $$WPContain.Popup({positioningFunction:$$WPContain.Positions.InsideNearTop,Components:t,IsClosable:!t.Data.emailRequired,TitleText:null,Size:$$WPContain.Popup.SizeEnum.MEDIUM,Class:"notificationreview",BackButtonText:$$WP.Strings.get("AskLaterExitPopup","notifications.notificationalert")});t.show(),e.show(!0),$$WP.FormValidation.initializeDOMSubtree($afe.select("#updateform")),setupButtoncheck()},$$WPUtil.guaranteeExistence($$WPUtil,"ComponentFactory.Clinical"),$$WPUtil.ComponentFactory.Clinical.goals=function CF$goals(t){(t=t||{}).DontSetH2AsTitle=!0,t.Class=t.Class||"",t.Class+=" goalsvb6",t.SupportAnimations=!1!==t.SupportAnimations;var e,n,o=t.RegistryID||"";return n="section=1&widgetMode=1&registryid="+o,e=""===o?"goalsreview":"mycondition",t.Components$VB6Component$html=$$WPComp.VB6Component.prototype.html,t.html=t.html||function CF$goals$html(e){var n,o,i,s,a,l,p,r,$,m,c,C;this.Components$VB6Component$html(e),o=$$WP.Strings.getForTemplate("graphlabel","Clinical.Goals"),i=$$WP.Strings.getForTemplate("tablelabel","Clinical.Goals"),s=[new $$WPComp.ComplexObjects.Button(o,"","graphButton selected","graph"),new $$WPComp.ComplexObjects.Button(i,"","tableButton","table")],p=new $$WPComp.ComplexObjects.ButtonBar("","","goaltitle","",""),$=new $$WPComp.ComplexObjects.ButtonBar("","","goalrecentvalue","",""),c=new $$WPComp.ComplexObjects.ButtonBar("","","goalbuttonlist",$$WPUtil.copyObject(s),$$WPComp.TITLEBARIDENTIFIER),r=$afe.renderTemplate($$WP.Templates.Core.ButtonBar,p),m=$afe.renderTemplate($$WP.Templates.Core.ButtonBar,$),C=$afe.renderTemplate($$WP.Templates.Core.ButtonBar,c),this.$content.safePrepend(C),this.$content.safePrepend(m),this.$content.safePrepend(r),l=$$WP.SimpleTemplates.Anchor({href:"#",class:"focusanchor",name:"goalmaintop",title:$$WP.Strings.get("showing_clicked_goal_details","Clinical.Goals")}),$$WP.Strings.setDisplayText(l,"showing_clicked_goal_details","Clinical.Goals"),this.$content.safePrepend(l),loadGraphs(),a=t._selectedIndex||0,n=$afe.select(".goalslarge .goalslist").find("[data-index='"+a+"']").safeAttr("id"),t._showSelectedGoalGraph(n)},t._componentClick=function(e){return t._switchTableGraph(e),!1},$$WPUtil.ComponentFactory.vb6Mode(e,n,t)},$$WPUtil.ComponentFactory.Clinical.TestResultDetails=function CF$testResults(t){(t=t||{}).DontSetH2AsTitle=!0,t.Class=t.Class||"",t.SupportAnimations=!1!==t.SupportAnimations;t.RegistryID;return t.Components$VB6Component$html=$$WPComp.VB6Component.prototype.html,t.Components$VB6Component$cleanResponse=$$WPComp.VB6Component.prototype.cleanResponse,t.cleanResponse=function(t){t=this.Components$VB6Component$cleanResponse(t);var e=dangerou$.parseHtml(t),n=e.filter(".title"),o=e.filter(".cptLink"),i=e.filter(".tabcontainer");return i.removeClass("tabcontainer"),n.find("div#assistiveicons").remove(),i.find(".navparent").remove(),$afe.jq(document.createElement("div")).safeAppend(n).safeAppend(o).safeAppend(i).html()},$$WPUtil.ComponentFactory.vb6Mode("labdetail",undefined,t)};;
/*! Copyright (c) Epic Systems Corporation 2014-2016 */
$$WPComp.TemplateComponent=function WPComp$TemplateComponent(t){this.Components$Component(t)},$$WPComp.TemplateComponent.prototype={Url:makeLink(""),Data:{},template:function WPComp$TemplateComponent$template(t){$$WP.Debug.logError("Descendents of TemplateComponent must implement the template property (or pass it in the settings bag).")},setData:function WPComp$TemplateComponent$set(t){(t=t||{}).ComponentNumber=this.ComponentNumber,this.Data=t,this.refresh()},refresh:function WPComp$TemplateComponent$refresh(){var t=Array.isArray(this.Data)?{dataElement:this.Data}:this.Data;try{this.html(this.template(t).trim())}catch(t){throw"Failed to execute the template for component"+this.ComponentNumber}},copy:function WPComp$Template$copy(t){return(t=t||{}).Data=this.Data,this.Components$Component$copy(t)},show:function WPComp$Template$show(){this._shownOnce||this._isDisposed||this.setData(this.Data),this.Components$Component$show()},load:function WPComp$Template$load(t,e,o,n){return this.makeRequest({success:this.setData,dataType:"json",data:n,type:"POST",url:t||this.Url},o||"load",e)}},$$WPComp.TemplateComponent.extend("Components.Component");;
/*! Copyright (c) Epic Systems Corporation 2014-2016 */
$$WPComp.InlineLoadingComponent=function WPComp$InlineLoadingComponent(n){this.Components$TemplateComponent(n),this.addEventListener("resize",this._resize)},$$WPComp.InlineLoadingComponent.prototype={CommunicationsIndicator:!1,$PermanentParent:null,template:$$WP.Templates.Core.loading,Data:{PrimaryMessage:$$WP.Strings.getForTemplate("GenericLoadingMessage","Global"),ExtraMessage:""},IsClosable:!1,TitleText:null,ToolbarButtons:null,Class:"inlineloading",show:function WPComp$InlineLoadingComponent$show(n){n=this.$PermanentParent||n,0===this.$container.parent().length&&this.$container.safeInsertBefore(n.children(".content")),this.Components$TemplateComponent$show()},_resize:function(){return!1}},$$WPComp.InlineLoadingComponent.extend("Components.TemplateComponent");;
/*! Copyright (c) Epic Systems Corporation 2016-2018 */
$$WPComp.InlineLoadingComponentWithSources=function WPComp$InlineLoadingComponentWithSources(t){this.Components$TemplateComponent(t),null!==this.AreaName&&(this.Url=makeLink("Loading/GetStatus?AreaName="+this.AreaName)),this.addEventListener("resize",this._resize),$$WP.CommunityUtilities.hasCommunityLinks()||(this.Url="")},$$WPComp.InlineLoadingComponentWithSources.prototype={CommunicationsIndicator:!1,$PermanentParent:null,Url:makeLink("Loading/GetStatus"),template:$$WP.Templates.Core.loading,IsClosable:!1,TitleText:null,ToolbarButtons:null,Class:"inlineloading withsources",stopGetStatus:!1,AreaName:null,statusIsCount:!1,setData:function(t){t.DataFromMultipleSources=!0,this.Components$TemplateComponent$setData(t),this.success(t)},success:function WPComp$InlineLoadingComponentWithSources$success(t){$$WP.Strings.setDefaultNamespace("community.externaljump");var n,e,i,s,o=0,a="";if($$WP.CommunityUtilities.hasCommunityLinks()){if(t&&t.Organizations&&t.Organizations.length>0&&!this.stopGetStatus){for(i=0;i<t.Organizations.length;i++){var r=t.Organizations[i];if(1!==r.Status&&7!==r.Status){if(r.Organization&&null!==r.Organization.OrganizationName){s=r.Organization;break}}else o++}o===t.Organizations.length&&(n=$$WP.Strings.get("CommunityLoadingStatus")),s||(s=t.Organizations[0].Organization),$$WP.Strings.setOrganization(s),$$WP.Strings.addMnemonic("@MYCHART@LOADEDORGS@",o),$$WP.Strings.addMnemonic("@MYCHART@TOTALORGS@",t.Organizations.length),e=$$WP.Strings.get("CommunityLoadingStatusWithCounter"),n=$$WP.Strings.get("CommunityLoadingStatus"),$$WP.Strings.removeMnemonic("@MYCHART@LOADEDORGS@"),$$WP.Strings.removeMnemonic("@MYCHART@TOTALORGS@"),$$WP.Strings.clearOrganization(),a=this.statusIsCount?n:e,this.statusIsCount=!this.statusIsCount,this._status=a,this.$content.find(".loadingStatus.loading").animate({opacity:0},350,(function(){$afe.jq(this).empty().safeAppend(a)})).animate({opacity:1},350)}this.stopGetStatus||setTimeout($.proxy((function(){getCSRFTokenAsQS($.proxy((function(){this.makeRequest({success:this.success,dataType:"json",type:"POST",url:this.Url},"getStatus")}),this))}),this),300),$$WP.Strings.clearDefaultNamespace()}},show:function WPComp$InlineLoadingComponentWithSources$show(t){t=this.$PermanentParent||t,0===this.$container.parent().length&&this.$container.safeInsertBefore(t.children(".content")),this.$container.removeClass("resized"),this.Components$TemplateComponent$show()},hide:function WPComp$InlineLoadingComponentWithSources$hide(t){var n;this.DataFromMultipleSources?(this.stopGetStatus=!0,this.$container.find(".loadingStatus").remove(),this.$container.find(".loadingExt").removeClass("loading").addClass("loaded"),n=$$WP.SimpleTemplates.Div({class:"subtlecolor loadingStatus","aria-hidden":"true"}),$$WP.Strings.setDisplayText(n,"CommunityLoadedMessage","community.externaljump"),this.$content.safeAppend(n),this.$container.addClass("loaded").on("transitionend",(function(t){if(t&&t.target&&!$afe.jq(this).hasClass("resized")&&$afe.jq(this).hasClass("loaded")){var n=$afe.jq(this).parent(".component:not(.inlineloading)").first();n&&($afe.jq(n).trigger("resize",{forceShrink:!0}),$afe.jq(this).addClass("resized"),$afe.jq(n).css("height",""))}}))):this.Components$TemplateComponent$hide()},refresh:function WPComp$InlineLoadingComponentWithSources$refresh(){this.$container.removeClass("loaded resized"),this.Components$TemplateComponent$refresh()},_resize:function(){return!1}},$$WPComp.InlineLoadingComponentWithSources.extend("Components.TemplateComponent");;
$$WPComp.ExternalJumpPopupComponent=function WPComp$ExternalJumpPopupComponent(e){this.Components$TemplateComponent(e),this.Data=this.Data||{},this.addEventListener("click",this._clickEvent),this.Data.ExternalJumpIframeId="externaljumpiframe_comp"+this.ComponentNumber,this.ExternalJumpIframeId=this.Data.ExternalJumpIframeId,this.Data.LastFocusTrapId="lastFocusTrap"+this.ComponentNumber,this.LastFocusTrapId=this.Data.LastFocusTrapId},$$WPComp.ExternalJumpPopupComponent.prototype={Class:"externaljump",ToolbarButtons:null,template:$$WP.Templates.Core.externaljump,CommunicationsIndicator:!1,ExternalJumpIframe:null,IsLoadingIndicatorHidden:!1,ResponseObject:null,NewWindowReference:null,ExternalJumpIframeId:null,LastFocusTrapId:null,RefreshCommunityTokenOnClose:!1,callback:null,context:null,windowMsgListener:null,initialize:function $$WPComp$externaljump$initialize(){this.clearModel(),this.refresh()},clearModel:function $$WPComp$externaljump$clearModel(){this.Data&&(this.Data.OrganizationName=null,this.Data.OrganizationLogo=null,this.Data.Url=null)},loadIframe:function $$WPComp$externaljump$loadIframe(e,t,n){"object"==typeof e&&(this.updateData(e.CommunityResponse,t,n),this.ResponseObject=e.CommunityResponse,this.RefreshCommunityTokenOnClose=e.RedirectToSignup,this.Data.IsSignupWorkFlow=e.RedirectToSignup,this.Data.Url=this.ResponseObject.RedirectURL,this.refresh(),$afe.select("#"+this.ExternalJumpIframeId).on("load",$.proxy(this.afterIframeLoaded,this)).on("error",this.failure),this.ExternalJumpIframe=document.getElementById(this.ExternalJumpIframeId)),this.windowMsgListener=$.proxy(this.msgListener,this),$afe.jq(window).on("message."+this.ComponentNumber,this.windowMsgListener),$afe.jq(window).on("resize orientationchange","",this.ComponentNumber,$.proxy(this._resizeIframe,this)),this.ContainerComponent._oldDispose=this.ContainerComponent.dispose,this.ContainerComponent.dispose=$.proxy(this._popupDispose,this)},afterIframeLoaded:function $$WPComp$externaljump$afterIframeLoaded(){this.hideLoadingIndicator()},hideLoadingIndicator:function $$WPComp$externaljump$hideLoadingIndicator(){this.IsLoadingIndicatorHidden||(this.$content.find(".loadingExt").removeClass("loading").addClass("loaded"),this.$content.find(".loadingContainer").addClass("loaded").on("transitionend transitionEnd",$.proxy(this.showIframeContent,this)),9===WP.DOM.Browser._getIEVersion()&&setTimeout($.proxy(this.showIframeContent,this),500),this.IsLoadingIndicatorHidden=!0)},showIframeContent:function $$WPComp$externaljump$showIframeContent(){this.$content.find(".loadingContainer").remove(),this.$content.find(".loadedcontent").removeClass("loadedcontent"),$.proxy(this._resizeIframe(),this),this.ContainerComponent.firstFocus.focus()},getLastFocusTrap:function $$WPComp$externaljump$getLastFocusTrap(e){return $afe.jq(e).find("#"+this.LastFocusTrapId).last()[0]},_resizeIframe:function $$WPComp$externaljump$_resizeIframe(e){var t,n,i,o,s,a,r,p;n=$afe.select(".externalheader"),i=$afe.select(".titlebar"),s=0===n.length?0:n.outerHeight(),o=0===i.length?0:i.outerHeight(),a=(t=$afe.select(".externaljumppopup")).length>0?t.outerHeight():0,r=window.innerWidth<=1300?window.innerHeight-s-o:a-s-o,0!==(p=$afe.select("#"+this.ExternalJumpIframeId)).length&&(t.css("max-height","none"),p.css("height",r+"px"),p.closest(".externalframewrapper").css("height",r+"px"))},showBrowserUnSupportedMessage:function $$WPComp$externaljump$showBrowserUnSupportedMessage(){var e,t;e=$$WP.SimpleTemplates.Div({id:"UnSupportedMessage"},null),$$WP.Strings.setDisplayText(e,"UnSupportedMessage","community.externaljump"),this.$content.find(".browsersupport").safeAppend(e),t=$$WP.SimpleTemplates.Anchor({href:"#","data-id":"unsupportedbrowserlink",class:"button completeworkflow autowidth",title:$$WP.Strings.get("UnSupportedBtnText","community.externaljump"),"aria-describedby":"UnSupportedMessage"}),$$WP.Strings.setDisplayText(t,"UnSupportedBtnText","community.externaljump"),this.$content.find(".browsersupport").safeAppend(t)},failure:function $$WPComp$externaljump$failure(){this.Data.ErrorMessage=$$WP.Strings.getForTemplate("WidgetErrorMessage"),this.refresh()},updateData:function $$WPComp$externaljump$updateData(e,t,n){e&&e.Organization&&(this.Data.OrganizationLogo=t&&n?n:e.Organization.LogoUrl,this.Data.IsPayvider=t&&n,this.Data.OrganizationName=e.Organization.OrganizationName,$$WP.Strings.setOrganization(e.Organization,!t,"community.externaljump"),this.Data.LoadingStatus=$$WP.Strings.getForTemplate("DeepLinkPopupLoadingMessage","community.externaljump"),this.Data.IframeTitle=$$WP.Strings.getForTemplate("IframeTitle","community.externaljump"),$$WP.Strings.clearOrganization(),this.Data.Address=e.Organization.Address,this.Data.Contact=e.Organization.ContactInformation,null===this.Data.Contact&&(this.Data.contactInfoClass="nocontact"))},msgListener:function $$WPComp$externaljump$msgListener(e){if(e&&e.originalEvent&&e.originalEvent.data){var t=JSON.parse(e.originalEvent.data);if(!t)return;if("cookieFlag"===t.message&&!t.canSetCookies)return this.hideLoadingIndicator(),$afe.select("#"+this.ExternalJumpIframeId).remove(),void this.showBrowserUnSupportedMessage();if(t.externalGUID===$$WP.CommunityUtilities.getExternalJumpGUID()&&this)if("closePopup"===t.message)this.ContainerComponent&&this.ContainerComponent._oldDispose(),this&&this._disposeTimeout&&clearTimeout(this._disposeTimeout);else if("isValidContext"===t.message){if(this.ExternalJumpIframe&&this.ExternalJumpIframe.contentWindow){var n={message:"valid"};this.ExternalJumpIframe.contentWindow.postMessage(JSON.stringify(n),"*")}}else"setActivity"===t.message&&$$WPUtil.setActivity()}},_clickEvent:function $$WPComp$externaljump$_clickEvent(e){return!e||("unsupportedbrowserlink"!==e.dataId||null===this.ResponseObject||$$WPUtil.IsNullOrEmpty(this.ResponseObject.RedirectURL)?void 0:(this.ResponseObject.IsSSOPost?(this.NewWindowReference=openWindow("","","scrollbars=1,resizable=1","externalJumpWindow",!0),$$WPUtil.postForm(this.ResponseObject.RedirectURL,this.ResponseObject.SSOParams,this.NewWindowReference.name)):(this.ResponseObject.RedirectURL=this.ResponseObject.RedirectURL+"&co=true",this.NewWindowReference=openWindow(this.ResponseObject.RedirectURL,"","scrollbars=1,resizable=1","externalJumpWindow",!0)),!1))},_popupDispose:function $$WPComp$externaljump$popupDispose(){if(this){if(this.ExternalJumpIframe&&this.ExternalJumpIframe.contentWindow||null!==this.NewWindowReference&&!this.NewWindowReference.closed){var e={message:"logout"};null!==this.NewWindowReference?this.NewWindowReference.window.postMessage(JSON.stringify(e),"*"):this.ExternalJumpIframe.contentWindow.postMessage(JSON.stringify(e),"*")}this.ContainerComponent.hide(),this._disposeTimeout=setTimeout($.proxy((function(){null===this.NewWindowReference||this.NewWindowReference.closed||closeAllWindows("externalJumpWindow"),this.ContainerComponent&&this.ContainerComponent._oldDispose()}),this),500)}},dispose:function $$WPComp$externaljump$dispose(){$afe.jq(window).off("message."+this.ComponentNumber,this.windowMsgListener),$afe.jq(window).off("resize orientationchange","",$.proxy(this._resizeIframe,this)),null!==this.ResponseObject&&this.RefreshCommunityTokenOnClose&&$$WP.CommunityUtilities.refreshCommunityLink(this.ResponseObject.Organization.OrganizationId),this.runCallback(this.callback),this.Components$Component$dispose()},runCallback:function $$WPComp$externaljump$runCallback(e){e&&this.context&&"function"==typeof e&&e.apply(this.context)}},$$WPComp.ExternalJumpPopupComponent.extend("Components.TemplateComponent");;
$$WPComp.ConfirmComponent=function WPPop$Confirm(o){$$WPComp.applySettings(o,this),"function"!=typeof this.callback&&$$WP.Debug.logError("A callback function is required for Confirm"),this.Components$Component({}),this.CallbackContext=this.CallbackContext||this,this.addEventListener("click",this._clickToolbar)},$$WPComp.ConfirmComponent.prototype={AffirmButtonIndex:0,_clickToolbar:function WPPop$Confirm$_click(o){if(o.dataId)return this.callback.apply(this.CallbackContext,[$$WPComp.TOOLBARIDENTIFIER+this.AffirmButtonIndex===o.dataId]),this.dispose(!0),!1}},$$WPComp.ConfirmComponent.extend("Components.Component");;
/*! Copyright (c) Epic Systems Corporation 2014-2016 */
$$WPUtil.guaranteeExistence($$WP,"Containers");var $$WPContain=$$WP.Containers;$$WPContain.ContainerComponent=function WPContain$Container(n){this._Components=[],this.Components$Component(n),this.Components&&(Array.isArray(this.Components)?this.addComponent(this.Components):this.setSingleComponent(this.Components),delete this.Components)},$$WPContain.ContainerComponent.prototype={Class:"container",Events:["dispose","resize"],_Components:[],IsClosable:!0,hasComponents:function WPContain$Container$hasComponents(){return this._Components&&this._Components.length>0},show:function WPContain$Container$show(n){if(!0!==this._visible){var o;if($$WP.Debug.UpdateTopMarginForBanners(),n&&this.hasComponents())for(o=0;o<this._Components.length;o+=1)this._Components[o].show(n);this.Components$Component$show()}},hide:function WPContain$Container$hide(n){var o;if(!1!==this._visible&&(this.Components$Component$hide(),n&&this.hasComponents()))for(o=0;o<this._Components.length;o+=1)this._Components[o].hide(n)},addComponent:function WPContain$Container$addComponent(n){var o;if(n)if(Array.isArray(n))for(o=0;o<n.length;o+=1)this.addComponent(n[o]);else{if(!$$WPComp.isComponent(n))throw"addComponent was called with something that isn't a component";n.ContainerComponent&&(n.ContainerComponent.removeComponent(n,!0),n.hide()),this._Components.push(n),0===this.$content.find(n.$container).length&&this.$content.safeAppend(n.$container),n.ContainerComponent=this,n._isVisibleOld=n.isVisible,n.isVisible=this._isComponentVisible}},_isComponentVisible:function(){return this._isVisibleOld()&&this.ContainerComponent.isVisible()},removeComponent:function WPContain$Container$removeComponent(n,o){var t,e;for(e=isNaN(n)?n.ComponentNumber:n,t=this._Components.length-1;t>-1&&this._Components[t].ComponentNumber!==e;t--);(n=this._Components[t])&&n.ComponentNumber===e&&(!0!==o&&n.dispose(),n.$container.remove(),n.ContainerComponent=null,n.isVisible=n._isVisibleOld,delete n._isVisibleOld,this._Components=this._Components.slice(0,t-1).concat(this._Components.slice(t+1,this._Components.length-1)))},clearComponents:function WPContain$Container$clearComponents(n){for(;this._Components.length;)this.removeComponent(this._Components[this._Components.length-1].ComponentNumber,n);this._Components=[]},setSingleComponent:function(n){$$WPComp.isComponent(n)?(this.addComponent(n),this.setTitle(n.TitleText,n.TitleButtons,n.TitleImage,n.IsClosable),n.setTitle(null,null,null,!1)):$$WP.Debug.logError("setSingleComponent called with something that isn't a component")},dispose:function WPContain$Container$dispose(n){this._isDisposed||(this.clearComponents(),this.Components$Component$dispose(n),this._ContentGeneratedOnce=!1)},html:function WPContain$Container$html(){$$WP.Debug.logError("You cannot directly set the HTML of a container.")},copy:function(n,o){var t,e;for((n=n||{}).Components=n.Components||[],e=this._Components.length,t=0;t<e;t++)n.Components.push(this._Components[t].copy(o||{}));return this.Components$Component$copy(n)},load:function(){for(var n=0;n<this._Components.length;n++)if("function"==typeof this._Components[n].load)try{this._Components[n].load.apply(this._Components[n],arguments)}catch(n){$$WP.Debug.logError(n)}}},$$WPContain.ContainerComponent.extend("Components.Component");;
$$WPUtil.guaranteeExistence($$WP,"Containers"),$$WPContain.Positions={None:function WPContain$Positions$None(){},InsideCentered:function WPContain$Positions$InsideCentered(t,e){var i,o,s,l,n,a,r,$,f,h,c,d,p=t.data;isNaN(p)||(p=$$WPComp.getInstance(p)),s=p.$container,i=$afe.jq(window),o=$$WPContain.Positions.getOffset.apply(p,[e]),l=i.height()-s.outerHeight(),r=$$WPUtil.getScrollTop(),$=$$WPUtil.getScrollLeft(),window.visualViewport&&Math.round(window.visualViewport.width)!==i.innerWidth()&&($=0),this._IsWindowScrollDisabled?(h=$$WPUtil.cssValueToPixels($afe.select("body").css("margin-top")),l>0?a=(i.height()-s.outerHeight())/2-h:(this._IsWindowScrollDisabled=!1,$afe.select("body").removeClass("scrollDisabled"))):(o.y<0&&(o.y=0),a=r+(i.height()-s.outerHeight())/2-o.y),null==a&&(a=0),c=Math.max(r+35,a),n=window.frameElement,isDataTile()&&null!=n&&(s.hasClass("small")?(d=(c=$$WPUtil.getDataTileScrollTop(n)+35)+s.outerHeight()-n.scrollHeight)>0&&(c-=d):c=0),(f=$+(i.width()-s.outerWidth())/2-o.x)<0&&(f=0),$afe.select("html").hasClass("mobile")&&i.scrollTop(0),s.css({top:c+"px",left:f+"px",right:f+"px"})},InsideNearTop:function WPContain$Positions$InsideNearTop(t,e){var i,o,s,l,n,a,r=t.data;"number"==typeof r&&(r=$$WPComp.Instances[r]),s=r.$container,i=$afe.jq(window),o=$$WPContain.Positions.getOffset.apply(r,[e]),l=$afe.select("#header").outerHeight()||null,n=$afe.select("body").hasClass("scrollDisabled")?l-$$WPUtil.cssValueToPixels($afe.select("body").css("margin-top"))+10+"px":$afe.select("html").hasClass("mobile")?l+10+"px":l+$$WPUtil.getScrollTop()+10+"px",scrollLeft=$$WPUtil.getScrollLeft(),window.visualViewport&&Math.round(window.visualViewport.width)!==i.innerWidth()&&(scrollLeft=0),(a=scrollLeft+(i.width()-s.outerWidth())/2-o.x)<0&&(a=0),$afe.select("html").hasClass("mobile")&&i.scrollTop(0),s.css({left:a,top:n,right:a})},getOffset:function WPContain$Positions$getOffset(t){var e,i,o;return this.origOffset&&!t||(this.$container.css({position:"absolute",top:0,left:0,right:0}),e=this.$container.offset(),"rtl"===$afe.select("html").safeAttr("dir")?(i=$afe.jq(window).width(),o=this.$container.outerWidth(),this.origOffset={x:i-(e.left+o),y:e.top}):this.origOffset={x:e.left,y:e.top}),this.origOffset}};;
$$WPUtil.guaranteeExistence($$WP,"Popups"),$$WPUtil.guaranteeExistence($$WP,"Utilities.UI");var $$WPPop=$$WP.Popups;$$WPContain.Popup=function WPContain$Popup(t){switch($$WPComp.applySettings(t,this),this.Size){case $$WPContain.Popup.SizeEnum.SMALL:this.Class+=" small";break;case $$WPContain.Popup.SizeEnum.MEDIUM:this.Class+=" medium";break;case $$WPContain.Popup.SizeEnum.LARGE:this.Class+=" large"}null===this.positioningFunction&&(this.positioningFunction=$$WPContain.Positions.InsideCentered),this.$parent=$afe.select("#classicPopupRoot"),this.$parent=this.$parent&&this.$parent.length>0?this.$parent:$afe.jq(document.body),this._shouldOverrideMobileBack()&&(Array.isArray(this.Components)?this.Components.forEach((function(t){t.IsClosable=!1})):this.Components.IsClosable=!1),this.Containers$ContainerComponent({}),this.addEventListener("resize",this._resizePopup),this.addEventListener("click",this._clickPopup),this.addEventListener("keydown",this._keydownPopup),this.addEventListener("fullscreenchange",this._adjustFullscreen),this.GetInvisibleLastFocusAnchor&&this.addEventListener("keyup",this._keyupPopup),$$WP.Utilities.UI.IsMobile&&this.addEventListener("focusout",this._onMobileFocusOut),!1!==this.HasBackButton&&(this.HasBackButton||isDataTile()&&this.IsClosable&&this.Size!=$$WPContain.Popup.SizeEnum.SMALL)&&(""===this.BackButtonText&&(this.BackButtonText=$$WP.Strings.get("PopupBackToPreviousPageButton",this.StringsNamespace)),null===this.ToolbarButtons&&(this.ToolbarButtons=[]),this.ToolbarButtons.push(new $$WPComp.ComplexObjects.Button(this.BackButtonText,null,"secondary neutral previouspage","close",this.BackButtonText)))},$$WPContain.Popup.SizeEnum={SMALL:1,MEDIUM:2,LARGE:3,AUTO:4},$$WPContain.Popup.__zIndex=0,$$WPContain.Popup.prototype={ToolbarButtons:null,HasOverlay:!0,IsClosable:!0,Class:"Popup",positioningFunction:$$WPContain.Positions.InsideCentered,Size:$$WPContain.Popup.SizeEnum.SMALL,_IsWindowScrollDisabled:!1,_ScrollBarPosition:0,_ScrollBarLeft:0,_IsScrollBarDisabledWhenOpened:!1,_InitialBodyMarginTop:0,_InitialBodyMarginLeft:0,$parent:$afe.select("body"),HasBackButton:null,BackButtonText:"",GetLastFocus:null,MonitorAriaLiveContent:!0,OnCloseCallback:null,_MinContentHeight:null,AriaLabelledByID:"",AriaDescribedByID:"",PierceShieldOfJustice:!1,CanResetFocusOnKeydown:!1,GetInvisibleLastFocusAnchor:null,_componentsHaveTitleText:function(){if(this.TitleText&&this.TitleText.string&&!$$WP.Utilities.IsNullOrEmpty(this.TitleText.string))return!0;if(this._Title&&this._Title.Text&&!$$WP.Utilities.IsNullOrEmpty(this._Title.Text))return!0;for(i=0;i<this._Components.length;i++){if(this._Components[i].TitleText&&this._Components[i].TitleText.string&&!$$WP.Utilities.IsNullOrEmpty(this._Components[i].TitleText.string))return!0;if(this._Components[i]._Title&&this._Components[i]._Title.Text&&!$$WP.Utilities.IsNullOrEmpty(this._Components[i]._Title.Text))return!0}return!1},show:function WPContain$Popup$show(t){if(this._componentsHaveTitleText()||$$WP.Debug.logError("TitleText cannot be null or empty for popups."),!0!==this._visible){this.__setAriaHidden(!0),this.$container.find(".alertLive").length>0&&(this.MonitorAriaLiveContent=!1),this.$container.safeAttr("role","dialog"),this.$container.safeAttr("aria-modal","true"),this._ScrollBarPosition=$$WPUtil.getScrollTop(),this._ScrollBarLeft=$$WPUtil.getScrollLeft(),this._IsScrollBarDisabledWhenOpened=$afe.select("body").hasClass("scrollDisabled"),this._IsScrollBarDisabledWhenOpened&&(this._InitialBodyMarginTop=$afe.select("body").css("margin-top"),this._InitialBodyMarginLeft=$afe.select("body").css("margin-left")),this.setAppropriateScrollBar(),$$WP.Debug.UpdateTopMarginForBanners(),this.HasOverlay&&this._overlay.on(!this.IsClosable,this),this.Containers$ContainerComponent$show(t);var e,i=$afe.select("#popupCloseAction");if(i&&i.on("click","",this.ComponentNumber,this._closePopup),this._supportsAriaDescription()&&(this.AriaDescribedByID.length>0||(e=this.AriaDescriptionComponentNumber>-1?this.AriaDescriptionComponentNumber:this.ComponentNumber,this.AriaDescribedByID="popupdescription"+e),this.$container.safeAttr("aria-describedby",this.AriaDescribedByID),this.MonitorAriaLiveContent=!1),this._supportsAriaLabel()&&(this.AriaLabelledByID.length>0||(e=this.AriaLabelComponentNumber>-1?this.AriaLabelComponentNumber:this.ComponentNumber,this.AriaLabelledByID="popuplabel"+e),this.$container.safeAttr("aria-labelledby",this.AriaLabelledByID)),this.MonitorAriaLiveContent&&(this.$container.safeAttr("aria-live","polite"),this.$container.safeAttr("aria-relevant","additions")),this.setFocus(),this.focus(),$afe.jq(window).on("resize orientationchange","",this.ComponentNumber,this.__windowResize),this._shouldOverrideMobileBack()){var o=this._getMobileBackEvents();this.$container.data("_cachedWindowEvents",[]),o.forEach((function(t){this.$container.data("_cachedWindowEvents").push(t)}),this),$afe.jq(window).off("mobile_back"),$afe.jq(window).on("mobile_back","",this.ComponentNumber,this.__mobileBack)}if(this.__otherPopupsExist()&&(this.__setAriaHiddenPreviousPopupContent(!0),popupAlert=this._createPopupAlert(),this.$container.safePrepend(popupAlert),this.focus(),popupAlert.setAttribute("tabindex","-1")),this._MinContentHeight=$$WPUtil.cssValueToPixels(this.$content.css("min-height")),this.setAppropriateContentHeight(),isDataTile()&&this.Size!==$$WPContain.Popup.SizeEnum.SMALL)try{window.history.pushState(null,null,location.href),scrollTopOfTheIframe(0,!0)}catch(t){$$WP.Debug.log("Cannot add Push state as the parent domain is not accessible")}}},setAppropriateScrollBar:function WPContain$Popup$setAppropriateScrollBar(){var t,e,i,o=$afe.select("body"),s=$afe.jq(window),n=$afe.select("#header");if(t=s.width(),e=s.height(),$$WPUtil.cssValueToPixels(o.css("min-width")),i=this.$container.outerHeight()+this.$container.offset().top<=e&&this.$container.outerWidth()<=t,!isDataTile()&&i){var a=$$WPUtil.getScrollTop(),r=$$WPUtil.getScrollLeft(),l=n.hasClass("compact");this._IsWindowScrollDisabled=!0,a>75&&(l||n.hasClass("static")||(n.addClass("compact"),s.trigger("compactHeader"),l=!0)),this._IsScrollBarDisabledWhenOpened||(o.css({"margin-top":"-"+a+"px"}),o.css({"margin-left":"-"+r+"px"}),o.addClass("scrollDisabled"),$$WP.Utilities.UI.EnforceEpicLogoVisibility(!l))}else this._IsWindowScrollDisabled=!1,o.css({"margin-top":""}),o.css({"margin-left":""}),o.removeClass("scrollDisabled")},setAppropriateContentHeight:function WPContain$Popup$setAppropriateContentHeight(){var t,e,i,o,s,n,a=$afe.select("#header").outerHeight();this._IsWindowScrollDisabled?(e=$afe.jq(window).innerHeight(),i=$afe.select(".Popup > .scrollable > .titlebar").outerHeight(),t=e-2*a-(n=$afe.select(".Popup > .scrollable > .toolbar").outerHeight())-i,this.$content.contentHeight(),s=e-a-n-i-10,void 0!==(o=this._MinContentHeight)&&o>s&&(o=s),void 0!==o&&o>t&&(t=o),t<150&&(t=150),this.$container.find("> .scrollable > .content").css({"max-height":t+"px","overflow-y":"auto","min-height":o+"px"})):this.$container.find("> .scrollable > .content").css({"max-height":"","overflow-y":"visible"})},setFocus:function(){try{this.firstFocus=WP.DOM.Search.getNextFocusable(this.$container.get(0))}catch(t){}try{null!==this.GetLastFocus?this.lastFocus=this.GetLastFocus(this.$container.get(0)):this.lastFocus=WP.DOM.Search.getLastFocusable(this.$container.get(0))}catch(t){}this.isFirstFocus=!1},__focus:function(){try{var t;(t=Array.isArray(this._Components)?this.__findFirstFocusableContent(this._Components,0):WP.DOM.Search.getNextFocusable(this._Components.$content))||"skipToMain"===(t=WP.DOM.Search.getNextFocusable(this.$container.get(0))).id&&(t=WP.DOM.Search.getNextFocusable(t)),this.PierceShieldOfJustice&&t.setAttribute("data-pierce-shield","true"),t.focus()}catch(t){}},__windowResize:function(t){var e=$$WPComp.getInstance(t.data);e&&(e._IsWindowScrollDisabled=!1,e.setAppropriateScrollBar(),e.$container.trigger("resize"))},hide:function WPContain$Popup$hide(t){if(!1!==this._visible){this.__otherPopupsExist()?this.__setAriaHiddenPreviousPopupContent(!1):this.__setAriaHidden(!1),this.Containers$ContainerComponent$hide(t),this._visible=!1,this._IsScrollBarDisabledWhenOpened?$afe.select("body").css({"margin-top":this._InitialBodyMarginTop,"margin-left":this._InitialBodyMarginLeft}):$afe.select("body").css({"margin-top":"","margin-left":""}).removeClass("scrollDisabled"),this._IsWindowScrollDisabled=!1,this.HasOverlay&&this._overlay.off(!this.IsClosable,this);try{var e=isDataTile()&&null!=window.frameElement;this.FocusOnClose.focus({preventScroll:e})}catch(t){}if(this._ScrollBarPosition&&$$WPUtil.setScrollTop(this._ScrollBarPosition),this._ScrollBarLeft&&$$WPUtil.setScrollLeft(this._ScrollBarLeft),1===$afe.select(".Popup.component").length&&$afe.jq(window).off("resize orientationchange","",this.__windowResize),this._shouldOverrideMobileBack()){var i=this.$container.data("_cachedWindowEvents");i&&($afe.jq(window).off("mobile_back"),i.forEach((function(t){$afe.jq(window).on("mobile_back",t.selector,t.data,t.handler)})))}"function"==typeof this.OnCloseCallback&&this.OnCloseCallback()}},reposition:function WPContain$Popup$reposition(t){if(0!==this.$container.parent().length){var e=this.$container.css("opacity");this.$container.css("opacity",0);try{this.positioningFunction({data:this},t)}catch(t){throw"repositioning error"}this.$container.css("opacity",e)}},setTitle:function(t,e,i,o){var s;t||e&&0!==e.length||o?this.$container.removeClass("notitle"):(s=!0,e=[new $$WPComp.ComplexObjects.Button($$WP.Strings.getForTemplate("JumpToContent","Core.Popup"),null,"clearlabel","jumptocontent")],this.$container.addClass("notitle")),this.Containers$ContainerComponent$setTitle(t,e,i,o),s&&this.$title.addClass("clearlabel")},_resizePopup:function WPContain$Popup$_resize(){return!!this.isVisible()&&(this.reposition(!0),this.setAppropriateContentHeight(),this.setFocus(),!1)},_clickPopup:function(t){return t.dataId===$$WPComp.TITLEBARIDENTIFIER+"jumptocontent"?(this.focus(!0),!1):"focusanchor"!==t.dataId&&void 0},_adjustFullscreen:function(){$afe.select("body").css("margin-left","-"+this._ScrollBarLeft+"px"),this.reposition(!0)},_onMobileFocusOut:function(t){t.relatedTarget||$afe.jq(window).scrollTop(0)},_keydownPopup:function WPContain$Popup$_keydown(t){this.canResetFocusOnKeydown&&this.setFocus();var e=$afe.select(".infoBubbleWrapper.hover").length>0;if(27===t.keyCode&&this.IsClosable&&!e&&this.dispose(!1),9===t.keyCode){if(t.target===this.firstFocus||t.target===this.lastFocus)return t.shiftKey&&t.target===this.firstFocus?(this.lastFocus&&this.lastFocus.focus(),this.isFirstFocus&&delete this.isFirstFocus,!1):t.shiftKey||t.target!==this.lastFocus?void 0:(this.firstFocus&&this.firstFocus.focus(),this.isFirstFocus&&delete this.isFirstFocus,!1);if(this.isFirstFocus){var i=t.shiftKey?this.lastFocus:this.firstFocus;return i&&i.focus(),delete this.isFirstFocus,!1}}},_keyupPopup:function WPContain$Popup$_keyup(t){var e=this.GetInvisibleLastFocusAnchor(this.$container.get(0));if(e)return t.shiftKey||t.target!==e?void(t.shiftKey&&t.target===e&&WP.DOM.Search.getPreviousFocusable(e).focus()):(e===this.lastFocus?(this.firstFocus&&this.firstFocus.focus(),this.isFirstFocus&&delete this.isFirstFocus):WP.DOM.Search.getNextFocusable(e).focus(),!1)},__mobileBack:function(t){var e=$$WPComp.getInstance(t.data);e&&e.dispose()},_shouldOverrideMobileBack:function WPContain$Popup$_shouldOverrideMobileBack(){if(!$$WP.Utilities.UI.IsMobile||this.Size!==$$WPContain.Popup.SizeEnum.MEDIUM&&this.Size!==$$WPContain.Popup.SizeEnum.LARGE||isDataTile())return!1;var t=this._getMobileBackEvents();return t&&t.length>0},_getMobileBackEvents:function WPContain$Popup$_getMobileBackEvents(){var t=$._data(window,"events");return t?t.mobile_back:null},_overlay:{on:function WPContain$Popup$overlay$on(t,e){var i,o;o=(o=(o=$afe.select("#classicPopupRoot"))&&o.length>0?o:$afe.select("body"))&&o.length>0?o:$afe.select("#datatile"),$$WPContain.Popup.__zIndex+=3,i=3e3+$$WPContain.Popup.__zIndex,e.$overlay=$afe.renderTemplate($$WP.Templates.Core.overlay,{}),o.safeAppend(e.$overlay),e.$overlay.show(),e.$overlay.css("z-index",i),e.$container.css("z-index",i+1),$$WP.Utilities.UI.PDF&&$$WP.Utilities.UI.PDF.needIframeShim()&&$$WP.Utilities.UI.PDF.pageHasEmbeddedPdf()&&$$WP.Utilities.UI.PDF.hidePdfs(),t||e.$overlay.on("click","",e.ComponentNumber,e._overlay._overlayClick)},off:function WPContain$Popup$overlay$off(t,e){var i;t||e.$overlay.off("click","",e._overlay._overlayClick),e.$overlay.remove(),i=$afe.select(".lb_overlay:visible").length,$$WP.Utilities.UI.PDF&&$$WP.Utilities.UI.PDF.needIframeShim()&&$$WP.Utilities.UI.PDF.pageHasEmbeddedPdf()&&0==i&&$$WP.Utilities.UI.PDF.showPdfs()},_overlayClick:function WPContain$Popup$overlay$overlayClick(t){var e=$$WPComp.getInstance(t.data);return e&&e.dispose(),$$WPUtil.preventEvent(t)}},__setAriaHidden:function(t){var e=this.__getPageElementsForAria();for(i=0;i<e.length;i++)e[i].setAttribute("aria-hidden",t)},__getPageElementsForAria:function(){return document.querySelectorAll("[data-hide-during-popup='true']")},__setAriaHiddenPreviousPopupContent:function(t){var e=[];for(e=this.__getAllPopups(),i=0;i<e.length;i++)e[i].getAttribute("data-component-id")!==this.$container.safeAttr("data-component-id")&&e[i].setAttribute("aria-hidden",t)},__otherPopupsExist:function(){return this.__getAllPopups().length>1},__getAllPopups:function(){var t=[],e=[],o=0;for(t=document.querySelectorAll("div[data-component-id]"),i=0;i<t.length;i++)t[i].classList.contains("Popup")&&(e[o++]=t[i]);return e},__findFirstFocusableContent:function(t,e){if(e>=t.length)return null;var i=t[e].$content;if(!i)return this.__findFirstFocusableContent(t,++e);var o=WP.DOM.Search.getNextFocusable(i.get(0));return null!==o&&"popupCloseAction"!==o.id&&"OBJECT"!==o.tagName.toUpperCase()&&this.$container.get(0).contains(o)?o:this.__findFirstFocusableContent(t,++e)},focus:function WPPopup$focus(){try{null===this.FocusOnClose&&(this.FocusOnClose=WP.DOM.Search.getFocused(document.body))}catch(t){}try{this.__focus()}catch(t){}},_supportsAriaDescription:function(){if(this.SupportsAriaDescription)return!0;for(i=0;i<this._Components.length;i++)if(this._Components[i].SupportsAriaDescription)return this.AriaDescriptionComponentNumber=this._Components[i].ComponentNumber,!0;return!1},_supportsAriaLabel:function(){if(this.SupportsAriaLabel)return!0;for(i=0;i<this._Components.length;i++)if(this._Components[i].SupportsAriaLabel)return!0;return!1},_closePopup:function(t){var e=$$WPComp.getInstance(t.data);e&&e.dispose()},_createPopupAlert:function(){var t=document.createElement("span");t.className="clearlabel",t.setAttribute("tabindex","0"),t.setAttribute("role","alert"),this.hasOwnProperty("PierceShieldOfJustice")&&t.setAttribute("data-pierce-shield","true");var e=this._Title.Text.toString(),i=$$WP.Strings.getNamespace("Core.Popup"),o=isDataTile()&&this.Size!==$$WPContain.Popup.SizeEnum.SMALL?"PopupWindowAlert":"PopupAlert";o+=e?"WithTitle":"",i.addMnemonic("@MYCHART@PopupTitle@",e);var s=i.getStringForTemplate(o);return i.removeMnemonic("@MYCHART@PopupTitle@"),t.appendChild(document.createTextNode(s)),t}},$$WPContain.Popup.extend("Containers.ContainerComponent"),$afe.jq(window).on("popupResize",(function(){var t=$$WPComp.getInstance($afe.select(".Popup.component").safeAttr("data-component-id"));null!==t&&$$WPComp.isComponent(t)&&"function"==typeof t.setAppropriateContentHeight&&t.setAppropriateContentHeight()}));;
/*! Copyright (c) Epic Systems Corporation 2014-2016 */
$$WPContain.Panel=function WPContain$Panel(n){$$WPComp.applySettings(n,this),this.$parent=this.$parent||$afe.select("#main"),this.Containers$ContainerComponent({})},$$WPContain.Panel.prototype={IsClosable:!1,Class:"Panel",$parent:$afe.select("#main")},$$WPContain.Panel.extend("Containers.ContainerComponent");;
$$WP.Containers.CommunityListManagerContainer=function(o){o.Components=[o.HeaderComponent||this.HeaderComponent,o.ListComponent||this.ListComponent,o.FooterComponent||this.FooterComponent],this.Containers$ContainerComponent(o)},$$WP.Containers.CommunityListManagerContainer.prototype={HeaderComponent:$$WPComp.Component.prototype,FooterComponent:$$WPComp.Component.prototype,ListComponent:$$WPComp.Component.prototype,show:function(o){!0!==o?(this.HeaderComponent.hide(),this.ListComponent.show(),this.FooterComponent.hide(),this.Components$Component$show()):this.Containers$ContainerComponent$show(!0)}},$$WP.Containers.CommunityListManagerContainer.extend("Containers.ContainerComponent");;
!function(){var l=Handlebars.template,n=$$WP.Templates=$$WP.Templates||{};(n=n.Core=n.Core||{}).calendar=l({compiler:[8,">= 4.3.0"],main:function(l,n,e,t,a,o,r){var u,c,i=null!=n?n:l.nullContext||{},s=l.hooks.helperMissing,m="function",p=l.escapeExpression,h=l.lookupProperty||function(l,n){if(Object.prototype.hasOwnProperty.call(l,n))return l[n]};return'<div class="calendar '+p(typeof(c=null!=(c=h(e,"Class")||(null!=n?h(n,"Class"):n))?c:s)===m?c.call(i,{name:"Class",hash:{},data:a,loc:{start:{line:1,column:72},end:{line:1,column:81}}}):c)+'"><table><thead><tr>'+(null!=(u=h(e,"if").call(i,null!=n?h(n,"IsPrevEnabled"):n,{name:"if",hash:{},fn:l.program(1,a,0,o,r),inverse:l.program(3,a,0,o,r),data:a,loc:{start:{line:1,column:101},end:{line:1,column:336}}}))?u:"")+'<th id="calmonth'+p(typeof(c=null!=(c=h(e,"componentNumber")||(null!=n?h(n,"componentNumber"):n))?c:s)===m?c.call(i,{name:"componentNumber",hash:{},data:a,loc:{start:{line:1,column:352},end:{line:1,column:371}}}):c)+'" class="calmonth" colspan="5">'+p(typeof(c=null!=(c=h(e,"Title")||(null!=n?h(n,"Title"):n))?c:s)===m?c.call(i,{name:"Title",hash:{},data:a,loc:{start:{line:1,column:402},end:{line:1,column:411}}}):c)+"</th>"+(null!=(u=h(e,"if").call(i,null!=n?h(n,"IsNextEnabled"):n,{name:"if",hash:{},fn:l.program(5,a,0,o,r),inverse:l.program(3,a,0,o,r),data:a,loc:{start:{line:1,column:416},end:{line:1,column:652}}}))?u:"")+"</tr><tr>"+(null!=(u=h(e,"each").call(i,null!=n?h(n,"Days"):n,{name:"each",hash:{},fn:l.program(7,a,0,o,r),inverse:l.noop,data:a,loc:{start:{line:1,column:661},end:{line:1,column:776}}}))?u:"")+"</tr></thead>"+p((h(e,"$$WP$Components$Calendar$getCalendarObject")||n&&h(n,"$$WP$Components$Calendar$getCalendarObject")||s).call(i,null!=n?h(n,"ComponentNumber"):n,{name:"$$WP$Components$Calendar$getCalendarObject",hash:{},data:a,loc:{start:{line:1,column:789},end:{line:1,column:851}}}))+"</table></div> "},1:function(l,n,e,t,a){var o,r,u=null!=n?n:l.nullContext||{},c=l.hooks.helperMissing,i="function",s=l.escapeExpression,m=l.lookupProperty||function(l,n){if(Object.prototype.hasOwnProperty.call(l,n))return l[n]};return'<th id="calprev'+s(typeof(r=null!=(r=m(e,"componentNumber")||(null!=n?m(n,"componentNumber"):n))?r:c)===i?r.call(u,{name:"componentNumber",hash:{},data:a,loc:{start:{line:1,column:137},end:{line:1,column:156}}}):r)+'" title="'+s(typeof(r=null!=(r=m(e,"PrevTitle")||(null!=n?m(n,"PrevTitle"):n))?r:c)===i?r.call(u,{name:"PrevTitle",hash:{},data:a,loc:{start:{line:1,column:165},end:{line:1,column:178}}}):r)+'" class="'+s(typeof(r=null!=(r=m(e,"PrevClass")||(null!=n?m(n,"PrevClass"):n))?r:c)===i?r.call(u,{name:"PrevClass",hash:{},data:a,loc:{start:{line:1,column:187},end:{line:1,column:200}}}):r)+' calprev calnavbtn"><button data-id="calprev" href="#" aria-label="'+s(typeof(r=null!=(r=m(e,"PrevTitle")||(null!=n?m(n,"PrevTitle"):n))?r:c)===i?r.call(u,{name:"PrevTitle",hash:{},data:a,loc:{start:{line:1,column:267},end:{line:1,column:280}}}):r)+'">'+(null!=(o=typeof(r=null!=(r=m(e,"PrevButton")||(null!=n?m(n,"PrevButton"):n))?r:c)===i?r.call(u,{name:"PrevButton",hash:{},data:a,loc:{start:{line:1,column:282},end:{line:1,column:298}}}):r)?o:"")+"</button></th>"},3:function(l,n,e,t,a){return"<th></th>"},5:function(l,n,e,t,a){var o,r,u=null!=n?n:l.nullContext||{},c=l.hooks.helperMissing,i="function",s=l.escapeExpression,m=l.lookupProperty||function(l,n){if(Object.prototype.hasOwnProperty.call(l,n))return l[n]};return'<th  id="calnext'+s(typeof(r=null!=(r=m(e,"componentNumber")||(null!=n?m(n,"componentNumber"):n))?r:c)===i?r.call(u,{name:"componentNumber",hash:{},data:a,loc:{start:{line:1,column:453},end:{line:1,column:472}}}):r)+'" title="'+s(typeof(r=null!=(r=m(e,"NextTitle")||(null!=n?m(n,"NextTitle"):n))?r:c)===i?r.call(u,{name:"NextTitle",hash:{},data:a,loc:{start:{line:1,column:481},end:{line:1,column:494}}}):r)+'" class="'+s(typeof(r=null!=(r=m(e,"NextClass")||(null!=n?m(n,"NextClass"):n))?r:c)===i?r.call(u,{name:"NextClass",hash:{},data:a,loc:{start:{line:1,column:503},end:{line:1,column:516}}}):r)+' calnext calnavbtn"><button data-id="calnext" href="#" aria-label="'+s(typeof(r=null!=(r=m(e,"NextTitle")||(null!=n?m(n,"NextTitle"):n))?r:c)===i?r.call(u,{name:"NextTitle",hash:{},data:a,loc:{start:{line:1,column:583},end:{line:1,column:596}}}):r)+'">'+(null!=(o=typeof(r=null!=(r=m(e,"NextButton")||(null!=n?m(n,"NextButton"):n))?r:c)===i?r.call(u,{name:"NextButton",hash:{},data:a,loc:{start:{line:1,column:598},end:{line:1,column:614}}}):r)?o:"")+"</button></th>"},7:function(l,n,e,t,a,o,r){var u,c=l.lookupProperty||function(l,n){if(Object.prototype.hasOwnProperty.call(l,n))return l[n]};return'<th class="hdr dayHeading" '+(null!=(u=c(e,"if").call(null!=n?n:l.nullContext||{},null!=r[1]?c(r[1],"IsAriaHidden"):r[1],{name:"if",hash:{},fn:l.program(8,a,0,o,r),inverse:l.noop,data:a,loc:{start:{line:1,column:702},end:{line:1,column:751}}}))?u:"")+">"+(null!=(u=l.lambda(n,n))?u:"")+"</th>"},8:function(l,n,e,t,a){return' aria-hidden="true"'},useData:!0,useDepths:!0})}();;
/*! Copyright (c) Epic Systems Corporation 2014 - 2016 */
$$WPUtil.guaranteeExistence($$WP,"Components"),$$WP.Components.Calendar=function $$WPCal(e){var t,a,n,s;"undefined"!=typeof $$WP&&void 0!==$$WP.Strings&&($$WP.Strings.setDefaultNamespace("Global.Calendar"),$$WP.Strings.add("CalendarMonthTitleFormat","Jan"),$$WP.Strings.add("CalendarAudibleDate","_STR_AudibleDate_"),$$WP.Strings.add("HoverText",$$WP.Strings.get("SelectTooltip","UI.Calendar")),$$WP.Strings.add("HoverTextDisabled",$$WP.Strings.get("NotAvailableTooltip","UI.Calendar")),$$WP.Strings.add("NextButton",""),$$WP.Strings.add("PrevButton",""),$$WP.Strings.clearDefaultNamespace()),this.onSelect=e.onSelect||function(e){},this.TitleText=e.TitleText||"",this.Image=e.Image||"",this.filter=e.filter||function(){return!0},this.FromDTE=e.FromDTE,this.ToDTE=e.ToDTE,this.callback=e.callback||function(){},this.SelectedDate=e.SelectedDate,this.HighlightDays=e.HighlightDays||[],this.HasSelectableDays=!0===e.HasSelectableDays,this._calendarMouseover=e._calendarMouseover||this._calendarMouseover,this.IsClickEventEnabled=e.IsClickEventEnabled||!0,this.IsNextEnabled=e.IsNextEnabled||!1,this.IsPrevEnabled=e.IsPrevEnabled||!1,this.IsAriaHidden=e.IsAriaHidden||!1;for(var i=0;i<this.HighlightDays.length;i++)this.HighlightDays[i].length>0&&(a=(t=new Date(this.HighlightDays[i])).getMonth()+1,s=t.getDate(),n=t.getFullYear(),this.Dict[a+"/"+s+"/"+n]=!0,this.SelectableMonths[a+"/"+n]=!0);$$WP.Utilities.IsNullOrEmpty(this.SelectedDate)?this.Today=new Date:"function"==typeof this.SelectedDate.getYear?this.Today=this.SelectedDate:"string"==typeof this.SelectedDate.getYear?this.Today=new Date(this.SelectedDate):this.Today=new Date,this.Month=this.Today.getMonth(),this.Year=this.Today.getFullYear(),this.PrevButton=$$WP.Strings.get("PrevButton","Global.Calendar"),this.NextButton=$$WP.Strings.get("NextButton","Global.Calendar"),this.HoverText=$$WP.Strings.get("HoverText","Global.Calendar"),this.HoverTextDisabled=$$WP.Strings.get("HoverTextDisabled","Global.Calendar");for(var r=0;r<7;r++)this.Days[r]='<span class="clearlabel">'+getDayName((r+getFirstDayOfWeek())%7)+"</span>"+getDayLetter((r+getFirstDayOfWeek())%7);this.Components$TemplateComponent(e),this.addEventListener("click",this._calendarClick),this.addEventListener("focus",this._calendarFocus)},$$WP.Components.Calendar.prototype={Today:{},Title:"",Image:"",Summary:"",Class:"calendar",filter:"",FromDTE:"",ToDTE:"",Callback:"",SelectedDate:"",HoverText:"",HoverTextDisabled:"",Month:"",Year:"",Days:[],PrevButton:"",NextButton:"",HighlightDays:[],HasSelectableDays:"",Dict:{},SelectableMonths:{},data:{},IsClickEventEnabled:!0,IsNextEnabled:!1,IsPrevEnabled:!1,IsAriaHidden:!1,template:$$WP.Templates.Core.calendar,setData:function $$WP$Components$Calendar$set(){this.setTitles(),this.Components$TemplateComponent$setData(this.Data)},setTitles:function $$WP$Components$Calendar$title(){var e,t,a,n,s,i,r=this.Month,l=this.Year;this.hasSelectableDay(r,l),n=$$WP.I18N.monthTitleFormat(makeDate(l,r+1)),$$WP.Strings.setDefaultNamespace("UI.Calendar"),$$WP.Strings.addMnemonic("@MYCHART@DATEWITHMONTH@",$$WP.I18N.monthTitleFormat(makeDate(l,r))),e=$$WP.Strings.get("CalendarNextPrevMonthHelpText"),$$WP.Strings.removeMnemonic("@MYCHART@DATEWITHMONTH@"),$$WP.Strings.addMnemonic("@MYCHART@DATEWITHMONTH@",$$WP.I18N.monthTitleFormat(makeDate(l,r+2))),s=$$WP.Strings.get("CalendarNextPrevMonthHelpText"),$$WP.Strings.removeMnemonic("@MYCHART@DATEWITHMONTH@"),$$WP.Strings.clearDefaultNamespace(),t=this.IsPrevEnabled,i=this.IsNextEnabled,a=this.IsAriaHidden,this.Data={PrevClass:undefined,PrevButton:this.PrevButton,IsPrevEnabled:t,Title:n,PrevTitle:e,NextTitle:s,NextClass:undefined,NextButton:this.NextButton,IsNextEnabled:i,IsAriaHidden:a,Days:this.Days,ComponentNumber:this.ComponentNumber}},reInit:function $$WP$Components$Calendar$refresh(e){var t,a,n,s,i;if(e.HighlightDays)for(var r=0;r<e.HighlightDays.length;r++)(i=e.HighlightDays[r])&&i.length>0&&(a=(t=new Date(i)).getMonth()+1,s=t.getDate(),n=t.getFullYear(),this.Dict[a+"/"+s+"/"+n]=!0);this.setData(),this.refresh()},html:function(e){this.Components$Component$html(e),this.$content.find(".hasevents").safeAttr("data-id","hasevents")},_calendarClick:function $$WP$Components$Calendar$_click(e,t,a){this.IsClickEventEnabled&&("calnext"===e.dataId&&(this.drawNextMonth(),WP.Events.cancelEvent(e),WP.Events.preventDefault(e)),"calprev"===e.dataId&&(this.drawPreviousMonth(),WP.Events.cancelEvent(e),WP.Events.preventDefault(e)))},_calendarFocus:function $$WP$Components$Calendar$_focus(e,t){this.$$WP$Components$Calendar$_mouseover(e,t)},_isInCalendar:function $$WP$Components$Calendar$_isInCalendar(e){var t,a;for(a=e,t=0;a&&t<6;a=a.parentNode,t++)if(a&&a.id&&"calendar"===a.id.toLowerCase())return!0;return!1},setClickFunction:function $$WP$Components$Calendar$setClickFunction(e){var t,a,n,s=this.hoverText,i=this.hoverTextDisabled,r=this.clickFunction,l=e.getElementsByTagName("td"),o=new Date,d=document.all?"hand":"pointer",enable=function(e,t){WP.Events.addListener(e,"click",r),"ctrl"===e.className?(WP.Events.addListener(e,"mouseover",hi()),WP.Events.addListener(e,"mouseout",lo),WP.Events.addListener(e.firstChild,"focus",hi(!0)),WP.Events.addListener(e.firstChild,"blur",lo)):(WP.Events.addListener(e,"mouseover",(function(){e.firstChild.focus()})),WP.Events.addListener(e.firstChild,"focus",hi())),e.style.cursor=d,!0!==t&&(e.title=s)},disable=function(e){e.style.cursor="default",e.title=i};for(a=0;a<l.length;++a)"null"!==(n=(t=l[a]).className)&&"hdr"!==n&&t.firstChild&&("ctrl"===n?enable(t,!0):n.indexOf("othermonth")>0||0===n.indexOf("n")||0===n.indexOf("wkndn")||"ctrln"===n?disable(t):"today"!==n||this.filter(o.getFullYear(),o.getMonth(),o.getDate())?enable(t):disable(t))},drawNextMonth:function $$WP$Components$Calendar$drawNextMonth(){this.Month=(this.Month+1)%12,0===this.Month&&this.Year++,this.set()},drawPreviousMonth:function $$WP$Components$Calendar$drawPreviousMonth(){this.Month=this.Month-1,this.Month<0&&(this.Month+=12),11===this.Month&&this.Year--,this.getCalendarObject(),this.set()},hasSelectableDay:function $$WP$Components$Calendar$hasSelectableDay(e,t){var a=1,n=makeDate(t,e+1,a);for(e=n.getMonth();n.getMonth()===e;){if(this.filter(n.getFullYear(),n.getMonth(),a))return!0;n.setDate(++a)}return!1},getCalendarObject:function $$WP$Components$Calendar$getCalendarObject(e){var t,a,n,s,i,r=document.createElement("tbody"),l=this.Month,o=this.Year,d=new Date,h=d.getDate(),$=d.getMonth(),c=d.getFullYear(),g=WP.DOM.Create.tag,u=(this.hasSelectableDay(l,o),this.IsAriaHidden),D=this;d.setHours(0,0,0,0);var C,m,hasEvent=function(e,t,a,n){var s=e.getMonth(),i=e.getDate(),r=e.getFullYear();e.getDay();return!($$WP.Utilities.IsNullOrEmpty(a)||t||!a[s+1+"/"+i+"/"+r])},getClassName=function(e,t,a,n){var s,i=e.getMonth(),r=e.getDate(),o=e.getFullYear(),d="",g=e.getDay();if($$WP.Utilities.IsNullOrEmpty(a)||t||a[i+1+"/"+r+"/"+o]&&(d=" hasevents"),e<n)d+=" past";else if(i===l&&i===$&&r===h&&o===c)return"today"+d;return d+=t?" othermonth":"",s=0===g||6===g,D.filter(o,i,r)&&!t?(s?"wknd":"d")+d:(s?"wkndn":"n")+d};for((C=(a=makeDate(o,l+1,1)).getDay()-getFirstDayOfWeek())<0&&(C+=7),a.setDate(a.getDate()-C);a.getMonth()!==l+1&&a.getFullYear()<=o;){for(t=document.createElement("tr"),m=0;m<7;m++){i=a.getMonth()!==l;var P=hasEvent(a,i,this.Dict);!i&&this.filter(o,l,a.getDate())?(P?(s=WP.DOM.Create.anchoredNode(this.drawCalendarDate(a),!0,"")).className="haseventfocus selectableevent":s=this.drawCalendarDate(a),this.firstDate&&""!==this.firstDate||(this.firstDate=a.getDate()),(!this.lastDate||this.lastDate<a.getDate())&&(this.lastDate=a.getDate())):s=document.createTextNode(i?"":a.getDate()),n=g("td",getClassName(a,i,this.Dict,d),i?"":"cal_"+a.getFullYear()+"_"+a.getMonth()+"_"+a.getDate()),u&&!$afe.jq(n).hasClass("hasevents")&&n.setAttribute("aria-hidden","true"),P||$$WP.Utilities.IsNullOrEmpty(s)||i?n.appendChild(s):dangerou$.setHtml(n,s),t.appendChild(n),a.setDate(a.getDate()+1)}r.appendChild(t)}return r.innerHTML},drawCalendarDate:function $$WP$Components$Calendar$drawCalendarDate(e){return'<span class="clearlabel">'+$$WP.I18N.getCalendarDateAriaString(e)+"</span>"+'<span aria-hidden="true">'+e.getDate()+"</span>"}},Handlebars.registerHelper("$$WP$Components$Calendar$getCalendarObject",(function(e){return new Handlebars.SafeString($$WP.Components.getInstance(e).getCalendarObject())})),$$WP.Components.Calendar.extend("Components.TemplateComponent");;
/*! Copyright (c) Epic Systems Corporation 2015-2016 */
$$WPUtil.guaranteeExistence($$WP,"Containers"),$$WP.Containers.MultiMonthCalendar=function $$WP$Containers$MultiMonthCalendar(t){this.Containers$ContainerComponent(t),this.NumOfMonths=t.NumOfMonths||2,this.Class="multiMonthCalendar",this.Today=new Date,this.Month=this.Today.getMonth(),this.Year=this.Today.getFullYear(),this.IsAriaHidden=t.IsAriaHidden||!1;var n,e,a,s="SingleCalendar ";this.NumOfMonths<2?s+="full":this.NumOfMonths>2?s+="onethird":s+="half",n=this.Month,e=this.Year,a=this.IsAriaHidden;for(var i=0;i<this.NumOfMonths;i++){var o,r;o=!1,r=!1,0===i&&(r=!0),i===this.NumOfMonths-1&&(o=!0);var h=new $$WP.Components.Calendar({Class:s,Month:n,Year:e,IsClickEventEnabled:!1,IsNextEnabled:o,IsPrevEnabled:r,IsAriaHidden:a});0===(n=(n+1)%12)&&e++,this.CalendarComponents[i]=h,this.addComponent(this.CalendarComponents[i]),this.CalendarComponents[i].show()}this.Containers$ContainerComponent(t),this.addEventListener("click",this._calendarClick)},$$WP.Containers.MultiMonthCalendar.prototype={Today:{},NumOfMonths:0,Month:"",Year:"",CalendarComponents:[],Class:"multiMonthCalendar",MonthsMap:{},HighlightDays:[],data:{},IsAriaHidden:!1,setData:function $$WP$Containers$MultiMonthCalendar$set(t){for(var n=0;n<this.NumOfMonths;n++){this.CalendarComponents[n].Data=t;var e=this.CalendarComponents[n].settings||{};e.HighlightDays=t.HighlightDays,this.CalendarComponents[n].reInit(e)}this.MonthsMap=t.MonthsMap||{},this.MonthsMap&&this.setToolbarButtons()},setToolbarButtons:function $$WP$Containers$MultiMonthCalendar$setToolbarButtons(){var t,n,e,a,s,i,o,r=[];t=this.Month,n=this.Year,0===(t=(t+1)%12)&&n++,this.getFormattedMonthID(t,n),s=this.getPreviousEvent(),i=this.getNextEvent(),$$WP.Strings.setDefaultNamespace("clinical.todo"),s&&(o=new Date(this.MonthsMap[s].EndEvent.EventDate),$$WP.Strings.addMnemonic("@MYCHART@APPTTITLE@",this.MonthsMap[s].EndEvent.EventName),$$WP.Strings.addMnemonic("@MYCHART@APPTMONTH@",getMonthAbbr(o.getMonth()+1)),$$WP.Strings.addMnemonic("@MYCHART@APPTDATE@",o.getDate()),$$WP.Strings.addMnemonic("@MYCHART@APPTYEAR@",o.getFullYear()),e=$$WP.Strings.getForTemplate("calendarnextandpreveventtitle"),$$WP.Strings.removeMnemonic("@MYCHART@APPTTITLE@"),$$WP.Strings.removeMnemonic("@MYCHART@APPTMONTH@"),$$WP.Strings.removeMnemonic("@MYCHART@APPTDATE@"),$$WP.Strings.removeMnemonic("@MYCHART@APPTYEAR@"),r.push(new $$WPComp.ComplexObjects.Button(e,"","calendarBackEventBtn calendarBtns tertiary neutral",s))),i&&(o=new Date(this.MonthsMap[i].StartEvent.EventDate),$$WP.Strings.addMnemonic("@MYCHART@APPTTITLE@",this.MonthsMap[i].StartEvent.EventName),$$WP.Strings.addMnemonic("@MYCHART@APPTMONTH@",getMonthAbbr(o.getMonth()+1)),$$WP.Strings.addMnemonic("@MYCHART@APPTDATE@",o.getDate()),$$WP.Strings.addMnemonic("@MYCHART@APPTYEAR@",o.getFullYear()),a=$$WP.Strings.getForTemplate("calendarnextandpreveventtitle"),$$WP.Strings.removeMnemonic("@MYCHART@APPTTITLE@"),$$WP.Strings.removeMnemonic("@MYCHART@APPTMONTH@"),$$WP.Strings.removeMnemonic("@MYCHART@APPTDATE@"),$$WP.Strings.removeMnemonic("@MYCHART@APPTYEAR@"),r.push(new $$WPComp.ComplexObjects.Button(a,"","calendarNextEventBtn calendarBtns tertiary neutral",i))),$$WP.Strings.clearDefaultNamespace(),this.setToolbar(r)},getPreviousEvent:function $$WP$Containers$MultiMonthCalendar$getPreviousEvent(){var t,n,e,a,s;for(var i in n=this.Month,e=this.Year,t="",this.getFormattedMonthID(n,e),this.MonthsMap)if(this.MonthsMap.hasOwnProperty(i)){var o=i.split("_");if(o.length>=0)if(a=parseInt(o[0],10),s=parseInt(o[1],10),e>a)t=i;else{if(e!==a)break;if(!(n>s))break;t=i}}return""!==t?t:null},getNextEvent:function $$WP$Containers$MultiMonthCalendar$getNextEvent(){var t,n,e,a,s;e=this.Month,t=this.Year,n=!1;for(var i=0;i<this.NumOfMonths;i++)0===(e=(e+1)%12)&&t++;for(var o in"",this.getFormattedMonthID(e,t),this.MonthsMap)if(this.MonthsMap.hasOwnProperty(o)){var r=o.split("_");if(r.length>=0&&(a=parseInt(r[0],10),s=parseInt(r[1],10),t<=a&&(n=!0,t===a&&(n=e<=s)),n))return o}return null},moveCalendarMonths:function $$WP$Containers$MultiMonthCalendar$moveCalendarMonths(t,n){for(var e=0;e<this.NumOfMonths;e++)this.CalendarComponents[e].Month=t,this.CalendarComponents[e].Year=n,0===(t=(t+1)%12)&&n++,this.CalendarComponents[e].setTitles(),this.CalendarComponents[e].refresh();this.setToolbarButtons()},_calendarClick:function $$WP$Containers$MultiMonthCalendar$_calendarClick(t){var n,e,a,s=!1;if("calnext"===t.dataId?(this.Month=(this.Month+1)%12,0===this.Month&&this.Year++,n=this.Month,e=this.Year,this.moveCalendarMonths(n,e),t.preventDefault(),this.$container.find('[data-id="calnext"]').focus()):"calprev"===t.dataId?(this.Month=this.Month-1,this.Month<0&&(this.Month+=12),11===this.Month&&this.Year--,n=this.Month,e=this.Year,this.moveCalendarMonths(n,e),t.preventDefault(),s=!0):-1!==t.target.className.indexOf("calendarNextEventBtn")?(a="",t.dataId&&(a=t.dataId.substring(7)),a.length>5&&(e=a.substring(0,4),n=a.substring(5,a.length)),e&&n&&(e=parseInt(e,10),n=parseInt(n,10),(n-=this.NumOfMonths-1)<0&&(n+=12,e--),this.Month=n,this.Year=e,this.moveCalendarMonths(n,e)),t.preventDefault(),s=!0):-1!==t.target.className.indexOf("calendarBackEventBtn")&&(a="",t.dataId&&(a=t.dataId.substring(7)),a.length>5&&(e=a.substring(0,4),n=a.substring(5,a.length)),e&&n&&(e=parseInt(e,10),n=parseInt(n,10),this.Month=n,this.Year=e,this.moveCalendarMonths(n,e)),t.preventDefault(),s=!0),s)return this.$container.find("button").first().focus(),!1},getFormattedMonthID:function $$WP$Containers$MultiMonthCalendar$getFormattedMonthID(t,n){return n+"_"+t}},$$WP.Containers.MultiMonthCalendar.extend("Containers.ContainerComponent");;
var _dateChooser,formatCalendarDate=buildFormat("dddd MMMM d yyyy"),keyCode={TAB:9,ESC:27,PAGEUP:33,PAGEDOWN:34,END:35,HOME:36,LEFT:37,UP:38,RIGHT:39,DOWN:40},landscapeCutoffHeight=460;window.EpicPx=window.EpicPx||{},window.EpicPx.MobileIntegration=window.EpicPx.MobileIntegration||{};var cachedOnMobileBack=void 0,cachedOnMobileClose=void 0;function callback(e,t,a){document.forms[0].year.value=e,document.forms[0].month.value=getMonthName(t+1),document.forms[0].day.value=a}function createClickFunction(e){return function f(t){for(var a,n=WP.Events.getThis(t);"TD"!==n.nodeName.toUpperCase();)n=n.parentNode;if("calnext"===(a=n.id||n.getAttribute("name")))return _dateChooser.drawNextMonth(),WP.Events.cancelEvent(t),WP.Events.preventDefault(t),!1;if("calprev"===a)return _dateChooser.drawPreviousMonth(),WP.Events.cancelEvent(t),WP.Events.preventDefault(t),!1;if("calcancel"!==a){var o=a.replace("cal",""),r=makeDate(_dateChooser.year,_dateChooser.month+1,o);return r.getMonth()!=_dateChooser.month?(_dateChooser.year=r.getFullYear(),_dateChooser.month=r.getMonth(),_dateChooser.date=r.getDate()):_dateChooser.date=o,$afe.select(".currentselected").removeClass("currentselected"),$afe.jq(n).addClass("currentselected"),e.call(_dateChooser,_dateChooser.year,_dateChooser.month,_dateChooser.date,_dateChooser.input),_dateChooser.clearCalendar(),WP.Events.cancelEvent(t),WP.Events.preventDefault(t),!1}_dateChooser.clearCalendar()}}function DateChooser(e,t,a,n,o){this.trigger=e,this.callback=t,this.input=o,this.filter=a||function(){return!0},n&&"function"==typeof n.getYear?this.today=n:"string"==typeof n?(this.today=new Date(n),isNaN(this.today)&&(this.today=new Date)):this.today=new Date,this.month=this.today.getMonth(),this.year=this.today.getFullYear(),this.date=this.today.getDate(),this.calendar=null,this.clickFunction=createClickFunction(t)}function isInCalendar(e){var t,a;for(a=e,t=0;a&&t<8;a=a.parentNode,t++)if(a&&a.id&&"calendar"===a.id.toLowerCase())return!0;return!1}function lo(e){for(var t=WP.Events.getThis(e);"TD"!==t.nodeName.toUpperCase();)t=t.parentNode;$afe.jq(t).removeClass("hi")}function hi(e,t){return function(a){var n=WP.Events.getThis(a);if(t)for(;"DIV"!==n.nodeName.toUpperCase();)n=n.parentNode;else for(;"TD"!==n.nodeName.toUpperCase();)n=n.parentNode;$afe.jq(n).addClass("hi"),$afe.jq(n).hasClass("ctrl")&&!e||!_dateChooser.focusOn||_dateChooser.focusOn===n.id||(document.getElementById(_dateChooser.focusOn)&&lo({target:document.getElementById(_dateChooser.focusOn),srcElement:document.getElementById(_dateChooser.focusOn)}),_dateChooser.focusOn=n.id)}}function ctrlMouseDown(e){_dateChooser.mouseDown=!0}function ctrlFocus(e){_dateChooser.mouseDown?(_dateChooser.redrawn&&(_dateChooser.mouseDown=!1,_dateChooser.redrawn=!1),hi()(e)):(_dateChooser.redrawn=!1,hi(!0)(e))}function restoreHi(e){var t,a,n=WP.Events.getThis(e);n&&"calendar"!==n.className&&!isInCalendar(n)&&(a=$afe.select(".currentselected"),_dateChooser.focusOn&&(a.length>0?document.getElementById(a[0].id).firstChild.focus():((t=document.getElementById(_dateChooser.focusOn)).firstChild&&t.firstChild.blur(),lo({target:t,srcElement:t}))))}function _removeCalendar(e){var t=$afe.select("#calendar"),a=$afe.select(".calendarshield");e||(window.EpicPx.MobileIntegration.onMobileBack=cachedOnMobileBack,window.EpicPx.MobileIntegration.onMobileClose=cachedOnMobileClose),t.length>0&&(WP.Events.removeListener(document.body,"click",removeCalendar),WP.Events.removeListener(document.body,"mouseover",restoreHi),$afe.jq(window).off("orientationchange resize",handleOrientationChange),checkIfMobile()&&$$WP.Utilities.UI.ToggleBodyScrolling(!1),accessibilityRestorePage(),t.remove(),a.remove(),_dateChooser=null)}function removeCalendar(e){var t=WP.Events.getThis(e);t&&"calendar"!==t.className&&!isInCalendar(t)&&_removeCalendar()}function removeCalendarExternal(){_removeCalendar()}function keyOnPrevMonth(e){var t;if(9===e.keyCode)return e.shiftKey?((t=document.getElementById("calcancel").firstChild)&&"BUTTON"===t.nodeName.toUpperCase()?t.focus():document.getElementById("cal"+_dateChooser.lastDate).firstChild.focus(),WP.Events.preventDefault(e)):void 0;13===e.keyCode&&(_dateChooser.wasEnter=!0)}function keyOnNextMonth(e){var t;if(9===e.keyCode)return!e.shiftKey||(t=document.getElementById("calprev").firstChild)&&"BUTTON"===t.nodeName.toUpperCase()?void 0:((t=document.getElementById("calcancel").firstChild)&&"BUTTON"===t.nodeName.toUpperCase()?t.focus():document.getElementById("cal"+_dateChooser.lastDate).firstChild.focus(),WP.Events.preventDefault(e));13===e.keyCode&&(_dateChooser.wasEnter=!0)}function tabOnCancel(e){var t;if(9===e.keyCode){if(e.shiftKey)return;return(t=document.getElementById("calprev").firstChild)&&"BUTTON"===t.nodeName.toUpperCase()||(t=document.getElementById("calnext").firstChild)&&"BUTTON"===t.nodeName.toUpperCase()?t.focus():document.getElementById("cal"+_dateChooser.firstDate).firstChild.focus(),WP.Events.preventDefault(e)}}function checkIfMobile(){return document.documentElement.className.indexOf("mobile")>=0||document.documentElement.className.indexOf("respquestionnaire")>=0}function checkIfPopup(){var e=document.getElementById("appPopupRoot"),t=!1;null!=e&&(t=1==e.getElementsByClassName("_PopupContainer").length);return t||1==document.getElementsByClassName("Popup").length}function handleOrientationChange(){var e=document.getElementById("calendar");this.positionCalendar(this._dateChooser.trigger,e);var t=checkIfMobile();"orientationchange"!==window.event.type||t||scrollCalendarIntoView()}function scrollCalendarIntoView(){var e=document.getElementById("calendar");setTimeout((function(){e.scrollIntoView({behavior:"smooth",block:"start"})}),600)}function positionCalendar(e,t){var a=checkIfPopup(),n=checkIfMobile();if(e.offsetParent||(e=document.getElementById(e.id)),e.offsetParent){if(t.style.position="absolute",pos=getElementPosition(e),topElement=pos.topElement,topElement.appendChild(t),$$WPContain.Popup.__zIndex+=3,t.style.zIndex=3e3+$$WPContain.Popup.__zIndex,t.style.left=pos.x,t.style.top=pos.y,datatileContainer=$afe.select("html.datatile")[0],popupContainer=$afe.jq(e).parents(".Popup")[0],defaultContainer=document.getElementById("main"),container=popupContainer||datatileContainer||defaultContainer,containerOffsetWidth=container.offsetWidth,containerOffsetHeight=container.offsetHeight,pos=getElementPosition(e,container),t.offsetWidth){var o=parseInt(t.style.left,10);overflow=parseInt(pos.x,10)+t.offsetWidth-containerOffsetWidth,overflow>0&&(overflow<o?t.style.left=o-overflow+"px":t.style.left="0px")}if(t.offsetHeight){var r=parseInt(t.style.top,10);overflow=parseInt(pos.y,10)+t.offsetHeight-containerOffsetHeight,overflow>0&&(overflow<r?t.style.top=r-overflow+"px":t.style.top="0px");var s=document.body.clientHeight;s<landscapeCutoffHeight&&(t.style.top=s/3+"px")}if(a&&!n){t.style.position="fixed";var i=e.getBoundingClientRect(),d=i.top,l=i.left,c=window.innerHeight-d-t.offsetHeight,h=window.innerWidth-l-t.offsetWidth;t.style.top=c<0?d+c+"px":d+"px",t.style.left=h<0?l+h+"px":l+"px"}n&&(t.style.left="50%",t.style.position="fixed",t.style.top="50%")}else $afe.jq(e.parentNode).safeInsertBefore(t,this.trigger),$afe.jq(e).addClass("hidden")}function HandleKeyUp(e){e.keyCode==keyCode.ESC&&(e.stopPropagation(),e.preventDefault(),_dateChooser.clearCalendar())}function HandleKeyDown(e){for(var t=!1,a=document.activeElement;"TD"!==a.nodeName.toUpperCase();)a=a.parentNode;var n=a.id||a.getAttribute("name");if(a.className.indexOf("ctrl")<0){var o=n.replace("cal","");switch(e.keyCode){case keyCode.RIGHT:moveFocusByDay(o,1),t=!0;break;case keyCode.LEFT:moveFocusByDay(o,-1),t=!0;break;case keyCode.DOWN:moveFocusByDay(o,7),t=!0;break;case keyCode.UP:moveFocusByDay(o,-7),t=!0;break;case keyCode.PAGEDOWN:moveFocusByMonth(o,1),t=!0;break;case keyCode.PAGEUP:moveFocusByMonth(o,-1),t=!0;break;case keyCode.HOME:moveFocusToFirstDayOfWeek(o),t=!0;break;case keyCode.END:moveFocusToLastDayOfWeek(o),t=!0;break;case keyCode.ESC:t=!0}a=document.activeElement,null!==_dateChooser&&"0"==a.tabIndex&&(_dateChooser.focusOn=a.parentElement.id),t&&(e.stopPropagation(),e.preventDefault())}}function moveFocusToFirstDayOfWeek(e){var t=_dateChooser.year,a=_dateChooser.month,n=new Date(t,a,e).getDay()-getFirstDayOfWeek(),o=e-(n=n<0?n+7:n);document.getElementById("cal"+o).firstChild.focus()}function moveFocusToLastDayOfWeek(e){var t=_dateChooser.year,a=_dateChooser.month,n=new Date(t,a,e).getDay()-getFirstDayOfWeek();n=n<0?-1-n:6-n;var o=parseInt(e)+n;document.getElementById("cal"+o).firstChild.focus()}function moveFocusByDay(e,t){var a=_dateChooser.year,n=_dateChooser.month,o=parseInt(e)+t,r=new Date(a,n,o),s=r.getMonth(),i=r.getFullYear();t>0&&(s>n||i>a)?hasSelectableDay(s,i)?_dateChooser.drawNextMonth(r.getDate()):_dateChooser.isDateDisplayed(o)&&document.getElementById("cal"+o).firstChild.focus():t<0&&(s<n||i<a)?hasSelectableDay(s,i)?_dateChooser.drawPreviousMonth(r.getDate()):_dateChooser.isDateDisplayed(o)&&document.getElementById("cal"+o).firstChild.focus():document.getElementById("cal"+o).firstChild.focus()}function moveFocusByMonth(e,t){e=parseInt(e);var a=_dateChooser.year,n=_dateChooser.month,o=new Date(a,n,e).getDate();1==t&&e<=0||-1==t&&e>_dateChooser.lastDateOfMonth?(o=o>_dateChooser.lastDateOfMonth?_dateChooser.lastDateOfMonth:o,document.getElementById("cal"+o).firstChild.focus()):hasSelectableDay(n+t,a)?1==t?_dateChooser.drawNextMonth(o):-1==t&&_dateChooser.drawPreviousMonth(o):1==Math.abs(t)&&(o=1===t?o+new Date(a,n+1,0).getDate():o-new Date(a,n,0).getDate(),_dateChooser.isDateDisplayed(o)&&document.getElementById("cal"+o).firstChild.focus())}function buildNavHeaderObject(e,t){var a=WP.DOM.Create.tag,n=$$WP.Strings.get("PrevButtonTooltip","UI.Calendar"),o=$$WP.Strings.get("NextButtonTooltip","UI.Calendar"),r=$$WP.Strings.get("PrevButtonOverride","UI.Calendar"),s=$$WP.Strings.get("NextButtonOverride","UI.Calendar");""===r&&(r="&laquo;"),""===s&&(s="&raquo");var i,d,l=!hasSelectableDay(e,t),c=document.createElement("nav"),h=a("table","calendarheader",""),u=document.createElement("thead"),m=document.createElement("tr");return h.setAttribute("role","presentation"),hasSelectableDay(e-1,t)||l?(i=a("td","ctrl"+(hasSelectableDay(e-1,t)||l?"":"n"),"calprev",n),d=a("button","","","",r),i.appendChild(d),d.setAttribute("aria-label",n)):(i=a("td","ctrl"+(hasSelectableDay(e-1,t)||l?"":"n"),"calprev",$$WP.I18N.monthTitleFormat(makeDate(t,e)),""),(d=a("button","","","",r)).setAttribute("aria-disabled","true"),d.setAttribute("aria-label",n),d.style.cursor="default",i.appendChild(d)),m.appendChild(i),m.appendChild(a("th","hdr calmonth","monthlabel","",$$WP.I18N.monthTitleFormat(makeDate(t,e+1)))),m.lastChild.colSpan=5,hasSelectableDay(e+1,t)||l?(i=a("td","ctrl"+(hasSelectableDay(e+1,t)||l?"":"n"),"calnext",o),d=a("button","","","",s),i.appendChild(d),d.setAttribute("aria-label",o)):(i=a("td","ctrl"+(hasSelectableDay(e+1,t)||l?"":"n"),"calnext",$$WP.I18N.monthTitleFormat(makeDate(t,e+2)),""),(d=a("button","","","",s)).setAttribute("aria-label",o),d.setAttribute("aria-disabled","true"),d.style.cursor="default",i.appendChild(d)),c.appendChild(h),h.appendChild(u),u.appendChild(m),m.appendChild(i),c}function dfltClndrCallbackFactory(e){return function(t,a,n){var o=document.getElementById(e);o&&(o.holdErrors=!1,o.openingCalendar=!1,t&&!isNaN(a)&&a>-1&&a<12&&n&&(o.value=formatDate(new Date(t,a,n)),_dateChooser.today=parseDate(o.value,!0),WP.Events.fireEvent(o,"change"),o.focus()))}}function textBoxDataChooser(e,t,a,n){var o,r,s,i;r=document.getElementById(t),"string"==typeof n&&n.length>0?o=window[n](t):"function"==typeof n&&(o=n),"function"!=typeof o&&(o=dfltClndrCallbackFactory(t)),i=$afe.jq(r).safeAttr("data-focus-dte"),""!==r.value?s=parseDate(r.value,!0):void 0!==i&&(s=WP.Utils.dte2date(i)),new DateChooser(e,o,WP.Validators.Calendar[a],s,r).drawCalendar()}function writeCalendar(e,t,a,n,o,r,s,i){var d,l;"string"==typeof e&&(e=$afe.select("#"+e)),d=$afe.jq(createElement("button","calendar datechooserAnchor")),$$WPUtil.IsNullOrEmpty(i)||d.safeAttr("id",i),d.safeAttr("type","button"),l=$afe.select('label[for="'+e.attr("id")+'"]').text(),$$WPUtil.IsNullOrEmpty(l)&&(l=$$WP.Strings.get("DefaultFieldDescription","UI.Calendar")),$$WP.Strings.addMnemonic("@MYCHART@AssociatedLabelText@",l,!1,"UI.Calendar",$$WP.Strings.EncodingTypes.HTML),d.safeAttr("aria-label",HTMLUnencode($$WP.Strings.get("DatePickerDescription","UI.Calendar"))),d.safeAppend($$WP.SimpleTemplates.Img({src:a,"aria-hidden":"true",focusable:"false",alt:HTMLUnencode($$WP.Strings.get("DatePickerDescription","UI.Calendar"))})),$$WP.Strings.removeMnemonic("@MYCHART@AssociatedLabelText@","UI.Calendar"),"range"===t&&($$WPUtil.IsNullOrEmpty(n)||(window.cachedStartDate=WP.Utils.dte2date(n)),$$WPUtil.IsNullOrEmpty(o)||(window.cachedEndDate=WP.Utils.dte2date(o))),d.click((function(){return e.prop("openingCalendar",!0),e.prop("holdErrors",!1),textBoxDataChooser(d[0],e.prop("id"),t,r),!1})).on("mousedown",(function(){e.prop("holdErrors",!0)})).on("mouseout",(function(){e.prop("holdErrors",!1),e.prop("openingCalendar",!1)})),d.safeInsertAfter(e)}function clearCalendarDateRange(){window.cachedStartDate=null,window.cachedEndDate=null}function hasSelectableDay(e,t){var a=1,n=makeDate(t,e+1,a);for(e=n.getMonth();n.getMonth()===e;){if(_dateChooser.filter(n.getFullYear(),n.getMonth(),a))return!0;n.setDate(++a)}return!1}function pageLo(e){for(var t=WP.Events.getThis(e);"DIV"!==t.nodeName.toUpperCase();)t=t.parentNode;$afe.jq(t).removeClass("hover")}function pageHi(){return function(e){for(var t=WP.Events.getThis(e);"DIV"!==t.nodeName.toUpperCase();)t=t.parentNode;$afe.jq(t).addClass("hover"),_dateChooser.focusOn&&_dateChooser.focusOn!==t.id&&pageLo({target:document.getElementById(_dateChooser.focusOn),srcElement:document.getElementById(_dateChooser.focusOn)}),_dateChooser.focusOn=t.id}}function pageCalendarEffects(){var e,t,a,n;if(null!==(e=document.getElementById("pagecalendar"))&&(_dateChooser=function(){},null!==(t=e.getElementsByTagName("div"))))for(a=0;a<t.length;a++)n=t[a],($afe.jq(n).hasClass("NoData")||$afe.jq(n).hasClass("EditData")||$afe.jq(n).hasClass("ctrl"))&&(WP.Events.addListener(n,"mouseover",(function(){this.firstChild.focus()})),WP.Events.addListener(n,"mouseout",(function(){this.firstChild.blur()})),WP.Events.addListener(n.firstChild,"focus",pageHi()),WP.Events.addListener(n.firstChild,"blur",pageLo))}function accessibilityHidePage(){var e=accessibilityGetElements();for(i=0;i<e.length;i++)e[i]&&e[i].setAttribute("aria-hidden","true")}function accessibilityRestorePage(){var e=accessibilityGetElements();for(i=0;i<e.length;i++)e[i]&&e[i].removeAttribute("aria-hidden")}function accessibilityGetElements(){var e=[document.getElementById("header"),document.getElementById("footer"),document.getElementById("content")];if(WP.DOM.Browser.isSafari||WP.DOM.Browser.isIPhone||WP.DOM.Browser.isIPad||WP.DOM.Browser.isIPod){var t=$afe.jq(_dateChooser.trigger).parents(".Popup, ._Popup");t.length>0&&e.push(t[0])}return e}DateChooser.prototype.drawCalendar=function(e){e=void 0===e?null:e,_removeCalendar(!0),_dateChooser=this;var t,a,n,o=document.createElement("div");n=new Date,o.id="calendar",o.className="calendar",o.setAttribute("role","dialog"),o.setAttribute("aria-modal","true"),o.setAttribute("aria-labelledby","monthlabel"),this.lastDayOfMonth=new Date(this.year,this.month+1,0),this.lastDateOfMonth=this.lastDayOfMonth.getDate();var r=getFirstDayOfWeek(),s=this.lastDayOfMonth.getDay()-r;if(this.lastDisplayedDateId=s>=0?this.lastDateOfMonth-s+6:this.lastDateOfMonth-s+7,s=new Date(this.year,this.month,1).getDay()-r,this.firstDisplayedDateId=s>=0?1-s:-s-6,o.appendChild(this.getCalendarObject()),this.setClickFunction(o),positionCalendar(this.trigger,o),t=checkIfMobile(),a=checkIfPopup(),t){var i=document.createElement("div");i.className="calendarshield",i.setAttribute("tabindex","-1");var d=$afe.select("._PopupContainer");a&&d.length>0?document.getElementsByClassName("_PopupContainer")[0].appendChild(i):document.body.appendChild(i),$afe.select(".calendarshield").css({"z-index":o.style.zIndex-1})}var l=$afe.select(".currentselected");l.removeClass("currentselect"),this.calendar=o,WP.Events.addListener(document.body,"click",removeCalendar),WP.Events.addListener(document.body,"mouseover",restoreHi),$afe.jq(window).on("orientationchange resize",handleOrientationChange),cachedOnMobileBack=window.EpicPx.MobileIntegration.onMobileBack,cachedOnMobileClose=window.EpicPx.MobileIntegration.onMobileClose,window.EpicPx.MobileIntegration.onMobileBack=_removeCalendar,window.EpicPx.MobileIntegration.onMobileClose=_removeCalendar,null!=e?(e=e>this.lastDateOfMonth?this.lastDateOfMonth:e,document.getElementById("cal"+e).firstChild.focus()):0!==l.length?(document.getElementById(l[0].id).firstChild.focus(),this.focusOn=l[0].id):this.month===this.today.getMonth()&&this.year===this.today.getFullYear()&&document.getElementById("cal"+n.getDate())?(document.getElementById("cal"+this.date).firstChild.focus(),this.focusOn="cal"+this.date):document.getElementById("cal"+this.firstDate)&&(document.getElementById("cal"+this.firstDate).firstChild.focus(),this.focusOn="cal"+this.firstDate),WP.Events.addListener(document.getElementById("calprev"),"keydown",keyOnPrevMonth),WP.Events.addListener(document.getElementById("calnext"),"keydown",keyOnNextMonth),WP.Events.addListener(document.getElementById("calcancel"),"keydown",tabOnCancel),accessibilityHidePage(),this.firstDate="",this.lastDate="",t&&$$WP.Utilities.UI.ToggleBodyScrolling(!0),$afe.jq(window).on("orientationchange resize",handleOrientationChange)},DateChooser.prototype.clearCalendar=function(){_removeCalendar(),this.callback(),this.trigger.className=this.trigger.className.replace(" hidden",""),this.trigger.focus()},DateChooser.prototype.setClickFunction=function(e){var t,a,n,o=this.clickFunction,r=e.getElementsByTagName("td"),s=(new Date,document.all?"hand":"pointer"),enable=function(e){WP.Events.addListener(e,"click",o),"ctrl"===e.className?(WP.Events.addListener(e,"mouseover",hi()),WP.Events.addListener(e,"mouseout",lo),WP.Events.addListener(e,"mousedown",ctrlMouseDown),WP.Events.addListener(e.firstChild,"focus",ctrlFocus),WP.Events.addListener(e.firstChild,"blur",lo)):(WP.Events.addListener(e,"mouseover",(function(){e.firstChild.focus()})),WP.Events.addListener(e.firstChild,"focus",hi())),e.style.cursor=s},disable=function(e){e.style.cursor="default"};for(a=0;a<r.length;++a)"null"!==(n=(t=r[a]).className)&&"hdr"!==n&&t.firstChild&&("ctrl"===n?enable(t):n.indexOf("wkndn")>=0||0===n.indexOf("n")||n.indexOf("ctrln")>=0?disable(t):enable(t));WP.Events.addListener(e,"keydown",HandleKeyDown),WP.Events.addListener(e,"keyup",HandleKeyUp)},DateChooser.prototype.isDateDisplayed=function(e){return e>=this.firstDisplayedDateId&&e<=this.lastDisplayedDateId},DateChooser.prototype.drawNextMonth=function(e){if(e=void 0===e?null:e,this.clearCalendar(),this.month=(this.month+1)%12,0===this.month&&this.year++,this.drawCalendar(e),e){0!==(t=$afe.select(".currentselected")).length&&t[0].id!==_dateChooser.focusOn&&lo({target:document.getElementById(t[0].id),srcElement:document.getElementById(t[0].id)})}else{var t,a=document.getElementById("calnext");if(null!==a)if((a=a.firstChild)&&"BUTTON"===a.nodeName.toUpperCase())a.focus(),0!==(t=$afe.select(".currentselected")).length&&t[0].id===_dateChooser.focusOn||lo({target:document.getElementById(_dateChooser.focusOn),srcElement:document.getElementById(_dateChooser.focusOn)});document.getElementsByClassName("calendarwrapper")[0].scroll({top:0,left:0})}},DateChooser.prototype.drawPreviousMonth=function(e){if(e=void 0===e?null:e,this.clearCalendar(),this.month=this.month-1,this.month<0&&(this.month+=12),11===this.month&&this.year--,this.drawCalendar(e),e){0!==(t=$afe.select(".currentselected")).length&&t[0].id!==_dateChooser.focusOn&&lo({target:document.getElementById(t[0].id),srcElement:document.getElementById(t[0].id)})}else{var t,a=document.getElementById("calprev").firstChild;if(a&&"BUTTON"===a.nodeName.toUpperCase())a.focus(),0!==(t=$afe.select(".currentselected")).length&&t[0].id===_dateChooser.focusOn||lo({target:document.getElementById(_dateChooser.focusOn),srcElement:document.getElementById(_dateChooser.focusOn)});document.getElementsByClassName("calendarwrapper")[0].scroll({top:0,left:0})}},DateChooser.prototype.getCalendarObject=function(){var e,t,a,n,o,r=document.createElement("div"),s=document.createElement("tbody"),i=this.month,d=this.year,l=this.filter,c=new Date,h=c.getDate(),u=c.getMonth(),m=c.getFullYear(),p=WP.DOM.Create.tag,C=$$WP.Strings.get("CancelButton","UI.Calendar");r.className="calendarflexbox";var g=document.createElement("div");g.className="calendarwrapper";var y,v=buildNavHeaderObject(i,d);for(r.appendChild(v),e=document.createElement("table"),thead=document.createElement("thead"),t=document.createElement("tr"),o=0;o<7;o++)a=p("th","hdr","","",getDayLetter((o+getFirstDayOfWeek())%7)),$afe.jq(a).safeAttr("aria-hidden","true"),t.appendChild(a);thead.appendChild(t),e.appendChild(thead);for(var D,getClassName=function(e,t){var a,n,o=e.getMonth(),r=e.getDate(),s=e.getFullYear(),i=e.getDay();return a=0===i||6===i,n=o===u&&r===h&&s===m,(l(s,o,r)?a?"wknd":"d":a?"wkndn":"n")+(n?" today":"")+(t?" othermonth":"")},E=this.firstDisplayedDateId,b=new Date(d,i,E);b.getMonth()!==i+1&&b.getFullYear()<=d;){for(t=document.createElement("tr"),D=0;D<7;D++)y=b.getMonth()!==i,a=p("td",getClassName(b,y),"cal"+E),(n=p("button","","","",b.getDate())).setAttribute("aria-label",$$WP.I18N.getCalendarDateAriaString(b)),this.filter(b.getFullYear(),b.getMonth(),b.getDate())?(n.setAttribute("tabindex","0"),y||(this.firstDate&&""!==this.firstDate||(this.firstDate=b.getDate()),(!this.lastDate||this.lastDate<b.getDate())&&(this.lastDate=b.getDate()))):(n.setAttribute("tabindex","-1"),n.setAttribute("aria-disabled","true"),n.style.cursor="default"),a.appendChild(n),b.getTime()===_dateChooser.today.getTime()&&(applyClass(a,"currentselected"),applyClass(a,"hi")),t.appendChild(a),b.setDate(b.getDate()+1),E++;s.appendChild(t)}e.setAttribute("role","presentation"),e.appendChild(s),g.appendChild(e),r.appendChild(g);var P=p("div");return e=p("table","calendarfooter",""),s=p("tbody"),t=document.createElement("tr"),a=p("td","ctrl","calcancel"),n=p("button","","","",C),a.appendChild(n),t.appendChild(a),s.appendChild(t),e.appendChild(s),P.appendChild(e),r.appendChild(P),e.setAttribute("role","presentation"),t.firstChild.colSpan=7,r},$$WP.Utilities.UI.Calendars=function $$WP$Utilities$UI$Calendars(e){"load"===e.type&&$afe.select("input.date.withCalendar").each((function(){var e=$afe.jq(this);e.next().is("button.datechooserAnchor")||writeCalendar(e,e.safeAttr("data-filter"),makeStaticLink("images/calendar.svg"),e.safeAttr("data-filter-from"),e.safeAttr("data-filter-to"),e.safeAttr("data-callback"),void 0,void 0,"Pears")}))},$$WP.Utilities.UI.Map.Support.calendars=$$WP.Utilities.UI.Calendars;;
"undefined"==typeof WP&&(WP={}),void 0===WP.Validators&&(WP.Validators={}),WP.Validators.currentAlerts={},WP.Validators.alertsHolder=null,WP.Validators.DisplayErrors=function(e,t,n){var r,o,s,a;if(!0!==WP.suppressErrors&&" "!==e||(e=""),"function"==typeof e){try{r=e(t)}catch(e){r=""}if(""===r)return}else r="string"==typeof e?e:e.innerText||e.textContent;if(o=n||WP.Validators.alertsHolder)if(t)s=WP.Validators.currentAlerts,r?(s[t]||((a=document.createElement("p")).className="alert",s[t]=a,o.appendChild(a)),s[t].innerHTML!==r&&s[t]!==r&&("object"==typeof e?($afe.jq(s[t]).empty(),s[t].appendChild(e)):dangerou$.setHtml(s[t],r))):s[t]&&(o.removeChild(s[t]),delete s[t]);else if("&nbsp;"!==r&&" "!==r&&r!==HTMLUnencode("&nbsp;")||(r="","object"==typeof e&&$afe.jq(e).text()===HTMLUnencode("&nbsp;")&&(e="&nbsp;")),WP.Validators.currentAlerts={},"object"==typeof e)$afe.jq(o).empty(),o.appendChild(e);else{if(o.innerHTML===r)return;if(dangerou$.setHtml(o,r),"&nbsp;"===r)0===(o.innerText||o.textContent||"").length&&$T(o,String.fromCharCode(6))}else r&&$$WP.Utilities.quickMessageBox(r,"",[],null,[],"")},void 0===WP.Validators.Text&&(WP.Validators.Text={}),WP.Validators.Text.MaxLengthAndRequired=function(e,t,n,r,o,s){var a,l,d,i={};e&&("string"==typeof e&&(e=document.getElementById(e)),o=o||null,d=(t=t||"").length>0,n=n||200,i.hideHintTextFun=function(){var t=$afe.jq(e);t.parent().hasClass("ghostInput")||(t.removeClass("fadedtext").val(""),WP.Events.removeListener(e,"focus",i.hideHintTextFun))},i.showHintTextFun=function(){var t=$afe.jq(e);t.parent().hasClass("ghostInput")||(t.addClass("fadedtext").val("Enter Text Here"),WP.Events.addListener(e,"focus",i.hideHintTextFun))},o&&(void 0===(l=WP.Validators.Forms[o])&&(WP.Validators.Forms[o]=[],l=WP.Validators.Forms[o]),a=l.length),i.isEmpty=WP.Strings.isEmpty,i.scrollPreventer=function(){var t=e.scrollTop,n=e.scrollHeight,r=t+e.height===e.scrollHeight;i.valueChecker(),e.scrollTop!==t&&(e.scrollTop=!0===r?n:t),"function"==typeof s&&s()},i.valueChecker=function(){var s,u,c,v;$input=$afe.jq(e),$$WP.Utilities.setActivity(),s=e.value.length,(u={})["@MYCHART@MAXLEN@"]=n,s>n?(u["@MYCHART@OVERLIMIT@"]=s-n,v=decodeMnemonics("@MYCHART@OVERLIMIT@ too many characters",u),c=createAlert(v,!1)):(u["@MYCHART@REMAININGCHARACTERS@"]=Math.max(0,n-s)+"",c=(v=i.isEmpty(e.value)&&d?t:" ").trim().length>0?createAlert(v,!0):decodeMnemonics("@MYCHART@REMAININGCHARACTERS@ of @MYCHART@MAXLEN@ characters left",u),removeClassNames(e,"alertborder")),0===c.length&&(c="&nbsp;"),WP.Validators.DisplayErrors(c,"",r),o&&(l[a]=v,v.trim().length>0?($input.safeAttr("data-invalid","true"),applyClass(e,"invalid")):($input.removeAttr("data-invalid"),removeClassNames(e,"invalid")))},i.focusFun=function(){removeClassNames(e,"alertborder"),WP.Events.removeListener(e,"focus",i.focusFun)},i.blurFun=function(){var u;if(i.isEmpty(e.value)){if(0===e.value.length&&i.showHintTextFun(),d){u=!0;var c,v,p={};p["@MYCHART@MAXLEN@"]=n,c=decodeMnemonics(t,p),v=createAlert(c,!0),!0===WP.suppressErrors&&applyClass(v,"clearlabel"),WP.Validators.DisplayErrors(v,"",r),o&&(l[a]=c)}}else e.value.length<=n?(removeClassNames(e,"alertborder"),WP.Validators.DisplayErrors("&nbsp;","",r),o&&(l[a]=" "),"function"==typeof s&&s()):u=!0;u&&!0!==WP.suppressErrors&&(applyClass(e,"alertborder"),WP.Events.addListener(e,"focus",i.focusFun)),i.valueChecker();var f=$afe.select("form#"+o);f.length>0&&$$WP.FormValidation.checkIfFormIsValid(f,!0)},i.afterCutPaste=function(){window.setTimeout(i.scrollPreventer,1)},WP.Events.addListener(e,"blur",i.blurFun),WP.Events.addListener(e,"keyup",i.scrollPreventer),WP.Events.addListener(e,"paste",i.afterCutPaste),WP.Events.addListener(e,"cut",i.afterCutPaste),WP.Validators.undoRedo(e),WP.suppressErrors=!0,i.scrollPreventer(),i.blurFun(),WP.suppressErrors=!1,e.removeMaxLength=function(){WP.Events.removeListener(e,"blur",i.blurFun),WP.Events.removeListener(e,"keyup",i.scrollPreventer),WP.Events.removeListener(e,"cut",i.afterCutPaste),WP.Events.removeListener(e,"paste",i.afterCutPaste),i.hideHintTextFun(),i.focusFun(),delete i.blurFun,delete i.scrollPreventer,delete i.valueChecker,delete i.isEmpty,delete i.firstAction,delete i.showHintTextFun,delete i.hideHintTextFun,delete i.focusFun,l[a]="","function"==typeof s&&s(),"function"==typeof e.removeUndoRedo&&e.removeUndoRedo()})},void 0===WP.Validators.undoRedo&&(WP.Validators.undoRedo=function(e){if(-1!==navigator.userAgent.toLowerCase().indexOf("msie")){var t={undoStack:[e.value],redoStack:[],isDeleting:!1,isInserting:!1,pop:function(e){if(0!==e.length){var t=e[e.length-1];return e.length-=1,t}},addUndoFun:function(n){"Enter Text Here"!==e.value&&(0!==t.undoStack.length&&e.value===t.undoStack[t.undoStack.length-1]||(t.undoStack[t.undoStack.length]=e.value,t.undoStack.length>75&&t.undoStack.shift(),!0!==n&&(t.redoStack=[])))},onKeyUp:function(n){var r,o=n||window.event;if(!1!==o.ctrlKey){if(90===o.keyCode){if(0===t.undoStack.length)return;t.redoStack[t.redoStack.length]=e.value,(r=t.pop(t.undoStack))===e.value&&(r=t.pop(t.undoStack)||""),e.value=r}else if(89===o.keyCode){if(0===t.redoStack.length)return;r=t.pop(t.redoStack),t.addUndoFun(!0),e.value=r}}else t.clearNativeUndo()},onKeyDown:function(e){var n=e||window.event;8===n.keyCode||46===n.keyCode?(t.isDeleting=!0,!0===t.isInserting&&(t.isInserting=!1,t.addUndoFun())):(t.isInserting=!0,!0===t.isDeleting?(t.isDeleting=!1,t.addUndoFun()):32===n.keyCode?(!0!==t.isSpacing&&t.addUndoFun(),t.isSpacing=!0):(!0===t.isSpacing&&t.addUndoFun(),t.isSpacing=!1))},clearNativeUndo:function(){var e=document.createElement("div");document.body.appendChild(e),document.body.removeChild(e)}};WP.Events.addListener(e,"keyup",t.onKeyUp),WP.Events.addListener(e,"paste",t.addUndoFun),WP.Events.addListener(e,"cut",t.addUndoFun),WP.Events.addListener(e,"keydown",t.onKeyDown),e.removeUndoRedo=function(){WP.Events.removeListener(e,"keyup",t.onKeyUp),WP.Events.removeListener(e,"paste",t.addUndoFun),WP.Events.removeListener(e,"cut",t.addUndoFun),WP.Events.removeListener(e,"keydown",t.onKeyDown);try{delete t.addUndoFun,delete t.onKeyDown,delete t.undoStack,delete t.redoStack,delete t.isDeleting,delete t.isInserting,delete t.pop,delete t.clearNativeUndo}catch(e){}},t.addUndoFun()}}),void 0===WP.Validators.Calendar&&(WP.Validators.Calendar={aftertwodays:function(e,t,n){return new Date(e,t,n)-new Date>86399e3},past:function(e,t,n){return new Date(e,t,n)<=new Date},future:function(e,t,n){return new Date(e,t,n+1)>=new Date},range:function(e,t,n){var r,o,s;return o=window.cachedStartDate,s=window.cachedEndDate,r=new Date(e,t,n),!(o&&r<o)&&!(s&&r>s)},any:function(e,t,n){return!0}}),void 0===WP.Validators.Forms&&(WP.Validators.Forms={}),WP.Validators.Forms.SelectionRequired=function(e,t,n,r,o,s){var a,l,d,i={};e&&("string"==typeof e&&(e=document.getElementById(e)),o=o||null,d=(t=t||"").length>0,n=n||-1,o&&(void 0===(l=WP.Validators.Forms[o])&&(WP.Validators.Forms[o]=[],l=WP.Validators.Forms[o]),a=l.length),i.scrollPreventer=function(){var t=e.scrollTop,n=e.scrollHeight,r=t+e.height===e.scrollHeight;i.blurFun(),e.scrollTop!==t&&(e.scrollTop=!0===r?n:t),"function"==typeof s&&s()},i.focusFun=function(){removeClassNames(e,"alertborder"),WP.Events.removeListener(e,"focus",i.focusFun)},i.blurFun=function(){var u;if(e.value==n){if(d){u=!0;var c,v;c=decodeMnemonics(t,{}),v=createAlert(c,!0),!0===WP.suppressErrors&&applyClass(v,"clearlabel"),WP.Validators.DisplayErrors(v,"",r),o&&(l[a]=c)}}else removeClassNames(e,"alertborder"),WP.Validators.DisplayErrors("","",r),o&&(l[a]=" "),"function"==typeof s&&s();u&&!0!==WP.suppressErrors&&(applyClass(e,"alertborder"),WP.Events.addListener(e,"focus",i.focusFun))},WP.Events.addListener(e,"blur",i.blurFun),WP.Events.addListener(e,"change",i.blurFun),WP.Events.addListener(e,"keyup",i.scrollPreventer),WP.suppressErrors=!0,i.scrollPreventer(),i.blurFun(),WP.suppressErrors=!1)};;
/*! Copyright (c) Epic Systems Corporation 2014-2018*/
$$WPContain.HTMLTemplateContainer=function CF$HTMLTemplateContainer(e){(e=e||{}).$parent&&e.$parent.length>0&&(e.Html=e.$parent.html(),e.$parent.empty()),this.Containers$Panel(e)},$$WPContain.HTMLTemplateContainer.prototype={SupportedComponents:[],ComponentProperties:{SupportAnimations:!0},ContainerProperties:{SupportAnimations:!0},Class:"HPtemplate",html:function(e){var t,n;this.clearComponents(),this.Components$Component$html(e),this.show(!1),(t=this).$content.find("[data-component]").each((function WPC$(){var e,o,a,i,s,r,l,c,p;if(o=(e=$afe.jq(this)).safeAttr("data-component"),r=e.safeAttr("data-component-settings"),$.inArray(o,t.SupportedComponents)>=0||0===t.SupportedComponents.length){if((i=$$WPUtil.copyObject(t.ComponentProperties)).$container=i.$container||e,"campaigns"===o)return void(n=function(){new $$WP.CampaignOutreach.CampaignsController(i.$container).render()}.bind(this));if(r)for(i.TemplateSettings={},l=r.split("&"),p=0;p<l.length;p++)(c=l[p].split("="))[0]&&(i.TemplateSettings[c[0]]=c[1]);s=$$WPUtil.copyObject(t.ContainerProperties),i.$parent=i.$parent||e.parent(),(a=t._getNewComponent(o,i,s))&&(t.addComponent(a),a.show())}})),getCSRFTokenAsQS((function WPContain$Lpoc$afterCSRFToken(){$.each(t._Components,(function(e,t){t.load()})),n&&n()}))},_getNewComponent:function WPContain$Lpoc$_getNewComp(e,t,n){var o;switch(e){case"alerts":try{o=$$WPUtil.ComponentFactory.HomePage.alerts(t)}catch(e){$$WP.Debug.log("Unable to load alerts component. "+e)}break;case"news":try{o=$$WPUtil.ComponentFactory.HomePage.news(t)}catch(e){$$WP.Debug.log("Unable to load news component. "+e)}break;case"quicklinks":try{o=$$WPUtil.ComponentFactory.HomePage.quickLinks(t)}catch(e){$$WP.Debug.log("Unable to load quicklinks component. "+e)}break;case"careteam":try{o=new $$WP.Clinical.CareTeam.Components.CareTeam(t)}catch(e){$$WP.Debug.log("Unable to load care team widget. "+e)}break;case"todo":try{o=new $$WP.Clinical.ToDo.Containers.ToDoEventsContainer(t)}catch(e){$$WP.Debug.log("Unable to load todo widget. "+e)}break;case"medications":try{o=new $$WP.Clinical.Medications.Components.MedicationsWidgetComponent(t)}catch(e){$$WP.Debug.log("Unable to load medications widget. "+e)}break;case"goals":try{o=new $$WP.Clinical.Goals.Components.GoalsComponent(t)}catch(e){$$WP.Debug.log("Unable to load goals widget. "+e)}break;case"guarantor":try{o=new $$WP.GuarantorVerification.Components.GuarantorDetailsComponent(t)}catch(e){$$WP.Debug.log("Unable to load guarantor widget. "+e)}break;case"viewdocuments":try{o=new $$WP.ViewDocument.Components.ViewDocument(t)}catch(e){$$WP.Debug.log("Unable to load view document widget. "+e)}break;case"externalalerts":try{o=new $$WP.Alerts.Components.ExternalAlertsComponent(t)}catch(e){$$WP.Debug.log("Unable to load external alerts. "+e)}break;case"reviewmessages":try{t.Mailbox=t.$container.safeAttr("data-mailbox"),t.SupportAnimations=!1,o=new $$WP.Messaging.ReviewMessagesContainer(t)}catch(e){$$WP.Debug.log("Unable to load message list widget. "+e)}break;case"allergies":try{o=new $$WP.Clinical.Allergies.Components.Allergies(t)}catch(e){$$WP.Debug.log("Unable to load allergies. "+e)}break;case"healthissues":try{o=new $$WP.Clinical.HealthIssues.Components.HealthIssues(t)}catch(e){$$WP.Debug.log("Unable to load health issues. "+e)}break;case"medicationsdetails":try{o=new $$WP.Clinical.Medications.Components.MedicationsDetailsComponent(t)}catch(e){$$WP.Debug.log("Unable to load medications widget. "+e)}break;case"externallinking":try{o=new $$WP.Community.Components.ExternalLinkingComponent(t)}catch(e){$$WP.Debug.log("Unable to load external linking. "+e)}break;case"visitslist":try{o=new $$WP.Visits.VisitsListContainer(t)}catch(e){$$WP.Debug.log("Unable to load visits widget. "+e)}break;case"testresultspoc":try{o=new $$WP.Clinical.TestResultsPOC.Components.TRPComponent(t)}catch(e){$$WP.Debug.log("Unable to load test results POC list widget. "+e)}break;case"testresults":try{t.SupportAnimations=!1,o=new $$WP.Clinical.TestResults.TestResultsContainer(t)}catch(e){$$WP.Debug.log("Unable to load test results list widget. "+e)}break;case"personalnotes":try{o=new $$WP.Clinical.PersonalNotes.Components.PersonalNotesComponent(t)}catch(e){$$WP.Debug.log("Unable to load patient notes. "+e)}}return o}},$$WPContain.HTMLTemplateContainer.extend("Containers.Panel"),$$WPUtil.ComponentFactory.HomePage.Main=function CF$homePage(e){return(e=e||{}).SupportedComponents=e.SupportedComponents||[],e.$parent=$afe.select("#homepagemain"),e.$parent.addClass("widgets"),new $$WPContain.HTMLTemplateContainer(e)},$$WPUtil.ComponentFactory.GuarantorVerification=function CF$guarantorVerification(e,t){return(t=t||{}).ComponentProperties=t.ComponentProperties||{},t.ComponentProperties.encCSN=e,t.SupportedComponents=["guarantor"],t.$parent=$afe.select("#guarantorverificationtemplate"),new $$WPContain.HTMLTemplateContainer(t)},$$WPUtil.ComponentFactory.HomePage.Sidebar=function CF$homePage(e){return(e=e||{}).SupportedComponents=e.SupportedComponents||[],e.$parent=$afe.select("#homepagesidebar"),e.$parent.addClass("widgets"),new $$WPContain.HTMLTemplateContainer(e)};;
$$WPComp.SafeToRedirectComponent=function WPPop$SafeToRedirectPopup(e){if($$WPComp.applySettings(e,this),"function"!=typeof this.callback)throw"A callback function is required for SafetoRedirectPopup";if(this.CallbackContext=this.CallbackContext||this,this.Components$Component({}),!WP.Events.showBeforeUnloadMessage())return WP.Events.beforeUnloadHold=!0,this.callback.apply(this.CallbackContext,[!0]),this._alreadyExecutedCallback=!0,void this.dispose();this.addEventListener("click",this.clickSafeToRedirect)},$$WPComp.SafeToRedirectComponent.prototype={IsClosable:!0,ToolbarButtons:[new $$WPComp.ComplexObjects.Button($$WP.Strings.get("StayButtonText","Core.SafeToRedirectPopup"),null,"","stay"),new $$WPComp.ComplexObjects.Button($$WP.Strings.get("LeaveButtonText","Core.SafeToRedirectPopup"),null,"inlinedelete","leave")],TitleText:$$WP.Strings.get("SafeToRedirectTitle","Core.SafeToRedirectPopup"),Html:$$WP.Strings.get("Message","Core.SafeToRedirectPopup"),clickSafeToRedirect:function WPPop$SafeToRedirectPopup$_click(e){if(e.dataId)return WP.Events.beforeUnloadHold=e.dataId===$$WPComp.TOOLBARIDENTIFIER+"leave",this._alreadyExecutedCallback=!0,this.callback.apply(this.CallbackContext,[WP.Events.beforeUnloadHold]),this.dispose(!0),!1},show:function(){this._alreadyExecutedCallback?this.dispose(!0):(this.Components$Component$show(),WP.Events.SafeToUnloadWarningDisplayed=!0)},dispose:function(e){this._isDisposed||(this._alreadyExecutedCallback||(this._alreadyExecutedCallback=!0,this.callback.apply(this.CallbackContext,[!1])),this.Components$Component$dispose(e),WP.Events.SafeToUnloadWarningDisplayed=!1)}},$$WPComp.SafeToRedirectComponent.canceledRedirect=function WPPop$SafeToRedirectPopup$canceledRedirect(){delete WP.Events.beforeUnloadHold},$$WPComp.SafeToRedirectComponent.extend("Components.Component");;
/*! Copyright (c) Epic Systems Corporation 2014-2021 */
$$WPComp.TimeoutWarningComponent=function WPComp$TimeoutWarningComponent(e){var t,i;$$WP.Strings.setDefaultNamespace("Core.TimeOutPopup"),t=$$WP.HyperspaceSession?"FromHyperspace":WP.Events.showBeforeUnloadMessage()?"WithChanges":"TimeOut",this.PreHtml=e.Html||e.Text||$$WP.Strings.get(t+"Message"),this.Html=this.PreHtml,$$WPComp.applySettings(e,this),this._SecondsAtStart=Math.floor(this.SecondsLeft)||60,$$WP.Strings.addMnemonic("@MYCHART@SecondsLeft@",this._SecondsAtStart.toString()),i=$$WP.HyperspaceSession?[new $$WPComp.ComplexObjects.Button(this.StayString||$$WP.Strings.getForTemplate("FromHyperspaceStayButtonText"),null,"","stay")]:this.isPreLogin?[new $$WPComp.ComplexObjects.Button(this.StayString||$$WP.Strings.getForTemplate("PreLoginStayButtonText"),null,"","stay"),new $$WPComp.ComplexObjects.Button(this.LeaveString||$$WP.Strings.getForTemplate("PreLoginLogOutButtonText"),null,"inlinedelete","leave")]:[new $$WPComp.ComplexObjects.Button(this.StayString||$$WP.Strings.getForTemplate("StayButtonText"),null,"","stay"),new $$WPComp.ComplexObjects.Button(this.LeaveString||$$WP.Strings.getForTemplate("LogOutButtonText"),null,"inlinedelete","leave")],this._clickContext=this._clickContext||this,this.TitleText=this.TitleText||$$WP.Strings.getForTemplate(t+"Title"),this.ToolbarButtons=i,this.Components$Component(),$$WP.Strings.removeMnemonic("@MYCHART@SecondsLeft@"),$$WP.Strings.clearDefaultNamespace(),$.proxy(this._createScreenReaderAlert(),this),this._timer=$.proxy(this._timer,this),this._TimerId=window.setTimeout(this._timer,1e3),this.$content.safeAttr("aria-hidden",!0),this._D0=new Date,this.addEventListener("click",this.clickTimeoutWarning),$$WPComp.TimeoutWarningComponent.hasVisibleInstance=!0,removeCalendarExternal()},$$WPComp.TimeoutWarningComponent.prototype={ToolbarButtons:null,SecondsLeft:60,StayString:null,LeaveString:null,IsClosable:!0,isPreLogin:!1,preLoginRedirectURL:null,_SecondsAtStart:Number,_D0:new Date,_TimerId:Number,_isFirstTime:!0,Class:"timeoutwarning",clickTimeoutWarning:function WPComp$TimeoutWarningComponent$_click(e){if(e.dataId)return e.dataId===$$WPComp.TOOLBARIDENTIFIER+"leave"&&$$WPComp.TimeoutWarningComponent.leaveClick(this.isPreLogin,!1,this.preLoginRedirectURL),this.dispose(!0),!1},_timer:function WPComp$TimeoutWarningComponent$_timer(){var e,t;if(!1!==this.isVisible())if($afe.select(".Popup").removeAttr("aria-live"),(i=$afe.select("#screenReaderAlertTimeout")).innerHTML=this.PreHtml,e=new Date,(t=Math.floor(this._SecondsAtStart-Math.round((e-this._D0)/1e3,0)))<=0)$$WPComp.TimeoutWarningComponent.leaveClick(this.isPreLogin,!0,this.preLoginRedirectURL),this.dispose(!0);else{var i;if($$WP.Strings.setDefaultNamespace("Core.TimeOutPopup"),this._timerId=window.setTimeout(this._timer,1e3),t%10==0||this._isFirstTime)this._isFirstTime=!1,(i=$afe.select("#screenReaderAlertTimeout")).innerHTML=this.PreHtml,$$WP.Strings.addMnemonic("@MYCHART@SecondsLeft@",t.toString()),$$WP.Strings.setDisplayText(i,"Message"),$$WP.Strings.removeMnemonic("@MYCHART@SecondsLeft@");$$WP.Strings.addMnemonic("@MYCHART@SecondsLeft@",t.toString()),this.html(this.PreHtml),$$WP.Strings.removeMnemonic("@MYCHART@SecondsLeft@"),$$WP.Strings.clearDefaultNamespace()}else this.dispose(!0)},dispose:function WPComp$TimeoutWarningComponent$dispose(e){this._isDisposed||(window.clearTimeout(this._timerId),this._timerId=null,this.Components$Component$dispose(e),$$WPUtil.setActivity(),checkActivity(),$$WP.Strings.getNamespace("Core.TimeOutPopup").removeMnemonic("@MYCHART@SecondsLeft@"),$$WPComp.TimeoutWarningComponent.hasVisibleInstance=!1)},_createScreenReaderAlert:function WPComp$TimeoutWarningComponent$createScreenReaderAlert(){$$WP.Strings.setDefaultNamespace("Core.TimeOutPopup");var e=this.$content,t=e.clone();t.addClass("clearlabel"),t.safeAttr("id","screenReaderAlertTimeout"),this.$container.safeAppend(t),(e=$afe.select("#screenReaderAlertTimeout")).innerHTML=this.PreHtml,$$WP.Strings.addMnemonic("@MYCHART@SecondsLeft@",this._SecondsAtStart.toString()),$$WP.Strings.setDisplayText(e,"TimeOutMessage"),$$WP.Strings.removeMnemonic("@MYCHART@SecondsLeft@"),t.safeAttr("aria-hidden",!1),t.safeAttr("aria-live","assertive"),t.safeAttr("aria-relevant","additions"),t.safeAttr("aria-atomic",!0),$$WP.Strings.clearDefaultNamespace()}},$$WPComp.TimeoutWarningComponent.leaveClick=function WPComp$TimeoutWarningComponent$leaveClick(e,t,i){var n;WP.Events.cancelBeforeUnload(),e?window.location!==window.parent.location?document.location.href=document.location.href:$$WPUtil.IsNullOrEmpty(i)?window.location.reload(!1):window.location.href=i:(n=new $$WPComp.LoggingOutComponent("",t),new $$WPContain.Popup({positioningFunction:$$WPContain.Positions.InsideCentered,Components:n,Class:"logout"}).show(!0))},$$WPComp.TimeoutWarningComponent.extend("Components.Component");;
$$WPComp.LoggingOutComponent=function WPPop$LoggingOutPopup(o,t,e){this.Components$TemplateComponent(o),this._isTimeout=!0===t,this._callback=e},$$WPComp.LoggingOutComponent.prototype={Class:"logout",ToolbarButtons:null,_isTimeout:null,TitleText:$$WP.Strings.getForTemplate("LoggingOutTitle","Core.LoggingOutPopup"),template:$$WP.Templates.Core.loggingout,Data:{Message:$$WP.Strings.getForTemplate("Message","Core.LoggingOutPopup")},show:function(){this.Components$TemplateComponent$show(),logOut("","",this._isTimeout,this._callback)}},$$WPComp.LoggingOutComponent.extend("Components.TemplateComponent");;
$$WPComp.InlineLoggingOutComponent=function WPPop$InlineLoggingOutPopup(o,n,t){$$WPComp.LoggingOutComponent.call(this,o,t),this.afterLogoutCallback=n},$$WPComp.InlineLoggingOutComponent.prototype={show:function(){this.Components$TemplateComponent$show()},logout:function(){WP.Comm.logOut($.proxy((function(o){$.ajax({url:makeLink(o),method:"GET",success:$.proxy((function(){this.afterLogoutCallback&&this.afterLogoutCallback()}),this)})}),this))}},$$WPComp.InlineLoggingOutComponent.extend("Components.LoggingOutComponent");;
$$WPComp.MessageComponent=function WPComp$MessageComponent(s){this.Components$Component(s),this.Message&&(this.setMessage(this.Message),this.SupportsAriaDescription=!0),this.addEventListener("click",this._messageClick)},$$WPComp.MessageComponent.prototype={Class:"messageComponent",Message:"",IsClosable:!0,setMessage:function WPComp$setMessage(s){null!=s?(s instanceof Handlebars.SafeString&&($$WP.Debug.logError("A MessageComponent's text should be a String. It's currently a Handlebars.SafeString. Setting the content anyway..."),s=s.toString()),this.html("<p id='popupdescription"+this.ComponentNumber+"'>"+s+"</p>")):$$WP.Debug.logError("Trying to set non-existant html in a MessageComponent...")},_messageClick:function WPComp$MessageComponent$_click(s){if(s.dataId)return this.CallbackArgs=this.CallbackArgs||[],this.CallbackArgs.push(s.dataId),this._addedDataId=!0,this.dispose(!0),!1},dispose:function WPComp$MessageComponent$dispose(s){this._isDisposed||(this.Components$Component$dispose(s),"function"==typeof this.callback&&(this.CallbackArgs=this.CallbackArgs||[],this._addedDataId||this.CallbackArgs.push("close"),this.callback.apply(this.CallbackContext||this,this.CallbackArgs||[])))}},$$WPComp.MessageComponent.extend("Components.Component");;
$$WP.Components.CommunityListManagerComponent=function(t){this.ListSelector=this.ListSelector||"ul",this.ListElementSelector=this.ListElementSelector||"li",this.Components$TemplateComponent(t),this._autoAddAfterWait=!0,this.SerializedIndex=this.SerializedIndex||"",this._compareFunction=$.proxy(this._compareFunction,this);var e=$afe.select("ul#proxies").find("li.selected"),i=new RegExp(makeLink("showfile.asp.key=").replace("/","/")+"[0-9]+","gi");this.UserPhoto=(i.exec(e.html())||[makeStaticLink("images/ProxySilhouette.png")])[0],this.PhotoColor=(e.safeAttr("class")||"").match(/\bcolor\d\b/i),this.PhotoColor=this.PhotoColor&&this.PhotoColor.length>0?this.PhotoColor[0]:"color1"},$$WP.Components.CommunityListManagerComponent.prototype={SearchString:"",CanSearch:!1,CanSort:!1,SortBy:"PrimaryDate",SortDescending:!0,Filter:"None",RenderedData:[],SerializedIndex:"",HasLoadedData:!1,NeverAutoFocus:!1,Class:"CommunityListManager",DataFromMultipleSources:!0,CurrentOrgHasAllHidden:!1,ContainerComponent:$$WP.Containers.CommunityListManagerContainer.prototype,_getNextPage:function(){var t,e,i=[];if(!1===this.HasMoreData||void 0===this.HasMoreData){for(e in this.UnusedRecords)this.UnusedRecords[e].length>0&&(i=i.concat(this.UnusedRecords[e]),this.OldestRenderedDate=new Date(Math.min(this.OldestRenderedDate,this.UnusedRecords[e][this.UnusedRecords[e].length-1].PrimaryDate)),this.UnusedRecords[e]=[]);return i}for(;;){for(e in t=null,this.UnusedRecords)t=t||e,this.UnusedRecords[e].length>0&&(0===this.UnusedRecords[t].length||this.UnusedRecords[e][0].PrimaryDate>this.UnusedRecords[t][0].PrimaryDate)&&(t=e);if(void 0===this.UnusedRecords[t]||0===this.UnusedRecords[t].length)return i;if(this.OldestRenderedDate=new Date(Math.min(this.OldestRenderedDate,this.UnusedRecords[t][0].PrimaryDate)),i.push(this.UnusedRecords[t].shift()),0===this.UnusedRecords[t].length&&!0===this.Organizations[t].HasMoreData)return i}},_updateHeaderFooter:function(t){var e,i=!1,n=0;if(this.Organizations)for(e in this.Organizations)if(this.Organizations[e].OrganizationId===e&&++n>1){i=!0;break}var s=!1;for(organization in this.UnusedRecords)this.UnusedRecords[organization].length>0&&(s=!0);(t=$$WPUtil.mergeObjects(t,{OldestRenderedDate:this.OldestRenderedDate?formatDate(this.OldestRenderedDate):null,AllDataDisplayed:!this.HasMoreData&&!s,HasMoreData:this.HasMoreData,SearchString:this.SearchString,Filter:this.Filter,SortBy:this.SortBy,SortDescending:this.SortDescending,ListCount:this.RenderedData.length,HasLoadedData:this.HasLoadedData,HasMultipleOrganizations:i,CurrentOrgHasAllHidden:this.CurrentOrgHasAllHidden,SkippedSomeResults:this.Data.SkippedSomeResults},!1,!0)).ViewBagProperties=this.Data.ViewBagProperties,this.ContainerComponent.HeaderComponent.ListData=t,this.ContainerComponent.FooterComponent.ListData=t,this.ContainerComponent.HeaderComponent.refresh(),this.ContainerComponent.FooterComponent.refresh()},addNextPage:function(t){if(this._waiting)return this._autoAddAfterWait=!0,this._userInitiatedAutoAdd=!0,void this.ContainerComponent.FooterComponent.CommunicationsIndicator.show(this.ContainerComponent.FooterComponent.$container);this.ContainerComponent.FooterComponent.show(),this.ContainerComponent.FooterComponent.CommunicationsIndicator.hide();var e,i,n=!0,s=this._getNextPage(),r=(!t||!0===this._userInitiatedAutoAdd)&&!0!==this.NeverAutoFocus;if(this._userInitiatedAutoAdd=!1,s.sort(this._compareFunction),0===s.length){if(this._updateHeaderFooter(),this.RenderedData.length>0)return;n=!1}else n=(n="PrimaryDate"===this.SortBy&&this.SortDescending&&!this.$container.hasClass("nodata")&&this.RenderedData.length>0)&&s[0].PrimaryDate<=this.RenderedData[this.RenderedData.length-1].PrimaryDate;if(0===this.RenderedData.length&&s.length>0&&this.show(),n){var a=dangerou$.parseHtml(this._getListHtml(s));this.SearchString&&this.SearchString.length>0&&$$WPUtil.highlightNodeText(a.get(0),this.SearchString),this.RenderedData=this.RenderedData.concat(s),"ul"!==a.get(0).tagName.toLowerCase()&&(a=a.find("ul").first()),a=a.children("li"),$$WPUtil.removePopupListener(this.$content),this.$content.find("ul").first().safeAppend(a),this.afterAppendNewPage(s),this.$content.trigger("resize"),$$WPUtil.addPopupListener(this.$content),this.applyFilters(),r&&(e=a.first().safeAttr("data-index"))}else if(0===s.length?r=!1:i=s[0].Id,this.RenderedData=this.RenderedData.concat(s),this.refresh(),r)for(var o=0;o<this.RenderedData.length;o++)if(this.RenderedData[o].Id===i){e=o;break}this._updateHeaderFooter(),s.length>0&&this.load(),r&&this.focusOn(e)},focusOn:function(t){var e=this.$container.find("ul").children("li").get(t);document.activeElement===e?(e.blur(),window.setTimeout(this._focusOnCallback,200,e)):(e.focus(),document.activeElement!==e&&window.setTimeout(this._focusOnCallback,200,e))},_focusOnCallback:function(t){t&&t.focus()},_getListHtml:function(t,e){if(!t&&0===this.RenderedData.length)return"";var i=0;return t&&(i=this.RenderedData.length),e=$$WPUtil.mergeObjects(e||{},{List:t||this.RenderedData,UserPhoto:this.UserPhoto,ListOffset:i,PhotoColor:this.PhotoColor,ComponentNumber:this.ComponentNumber},!1,!0),this.template(e).trim()},refresh:function(){this.RenderedData.sort(this._compareFunction),this.html(this._getListHtml()),this.applyFilters()},_compareFunction:function(t,e,i,n){i=i||this.SortBy,n=n||this.SortDescending;var s,r,a,o=i.split(".");return a=function(t,e){var i;for(i=0;i<e.length;i++)t=t[e[i]];return t},!0===n?(s=a(e,o),r=a(t,o)):(s=a(t,o),r=a(e,o)),s===r||r-s==0?"PrimaryDate"!==i?this._compareFunction(t,e,"PrimaryDate",!0):0:"string"==typeof s?r.toLowerCase()<s.toLowerCase()?1:-1:s-r},load:function(t){var e,i,n=0===this.RenderedData.length;t=t||"",i={serializedIndex:""!==this.SerializedIndex&&!1===this.HasMoreData?"ALLITEMSDISPLAYED":encodeURIComponent(this.SerializedIndex)},!0===this._waiting&&this.cancelRequest("listload",this.__lastLoad),-1===this.Url.indexOf("?")?this.Url+="?":"&"!==this.Url[this.Url.length-1]&&(this.Url+="&"),this._waiting=!0,encodeURIComponent(this.SerializedIndex),e=this.Url+"searchString="+encodeURIComponent(this.SearchString)+"&oldestRenderedDate=",e+=encodeURIComponent(this.OldestRenderedDate.toISOString())+"&"+t,this.__lastLoad=this.Components$TemplateComponent$load(e,n,"listload",i)},setData:function(t){if("ALLITEMSDISPLAYED"!==t){if(this.Data=t,void 0!==this.Data.ViewBagProperties)for(var e in this.Data.ViewBagProperties)this.Data[e]=this.Data.ViewBagProperties[e];var i,n,s,r,a;if(this.SerializedIndex=t.SerializedIndex||"",this.CanSearch=t.CanSearch||!1,this.CanSort=t.CanSort||!1,this.ErrorState=this.ErrorState||{},t.List){if(this.HasLoadedData=!0,this.Organizations=this.Organizations||t.Organizations||[],!this.EverHadErrorState)for(i in this.UnusedRecords)this.ErrorState[i]=!this.Organizations[i]||this.Organizations[i].HasMoreData;for(i in t.List){for(this.ErrorState[i]=!1,this.Organizations[i]=t.Organizations[i],this.Organizations[i].HasMoreData=t.List[i].HasMoreData,n=(a=t.List[i].List).length-1;n>-1;n--)(r=a[n]).PrimaryDate=new Date(r.PrimaryDate),r.Organization=r.Organization||this.Organizations[i],r.Id=encodeURIComponent(r.Id),r.CommunityIdUrlEncoded=encodeURIComponent(r.CommunityId);s=s||t.List[i].HasMoreData,this.UnusedRecords[i]?this.UnusedRecords[i]=this.UnusedRecords[i].concat(a):this.UnusedRecords[i]=a}if(this.HasMoreData=s,!this.EverHadErrorState)for(i in this.UnusedRecords)if(this.UnusedRecords[i].ErrorState){this.EverHadErrorState=!0;break}if(this._waiting=!1,this._autoAddAfterWait=this.Data.AutoRenderThisSet||this._autoAddAfterWait,this.Data.List=[],this._autoAddAfterWait)return this._autoAddAfterWait=!1,void this.addNextPage(!0)}else this.clearModel(),this.refresh()}else this._waiting=!1},setSort:function(t,e){this.SortBy=t,this.SortDescending=e,this.refresh()},setSearch:function(t){t!==this.SearchString&&(this.SearchString=t,this.reload())},setFilter:function(t){if(t!==this.Filter)switch(this.Filter=t,t.split("~")[0]){case"None":case"organization":return void this.applyFilters();default:return void this.reload()}},applyFilters:function(t){var e,i,n,s,r,a,o,h=0,d=0;for(e=this.$content.find("ul"),n=t?e.length:1,i=0;i<n;i++)for(r=$afe.jq(e[i]).children("li"),s=0;s<r.length;s++)a=$afe.jq(r[s]),o=parseInt(a.safeAttr("data-index"),10),isNaN(o)&&(o=d),this.shouldBeFiltered(this.RenderedData[o])?a.hasClass("hidden")||(h++,a.addClass("hidden")):a.hasClass("hidden")&&(h--,a.removeClass("hidden")),d++;this.CurrentOrgHasAllHidden=this.RenderedData&&this.RenderedData.length>0&&this.$content.find("li.hidden").length===this.RenderedData.length,this.$content.trigger("resize",{forceShrink:h>0})},shouldBeFiltered:function(t){this.Filter=this.Filter||"";var e=this.Filter.split("~");return"organization"===e[0]&&!this.hasSourceOrg(t,e[1])},hasSourceOrg:function(t,e){if(t.Organization.OrganizationId===e)return!0;if(t.OrganizationLinks)for(var i=0;i<t.OrganizationLinks.length;i++)if(t.OrganizationLinks[i].OrganizationId===e)return!0;return!1},reload:function(){this.clearModel(),this.load(),this._autoAddAfterWait=!0},resetUrl:function(t){this.Url!==t&&(this.Url=t,this.reload())},clearModel:function(){this.SerializedIndex="",this.UnusedRecords={},this.RenderedData=[],this.OldestRenderedDate=new Date,this.HasLoadedData=!1,this.HasMoreData=!1,this.hide(),this.$content.trigger("resize",{forceShrink:!0}),this._updateHeaderFooter()},html:function(t,e){this.Components$TemplateComponent$html(t,e),this.SearchString&&this.SearchString.length>0&&$$WPUtil.highlightNodeText(this.$content.get(0),this.SearchString)},afterAppendNewPage:function(t){}},$$WP.Components.CommunityListManagerComponent.extend("Components.TemplateComponent");;
/*! Copyright (c) Epic Systems Corporation 2016-2018 */
var debug_clickedModel;$$WP.$body=$$WP.$body||$afe.select("body"),function WP$Common$ViewBinder$definition(){var e=$$WP.Common.Model,t=$$WP.Common.ModelCollection,o=function WP$Common$ViewBinder(e,t){var o;for(this.WP$Controllers$Controller(),e=e||[],t=t||[],this.proxify("_onDomEventWrapper","_onPropertyChangedWrapper"),this.ViewBinderId=n++,this._eventNames=e.join(" "),this._boundModels={},this._modelId2listenerId={},this._propertyNames={},o=0;o<t.length;o++)this._propertyNames[t[o]]=!0;null!==$$WP.$body&&0===$$WP.$body.length&&($$WP.$body=$afe.select("body")),this.setBindingRoot($$WP.$body)},n=0;o.prototype={ViewBinderId:null,_eventNames:null,_propertyNames:null,_$bindingRoot:null,_boundModels:null,_modelId2listenerId:null,bindModel:function(e){var t;this._boundModels[e.ModelId]||(this._boundModels[e.ModelId]=!0,t=e.addPropertyListener("",this._onPropertyChangedWrapper),this._modelId2listenerId[e.ModelId]=t)},bindAllModels:function(e){for(var t=0;t<e.length;t++)this.bindModel(e[t])},bind:function(e,t){this.bindModel(e),t.safeAttr("data-model-id",e.ModelId),t.safeAttr("data-view-binder-id",this.ViewBinderId)},unbindModel:function(e){this._boundModels[e.ModelId]&&(delete this._boundModels[e.ModelId],e.removePropertyListener(this._modelId2listenerId[e.ModelId]),this.unbindElement(this.getBoundElements(e,this._$bindingRoot)))},unbindElement:function(e){e.removeAttr("data-model-id"),e.removeAttr("data-view-binder-id")},getBoundElements:function(e,t){var o;return t=t||this._$bindingRoot,o='[data-view-binder-id="'+this.ViewBinderId+'"]',void 0!==e&&(o+='[data-model-id="'+e.ModelId+'"]'),t.find(o)},getBoundModels:function(e){var o,n,d;for(n={},o=this.getBoundElements(),d=0;d<o.length;d++)n[$afe.jq(o.get(d)).safeAttr("data-model-id")]=!0;return t.modelIdSet2Array(n)},setBindingRoot:function(e){var t;t='[data-view-binder-id="'+this.ViewBinderId+'"]',null!==this._$bindingRoot&&this._$bindingRoot.off(this._eventNames,t,this._onDomEventWrapper),this._$bindingRoot=e,this._$bindingRoot.on(this._eventNames,t,this._onDomEventWrapper)},syncModelsToDOM:function(){var e,t;for(t=this.getBoundModels(),e=0;e<t.length;e++)this._onSyncModelToDOM(t[e])},_onDomEventWrapper:function(t,o){var n,d,i;i=(n=$afe.jq(t.target).closest('[data-model-id][data-view-binder-id="'+this.ViewBinderId+'"]')).safeAttr("data-model-id"),null===(d=e.getInstance(i))&&"-1"!==i||this._onDomEvent(d,n,t,o)},_onPropertyChangedWrapper:function(e){this._propertyNames[e.propertyName]&&this._onPropertyChanged(e.model,e)},_onPropertyChanged:function(e,t){throw"[ViewBinder] Subclass did not implement the virtual method _onPropertyChanged"},_onSyncModelToDOM:function(e){throw"[ViewBinder] Subclass did not implement the virtual method _onSyncModelToDOM"},_onDomEvent:function(e,t,o){throw"[ViewBinder] Subclass did not implement the virtual method _onDomEvent"}},$$WP.Common=$$WP.Common||{},$$WP.Common.ViewBinder=o,o.extend($$WP.Controllers.Controller,"WP$Common$ViewBinder"),$$WP.Debug.IsEnabled&&$$WP.$body.on("click","[data-model-id]",(function WP$Common$ViewBinder$s_getBoundModelOnClick(t){var o,n;t.ctrlKey&&$$WP.Debug.IsEnabled&&(o=$afe.jq(t.target).closest("[data-model-id]").safeAttr("data-model-id"),null!==(n=e.getInstance(o))&&(debug_clickedModel=n,$$WP.Debug.log("(Ctrl+Click on bound model) Global variable debug_clickedModel set to point at model #"+n.ModelId+" : "+n._constructor._className)))}))}(),$$WP.Debug.UnitTest=$$WP.Debug.UnitTest||{},$$WP.Debug.UnitTest.tests=$$WP.Debug.UnitTest.tests||[],$$WP.Debug.UnitTest.tests.push((function UnitTests$Common$ViewBinder(e){$$WP.Debug.UnitTest.assert}));;
/*0*/